From 936b2b9be7eab00f1e24db3a3ca2bc41218cafb4 Mon Sep 17 00:00:00 2001 From: Shannon Lewis Date: Tue, 6 Dec 2022 10:44:46 +1000 Subject: [PATCH] feat!: Update action to use the native API client --- ...onfig.yml => codeql-config-javascript.yml} | 0 .github/workflows/codeql-analysis.yml | 7 +- .github/workflows/test.yml | 14 +- .prettierignore | 3 +- README.md | 32 +- __tests__/main.test.ts | 38 +- __tests__/test-helpers.ts | 24 + action.yml | 19 +- dist/index.js | 72175 ++++++---------- migration-guide.md | 10 + package-lock.json | 80 +- package.json | 3 +- src/index.ts | 45 +- src/input-parameters.ts | 59 +- src/push-build-information.ts | 82 +- src/test-setup.ts | 5 +- 16 files changed, 26206 insertions(+), 46390 deletions(-) rename .github/codeql/{codeql-config.yml => codeql-config-javascript.yml} (100%) create mode 100644 __tests__/test-helpers.ts create mode 100644 migration-guide.md diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config-javascript.yml similarity index 100% rename from .github/codeql/codeql-config.yml rename to .github/codeql/codeql-config-javascript.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 41023ea..6166341 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -19,6 +19,7 @@ on: branches: [ main ] schedule: - cron: '31 23 * * 6' + workflow_dispatch: jobs: analyze: @@ -46,11 +47,7 @@ jobs: uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} - config-file: ./.github/codeql/codeql-config.yml - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + config-file: ./.github/codeql/codeql-config-${{ matrix.language }}.yml # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0812f89..9f97241 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,16 +1,19 @@ name: 'build-test' on: push: + branches: '**' paths-ignore: - '**/*.md' - schedule: # Daily 5am australian/brisbane time (7pm UTC) - cron: '0 19 * * *' + workflow_dispatch: + env: ADMIN_API_KEY: '${{ secrets.OD_IMAGE_ADMIN_API_KEY }}' SA_PASSWORD: '${{ secrets.DB_IMAGE_SA_PASSWORD }}' SERVER_URL: 'http://localhost:8080' + jobs: test: runs-on: ubuntu-latest @@ -50,7 +53,7 @@ jobs: - name: Compile and run tests env: OCTOPUS_TEST_URL: ${{ env.SERVER_URL }} - OCTOPUS_TEST_APIKEY: ${{ env.ADMIN_API_KEY }} + OCTOPUS_TEST_API_KEY: ${{ env.ADMIN_API_KEY }} run: npm run all - name: Test Report @@ -64,15 +67,14 @@ jobs: - name: Add server url to CORS run: | curl '${{ env.SERVER_URL }}/api/configuration/webportal/values' -X 'PUT' -H 'Content-Type: application/json' -H 'X-Octopus-ApiKey: ${{ env.ADMIN_API_KEY }}' --data-binary '{"Security":{"CorsWhitelist":"http://localhost,${{ env.SERVER_URL }}","ReferrerPolicy":"no-referrer","ContentSecurityPolicyEnabled":true,"HttpStrictTransportSecurityEnabled":false,"HttpStrictTransportSecurityMaxAge":31556926,"XOptions":{"XFrameOptionAllowFrom":null,"XFrameOptions":"None"}}}' -o /dev/null -s -w "%{http_code}\n" - + - name: Push build information to Octopus Deploy uses: ./ env: - OCTOPUS_HOST: ${{ env.SERVER_URL }} + OCTOPUS_URL: ${{ env.SERVER_URL }} OCTOPUS_API_KEY: ${{ env.ADMIN_API_KEY }} - OCTOPUS_SPACE: 'Spaces-1' + OCTOPUS_SPACE: 'Default' with: branch: 'test' packages: 'Testing' version: '1.0.0' - debug: true diff --git a/.prettierignore b/.prettierignore index 2186947..a6bc790 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,4 @@ dist/ lib/ -node_modules/ \ No newline at end of file +node_modules/ +.github/workflows/ \ No newline at end of file diff --git a/README.md b/README.md index c35d274..fb9cf0d 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ Incorporate the following actions in your workflow to push build information to ```yml env: + OCTOPUS_URL: ${{ secrets.OCTOPUS_URL }} # address of Octopus Deploy instance (i.e. https://demo.octopus.app) OCTOPUS_API_KEY: ${{ secrets.OCTOPUS_API_KEY }} # API key used with Octopus Deploy instance - OCTOPUS_HOST: ${{ secrets.OCTOPUS_HOST }} # address of Octopus Deploy instance (i.e. https://demo.octopus.app) - OCTOPUS_SPACE: '' # or you can specify a Space ID + OCTOPUS_SPACE: '' # or you can specify a Space ID steps: - uses: actions/checkout@v2 - name: Push build information to Octopus Deploy 🐙 @@ -32,22 +32,26 @@ steps: version: '' ``` -## 📥 Inputs +## 📥 Environment Variables -The following inputs are required: +| Name | Description | +| :---------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- | +| `OCTOPUS_URL` | The base URL hosting Octopus Deploy (i.e. `https://octopus.example.com`). It is strongly recommended that this value retrieved from a GitHub secret. | +| `OCTOPUS_API_KEY` | The API key used to access Octopus Deploy. It is strongly recommended that this value retrieved from a GitHub secret. | +| `OCTOPUS_SPACE` | The Name of a space within which this command will be executed. | -| Name | Description | Default | -| :--------- | :------------------------------------------------------------------------- | :-----: | -| `packages` | A multi-line list of packages to push build information to Octopus Deploy. | | -| `version` | The version of the package(s). | | +## 📥 Inputs -The following inputs are optional: +| Name | Description | +| :--------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `packages` | A multi-line list of packages to push build information to Octopus Deploy. | +| `version` | The version of the package(s). | +| `branch` | The branch name, if omitted the GitHub ref will be used. | +| `overwrite_mode` | Determines the action to perform with build information if it already exists in the repository. Valid input values are `FailIfExists` (default), `OverwriteExisting`, and `IgnoreIfExists`. | +| `server` | The instance URL hosting Octopus Deploy (i.e. "https://octopus.example.com/"). The instance URL is required, but you may also use the OCTOPUS_URL environment variable. | +| `api_key` | The API key used to access Octopus Deploy. An API key is required, but you may also use the OCTOPUS_API_KEY environment variable. It is strongly recommended that this value retrieved from a GitHub secret. | +| `space` | The name of a space within which this command will be executed. The space name is required, but you may also use the OCTOPUS_SPACE environment variable. | -| Name | Description | Default | -| :--------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------: | -| `branch` | The branch name, if omitted the GitHub ref will be used. | | -| `debug` | Logs the build information data. | `false` | -| `overwrite_mode` | Determines the action to perform with build information if it already exists in the repository. Valid input values are `FailIfExists`, `OverwriteExisting`, and `IgnoreIfExists`. | `FailIfExists` | ## 🤝 Contributions Contributions are welcome! :heart: Please read our [Contributing Guide](.github/CONTRIBUTING.md) for information about how to get involved in this project. diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 5603fbd..cf10589 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -1,21 +1,53 @@ import { context } from '@actions/github' +import { Client, ClientConfiguration, Logger } from '@octopusdeploy/api-client' import * as inputs from '../src/input-parameters' import * as octopus from '../src/push-build-information' +import { CaptureOutput } from './test-helpers' + +const apiClientConfig: ClientConfiguration = { + userAgentApp: 'Test', + apiKey: process.env.OCTOPUS_TEST_API_KEY || 'API-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + instanceURL: process.env.OCTOPUS_TEST_URL || 'http://localhost:8050' +} describe('inputs', () => { it('successfully get input parameters', async () => { - const inputParameters = inputs.get() + const inputParameters = inputs.get(false) expect(inputParameters != undefined) }, 100000) }) describe('build information', () => { it('successfully pushes build information', async () => { - const inputParameters = inputs.get() + const output = new CaptureOutput() + + const logger: Logger = { + debug: message => output.debug(message), + info: message => output.info(message), + warn: message => output.warn(message), + error: (message, err) => { + if (err !== undefined) { + output.error(err.message) + } else { + output.error(message) + } + } + } + + const config: ClientConfiguration = { + userAgentApp: 'Test', + instanceURL: apiClientConfig.instanceURL, + apiKey: apiClientConfig.apiKey, + logging: logger + } + + const client = await Client.create(config) + + const inputParameters = inputs.get(false) const runId = context.runId if (runId === undefined) { throw new Error('GitHub run number is not defined') } - await octopus.pushBuildInformation(runId, inputParameters) + await octopus.pushBuildInformationFromInputs(client, runId, inputParameters) }, 100000) }) diff --git a/__tests__/test-helpers.ts b/__tests__/test-helpers.ts new file mode 100644 index 0000000..ee7cd0d --- /dev/null +++ b/__tests__/test-helpers.ts @@ -0,0 +1,24 @@ +export class CaptureOutput { + msgs: string[] + + constructor() { + this.msgs = [] + } + + debug(message: string): void { + this.msgs.push(`[DEBUG] ${message}`) + } + info(message: string): void { + this.msgs.push(`[INFO] ${message}`) + } + warn(message: string): void { + this.msgs.push(`[WARN] ${message}`) + } + error(message: string): void { + this.msgs.push(`[ERROR] ${message}`) + } + + getAllMessages(): string[] { + return this.msgs + } +} diff --git a/action.yml b/action.yml index 059e750..7bc4487 100644 --- a/action.yml +++ b/action.yml @@ -6,18 +6,21 @@ branding: icon: 'package' inputs: - branch: - description: 'The branch name, if omitted the GitHub ref will be used.' - debug: - default: false - description: 'Enable debug logging.' - overwrite_mode: - default: 'FailIfExists' - description: 'Determines the action to perform with build information if it already exists in the repository. Valid values are "FailIfExists", "OverwriteExisting", and "IgnoreIfExists".' packages: description: 'A multi-line list of packages to push to Octopus Deploy.' version: description: 'The version of the package(s)' + overwrite_mode: + default: 'FailIfExists' + description: 'Determines the action to perform with build information if it already exists in the repository. Valid values are "FailIfExists", "OverwriteExisting", and "IgnoreIfExists".' + branch: + description: 'The branch name, if omitted the GitHub ref will be used.' + api_key: + description: 'The API key used to access Octopus Deploy. You must provide an API key or username and password. If the guest account is enabled, a key of API-GUEST may be used. It is strongly recommended that this value retrieved from a GitHub secret.' + server: + description: 'The base URL hosting Octopus Deploy (i.e. "https://octopus.example.com/"). It is recommended to retrieve this value from an environment variable.' + space: + description: 'The name or ID of a space within which this command will be executed. If omitted, the default space will be used.' runs: using: 'node16' diff --git a/dist/index.js b/dist/index.js index 93399b4..2ddc45e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 87351: +/***/ 7351: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issue = exports.issueCommand = void 0; -const os = __importStar(__nccwpck_require__(22037)); +const os = __importStar(__nccwpck_require__(2037)); const utils_1 = __nccwpck_require__(5278); /** * Commands @@ -100,7 +100,7 @@ function escapeProperty(s) { /***/ }), -/***/ 42186: +/***/ 2186: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -135,12 +135,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(87351); +const command_1 = __nccwpck_require__(7351); const file_command_1 = __nccwpck_require__(717); const utils_1 = __nccwpck_require__(5278); -const os = __importStar(__nccwpck_require__(22037)); -const path = __importStar(__nccwpck_require__(71017)); -const oidc_utils_1 = __nccwpck_require__(98041); +const os = __importStar(__nccwpck_require__(2037)); +const path = __importStar(__nccwpck_require__(1017)); +const oidc_utils_1 = __nccwpck_require__(8041); /** * The code to exit an action */ @@ -425,12 +425,12 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -var summary_1 = __nccwpck_require__(81327); +var summary_1 = __nccwpck_require__(1327); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -var summary_2 = __nccwpck_require__(81327); +var summary_2 = __nccwpck_require__(1327); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports @@ -472,9 +472,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__nccwpck_require__(57147)); -const os = __importStar(__nccwpck_require__(22037)); -const uuid_1 = __nccwpck_require__(75840); +const fs = __importStar(__nccwpck_require__(7147)); +const os = __importStar(__nccwpck_require__(2037)); +const uuid_1 = __nccwpck_require__(5840); const utils_1 = __nccwpck_require__(5278); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -508,7 +508,7 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ }), -/***/ 98041: +/***/ 8041: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -524,9 +524,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(96255); -const auth_1 = __nccwpck_require__(35526); -const core_1 = __nccwpck_require__(42186); +const http_client_1 = __nccwpck_require__(6255); +const auth_1 = __nccwpck_require__(5526); +const core_1 = __nccwpck_require__(2186); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -618,7 +618,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; -const path = __importStar(__nccwpck_require__(71017)); +const path = __importStar(__nccwpck_require__(1017)); /** * toPosixPath converts the given path to the posix form. On Windows, \\ will be * replaced with /. @@ -657,7 +657,7 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -/***/ 81327: +/***/ 1327: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -673,8 +673,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; -const os_1 = __nccwpck_require__(22037); -const fs_1 = __nccwpck_require__(57147); +const os_1 = __nccwpck_require__(2037); +const fs_1 = __nccwpck_require__(7147); const { access, appendFile, writeFile } = fs_1.promises; exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; @@ -994,15 +994,15 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 74087: +/***/ 4087: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Context = void 0; -const fs_1 = __nccwpck_require__(57147); -const os_1 = __nccwpck_require__(22037); +const fs_1 = __nccwpck_require__(7147); +const os_1 = __nccwpck_require__(2037); class Context { /** * Hydrate the context from the environment @@ -1055,7 +1055,7 @@ exports.Context = Context; /***/ }), -/***/ 95438: +/***/ 5438: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1081,8 +1081,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOctokit = exports.context = void 0; -const Context = __importStar(__nccwpck_require__(74087)); -const utils_1 = __nccwpck_require__(73030); +const Context = __importStar(__nccwpck_require__(4087)); +const utils_1 = __nccwpck_require__(3030); exports.context = new Context.Context(); /** * Returns a hydrated octokit ready to use for GitHub Actions @@ -1099,7 +1099,7 @@ exports.getOctokit = getOctokit; /***/ }), -/***/ 47914: +/***/ 7914: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1125,7 +1125,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0; -const httpClient = __importStar(__nccwpck_require__(96255)); +const httpClient = __importStar(__nccwpck_require__(6255)); function getAuthString(token, options) { if (!token && !options.auth) { throw new Error('Parameter token or opts.auth is required'); @@ -1149,7 +1149,7 @@ exports.getApiBaseUrl = getApiBaseUrl; /***/ }), -/***/ 73030: +/***/ 3030: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1175,12 +1175,12 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0; -const Context = __importStar(__nccwpck_require__(74087)); -const Utils = __importStar(__nccwpck_require__(47914)); +const Context = __importStar(__nccwpck_require__(4087)); +const Utils = __importStar(__nccwpck_require__(7914)); // octokit + plugins -const core_1 = __nccwpck_require__(18525); -const plugin_rest_endpoint_methods_1 = __nccwpck_require__(83044); -const plugin_paginate_rest_1 = __nccwpck_require__(64193); +const core_1 = __nccwpck_require__(8525); +const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044); +const plugin_paginate_rest_1 = __nccwpck_require__(4193); exports.context = new Context.Context(); const baseUrl = Utils.getApiBaseUrl(); exports.defaults = { @@ -1210,7 +1210,7 @@ exports.getOctokitOptions = getOctokitOptions; /***/ }), -/***/ 40673: +/***/ 673: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -1273,7 +1273,7 @@ exports.createTokenAuth = createTokenAuth; /***/ }), -/***/ 18525: +/***/ 8525: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1281,11 +1281,11 @@ exports.createTokenAuth = createTokenAuth; Object.defineProperty(exports, "__esModule", ({ value: true })); -var universalUserAgent = __nccwpck_require__(45030); -var beforeAfterHook = __nccwpck_require__(83682); -var request = __nccwpck_require__(89353); -var graphql = __nccwpck_require__(86422); -var authToken = __nccwpck_require__(40673); +var universalUserAgent = __nccwpck_require__(5030); +var beforeAfterHook = __nccwpck_require__(3682); +var request = __nccwpck_require__(9353); +var graphql = __nccwpck_require__(6422); +var authToken = __nccwpck_require__(673); function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; @@ -1457,7 +1457,7 @@ exports.Octokit = Octokit; /***/ }), -/***/ 38713: +/***/ 8713: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1465,8 +1465,8 @@ exports.Octokit = Octokit; Object.defineProperty(exports, "__esModule", ({ value: true })); -var isPlainObject = __nccwpck_require__(63287); -var universalUserAgent = __nccwpck_require__(45030); +var isPlainObject = __nccwpck_require__(3287); +var universalUserAgent = __nccwpck_require__(5030); function lowercaseKeys(object) { if (!object) { @@ -1855,7 +1855,7 @@ exports.endpoint = endpoint; /***/ }), -/***/ 86422: +/***/ 6422: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1863,8 +1863,8 @@ exports.endpoint = endpoint; Object.defineProperty(exports, "__esModule", ({ value: true })); -var request = __nccwpck_require__(89353); -var universalUserAgent = __nccwpck_require__(45030); +var request = __nccwpck_require__(9353); +var universalUserAgent = __nccwpck_require__(5030); const VERSION = "4.8.0"; @@ -1981,7 +1981,7 @@ exports.withCustomRequest = withCustomRequest; /***/ }), -/***/ 37471: +/***/ 7471: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1991,7 +1991,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var deprecation = __nccwpck_require__(58932); +var deprecation = __nccwpck_require__(8932); var once = _interopDefault(__nccwpck_require__(1223)); const logOnceCode = once(deprecation => console.warn(deprecation)); @@ -2063,7 +2063,7 @@ exports.RequestError = RequestError; /***/ }), -/***/ 89353: +/***/ 9353: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -2073,11 +2073,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var endpoint = __nccwpck_require__(38713); -var universalUserAgent = __nccwpck_require__(45030); -var isPlainObject = __nccwpck_require__(63287); -var nodeFetch = _interopDefault(__nccwpck_require__(80467)); -var requestError = __nccwpck_require__(37471); +var endpoint = __nccwpck_require__(8713); +var universalUserAgent = __nccwpck_require__(5030); +var isPlainObject = __nccwpck_require__(3287); +var nodeFetch = _interopDefault(__nccwpck_require__(467)); +var requestError = __nccwpck_require__(7471); const VERSION = "5.6.3"; @@ -2248,7 +2248,7 @@ exports.request = request; /***/ }), -/***/ 35526: +/***/ 5526: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -2336,7 +2336,7 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -/***/ 96255: +/***/ 6255: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2372,10 +2372,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; -const http = __importStar(__nccwpck_require__(13685)); -const https = __importStar(__nccwpck_require__(95687)); -const pm = __importStar(__nccwpck_require__(19835)); -const tunnel = __importStar(__nccwpck_require__(74294)); +const http = __importStar(__nccwpck_require__(3685)); +const https = __importStar(__nccwpck_require__(5687)); +const pm = __importStar(__nccwpck_require__(9835)); +const tunnel = __importStar(__nccwpck_require__(4294)); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -2948,7 +2948,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -/***/ 19835: +/***/ 9835: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -3016,7 +3016,7 @@ exports.checkBypass = checkBypass; /***/ }), -/***/ 64193: +/***/ 4193: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -3229,7 +3229,7 @@ exports.paginatingEndpoints = paginatingEndpoints; /***/ }), -/***/ 83044: +/***/ 3044: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -4344,7 +4344,7 @@ exports.restEndpointMethods = restEndpointMethods; /***/ }), -/***/ 40937: +/***/ 937: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -4363,7 +4363,7 @@ exports.AdapterError = AdapterError; /***/ }), -/***/ 49018: +/***/ 9018: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -4409,8 +4409,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AxiosAdapter = void 0; -var axios_1 = __importDefault(__nccwpck_require__(96545)); -var adapter_1 = __nccwpck_require__(40937); +var axios_1 = __importDefault(__nccwpck_require__(6545)); +var adapter_1 = __nccwpck_require__(937); var AxiosAdapter = /** @class */ (function () { function AxiosAdapter() { } @@ -4430,13 +4430,13 @@ var AxiosAdapter = /** @class */ (function () { } return message; } - var config, response, error_1; + var config, userAgent, response, error_1; return __generator(this, function (_c) { switch (_c.label) { case 0: _c.trys.push([0, 2, , 3]); config = { - httpsAgent: options.configuration.agent, + httpsAgent: options.configuration.httpsAgent, url: options.url, method: options.method, data: options.requestBody, @@ -4447,7 +4447,11 @@ var AxiosAdapter = /** @class */ (function () { }; if (typeof XMLHttpRequest === "undefined") { if (config.headers) { - config.headers["User-Agent"] = "ts-octopusdeploy"; + userAgent = "ts-octopusdeploy"; + if (options.configuration.userAgentApp) { + userAgent = "".concat(userAgent, " ").concat(options.configuration.userAgentApp); + } + config.headers["User-Agent"] = userAgent; } } return [4 /*yield*/, axios_1.default.request(config)]; @@ -4478,7 +4482,7 @@ exports.AxiosAdapter = AxiosAdapter; /***/ }), -/***/ 51542: +/***/ 1542: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -4520,15 +4524,16 @@ var __generator = (this && this.__generator) || function (thisArg, body) { } }; Object.defineProperty(exports, "__esModule", ({ value: true })); -var message_contracts_1 = __nccwpck_require__(74561); -var adapter_1 = __nccwpck_require__(40937); -var axiosAdapter_1 = __nccwpck_require__(49018); +var octopusError_1 = __nccwpck_require__(408); +var adapter_1 = __nccwpck_require__(937); +var axiosAdapter_1 = __nccwpck_require__(9018); var ApiClient = /** @class */ (function () { function ApiClient(options) { var _this = this; this.handleSuccess = function (response) { if (_this.options.onResponseCallback) { var details = { + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/consistent-type-assertions method: _this.options.method, url: _this.options.url, statusCode: response.statusCode, @@ -4537,6 +4542,7 @@ var ApiClient = /** @class */ (function () { } var responseText = ""; if (_this.options.raw) { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions responseText = response.data; } else { @@ -4551,6 +4557,7 @@ var ApiClient = /** @class */ (function () { var err = generateOctopusError(requestError); if (_this.options.onErrorResponseCallback) { var details = { + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/consistent-type-assertions method: _this.options.method, url: _this.options.url, statusCode: err.StatusCode, @@ -4596,26 +4603,30 @@ var ApiClient = /** @class */ (function () { return ApiClient; }()); exports["default"] = ApiClient; -var deserialize = function (responseText, raw, forceJson) { - if (forceJson === void 0) { forceJson = false; } - if (raw && !forceJson) - return responseText; - if (responseText && responseText.length) - return JSON.parse(responseText); - return null; -}; var generateOctopusError = function (requestError) { if (requestError.code) { var code = requestError.code; - return new message_contracts_1.OctopusError(code, requestError.message); + return new octopusError_1.OctopusError(code, requestError.message); } - return new message_contracts_1.OctopusError(0, requestError.message); + return new octopusError_1.OctopusError(0, requestError.message); }; /***/ }), -/***/ 63024: +/***/ 7083: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.apiLocation = void 0; +exports.apiLocation = "~/api"; + + +/***/ }), + +/***/ 3024: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -4717,7 +4728,7 @@ exports["default"] = Caching; /***/ }), -/***/ 42399: +/***/ 2399: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -4774,21 +4785,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Client = void 0; -var apiClient_1 = __importDefault(__nccwpck_require__(51542)); -var clientConfiguration_1 = __nccwpck_require__(5966); -var environment_1 = __importDefault(__nccwpck_require__(96050)); -var resolver_1 = __nccwpck_require__(28043); -var subscriptionRecord_1 = __nccwpck_require__(31547); -var apiLocation = "~/api"; +var apiClient_1 = __importDefault(__nccwpck_require__(1542)); +var resolver_1 = __nccwpck_require__(8043); +var subscriptionRecord_1 = __nccwpck_require__(1547); +var spaceScopedOperation_1 = __nccwpck_require__(3667); +var spaceResolver_1 = __nccwpck_require__(2054); +var spaceScopedArgs_1 = __nccwpck_require__(5626); +var spaceScopedRequest_1 = __nccwpck_require__(3295); +var apiLocation_1 = __nccwpck_require__(7083); // The Octopus Client implements the low-level semantics of the Octopus Deploy REST API var Client = /** @class */ (function () { - function Client(session, resolver, rootDocument, spaceId, spaceRootDocument, configuration) { + function Client(resolver, configuration) { var _this = this; - this.session = session; this.resolver = resolver; - this.rootDocument = rootDocument; - this.spaceId = spaceId; - this.spaceRootDocument = spaceRootDocument; this.configuration = configuration; this.requestSubscriptions = new subscriptionRecord_1.SubscriptionRecord(); this.responseSubscriptions = new subscriptionRecord_1.SubscriptionRecord(); @@ -4829,149 +4838,38 @@ var Client = /** @class */ (function () { }; this.resolve = function (path, uriTemplateParameters) { return _this.resolver.resolve(path, uriTemplateParameters); }; this.configuration = configuration; - this.logger = __assign({ - debug: function (message) { return console.debug(message); }, - info: function (message) { return console.info(message); }, - warn: function (message) { return console.warn(message); }, - error: function (message, err) { - if (err !== undefined) { - console.error(err.message); - } - else { - console.error(message); - } - }, - }, configuration.logging); + this.logger = configuration.logging || { + debug: function (message) { return null; }, + info: function (message) { return null; }, + warn: function (message) { return null; }, + error: function (message, err) { return null; }, + }; this.resolver = resolver; - this.rootDocument = rootDocument; - this.spaceRootDocument = spaceRootDocument; } Client.create = function (configuration) { return __awaiter(this, void 0, void 0, function () { - var resolver, client, error_1, error_2; + var resolver, client; return __generator(this, function (_a) { switch (_a.label) { case 0: - configuration = (0, clientConfiguration_1.processConfiguration)(configuration); - if (!configuration.apiUri) { + if (!configuration.instanceURL) { throw new Error("The host is not specified"); } - resolver = new resolver_1.Resolver(configuration.apiUri); - client = new Client(null, resolver, null, null, null, configuration); - if (!configuration.autoConnect) return [3 /*break*/, 8]; - _a.label = 1; + resolver = new resolver_1.Resolver(configuration.instanceURL); + client = new Client(resolver, configuration); + return [4 /*yield*/, client.getServerInformation()]; case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, client.connect(function (message, error) { - client.debug("Attempting to connect to API endpoint..."); - })]; - case 2: - _a.sent(); - return [3 /*break*/, 4]; - case 3: - error_1 = _a.sent(); - if (error_1 instanceof Error) - client.error("Could not connect", error_1); - throw error_1; - case 4: - if (!(configuration.space !== undefined && configuration.space !== "")) return [3 /*break*/, 8]; - _a.label = 5; - case 5: - _a.trys.push([5, 7, , 8]); - return [4 /*yield*/, client.switchToSpace(configuration.space)]; - case 6: _a.sent(); - return [3 /*break*/, 8]; - case 7: - error_2 = _a.sent(); - if (error_2 instanceof Error) - client.error("Could not switch to space", error_2); - throw error_2; - case 8: return [2 /*return*/, client]; - } - }); - }); - }; - Client.prototype.connect = function (progressCallback) { - var _this = this; - progressCallback("Checking credentials..."); - return new Promise(function (resolve, reject) { - if (_this.rootDocument) { - resolve(); - return; - } - var attempt = function (success, fail) { - _this.get(apiLocation).then(function (root) { - success(root); - }, fail); - }; - var onSuccess = function (root) { - _this.rootDocument = root; - resolve(); - }; - var onFail = function (err) { - progressCallback("Unable to connect.", err); - reject(err); - }; - attempt(onSuccess, onFail); - }); - }; - Client.prototype.disconnect = function () { - this.rootDocument = null; - this.spaceId = null; - this.spaceRootDocument = null; - }; - Client.prototype.forSpace = function (spaceId) { - return __awaiter(this, void 0, void 0, function () { - var spaceRootResource; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.get(this.rootDocument.Links["SpaceHome"], { spaceId: spaceId })]; - case 1: - spaceRootResource = _a.sent(); - return [2 /*return*/, new Client(this.session, this.resolver, this.rootDocument, spaceId, spaceRootResource, this.configuration)]; + return [2 /*return*/, client]; } }); }); }; - Client.prototype.forSystem = function () { - return new Client(this.session, this.resolver, this.rootDocument, null, null, this.configuration); - }; - Client.prototype.switchToSpace = function (spaceIdOrName) { - return __awaiter(this, void 0, void 0, function () { - var spaceList, uppercaseSpaceIdOrName, spaceResources, spaceResource, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (this.rootDocument === null) { - throw new Error("Root document is null; this document is required for the API client. Please ensure that the API endpoint is accessible along with its root document."); - } - return [4 /*yield*/, this.get(this.rootDocument.Links["Spaces"])]; - case 1: - spaceList = _b.sent(); - uppercaseSpaceIdOrName = spaceIdOrName.toUpperCase(); - spaceResources = spaceList.Items.filter(function (s) { return s.Name.toUpperCase() === uppercaseSpaceIdOrName || s.Id.toUpperCase() === uppercaseSpaceIdOrName; }); - if (!(spaceResources.length == 1)) return [3 /*break*/, 3]; - spaceResource = spaceResources[0]; - this.spaceId = spaceResource.Id; - _a = this; - return [4 /*yield*/, this.get(spaceResource.Links["SpaceHome"])]; - case 2: - _a.spaceRootDocument = _b.sent(); - return [2 /*return*/]; - case 3: throw new Error("Unable to uniquely identify a space using '".concat(spaceIdOrName, "'.")); - } - }); - }); - }; - Client.prototype.switchToSystem = function () { - this.spaceId = null; - this.spaceRootDocument = null; - }; Client.prototype.get = function (path, args) { if (path === undefined) - return {}; - var url = this.resolveUrlWithSpaceId(path, args); + throw new Error("path parameter was not"); + var url = this.resolveUrl(path, args); + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions return this.dispatchRequest("GET", url); }; Client.prototype.getRaw = function (path, args) { @@ -4980,14 +4878,11 @@ var Client = /** @class */ (function () { return new Promise(function (resolve, reject) { new apiClient_1.default({ configuration: _this.configuration, - session: _this.session, url: url, method: "GET", error: function (e) { return reject(e); }, raw: true, success: function (data) { return resolve(data); }, - tryGetServerInformation: function () { return _this.tryGetServerInformation(); }, - getAntiForgeryTokenCallback: function () { return _this.getAntiforgeryToken(); }, onRequestCallback: function (r) { return _this.onRequest(r); }, onResponseCallback: function (r) { return _this.onResponse(r); }, onErrorResponseCallback: function (r) { return _this.onErrorResponse(r); }, @@ -5028,156 +4923,148 @@ var Client = /** @class */ (function () { } this.errorSubscriptions.notifyAll(details); }; - Client.prototype.post = function (path, resource, args) { - var url = this.resolveUrlWithSpaceId(path, args); - return this.dispatchRequest("POST", url, resource); + Client.prototype.doCreate = function (path, command, args) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, this.doCommand("POST", path, command, args)]; + }); + }); }; - Client.prototype.create = function (path, resource, args) { - var _this = this; - var url = this.resolve(path, args); - return new Promise(function (resolve, reject) { - _this.dispatchRequest("POST", url, resource).then(function (result) { - var _a; - var selfLink = (_a = result.Links) === null || _a === void 0 ? void 0 : _a.Self; - if (selfLink) { - var result2 = _this.get(selfLink); - resolve(result2); - return; - } - resolve(result); - }, reject); + Client.prototype.doUpdate = function (path, command, args) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, this.doCommand("PUT", path, command, args)]; + }); }); }; - Client.prototype.update = function (path, resource, args) { - var _this = this; - var url = this.resolve(path, args); - return new Promise(function (resolve, reject) { - _this.dispatchRequest("PUT", url, resource).then(function (result) { - var _a; - var selfLink = (_a = result.Links) === null || _a === void 0 ? void 0 : _a.Self; - if (selfLink) { - var result2 = _this.get(selfLink); - resolve(result2); - return; + Client.prototype.doCommand = function (verb, path, command, args) { + return __awaiter(this, void 0, void 0, function () { + var spaceId, spaceId, url; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(0, spaceScopedOperation_1.isSpaceScopedOperation)(command)) return [3 /*break*/, 2]; + return [4 /*yield*/, (0, spaceResolver_1.resolveSpaceId)(this, command.spaceName)]; + case 1: + spaceId = _a.sent(); + args = __assign({ spaceId: spaceId }, args); + command = __assign({ spaceId: spaceId }, command); + _a.label = 2; + case 2: + if (!(args && (0, spaceScopedArgs_1.isSpaceScopedArgs)(args))) return [3 /*break*/, 4]; + return [4 /*yield*/, (0, spaceResolver_1.resolveSpaceId)(this, args.spaceName)]; + case 3: + spaceId = _a.sent(); + args = __assign({ spaceId: spaceId }, args); + _a.label = 4; + case 4: + url = this.resolveUrl(path, args); + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return [2 /*return*/, this.dispatchRequest(verb, url, command)]; } - resolve(result); - }, reject); + }); }); }; - Client.prototype.del = function (path, resource, args) { - var url = this.resolve(path, args); - return this.dispatchRequest("DELETE", url, resource); + Client.prototype.request = function (path, request) { + return __awaiter(this, void 0, void 0, function () { + var spaceId, url; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(0, spaceScopedRequest_1.isSpaceScopedRequest)(request)) return [3 /*break*/, 2]; + return [4 /*yield*/, (0, spaceResolver_1.resolveSpaceId)(this, request.spaceName)]; + case 1: + spaceId = _a.sent(); + request = __assign({ spaceId: spaceId }, request); + _a.label = 2; + case 2: + url = this.resolveUrl(path, request); + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return [2 /*return*/, this.dispatchRequest("GET", url, null)]; + } + }); + }); }; - Client.prototype.put = function (path, resource, args) { - var url = this.resolveUrlWithSpaceId(path, args); - return this.dispatchRequest("PUT", url, resource); + Client.prototype.post = function (path, resource, args) { + var url = this.resolveUrl(path, args); + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return this.dispatchRequest("POST", url, resource); }; - Client.prototype.getAntiforgeryToken = function () { - if (!this.isConnected()) { - return null; - } - var installationId = this.getGlobalRootDocument().InstallationId; - if (!installationId) { - return null; - } - // If we have come this far we know we are on a version of Octopus Server which supports anti-forgery tokens - var antiforgeryCookieName = "Octopus-Csrf-Token_" + installationId; - var antiforgeryCookies = document.cookie - .split(";") - .filter(function (c) { - return c.trim().indexOf(antiforgeryCookieName) === 0; - }) - .map(function (c) { - return c.trim(); + Client.prototype.del = function (path, args) { + return __awaiter(this, void 0, void 0, function () { + var spaceId, url; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(args && (0, spaceScopedArgs_1.isSpaceScopedArgs)(args))) return [3 /*break*/, 2]; + return [4 /*yield*/, (0, spaceResolver_1.resolveSpaceId)(this, args.spaceName)]; + case 1: + spaceId = _a.sent(); + args = __assign({ spaceId: spaceId }, args); + _a.label = 2; + case 2: + url = this.resolve(path, args); + return [2 /*return*/, this.dispatchRequest("DELETE", url, undefined)]; + } + }); }); - if (antiforgeryCookies && antiforgeryCookies.length === 1) { - var antiforgeryToken = antiforgeryCookies[0].split("=")[1]; - return antiforgeryToken; - } - else { - if (environment_1.default.isInDevelopmentMode()) { - return "FAKE TOKEN USED FOR DEVELOPMENT"; - } - return null; - } - }; - Client.prototype.resolveLinkTemplate = function (link, args) { - return this.resolve(this.getLink(link), args); }; Client.prototype.getServerInformation = function () { - if (!this.isConnected()) { - throw new Error("The Octopus Client has not connected. THIS SHOULD NOT HAPPEN! Please notify support."); - } - return { - version: this.rootDocument.Version, - }; + return __awaiter(this, void 0, void 0, function () { + var _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!!this.serverInformation) return [3 /*break*/, 2]; + _a = this; + return [4 /*yield*/, this.tryGetServerInformation()]; + case 1: + _a.serverInformation = _b.sent(); + if (!this.serverInformation) { + throw new Error("The Octopus server information could not be retrieved. Please check the configured URL."); + } + _b.label = 2; + case 2: return [2 /*return*/, this.serverInformation]; + } + }); + }); }; Client.prototype.tryGetServerInformation = function () { - return this.rootDocument - ? { - version: this.rootDocument.Version, - installationId: this.rootDocument.InstallationId, - } - : null; - }; - Client.prototype.throwIfClientNotConnected = function () { - if (!this.isConnected()) { - var errorMessage = "Can't get the link from the client, because the client has not yet been connected."; - throw new Error(errorMessage); - } - }; - Client.prototype.getSystemLink = function (linkGetter) { - this.throwIfClientNotConnected(); - var link = linkGetter(this.rootDocument.Links); - if (link === null) { - var errorMessage = "Can't get the link for ".concat(name, " from the client, because it could not be found in the root document."); - throw new Error(errorMessage); - } - return link; - }; - Client.prototype.getLink = function (name) { - this.throwIfClientNotConnected(); - var spaceLinkExists = this.spaceRootDocument && this.spaceRootDocument.Links !== undefined && this.spaceRootDocument.Links[name]; - var link = spaceLinkExists ? this.spaceRootDocument.Links[name] : this.rootDocument.Links[name]; - if (!link) { - var errorMessage = "Can't get the link for ".concat(name, " from the client, because it could not be found in the root document or the space root document."); - throw new Error(errorMessage); - } - return link; + return __awaiter(this, void 0, void 0, function () { + var rootDocument; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.get(apiLocation_1.apiLocation)]; + case 1: + rootDocument = _a.sent(); + return [2 /*return*/, rootDocument + ? { + version: rootDocument.Version, + installationId: rootDocument.InstallationId, + } + : null]; + } + }); + }); }; Client.prototype.dispatchRequest = function (method, url, requestBody) { var _this = this; return new Promise(function (resolve, reject) { new apiClient_1.default({ configuration: _this.configuration, - session: _this.session, error: function (e) { return reject(e); }, method: method, url: url, requestBody: requestBody, success: function (data) { return resolve(data); }, - tryGetServerInformation: function () { return _this.tryGetServerInformation(); }, - getAntiForgeryTokenCallback: function () { return _this.getAntiforgeryToken(); }, onRequestCallback: function (r) { return _this.onRequest(r); }, onResponseCallback: function (r) { return _this.onResponse(r); }, onErrorResponseCallback: function (r) { return _this.onErrorResponse(r); }, }).execute(); }); }; - Client.prototype.isConnected = function () { - return this.rootDocument !== null; - }; - Client.prototype.getArgsWithSpaceId = function (args) { - return this.spaceId ? __assign({ spaceId: this.spaceId }, args) : args; - }; - Client.prototype.getGlobalRootDocument = function () { - if (!this.isConnected()) { - throw new Error("The Octopus Client has not connected."); - } - return this.rootDocument; - }; - Client.prototype.resolveUrlWithSpaceId = function (path, args) { - return this.resolve(path, this.getArgsWithSpaceId(args)); + Client.prototype.resolveUrl = function (path, args) { + return this.resolve(path, args); }; return Client; }()); @@ -5187,38 +5074,6 @@ exports.Client = Client; /***/ }), /***/ 5966: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.processConfiguration = void 0; -var environmentVariables_1 = __nccwpck_require__(48583); -function processConfiguration(configuration) { - var apiKey = process.env[environmentVariables_1.EnvironmentVariables.ApiKey] || ""; - var host = process.env[environmentVariables_1.EnvironmentVariables.Host] || ""; - var space = process.env[environmentVariables_1.EnvironmentVariables.Space] || ""; - if (!configuration) { - return { - apiKey: apiKey, - apiUri: host, - autoConnect: true, - space: space, - }; - } - return { - apiKey: !configuration.apiKey || configuration.apiKey.length === 0 ? apiKey : configuration.apiKey, - apiUri: !configuration.apiUri || configuration.apiUri.length === 0 ? host : configuration.apiUri, - autoConnect: configuration.autoConnect === undefined ? true : configuration.autoConnect, - space: !configuration.space || configuration.space.length === 0 ? space : configuration.space, - }; -} -exports.processConfiguration = processConfiguration; - - -/***/ }), - -/***/ 92101: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -5228,7 +5083,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 57948: +/***/ 2101: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -5238,7 +5093,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 16397: +/***/ 7948: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -5248,7 +5103,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 35758: +/***/ 6397: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -5258,32 +5113,17 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 45953: +/***/ 5758: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ClientSession = void 0; -var ClientSession = /** @class */ (function () { - function ClientSession(cache, isAuthenticated, endSession) { - var _this = this; - this.cache = cache; - this.isAuthenticated = isAuthenticated; - this.endSession = endSession; - this.end = function () { - _this.endSession(); - _this.cache.clearAll(); - }; - } - return ClientSession; -}()); -exports.ClientSession = ClientSession; /***/ }), -/***/ 96050: +/***/ 6050: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -5302,175 +5142,100 @@ exports["default"] = Environment; /***/ }), -/***/ 48583: +/***/ 661: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EnvironmentVariables = void 0; -exports.EnvironmentVariables = { - ApiKey: "OCTOPUS_API_KEY", - Host: "OCTOPUS_HOST", - Proxy: "OCTOPUS_PROXY", - ProxyPassword: "OCTOPUS_PROXY_PASSWORD", - ProxyUsername: "OCTOPUS_PROXY_USERNAME", - Space: "OCTOPUS_SPACE", -}; /***/ }), -/***/ 30661: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 80586: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 2966: +/***/ (function(__unused_webpack_module, exports) { "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +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 })); -__exportStar(__nccwpck_require__(51542), exports); -__exportStar(__nccwpck_require__(63024), exports); -__exportStar(__nccwpck_require__(42399), exports); -__exportStar(__nccwpck_require__(5966), exports); -__exportStar(__nccwpck_require__(92101), exports); -__exportStar(__nccwpck_require__(57948), exports); -__exportStar(__nccwpck_require__(16397), exports); -__exportStar(__nccwpck_require__(35758), exports); -__exportStar(__nccwpck_require__(45953), exports); -__exportStar(__nccwpck_require__(96050), exports); -__exportStar(__nccwpck_require__(48583), exports); -__exportStar(__nccwpck_require__(30661), exports); -__exportStar(__nccwpck_require__(5924), exports); -__exportStar(__nccwpck_require__(77085), exports); -__exportStar(__nccwpck_require__(9507), exports); -__exportStar(__nccwpck_require__(67895), exports); -__exportStar(__nccwpck_require__(89463), exports); -__exportStar(__nccwpck_require__(42583), exports); -__exportStar(__nccwpck_require__(15835), exports); -__exportStar(__nccwpck_require__(7946), exports); -__exportStar(__nccwpck_require__(4776), exports); -__exportStar(__nccwpck_require__(41266), exports); -__exportStar(__nccwpck_require__(94659), exports); -__exportStar(__nccwpck_require__(94203), exports); -__exportStar(__nccwpck_require__(69039), exports); -__exportStar(__nccwpck_require__(13497), exports); -__exportStar(__nccwpck_require__(66446), exports); -__exportStar(__nccwpck_require__(20009), exports); -__exportStar(__nccwpck_require__(81630), exports); -__exportStar(__nccwpck_require__(82773), exports); -__exportStar(__nccwpck_require__(91848), exports); -__exportStar(__nccwpck_require__(98936), exports); -__exportStar(__nccwpck_require__(27848), exports); -__exportStar(__nccwpck_require__(8183), exports); -__exportStar(__nccwpck_require__(65269), exports); -__exportStar(__nccwpck_require__(22999), exports); -__exportStar(__nccwpck_require__(4387), exports); -__exportStar(__nccwpck_require__(55459), exports); -__exportStar(__nccwpck_require__(56116), exports); -__exportStar(__nccwpck_require__(20037), exports); -__exportStar(__nccwpck_require__(18029), exports); -__exportStar(__nccwpck_require__(90977), exports); -__exportStar(__nccwpck_require__(15228), exports); -__exportStar(__nccwpck_require__(78681), exports); -__exportStar(__nccwpck_require__(64693), exports); -__exportStar(__nccwpck_require__(51916), exports); -__exportStar(__nccwpck_require__(56946), exports); -__exportStar(__nccwpck_require__(3522), exports); -__exportStar(__nccwpck_require__(154), exports); -__exportStar(__nccwpck_require__(53015), exports); -__exportStar(__nccwpck_require__(50197), exports); -__exportStar(__nccwpck_require__(1939), exports); -__exportStar(__nccwpck_require__(94772), exports); -__exportStar(__nccwpck_require__(80891), exports); -__exportStar(__nccwpck_require__(34819), exports); -__exportStar(__nccwpck_require__(53378), exports); -__exportStar(__nccwpck_require__(21797), exports); -__exportStar(__nccwpck_require__(97886), exports); -__exportStar(__nccwpck_require__(53127), exports); -// export * from "./repositories/projectContextRepository"; -__exportStar(__nccwpck_require__(38331), exports); -__exportStar(__nccwpck_require__(52058), exports); -__exportStar(__nccwpck_require__(91795), exports); -__exportStar(__nccwpck_require__(57502), exports); -__exportStar(__nccwpck_require__(7358), exports); -__exportStar(__nccwpck_require__(87252), exports); -__exportStar(__nccwpck_require__(11050), exports); -__exportStar(__nccwpck_require__(82404), exports); -__exportStar(__nccwpck_require__(18312), exports); -__exportStar(__nccwpck_require__(30242), exports); -__exportStar(__nccwpck_require__(73544), exports); -__exportStar(__nccwpck_require__(63767), exports); -__exportStar(__nccwpck_require__(18774), exports); -__exportStar(__nccwpck_require__(96489), exports); -__exportStar(__nccwpck_require__(84463), exports); -__exportStar(__nccwpck_require__(50924), exports); -__exportStar(__nccwpck_require__(7025), exports); -__exportStar(__nccwpck_require__(56836), exports); -__exportStar(__nccwpck_require__(94178), exports); -__exportStar(__nccwpck_require__(50450), exports); -__exportStar(__nccwpck_require__(53573), exports); -__exportStar(__nccwpck_require__(30986), exports); -__exportStar(__nccwpck_require__(66168), exports); -__exportStar(__nccwpck_require__(54198), exports); -__exportStar(__nccwpck_require__(19652), exports); -__exportStar(__nccwpck_require__(99284), exports); -__exportStar(__nccwpck_require__(67597), exports); -__exportStar(__nccwpck_require__(41025), exports); -__exportStar(__nccwpck_require__(27747), exports); -__exportStar(__nccwpck_require__(10895), exports); -__exportStar(__nccwpck_require__(74126), exports); -__exportStar(__nccwpck_require__(72887), exports); -__exportStar(__nccwpck_require__(50210), exports); -__exportStar(__nccwpck_require__(65737), exports); -__exportStar(__nccwpck_require__(91616), exports); -__exportStar(__nccwpck_require__(43399), exports); -__exportStar(__nccwpck_require__(871), exports); -__exportStar(__nccwpck_require__(15435), exports); -__exportStar(__nccwpck_require__(28043), exports); -__exportStar(__nccwpck_require__(82138), exports); -__exportStar(__nccwpck_require__(60232), exports); -__exportStar(__nccwpck_require__(445), exports); -__exportStar(__nccwpck_require__(31547), exports); -__exportStar(__nccwpck_require__(54663), exports); -__exportStar(__nccwpck_require__(47132), exports); - - -/***/ }), - -/***/ 5924: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BasicRepository = void 0; +// Repositories provide a helpful abstraction around the Octopus Deploy API +var BasicRepository = /** @class */ (function () { + function BasicRepository(client, baseApiPathTemplate, listParametersTemplate) { + var _this = this; + this.takeAll = 2147483647; + this.takeDefaultPageSize = 30; + this.notifySubscribersToDataModifications = function (resource) { + Object.keys(_this.subscribersToDataModifications).forEach(function (key) { return _this.subscribersToDataModifications[key](resource); }); + return resource; + }; + this.client = client; + this.baseApiPathTemplate = baseApiPathTemplate; + this.listParametersTemplate = listParametersTemplate; + this.subscribersToDataModifications = {}; + } + BasicRepository.prototype.del = function (resource) { + var _this = this; + return this.client.del("".concat(this.baseApiPathTemplate, "/").concat(resource.Id)).then(function (d) { return _this.notifySubscribersToDataModifications(resource); }); + }; + BasicRepository.prototype.create = function (resource, args) { + var _this = this; + return this.client.doCreate(this.baseApiPathTemplate, resource, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); + }; + BasicRepository.prototype.get = function (id) { + return this.client.get("".concat(this.baseApiPathTemplate, "/").concat(id)); + }; + BasicRepository.prototype.list = function (args) { + return this.client.request("".concat(this.baseApiPathTemplate, "{?").concat(this.listParametersTemplate, "}"), args); + }; + BasicRepository.prototype.modify = function (resource, args) { + var _this = this; + return this.client + .doUpdate("".concat(this.baseApiPathTemplate, "/").concat(resource.Id), resource, args) + .then(function (r) { return _this.notifySubscribersToDataModifications(r); }); + }; + BasicRepository.prototype.save = function (resource) { + if (isNewResource(resource)) { + return this.create(resource); + } + else { + return this.modify(resource); + } + function isTruthy(value) { + return !!value; + } + function isNewResource(resource) { + return !("Id" in resource && isTruthy(resource.Id)); + } + }; + BasicRepository.prototype.subscribeToDataModifications = function (key, callback) { + this.subscribersToDataModifications[key] = callback; + }; + BasicRepository.prototype.unsubscribeFromDataModifications = function (key) { + delete this.subscribersToDataModifications[key]; + }; + BasicRepository.prototype.extend = function (arg1, arg2) { + return __assign(__assign({}, arg1), arg2); + }; + return BasicRepository; +}()); +exports.BasicRepository = BasicRepository; /***/ }), -/***/ 46890: +/***/ 460: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -5511,195 +5276,164 @@ var __generator = (this && this.__generator) || function (thisArg, body) { if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; +var __values = (this && this.__values) || function(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."); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.connect = void 0; -var client_1 = __nccwpck_require__(42399); -var repository_1 = __nccwpck_require__(871); -function connect(space) { - return __awaiter(this, void 0, void 0, function () { - var client, repository; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, client_1.Client.create()]; - case 1: - client = _a.sent(); - if (client === undefined) { - throw new Error("The API client failed initialize"); - } - return [4 /*yield*/, new repository_1.Repository(client).forSpace(space)]; - case 2: - repository = _a.sent(); - return [2 /*return*/, [repository, client]]; - } +exports.BuildInformationRepository = void 0; +var overwriteMode_1 = __nccwpck_require__(7758); +var __1 = __nccwpck_require__(586); +var BuildInformationRepository = /** @class */ (function () { + function BuildInformationRepository(client, spaceName) { + this.client = client; + this.spaceName = spaceName; + } + BuildInformationRepository.prototype.push = function (buildInformation, overwriteMode) { + if (overwriteMode === void 0) { overwriteMode = overwriteMode_1.OverwriteMode.FailIfExists; } + return __awaiter(this, void 0, void 0, function () { + var tasks, _a, _b, pkg; + var e_1, _c; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + tasks = []; + try { + for (_a = __values(buildInformation.Packages), _b = _a.next(); !_b.done; _b = _a.next()) { + pkg = _b.value; + tasks.push(this.client.doCreate("".concat(__1.spaceScopedRoutePrefix, "/build-information{?overwriteMode}"), { + spaceName: buildInformation.spaceName, + PackageId: pkg.Id, + Version: pkg.Version, + OctopusBuildInformation: { + Branch: buildInformation.Branch, + BuildEnvironment: buildInformation.BuildEnvironment, + BuildNumber: buildInformation.BuildNumber, + BuildUrl: buildInformation.BuildUrl, + Commits: buildInformation.Commits.map(function (c) { return ({ Id: c.Id, Comment: c.Comment }); }), + VcsCommitNumber: buildInformation.VcsCommitNumber, + VcsRoot: buildInformation.VcsRoot, + VcsType: buildInformation.VcsType, + }, + }, { overwriteMode: overwriteMode })); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_b && !_b.done && (_c = _a.return)) _c.call(_a); + } + finally { if (e_1) throw e_1.error; } + } + return [4 /*yield*/, Promise.allSettled(tasks)]; + case 1: + _d.sent(); + return [2 /*return*/]; + } + }); }); - }); -} -exports.connect = connect; + }; + return BuildInformationRepository; +}()); +exports.BuildInformationRepository = BuildInformationRepository; /***/ }), -/***/ 62407: -/***/ (function(__unused_webpack_module, exports) { +/***/ 8304: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CouldNotFindError = void 0; -var CouldNotFindError = /** @class */ (function (_super) { - __extends(CouldNotFindError, _super); - function CouldNotFindError(message) { - var _this = _super.call(this, message) || this; - Object.setPrototypeOf(_this, CouldNotFindError.prototype); - return _this; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; } - CouldNotFindError.createWhat = function (what, quotedName) { - if (quotedName === void 0) { quotedName = null; } - var message = quotedName === null ? what : "".concat(what, " '").concat(quotedName, "'"); - var e = new CouldNotFindError("Could not find ".concat(message, "; either it does not exist or you lack permissions to view it.")); - return e; - }; - CouldNotFindError.createResource = function (resourceTypeDisplayName, nameOrId, enclosingContextDescription) { - if (enclosingContextDescription === void 0) { enclosingContextDescription = ""; } - return CouldNotFindError.createWhat("Cannot find the ".concat(resourceTypeDisplayName, " with name or id '").concat(nameOrId, "'").concat(enclosingContextDescription, ". Please check the spelling and that you have permissions to view it. Please use Configuration > Test Permissions to confirm.")); - }; - return CouldNotFindError; -}(Error)); -exports.CouldNotFindError = CouldNotFindError; + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(460), exports); +__exportStar(__nccwpck_require__(8146), exports); +__exportStar(__nccwpck_require__(2697), exports); /***/ }), -/***/ 27379: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 8146: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (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()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; - } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ChannelVersionRuleTestResult = exports.ChannelVersionRuleTester = void 0; -var semver_1 = __nccwpck_require__(11383); -var ChannelVersionRuleTester = /** @class */ (function () { - function ChannelVersionRuleTester(client) { - this.client = client; + + +/***/ }), + +/***/ 2697: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PackageIdentity = void 0; +var PackageIdentity = /** @class */ (function () { + function PackageIdentity(Id, Version) { + this.Id = Id; + this.Version = Version; } - ChannelVersionRuleTester.prototype.test = function (rule, packageVersion, feedId) { - var _a; - return __awaiter(this, void 0, void 0, function () { - var link, resource, version; - return __generator(this, function (_b) { - if (rule === undefined) - // Anything goes if there is no rule defined for this step - return [2 /*return*/, ChannelVersionRuleTestResult.Null()]; - if (!packageVersion) - // If we don't have a package version, this rule should be ignored - return [2 /*return*/, ChannelVersionRuleTestResult.Failed()]; - link = this.client.getLink('VersionRuleTest'); - resource = { - version: packageVersion, - versionRange: rule.VersionRange, - preReleaseTag: rule.Tag, - feedId: feedId - }; - version = (_a = this.client.tryGetServerInformation()) === null || _a === void 0 ? void 0 : _a.version; - if (version !== undefined && new semver_1.SemVer(version) > new semver_1.SemVer('2021.2')) { - return [2 /*return*/, this.client.post(link, resource)]; - } - return [2 /*return*/, this.client.get(link, resource)]; - }); - }); - }; - return ChannelVersionRuleTester; -}()); -exports.ChannelVersionRuleTester = ChannelVersionRuleTester; -var Pass = 'PASS'; -var Fail = 'FAIL'; -var ChannelVersionRuleTestResult = /** @class */ (function () { - function ChannelVersionRuleTestResult() { - this.satisfiesVersionRange = false; - this.satisfiesPreReleaseTag = false; - this.isNull = false; - } - Object.defineProperty(ChannelVersionRuleTestResult.prototype, "isSatisfied", { - get: function () { - return this.satisfiesVersionRange && this.satisfiesPreReleaseTag; - }, - enumerable: false, - configurable: true - }); - ChannelVersionRuleTestResult.prototype.toSummaryString = function () { - return this.isNull - ? 'Allow any version' - : "Range: ".concat(this.satisfiesVersionRange ? Pass : Fail, " Tag: ").concat(this.satisfiesPreReleaseTag ? Pass : Fail); - }; - ChannelVersionRuleTestResult.Failed = function () { - return new ChannelVersionRuleTestResult(); - }; - ChannelVersionRuleTestResult.Null = function () { - var channelVersionRuleTestResult = new ChannelVersionRuleTestResult(); - channelVersionRuleTestResult.isNull = true; - channelVersionRuleTestResult.satisfiesVersionRange = true; - channelVersionRuleTestResult.satisfiesPreReleaseTag = true; - return channelVersionRuleTestResult; - }; - return ChannelVersionRuleTestResult; + return PackageIdentity; }()); -exports.ChannelVersionRuleTestResult = ChannelVersionRuleTestResult; +exports.PackageIdentity = PackageIdentity; + + +/***/ }), + +/***/ 9296: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 8318: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 2171: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 77948: +/***/ 4520: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -5730,352 +5464,41 @@ var __assign = (this && this.__assign) || function () { }; return __assign.apply(this, arguments); }; -var __awaiter = (this && this.__awaiter) || function (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()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; - } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createRelease = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var clientConfiguration_1 = __nccwpck_require__(5966); -var deployment_base_1 = __nccwpck_require__(5548); -var throw_if_undefined_1 = __nccwpck_require__(70347); -var channel_version_rule_tester_1 = __nccwpck_require__(27379); -var package_version_resolver_1 = __nccwpck_require__(89489); -var release_plan_builder_1 = __nccwpck_require__(43817); -function releaseOptionsDefaults() { - return { - ignoreChannelRules: false, - ignoreExisting: false, - packages: [], - whatIf: false, - }; -} -function createRelease(repository, project, releaseOptions, deploymentOptions) { - return __awaiter(this, void 0, void 0, function () { - var proj, configuration; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, repository.projects.find(nameOrId)]; - case 1: return [2 /*return*/, _a.sent()]; - } - }); }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, repository.projects.get(id)]; - }); }); }, "Projects", "project", project.Name)]; - case 1: - proj = _a.sent(); - configuration = (0, clientConfiguration_1.processConfiguration)(); - console.log("Creating a release..."); - return [4 /*yield*/, new CreateRelease(repository, configuration.apiUri, proj, releaseOptions, deploymentOptions).execute()]; - case 2: - _a.sent(); - console.log("Release created successfully."); - return [2 /*return*/]; - } - }); - }); -} -exports.createRelease = createRelease; -var CreateRelease = /** @class */ (function (_super) { - __extends(CreateRelease, _super); - function CreateRelease(repository, serverUrl, project, releaseOptions, deploymentOptions) { - var _this = _super.call(this, repository, serverUrl, deploymentOptions) || this; - _this.project = project; - _this.releaseOptions = __assign(__assign({}, releaseOptionsDefaults()), releaseOptions); - _this.packageVersionResolver = new package_version_resolver_1.PackageVersionResolver(); - _this.releasePlanBuilder = new release_plan_builder_1.ReleasePlanBuilder(repository.client, _this.packageVersionResolver, new channel_version_rule_tester_1.ChannelVersionRuleTester(repository.client)); - return _this; +exports.EnvironmentRepository = void 0; +var __1 = __nccwpck_require__(586); +var spaceScopedBasicRepository_1 = __nccwpck_require__(3496); +var EnvironmentRepository = /** @class */ (function (_super) { + __extends(EnvironmentRepository, _super); + function EnvironmentRepository(client, spaceName) { + return _super.call(this, client, spaceName, "".concat(__1.spaceScopedRoutePrefix, "/environments"), "skip,take,ids,partialName") || this; } - CreateRelease.prototype.releaseNotesFallBackToDeploymentSettings = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (this.releaseOptions.releaseNotes) - return [2 /*return*/]; - return [2 /*return*/]; - }); - }); - }; - CreateRelease.prototype.execute = function () { - var _a, _b, _c, _d, _e; - return __awaiter(this, void 0, void 0, function () { - var _i, _f, pkg, plan, found, _g, releaseResource, release; - return __generator(this, function (_h) { - switch (_h.label) { - case 0: - this.validateProjectPersistenceRequirements(); - if (this.releaseOptions.defaultPackageVersion != undefined) { - this.packageVersionResolver.setDefault(this.releaseOptions.defaultPackageVersion); - } - if (!(this.releaseOptions.packagesFolder != undefined)) return [3 /*break*/, 2]; - return [4 /*yield*/, this.packageVersionResolver.addFolder(this.releaseOptions.packagesFolder)]; - case 1: - _h.sent(); - _h.label = 2; - case 2: - _i = 0, _f = this.releaseOptions.packages; - _h.label = 3; - case 3: - if (!(_i < _f.length)) return [3 /*break*/, 6]; - pkg = _f[_i]; - return [4 /*yield*/, this.packageVersionResolver.addPackage(pkg.id, pkg.version)]; - case 4: - _h.sent(); - _h.label = 5; - case 5: - _i++; - return [3 /*break*/, 3]; - case 6: return [4 /*yield*/, this.buildReleasePlan()]; - case 7: - plan = _h.sent(); - if (!plan) - return [2 /*return*/]; - if (this.releaseOptions.releaseNumber) { - this.versionNumber = this.releaseOptions.releaseNumber; - console.debug("Using version number provided on command-line: ".concat(this.versionNumber)); - } - else if (plan.releaseTemplate.NextVersionIncrement) { - this.versionNumber = plan.releaseTemplate.NextVersionIncrement; - console.debug("Using version number from release template: ".concat(this.versionNumber)); - } - else if (plan.releaseTemplate.VersioningPackageStepName) { - this.versionNumber = plan.getActionVersionNumber(plan.releaseTemplate.VersioningPackageStepName, plan.releaseTemplate.VersioningPackageReferenceName); - console.debug("Using version number from package step: ".concat(this.versionNumber)); - } - else { - throw new Error("A version number was not specified and could not be automatically selected."); - } - if (plan.isViableReleasePlan()) { - console.info("Release plan for ".concat(this.project.Name, " ").concat(this.versionNumber)); - } - else { - console.warn("Release plan for ".concat(this.project.Name, " ").concat(this.versionNumber)); - } - if (plan.hasUnresolvedSteps()) - throw new Error("Package versions could not be resolved for one or more of the package packageSteps in this release. See the errors above for details. Either ensure the latest version of the package can be automatically resolved, or set the version to use specifically by using the --package argument."); - if (!plan.channelHasAnyEnabledSteps()) { - throw new Error("Channel ".concat((_a = plan.channel) === null || _a === void 0 ? void 0 : _a.Name, " has no available steps")); - } - if (plan.hasStepsViolatingChannelVersionRules()) { - if (this.releaseOptions.ignoreChannelRules) - console.warn("At least one step violates the package version rules for the Channel '".concat((_b = plan.channel) === null || _b === void 0 ? void 0 : _b.Name, "'. Forcing the release to be created ignoring these rules...")); - else - throw new Error("At least one step violates the package version rules for the Channel '".concat((_c = plan.channel) === null || _c === void 0 ? void 0 : _c.Name, "'. Either correct the package versions for this release, let Octopus select the best channel by omitting the --channel argument, select a different channel using --channel=MyChannel argument, or ignore these version rules altogether by using the --ignoreChannelRules argument.")); - } - if (!this.releaseOptions.ignoreExisting) return [3 /*break*/, 11]; - console.debug("Checking for existing release for ".concat(this.project.Name, " ").concat(this.versionNumber, " because you specified --ignoreExisting...")); - _h.label = 8; - case 8: - _h.trys.push([8, 10, , 11]); - return [4 /*yield*/, this.repository.projects.getReleaseByVersion(this.project, this.versionNumber)]; - case 9: - found = _h.sent(); - if (found !== undefined) { - console.info("A release of ".concat(this.project.Name, " with the number ").concat(this.versionNumber, " already exists, and you specified --ignoreExisting, so we won't even attempt to create the release.")); - return [2 /*return*/]; - } - return [3 /*break*/, 11]; - case 10: - _g = _h.sent(); - // Expected - console.debug("No release exists - the coast is clear!"); - return [3 /*break*/, 11]; - case 11: - if (!this.releaseOptions.whatIf) return [3 /*break*/, 12]; - // We were just doing a dry run - bail out here - if (this.deploymentOptions.deployTo.length > 0) - console.info("[WhatIf] This release would have been created using the release plan and deployed to ".concat(this.deploymentOptions.deployTo)); - else - console.info("[WhatIf] This release would have been created using the release plan"); - return [3 /*break*/, 16]; - case 12: - // Actually create the release! - console.debug("Creating release..."); - return [4 /*yield*/, this.releaseNotesFallBackToDeploymentSettings()]; - case 13: - _h.sent(); - releaseResource = { - ChannelId: (_d = plan.channel) === null || _d === void 0 ? void 0 : _d.Id, - ProjectId: this.project.Id, - SelectedPackages: plan.getSelections(), - Version: this.versionNumber, - }; - releaseResource.VersionControlReference = - this.project.PersistenceSettings.Type === message_contracts_1.PersistenceSettingsType.VersionControlled - ? { - GitRef: this.releaseOptions.gitRef, - GitCommit: this.releaseOptions.gitCommit, - } - : undefined; - return [4 /*yield*/, this.repository.releases.create(releaseResource, this.releaseOptions.ignoreChannelRules)]; - case 14: - release = _h.sent(); - console.info("Release ".concat(release.Version, " created successfully.")); - if ((_e = release.VersionControlReference) === null || _e === void 0 ? void 0 : _e.GitCommit) - console.info("Release created from commit ".concat(release.VersionControlReference.GitCommit, " of git reference ").concat(release.VersionControlReference.GitRef, ".")); - return [4 /*yield*/, this.deployRelease(this.project, release)]; - case 15: - _h.sent(); - _h.label = 16; - case 16: return [2 /*return*/]; - } - }); - }); - }; - CreateRelease.prototype.buildReleasePlan = function () { - return __awaiter(this, void 0, void 0, function () { - var matchingChannel; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!this.releaseOptions.channel) return [3 /*break*/, 3]; - console.info("Building release plan for channel '".concat(this.releaseOptions.channel.Name, "'...")); - return [4 /*yield*/, this.getMatchingChannel(this.releaseOptions.channel.Name)]; - case 1: - matchingChannel = _a.sent(); - return [4 /*yield*/, this.releasePlanBuilder.build(this.repository, this.project, matchingChannel, this.releaseOptions.packagePrerelease, this.releaseOptions.gitRef, this.releaseOptions.gitCommit)]; - case 2: return [2 /*return*/, _a.sent()]; - case 3: - console.debug("Automatically selecting the best channel for this release..."); - return [4 /*yield*/, this.autoSelectBestReleasePlanOrThrow()]; - case 4: return [2 /*return*/, _a.sent()]; - } - }); - }); + // getMetadata(environment: DeploymentEnvironment): Promise { + // return this.client.get('${spaceScopedRoutePrefix}/environments/{id}/metadata', { spaceId: environment.SpaceId, id: environment.Id }); + // } + EnvironmentRepository.prototype.sort = function (order) { + return this.client.doUpdate("".concat(this.baseApiPathTemplate, "/sortorder"), order, { spaceName: this.spaceName }); }; - CreateRelease.prototype.getChannel = function () { - var _a, _b; - return __awaiter(this, void 0, void 0, function () { - var branch; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - branch = undefined; - if ((0, message_contracts_1.HasVersionControlledPersistenceSettings)(this.project.PersistenceSettings)) { - branch = (_b = (_a = this.releaseOptions.gitCommit) !== null && _a !== void 0 ? _a : this.releaseOptions.gitRef) !== null && _b !== void 0 ? _b : this.project.PersistenceSettings.DefaultBranch; - } - return [4 /*yield*/, this.repository.projects.getChannels(this.project, branch, 0, this.repository.projects.takeAll)]; - case 1: return [2 /*return*/, _c.sent()]; - } - }); - }); + EnvironmentRepository.prototype.summary = function (args) { + return this.client.request("".concat(this.baseApiPathTemplate, "/summary{?ids,partialName,machinePartialName,roles,isDisabled,healthStatuses,commStyles,tenantIds,tenantTags,hideEmptyEnvironments,shellNames,deploymentTargetTypes}"), __assign({ spaceName: this.spaceName }, args)); }; - CreateRelease.prototype.autoSelectBestReleasePlanOrThrow = function () { - var _a, _b; - return __awaiter(this, void 0, void 0, function () { - var channels, candidateChannels, releasePlans, _i, candidateChannels_1, channel, _c, viablePlans, selectedPlan, selectedPlan; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: return [4 /*yield*/, this.getChannel()]; - case 1: - channels = _d.sent(); - candidateChannels = channels.Items; - releasePlans = []; - _i = 0, candidateChannels_1 = candidateChannels; - _d.label = 2; - case 2: - if (!(_i < candidateChannels_1.length)) return [3 /*break*/, 5]; - channel = candidateChannels_1[_i]; - console.info("Building a release plan for channel, \"".concat(channel.Name, "\"...")); - _c = this; - return [4 /*yield*/, this.releasePlanBuilder.build(this.repository, this.project, channel, this.releaseOptions.packagePrerelease, this.releaseOptions.gitRef, this.releaseOptions.gitCommit)]; - case 3: - _c.plan = _d.sent(); - releasePlans.push(this.plan); - if (!this.plan.channelHasAnyEnabledSteps()) - console.warn("Channel, \"".concat(channel.Name, "\" does not have any enabled package steps.")); - _d.label = 4; - case 4: - _i++; - return [3 /*break*/, 2]; - case 5: - viablePlans = releasePlans.filter(function (p) { return p.isViableReleasePlan(); }); - if (viablePlans.length === 0) - throw new Error("There are no viable release plans in any channels using the provided arguments. The following release plans were considered:" + - "Sorry not implemented yet!"); - if (viablePlans.length === 1) { - selectedPlan = viablePlans[0]; - console.info("Selected the release plan for channel, \"".concat((_a = selectedPlan.channel) === null || _a === void 0 ? void 0 : _a.Name, "\".")); - return [2 /*return*/, selectedPlan]; - } - if (viablePlans.length > 1 && viablePlans.some(function (p) { var _a; return (_a = p.channel) === null || _a === void 0 ? void 0 : _a.IsDefault; })) { - selectedPlan = viablePlans.find(function (p) { var _a; return (_a = p.channel) === null || _a === void 0 ? void 0 : _a.IsDefault; }); - console.info("Selected the release plan for channel \"".concat((_b = selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.channel) === null || _b === void 0 ? void 0 : _b.Name, "\" - there were multiple matching Channels (").concat(viablePlans - .map(function (p) { var _a; return (_a = p.channel) === null || _a === void 0 ? void 0 : _a.Name; }) - .reduce(function (previousValue, currentValue) { return "".concat(previousValue, ",").concat(currentValue); }, ""), ") so we selected the default channel.")); - return [2 /*return*/, selectedPlan]; - } - throw new Error("There are ".concat(viablePlans.length, " viable release plans using the provided arguments so we cannot auto-select one. The viable release plans are:") + - "Sorry not implemented yet!" + - "The unviable release plans are:" + - "Sorry not implemented yet!"); - } - }); - }); + EnvironmentRepository.prototype.machines = function (environment, args) { + return this.client.request("".concat(this.baseApiPathTemplate, "/").concat(environment.Id, "/machines{?skip,take,partialName,roles,isDisabled,healthStatuses,commStyles,tenantIds,tenantTags,shellNames,deploymentTargetTypes}"), __assign({ spaceName: this.spaceName }, args)); }; - CreateRelease.prototype.getMatchingChannel = function (channelNameOrId) { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - return [2 /*return*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, this.repository.channels.find(nameOrId)]; - }); }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, this.repository.channels.get(id)]; - }); }); }, "Channels", "channel", channelNameOrId)]; - }); + EnvironmentRepository.prototype.variablesScopedOnlyToThisEnvironment = function (environment) { + return this.client.request("".concat(__1.spaceScopedRoutePrefix, "/environments/{id}/singlyScopedVariableDetails"), { + spaceName: this.spaceName, + id: environment.Id, }); }; - CreateRelease.prototype.validateProjectPersistenceRequirements = function () { - var wasGitRefProvided = this.releaseOptions.gitRef; - if (!wasGitRefProvided && this.project.PersistenceSettings.Type === message_contracts_1.PersistenceSettingsType.VersionControlled) { - this.gitReference = this.project.PersistenceSettings.DefaultBranch; - console.info("No gitRef parameter provided. Using Project Default Branch: ".concat(this.project.PersistenceSettings.DefaultBranch)); - } - if (!this.project.IsVersionControlled && wasGitRefProvided) - throw new Error("Since the provided project is not a version controlled project," + - " the --gitCommit and --gitRef arguments are not supported for this command."); - }; - return CreateRelease; -}(deployment_base_1.DeploymentBase)); + return EnvironmentRepository; +}(spaceScopedBasicRepository_1.SpaceScopedBasicRepository)); +exports.EnvironmentRepository = EnvironmentRepository; /***/ }), -/***/ 70067: +/***/ 7206: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -6095,213 +5518,33 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(77948), exports); -__exportStar(__nccwpck_require__(35307), exports); -__exportStar(__nccwpck_require__(89489), exports); -__exportStar(__nccwpck_require__(42235), exports); -__exportStar(__nccwpck_require__(40744), exports); -__exportStar(__nccwpck_require__(43817), exports); -__exportStar(__nccwpck_require__(43179), exports); +__exportStar(__nccwpck_require__(2171), exports); +__exportStar(__nccwpck_require__(4520), exports); /***/ }), -/***/ 35307: +/***/ 6459: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PackageIdentity = void 0; -var PackageIdentity = /** @class */ (function () { - function PackageIdentity(id, version) { - this.id = id; - this.version = version; - } - return PackageIdentity; -}()); -exports.PackageIdentity = PackageIdentity; /***/ }), -/***/ 89489: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 7587: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (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()); - }); -}; -var __generator = (this && this.__generator) || function (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 __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PackageVersionResolver = void 0; -var glob_1 = __importDefault(__nccwpck_require__(91957)); -var path_1 = __importDefault(__nccwpck_require__(71017)); -var semver_1 = __nccwpck_require__(11383); -var package_identity_1 = __nccwpck_require__(35307); -var WildCard = "*"; -function packageKey(stepNameOrPackageId, referenceName) { - return "".concat(stepNameOrPackageId, ":").concat(referenceName).toLowerCase(); -} -var PackageVersionResolver = /** @class */ (function () { - function PackageVersionResolver() { - this.stepNameToVersion = new Map(); - } - PackageVersionResolver.prototype.addFolder = function (folderPath) { - return __awaiter(this, void 0, void 0, function () { - var retrievePackages, files, _i, files_1, file, packageIdentity; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - retrievePackages = function (pattern) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, new Promise(function (resolve, reject) { - (0, glob_1.default)("".concat(folderPath, "/**/").concat(pattern), {}, function (err, matches) { - if (err) { - reject(err); - return; - } - resolve(matches); - }); - })]; - }); - }); }; - console.debug("Using package versions from '".concat(folderPath, "' folder")); - return [4 /*yield*/, retrievePackages("*(".concat(PackageVersionResolver.SupportedZipFilePatterns.map(function (v) { return v; }).join("|"), ")"))]; - case 1: - files = _a.sent(); - for (_i = 0, files_1 = files; _i < files_1.length; _i++) { - file = files_1[_i]; - console.debug("Package file: ".concat(file)); - packageIdentity = this.tryParseIdAndVersion(file); - if (packageIdentity) { - this.add(packageIdentity.id, undefined, packageIdentity.version); - } - } - return [2 /*return*/]; - } - }); - }); - }; - PackageVersionResolver.prototype.add3 = function (stepNameOrPackageIdAndVersion) { - var split = stepNameOrPackageIdAndVersion.split(/[:=/]+/); - if (split.length < 2) - throw new Error("The package argument '".concat(stepNameOrPackageIdAndVersion, "' does not use expected format of : {Step Name}:{Version}")); - var stepNameOrPackageId = split[0]; - var packageReferenceName = split.length > 2 ? split[1] : WildCard; - var version = split.length > 2 ? split[2] : split[1]; - if (!stepNameOrPackageId || !version) - throw new Error("The package argument '".concat(stepNameOrPackageIdAndVersion, "' does not use expected format of : {Step Name}:{Version}")); - this.add(stepNameOrPackageId, packageReferenceName, version); - }; - PackageVersionResolver.prototype.addPackage = function (stepNameOrPackageId, packageVersion) { - this.add(stepNameOrPackageId, "", packageVersion); - }; - PackageVersionResolver.prototype.add = function (stepNameOrPackageId, packageReferenceName, packageVersion) { - // Double wild card == default value - if (stepNameOrPackageId === WildCard && packageReferenceName === WildCard) { - this.setDefault(packageVersion); - return; - } - var key = packageKey(stepNameOrPackageId, packageReferenceName !== null && packageReferenceName !== void 0 ? packageReferenceName : WildCard); - var current = this.stepNameToVersion.get(key); - if (current !== undefined) { - var newVersion = new semver_1.SemVer(packageVersion); - var currentVersion = new semver_1.SemVer(current); - if (newVersion.compare(currentVersion) < 0) - return; - } - this.stepNameToVersion.set(key, packageVersion); - }; - PackageVersionResolver.prototype.setDefault = function (packageVersion) { - if ((0, semver_1.valid)(packageVersion) === null) { - throw new Error("Invalid package version"); - } - this.defaultVersion = packageVersion; - }; - PackageVersionResolver.prototype.tryParseIdAndVersion = function (filename) { - var _a, _b; - var idAndVersion = path_1.default.basename(filename, path_1.default.extname(filename)); - var tarExtension = path_1.default.extname(idAndVersion); - if (tarExtension.localeCompare(".tar", undefined, { - sensitivity: "accent", - }) === 0) { - idAndVersion = path_1.default.basename(idAndVersion, tarExtension); - } - var packageIdPattern = /(?(\w+([_.-]\w+)*?))/; - var semanticVersionPattern = new RegExp("(?(\\d+(.\\d+){0,3}" + // Major Minor Patch - "(-[0-9A-Za-z-]+(.[0-9A-Za-z-]+)*)?)" + // Pre-release identifiers - "(\\+[0-9A-Za-z-]+(.[0-9A-Za-z-]+)*)?)"); // Build Metadata - var match = new RegExp("^".concat(packageIdPattern.source, "\\.").concat(semanticVersionPattern.source, "$")).exec(idAndVersion); - var packageIdMatch = (_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.packageId; - var versionMatch = (_b = match === null || match === void 0 ? void 0 : match.groups) === null || _b === void 0 ? void 0 : _b.semanticVersion; - if (!packageIdMatch || !versionMatch) { - return; - } - var packageId = packageIdMatch; - if (!(0, semver_1.valid)(versionMatch)) { - return; - } - return new package_identity_1.PackageIdentity(packageId, versionMatch); - }; - PackageVersionResolver.prototype.resolveVersion = function (stepName, packageId, packageReferenceName) { - var _this = this; - var _a, _b; - var identifiers = [stepName, packageId]; - return ((_b = (_a = identifiers - .map(function (id) { return packageKey(id, packageReferenceName !== null && packageReferenceName !== void 0 ? packageReferenceName : ""); }) - .map(function (key) { var _a; return (_a = _this.stepNameToVersion.get(key)) !== null && _a !== void 0 ? _a : undefined; }) - .find(function (version) { return version !== undefined; })) !== null && _a !== void 0 ? _a : identifiers - .flatMap(function (id) { return [packageKey(WildCard, packageReferenceName !== null && packageReferenceName !== void 0 ? packageReferenceName : ""), packageKey(id, WildCard)]; }) - .map(function (key) { var _a; return (_a = _this.stepNameToVersion.get(key)) !== null && _a !== void 0 ? _a : undefined; }) - .find(function (version) { return version !== undefined; })) !== null && _b !== void 0 ? _b : this.defaultVersion); - }; - PackageVersionResolver.SupportedZipFilePatterns = ["*.zip", "*.tgz", "*.tar.gz", "*.tar.Z", "*.tar.bz2", "*.tar.bz", "*.tbz", "*.tar", "*.nupkg"]; - return PackageVersionResolver; -}()); -exports.PackageVersionResolver = PackageVersionResolver; /***/ }), -/***/ 42235: +/***/ 283: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -6311,396 +5554,377 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 43817: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 996: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (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()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; - } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ReleasePlanBuilder = void 0; -var could_not_find_error_1 = __nccwpck_require__(62407); -var release_plan_1 = __nccwpck_require__(40744); -var GitReferenceMissingForVersionControlledProjectErrorMessage = "Attempting to create a release for a version controlled project, but no git reference has been provided. Use the gitRef parameter to supply a git reference."; -var ReleasePlanBuilder = /** @class */ (function () { - function ReleasePlanBuilder(client, versionResolver, channelVersionRuleTester) { - this.client = client; - this.versionResolver = versionResolver; - this.channelVersionRuleTester = channelVersionRuleTester; - } - ReleasePlanBuilder.gitReferenceSuppliedForDatabaseProjectErrorMessage = function (gitObjectName) { - return "Attempting to create a release from version control because the git ".concat(gitObjectName, " was provided. The selected project is not a version controlled project."); - }; - ReleasePlanBuilder.loadFeedsForSteps = function (repository, project, steps) { - return __awaiter(this, void 0, void 0, function () { - var allRelevantFeedIdOrName, allRelevantFeeds; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - allRelevantFeedIdOrName = steps.map(function (step) { return step.packageFeedId; }).filter(function (feedId) { return feedId !== undefined; }); - return [4 /*yield*/, repository.feeds.list({ - ids: allRelevantFeedIdOrName, - take: repository.feeds.takeAll, - })]; - case 1: - allRelevantFeeds = _a.sent(); - return [2 /*return*/, new Map(project.IsVersionControlled ? allRelevantFeeds.Items.map(function (p) { return [p.Name, p]; }) : allRelevantFeeds.Items.map(function (p) { return [p.Id, p]; }))]; - } - }); - }); - }; - ReleasePlanBuilder.prototype.buildChannelVersionFilters = function (stepName, packageReferenceName, channel) { - var filters = {}; - if (channel === undefined) - return filters; - var rule = channel.Rules.find(function (r) { - return r.ActionPackages.some(function (pkg) { - var _a; - return pkg.DeploymentAction.localeCompare(stepName, undefined, { - sensitivity: "accent", - }) === 0 && - ((_a = pkg.PackageReference) === null || _a === void 0 ? void 0 : _a.localeCompare(packageReferenceName, undefined, { - sensitivity: "accent", - })) === 0; - }); - }); - if (rule === null || rule === undefined) - return filters; - if (!rule.VersionRange) - filters["versionRange"] = rule.VersionRange; - if (!rule.Tag) - filters["preReleaseTag"] = rule.Tag; - return filters; - }; - ReleasePlanBuilder.prototype.build = function (repository, project, channel, versionPreReleaseTag, gitReference, gitCommit) { - return __awaiter(this, void 0, void 0, function () { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!!gitReference) return [3 /*break*/, 2]; - return [4 /*yield*/, this.buildReleaseFromDatabase(repository, project, channel, versionPreReleaseTag)]; - case 1: - _a = _b.sent(); - return [3 /*break*/, 4]; - case 2: return [4 /*yield*/, this.buildReleaseFromVersionControl(repository, project, channel, versionPreReleaseTag, gitReference, gitCommit)]; - case 3: - _a = _b.sent(); - _b.label = 4; - case 4: return [2 /*return*/, _a]; - } - }); - }); - }; - ReleasePlanBuilder.prototype.buildReleaseFromDatabase = function (repository, project, channel, versionPreReleaseTag) { - return __awaiter(this, void 0, void 0, function () { - var deploymentProcess, releaseTemplate; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (project.IsVersionControlled) - throw new Error(GitReferenceMissingForVersionControlledProjectErrorMessage); - console.debug("Finding deployment process..."); - return [4 /*yield*/, repository.deploymentProcesses.get(project.DeploymentProcessId, undefined)]; - case 1: - deploymentProcess = _a.sent(); - if (deploymentProcess === undefined) - throw new could_not_find_error_1.CouldNotFindError("a deployment process for project \"".concat(project.Name, "\"")); - console.debug("Finding release template..."); - return [4 /*yield*/, repository.deploymentProcesses.getTemplate(deploymentProcess, channel)]; - case 2: - releaseTemplate = _a.sent(); - if (releaseTemplate === undefined) - throw new could_not_find_error_1.CouldNotFindError(channel ? "a release template for project \"".concat(project.Name, "\" and channel \"").concat(channel.Name, "\"") : "A release template for project \"".concat(project.Name, "\"")); - return [4 /*yield*/, this.buildInternal(repository, project, channel, versionPreReleaseTag, releaseTemplate, deploymentProcess)]; - case 3: return [2 /*return*/, _a.sent()]; - } - }); - }); - }; - ReleasePlanBuilder.prototype.buildReleaseFromVersionControl = function (repository, project, channel, versionPreReleaseTag, gitReference, gitCommit) { - return __awaiter(this, void 0, void 0, function () { - var gitObject, gitObjectName, deploymentProcess, releaseTemplate; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - gitObject = !gitCommit ? gitReference : gitCommit; - gitObjectName = !gitCommit ? "reference ".concat(gitReference) : "commit ".concat(gitCommit); - if (!project.IsVersionControlled) - throw new Error(ReleasePlanBuilder.gitReferenceSuppliedForDatabaseProjectErrorMessage(gitObjectName)); - console.debug("Finding deployment process at git ".concat(gitObjectName, "...")); - return [4 /*yield*/, repository.deploymentProcesses.get(project.DeploymentProcessId, gitObject)]; - case 1: - deploymentProcess = _a.sent(); - if (deploymentProcess === undefined) - throw new could_not_find_error_1.CouldNotFindError("a deployment process for project \"".concat(project.Name, "\" and git ").concat(gitObjectName, ".")); - console.debug("Finding release template at git ".concat(gitObjectName, "...")); - return [4 /*yield*/, repository.deploymentProcesses.getTemplate(deploymentProcess, channel)]; - case 2: - releaseTemplate = _a.sent(); - if (releaseTemplate === undefined) - throw new could_not_find_error_1.CouldNotFindError("a release template for project \"".concat(project.Name, "\", channel \"").concat(channel.Name, "\" and git ").concat(gitObjectName, ".")); - return [4 /*yield*/, this.buildInternal(repository, project, channel, versionPreReleaseTag, releaseTemplate, deploymentProcess)]; - case 3: return [2 /*return*/, _a.sent()]; - } - }); - }); - }; - ReleasePlanBuilder.prototype.buildInternal = function (repository, project, channel, versionPreReleaseTag, releaseTemplate, deploymentProcess) { - return __awaiter(this, void 0, void 0, function () { - var plan, allRelevantFeeds, _i, _a, unresolved, feed, filters, packages, latestPackage, _loop_1, this_1, _b, _c, step; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - plan = new release_plan_1.ReleasePlan(project, channel, releaseTemplate, deploymentProcess, this.versionResolver); - if (!(plan.unresolvedSteps.length > 0)) return [3 /*break*/, 5]; - console.debug("The package version for some steps was not specified. Attempting to resolve those automatically..."); - return [4 /*yield*/, ReleasePlanBuilder.loadFeedsForSteps(repository, project, plan.unresolvedSteps)]; - case 1: - allRelevantFeeds = _d.sent(); - _i = 0, _a = plan.unresolvedSteps; - _d.label = 2; - case 2: - if (!(_i < _a.length)) return [3 /*break*/, 5]; - unresolved = _a[_i]; - if (!unresolved.isResolvable) { - console.error("The version number for step, \"".concat(unresolved.actionName, "\" cannot be automatically resolved because the feed or package ID is dynamic.")); - return [3 /*break*/, 4]; - } - if (versionPreReleaseTag) - console.debug("Finding latest package with pre-release \"".concat(versionPreReleaseTag, "\" for step, \"").concat(unresolved.actionName, "\"...")); - else - console.debug("Finding latest package for step, \"".concat(unresolved.actionName, "\"...")); - if (!allRelevantFeeds.has(unresolved.packageFeedId)) { - throw new Error("Could not find a feed with ID \"".concat(unresolved.packageFeedId, "\", which is used by step: \"").concat(unresolved.actionName, "\".")); - } - feed = allRelevantFeeds.get(unresolved.packageFeedId); - filters = this.buildChannelVersionFilters(unresolved.actionName, unresolved.packageReferenceName, channel); - filters["packageId"] = unresolved.packageId; - if (versionPreReleaseTag) - filters["preReleaseTag"] = versionPreReleaseTag; - return [4 /*yield*/, this.client.get(feed.Links.SearchTemplate, filters)]; - case 3: - packages = _d.sent(); - latestPackage = packages[0]; - if (packages.length === 0) { - console.info("Could not find any packages with ID \"".concat(unresolved.packageId, "\" that match the channel filter, in the feed, \"").concat(feed.Name, "\".")); - } - else { - console.debug("Selected \"".concat(latestPackage.PackageId, "\" version \"").concat(latestPackage.Version, "\" for \"").concat(unresolved.actionName, "\".")); - unresolved.setVersionFromLatest(latestPackage.Version); - } - _d.label = 4; - case 4: - _i++; - return [3 /*break*/, 2]; - case 5: - if (!(channel !== undefined)) return [3 /*break*/, 9]; - _loop_1 = function (step) { - var rule, result; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - rule = channel.Rules.find(function (r) { - return r.ActionPackages.some(function (pkg) { - var _a; - return pkg.DeploymentAction.localeCompare(step.actionName, undefined, { - sensitivity: "accent", - }) === 0 && - ((_a = pkg.PackageReference) === null || _a === void 0 ? void 0 : _a.localeCompare(step.packageReferenceName, undefined, { - sensitivity: "accent", - })) === 0; - }); - }); - return [4 /*yield*/, this_1.channelVersionRuleTester.test(rule, step.version, step.packageFeedId)]; - case 1: - result = _e.sent(); - step.setChannelVersionRuleTestResult(result); - return [2 /*return*/]; - } - }); - }; - this_1 = this; - _b = 0, _c = plan.packageSteps; - _d.label = 6; - case 6: - if (!(_b < _c.length)) return [3 /*break*/, 9]; - step = _c[_b]; - return [5 /*yield**/, _loop_1(step)]; - case 7: - _d.sent(); - _d.label = 8; - case 8: - _b++; - return [3 /*break*/, 6]; - case 9: return [2 /*return*/, plan]; - } - }); - }); - }; - return ReleasePlanBuilder; -}()); -exports.ReleasePlanBuilder = ReleasePlanBuilder; /***/ }), -/***/ 43179: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6121: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +/* eslint-disable @typescript-eslint/consistent-type-assertions */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ReleasePlanItem = void 0; -var ReleasePlanItem = /** @class */ (function () { - function ReleasePlanItem(actionName, packageReferenceName, packageId, packageFeedId, isResolvable, userSpecifiedVersion) { - this.actionName = actionName; - this.packageReferenceName = packageReferenceName; - this.packageId = packageId; - this.packageFeedId = packageFeedId; - this.isResolvable = isResolvable; - this.isDisabled = false; - this.version = userSpecifiedVersion; - this.versionSource = !this.version ? "Cannot resolve" : "User specified"; - } - ReleasePlanItem.prototype.setVersionFromLatest = function (version) { - this.version = version; - this.versionSource = "Latest available"; - }; - ReleasePlanItem.prototype.setChannelVersionRuleTestResult = function (result) { - this.channelVersionRuleTestResult = result; - }; - return ReleasePlanItem; -}()); -exports.ReleasePlanItem = ReleasePlanItem; +exports.getFeedTypeLabel = exports.isContainerImageRegistry = exports.containerRegistryFeedTypes = exports.isOctopusProjectFeed = exports.feedTypeSupportsExtraction = exports.feedTypeCanSearchEmpty = void 0; +var feedType_1 = __nccwpck_require__(2957); +var lodash_1 = __nccwpck_require__(250); +function feedTypeCanSearchEmpty(feed) { + return ![feedType_1.FeedType.Docker, feedType_1.FeedType.AwsElasticContainerRegistry, feedType_1.FeedType.Maven, feedType_1.FeedType.GitHub].includes(feed); +} +exports.feedTypeCanSearchEmpty = feedTypeCanSearchEmpty; +function feedTypeSupportsExtraction(feed) { + // Container images can not be extracted + return ![feedType_1.FeedType.Docker, feedType_1.FeedType.AwsElasticContainerRegistry].includes(feed); +} +exports.feedTypeSupportsExtraction = feedTypeSupportsExtraction; +function isOctopusProjectFeed(feed) { + return feed === "OctopusProject"; +} +exports.isOctopusProjectFeed = isOctopusProjectFeed; +function containerRegistryFeedTypes() { + return [feedType_1.FeedType.Docker, feedType_1.FeedType.AwsElasticContainerRegistry]; +} +exports.containerRegistryFeedTypes = containerRegistryFeedTypes; +function isContainerImageRegistry(feed) { + return containerRegistryFeedTypes().includes(feed); +} +exports.isContainerImageRegistry = isContainerImageRegistry; +var getFeedTypeLabel = function (feedType) { + var requiresContainerImageRegistryFeed = feedType && feedType.length >= 1 && (0, lodash_1.every)(feedType, function (f) { return isContainerImageRegistry(f); }); + var requiresHelmChartFeed = feedType && feedType.length === 1 && feedType[0] === feedType_1.FeedType.Helm; + if (requiresContainerImageRegistryFeed) { + return "Container Image Registry"; + } + if (requiresHelmChartFeed) { + return "Helm Chart Repository"; + } + return "Package"; +}; +exports.getFeedTypeLabel = getFeedTypeLabel; /***/ }), -/***/ 40744: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 7423: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ReleasePlan = void 0; -var release_plan_item_1 = __nccwpck_require__(43179); -var ReleasePlan = /** @class */ (function () { - function ReleasePlan(project, channel, releaseTemplate, deploymentProcess, versionResolver) { - this.project = project; - this.channel = channel; - this.releaseTemplate = releaseTemplate; - this.versionResolver = versionResolver; - this.scriptSteps = deploymentProcess.Steps.flatMap(function (s) { return s.Actions; }) - .map(function (a) { - var _a, _b; - return ({ - stepName: a.Name, - packageId: (_a = a.Properties["Octopus.Action.Package.PackageId"]) !== null && _a !== void 0 ? _a : "", - feedId: (_b = a.Properties["Octopus.Action.Package.FeedId"]) !== null && _b !== void 0 ? _b : "", - isDisabled: a.IsDisabled, - channels: a.Channels, - }); - }) - .filter(function (x) { return !x.packageId && !x.isDisabled; }) // only consider enabled script steps - .filter(function (a) { return a.channels.length === 0 || a.channels.find(function (id) { return id === (channel === null || channel === void 0 ? void 0 : channel.Id); }); }) // only include actions without channel scope or with a matching channel scope - .map(function (x) { - var releasePlanItem = new release_plan_item_1.ReleasePlanItem(x.stepName, undefined, undefined, undefined, true, undefined); - releasePlanItem.isDisabled = x.isDisabled; - return releasePlanItem; - }); - this.packageSteps = releaseTemplate.Packages.map(function (p) { - return new release_plan_item_1.ReleasePlanItem(p.ActionName, p.PackageReferenceName, p.PackageId, p.FeedId, p.IsResolvable, versionResolver.resolveVersion(p.ActionName, p.PackageId, p.PackageReferenceName)); - }); - } - Object.defineProperty(ReleasePlan.prototype, "unresolvedSteps", { - get: function () { - return this.packageSteps.filter(function (s) { return !s.version; }); - }, - enumerable: false, - configurable: true - }); - ReleasePlan.prototype.channelHasAnyEnabledSteps = function () { - return ReleasePlan.anyEnabled(this.packageSteps) || ReleasePlan.anyEnabled(this.scriptSteps); - }; - ReleasePlan.anyEnabled = function (items) { - return items.some(function (x) { return !x.isDisabled; }); - }; - ReleasePlan.prototype.isViableReleasePlan = function () { - return !this.hasUnresolvedSteps() && !this.hasStepsViolatingChannelVersionRules() && this.channelHasAnyEnabledSteps(); - }; - ReleasePlan.prototype.hasUnresolvedSteps = function () { - return this.unresolvedSteps.length > 0; - }; - ReleasePlan.prototype.hasStepsViolatingChannelVersionRules = function () { - return this.channel !== undefined && this.packageSteps.some(function (s) { var _a; return ((_a = s.channelVersionRuleTestResult) === null || _a === void 0 ? void 0 : _a.isSatisfied) !== true; }); - }; - ReleasePlan.prototype.formatAsTable = function () { - return undefined; - }; - ReleasePlan.prototype.getActionVersionNumber = function (packageStepName, packageReferenceName) { - var step = this.packageSteps.find(function (s) { - return s.actionName.localeCompare(packageStepName, undefined, { - sensitivity: "accent", - }) === 0 && - (!s.packageReferenceName || s.packageReferenceName.localeCompare(packageReferenceName !== null && packageReferenceName !== void 0 ? packageReferenceName : "", undefined, { sensitivity: "accent" }) === 0); - }); - if (step === undefined) - throw new Error("The step '".concat(packageStepName, "' is configured to provide the package version number but doesn't exist in the release plan.")); - if (!step.version) - throw new Error("The step '".concat(packageStepName, "' provides the release version number but no package version could be determined from it.")); - return step.version; +var __extends = (this && this.__extends) || (function () { + 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); }; - ReleasePlan.prototype.getSelections = function () { - return this.packageSteps.map(function (x) { return ({ - ActionName: x.actionName, - PackageReferenceName: x.packageReferenceName, - Version: x.version, - }); }); + return function (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 __()); }; - return ReleasePlan; -}()); -exports.ReleasePlan = ReleasePlan; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FeedRepository = void 0; +var __1 = __nccwpck_require__(586); +var spaceScopedBasicRepository_1 = __nccwpck_require__(3496); +var FeedRepository = /** @class */ (function (_super) { + __extends(FeedRepository, _super); + function FeedRepository(client, spaceName) { + return _super.call(this, client, spaceName, "".concat(__1.spaceScopedRoutePrefix, "/feeds"), "skip,take,ids,partialName,feedType") || this; + } + return FeedRepository; +}(spaceScopedBasicRepository_1.SpaceScopedBasicRepository)); +exports.FeedRepository = FeedRepository; + + +/***/ }), + +/***/ 2957: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FeedType = void 0; +var FeedType; +(function (FeedType) { + FeedType["AwsElasticContainerRegistry"] = "AwsElasticContainerRegistry"; + FeedType["BuiltIn"] = "BuiltIn"; + FeedType["Docker"] = "Docker"; + FeedType["GitHub"] = "GitHub"; + FeedType["Helm"] = "Helm"; + FeedType["Maven"] = "Maven"; + FeedType["Nuget"] = "NuGet"; + FeedType["OctopusProject"] = "OctopusProject"; +})(FeedType = exports.FeedType || (exports.FeedType = {})); + + +/***/ }), + +/***/ 4023: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 6080: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 4962: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(7587), exports); +__exportStar(__nccwpck_require__(283), exports); +__exportStar(__nccwpck_require__(996), exports); +__exportStar(__nccwpck_require__(6121), exports); +__exportStar(__nccwpck_require__(7423), exports); +__exportStar(__nccwpck_require__(2957), exports); +__exportStar(__nccwpck_require__(4023), exports); +__exportStar(__nccwpck_require__(6080), exports); +__exportStar(__nccwpck_require__(8150), exports); +__exportStar(__nccwpck_require__(5306), exports); +__exportStar(__nccwpck_require__(9759), exports); +__exportStar(__nccwpck_require__(6916), exports); + + +/***/ }), + +/***/ 8150: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 5306: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 9759: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 6916: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 1145: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ControlType = void 0; +var ControlType; +(function (ControlType) { + ControlType["AmazonWebServicesAccount"] = "AmazonWebServicesAccount"; + ControlType["AzureAccount"] = "AzureAccount"; + ControlType["Certificate"] = "Certificate"; + ControlType["Checkbox"] = "Checkbox"; + ControlType["Custom"] = "Custom"; + ControlType["GoogleCloudAccount"] = "GoogleCloudAccount"; + ControlType["MultiLineText"] = "MultiLineText"; + ControlType["Package"] = "Package"; + ControlType["Select"] = "Select"; + ControlType["Sensitive"] = "Sensitive"; + ControlType["SingleLineText"] = "SingleLineText"; + ControlType["StepName"] = "StepName"; + ControlType["WorkerPool"] = "WorkerPool"; +})(ControlType = exports.ControlType || (exports.ControlType = {})); + + +/***/ }), + +/***/ 669: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ConnectivityCheckResponseMessageCategory = exports.PropertyApplicabilityMode = void 0; +var PropertyApplicabilityMode; +(function (PropertyApplicabilityMode) { + PropertyApplicabilityMode["ApplicableIfHasAnyValue"] = "ApplicableIfHasAnyValue"; + PropertyApplicabilityMode["ApplicableIfHasNoValue"] = "ApplicableIfHasNoValue"; + PropertyApplicabilityMode["ApplicableIfSpecificValue"] = "ApplicableIfSpecificValue"; + PropertyApplicabilityMode["ApplicableIfNotSpecificValue"] = "ApplicableIfNotSpecificValue"; +})(PropertyApplicabilityMode = exports.PropertyApplicabilityMode || (exports.PropertyApplicabilityMode = {})); +var ConnectivityCheckResponseMessageCategory; +(function (ConnectivityCheckResponseMessageCategory) { + ConnectivityCheckResponseMessageCategory["Info"] = "Info"; + ConnectivityCheckResponseMessageCategory["Warning"] = "Warning"; + ConnectivityCheckResponseMessageCategory["Error"] = "Error"; +})(ConnectivityCheckResponseMessageCategory = exports.ConnectivityCheckResponseMessageCategory || (exports.ConnectivityCheckResponseMessageCategory = {})); + + +/***/ }), + +/***/ 599: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(1145), exports); +__exportStar(__nccwpck_require__(669), exports); + + +/***/ }), + +/***/ 5024: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(8304), exports); +__exportStar(__nccwpck_require__(7206), exports); +__exportStar(__nccwpck_require__(599), exports); +__exportStar(__nccwpck_require__(4979), exports); +__exportStar(__nccwpck_require__(5207), exports); +__exportStar(__nccwpck_require__(1682), exports); +__exportStar(__nccwpck_require__(9659), exports); +__exportStar(__nccwpck_require__(6568), exports); +__exportStar(__nccwpck_require__(1163), exports); +__exportStar(__nccwpck_require__(9925), exports); +__exportStar(__nccwpck_require__(341), exports); +__exportStar(__nccwpck_require__(3217), exports); +__exportStar(__nccwpck_require__(621), exports); +__exportStar(__nccwpck_require__(2966), exports); +__exportStar(__nccwpck_require__(9296), exports); +__exportStar(__nccwpck_require__(8318), exports); +__exportStar(__nccwpck_require__(6459), exports); +__exportStar(__nccwpck_require__(7758), exports); +__exportStar(__nccwpck_require__(800), exports); +__exportStar(__nccwpck_require__(3496), exports); + + +/***/ }), + +/***/ 4979: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(1703), exports); +__exportStar(__nccwpck_require__(6141), exports); +__exportStar(__nccwpck_require__(5101), exports); +__exportStar(__nccwpck_require__(9310), exports); + + +/***/ }), + +/***/ 1703: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 92351: +/***/ 6141: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -6720,198 +5944,102 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -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); -}; -var __awaiter = (this && this.__awaiter) || function (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()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LifecycleRepository = void 0; +var spaceScopedRoutePrefix_1 = __nccwpck_require__(7218); +var spaceScopedBasicRepository_1 = __nccwpck_require__(3496); +var LifecycleRepository = /** @class */ (function (_super) { + __extends(LifecycleRepository, _super); + function LifecycleRepository(client, spaceName) { + return _super.call(this, client, spaceName, "".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/lifecycles"), "skip,take,ids,partialName") || this; } -}; + return LifecycleRepository; +}(spaceScopedBasicRepository_1.SpaceScopedBasicRepository)); +exports.LifecycleRepository = LifecycleRepository; + + +/***/ }), + +/***/ 5101: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.deployRelease = void 0; -var semver_1 = __nccwpck_require__(11383); -var clientConfiguration_1 = __nccwpck_require__(5966); -var could_not_find_error_1 = __nccwpck_require__(62407); -var throw_if_undefined_1 = __nccwpck_require__(70347); -var deployment_base_1 = __nccwpck_require__(5548); -function deployRelease(repository, project, version, deployTo, channel, updateVariables, deploymentOptions) { - return __awaiter(this, void 0, void 0, function () { - var proj, configuration; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, repository.projects.find(nameOrId)]; - case 1: return [2 /*return*/, _a.sent()]; - } - }); }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, repository.projects.get(id)]; - }); }); }, "Projects", "project", project.Id)]; - case 1: - proj = _a.sent(); - configuration = (0, clientConfiguration_1.processConfiguration)(); - return [4 /*yield*/, new DeployRelease(repository, configuration.apiUri, proj, deployTo, deploymentOptions).execute(version, channel, updateVariables)]; - case 2: - _a.sent(); - return [2 /*return*/]; - } - }); - }); -} -exports.deployRelease = deployRelease; -var DeployRelease = /** @class */ (function (_super) { - __extends(DeployRelease, _super); - function DeployRelease(repository, serverUrl, project, deployTo, deploymentOptions) { - var _this = _super.call(this, repository, serverUrl, __assign(__assign({}, deploymentOptions), { deployTo: deployTo })) || this; - _this.project = project; - return _this; + + +/***/ }), + +/***/ 9310: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RetentionUnit = void 0; +var RetentionUnit; +(function (RetentionUnit) { + RetentionUnit["Days"] = "Days"; + RetentionUnit["Items"] = "Items"; +})(RetentionUnit = exports.RetentionUnit || (exports.RetentionUnit = {})); + + +/***/ }), + +/***/ 7758: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.OverwriteMode = void 0; +var OverwriteMode; +(function (OverwriteMode) { + OverwriteMode["FailIfExists"] = "FailIfExists"; + OverwriteMode["OverwriteExisting"] = "OverwriteExisting"; + OverwriteMode["IgnoreIfExists"] = "IgnoreIfExists"; +})(OverwriteMode = exports.OverwriteMode || (exports.OverwriteMode = {})); + + +/***/ }), + +/***/ 5207: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; } - DeployRelease.prototype.execute = function (version, channel, updateVariables) { - if (updateVariables === void 0) { updateVariables = false; } - return __awaiter(this, void 0, void 0, function () { - var channelResource, releaseToPromote; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - channelResource = undefined; - if (!channel) return [3 /*break*/, 2]; - return [4 /*yield*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.repository.channels.find(nameOrId)]; - case 1: return [2 /*return*/, _a.sent()]; - } - }); }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, this.repository.channels.get(id)]; - }); }); }, "Channels", "channel", channel.Name)]; - case 1: - channelResource = _a.sent(); - _a.label = 2; - case 2: return [4 /*yield*/, this.getReleaseByVersion(version, this.project, channelResource)]; - case 3: - releaseToPromote = _a.sent(); - if (!updateVariables) return [3 /*break*/, 5]; - console.debug("Updating the release variable snapshot with variables from the project"); - return [4 /*yield*/, this.repository.releases.snapshotVariables(releaseToPromote)]; - case 4: - _a.sent(); - _a.label = 5; - case 5: return [4 /*yield*/, this.deployRelease(this.project, releaseToPromote)]; - case 6: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - DeployRelease.prototype.getReleaseByVersion = function (versionNumber, project, channel) { - return __awaiter(this, void 0, void 0, function () { - var releaseToPromote, message, releases, compareFn_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - releaseToPromote = undefined; - if (!(versionNumber === "latest")) return [3 /*break*/, 7]; - message = channel === null ? "latest release for project" : "latest release in channel '".concat(channel === null || channel === void 0 ? void 0 : channel.Name, "'"); - console.debug("Finding ".concat(message, "...")); - return [4 /*yield*/, this.repository.projects.getReleases(project)]; - case 1: - releases = _a.sent(); - compareFn_1 = function (r1, r2) { - var r1Version = new semver_1.SemVer(r1.Version); - var r2Version = new semver_1.SemVer(r2.Version); - return r1Version.compare(r2Version); - }; - if (!(releases.TotalResults > 0)) return [3 /*break*/, 5]; - if (!(channel === undefined)) return [3 /*break*/, 2]; - releaseToPromote = releases.Items.sort(compareFn_1)[0]; - return [3 /*break*/, 4]; - case 2: return [4 /*yield*/, this.paginate(releases, this.repository, function (page) { - releaseToPromote = page.Items.sort(compareFn_1).find(function (r) { return r.ChannelId === channel.Id; }); - // If we haven't found one yet, keep paginating - return releaseToPromote === undefined; - })]; - case 3: - _a.sent(); - _a.label = 4; - case 4: return [3 /*break*/, 7]; - case 5: - console.debug("Finding release ".concat(versionNumber)); - return [4 /*yield*/, this.repository.projects.getReleaseByVersion(project, versionNumber)]; - case 6: - releaseToPromote = _a.sent(); - _a.label = 7; - case 7: - if (releaseToPromote === undefined) - throw new could_not_find_error_1.CouldNotFindError("the ".concat(project.Name)); - return [2 /*return*/, releaseToPromote]; - } - }); - }); - }; - DeployRelease.prototype.paginate = function (source, repository, getNextPage) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(getNextPage(source) && source.Items.length > 0 && source.Links["Page.Next"])) return [3 /*break*/, 2]; - return [4 /*yield*/, repository.client.get(source.Links["Page.Next"])]; - case 1: - source = _a.sent(); - return [3 /*break*/, 0]; - case 2: return [2 /*return*/]; - } - }); - }); - }; - return DeployRelease; -}(deployment_base_1.DeploymentBase)); + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(714), exports); +__exportStar(__nccwpck_require__(7857), exports); + + +/***/ }), + +/***/ 714: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 5548: +/***/ 7857: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -6963,649 +6091,271 @@ var __generator = (this && this.__generator) || function (thisArg, body) { if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; +var __values = (this && this.__values) || function(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."); +}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeploymentBase = void 0; -var form_1 = __nccwpck_require__(11110); -var moment_1 = __importDefault(__nccwpck_require__(99623)); -var could_not_find_error_1 = __nccwpck_require__(62407); -var throw_if_undefined_1 = __nccwpck_require__(70347); -var execution_resource_waiter_1 = __nccwpck_require__(59634); -function deploymentOptionsDefaults() { - return { - cancelOnTimeout: false, - deployTo: [], - deploymentCheckSleepCycle: 10000, - deploymentTimeout: 600000, - excludeMachines: [], - force: false, - forcePackageDownload: false, - noRawLog: false, - progress: true, - skipStepNames: [], - specificMachines: [], - tenantTags: [], - tenants: [], - variable: [], - waitForDeployment: false, - }; -} -var DeploymentBase = /** @class */ (function () { - function DeploymentBase(repository, serverUrl, deploymentConfiguration) { - this.repository = repository; - this.serverUrl = serverUrl; - this.deployments = []; - this.promotionTargets = []; - this.deploymentOptions = __assign(__assign({}, deploymentOptionsDefaults()), deploymentConfiguration); +exports.PackageRepository = void 0; +var fs_1 = __nccwpck_require__(7147); +var path_1 = __importDefault(__nccwpck_require__(1017)); +var form_data_1 = __importDefault(__nccwpck_require__(4334)); +var overwriteMode_1 = __nccwpck_require__(7758); +var spaceScopedRoutePrefix_1 = __nccwpck_require__(7218); +var spaceResolver_1 = __nccwpck_require__(2054); +var PackageRepository = /** @class */ (function () { + function PackageRepository(client, spaceName) { + this.client = client; + this.spaceName = spaceName; } - DeploymentBase.prototype.deployRelease = function (project, release) { - return __awaiter(this, void 0, void 0, function () { - var _a, _b, waiter; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - _a = this; - if (!(this.deploymentOptions.tenants.length > 0 || this.deploymentOptions.tenantTags.length > 0)) return [3 /*break*/, 2]; - return [4 /*yield*/, this.deployTenantedRelease(project, release)]; - case 1: - _b = _c.sent(); - return [3 /*break*/, 4]; - case 2: return [4 /*yield*/, this.deployToEnvironments(project, release)]; - case 3: - _b = _c.sent(); - _c.label = 4; - case 4: - _a.deployments = _b; - if (!(this.deployments.length > 0 && this.deploymentOptions.waitForDeployment)) return [3 /*break*/, 6]; - waiter = new execution_resource_waiter_1.ExecutionResourceWaiter(this.repository, this.serverUrl); - return [4 /*yield*/, waiter.waitForDeploymentToComplete(this.deployments, project, release, this.deploymentOptions.progress, this.deploymentOptions.noRawLog, this.deploymentOptions.rawLogFile, this.deploymentOptions.cancelOnTimeout, this.deploymentOptions.deploymentCheckSleepCycle, this.deploymentOptions.deploymentTimeout)]; - case 5: - _c.sent(); - _c.label = 6; - case 6: return [2 /*return*/]; - } - }); - }); - }; - DeploymentBase.prototype.getTenants = function (project, environmentName, release, releaseTemplate) { - return __awaiter(this, void 0, void 0, function () { - var deployableTenants, tenantPromotions, tenants, tenantsByNameOrId, unDeployableTenants, tenantsByTag, deployableByTag; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (this.deploymentOptions.tenants.length === 0 && this.deploymentOptions.tenantTags.length === 0) - return [2 /*return*/, []]; - deployableTenants = []; - if (!this.deploymentOptions.tenants.some(function (t) { return t.Id === "*"; })) return [3 /*break*/, 2]; - tenantPromotions = releaseTemplate.TenantPromotions.filter(function (tp) { - return tp.PromoteTo.some(function (promo) { - return promo.Name.localeCompare(environmentName, undefined, { - sensitivity: "accent", - }) === 0; - }); - }).map(function (tp) { return tp.Id; }); - return [4 /*yield*/, this.repository.tenants.all({ - ids: tenantPromotions, - })]; - case 1: - tenants = _a.sent(); - deployableTenants.push.apply(deployableTenants, tenants); - console.info("Found ".concat(deployableTenants.length, " tenant(s) who can deploy ").concat(project.Name, " ").concat(release.Version, " to ").concat(environmentName)); - return [3 /*break*/, 6]; - case 2: - if (!(this.deploymentOptions.tenants.length > 0)) return [3 /*break*/, 4]; - return [4 /*yield*/, this.repository.tenants.find(this.deploymentOptions.tenants.map(function (t) { return t.Id; }))]; - case 3: - tenantsByNameOrId = _a.sent(); - deployableTenants.push.apply(deployableTenants, tenantsByNameOrId); - unDeployableTenants = deployableTenants.filter(function (dt) { return !dt.ProjectEnvironments.hasOwnProperty(project.Id); }).map(function (dt) { return dt.Name; }); - if (unDeployableTenants.length > 0) - throw new Error("Release '".concat(release.Version, "' of project '").concat(project.Name, "' cannot be deployed for tenant").concat(unDeployableTenants.length === 1 ? "" : "s", " ").concat(unDeployableTenants.join(" or "), ". This may be because either a) ").concat(unDeployableTenants.length === 1 ? "it is" : "they are", " not connected to this project, or b) you do not have permission to deploy ").concat(unDeployableTenants.length === 1 ? "it" : "them", " to this project.")); - unDeployableTenants = deployableTenants - .filter(function (dt) { - var tenantPromo = releaseTemplate.TenantPromotions.find(function (tp) { return tp.Id === dt.Id; }); - return (tenantPromo === undefined || - !(tenantPromo === null || tenantPromo === void 0 ? void 0 : tenantPromo.PromoteTo.some(function (tdt) { - return tdt.Name.localeCompare(environmentName, undefined, { - sensitivity: "accent", - }) === 0; - }))); - }) - .map(function (dt) { return dt.Name; }); - if (unDeployableTenants.length > 0) - throw new Error("Release '".concat(release.Version, "' of project '").concat(project.Name, "' cannot be deployed for tenant").concat(unDeployableTenants.length === 1 ? "" : "s", " ").concat(unDeployableTenants.join(" or "), " to environment '").concat(environmentName, "'. This may be because a) the tenant").concat(unDeployableTenants.length === 1 ? "" : "s", " ").concat(unDeployableTenants.length === 1 ? "is" : "are", " not connected to this environment, a) the environment does not exist or is misspelled, b) The lifecycle has not reached this phase, possibly due to previous deployment failure, c) you don't have permission to deploy to this environment, d) the environment is not in the list of environments defined by the lifecycle, or e) ").concat(unDeployableTenants.length === 1 ? "it is" : "they are", " unable to deploy to this channel.")); - _a.label = 4; - case 4: - if (!(this.deploymentOptions.tenantTags.length > 0)) return [3 /*break*/, 6]; - return [4 /*yield*/, this.repository.tenants.list({ - tags: this.deploymentOptions.tenantTags.toString(), - take: this.repository.tenants.takeAll, - })]; - case 5: - tenantsByTag = _a.sent(); - deployableByTag = tenantsByTag.Items.filter(function (dt) { - var tenantPromo = releaseTemplate.TenantPromotions.find(function (tp) { return tp.Id === dt.Id; }); - return (tenantPromo !== undefined && - tenantPromo.PromoteTo.some(function (tdt) { - return tdt.Name.localeCompare(environmentName, undefined, { - sensitivity: "accent", - }) === 0; - })); - }).filter(function (tenant) { return !deployableTenants.some(function (deployable) { return deployable.Id === tenant.Id; }); }); - deployableTenants.push.apply(deployableTenants, deployableByTag); - _a.label = 6; - case 6: - if (deployableTenants.length === 0) - throw new Error("No tenants are available to be deployed for release '".concat(release.Version, "' of project '").concat(project.Name, "' to environment '").concat(environmentName, "'. This may be because a) No tenants matched the tags provided b) The tenants that do match are not connected to this project or environment, c) The tenants that do match are not yet able to release to this lifecycle phase, or d) you do not have the appropriate deployment permissions.")); - return [2 /*return*/, deployableTenants]; - } - }); - }); - }; - DeploymentBase.prototype.getSpecificMachines = function () { + PackageRepository.prototype.get = function (packageId) { return __awaiter(this, void 0, void 0, function () { - var specificMachineIds, machines_1, missing; + var response; return __generator(this, function (_a) { switch (_a.label) { case 0: - specificMachineIds = []; - if (!(this.deploymentOptions.specificMachines.length > 0)) return [3 /*break*/, 2]; - return [4 /*yield*/, this.repository.machines.all({ - ids: this.deploymentOptions.specificMachines, + if (!packageId) { + throw new Error("Package Id was not provided"); + } + return [4 /*yield*/, this.client.request("".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/packages{/packageId}"), { + spaceName: this.spaceName, + packageId: packageId, })]; case 1: - machines_1 = _a.sent(); - missing = this.deploymentOptions.specificMachines.filter(function (id) { return !machines_1.some(function (value) { return value.Id === id; }); }); - if (missing.length > 0) - throw could_not_find_error_1.CouldNotFindError.createResource("machine", missing.toString()); - specificMachineIds.push.apply(specificMachineIds, machines_1.map(function (m) { return m.Id; })); - _a.label = 2; - case 2: return [2 /*return*/, specificMachineIds]; + response = _a.sent(); + return [2 /*return*/, response]; } }); }); }; - DeploymentBase.prototype.getExcludedMachines = function () { + PackageRepository.prototype.list = function (args) { return __awaiter(this, void 0, void 0, function () { - var excludedMachineIds, machines_2, missing; + var response; return __generator(this, function (_a) { switch (_a.label) { - case 0: - excludedMachineIds = []; - if (!(this.deploymentOptions.excludeMachines.length > 0)) return [3 /*break*/, 2]; - return [4 /*yield*/, this.repository.machines.all({ - ids: this.deploymentOptions.excludeMachines, - })]; + case 0: return [4 /*yield*/, this.client.request("".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/packages{/id}{?nuGetPackageId,filter,latest,skip,take,includeNotes}"), __assign({ spaceName: this.spaceName }, args))]; case 1: - machines_2 = _a.sent(); - missing = this.deploymentOptions.excludeMachines.filter(function (id) { return !machines_2.some(function (value) { return value.Id === id; }); }); - if (missing.length > 0) - throw could_not_find_error_1.CouldNotFindError.createResource("machine", missing.toString()); - excludedMachineIds.push.apply(excludedMachineIds, machines_2.map(function (m) { return m.Id; })); - _a.label = 2; - case 2: return [2 /*return*/, excludedMachineIds]; + response = _a.sent(); + return [2 /*return*/, response]; } }); }); }; - DeploymentBase.prototype.logScheduledDeployment = function () { - if (this.deploymentOptions.deployAt) { - console.info("Deployment will be scheduled to start at ".concat(this.deploymentOptions.deployAt.toLocaleString())); - } - }; - DeploymentBase.prototype.createDeploymentTask = function (project, release, promotionTarget, specificMachineIds, excludedMachineIds, tenant) { - if (tenant === void 0) { tenant = undefined; } + PackageRepository.prototype.push = function (packages, overwriteMode) { + if (overwriteMode === void 0) { overwriteMode = overwriteMode_1.OverwriteMode.FailIfExists; } return __awaiter(this, void 0, void 0, function () { - var preview, skip, _loop_1, _i, _a, step, _loop_2, this_1, _b, _c, element, _d, _e, previewStep, deployment; - return __generator(this, function (_f) { - switch (_f.label) { - case 0: return [4 /*yield*/, this.repository.releases.getDeploymentPreview(promotionTarget)]; + var spaceId, tasks, packages_1, packages_1_1, packagePath; + var e_1, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: return [4 /*yield*/, (0, spaceResolver_1.resolveSpaceId)(this.client, this.spaceName)]; case 1: - preview = _f.sent(); - skip = []; - _loop_1 = function (step) { - var stepToExecute = preview.StepsToExecute.find(function (s) { return s.ActionName === step; }); - if (stepToExecute === undefined) { - console.warn("No step/action named '".concat(step, "' could be found when deploying to environment '").concat(promotionTarget.Name, "', so the step cannot be skipped.")); + spaceId = _b.sent(); + tasks = []; + try { + for (packages_1 = __values(packages), packages_1_1 = packages_1.next(); !packages_1_1.done; packages_1_1 = packages_1.next()) { + packagePath = packages_1_1.value; + tasks.push(this.packageUpload(spaceId, packagePath, overwriteMode)); } - else { - console.debug("Skipping step: ".concat(stepToExecute.ActionName)); - skip.push(stepToExecute.ActionId); - } - }; - for (_i = 0, _a = this.deploymentOptions.skipStepNames; _i < _a.length; _i++) { - step = _a[_i]; - _loop_1(step); } - // Validate form values supplied - if (preview.Form !== null && preview.Form.Elements !== null && preview.Form.Values !== null) { - _loop_2 = function (element) { - if (element.Control.Type !== form_1.ControlType.VariableValue) - return "continue"; - var variableInput = element.Control; - var value = this_1.deploymentOptions.variable.reduce(function (previousValue, currentValue) { - if (previousValue !== undefined) { - return previousValue; - } - var variableName = currentValue.name; - var variableValue = currentValue.value; - if (variableName === variableInput.Label) { - return variableValue.toString(); - } - if (variableName === variableInput.Name) { - return variableValue.toString(); - } - return undefined; - }, undefined); - if (value === undefined && element.IsValueRequired) - throw new Error("Please provide a variable for the prompted value ".concat(variableInput.Label)); - preview.Form.Values[element.Name] = value; - }; - this_1 = this; - for (_b = 0, _c = preview.Form.Elements; _b < _c.length; _b++) { - element = _c[_b]; - _loop_2(element); + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (packages_1_1 && !packages_1_1.done && (_a = packages_1.return)) _a.call(packages_1); } + finally { if (e_1) throw e_1.error; } } - // Log step with no machines - for (_d = 0, _e = preview.StepsToExecute; _d < _e.length; _d++) { - previewStep = _e[_d]; - if (previewStep.HasNoApplicableMachines) - console.warn("Warning: there are no applicable machines roles used by step ".concat(previewStep.ActionName)); - } - return [4 /*yield*/, this.repository.deployments.create({ - ProjectId: project.Id, - TenantId: tenant === null || tenant === void 0 ? void 0 : tenant.Id, - EnvironmentId: promotionTarget.Id, - SkipActions: skip, - ReleaseId: release.Id, - ForcePackageDownload: this.deploymentOptions.forcePackageDownload, - UseGuidedFailure: preview.UseGuidedFailureModeByDefault, - SpecificMachineIds: specificMachineIds, - ExcludedMachineIds: excludedMachineIds, - ForcePackageRedeployment: this.deploymentOptions.force, - FormValues: preview.Form.Values, - QueueTime: this.deploymentOptions.deployAt ? (0, moment_1.default)(this.deploymentOptions.deployAt) : undefined, - QueueTimeExpiry: this.deploymentOptions.noDeployAfter ? (0, moment_1.default)(this.deploymentOptions.noDeployAfter) : undefined, - })]; + return [4 /*yield*/, Promise.allSettled(tasks)]; case 2: - deployment = _f.sent(); - console.info("Deploying ".concat(project.Name, " ").concat(release.Version, " to: ").concat(promotionTarget.Name, " ").concat(tenant === undefined ? "" : "for ".concat(tenant.Name, " "), "(Guided Failure: ").concat(deployment.UseGuidedFailure ? "Enabled" : "Not Enabled", ")")); - return [2 /*return*/, deployment]; + _b.sent(); + this.client.info("Packages uploaded"); + return [2 /*return*/]; } }); }); }; - DeploymentBase.prototype.deployTenantedRelease = function (project, release) { + PackageRepository.prototype.packageUpload = function (spaceId, filePath, overwriteMode) { return __awaiter(this, void 0, void 0, function () { - var environment, releaseTemplate, deploymentTenants, specificMachineIds, excludedMachineIds, createTasks; - var _this = this; + var fileName; return __generator(this, function (_a) { switch (_a.label) { case 0: - if (this.deploymentOptions.deployTo.length !== 1) - return [2 /*return*/, []]; - return [4 /*yield*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.repository.environments.find([nameOrId])]; - case 1: return [2 /*return*/, (_a.sent()).find(function (v) { return v; })]; - } - }); }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, this.repository.environments.get(id)]; - }); }); }, "Environments", "Environment", this.deploymentOptions.deployTo[0].Name)]; + fileName = path_1.default.basename(filePath); + this.client.info("Uploading package, ".concat(fileName, "...")); + return [4 /*yield*/, this.upload(spaceId, filePath, fileName, overwriteMode)]; case 1: - environment = _a.sent(); - return [4 /*yield*/, this.repository.releases.getDeploymentTemplate(release)]; - case 2: - releaseTemplate = _a.sent(); - return [4 /*yield*/, this.getTenants(project, environment.Name, release, releaseTemplate)]; - case 3: - deploymentTenants = _a.sent(); - return [4 /*yield*/, this.getSpecificMachines()]; - case 4: - specificMachineIds = _a.sent(); - return [4 /*yield*/, this.getExcludedMachines()]; - case 5: - excludedMachineIds = _a.sent(); - this.logScheduledDeployment(); - createTasks = deploymentTenants.map(function (tenant) { return __awaiter(_this, void 0, void 0, function () { - var promotion; - var _a; - return __generator(this, function (_b) { - promotion = (_a = releaseTemplate.TenantPromotions.find(function (t) { return t.Id === tenant.Id; })) === null || _a === void 0 ? void 0 : _a.PromoteTo.find(function (tt) { - return tt.Name.localeCompare(environment.Name, undefined, { - sensitivity: "accent", - }) === 0; - }); - this.promotionTargets.push(promotion); - return [2 /*return*/, this.createDeploymentTask(project, release, promotion, specificMachineIds, excludedMachineIds, tenant)]; - }); - }); }); - return [4 /*yield*/, Promise.all(createTasks)]; - case 6: return [2 /*return*/, _a.sent()]; + _a.sent(); + return [2 /*return*/]; } }); }); }; - DeploymentBase.prototype.deployToEnvironments = function (project, release) { + PackageRepository.prototype.upload = function (spaceId, filePath, fileName, overwriteMode) { return __awaiter(this, void 0, void 0, function () { - var releaseTemplate, deployToEnvironments, promotingEnvironments, unknownEnvironments, specificMachineIds, excludedMachineIds, createTasks; - var _this = this; + var fd, data; return __generator(this, function (_a) { switch (_a.label) { case 0: - if (this.deploymentOptions.deployTo.length === 0) - return [2 /*return*/, []]; - return [4 /*yield*/, this.repository.releases.getDeploymentTemplate(release)]; + fd = new form_data_1.default(); + return [4 /*yield*/, fs_1.promises.readFile(filePath)]; case 1: - releaseTemplate = _a.sent(); - return [4 /*yield*/, this.repository.environments.find(this.deploymentOptions.deployTo.map(function (e) { return e.Name; }))]; - case 2: - deployToEnvironments = _a.sent(); - promotingEnvironments = deployToEnvironments.map(function (environment) { return ({ - name: environment.Name, - promotion: releaseTemplate.PromoteTo.find(function (p) { return p.Name === environment.Name; }), - }); }); - unknownEnvironments = promotingEnvironments.filter(function (p) { return p.promotion === undefined; }); - if (unknownEnvironments.length > 0) - throw new Error("Release '".concat(release.Version, "' of project '").concat(project.Name, "' cannot be deployed to ").concat(unknownEnvironments.length === 1 - ? "environment '".concat(unknownEnvironments[0].name, "' because the environment is") - : "environments ".concat(unknownEnvironments.map(function (e) { return "'".concat(e.name, "'"); }), " because the environments are"), " not in the list of environments that this release can be deployed to. This may be because a) the environment does not exist or is misspelled, b) The lifecycle has not reached this phase, possibly due to previous deployment failure, c) you don't have permission to deploy to this environment, or d) the environment is not in the list of environments defined by the lifecycle.")); - this.logScheduledDeployment(); - return [4 /*yield*/, this.getSpecificMachines()]; - case 3: - specificMachineIds = _a.sent(); - return [4 /*yield*/, this.getExcludedMachines()]; - case 4: - excludedMachineIds = _a.sent(); - createTasks = promotingEnvironments.map(function (promotion) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.promotionTargets.push(promotion.promotion); - return [2 /*return*/, this.createDeploymentTask(project, release, promotion.promotion, specificMachineIds, excludedMachineIds)]; - }); - }); }); - return [4 /*yield*/, Promise.all(createTasks)]; - case 5: return [2 /*return*/, _a.sent()]; + data = _a.sent(); + fd.append("fileToUpload", data, fileName); + return [2 /*return*/, this.client.post("".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/packages/raw{?overwriteMode}"), fd, { overwriteMode: overwriteMode, spaceId: spaceId })]; } }); }); }; - return DeploymentBase; + return PackageRepository; }()); -exports.DeploymentBase = DeploymentBase; +exports.PackageRepository = PackageRepository; /***/ }), -/***/ 32703: +/***/ 800: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Permission = void 0; +//Enums can't be keys in a dictionary so we might need to convert this to a list of static strings +var Permission; +(function (Permission) { + Permission["None"] = "None"; + Permission["AccountCreate"] = "AccountCreate"; + Permission["AccountDelete"] = "AccountDelete"; + Permission["AccountEdit"] = "AccountEdit"; + Permission["AccountView"] = "AccountView"; + Permission["ActionTemplateCreate"] = "ActionTemplateCreate"; + Permission["ActionTemplateDelete"] = "ActionTemplateDelete"; + Permission["ActionTemplateEdit"] = "ActionTemplateEdit"; + Permission["ActionTemplateView"] = "ActionTemplateView"; + Permission["AdministerSystem"] = "AdministerSystem"; + Permission["ArtifactCreate"] = "ArtifactCreate"; + Permission["ArtifactDelete"] = "ArtifactDelete"; + Permission["ArtifactEdit"] = "ArtifactEdit"; + Permission["ArtifactView"] = "ArtifactView"; + Permission["BuildInformationAdminister"] = "BuildInformationAdminister"; + Permission["BuildInformationPush"] = "BuildInformationPush"; + Permission["BuiltInFeedAdminister"] = "BuiltInFeedAdminister"; + Permission["BuiltInFeedDownload"] = "BuiltInFeedDownload"; + Permission["BuiltInFeedPush"] = "BuiltInFeedPush"; + Permission["CertificateCreate"] = "CertificateCreate"; + Permission["CertificateDelete"] = "CertificateDelete"; + Permission["CertificateEdit"] = "CertificateEdit"; + Permission["CertificateView"] = "CertificateView"; + Permission["CertificateExportPrivateKey"] = "CertificateExportPrivateKey"; + Permission["ConfigureServer"] = "ConfigureServer"; + Permission["DefectReport"] = "DefectReport"; + Permission["DefectResolve"] = "DefectResolve"; + Permission["DeploymentCreate"] = "DeploymentCreate"; + Permission["DeploymentDelete"] = "DeploymentDelete"; + Permission["DeploymentView"] = "DeploymentView"; + Permission["EnvironmentCreate"] = "EnvironmentCreate"; + Permission["EnvironmentDelete"] = "EnvironmentDelete"; + Permission["EnvironmentEdit"] = "EnvironmentEdit"; + Permission["EnvironmentView"] = "EnvironmentView"; + Permission["EventView"] = "EventView"; + Permission["FeedEdit"] = "FeedEdit"; + Permission["FeedView"] = "FeedView"; + Permission["InterruptionSubmit"] = "InterruptionSubmit"; + Permission["InterruptionView"] = "InterruptionView"; + Permission["InterruptionViewSubmitResponsible"] = "InterruptionViewSubmitResponsible"; + Permission["LibraryVariableSetCreate"] = "LibraryVariableSetCreate"; + Permission["LibraryVariableSetDelete"] = "LibraryVariableSetDelete"; + Permission["LibraryVariableSetEdit"] = "LibraryVariableSetEdit"; + Permission["LibraryVariableSetView"] = "LibraryVariableSetView"; + Permission["LifecycleCreate"] = "LifecycleCreate"; + Permission["LifecycleDelete"] = "LifecycleDelete"; + Permission["LifecycleEdit"] = "LifecycleEdit"; + Permission["LifecycleView"] = "LifecycleView"; + Permission["ReleaseCreate"] = "ReleaseCreate"; + Permission["ReleaseView"] = "ReleaseView"; + Permission["ReleaseEdit"] = "ReleaseEdit"; + Permission["ReleaseDelete"] = "ReleaseDelete"; + Permission["MachineCreate"] = "MachineCreate"; + Permission["MachineEdit"] = "MachineEdit"; + Permission["MachineView"] = "MachineView"; + Permission["MachineDelete"] = "MachineDelete"; + Permission["MachinePolicyCreate"] = "MachinePolicyCreate"; + Permission["MachinePolicyDelete"] = "MachinePolicyDelete"; + Permission["MachinePolicyEdit"] = "MachinePolicyEdit"; + Permission["MachinePolicyView"] = "MachinePolicyView"; + Permission["ProjectGroupCreate"] = "ProjectGroupCreate"; + Permission["ProjectGroupDelete"] = "ProjectGroupDelete"; + Permission["ProjectGroupEdit"] = "ProjectGroupEdit"; + Permission["ProjectGroupView"] = "ProjectGroupView"; + Permission["TenantCreate"] = "TenantCreate"; + Permission["TenantDelete"] = "TenantDelete"; + Permission["TenantEdit"] = "TenantEdit"; + Permission["TenantView"] = "TenantView"; + Permission["TagSetCreate"] = "TagSetCreate"; + Permission["TagSetDelete"] = "TagSetDelete"; + Permission["TagSetEdit"] = "TagSetEdit"; + Permission["ProcessEdit"] = "ProcessEdit"; + Permission["ProcessView"] = "ProcessView"; + Permission["ProjectCreate"] = "ProjectCreate"; + Permission["ProjectDelete"] = "ProjectDelete"; + Permission["ProjectEdit"] = "ProjectEdit"; + Permission["ProjectView"] = "ProjectView"; + Permission["ProxyCreate"] = "ProxyCreate"; + Permission["ProxyDelete"] = "ProxyDelete"; + Permission["ProxyEdit"] = "ProxyEdit"; + Permission["ProxyView"] = "ProxyView"; + Permission["RunbookEdit"] = "RunbookEdit"; + Permission["RunbookView"] = "RunbookView"; + Permission["RunbookRunCreate"] = "RunbookRunCreate"; + Permission["RunbookRunEdit"] = "RunbookRunEdit"; + Permission["RunbookRunView"] = "RunbookRunView"; + Permission["SpaceCreate"] = "SpaceCreate"; + Permission["SpaceDelete"] = "SpaceDelete"; + Permission["SpaceEdit"] = "SpaceEdit"; + Permission["SpaceView"] = "SpaceView"; + Permission["SubscriptionCreate"] = "SubscriptionCreate"; + Permission["SubscriptionDelete"] = "SubscriptionDelete"; + Permission["SubscriptionEdit"] = "SubscriptionEdit"; + Permission["SubscriptionView"] = "SubscriptionView"; + Permission["TaskCancel"] = "TaskCancel"; + Permission["TaskCreate"] = "TaskCreate"; + Permission["TaskEdit"] = "TaskEdit"; + Permission["TaskView"] = "TaskView"; + Permission["TeamCreate"] = "TeamCreate"; + Permission["TeamDelete"] = "TeamDelete"; + Permission["TeamEdit"] = "TeamEdit"; + Permission["TeamView"] = "TeamView"; + Permission["TriggerCreate"] = "TriggerCreate"; + Permission["TriggerDelete"] = "TriggerDelete"; + Permission["TriggerEdit"] = "TriggerEdit"; + Permission["TriggerView"] = "TriggerView"; + Permission["UserEdit"] = "UserEdit"; + Permission["UserInvite"] = "UserInvite"; + Permission["UserView"] = "UserView"; + Permission["UserRoleEdit"] = "UserRoleEdit"; + Permission["UserRoleView"] = "UserRoleView"; + Permission["VariableEdit"] = "VariableEdit"; + Permission["VariableEditUnscoped"] = "VariableEditUnscoped"; + Permission["VariableView"] = "VariableView"; + Permission["VariableViewUnscoped"] = "VariableViewUnscoped"; + Permission["WorkerEdit"] = "WorkerEdit"; + Permission["WorkerView"] = "WorkerView"; +})(Permission = exports.Permission || (exports.Permission = {})); /***/ }), -/***/ 59634: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (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()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; - } -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExecutionResourceWaiter = void 0; -var fs_1 = __nccwpck_require__(57147); -var ExecutionResourceWaiter = /** @class */ (function () { - function ExecutionResourceWaiter(repository, serverBaseUrl) { - this.repository = repository; - this.serverBaseUrl = serverBaseUrl; - } - ExecutionResourceWaiter.prototype.waitForDeploymentToComplete = function (resources, project, release, showProgress, noRawLog, rawLogFile, cancelOnTimeout, deploymentStatusCheckSleepCycle, deploymentTimeout) { - return __awaiter(this, void 0, void 0, function () { - var guidedFailureWarning; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - guidedFailureWarning = function (guidedFailureDeployment) { return __awaiter(_this, void 0, void 0, function () { - var environment; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.repository.client.get(this.repository.client.getLink("Environments"))]; - case 1: - environment = _a.sent(); - console.warn(" - ".concat(environment.Name, ": ").concat(this.getPortalUrl("/app#/projects/".concat(project.Slug, "/releases/").concat(release.Version, "/deployments/").concat(guidedFailureDeployment.Id)))); - return [2 /*return*/]; - } - }); - }); }; - return [4 /*yield*/, this.waitForExecutionToComplete(resources, showProgress, noRawLog, rawLogFile, cancelOnTimeout, deploymentStatusCheckSleepCycle, deploymentTimeout, guidedFailureWarning, "deployment")]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - ExecutionResourceWaiter.prototype.waitForCompletion = function (deploymentTasks, deploymentStatusCheckSleepCycle, deploymentTimeout) { - return __awaiter(this, void 0, void 0, function () { - var sleep, timeout, stop, _i, deploymentTasks_1, deploymentTask, task; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - sleep = function (ms) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, new Promise(function (r) { return setTimeout(r, ms); })]; - }); }); }; - timeout = new Promise(function (r) { return setTimeout(r, deploymentTimeout); }); - stop = false; - // eslint-disable-next-line github/no-then - timeout.then(function () { - stop = true; - }); - _i = 0, deploymentTasks_1 = deploymentTasks; - _a.label = 1; - case 1: - if (!(_i < deploymentTasks_1.length)) return [3 /*break*/, 6]; - deploymentTask = deploymentTasks_1[_i]; - _a.label = 2; - case 2: - if (!!stop) return [3 /*break*/, 5]; - return [4 /*yield*/, this.repository.tasks.get(deploymentTask.Id)]; - case 3: - task = _a.sent(); - if (task.IsCompleted) { - return [3 /*break*/, 5]; - } - return [4 /*yield*/, sleep(deploymentStatusCheckSleepCycle)]; - case 4: - _a.sent(); - return [3 /*break*/, 2]; - case 5: - _i++; - return [3 /*break*/, 1]; - case 6: return [2 /*return*/]; - } - }); - }); - }; - ExecutionResourceWaiter.prototype.waitForExecutionToComplete = function (resources, showProgress, noRawLog, rawLogFile, cancelOnTimeout, deploymentStatusCheckSleepCycle, deploymentTimeout, guidedFailureWarningGenerator, alias) { - return __awaiter(this, void 0, void 0, function () { - var getTasks, deploymentTasks, failed, _i, deploymentTasks_2, deploymentTask, updated, raw, er_1, er_2; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - getTasks = resources.map(function (dep) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, this.repository.tasks.get(dep.TaskId)]; - }); }); }); - return [4 /*yield*/, Promise.all(getTasks)]; - case 1: - deploymentTasks = _a.sent(); - if (showProgress && resources.length > 1) - console.info("Only progress of the first task (".concat(deploymentTasks[0].Name, ") will be shown")); - _a.label = 2; - case 2: - _a.trys.push([2, 15, , 16]); - console.info("Waiting for ".concat(deploymentTasks.length, " ").concat(alias, "(s) to complete...")); - return [4 /*yield*/, this.waitForCompletion(deploymentTasks, deploymentStatusCheckSleepCycle, deploymentTimeout)]; - case 3: - _a.sent(); - failed = false; - _i = 0, deploymentTasks_2 = deploymentTasks; - _a.label = 4; - case 4: - if (!(_i < deploymentTasks_2.length)) return [3 /*break*/, 14]; - deploymentTask = deploymentTasks_2[_i]; - return [4 /*yield*/, this.repository.tasks.get(deploymentTask.Id)]; - case 5: - updated = _a.sent(); - if (!updated.FinishedSuccessfully) return [3 /*break*/, 6]; - console.info("".concat(updated.Description, ": ").concat(updated.State)); - return [3 /*break*/, 13]; - case 6: - console.error("".concat(updated.Description, ": ").concat(updated.State, ", ").concat(updated.ErrorMessage)); - failed = true; - if (noRawLog) - return [3 /*break*/, 13]; - _a.label = 7; - case 7: - _a.trys.push([7, 12, , 13]); - return [4 /*yield*/, this.repository.tasks.getRaw(updated)]; - case 8: - raw = _a.sent(); - if (!rawLogFile) return [3 /*break*/, 10]; - return [4 /*yield*/, fs_1.promises.writeFile(rawLogFile, raw)]; - case 9: - _a.sent(); - return [3 /*break*/, 11]; - case 10: - console.error(raw); - _a.label = 11; - case 11: return [3 /*break*/, 13]; - case 12: - er_1 = _a.sent(); - if (er_1 instanceof Error) { - console.error("Could not retrieve raw log", er_1); - } - return [3 /*break*/, 13]; - case 13: - _i++; - return [3 /*break*/, 4]; - case 14: - if (failed) - throw new Error("One or more ".concat(alias, " tasks failed.")); - console.info("Done!"); - return [3 /*break*/, 16]; - case 15: - er_2 = _a.sent(); - if (er_2 instanceof Error) { - console.error("Failed!", er_2); - } - return [3 /*break*/, 16]; - case 16: return [2 /*return*/]; - } - }); - }); - }; - ExecutionResourceWaiter.prototype.cancelExecutionOnTimeoutIfRequested = function (deploymentTasks, cancelOnTimeout, alias) { - return __awaiter(this, void 0, void 0, function () { - var tasks; - var _this = this; - return __generator(this, function (_a) { - if (!cancelOnTimeout) - return [2 /*return*/]; - tasks = deploymentTasks.map(function (task) { return __awaiter(_this, void 0, void 0, function () { - var er_3; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - console.warn("Cancelling ".concat(alias, " task '{").concat(task.Description, "}'")); - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.repository.tasks.cancel(task)]; - case 2: - _a.sent(); - return [3 /*break*/, 4]; - case 3: - er_3 = _a.sent(); - if (er_3 instanceof Error) { - console.error("Failed to cancel ".concat(alias, " task '{").concat(task.Description, "}': {").concat(er_3.message, "}")); - } - return [3 /*break*/, 4]; - case 4: return [2 /*return*/]; - } - }); - }); }); - return [2 /*return*/, Promise.all(tasks)]; - }); - }); - }; - ExecutionResourceWaiter.prototype.printTaskOutput = function (taskResources) { - return __awaiter(this, void 0, void 0, function () { - var task; - return __generator(this, function (_a) { - task = taskResources[0]; - return [2 /*return*/, this.printTask(task)]; - }); - }); - }; - ExecutionResourceWaiter.prototype.printTask = function (task) { - console.info(task.Name); - }; - ExecutionResourceWaiter.prototype.getPortalUrl = function (path) { - if (!path.startsWith("/")) - path = "/".concat(path); - var uri = new URL(this.serverBaseUrl + path); - return uri.toString(); - }; - return ExecutionResourceWaiter; -}()); -exports.ExecutionResourceWaiter = ExecutionResourceWaiter; - - -/***/ }), - -/***/ 30642: +/***/ 1682: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -7625,19 +6375,124 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(92351), exports); -__exportStar(__nccwpck_require__(5548), exports); -__exportStar(__nccwpck_require__(32703), exports); -__exportStar(__nccwpck_require__(59634), exports); +__exportStar(__nccwpck_require__(4182), exports); +__exportStar(__nccwpck_require__(2930), exports); + + +/***/ }), + +/***/ 4182: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 2930: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + 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); + }; + return function (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 __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProjectGroupRepository = void 0; +var __1 = __nccwpck_require__(586); +var spaceScopedBasicRepository_1 = __nccwpck_require__(3496); +var ProjectGroupRepository = /** @class */ (function (_super) { + __extends(ProjectGroupRepository, _super); + function ProjectGroupRepository(client, spaceName) { + return _super.call(this, client, spaceName, "".concat(__1.spaceScopedRoutePrefix, "/projectgroups"), "skip,take,ids,partialName") || this; + } + return ProjectGroupRepository; +}(spaceScopedBasicRepository_1.SpaceScopedBasicRepository)); +exports.ProjectGroupRepository = ProjectGroupRepository; + + +/***/ }), + +/***/ 7397: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 7974: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 1067: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 5187: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 4143: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 77085: +/***/ 9075: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "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); +}; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); @@ -7649,22 +6504,150 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi if (k2 === undefined) k2 = k; o[k2] = m[k]; })); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (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; +}; +var __read = (this && this.__read) || function (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; +}; +var __spreadArray = (this && this.__spreadArray) || function (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)); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(62407), exports); -__exportStar(__nccwpck_require__(70067), exports); -__exportStar(__nccwpck_require__(30642), exports); -__exportStar(__nccwpck_require__(25605), exports); -__exportStar(__nccwpck_require__(42176), exports); -__exportStar(__nccwpck_require__(72092), exports); -__exportStar(__nccwpck_require__(70347), exports); +exports.InitialisePrimaryPackageReference = exports.SetPrimaryPackageReference = exports.SetNamedPackageReference = exports.GetNamedPackageReferences = exports.IsNamedPackageReference = exports.GetPrimaryPackageReference = exports.HasManualInterventionResponsibleTeams = exports.PackageReferenceNamesMatch = exports.RemovePrimaryPackageReference = exports.IsPrimaryPackageReference = exports.IsDeployReleaseAction = void 0; +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +var _ = __importStar(__nccwpck_require__(250)); +var feeds_1 = __nccwpck_require__(4962); +var packageAcquisitionLocation_1 = __nccwpck_require__(7266); +var packageReference_1 = __nccwpck_require__(7708); +function parseCSV(val) { + if (!val || val === "") { + return []; + } + return val.split(","); +} +function IsDeployReleaseAction(action) { + return !!action.Properties["Octopus.Action.DeployRelease.ProjectId"]; +} +exports.IsDeployReleaseAction = IsDeployReleaseAction; +function IsPrimaryPackageReference(pkg) { + return !pkg.Name; +} +exports.IsPrimaryPackageReference = IsPrimaryPackageReference; +function RemovePrimaryPackageReference(packages) { + return _.filter(packages, function (pkg) { return !IsPrimaryPackageReference(pkg); }); +} +exports.RemovePrimaryPackageReference = RemovePrimaryPackageReference; +// Returns true if the names match, where null and empty string are equivalent +function PackageReferenceNamesMatch(nameA, nameB) { + if (!nameA) { + return !nameB; + } + return nameA === nameB; +} +exports.PackageReferenceNamesMatch = PackageReferenceNamesMatch; +function HasManualInterventionResponsibleTeams(action) { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return _.some(parseCSV(action.Properties["Octopus.Action.Manual.ResponsibleTeamIds"])); +} +exports.HasManualInterventionResponsibleTeams = HasManualInterventionResponsibleTeams; +function GetPrimaryPackageReference(packages) { + return packages === null || packages === void 0 ? void 0 : packages.find(function (pkg) { return IsPrimaryPackageReference(pkg); }); +} +exports.GetPrimaryPackageReference = GetPrimaryPackageReference; +function IsNamedPackageReference(pkg) { + return !!pkg.Name; +} +exports.IsNamedPackageReference = IsNamedPackageReference; +function GetNamedPackageReferences(packages) { + return RemovePrimaryPackageReference(packages); +} +exports.GetNamedPackageReferences = GetNamedPackageReferences; +function SetNamedPackageReference(name, updated, packages) { + return _.map(packages, function (pkg) { + if (!PackageReferenceNamesMatch(name, pkg.Name)) { + return pkg; + } + return __assign(__assign({}, pkg), updated); + }); +} +exports.SetNamedPackageReference = SetNamedPackageReference; +function SetPrimaryPackageReference(updated, packages) { + return _.map(packages, function (pkg) { + if (!IsPrimaryPackageReference(pkg)) { + return pkg; + } + return __assign(__assign({}, pkg), updated); + }); +} +exports.SetPrimaryPackageReference = SetPrimaryPackageReference; +function InitialisePrimaryPackageReference(packages, feeds, itemsKeyedBy) { + var primaryPackage = GetPrimaryPackageReference(packages); + if (primaryPackage) { + if (!primaryPackage.Properties.SelectionMode) { + primaryPackage.Properties.SelectionMode = packageReference_1.PackageSelectionMode.Immediate; + } + return __spreadArray([], __read(packages), false); + } + var packagesWithoutDefault = RemovePrimaryPackageReference(packages); + var builtInFeed = feeds.find(function (f) { return f.FeedType === feeds_1.FeedType.BuiltIn; }); + var builtInFeedIdOrName = builtInFeed && builtInFeed[itemsKeyedBy]; + return __spreadArray([ + { + Id: null, + PackageId: null, + FeedId: builtInFeedIdOrName, + AcquisitionLocation: packageAcquisitionLocation_1.PackageAcquisitionLocation.Server, + Properties: { + SelectionMode: packageReference_1.PackageSelectionMode.Immediate, + }, + } + ], __read(packagesWithoutDefault), false); +} +exports.InitialisePrimaryPackageReference = InitialisePrimaryPackageReference; + + +/***/ }), + +/***/ 6989: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 25605: +/***/ 929: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -7680,46 +6663,68 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi if (k2 === undefined) k2 = k; o[k2] = m[k]; })); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (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; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(69100), exports); +exports.deploymentActionPackages = exports.displayName = void 0; +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +var _ = __importStar(__nccwpck_require__(250)); +function displayName(pkg) { + return !!pkg.PackageReference ? "".concat(pkg.DeploymentAction, "/").concat(pkg.PackageReference) : pkg.DeploymentAction; +} +exports.displayName = displayName; +function deploymentActionPackages(actions) { + return _.chain(actions) + .flatMap(function (action) { + return _.map(action.Packages, function (pkg) { return ({ + DeploymentAction: action.Name, + PackageReference: pkg.Name, + }); }); + }) + .value(); +} +exports.deploymentActionPackages = deploymentActionPackages; + + +/***/ }), + +/***/ 6259: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isDeploymentProcess = void 0; +var utils_1 = __nccwpck_require__(7132); +var runbookProcess_1 = __nccwpck_require__(1379); +function isDeploymentProcess(resource) { + if (resource === null || resource === undefined) { + return false; + } + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + var converted = resource; + return !(0, runbookProcess_1.isRunbookProcess)(resource) && converted.Version !== undefined && (0, utils_1.typeSafeHasOwnProperty)(converted, "Version"); +} +exports.isDeploymentProcess = isDeploymentProcess; /***/ }), -/***/ 69100: +/***/ 3958: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 = (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); -}; var __awaiter = (this && this.__awaiter) || function (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) { @@ -7757,109 +6762,230 @@ var __generator = (this && this.__generator) || function (thisArg, body) { } }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.promoteRelease = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var semver_1 = __nccwpck_require__(11383); -var clientConfiguration_1 = __nccwpck_require__(5966); -var dashboardRepository_1 = __nccwpck_require__(20009); -var could_not_find_error_1 = __nccwpck_require__(62407); -var deployment_base_1 = __nccwpck_require__(5548); -var throw_if_undefined_1 = __nccwpck_require__(70347); -function promoteRelease(repository, project, from, deployTo, lastSuccessful, updateVariables, deploymentOptions) { - return __awaiter(this, void 0, void 0, function () { - var proj, configuration; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, repository.projects.find(nameOrId)]; - }); }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, repository.projects.get(id)]; - }); }); }, "Projects", "project", project.Id)]; - case 1: - proj = _a.sent(); - configuration = (0, clientConfiguration_1.processConfiguration)(); - return [4 /*yield*/, new PromoteRelease(repository, configuration.apiUri, proj, deployTo, deploymentOptions).execute(from.Name, lastSuccessful, updateVariables)]; - case 2: - _a.sent(); - return [2 /*return*/]; - } - }); - }); -} -exports.promoteRelease = promoteRelease; -var PromoteRelease = /** @class */ (function (_super) { - __extends(PromoteRelease, _super); - function PromoteRelease(repository, serverUrl, project, deployTo, deploymentOptions) { - var _this = _super.call(this, repository, serverUrl, __assign(__assign({}, deploymentOptions), { deployTo: deployTo })) || this; - _this.project = project; - return _this; +exports.DeploymentProcessRepository = void 0; +var __1 = __nccwpck_require__(586); +var DeploymentProcessRepository = /** @class */ (function () { + function DeploymentProcessRepository(client, spaceName) { + this.client = client; + this.spaceName = spaceName; } - PromoteRelease.prototype.execute = function (from, useLatestSuccessfulRelease, updateVariables) { - if (useLatestSuccessfulRelease === void 0) { useLatestSuccessfulRelease = false; } - if (updateVariables === void 0) { updateVariables = false; } + DeploymentProcessRepository.prototype.get = function (project) { return __awaiter(this, void 0, void 0, function () { - var environment, dashboardItemsOptions, dashboard, compareFn, dashboardItems, dashboardItem, deploymentType, release; - var _this = this; + var response; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { - var results; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.repository.environments.find([nameOrId])]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.length > 0 ? results[0] : undefined]; - } - }); - }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, this.repository.environments.get(id)]; - }); }); }, "Environments", "environment", from)]; + case 0: return [4 /*yield*/, this.client.request("".concat(__1.spaceScopedRoutePrefix, "/projects/{projectId}/deploymentprocesses"), { + spaceName: this.spaceName, + projectId: project.Id, + })]; case 1: - environment = _a.sent(); - dashboardItemsOptions = useLatestSuccessfulRelease - ? dashboardRepository_1.DashboardItemsOptions.IncludeCurrentAndPreviousSuccessfulDeployment - : dashboardRepository_1.DashboardItemsOptions.IncludeCurrentDeploymentOnly; - return [4 /*yield*/, this.repository.dashboards.getDynamicDashboard([this.project.Id], [environment.Id], dashboardItemsOptions)]; - case 2: - dashboard = _a.sent(); - compareFn = function (r1, r2) { - var r1Version = new semver_1.SemVer(r1.ReleaseVersion); - var r2Version = new semver_1.SemVer(r2.ReleaseVersion); - return r1Version.compare(r2Version); - }; - dashboardItems = dashboard.Items.filter(function (e) { return e.EnvironmentId === environment.Id && e.ProjectId === _this.project.Id; }).sort(compareFn); - dashboardItem = useLatestSuccessfulRelease ? dashboardItems.filter(function (x) { return x.State === message_contracts_1.TaskState.Success; }).at(0) : dashboardItems.at(0); - if (dashboardItem === undefined) { - deploymentType = useLatestSuccessfulRelease ? "successful " : ""; - throw new could_not_find_error_1.CouldNotFindError("latest ".concat(deploymentType, "deployment of the project for this environment. Please check that a ").concat(deploymentType, " deployment for this project/environment exists on the dashboard.")); - } - console.debug("Finding release details for release ".concat(dashboardItem.ReleaseVersion)); - return [4 /*yield*/, this.repository.projects.getReleaseByVersion(this.project, dashboardItem.ReleaseVersion)]; - case 3: - release = _a.sent(); - if (!updateVariables) return [3 /*break*/, 5]; - console.debug("Updating the release variable snapshot with variables from the project"); - return [4 /*yield*/, this.repository.releases.snapshotVariables(release)]; - case 4: - _a.sent(); - _a.label = 5; - case 5: return [4 /*yield*/, this.deployRelease(this.project, release)]; - case 6: - _a.sent(); - return [2 /*return*/]; + response = _a.sent(); + return [2 /*return*/, response]; + } + }); + }); + }; + DeploymentProcessRepository.prototype.getByGitRef = function (project, gitRef) { + return __awaiter(this, void 0, void 0, function () { + var response; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.client.request("".concat(__1.spaceScopedRoutePrefix, "/projects/{projectId}/{gitRef}/deploymentprocesses"), { + spaceName: this.spaceName, + projectId: project.Id, + gitRef: gitRef, + })]; + case 1: + response = _a.sent(); + return [2 /*return*/, response]; + } + }); + }); + }; + DeploymentProcessRepository.prototype.update = function (project, deploymentProcess) { + return __awaiter(this, void 0, void 0, function () { + var response; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.client.doUpdate("".concat(__1.spaceScopedRoutePrefix, "/projects/{projectId}/deploymentprocesses"), deploymentProcess, { + spaceName: this.spaceName, + projectId: project.Id, + })]; + case 1: + response = _a.sent(); + return [2 /*return*/, response]; + } + }); + }); + }; + DeploymentProcessRepository.prototype.updateByGitRef = function (project, deploymentProcess, gitRef) { + return __awaiter(this, void 0, void 0, function () { + var response; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.client.doUpdate("".concat(__1.spaceScopedRoutePrefix, "/projects/{projectId}/{gitRef}/deploymentprocesses"), deploymentProcess, { + spaceName: this.spaceName, + projectId: project.Id, + gitRef: gitRef, + })]; + case 1: + response = _a.sent(); + return [2 /*return*/, response]; } }); }); }; - return PromoteRelease; -}(deployment_base_1.DeploymentBase)); + return DeploymentProcessRepository; +}()); +exports.DeploymentProcessRepository = DeploymentProcessRepository; + + +/***/ }), + +/***/ 6676: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.GuidedFailureMode = void 0; +var GuidedFailureMode; +(function (GuidedFailureMode) { + GuidedFailureMode["EnvironmentDefault"] = "EnvironmentDefault"; + GuidedFailureMode["Off"] = "Off"; + GuidedFailureMode["On"] = "On"; +})(GuidedFailureMode = exports.GuidedFailureMode || (exports.GuidedFailureMode = {})); + + +/***/ }), + +/***/ 5188: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PackageRequirement = exports.RunCondition = exports.StartTrigger = void 0; +var StartTrigger; +(function (StartTrigger) { + StartTrigger["StartWithPrevious"] = "StartWithPrevious"; + StartTrigger["StartAfterPrevious"] = "StartAfterPrevious"; +})(StartTrigger = exports.StartTrigger || (exports.StartTrigger = {})); +var RunCondition; +(function (RunCondition) { + RunCondition["Success"] = "Success"; + RunCondition["Failure"] = "Failure"; + RunCondition["Always"] = "Always"; + RunCondition["Variable"] = "Variable"; +})(RunCondition = exports.RunCondition || (exports.RunCondition = {})); +var PackageRequirement; +(function (PackageRequirement) { + PackageRequirement["LetOctopusDecide"] = "LetOctopusDecide"; + PackageRequirement["BeforePackageAcquisition"] = "BeforePackageAcquisition"; + PackageRequirement["AfterPackageAcquisition"] = "AfterPackageAcquisition"; +})(PackageRequirement = exports.PackageRequirement || (exports.PackageRequirement = {})); + + +/***/ }), + +/***/ 7274: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(7974), exports); +__exportStar(__nccwpck_require__(1067), exports); +__exportStar(__nccwpck_require__(4143), exports); +__exportStar(__nccwpck_require__(5187), exports); +__exportStar(__nccwpck_require__(9075), exports); +__exportStar(__nccwpck_require__(6989), exports); +__exportStar(__nccwpck_require__(929), exports); +__exportStar(__nccwpck_require__(6259), exports); +__exportStar(__nccwpck_require__(3958), exports); +__exportStar(__nccwpck_require__(6676), exports); +__exportStar(__nccwpck_require__(5188), exports); +__exportStar(__nccwpck_require__(7266), exports); +__exportStar(__nccwpck_require__(7708), exports); +__exportStar(__nccwpck_require__(6057), exports); + + +/***/ }), + +/***/ 7266: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PackageAcquisitionLocation = void 0; +var PackageAcquisitionLocation; +(function (PackageAcquisitionLocation) { + PackageAcquisitionLocation["Server"] = "Server"; + PackageAcquisitionLocation["ExecutionTarget"] = "ExecutionTarget"; + PackageAcquisitionLocation["NotAcquired"] = "NotAcquired"; +})(PackageAcquisitionLocation = exports.PackageAcquisitionLocation || (exports.PackageAcquisitionLocation = {})); + + +/***/ }), + +/***/ 7708: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PackageSelectionMode = void 0; +var PackageSelectionMode; +(function (PackageSelectionMode) { + PackageSelectionMode["Immediate"] = "immediate"; + PackageSelectionMode["Deferred"] = "deferred"; +})(PackageSelectionMode = exports.PackageSelectionMode || (exports.PackageSelectionMode = {})); + + +/***/ }), + +/***/ 6057: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RunConditionForAction = void 0; +var RunConditionForAction; +(function (RunConditionForAction) { + RunConditionForAction["Success"] = "Success"; + RunConditionForAction["Variable"] = "Variable"; +})(RunConditionForAction = exports.RunConditionForAction || (exports.RunConditionForAction = {})); + + +/***/ }), + +/***/ 9259: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 42176: +/***/ 9659: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -7879,16 +7005,175 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(99606), exports); +__exportStar(__nccwpck_require__(7274), exports); +__exportStar(__nccwpck_require__(3820), exports); +__exportStar(__nccwpck_require__(5068), exports); +__exportStar(__nccwpck_require__(7397), exports); +__exportStar(__nccwpck_require__(9259), exports); +__exportStar(__nccwpck_require__(7748), exports); +__exportStar(__nccwpck_require__(3041), exports); +__exportStar(__nccwpck_require__(5469), exports); + + +/***/ }), + +/***/ 7748: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* eslint-disable @typescript-eslint/no-explicit-any */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getBranchNameFromRouteParameter = exports.getURISafeBranchName = exports.isVcsBranchResource = exports.NewProject = exports.HasVersionControlledPersistenceSettings = exports.IsUsingUsernamePasswordAuth = exports.AuthenticationType = exports.PersistenceSettingsType = void 0; +var PersistenceSettingsType; +(function (PersistenceSettingsType) { + PersistenceSettingsType["VersionControlled"] = "VersionControlled"; + PersistenceSettingsType["Database"] = "Database"; +})(PersistenceSettingsType = exports.PersistenceSettingsType || (exports.PersistenceSettingsType = {})); +var AuthenticationType; +(function (AuthenticationType) { + AuthenticationType["Anonymous"] = "Anonymous"; + AuthenticationType["UsernamePassword"] = "UsernamePassword"; +})(AuthenticationType = exports.AuthenticationType || (exports.AuthenticationType = {})); +function IsUsingUsernamePasswordAuth(T) { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return T.Type === AuthenticationType.UsernamePassword; +} +exports.IsUsingUsernamePasswordAuth = IsUsingUsernamePasswordAuth; +function HasVersionControlledPersistenceSettings(T) { + return T.Type === PersistenceSettingsType.VersionControlled; +} +exports.HasVersionControlledPersistenceSettings = HasVersionControlledPersistenceSettings; +function NewProject(name, projectGroup, lifecycle) { + return { + LifecycleId: lifecycle.Id, + Name: name, + ProjectGroupId: projectGroup.Id, + }; +} +exports.NewProject = NewProject; +function isVcsBranchResource(branch) { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return branch.Name !== undefined; +} +exports.isVcsBranchResource = isVcsBranchResource; +function getURISafeBranchName(branch) { + return encodeURIComponent(branch.Name); +} +exports.getURISafeBranchName = getURISafeBranchName; +function getBranchNameFromRouteParameter(routeParameter) { + if (routeParameter) { + return decodeURIComponent(routeParameter); + } + return undefined; +} +exports.getBranchNameFromRouteParameter = getBranchNameFromRouteParameter; + + +/***/ }), + +/***/ 3041: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + 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); + }; + return function (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 __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProjectRepository = void 0; +var spaceScopedBasicRepository_1 = __nccwpck_require__(3496); +var __1 = __nccwpck_require__(586); +var ProjectRepository = /** @class */ (function (_super) { + __extends(ProjectRepository, _super); + function ProjectRepository(client, spaceName) { + return _super.call(this, client, spaceName, "".concat(__1.spaceScopedRoutePrefix, "/projects"), "skip,take,ids,partialName,clonedFromProjectId") || this; + } + return ProjectRepository; +}(spaceScopedBasicRepository_1.SpaceScopedBasicRepository)); +exports.ProjectRepository = ProjectRepository; + + +/***/ }), + +/***/ 7650: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 4213: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 7: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 3565: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 9198: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 99606: +/***/ 3227: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "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); +}; var __awaiter = (this && this.__awaiter) || function (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) { @@ -7926,50 +7211,121 @@ var __generator = (this && this.__generator) || function (thisArg, body) { } }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.pushBuildInformation = void 0; -var packageRepository_1 = __nccwpck_require__(53378); -var connect_1 = __nccwpck_require__(46890); -function pushBuildInformation(space, packages, buildInformation, overwriteMode) { - if (overwriteMode === void 0) { overwriteMode = packageRepository_1.OverwriteMode.FailIfExists; } - return __awaiter(this, void 0, void 0, function () { - var repository, tasks, _i, packages_1, pkg; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, connect_1.connect)(space)]; - case 1: - repository = (_a.sent())[0]; - tasks = []; - for (_i = 0, packages_1 = packages; _i < packages_1.length; _i++) { - pkg = packages_1[_i]; - tasks.push(repository.buildInformation.create({ - PackageId: pkg.id, - Version: pkg.version, - OctopusBuildInformation: { - Branch: buildInformation.branch, - BuildEnvironment: buildInformation.buildEnvironment, - BuildNumber: buildInformation.buildNumber, - BuildUrl: buildInformation.buildUrl, - Commits: buildInformation.commits.map(function (c) { return ({ Id: c.id, Comment: c.comment }); }), - VcsCommitNumber: buildInformation.vcsCommitNumber, - VcsRoot: buildInformation.vcsRoot, - VcsType: buildInformation.vcsType, - }, - }, { overwriteMode: overwriteMode })); - } - return [4 /*yield*/, Promise.all(tasks)]; - case 2: - _a.sent(); - return [2 /*return*/]; - } +exports.DeploymentRepository = void 0; +var __1 = __nccwpck_require__(586); +var DeploymentRepository = /** @class */ (function () { + function DeploymentRepository(client, spaceName) { + this.baseApiPathTemplate = "".concat(__1.spaceScopedRoutePrefix, "/deployments"); + this.client = client; + this.spaceName = spaceName; + } + DeploymentRepository.prototype.get = function (id) { + return this.client.request("".concat(this.baseApiPathTemplate, "/").concat(id), { spaceName: this.spaceName }); + }; + DeploymentRepository.prototype.list = function (args) { + return this.client.request("".concat(this.baseApiPathTemplate, "{?skip,take,ids,projects,environments,tenants,channels,taskState}"), __assign({ spaceName: this.spaceName }, args)); + }; + DeploymentRepository.prototype.create = function (command) { + return __awaiter(this, void 0, void 0, function () { + var response, mappedTasks; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + this.client.debug("Deploying a release..."); + return [4 /*yield*/, this.client.doCreate("".concat(this.baseApiPathTemplate, "/create/untenanted/v1"), __assign({ spaceIdOrName: command.spaceName }, command))]; + case 1: + response = _a.sent(); + if (response.DeploymentServerTasks.length == 0) { + throw new Error("No server task details returned"); + } + mappedTasks = response.DeploymentServerTasks.map(function (x) { + return { + DeploymentId: x.DeploymentId || x.deploymentId, + ServerTaskId: x.ServerTaskId || x.serverTaskId, + }; + }); + this.client.debug("Deployment(s) created successfully. [".concat(mappedTasks.map(function (t) { return t.ServerTaskId; }).join(", "), "]")); + return [2 /*return*/, { + DeploymentServerTasks: mappedTasks, + }]; + } + }); }); - }); -} -exports.pushBuildInformation = pushBuildInformation; + }; + DeploymentRepository.prototype.createTenanted = function (command) { + return __awaiter(this, void 0, void 0, function () { + var response, mappedTasks; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + this.client.debug("Deploying a tenanted release..."); + return [4 /*yield*/, this.client.doCreate("".concat(this.baseApiPathTemplate, "/create/tenanted/v1"), __assign({ spaceIdOrName: command.spaceName }, command))]; + case 1: + response = _a.sent(); + if (response.DeploymentServerTasks.length == 0) { + throw new Error("No server task details returned"); + } + mappedTasks = response.DeploymentServerTasks.map(function (x) { + return { + DeploymentId: x.DeploymentId || x.deploymentId, + ServerTaskId: x.ServerTaskId || x.serverTaskId, + }; + }); + this.client.debug("Tenanted Deployment(s) created successfully. [".concat(mappedTasks.map(function (t) { return t.ServerTaskId; }).join(", "), "]")); + return [2 /*return*/, { + DeploymentServerTasks: mappedTasks, + }]; + } + }); + }); + }; + return DeploymentRepository; +}()); +exports.DeploymentRepository = DeploymentRepository; + + +/***/ }), + +/***/ 5952: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 3921: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(7), exports); +__exportStar(__nccwpck_require__(3565), exports); +__exportStar(__nccwpck_require__(9198), exports); +__exportStar(__nccwpck_require__(3227), exports); +__exportStar(__nccwpck_require__(5952), exports); /***/ }), -/***/ 72092: +/***/ 3820: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -7989,16 +7345,41 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(64833), exports); +__exportStar(__nccwpck_require__(3921), exports); +__exportStar(__nccwpck_require__(7650), exports); +__exportStar(__nccwpck_require__(4213), exports); +__exportStar(__nccwpck_require__(7448), exports); +__exportStar(__nccwpck_require__(8566), exports); + + +/***/ }), + +/***/ 7448: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 64833: +/***/ 8566: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "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); +}; var __awaiter = (this && this.__awaiter) || function (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) { @@ -8035,63 +7416,125 @@ var __generator = (this && this.__generator) || function (thisArg, body) { if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.pushPackage = void 0; -var fs_1 = __nccwpck_require__(57147); -var readFile = fs_1.promises.readFile; -var path_1 = __importDefault(__nccwpck_require__(71017)); -var packageRepository_1 = __nccwpck_require__(53378); -var connect_1 = __nccwpck_require__(46890); -function pushPackage(space, packages, overwriteMode) { - if (overwriteMode === void 0) { overwriteMode = packageRepository_1.OverwriteMode.FailIfExists; } - return __awaiter(this, void 0, void 0, function () { - function uploadPackage(filePath) { - return __awaiter(this, void 0, void 0, function () { - var buffer, fileName; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, readFile(filePath)]; - case 1: - buffer = _a.sent(); - fileName = path_1.default.basename(filePath); - console.log("Uploading package, ".concat(fileName, "...")); - return [4 /*yield*/, repository.packages.upload(new File([buffer], fileName), overwriteMode)]; - case 2: - _a.sent(); - return [2 /*return*/]; - } - }); +exports.ReleaseRepository = void 0; +var __1 = __nccwpck_require__(586); +var ReleaseRepository = /** @class */ (function () { + function ReleaseRepository(client, spaceName) { + this.client = client; + this.spaceName = spaceName; + } + ReleaseRepository.prototype.create = function (command) { + return __awaiter(this, void 0, void 0, function () { + var response; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + this.client.debug("Creating a release..."); + return [4 /*yield*/, this.client.doCreate("".concat(__1.spaceScopedRoutePrefix, "/releases/create/v1"), __assign({ spaceIdOrName: command.spaceName }, command))]; + case 1: + response = _a.sent(); + this.client.debug("Release created successfully."); + return [2 /*return*/, response]; + } }); - } - var repository, tasks, _i, packages_1, packagePath; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, connect_1.connect)(space)]; - case 1: - repository = (_a.sent())[0]; - tasks = []; - for (_i = 0, packages_1 = packages; _i < packages_1.length; _i++) { - packagePath = packages_1[_i]; - tasks.push(uploadPackage(packagePath)); - } - return [4 /*yield*/, Promise.all(tasks)]; - case 2: - _a.sent(); - console.log("Packages uploaded"); - return [2 /*return*/]; - } }); - }); + }; + return ReleaseRepository; +}()); +exports.ReleaseRepository = ReleaseRepository; + + +/***/ }), + +/***/ 5068: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(7890), exports); +__exportStar(__nccwpck_require__(9664), exports); +__exportStar(__nccwpck_require__(9825), exports); +__exportStar(__nccwpck_require__(1379), exports); +__exportStar(__nccwpck_require__(4916), exports); +__exportStar(__nccwpck_require__(8920), exports); +__exportStar(__nccwpck_require__(3196), exports); +__exportStar(__nccwpck_require__(2938), exports); +__exportStar(__nccwpck_require__(7068), exports); + + +/***/ }), + +/***/ 9664: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 9825: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RunbookEnvironmentScope = void 0; +var RunbookEnvironmentScope; +(function (RunbookEnvironmentScope) { + RunbookEnvironmentScope["All"] = "All"; + RunbookEnvironmentScope["Specified"] = "Specified"; + RunbookEnvironmentScope["FromProjectLifecycles"] = "FromProjectLifecycles"; +})(RunbookEnvironmentScope = exports.RunbookEnvironmentScope || (exports.RunbookEnvironmentScope = {})); + + +/***/ }), + +/***/ 1379: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.processResourcePermission = exports.isRunbookProcess = void 0; +var utils_1 = __nccwpck_require__(7132); +var permission_1 = __nccwpck_require__(800); +function isRunbookProcess(resource) { + if (resource === null || resource === undefined) { + return false; + } + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + var converted = resource; + return converted.RunbookId !== undefined && (0, utils_1.typeSafeHasOwnProperty)(converted, "RunbookId"); +} +exports.isRunbookProcess = isRunbookProcess; +function processResourcePermission(resource) { + var isRunbook = isRunbookProcess(resource); + return isRunbook ? permission_1.Permission.RunbookEdit : permission_1.Permission.ProcessEdit; } -exports.pushPackage = pushPackage; +exports.processResourcePermission = processResourcePermission; /***/ }), -/***/ 70347: +/***/ 4916: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -8133,229 +7576,56 @@ var __generator = (this && this.__generator) || function (thisArg, body) { } }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.throwIfUndefined = void 0; -var could_not_find_error_1 = __nccwpck_require__(62407); -function throwIfUndefined( -// eslint-disable-next-line no-shadow -findPromise, getPromise, resourceTypeIdPrefix, resourceTypeDisplayName, nameOrId, enclosingContextDescription, skipLog) { - if (enclosingContextDescription === void 0) { enclosingContextDescription = ""; } - if (skipLog === void 0) { skipLog = false; } - return __awaiter(this, void 0, void 0, function () { - var escapeRegExp, resourceById, _a, resourceByName, _b, found; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - escapeRegExp = function (text) { - return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string - }; - if (!!new RegExp("^".concat(escapeRegExp(resourceTypeIdPrefix), "-/d+$")).test(nameOrId)) return [3 /*break*/, 1]; - resourceById = undefined; - return [3 /*break*/, 4]; - case 1: - _c.trys.push([1, 3, , 4]); - return [4 /*yield*/, getPromise(nameOrId)]; - case 2: - resourceById = _c.sent(); - return [3 /*break*/, 4]; - case 3: - _a = _c.sent(); - resourceById = undefined; - return [3 /*break*/, 4]; - case 4: - _c.trys.push([4, 6, , 7]); - return [4 /*yield*/, findPromise(nameOrId)]; - case 5: - resourceByName = _c.sent(); - return [3 /*break*/, 7]; - case 6: - _b = _c.sent(); - resourceByName = undefined; - return [3 /*break*/, 7]; - case 7: - if (resourceById === undefined && resourceByName === undefined) - throw could_not_find_error_1.CouldNotFindError.createResource(resourceTypeDisplayName, nameOrId, enclosingContextDescription); - if (resourceById !== undefined && resourceByName !== undefined && resourceById.Id !== resourceByName.Id) - throw new Error("Ambiguous ".concat(resourceTypeDisplayName, " reference '").concat(nameOrId, "' matches both '").concat(resourceById.Name, "' (").concat(resourceById.Id, ") and '").concat(resourceByName.Name, "' (").concat(resourceByName.Id, ").")); - found = resourceById !== null && resourceById !== void 0 ? resourceById : resourceByName; - if (found === undefined) { - throw could_not_find_error_1.CouldNotFindError.createResource(resourceTypeDisplayName, nameOrId, enclosingContextDescription); - } - return [2 /*return*/, found]; - } +exports.RunbookProcessRepository = void 0; +var spaceScopedRoutePrefix_1 = __nccwpck_require__(7218); +var RunbookProcessRepository = /** @class */ (function () { + function RunbookProcessRepository(client, spaceName, project) { + this.client = client; + this.spaceName = spaceName; + this.projectId = project.Id; + } + RunbookProcessRepository.prototype.get = function (runbook) { + return __awaiter(this, void 0, void 0, function () { + var response; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.client.request("".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/projects/{projectId}/runbookProcesses{/id}"), { + spaceName: this.spaceName, + projectId: this.projectId, + id: runbook.RunbookProcessId, + })]; + case 1: + response = _a.sent(); + return [2 /*return*/, response]; + } + }); }); - }); -} -exports.throwIfUndefined = throwIfUndefined; - - -/***/ }), - -/***/ 9507: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AccountRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var AccountRepository = /** @class */ (function (_super) { - __extends(AccountRepository, _super); - function AccountRepository(client) { - return _super.call(this, "Accounts", client) || this; - } - AccountRepository.prototype.getAccountUsages = function (account) { - return this.client.get(account.Links["Usages"]); - }; - AccountRepository.prototype.getFabricApplications = function (account) { - return this.client.get(account.Links["FabricApplications"]); - }; - AccountRepository.prototype.getIsolatedAzureEnvironments = function () { - return this.client.get(this.client.getLink("AzureEnvironments")); - }; - AccountRepository.prototype.getResourceGroups = function (account) { - return this.client.get(account.Links["ResourceGroups"]); - }; - AccountRepository.prototype.getStorageAccounts = function (account) { - return this.client.get(account.Links["StorageAccounts"]); - }; - AccountRepository.prototype.getWebSites = function (account) { - return this.client.get(account.Links["WebSites"]); - }; - AccountRepository.prototype.getWebSiteSlots = function (account, resourceGroupName, webSiteName) { - var args = { resourceGroupName: resourceGroupName, webSiteName: webSiteName }; - return this.client.get(account.Links["WebSiteSlots"], args); - }; - return AccountRepository; -}(basicRepository_1.BasicRepository)); -exports.AccountRepository = AccountRepository; - - -/***/ }), - -/***/ 67895: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 = (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 })); -exports.ActionTemplateRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var ActionTemplateRepository = /** @class */ (function (_super) { - __extends(ActionTemplateRepository, _super); - function ActionTemplateRepository(client) { - return _super.call(this, "ActionTemplates", client) || this; - } - ActionTemplateRepository.prototype.categories = function () { - return this.client.get(this.client.getLink("ActionTemplatesCategories")); - }; - ActionTemplateRepository.prototype.getByCommunityTemplate = function (communityTemplate) { - var allArgs = __assign({}, { id: communityTemplate.Id }); - return this.client.get(communityTemplate.Links["InstalledTemplate"], allArgs); - }; - ActionTemplateRepository.prototype.getUsage = function (template) { - return this.client.get(template.Links["Usage"]); - }; - ActionTemplateRepository.prototype.getVersion = function (actionTemplate, version) { - return this.client.get(actionTemplate.Links["Versions"], { version: version }); - }; - ActionTemplateRepository.prototype.search = function (args) { - return this.client.get(this.client.getLink("ActionTemplatesSearch"), args); }; - ActionTemplateRepository.prototype.updateActions = function (actionTemplate, actionsToUpdate, defaults, overrides) { - if (defaults === void 0) { defaults = {}; } - if (overrides === void 0) { overrides = {}; } - var resource = { - ActionsToUpdate: actionsToUpdate, - Overrides: overrides || {}, - DefaultPropertyValues: defaults || {}, - Version: actionTemplate.Version, - }; - return this.client.post(actionTemplate.Links["ActionsUpdate"], resource); - }; - return ActionTemplateRepository; -}(basicRepository_1.BasicRepository)); -exports.ActionTemplateRepository = ActionTemplateRepository; - - -/***/ }), - -/***/ 89463: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); + RunbookProcessRepository.prototype.update = function (runbookProcess) { + return __awaiter(this, void 0, void 0, function () { + var response; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.client.doUpdate("".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/projects/{projectId}/runbookProcesses{/id}"), runbookProcess, { + spaceName: this.spaceName, + projectId: this.projectId, + id: runbookProcess.Id, + })]; + case 1: + response = _a.sent(); + return [2 /*return*/, response]; + } + }); + }); }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ArtifactRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var ArtifactRepository = /** @class */ (function (_super) { - __extends(ArtifactRepository, _super); - function ArtifactRepository(client) { - return _super.call(this, "Artifacts", client) || this; - } - return ArtifactRepository; -}(basicRepository_1.BasicRepository)); -exports.ArtifactRepository = ArtifactRepository; + return RunbookProcessRepository; +}()); +exports.RunbookProcessRepository = RunbookProcessRepository; /***/ }), -/***/ 42583: +/***/ 8920: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -8376,278 +7646,46 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AuthenticationRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var AuthenticationRepository = /** @class */ (function (_super) { - __extends(AuthenticationRepository, _super); - function AuthenticationRepository(client) { - return _super.call(this, "Authentication", client) || this; - } - AuthenticationRepository.prototype.get = function () { - return this.client.get(this.client.getLink("Authentication")); - }; - AuthenticationRepository.prototype.wasLoginInitiated = function (encodedQueryString) { - return this.client.post(this.client.getLink("LoginInitiated"), { EncodedQueryString: encodedQueryString }); - }; - return AuthenticationRepository; -}(basicRepository_1.BasicRepository)); -exports.AuthenticationRepository = AuthenticationRepository; - - -/***/ }), - -/***/ 30970: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"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 })); -exports.BasicRepository = void 0; -var lodash_1 = __nccwpck_require__(90250); -// Repositories provide a helpful abstraction around the Octopus Deploy API -var BasicRepository = /** @class */ (function () { - function BasicRepository(collectionLinkName, client) { - var _this = this; - this.takeAll = 2147483647; - this.takeDefaultPageSize = 30; - this.notifySubscribersToDataModifications = function (resource) { - Object.keys(_this.subscribersToDataModifications).forEach(function (key) { return _this.subscribersToDataModifications[key](resource); }); - return resource; - }; - this.collectionLinkName = collectionLinkName; - this.client = client; - this.subscribersToDataModifications = {}; +exports.RunbookRepository = void 0; +var spaceScopedRoutePrefix_1 = __nccwpck_require__(7218); +var spaceScopedBasicRepository_1 = __nccwpck_require__(3496); +var RunbookRepository = /** @class */ (function (_super) { + __extends(RunbookRepository, _super); + function RunbookRepository(client, spaceName, project) { + return _super.call(this, client, spaceName, "".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/projects/").concat(project.Id, "/runbooks"), "skip,take,ids,partialName") || this; } - BasicRepository.prototype.all = function (args) { - if (args !== undefined && args.ids instanceof Array && args.ids.length === 0) { - return new Promise(function (res) { - res([]); - }); - } - // http.sys has a max query string of about 16k chars. Our typical max id length is 50 chars - // so if we are doing requests by id and have more than 300, split into multiple requests - var maxIds = 300; - if (args !== undefined && args.ids instanceof Array && args.ids.length > maxIds) { - return this.batchRequestsById(args, maxIds); - } - var allArgs = this.extend(args || {}, { id: "all" }); - return this.client.get(this.client.getLink(this.collectionLinkName), allArgs); - }; - BasicRepository.prototype.allById = function (args) { - return this.all(args).then(function (result) { - return result.reduce(function (acc, resource) { - acc[resource.Id] = resource; - return acc; - }, {}); - }); - }; - BasicRepository.prototype.del = function (resource) { - var _this = this; - return this.client.del(resource.Links.Self).then(function (d) { return _this.notifySubscribersToDataModifications(resource); }); - }; - BasicRepository.prototype.create = function (resource, args) { - var _this = this; - return this.client - .create(this.client.getLink(this.collectionLinkName), resource, args) - .then(function (r) { return _this.notifySubscribersToDataModifications(r); }); - }; - BasicRepository.prototype.get = function (id, args) { - var allArgs = this.extend(args || {}, { id: id }); - return this.client.get(this.client.getLink(this.collectionLinkName), allArgs); - }; - BasicRepository.prototype.list = function (args) { - return this.client.get(this.client.getLink(this.collectionLinkName), args); - }; - BasicRepository.prototype.modify = function (resource, args) { - var _this = this; - return this.client.update(resource.Links.Self, resource, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); - }; - BasicRepository.prototype.save = function (resource) { - if (isNewResource(resource)) { - return this.create(resource); - } - else { - return this.modify(resource); - } - function isTruthy(value) { - return !!value; - } - function isNewResource(resource) { - return !("Id" in resource && isTruthy(resource.Id) && isTruthy(resource.Links)); - } - }; - BasicRepository.prototype.subscribeToDataModifications = function (key, callback) { - this.subscribersToDataModifications[key] = callback; - }; - BasicRepository.prototype.unsubscribeFromDataModifications = function (key) { - delete this.subscribersToDataModifications[key]; - }; - BasicRepository.prototype.extend = function (arg1, arg2) { - return __assign(__assign({}, arg1), arg2); - }; - BasicRepository.prototype.batchRequestsById = function (args, batchSize) { - var _this = this; - var idArrays = (0, lodash_1.chunk)(args.ids, batchSize); - var promises = idArrays.map(function (ids) { - var newArgs = __assign(__assign({}, args), { ids: ids, id: "all" }); - return _this.client.get(_this.client.getLink(_this.collectionLinkName), newArgs); - }); - return Promise.all(promises).then(function (result) { return (0, lodash_1.flatten)(result); }); - }; - return BasicRepository; -}()); -exports.BasicRepository = BasicRepository; + return RunbookRepository; +}(spaceScopedBasicRepository_1.SpaceScopedBasicRepository)); +exports.RunbookRepository = RunbookRepository; /***/ }), -/***/ 15835: +/***/ 3196: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BranchesRepository = void 0; -var BranchesRepository = /** @class */ (function () { - function BranchesRepository(client) { - this.client = client; - this.client = client; - } - BranchesRepository.prototype.getTemplate = function (branch, channelId) { - return this.client.get(branch.Links["ReleaseTemplate"], { channel: channelId }); - }; - return BranchesRepository; -}()); -exports.BranchesRepository = BranchesRepository; - - -/***/ }), - -/***/ 7946: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BuildInformationRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var BuildInformationRepository = /** @class */ (function (_super) { - __extends(BuildInformationRepository, _super); - function BuildInformationRepository(client) { - return _super.call(this, "BuildInformation", client) || this; - } - BuildInformationRepository.prototype.deleteMany = function (ids) { - return this.client.del(this.client.getLink("BuildInformationBulk"), null, { ids: ids }); - }; - return BuildInformationRepository; -}(basicRepository_1.BasicRepository)); -exports.BuildInformationRepository = BuildInformationRepository; /***/ }), -/***/ 4776: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 2938: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CertificateConfigurationRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var CertificateConfigurationRepository = /** @class */ (function (_super) { - __extends(CertificateConfigurationRepository, _super); - function CertificateConfigurationRepository(client) { - return _super.call(this, "CertificateConfiguration", client) || this; - } - CertificateConfigurationRepository.prototype.archive = function (certificate) { - return this.client.post(certificate.Links["Archive"]); - }; - CertificateConfigurationRepository.prototype.export = function (certificate, exportOptions) { - return this.client.get(certificate.Links["Export"], exportOptions); - }; - CertificateConfigurationRepository.prototype.global = function () { - return this.get("certificate-global"); - }; - CertificateConfigurationRepository.prototype.replace = function (certificate, newCertificateData, newPassword) { - return this.client.post(certificate.Links["Replace"], { - certificateData: newCertificateData, - password: newPassword, - }); - }; - CertificateConfigurationRepository.prototype.usage = function (certificate) { - return this.client.get(certificate.Links["Usages"]); - }; - CertificateConfigurationRepository.prototype.unarchive = function (certificate) { - return this.client.post(certificate.Links["Unarchive"]); - }; - return CertificateConfigurationRepository; -}(basicRepository_1.BasicRepository)); -exports.CertificateConfigurationRepository = CertificateConfigurationRepository; /***/ }), -/***/ 41266: +/***/ 7068: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __awaiter = (this && this.__awaiter) || function (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) { @@ -8685,75 +7723,109 @@ var __generator = (this && this.__generator) || function (thisArg, body) { } }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CertificateRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var SelfSignedEndpoint = "/generate"; -var CertificateRepository = /** @class */ (function (_super) { - __extends(CertificateRepository, _super); - function CertificateRepository(client) { - return _super.call(this, "Certificates", client) || this; - } - CertificateRepository.prototype.createSelfSigned = function (resource, args) { - var _this = this; - return this.client.create(this.client.getLink("Certificates") + SelfSignedEndpoint, resource, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); - }; - CertificateRepository.prototype.listForTenant = function (tenantId) { +exports.RunbookSnapshotRepository = void 0; +var spaceScopedRoutePrefix_1 = __nccwpck_require__(7218); +var RunbookSnapshotRepository = /** @class */ (function () { + function RunbookSnapshotRepository(client, spaceName, project) { + this.client = client; + this.spaceName = spaceName; + this.projectId = project.Id; + } + RunbookSnapshotRepository.prototype.create = function (runbook, name, publish, notes) { return __awaiter(this, void 0, void 0, function () { - var certificates; + var snapshot, response; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, this.list({ tenant: tenantId, take: this.takeAll })]; + case 0: + snapshot = { + ProjectId: this.projectId, + RunbookId: runbook.Id, + Name: name, + Notes: notes, + }; + return [4 /*yield*/, this.client.doCreate("".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/projects/{projectId}/runbookSnapshots{?publish}"), snapshot, { + spaceName: this.spaceName, + projectId: this.projectId, + publish: publish ? "true" : undefined, + })]; case 1: - certificates = (_a.sent()).Items; - return [2 /*return*/, certificates]; + response = _a.sent(); + return [2 /*return*/, response]; } }); }); }; - CertificateRepository.prototype.names = function (projectId, projectEnvironmentsFilter) { - return this.client.get(this.client.getLink("VariableNames"), { - project: projectId, - projectEnvironmentsFilter: projectEnvironmentsFilter ? projectEnvironmentsFilter.join(",") : projectEnvironmentsFilter, - }); - }; - CertificateRepository.prototype.saveSelfSigned = function (resource) { - if (isExistingResource(resource)) { - return this.modify(resource); - } - else { - return this.createSelfSigned(resource); - } - function isExistingResource(r) { - return !!r.Links && !!r.Id; - } - }; - return CertificateRepository; -}(basicRepository_1.BasicRepository)); -exports.CertificateRepository = CertificateRepository; + return RunbookSnapshotRepository; +}()); +exports.RunbookSnapshotRepository = RunbookSnapshotRepository; + + +/***/ }), + +/***/ 4010: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 94659: +/***/ 7890: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(4010), exports); +__exportStar(__nccwpck_require__(2562), exports); +__exportStar(__nccwpck_require__(827), exports); +__exportStar(__nccwpck_require__(2493), exports); + + +/***/ }), + +/***/ 2562: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 827: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"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); +}; var __awaiter = (this && this.__awaiter) || function (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) { @@ -8791,462 +7863,163 @@ var __generator = (this && this.__generator) || function (thisArg, body) { } }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ChannelRepository = void 0; -var projectScopedRepository_1 = __nccwpck_require__(91795); -var ChannelRepository = /** @class */ (function (_super) { - __extends(ChannelRepository, _super); - function ChannelRepository(projectRepository, client) { - return _super.call(this, projectRepository, "Channels", client) || this; - } - ChannelRepository.prototype.find = function (nameOrId) { +exports.RunbookRunRepository = void 0; +var spaceScopedRoutePrefix_1 = __nccwpck_require__(7218); +var RunbookRunRepository = /** @class */ (function () { + function RunbookRunRepository(client, spaceName) { + this.baseApiPathTemplate = "".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/runbookRuns"); + this.client = client; + this.spaceName = spaceName; + } + RunbookRunRepository.prototype.get = function (id) { + return this.client.request("".concat(this.baseApiPathTemplate, "/").concat(id), { spaceName: this.spaceName }); + }; + RunbookRunRepository.prototype.list = function (args) { + return this.client.request("".concat(this.baseApiPathTemplate, "{?skip,take,ids,projects,environments,tenants,runbooks,taskState,partialName}"), __assign({ spaceName: this.spaceName }, args)); + }; + RunbookRunRepository.prototype.create = function (command) { return __awaiter(this, void 0, void 0, function () { - var _a, channels; - return __generator(this, function (_b) { - switch (_b.label) { + var response, mappedTasks; + return __generator(this, function (_a) { + switch (_a.label) { case 0: - if (nameOrId.length === 0) - return [2 /*return*/]; - _b.label = 1; + this.client.debug("Running a runbook..."); + return [4 /*yield*/, this.client.doCreate("".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/runbook-runs/create/v1"), __assign({ spaceIdOrName: command.spaceName }, command))]; case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.get(nameOrId)]; - case 2: return [2 /*return*/, _b.sent()]; - case 3: - _a = _b.sent(); - return [3 /*break*/, 4]; - case 4: return [4 /*yield*/, this.list({ - partialName: nameOrId, - })]; - case 5: - channels = _b.sent(); - return [2 /*return*/, channels.Items.find(function (e) { return e.Name.localeCompare(nameOrId, undefined, { sensitivity: "base" }) === 0; })]; + response = _a.sent(); + if (response.RunbookRunServerTasks.length == 0) { + throw new Error("No server task details returned"); + } + mappedTasks = response.RunbookRunServerTasks.map(function (x) { + return { + RunbookRunId: x.RunbookRunId || x.runbookRunId, + ServerTaskId: x.ServerTaskId || x.serverTaskId, + }; + }); + this.client.debug("Runbook executed successfully. [".concat(mappedTasks.map(function (t) { return t.ServerTaskId; }).join(", "), "]")); + return [2 /*return*/, { + RunbookRunServerTasks: mappedTasks, + }]; } }); }); }; - ChannelRepository.prototype.ruleTest = function (searchOptions) { - return this.client.post(this.client.getLink("VersionRuleTest"), searchOptions); - }; - ChannelRepository.prototype.getReleases = function (channel, options) { - return this.client.get(channel.Links["Releases"], options); - }; - ChannelRepository.prototype.getOcl = function (channel) { - return this.client.get(channel.Links["RawOcl"]); - }; - ChannelRepository.prototype.modifyOcl = function (channel, command) { - return this.client.update(channel.Links["RawOcl"], command); - }; - ChannelRepository.prototype.modify = function (channel, args) { - var payload = channel; - this.addCommitMessage(payload, args); - if (payload !== undefined) { - return this.client.update(channel.Links.Self, payload); - } - else { - return _super.prototype.modify.call(this, channel, args); - } - }; - ChannelRepository.prototype.createForProject = function (projectResource, channel, args) { - var _this = this; - var payload = channel; - this.addCommitMessage(payload, args); - if (payload !== undefined) { - var link = projectResource.Links[this.collectionLinkName]; - return this.client.create(link, payload, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); - } - else { - return _super.prototype.createForProject.call(this, projectResource, channel, args); - } - }; - ChannelRepository.prototype.addCommitMessage = function (command, args) { - if (args !== undefined && "gitRef" in args && "commitMessage" in args) { - command.ChangeDescription = args["commitMessage"]; - } - }; - return ChannelRepository; -}(projectScopedRepository_1.ProjectScopedRepository)); -exports.ChannelRepository = ChannelRepository; - - -/***/ }), - -/***/ 94203: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CloudTemplateRepository = void 0; -var CloudTemplateRepository = /** @class */ (function () { - function CloudTemplateRepository(client) { - this.client = client; - } - CloudTemplateRepository.prototype.getMetadata = function (templateBody, id) { - var templateResource = { template: encodeURI(templateBody) }; - return this.client.post(this.client.getLink("CloudTemplate"), templateResource, { id: id.toString() }); - }; - return CloudTemplateRepository; + return RunbookRunRepository; }()); -exports.CloudTemplateRepository = CloudTemplateRepository; +exports.RunbookRunRepository = RunbookRunRepository; /***/ }), -/***/ 69039: -/***/ (function(__unused_webpack_module, exports) { +/***/ 2493: +/***/ ((__unused_webpack_module, exports) => { "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 })); -exports.CommunityActionTemplateRepository = void 0; -var CommunityActionTemplateRepository = /** @class */ (function () { - function CommunityActionTemplateRepository(client) { - this.client = client; - } - CommunityActionTemplateRepository.prototype.get = function (id) { - var allArgs = __assign({}, { id: id }); - return this.client.get(this.client.getLink("CommunityActionTemplates"), allArgs); - }; - CommunityActionTemplateRepository.prototype.install = function (communityActionTemplate) { - return this.client.post(communityActionTemplate.Links["Installation"]); - }; - CommunityActionTemplateRepository.prototype.updateInstallation = function (communityActionTemplate) { - return this.client.put(communityActionTemplate.Links["Installation"]); - }; - return CommunityActionTemplateRepository; -}()); -exports.CommunityActionTemplateRepository = CommunityActionTemplateRepository; /***/ }), -/***/ 13497: +/***/ 5469: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ConfigurationRepository = void 0; -var ConfigurationRepository = /** @class */ (function () { - function ConfigurationRepository(configurationLinkName, client) { - this.configurationLinkName = configurationLinkName; - this.client = client; - } - ConfigurationRepository.prototype.get = function () { - return this.client.get(this.client.getLink(this.configurationLinkName)); - }; - ConfigurationRepository.prototype.modify = function (resource) { - return this.client.update(resource.Links["Self"], resource); - }; - return ConfigurationRepository; -}()); -exports.ConfigurationRepository = ConfigurationRepository; +exports.TenantedDeploymentMode = void 0; +var TenantedDeploymentMode; +(function (TenantedDeploymentMode) { + TenantedDeploymentMode["Untenanted"] = "Untenanted"; + TenantedDeploymentMode["TenantedOrUntenanted"] = "TenantedOrUntenanted"; + TenantedDeploymentMode["Tenanted"] = "Tenanted"; +})(TenantedDeploymentMode = exports.TenantedDeploymentMode || (exports.TenantedDeploymentMode = {})); /***/ }), -/***/ 66446: +/***/ 6568: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DashboardConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var DashboardConfigurationRepository = /** @class */ (function (_super) { - __extends(DashboardConfigurationRepository, _super); - function DashboardConfigurationRepository(client) { - return _super.call(this, "DashboardConfiguration", client) || this; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; } - return DashboardConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.DashboardConfigurationRepository = DashboardConfigurationRepository; + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(4013), exports); +__exportStar(__nccwpck_require__(1038), exports); +__exportStar(__nccwpck_require__(1613), exports); +__exportStar(__nccwpck_require__(3797), exports); +__exportStar(__nccwpck_require__(9144), exports); /***/ }), -/***/ 20009: +/***/ 4013: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DashboardItemsOptions = exports.DashboardRepository = void 0; -var DashboardRepository = /** @class */ (function () { - function DashboardRepository(client) { - this.client = client; - } - DashboardRepository.prototype.getDeploymentsCountedByWeek = function (projectIds) { - return this.client.get(this.client.getLink("Reporting/DeploymentsCountedByWeek"), { projectIds: projectIds.join(",") }); - }; - DashboardRepository.prototype.getDashboard = function (dashboardFilter) { - return this.client.get(this.client.getLink("Dashboard"), dashboardFilter); - }; - DashboardRepository.prototype.getDynamicDashboard = function (projects, environments, dashboardItemsOptions) { - if (dashboardItemsOptions === void 0) { dashboardItemsOptions = DashboardItemsOptions.IncludeCurrentDeploymentOnly; } - return this.client.get(this.client.getLink("DashboardDynamic"), { - projects: projects, - environments: environments, - includePrevious: dashboardItemsOptions === DashboardItemsOptions.IncludeCurrentAndPreviousSuccessfulDeployment, - }); - }; - return DashboardRepository; -}()); -exports.DashboardRepository = DashboardRepository; -var DashboardItemsOptions; -(function (DashboardItemsOptions) { - DashboardItemsOptions[DashboardItemsOptions["IncludeCurrentDeploymentOnly"] = 0] = "IncludeCurrentDeploymentOnly"; - DashboardItemsOptions[DashboardItemsOptions["IncludeCurrentAndPreviousSuccessfulDeployment"] = 1] = "IncludeCurrentAndPreviousSuccessfulDeployment"; -})(DashboardItemsOptions = exports.DashboardItemsOptions || (exports.DashboardItemsOptions = {})); /***/ }), -/***/ 81630: +/***/ 1038: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DefectRepository = void 0; -var DefectRepository = /** @class */ (function () { - function DefectRepository(client) { - this.client = client; - } - DefectRepository.prototype.all = function (release) { - return this.client.get(release.Links["Defects"]); - }; - DefectRepository.prototype.report = function (release, description) { - return this.client.post(release.Links["ReportDefect"], { Description: description }); - }; - DefectRepository.prototype.resolve = function (release) { - return this.client.post(release.Links["ResolveDefect"]); - }; - return DefectRepository; -}()); -exports.DefectRepository = DefectRepository; +exports.ActivityLogEntryCategory = exports.ActivityStatus = void 0; +var ActivityStatus; +(function (ActivityStatus) { + ActivityStatus["Pending"] = "Pending"; + ActivityStatus["Running"] = "Running"; + ActivityStatus["Success"] = "Success"; + ActivityStatus["Failed"] = "Failed"; + ActivityStatus["Skipped"] = "Skipped"; + ActivityStatus["SuccessWithWarning"] = "SuccessWithWarning"; + ActivityStatus["Canceled"] = "Canceled"; +})(ActivityStatus = exports.ActivityStatus || (exports.ActivityStatus = {})); +var ActivityLogEntryCategory; +(function (ActivityLogEntryCategory) { + ActivityLogEntryCategory["Trace"] = "Trace"; + ActivityLogEntryCategory["Verbose"] = "Verbose"; + ActivityLogEntryCategory["Info"] = "Info"; + ActivityLogEntryCategory["Highlight"] = "Highlight"; + ActivityLogEntryCategory["Wait"] = "Wait"; + ActivityLogEntryCategory["Gap"] = "Gap"; + ActivityLogEntryCategory["Alert"] = "Alert"; + ActivityLogEntryCategory["Warning"] = "Warning"; + ActivityLogEntryCategory["Error"] = "Error"; + ActivityLogEntryCategory["Fatal"] = "Fatal"; + ActivityLogEntryCategory["Planned"] = "Planned"; + ActivityLogEntryCategory["Updated"] = "Updated"; + ActivityLogEntryCategory["Finished"] = "Finished"; + ActivityLogEntryCategory["Abandoned"] = "Abandoned"; +})(ActivityLogEntryCategory = exports.ActivityLogEntryCategory || (exports.ActivityLogEntryCategory = {})); /***/ }), -/***/ 82773: +/***/ 1613: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 = (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 })); -exports.DeploymentProcessRepository = void 0; -var projectScopedRepository_1 = __nccwpck_require__(91795); -var DeploymentProcessRepository = /** @class */ (function (_super) { - __extends(DeploymentProcessRepository, _super); - function DeploymentProcessRepository(projectRepository, client) { - var _this = _super.call(this, projectRepository, "DeploymentProcesses", client) || this; - _this.resourceLink = "DeploymentProcess"; - _this.collectionLink = "DeploymentProcesses"; - return _this; - } - DeploymentProcessRepository.prototype.get = function (id, gitRef) { - return _super.prototype.get.call(this, id, { gitRef: gitRef }); - }; - DeploymentProcessRepository.prototype.getForRelease = function (release) { - return this.client.get(this.client.getLink(this.collectionLink), { id: release.ProjectDeploymentProcessSnapshotId }); - }; - DeploymentProcessRepository.prototype.getTemplate = function (deploymentProcess, channel, releaseId) { - return this.client.get(deploymentProcess.Links["Template"], { channel: channel === null || channel === void 0 ? void 0 : channel.Id, releaseId: releaseId }); - }; - DeploymentProcessRepository.prototype.modify = function (deploymentProcess) { - return this.client.update(deploymentProcess.Links.Self, deploymentProcess); - }; - DeploymentProcessRepository.prototype.validate = function (deploymentProcess) { - return this.client.post(deploymentProcess.Links["Validation"], __assign({}, deploymentProcess)); - }; - DeploymentProcessRepository.prototype.getOcl = function (deploymentProcess) { - return this.client.get(deploymentProcess.Links["RawOcl"]); - }; - DeploymentProcessRepository.prototype.modifyOcl = function (deploymentProcess, command) { - return this.client.update(deploymentProcess.Links["RawOcl"], command); - }; - return DeploymentProcessRepository; -}(projectScopedRepository_1.ProjectScopedRepository)); -exports.DeploymentProcessRepository = DeploymentProcessRepository; - - -/***/ }), - -/***/ 91848: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeploymentRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var DeploymentRepository = /** @class */ (function (_super) { - __extends(DeploymentRepository, _super); - function DeploymentRepository(client) { - return _super.call(this, "Deployments", client) || this; - } - return DeploymentRepository; -}(basicRepository_1.BasicRepository)); -exports.DeploymentRepository = DeploymentRepository; - - -/***/ }), - -/***/ 98936: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeploymentSettingsRepository = void 0; -var DeploymentSettingsRepository = /** @class */ (function () { - function DeploymentSettingsRepository(client, project, branch) { - this.client = client; - this.project = project; - this.branch = branch; - this.resourceLink = "DeploymentSettings"; - this.client = client; - } - DeploymentSettingsRepository.prototype.get = function () { - if (this.project.IsVersionControlled && this.branch !== undefined) { - return this.client.get(this.branch.Links[this.resourceLink]); - } - return this.client.get(this.project.Links[this.resourceLink]); - }; - DeploymentSettingsRepository.prototype.getOcl = function (deploymentSettings) { - return this.client.get(deploymentSettings.Links["RawOcl"]); - }; - DeploymentSettingsRepository.prototype.modify = function (deploymentSettings) { - return this.client.update(deploymentSettings.Links.Self, deploymentSettings); - }; - DeploymentSettingsRepository.prototype.modifyOcl = function (deploymentSettings, command) { - return this.client.update(deploymentSettings.Links["RawOcl"], command); - }; - return DeploymentSettingsRepository; -}()); -exports.DeploymentSettingsRepository = DeploymentSettingsRepository; - - -/***/ }), - -/***/ 27848: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DynamicExtensionRepository = void 0; -var DynamicExtensionRepository = /** @class */ (function () { - function DynamicExtensionRepository(client) { - this.client = client; - } - DynamicExtensionRepository.prototype.getFeaturesMetadata = function () { - return this.client.get(this.client.getLink("DynamicExtensionsFeaturesMetadata")); - }; - DynamicExtensionRepository.prototype.getFeaturesValues = function () { - return this.client.get(this.client.getLink("DynamicExtensionsFeaturesValues")); - }; - DynamicExtensionRepository.prototype.getScripts = function () { - return this.client.get(this.client.getLink("DynamicExtensionsScripts")); - }; - DynamicExtensionRepository.prototype.putFeaturesValues = function (values) { - return this.client.put(this.client.getLink("DynamicExtensionsFeaturesValues"), values); - }; - return DynamicExtensionRepository; -}()); -exports.DynamicExtensionRepository = DynamicExtensionRepository; - - -/***/ }), - -/***/ 8183: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __awaiter = (this && this.__awaiter) || function (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) { @@ -9283,272 +8056,118 @@ var __generator = (this && this.__generator) || function (thisArg, body) { if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; +var __values = (this && this.__values) || function(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."); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EnvironmentRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var EnvironmentRepository = /** @class */ (function (_super) { - __extends(EnvironmentRepository, _super); - function EnvironmentRepository(client) { - return _super.call(this, "Environments", client) || this; +exports.ServerTaskWaiter = void 0; +var serverTasks_1 = __nccwpck_require__(6568); +var ServerTaskWaiter = /** @class */ (function () { + function ServerTaskWaiter(client, spaceName) { + this.client = client; + this.spaceName = spaceName; } - EnvironmentRepository.prototype.find = function (namesOrIds) { + ServerTaskWaiter.prototype.waitForServerTasksToComplete = function (serverTaskIds, statusCheckSleepCycle, timeout, pollingCallback) { return __awaiter(this, void 0, void 0, function () { - var environments, matchingEnvironments, _a, _loop_1, this_1, _i, namesOrIds_1, name_1; + var spaceServerTaskRepository, taskPromises, serverTaskIds_1, serverTaskIds_1_1, serverTaskId; + var e_1, _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (namesOrIds.length === 0) - return [2 /*return*/, []]; - environments = []; - _b.label = 1; + spaceServerTaskRepository = new serverTasks_1.SpaceServerTaskRepository(this.client, this.spaceName); + taskPromises = []; + try { + for (serverTaskIds_1 = __values(serverTaskIds), serverTaskIds_1_1 = serverTaskIds_1.next(); !serverTaskIds_1_1.done; serverTaskIds_1_1 = serverTaskIds_1.next()) { + serverTaskId = serverTaskIds_1_1.value; + taskPromises.push(this.waitForTask(spaceServerTaskRepository, serverTaskId, statusCheckSleepCycle, timeout, pollingCallback)); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (serverTaskIds_1_1 && !serverTaskIds_1_1.done && (_a = serverTaskIds_1.return)) _a.call(serverTaskIds_1); + } + finally { if (e_1) throw e_1.error; } + } + return [4 /*yield*/, Promise.allSettled(taskPromises)]; + case 1: return [2 /*return*/, _b.sent()]; + } + }); + }); + }; + ServerTaskWaiter.prototype.waitForServerTaskToComplete = function (serverTaskId, statusCheckSleepCycle, timeout, pollingCallback) { + return __awaiter(this, void 0, void 0, function () { + var spaceServerTaskRepository; + return __generator(this, function (_a) { + spaceServerTaskRepository = new serverTasks_1.SpaceServerTaskRepository(this.client, this.spaceName); + return [2 /*return*/, this.waitForTask(spaceServerTaskRepository, serverTaskId, statusCheckSleepCycle, timeout, pollingCallback)]; + }); + }); + }; + ServerTaskWaiter.prototype.waitForTask = function (spaceServerTaskRepository, serverTaskId, statusCheckSleepCycle, timeout, pollingCallback) { + return __awaiter(this, void 0, void 0, function () { + var sleep, stop, t, taskDetails, task; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + sleep = function (ms) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, new Promise(function (r) { return setTimeout(r, ms); })]; + }); }); }; + stop = false; + t = setTimeout(function () { + stop = true; + }, timeout); + _a.label = 1; case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.list({ - ids: namesOrIds, - })]; + if (!!stop) return [3 /*break*/, 7]; + if (!pollingCallback) return [3 /*break*/, 3]; + return [4 /*yield*/, spaceServerTaskRepository.getDetails(serverTaskId)]; case 2: - matchingEnvironments = _b.sent(); - environments.push.apply(environments, matchingEnvironments.Items); - return [3 /*break*/, 4]; - case 3: - _a = _b.sent(); - return [3 /*break*/, 4]; + taskDetails = _a.sent(); + pollingCallback(taskDetails); + if (taskDetails.Task.IsCompleted) { + clearTimeout(t); + return [2 /*return*/, taskDetails.Task]; + } + return [3 /*break*/, 5]; + case 3: return [4 /*yield*/, spaceServerTaskRepository.getById(serverTaskId)]; case 4: - _loop_1 = function (name_1) { - var matchingEnvironments; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [4 /*yield*/, this_1.list({ - name: name_1, - })]; - case 1: - matchingEnvironments = _c.sent(); - environments.push.apply(environments, matchingEnvironments.Items.filter(function (e) { return e.Name.localeCompare(name_1, undefined, { sensitivity: 'base' }) === 0; })); - return [2 /*return*/]; - } - }); - }; - this_1 = this; - _i = 0, namesOrIds_1 = namesOrIds; - _b.label = 5; - case 5: - if (!(_i < namesOrIds_1.length)) return [3 /*break*/, 8]; - name_1 = namesOrIds_1[_i]; - return [5 /*yield**/, _loop_1(name_1)]; + task = _a.sent(); + if (task.IsCompleted) { + clearTimeout(t); + return [2 /*return*/, task]; + } + _a.label = 5; + case 5: return [4 /*yield*/, sleep(statusCheckSleepCycle)]; case 6: - _b.sent(); - _b.label = 7; - case 7: - _i++; - return [3 /*break*/, 5]; - case 8: return [2 /*return*/, environments]; + _a.sent(); + return [3 /*break*/, 1]; + case 7: return [2 /*return*/, null]; } }); }); }; - EnvironmentRepository.prototype.getMetadata = function (environment) { - return this.client.get(environment.Links["Metadata"], {}); - }; - EnvironmentRepository.prototype.sort = function (order) { - return this.client.put(this.client.getLink("EnvironmentSortOrder"), order); - }; - EnvironmentRepository.prototype.summary = function (args) { - return this.client.get(this.client.getLink("EnvironmentsSummary"), args); - }; - EnvironmentRepository.prototype.machines = function (environment, args) { - return this.client.get(environment.Links["Machines"], args); - }; - EnvironmentRepository.prototype.variablesScopedOnlyToThisEnvironment = function (environment) { - return this.client.get(environment.Links["SinglyScopedVariableDetails"]); - }; - return EnvironmentRepository; -}(basicRepository_1.BasicRepository)); -exports.EnvironmentRepository = EnvironmentRepository; - - -/***/ }), - -/***/ 65269: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventRepository = void 0; -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var EventRepository = /** @class */ (function (_super) { - __extends(EventRepository, _super); - function EventRepository(client) { - return _super.call(this, "Events", client) || this; - } - EventRepository.prototype.categories = function (options) { - return this.client.get(this.client.getLink("EventCategories"), options); - }; - EventRepository.prototype.groups = function (options) { - return this.client.get(this.client.getLink("EventGroups"), options); - }; - EventRepository.prototype.documentTypes = function (options) { - return this.client.get(this.client.getLink("EventDocumentTypes"), options); - }; - EventRepository.prototype.eventAgents = function () { - return this.client.get(this.client.getLink("EventAgents")); - }; - return EventRepository; -}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); -exports.EventRepository = EventRepository; - - -/***/ }), - -/***/ 22999: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExternalSecurityGroupProviderRepository = void 0; -var ExternalSecurityGroupProviderRepository = /** @class */ (function () { - function ExternalSecurityGroupProviderRepository(client) { - this.client = client; - } - ExternalSecurityGroupProviderRepository.prototype.all = function () { - return this.client.get(this.client.getLink("ExternalSecurityGroupProviders")); - }; - return ExternalSecurityGroupProviderRepository; -}()); -exports.ExternalSecurityGroupProviderRepository = ExternalSecurityGroupProviderRepository; - - -/***/ }), - -/***/ 4387: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExternalSecurityGroupRepository = void 0; -var ExternalSecurityGroupRepository = /** @class */ (function () { - function ExternalSecurityGroupRepository(client) { - this.client = client; - } - ExternalSecurityGroupRepository.prototype.search = function (url, partialName) { - return this.client.get(url, { partialName: partialName }); - }; - return ExternalSecurityGroupRepository; -}()); -exports.ExternalSecurityGroupRepository = ExternalSecurityGroupRepository; - - -/***/ }), - -/***/ 55459: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExternalUsersRepository = void 0; -var ExternalUsersRepository = /** @class */ (function () { - function ExternalUsersRepository(client) { - this.client = client; - } - ExternalUsersRepository.prototype.search = function (partialName) { - return this.client.get(this.client.getLink("ExternalUserSearch"), { partialName: partialName }); - }; - ExternalUsersRepository.prototype.searchProvider = function (providerUrl, partialName) { - return this.client.get(providerUrl, { partialName: partialName }); - }; - return ExternalUsersRepository; + return ServerTaskWaiter; }()); -exports.ExternalUsersRepository = ExternalUsersRepository; - - -/***/ }), - -/***/ 56116: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FeaturesConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var FeaturesConfigurationRepository = /** @class */ (function (_super) { - __extends(FeaturesConfigurationRepository, _super); - function FeaturesConfigurationRepository(client) { - return _super.call(this, "FeaturesConfiguration", client) || this; - } - return FeaturesConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.FeaturesConfigurationRepository = FeaturesConfigurationRepository; +exports.ServerTaskWaiter = ServerTaskWaiter; /***/ }), -/***/ 20037: +/***/ 3797: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/consistent-type-assertions */ -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 = (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); -}; var __awaiter = (this && this.__awaiter) || function (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) { @@ -9585,123 +8204,155 @@ var __generator = (this && this.__generator) || function (thisArg, body) { if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; +var __values = (this && this.__values) || function(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."); +}; +var __read = (this && this.__read) || function (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; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FeedRepository = exports.ExternalFeedsFilterTypes = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var basicRepository_1 = __nccwpck_require__(30970); -var ExternalFeedsFilterTypes = /** @class */ (function () { - function ExternalFeedsFilterTypes() { - } - Object.defineProperty(ExternalFeedsFilterTypes, "defaultFilterTypes", { - get: function () { - return this._defaultFilterTypes; - }, - enumerable: false, - configurable: true - }); - ExternalFeedsFilterTypes._defaultFilterTypes = Object.keys(message_contracts_1.FeedType) - .filter(function (f) { return f !== message_contracts_1.FeedType.BuiltIn && f !== message_contracts_1.FeedType.OctopusProject; }) - .map(function (f) { return f; }); - return ExternalFeedsFilterTypes; -}()); -exports.ExternalFeedsFilterTypes = ExternalFeedsFilterTypes; -var FeedRepository = /** @class */ (function (_super) { - __extends(FeedRepository, _super); - function FeedRepository(client) { - return _super.call(this, "Feeds", client) || this; +exports.SpaceServerTaskRepository = void 0; +var lodash_1 = __nccwpck_require__(250); +var spaceScopedRoutePrefix_1 = __nccwpck_require__(7218); +var SpaceServerTaskRepository = /** @class */ (function () { + function SpaceServerTaskRepository(client, spaceName) { + this.baseApiPathTemplate = "".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/tasks"); + this.client = client; + this.spaceName = spaceName; } - FeedRepository.prototype.getBuiltIn = function () { + SpaceServerTaskRepository.prototype.getById = function (serverTaskId) { return __awaiter(this, void 0, void 0, function () { - var result; + var response; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, this.client.get(this.client.getLink("Feeds"), { feedType: message_contracts_1.FeedType.BuiltIn })]; + case 0: + if (!serverTaskId) { + throw new Error("Server Task Id was not provided"); + } + return [4 /*yield*/, this.client.request("".concat(this.baseApiPathTemplate, "/").concat(serverTaskId), { spaceName: this.spaceName })]; case 1: - result = _a.sent(); - return [2 /*return*/, result.Items[0]]; + response = _a.sent(); + return [2 /*return*/, response]; } }); }); }; - FeedRepository.prototype.getOctopusProject = function () { + SpaceServerTaskRepository.prototype.getByIds = function (serverTaskIds) { return __awaiter(this, void 0, void 0, function () { - var result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.client.get(this.client.getLink("Feeds"), { feedType: message_contracts_1.FeedType.OctopusProject })]; - case 1: - result = _a.sent(); - return [2 /*return*/, result.Items[0]]; + var batchSize, idArrays, promises, _a, _b, _c, index, ids; + var e_1, _d; + return __generator(this, function (_e) { + batchSize = 300; + idArrays = (0, lodash_1.chunk)(serverTaskIds, batchSize); + promises = []; + try { + for (_a = __values(idArrays.entries()), _b = _a.next(); !_b.done; _b = _a.next()) { + _c = __read(_b.value, 2), index = _c[0], ids = _c[1]; + promises.push(this.client.request("".concat(this.baseApiPathTemplate, "{?skip,take,ids,partialName}"), { + spaceName: this.spaceName, + ids: ids, + skip: index * batchSize, + take: batchSize, + })); + } } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_b && !_b.done && (_d = _a.return)) _d.call(_a); + } + finally { if (e_1) throw e_1.error; } + } + return [2 /*return*/, Promise.allSettled(promises).then(function (result) { return (0, lodash_1.flatMap)(result, function (c) { return (c.status == "fulfilled" ? c.value.Items : []); }); })]; }); }); }; - FeedRepository.prototype.getBuiltInStatus = function () { + SpaceServerTaskRepository.prototype.getDetails = function (serverTaskId) { return __awaiter(this, void 0, void 0, function () { + var response; return __generator(this, function (_a) { - return [2 /*return*/, this.client.get(this.client.getLink("BuiltInFeedStats"))]; + switch (_a.label) { + case 0: + if (!serverTaskId) { + throw new Error("Server Task Id was not provided"); + } + return [4 /*yield*/, this.client.request("".concat(this.baseApiPathTemplate, "/").concat(serverTaskId, "/details"), { + spaceName: this.spaceName, + })]; + case 1: + response = _a.sent(); + return [2 /*return*/, response]; + } }); }); }; - FeedRepository.prototype.listExternal = function () { + SpaceServerTaskRepository.prototype.getRaw = function (serverTaskId) { return __awaiter(this, void 0, void 0, function () { + var response; return __generator(this, function (_a) { - return [2 /*return*/, this.client.get(this.client.getLink("Feeds"), { feedType: ExternalFeedsFilterTypes.defaultFilterTypes })]; + switch (_a.label) { + case 0: + if (!serverTaskId) { + throw new Error("Server Task Id was not provided"); + } + return [4 /*yield*/, this.client.request("".concat(this.baseApiPathTemplate, "/").concat(serverTaskId, "/raw"), { spaceName: this.spaceName })]; + case 1: + response = _a.sent(); + return [2 /*return*/, response]; + } }); }); }; - FeedRepository.prototype.searchPackages = function (feed, searchOptions) { - return this.client.get(feed.Links.SearchPackagesTemplate, searchOptions); - }; - FeedRepository.prototype.searchPackageVersions = function (feed, packageId, searchOptions) { - return this.client.get(feed.Links["SearchPackageVersionsTemplate"], __assign({ packageId: packageId }, searchOptions)); - }; - FeedRepository.prototype.getNotes = function (feed, packageId, version) { - return this.client.getRaw(feed.Links["NotesTemplate"], { packageId: packageId, version: version }); - }; - return FeedRepository; -}(basicRepository_1.BasicRepository)); -exports.FeedRepository = FeedRepository; + return SpaceServerTaskRepository; +}()); +exports.SpaceServerTaskRepository = SpaceServerTaskRepository; /***/ }), -/***/ 18029: +/***/ 9144: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ImportExportActions = void 0; -var ImportExportActions = /** @class */ (function () { - function ImportExportActions(client) { - this.client = client; - } - ImportExportActions.prototype.export = function (exportRequest) { - return this.client.post(this.client.getLink("ExportProjects"), exportRequest); - }; - ImportExportActions.prototype.files = function () { - return this.client.get(this.client.getLink("ProjectImportFiles")); - }; - ImportExportActions.prototype.import = function (importRequest) { - return this.client.post(this.client.getLink("ImportProjects"), importRequest); - }; - ImportExportActions.prototype.preview = function (importRequest) { - return this.client.post(this.client.getLink("ProjectImportPreview"), importRequest); - }; - ImportExportActions.prototype.upload = function (pkg) { - var fd = new FormData(); - fd.append("fileToUpload", pkg); - return this.client.post(this.client.getLink("ProjectImportFiles"), fd); - }; - return ImportExportActions; -}()); -exports.ImportExportActions = ImportExportActions; +exports.TaskState = void 0; +var TaskState; +(function (TaskState) { + TaskState["Canceled"] = "Canceled"; + TaskState["Cancelling"] = "Cancelling"; + TaskState["Executing"] = "Executing"; + TaskState["Failed"] = "Failed"; + TaskState["Queued"] = "Queued"; + TaskState["Success"] = "Success"; + TaskState["TimedOut"] = "TimedOut"; +})(TaskState = exports.TaskState || (exports.TaskState = {})); /***/ }), -/***/ 90977: +/***/ 3496: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -9721,66 +8372,96 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); +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 })); -exports.InterruptionRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var InterruptionRepository = /** @class */ (function (_super) { - __extends(InterruptionRepository, _super); - function InterruptionRepository(client) { - return _super.call(this, "Interruptions", client) || this; - } - InterruptionRepository.prototype.submit = function (interruption, result) { - return this.client.post(interruption.Links["Submit"], result); +exports.SpaceScopedBasicRepository = void 0; +var basicRepository_1 = __nccwpck_require__(2966); +var spaceScopedRoutePrefix_1 = __nccwpck_require__(7218); +var SpaceScopedBasicRepository = /** @class */ (function (_super) { + __extends(SpaceScopedBasicRepository, _super); + function SpaceScopedBasicRepository(client, spaceName, baseApiPathTemplate, listParametersTemplate) { + var _this = _super.call(this, client, baseApiPathTemplate, listParametersTemplate) || this; + if (!baseApiPathTemplate.startsWith(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix)) { + throw new Error("Space scoped repositories must prefix their baseApiTemplate with `spaceScopedRoutePrefix`"); + } + _this.spaceName = spaceName; + return _this; + } + SpaceScopedBasicRepository.prototype.del = function (resource) { + var _this = this; + return this.client + .del("".concat(this.baseApiPathTemplate, "/").concat(resource.Id), { spaceName: this.spaceName }) + .then(function (d) { return _this.notifySubscribersToDataModifications(resource); }); }; - InterruptionRepository.prototype.takeResponsibility = function (interruption) { - return this.client.put(interruption.Links["Responsible"]); + SpaceScopedBasicRepository.prototype.create = function (resource, args) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return _super.prototype.create.call(this, resource, __assign({ spaceName: this.spaceName }, args)); }; - return InterruptionRepository; + SpaceScopedBasicRepository.prototype.get = function (id) { + return this.client.request("".concat(this.baseApiPathTemplate, "/").concat(id), { spaceName: this.spaceName }); + }; + SpaceScopedBasicRepository.prototype.list = function (args) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return _super.prototype.list.call(this, __assign({ spaceName: this.spaceName }, args)); + }; + SpaceScopedBasicRepository.prototype.modify = function (resource, args) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return _super.prototype.modify.call(this, resource, __assign({ spaceName: this.spaceName }, args)); + }; + return SpaceScopedBasicRepository; }(basicRepository_1.BasicRepository)); -exports.InterruptionRepository = InterruptionRepository; +exports.SpaceScopedBasicRepository = SpaceScopedBasicRepository; /***/ }), -/***/ 15228: +/***/ 1163: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(7970), exports); +__exportStar(__nccwpck_require__(4778), exports); + + +/***/ }), + +/***/ 7970: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InvitationRepository = void 0; -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var InvitationRepository = /** @class */ (function (_super) { - __extends(InvitationRepository, _super); - function InvitationRepository(client) { - return _super.call(this, "Invitations", client) || this; - } - InvitationRepository.prototype.invite = function (teamIds, spaceId) { - return this.client.post(this.client.getLink("Invitations"), { AddToTeamIds: teamIds, SpaceId: spaceId }); - }; - return InvitationRepository; -}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); -exports.InvitationRepository = InvitationRepository; /***/ }), -/***/ 78681: +/***/ 4778: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -9801,21 +8482,69 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LetsEncryptConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var LetsEncryptConfigurationRepository = /** @class */ (function (_super) { - __extends(LetsEncryptConfigurationRepository, _super); - function LetsEncryptConfigurationRepository(client) { - return _super.call(this, "LetsEncryptConfiguration", client) || this; +exports.SpaceRepository = void 0; +var __1 = __nccwpck_require__(586); +var basicRepository_1 = __nccwpck_require__(2966); +var SpaceRepository = /** @class */ (function (_super) { + __extends(SpaceRepository, _super); + function SpaceRepository(client) { + return _super.call(this, client, "".concat(__1.apiLocation, "/spaces"), "skip,ids,take,partialName") || this; + } + return SpaceRepository; +}(basicRepository_1.BasicRepository)); +exports.SpaceRepository = SpaceRepository; + + +/***/ }), + +/***/ 9925: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; } - return LetsEncryptConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.LetsEncryptConfigurationRepository = LetsEncryptConfigurationRepository; + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(7635), exports); +__exportStar(__nccwpck_require__(240), exports); +__exportStar(__nccwpck_require__(1970), exports); + + +/***/ }), + +/***/ 7635: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 240: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 64693: +/***/ 1970: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -9836,51 +8565,73 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LibraryVariableRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var LibraryVariableRepository = /** @class */ (function (_super) { - __extends(LibraryVariableRepository, _super); - function LibraryVariableRepository(client) { - return _super.call(this, "LibraryVariables", client) || this; - } - LibraryVariableRepository.prototype.getUsages = function (libraryVariableSet) { - return this.client.get(libraryVariableSet.Links["Usages"]); +exports.TagSetRepository = void 0; +var spaceScopedRoutePrefix_1 = __nccwpck_require__(7218); +var spaceScopedBasicRepository_1 = __nccwpck_require__(3496); +var TagSetRepository = /** @class */ (function (_super) { + __extends(TagSetRepository, _super); + function TagSetRepository(client, spaceName) { + return _super.call(this, client, spaceName, "".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/tagsets"), "skip,take,ids,partialName") || this; + } + TagSetRepository.prototype.sort = function (ids) { + return this.client.doUpdate("".concat(spaceScopedRoutePrefix_1.spaceScopedRoutePrefix, "/tagsets/sortorder"), ids, { spaceName: this.spaceName }); }; - return LibraryVariableRepository; -}(basicRepository_1.BasicRepository)); -exports.LibraryVariableRepository = LibraryVariableRepository; + return TagSetRepository; +}(spaceScopedBasicRepository_1.SpaceScopedBasicRepository)); +exports.TagSetRepository = TagSetRepository; + + +/***/ }), + +/***/ 341: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(5305), exports); +__exportStar(__nccwpck_require__(7026), exports); +__exportStar(__nccwpck_require__(7444), exports); +__exportStar(__nccwpck_require__(2830), exports); /***/ }), -/***/ 51916: +/***/ 5305: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LicenseRepository = void 0; -var LicenseRepository = /** @class */ (function () { - function LicenseRepository(client) { - this.client = client; - } - LicenseRepository.prototype.getCurrent = function () { - return this.client.get(this.client.getLink("CurrentLicense")); - }; - LicenseRepository.prototype.getCurrentStatus = function () { - return this.client.get(this.client.getLink("CurrentLicenseStatus")); - }; - LicenseRepository.prototype.modifyCurrent = function (resource) { - return this.client.update(resource.Links.Self, resource); - }; - return LicenseRepository; -}()); -exports.LicenseRepository = LicenseRepository; /***/ }), -/***/ 56946: +/***/ 7026: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 7444: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -9901,28 +8652,109 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LifecycleRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var LifecycleRepository = /** @class */ (function (_super) { - __extends(LifecycleRepository, _super); - function LifecycleRepository(client) { - return _super.call(this, "Lifecycles", client) || this; +exports.TenantRepository = void 0; +var __1 = __nccwpck_require__(586); +var spaceScopedBasicRepository_1 = __nccwpck_require__(3496); +var TenantRepository = /** @class */ (function (_super) { + __extends(TenantRepository, _super); + function TenantRepository(client, spaceName) { + return _super.call(this, client, spaceName, "".concat(__1.spaceScopedRoutePrefix, "/tenants"), "skip,projectId,tags,take,ids,clone,partialName,clonedFromTenantId") || this; } - LifecycleRepository.prototype.preview = function (lifecycle) { - return this.client.get(lifecycle.Links["Preview"]); + TenantRepository.prototype.tagTest = function (tenantIds, tags) { + return this.client.request("".concat(__1.spaceScopedRoutePrefix, "/tenants/tag-test{?tenantIds,tags}"), { tenantIds: tenantIds, tags: tags }); }; - LifecycleRepository.prototype.projects = function (lifecycle) { - return this.client.get(lifecycle.Links["Projects"]); + TenantRepository.prototype.getVariables = function (tenant) { + return this.client.request("".concat(__1.spaceScopedRoutePrefix, "/tenants/{id}/variables")); }; - return LifecycleRepository; -}(basicRepository_1.BasicRepository)); -exports.LifecycleRepository = LifecycleRepository; + TenantRepository.prototype.setVariables = function (tenant, variables) { + return this.client.doUpdate("".concat(__1.spaceScopedRoutePrefix, "/tenants/{id}/variables"), variables); + }; + TenantRepository.prototype.missingVariables = function (filterOptions, includeDetails) { + if (filterOptions === void 0) { filterOptions = {}; } + if (includeDetails === void 0) { includeDetails = false; } + var payload = { + environmentId: filterOptions.environmentId, + includeDetails: includeDetails, + projectId: filterOptions.projectId, + tenantId: filterOptions.tenantId, + }; + return this.client.request("".concat(__1.spaceScopedRoutePrefix, "/tenants/variables-missing{?tenantId,projectId,environmentId,includeDetails}"), payload); + }; + return TenantRepository; +}(spaceScopedBasicRepository_1.SpaceScopedBasicRepository)); +exports.TenantRepository = TenantRepository; /***/ }), -/***/ 3522: -/***/ (function(__unused_webpack_module, exports) { +/***/ 2830: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 41: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 1321: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IdentityType = void 0; +var IdentityType; +(function (IdentityType) { + IdentityType["Guest"] = "Guest"; + IdentityType["UsernamePassword"] = "UsernamePassword"; + IdentityType["ActiveDirectory"] = "ActiveDirectory"; + IdentityType["OAuth"] = "OAuth"; +})(IdentityType = exports.IdentityType || (exports.IdentityType = {})); + + +/***/ }), + +/***/ 3217: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(41), exports); +__exportStar(__nccwpck_require__(1321), exports); +__exportStar(__nccwpck_require__(4438), exports); +__exportStar(__nccwpck_require__(1380), exports); + + +/***/ }), + +/***/ 1380: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -9963,231 +8795,166 @@ var __generator = (this && this.__generator) || function (thisArg, body) { } }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.saveLogo = exports.uploadLogo = void 0; -function uploadLogo(client, resource, logo) { - var fd = new FormData(); - fd.append("fileToUpload", logo); - return client.post(resource.Links["Logo"], fd); -} -exports.uploadLogo = uploadLogo; -function saveLogo(client, resource, file, reset) { +exports.userGetCurrent = void 0; +var __1 = __nccwpck_require__(586); +function userGetCurrent(client) { return __awaiter(this, void 0, void 0, function () { + var user; return __generator(this, function (_a) { - // Important: when using saveLogo - // We upload the logo first so that when we do the model save we get back a new url for logo - if (file) { - return [2 /*return*/, uploadLogo(client, resource, file)]; - } - else if (reset) { - return [2 /*return*/, uploadLogo(client, resource, null)]; + switch (_a.label) { + case 0: return [4 /*yield*/, client.get("".concat(__1.apiLocation, "/users/me"))]; + case 1: + user = _a.sent(); + return [2 /*return*/, user]; } - return [2 /*return*/]; }); }); } -exports.saveLogo = saveLogo; +exports.userGetCurrent = userGetCurrent; /***/ }), -/***/ 154: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 4438: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachinePolicyRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var MachinePolicyRepository = /** @class */ (function (_super) { - __extends(MachinePolicyRepository, _super); - function MachinePolicyRepository(client) { - return _super.call(this, "MachinePolicies", client) || this; - } - MachinePolicyRepository.prototype.getTemplate = function () { - return this.client.get(this.client.getLink("MachinePolicyTemplate")); - }; - MachinePolicyRepository.prototype.getMachines = function (machinePolicy) { - return this.client.get(machinePolicy.Links["Machines"]); - }; - MachinePolicyRepository.prototype.getWorkers = function (machinePolicy) { - return this.client.get(machinePolicy.Links["Workers"]); - }; - return MachinePolicyRepository; -}(basicRepository_1.BasicRepository)); -exports.MachinePolicyRepository = MachinePolicyRepository; /***/ }), -/***/ 53015: +/***/ 621: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 = (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); +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachineRepository = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var basicRepository_1 = __nccwpck_require__(30970); -var MachineRepository = /** @class */ (function (_super) { - __extends(MachineRepository, _super); - function MachineRepository(client) { - return _super.call(this, "Machines", client) || this; - } - MachineRepository.prototype.discover = function (host, port, type, proxyId) { - return proxyId ? this.client.get(this.client.getLink("DiscoverMachine"), { host: host, port: port, type: type, proxyId: proxyId }) : this.client.get(this.client.getLink("DiscoverMachine"), { host: host, port: port, type: type }); - }; - MachineRepository.prototype.getConnectionStatus = function (machine) { - return this.client.get(machine.Links["Connection"]); - }; - MachineRepository.prototype.getDeployments = function (machine, options) { - return this.client.get(machine.Links["TasksTemplate"], __assign(__assign({}, options), { type: message_contracts_1.DeploymentTargetTaskType.Deployment })); - }; - MachineRepository.prototype.getRunbookRuns = function (machine, options) { - return this.client.get(machine.Links["TasksTemplate"], __assign(__assign({}, options), { type: message_contracts_1.DeploymentTargetTaskType.RunbookRun })); - }; - MachineRepository.prototype.hosted = function () { - var allArgs = { id: "hosted" }; - return this.client.get(this.client.getLink("Machines"), allArgs); - }; - MachineRepository.prototype.list = function (args) { - return this.client.get(this.client.getLink("Machines"), args); - }; - MachineRepository.prototype.listByDeployment = function (deployment) { - return this.client.get(this.client.getLink("Machines"), { deploymentId: deployment.Id, id: "all" }); - }; - MachineRepository.prototype.listByEnvironment = function (environment) { - return this.client.get(environment.Links["Machines"]); - }; - return MachineRepository; -}(basicRepository_1.BasicRepository)); -exports.MachineRepository = MachineRepository; +__exportStar(__nccwpck_require__(9790), exports); /***/ }), -/***/ 50197: +/***/ 9790: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachineRoleRepository = void 0; -var MachineRoleRepository = /** @class */ (function () { - function MachineRoleRepository(client) { - this.client = client; - } - MachineRoleRepository.prototype.all = function () { - return this.client.get(this.client.getLink("MachineRoles")); +exports.isSensitiveValue = exports.NewSensitiveValue = void 0; +function NewSensitiveValue(value, hint) { + return { + HasValue: true, + Hint: hint, + NewValue: value, }; - return MachineRoleRepository; -}()); -exports.MachineRoleRepository = MachineRoleRepository; +} +exports.NewSensitiveValue = NewSensitiveValue; +function isSensitiveValue(value) { + if (typeof value === "string" || value === null) { + return false; + } + return Object.prototype.hasOwnProperty.call(value, "HasValue"); +} +exports.isSensitiveValue = isSensitiveValue; + + +/***/ }), + +/***/ 586: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(5024), exports); +__exportStar(__nccwpck_require__(1542), exports); +__exportStar(__nccwpck_require__(7083), exports); +__exportStar(__nccwpck_require__(3024), exports); +__exportStar(__nccwpck_require__(2399), exports); +__exportStar(__nccwpck_require__(5966), exports); +__exportStar(__nccwpck_require__(2101), exports); +__exportStar(__nccwpck_require__(7948), exports); +__exportStar(__nccwpck_require__(6397), exports); +__exportStar(__nccwpck_require__(5758), exports); +__exportStar(__nccwpck_require__(6050), exports); +__exportStar(__nccwpck_require__(661), exports); +__exportStar(__nccwpck_require__(5924), exports); +__exportStar(__nccwpck_require__(6447), exports); +__exportStar(__nccwpck_require__(5435), exports); +__exportStar(__nccwpck_require__(8043), exports); +__exportStar(__nccwpck_require__(2850), exports); +__exportStar(__nccwpck_require__(6742), exports); +__exportStar(__nccwpck_require__(2138), exports); +__exportStar(__nccwpck_require__(232), exports); +__exportStar(__nccwpck_require__(2054), exports); +__exportStar(__nccwpck_require__(5626), exports); +__exportStar(__nccwpck_require__(3667), exports); +__exportStar(__nccwpck_require__(3295), exports); +__exportStar(__nccwpck_require__(492), exports); +__exportStar(__nccwpck_require__(7218), exports); +__exportStar(__nccwpck_require__(1547), exports); +__exportStar(__nccwpck_require__(7132), exports); /***/ }), -/***/ 1939: +/***/ 5924: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachineShellsRepository = void 0; -var MachineShellsRepository = /** @class */ (function () { - function MachineShellsRepository(client) { - this.client = client; - } - MachineShellsRepository.prototype.all = function () { - return this.client.get(this.client.getLink("MachineShells")); - }; - return MachineShellsRepository; -}()); -exports.MachineShellsRepository = MachineShellsRepository; /***/ }), -/***/ 94772: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 6447: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MaintenanceConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var MaintenanceConfigurationRepository = /** @class */ (function (_super) { - __extends(MaintenanceConfigurationRepository, _super); - function MaintenanceConfigurationRepository(client) { - return _super.call(this, "MaintenanceConfiguration", client) || this; - } - return MaintenanceConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.MaintenanceConfigurationRepository = MaintenanceConfigurationRepository; /***/ }), -/***/ 80891: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 408: +/***/ (function(__unused_webpack_module, exports) { "use strict"; +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +/* eslint-disable @typescript-eslint/no-explicit-any */ var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || @@ -10203,309 +8970,154 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.convertToSpacePartitionParameters = exports.MixedScopeBaseRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -// includeSystem is set to true by default, can be overridden by args -var MixedScopeBaseRepository = /** @class */ (function (_super) { - __extends(MixedScopeBaseRepository, _super); - function MixedScopeBaseRepository() { - return _super !== null && _super.apply(this, arguments) || this; - } - MixedScopeBaseRepository.prototype.all = function (args) { - var combinedArgs = _super.prototype.extend.call(this, this.spacePartitionParameters(), args); - return _super.prototype.all.call(this, combinedArgs); - }; - MixedScopeBaseRepository.prototype.allById = function (args) { - var combinedArgs = _super.prototype.extend.call(this, this.spacePartitionParameters(), args); - return _super.prototype.allById.call(this, combinedArgs); - }; - MixedScopeBaseRepository.prototype.get = function (id, args) { - var allArgs = this.extend(args || {}, { id: id }); - var argsWithSpace = this.extend(allArgs, this.spacePartitionParameters()); - return _super.prototype.get.call(this, id, argsWithSpace); - }; - MixedScopeBaseRepository.prototype.list = function (args) { - var combinedArgs = _super.prototype.extend.call(this, this.spacePartitionParameters(), args); - return _super.prototype.list.call(this, combinedArgs); +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; }; - MixedScopeBaseRepository.prototype.spacePartitionParameters = function () { - return convertToSpacePartitionParameters(this.client.spaceId, true); + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.OctopusError = void 0; +// Octopus prefix is used here as there is already a built-in type called Error +var OctopusError = /** @class */ (function (_super) { + __extends(OctopusError, _super); + function OctopusError(StatusCode, message) { + var _this = _super.call(this, message) || this; + _this.StatusCode = StatusCode; + _this.ErrorMessage = message; + _this.Errors = []; + Object.setPrototypeOf(_this, OctopusError.prototype); + return _this; + } + OctopusError.create = function (statusCode, response) { + var e = new OctopusError(statusCode); + var n = __assign(__assign({}, e), response); + Object.setPrototypeOf(n, OctopusError.prototype); + return n; }; - return MixedScopeBaseRepository; -}(basicRepository_1.BasicRepository)); -exports.MixedScopeBaseRepository = MixedScopeBaseRepository; -function convertToSpacePartitionParameters(spaceId, includeSystem) { - var spaces = spaceId ? [spaceId] : []; - return { includeSystem: includeSystem, spaces: spaces }; -} -exports.convertToSpacePartitionParameters = convertToSpacePartitionParameters; + return OctopusError; +}(Error)); +exports.OctopusError = OctopusError; /***/ }), -/***/ 34819: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 5435: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OctopusServerNodeRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var OctopusServerNodeRepository = /** @class */ (function (_super) { - __extends(OctopusServerNodeRepository, _super); - function OctopusServerNodeRepository(client) { - return _super.call(this, "OctopusServerNodes", client) || this; - } - OctopusServerNodeRepository.prototype.del = function (resource) { - var _this = this; - return this.client.del(resource.Links.Node).then(function (d) { return _this.notifySubscribersToDataModifications(resource); }); - }; - //technically deprecated, as its not called from the UI. - //introduced in 2019.1.0, the code that called it got changed soon after - OctopusServerNodeRepository.prototype.details = function (node) { - return this.client.get(node.Links["Details"]); - }; - OctopusServerNodeRepository.prototype.summary = function () { - return this.client.get(this.client.getLink("OctopusServerClusterSummary")); - }; - return OctopusServerNodeRepository; -}(basicRepository_1.BasicRepository)); -exports.OctopusServerNodeRepository = OctopusServerNodeRepository; /***/ }), -/***/ 53378: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 8043: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/consistent-type-assertions */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PackageRepository = exports.OverwriteMode = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var OverwriteMode; -(function (OverwriteMode) { - OverwriteMode[OverwriteMode["FailIfExists"] = 0] = "FailIfExists"; - OverwriteMode[OverwriteMode["OverwriteExisting"] = 1] = "OverwriteExisting"; - OverwriteMode[OverwriteMode["IgnoreIfExists"] = 2] = "IgnoreIfExists"; -})(OverwriteMode = exports.OverwriteMode || (exports.OverwriteMode = {})); -var PackageRepository = /** @class */ (function (_super) { - __extends(PackageRepository, _super); - function PackageRepository(client) { - return _super.call(this, "Packages", client) || this; +exports.Resolver = void 0; +var URI = __nccwpck_require__(4190); +var URITemplate = __nccwpck_require__(3423); +var Resolver = /** @class */ (function () { + function Resolver(baseUri) { + this.baseUri = baseUri; + this.baseUri = this.baseUri.endsWith("/") ? this.baseUri : this.baseUri + "/"; + var lastIndexOfMandatorySegment = this.baseUri.lastIndexOf("/api/"); + if (lastIndexOfMandatorySegment >= 1) { + this.baseUri = this.baseUri.substring(0, lastIndexOfMandatorySegment); + } + else { + if (this.baseUri.endsWith("/api")) { + this.baseUri = this.baseUri.substring(0, -4); + } + } + this.baseUri = this.baseUri.endsWith("/") ? this.baseUri.substring(0, this.baseUri.length - 1) : this.baseUri; + var parsed = URI(this.baseUri); + this.rootUri = parsed.scheme() + "://" + parsed.authority(); + this.rootUri = this.rootUri.endsWith("/") ? this.rootUri.substring(0, this.rootUri.length - 1) : this.rootUri; } - PackageRepository.prototype.deleteMany = function (packageIds) { - return this.client.del(this.client.getLink("PackagesBulk"), null, { ids: packageIds }); - }; - PackageRepository.prototype.upload = function (pkg, overwriteMode) { - if (overwriteMode === void 0) { overwriteMode = OverwriteMode.FailIfExists; } - var fd = new FormData(); - fd.append("fileToUpload", pkg); - return this.client.post(this.client.getLink("PackageUpload"), fd, { overwriteMode: overwriteMode }); - }; - PackageRepository.prototype.getNotes = function (packages) { - var packageIds = packages.reduce(function (result, item) { - return result + - (result.length === 0 ? "" : ",") + - encodeURIComponent(item.FeedId) + - ":" + - encodeURIComponent(item.PackageId) + - ":" + - encodeURIComponent(item.Version); - }, ""); - return this.client.get(this.client.getLink("PackageNotesList"), { packageIds: packageIds }); + Resolver.prototype.resolve = function (path, uriTemplateParameters) { + if (!path) { + throw new Error("The link is not set to a value"); + } + if (path.startsWith("~/")) { + path = path.substring(1, path.length); + path = this.baseUri + path; + } + else { + path = this.rootUri + path; + } + var template = new URITemplate(path); + var result = template.expand(uriTemplateParameters || {}); + return result; }; - return PackageRepository; -}(basicRepository_1.BasicRepository)); -exports.PackageRepository = PackageRepository; + return Resolver; +}()); +exports.Resolver = Resolver; /***/ }), -/***/ 21797: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 2850: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PerformanceConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var PerformanceConfigurationRepository = /** @class */ (function (_super) { - __extends(PerformanceConfigurationRepository, _super); - function PerformanceConfigurationRepository(client) { - return _super.call(this, "PerformanceConfiguration", client) || this; - } - return PerformanceConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.PerformanceConfigurationRepository = PerformanceConfigurationRepository; +exports.isResource = void 0; +function isResource(resource) { + return "Id" in resource; +} +exports.isResource = isResource; /***/ }), -/***/ 97886: +/***/ 6742: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PermissionDescriptionRepository = void 0; -var PermissionDescriptionRepository = /** @class */ (function () { - function PermissionDescriptionRepository(client) { - this.client = client; - } - PermissionDescriptionRepository.prototype.all = function () { - return this.client.get(this.client.getLink("PermissionDescriptions"), null); - }; - return PermissionDescriptionRepository; -}()); -exports.PermissionDescriptionRepository = PermissionDescriptionRepository; /***/ }), -/***/ 53127: +/***/ 2138: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProgressionRepository = void 0; -var ProgressionRepository = /** @class */ (function () { - function ProgressionRepository(client) { - this.client = client; - } - ProgressionRepository.prototype.getProgression = function (project, options) { - return this.client.get(project.Links["Progression"], options); - }; - ProgressionRepository.prototype.getRunbookProgression = function (runbook, options) { - return this.client.get(runbook.Links["Progression"], options); - }; - ProgressionRepository.prototype.getTaskRunDashboardItemsForProject = function (project, options) { - return this.client.get(project.Links["RunbookTaskRunDashboardItemsTemplate"], options); - }; - ProgressionRepository.prototype.getTaskRunDashboardItemsForRunbook = function (runbook, options) { - return this.client.get(runbook.Links["TaskRunDashboardItemsTemplate"], options); - }; - return ProgressionRepository; -}()); -exports.ProgressionRepository = ProgressionRepository; /***/ }), -/***/ 38331: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 232: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProjectGroupRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var ProjectGroupRepository = /** @class */ (function (_super) { - __extends(ProjectGroupRepository, _super); - function ProjectGroupRepository(client) { - return _super.call(this, "ProjectGroups", client) || this; - } - return ProjectGroupRepository; -}(basicRepository_1.BasicRepository)); -exports.ProjectGroupRepository = ProjectGroupRepository; /***/ }), -/***/ 52058: +/***/ 2054: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -/* eslint-disable @typescript-eslint/no-non-null-assertion,@typescript-eslint/consistent-type-assertions */ -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 = (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); -}; var __awaiter = (this && this.__awaiter) || function (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) { @@ -10543,43937 +9155,25435 @@ var __generator = (this && this.__generator) || function (thisArg, body) { } }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UseDefaultBranch = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var basicRepository_1 = __nccwpck_require__(30970); -exports.UseDefaultBranch = { UseDefaultBranch: true }; -var ProjectRepository = /** @class */ (function (_super) { - __extends(ProjectRepository, _super); - function ProjectRepository(client) { - return _super.call(this, "Projects", client) || this; - } - ProjectRepository.prototype.find = function (nameOrId) { - return __awaiter(this, void 0, void 0, function () { - var _a, projects; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (nameOrId.length === 0) - return [2 /*return*/]; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.get(nameOrId)]; - case 2: return [2 /*return*/, _b.sent()]; - case 3: - _a = _b.sent(); - return [3 /*break*/, 4]; - case 4: return [4 /*yield*/, this.list({ - partialName: nameOrId, - })]; - case 5: - projects = _b.sent(); - return [2 /*return*/, projects.Items.find(function (p) { return p.Name === nameOrId; })]; - } - }); - }); - }; - ProjectRepository.prototype.getChannels = function (project, gitRef, skip, take) { - if (skip === void 0) { skip = 0; } - if (take === void 0) { take = this.takeAll; } - if (gitRef && (0, message_contracts_1.HasVersionControlledPersistenceSettings)(project.PersistenceSettings)) { - return this.client.get(project.Links["Channels"], { skip: skip, take: take, gitRef: gitRef }); - } - return this.client.get(project.Links["Channels"], { skip: skip, take: take }); - }; - ProjectRepository.prototype.getDeployments = function (project) { - return this.client.get(this.client.getLink("Deployments"), { projects: project.Id }); - }; - ProjectRepository.prototype.getDeploymentSettings = function (project, gitRef) { - if (gitRef && (0, message_contracts_1.HasVersionControlledPersistenceSettings)(project.PersistenceSettings)) { - return this.client.get(project.Links["DeploymentSettings"], { gitRef: gitRef }); - } - return this.client.get(project.Links["DeploymentSettings"]); - }; - ProjectRepository.prototype.getReleases = function (project, args) { - return this.client.get(project.Links["Releases"], args); - }; - ProjectRepository.prototype.getReleaseByVersion = function (project, version) { - return this.client.get(project.Links["Releases"], { version: version }); - }; - ProjectRepository.prototype.list = function (args) { - return this.client.get(this.client.getLink("Projects"), __assign({}, args)); - }; - ProjectRepository.prototype.listByGroup = function (projectGroup) { - return this.client.get(projectGroup.Links["Projects"]); - }; - ProjectRepository.prototype.getTriggers = function (project, gitRef, skip, take, triggerActionType, triggerActionCategory, runbooks, partialName) { - return this.client.get(project.Links["Triggers"], { - skip: skip, - take: take, - gitRef: gitRef, - triggerActionType: triggerActionType, - triggerActionCategory: triggerActionCategory, - runbooks: runbooks, - partialName: partialName, - }); - }; - ProjectRepository.prototype.orderChannels = function (project) { - return this.client.post(project.Links["OrderChannels"]); - }; - ProjectRepository.prototype.getPulse = function (projects) { - var projectIds = projects - .map(function (p) { - return p.Id; - }) - .join(","); - return this.client.get(this.client.getLink("ProjectPulse"), { projectIds: projectIds }); - }; - ProjectRepository.prototype.getMetadata = function (project) { - return this.client.get(project.Links["Metadata"], {}); - }; - ProjectRepository.prototype.getRunbooks = function (project, args) { - return this.client.get(project.Links["Runbooks"], args); - }; - ProjectRepository.prototype.summaries = function () { - return this.client.get(this.client.getLink("ProjectsExperimentalSummaries")); - }; - ProjectRepository.prototype.getSummary = function (project, branch) { - return this.client.get(project.Links["Summary"], { gitRef: GetBranchDetails(branch) }); - }; - ProjectRepository.prototype.getBranch = function (project, branch) { - if ((0, message_contracts_1.HasVcsProjectResourceLinks)(project.Links) && (0, message_contracts_1.HasVersionControlledPersistenceSettings)(project.PersistenceSettings)) { - var branchName = ShouldUseDefaultBranch(branch) ? project.PersistenceSettings.DefaultBranch : branch; - return this.client.get(project.Links.Branches, { name: branchName }); - } - throw new Error("Cannot retrieve branches from non-VCS projects"); - }; - ProjectRepository.prototype.getBranches = function (project) { - if ((0, message_contracts_1.HasVcsProjectResourceLinks)(project.Links)) { - return this.client.get(project.Links.Branches); - } - throw new Error("Cannot retrieve branches from non-VCS projects"); - }; - ProjectRepository.prototype.searchBranches = function (project, partialBranchName) { - if ((0, message_contracts_1.HasVcsProjectResourceLinks)(project.Links)) { - return this.client.get(project.Links.Branches, { searchByName: partialBranchName }); - } - throw new Error("Cannot retrieve branches from non-VCS projects"); - }; - ProjectRepository.prototype.convertToVcs = function (project, payload) { - return this.client.post(project.Links.ConvertToVcs, payload); - }; - ProjectRepository.prototype.vcsCompatibilityReport = function (project) { - return this.client.get(project.Links["VersionControlCompatibilityReport"]); - }; - // TODO: @team-config-as-code - Our project needs a custom "Delete" link that does _not_ include the GitRef in order for us to - // successfully hit the /projects/{id} DEL endpoint. For EAP, we're out of time and just hacking it into the frontend client. - ProjectRepository.prototype.del = function (project) { - var _this = this; - if (project.IsVersionControlled) { - // Our "Self" link should currently include the GitRef. If so, and our last path does not look like our projectId, strip it. - var selfLinkParts = project.Links.Self.split("/"); - if (selfLinkParts[selfLinkParts.length - 1] !== project.Id) { - selfLinkParts.pop(); +exports.resolveSpaceId = void 0; +var apiLocation_1 = __nccwpck_require__(7083); +var knownSpaces = {}; +function resolveSpaceId(client, spaceName) { + return __awaiter(this, void 0, void 0, function () { + var spaces, spaceId; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (knownSpaces[spaceName]) { + return [2 /*return*/, knownSpaces[spaceName]]; + } + client.debug("Resolving space from name '".concat(spaceName, "'")); + return [4 /*yield*/, client.get("".concat(apiLocation_1.apiLocation, "/spaces"), { partialName: spaceName })]; + case 1: + spaces = _a.sent(); + spaceId = ""; + if (spaces.TotalResults === 0) { + client.error("No spaces exist with name '".concat(spaceName, "'")); + throw new Error("No spaces exist with name '".concat(spaceName, "'")); + } + spaces.Items.forEach(function (space) { + if (space.Name == spaceName) { + spaceId = space.Id; + knownSpaces[spaceName] = spaceId; + client.debug("Resolved space name '".concat(spaceName, "' to Id ").concat(spaceId)); + } + }); + if (spaceId === "") { + client.error("Unable to resolve space name '".concat(spaceName, "'")); + throw new Error("Unable to resolve space name '".concat(spaceName, "'")); + } + return [2 /*return*/, spaceId]; } - var selfLink = selfLinkParts.join("/"); - return this.client.del(selfLink).then(function (d) { return _this.notifySubscribersToDataModifications(project); }); - } - else { - return this.client.del(project.Links.Self).then(function (d) { return _this.notifySubscribersToDataModifications(project); }); - } - }; - ProjectRepository.prototype.markAsStale = function (project) { - return this.client.post(project.Links["RepositoryModified"]); - }; - return ProjectRepository; -}(basicRepository_1.BasicRepository)); -function ShouldUseDefaultBranch(branch) { - return typeof branch === "object"; + }); + }); } -function GetBranchDetails(branch) { - if (typeof branch === "string" || branch instanceof String) { - return branch; - } - else { - return branch === null || branch === void 0 ? void 0 : branch.Name; - } +exports.resolveSpaceId = resolveSpaceId; + + +/***/ }), + +/***/ 5626: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isSpaceScopedArgs = void 0; +function isSpaceScopedArgs(args) { + return "spaceName" in args; } -exports["default"] = ProjectRepository; +exports.isSpaceScopedArgs = isSpaceScopedArgs; /***/ }), -/***/ 91795: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 3667: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -/* eslint-disable @typescript-eslint/no-non-null-assertion,jsdoc/require-param */ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/consistent-type-assertions */ -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 = (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 })); -exports.ProjectScopedRepository = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var basicRepository_1 = __nccwpck_require__(30970); -var lodash_1 = __nccwpck_require__(90250); -var ProjectScopedRepository = /** @class */ (function (_super) { - __extends(ProjectScopedRepository, _super); - function ProjectScopedRepository(projectRepository, collectionLinkName, client) { - var _this = _super.call(this, collectionLinkName, client) || this; - _this.takeAll = 2147483647; - _this.projectRepository = projectRepository; - return _this; - } - ProjectScopedRepository.prototype.create = function (resource, args) { - var _this = this; - // Need to separate this out because it's either called immediately, or - var createInternal = function (projectResource, resource, args) { - // For now, we only want to use the project scoped endpoint for version controlled projects - // Database projects should remain as they were - if (projectResource.PersistenceSettings.Type == message_contracts_1.PersistenceSettingsType.VersionControlled) { - return _this.createForProject(projectResource, resource, args); - } - return _super.prototype.create.call(_this, resource, args); - }; - return this.projectRepository.get(resource.ProjectId).then(function (proj) { return createInternal(proj, resource, args); }); - }; - ProjectScopedRepository.prototype.createForProject = function (projectResource, resource, args) { - var _this = this; - var link = projectResource.Links[this.collectionLinkName]; - return this.client.create(link, resource, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); - }; - ProjectScopedRepository.prototype.listFromProject = function (projectResource, args) { - var link = projectResource.Links[this.collectionLinkName]; - return this.client.get(link, args); - }; - ProjectScopedRepository.prototype.getFromProject = function (projectResource, id, args) { - if (projectResource.PersistenceSettings.Type == message_contracts_1.PersistenceSettingsType.VersionControlled) { - var allArgs = this.extend(args || {}, { id: id }); - var link = projectResource.Links[this.collectionLinkName]; - return this.client.get(link, allArgs); - } - return _super.prototype.get.call(this, id, args); - }; - ProjectScopedRepository.prototype.allFromProject = function (projectResource, args) { - if (args !== undefined && args.ids instanceof Array && args.ids.length === 0) { - return new Promise(function (res) { - res([]); - }); - } - // http.sys has a max query string of about 16k chars. Our typical max id length is 50 chars - // so if we are doing requests by id and have more than 300, split into multiple requests - var maxIds = 300; - if (args !== undefined && args.ids instanceof Array && args.ids.length > maxIds) { - return this.batchRequestsByIdForProject(projectResource, args, maxIds); - } - var allArgs = this.extend(args || {}, { take: this.takeAll }); - var link = projectResource.Links[this.collectionLinkName]; - return this.client.get(link, allArgs).then(function (res) { return res.Items; }); - }; - ProjectScopedRepository.prototype.saveToProject = function (projectResource, resource, args) { - if (isNewResource(resource)) { - return this.createForProject(projectResource, resource, args); - } - else { - //We need the cast here, since there is a bug in typescript where things don't narrow appropriately for generics https://github.com/microsoft/TypeScript/issues/44404 - //The usual workaround of inverting the checks doesn't seem to work here unfortunately so there is no way to avoid the cast until the bug is fixed. - return this.modify(resource, args); - } - function isTruthy(value) { - return !!value; - } - function isNewResource(resource) { - return !("Id" in resource && isTruthy(resource.Id) && isTruthy(resource.Links)); - } - }; - ProjectScopedRepository.prototype.batchRequestsByIdForProject = function (projectResource, args, batchSize) { - var _this = this; - var idArrays = (0, lodash_1.chunk)(args.ids, batchSize); - var promises = idArrays.map(function (ids) { - var newArgs = __assign(__assign({}, args), { ids: ids }); - var link = projectResource.Links[_this.collectionLinkName]; - return _this.client.get(link, newArgs); - }); - return Promise.all(promises).then(function (result) { return (0, lodash_1.flatten)(result); }); - }; - return ProjectScopedRepository; -}(basicRepository_1.BasicRepository)); -exports.ProjectScopedRepository = ProjectScopedRepository; +exports.isSpaceScopedOperation = void 0; +function isSpaceScopedOperation(command) { + return "spaceName" in command; +} +exports.isSpaceScopedOperation = isSpaceScopedOperation; /***/ }), -/***/ 57502: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 3295: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProjectTriggerRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var ProjectTriggerRepository = /** @class */ (function (_super) { - __extends(ProjectTriggerRepository, _super); - function ProjectTriggerRepository(client) { - return _super.call(this, "ProjectTriggers", client) || this; - } - return ProjectTriggerRepository; -}(basicRepository_1.BasicRepository)); -exports.ProjectTriggerRepository = ProjectTriggerRepository; +exports.isSpaceScopedRequest = void 0; +function isSpaceScopedRequest(command) { + return "spaceName" in command; +} +exports.isSpaceScopedRequest = isSpaceScopedRequest; /***/ }), -/***/ 7358: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 492: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProxyRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var ProxyRepository = /** @class */ (function (_super) { - __extends(ProxyRepository, _super); - function ProxyRepository(client) { - return _super.call(this, "Proxies", client) || this; - } - return ProxyRepository; -}(basicRepository_1.BasicRepository)); -exports.ProxyRepository = ProxyRepository; +exports.isSpaceScopedResource = void 0; +function isSpaceScopedResource(resource) { + return "SpaceId" in resource; +} +exports.isSpaceScopedResource = isSpaceScopedResource; /***/ }), -/***/ 87252: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 7218: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ReleasesRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var ReleasesRepository = /** @class */ (function (_super) { - __extends(ReleasesRepository, _super); - function ReleasesRepository(client) { - return _super.call(this, "Releases", client) || this; - } - ReleasesRepository.prototype.getDeployments = function (release, options) { - return this.client.get(release.Links["Deployments"], options); - }; - ReleasesRepository.prototype.getDeploymentTemplate = function (release) { - return this.client.get(release.Links["DeploymentTemplate"]); - }; - ReleasesRepository.prototype.getDeploymentPreview = function (promotionTarget) { - return this.client.get(promotionTarget.Links["Preview"], { includeDisabledSteps: true }); - }; - ReleasesRepository.prototype.progression = function (release) { - return this.client.get(release.Links["Progression"]); - }; - ReleasesRepository.prototype.snapshotVariables = function (release) { - return this.client.post(release.Links["SnapshotVariables"]); - }; - ReleasesRepository.prototype.deploymentPreviews = function (release, deploymentTemplates) { - return this.client.post(release.Links["DeploymentPreviews"], deploymentTemplates); - }; - ReleasesRepository.prototype.getChannel = function (release) { - return this.client.get(release.Links["Channel"]); - }; - ReleasesRepository.prototype.getLifecycle = function (release) { - return this.client.get(release.Links["Lifecycle"]); - }; - return ReleasesRepository; -}(basicRepository_1.BasicRepository)); -exports.ReleasesRepository = ReleasesRepository; +exports.spaceScopedRoutePrefix = void 0; +var apiLocation_1 = __nccwpck_require__(7083); +exports.spaceScopedRoutePrefix = "".concat(apiLocation_1.apiLocation, "/{spaceId}"); /***/ }), -/***/ 11050: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 1547: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RetentionDefaultConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var RetentionDefaultConfigurationRepository = /** @class */ (function (_super) { - __extends(RetentionDefaultConfigurationRepository, _super); - function RetentionDefaultConfigurationRepository(client) { - return _super.call(this, "RetentionDefaultConfiguration", client) || this; +exports.SubscriptionRecord = void 0; +var SubscriptionRecord = /** @class */ (function () { + function SubscriptionRecord() { + this.subscriptions = {}; } - return RetentionDefaultConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.RetentionDefaultConfigurationRepository = RetentionDefaultConfigurationRepository; - - -/***/ }), - -/***/ 82404: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - 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); + SubscriptionRecord.prototype.subscribe = function (registrationName, callback) { + var _this = this; + this.subscriptions[registrationName] = callback; + return function () { return _this.unsubscribe(registrationName); }; }; - return function (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 __()); + SubscriptionRecord.prototype.unsubscribe = function (registrationName) { + delete this.subscriptions[registrationName]; }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunbookProcessRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var RunbookProcessRepository = /** @class */ (function (_super) { - __extends(RunbookProcessRepository, _super); - function RunbookProcessRepository(client) { - return _super.call(this, "RunbookProcesses", client) || this; - } - RunbookProcessRepository.prototype.getRunbookSnapshotTemplate = function (runbookProcess, runbookSnapshotId) { - return this.client.get(runbookProcess.Links["RunbookSnapshotTemplate"], { runbookSnapshotId: runbookSnapshotId }); + SubscriptionRecord.prototype.notify = function (predicate, data) { + var _this = this; + Object.keys(this.subscriptions) + .filter(predicate) + .forEach(function (key) { return _this.subscriptions[key](data); }); }; - return RunbookProcessRepository; -}(basicRepository_1.BasicRepository)); -exports.RunbookProcessRepository = RunbookProcessRepository; + SubscriptionRecord.prototype.notifyAll = function (data) { + this.notify(function () { return true; }, data); + }; + SubscriptionRecord.prototype.notifySingle = function (registrationName, data) { + if (registrationName in this.subscriptions) { + this.subscriptions[registrationName](data); + } + }; + return SubscriptionRecord; +}()); +exports.SubscriptionRecord = SubscriptionRecord; /***/ }), -/***/ 18312: +/***/ 7132: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __awaiter = (this && this.__awaiter) || function (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()); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isPropertyDefinedAndNotNull = exports.typeSafeHasOwnProperty = exports.ensureSuffix = exports.ensurePrefix = exports.determineServerEndpoint = exports.getResolver = exports.getServerEndpoint = exports.getQueryValue = void 0; +var lodash_1 = __nccwpck_require__(250); +var urijs_1 = __importDefault(__nccwpck_require__(4190)); +var resolver_1 = __nccwpck_require__(8043); +var getQueryValue = function (key, location) { + var result; + (0, urijs_1.default)(location).hasQuery(key, function (value) { + result = value; }); + return result; }; -var __generator = (this && this.__generator) || function (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 }; - } +exports.getQueryValue = getQueryValue; +var getServerEndpoint = function (location) { + if (location === void 0) { location = window.location; } + return (0, exports.getQueryValue)("octopus.server", location.href) || (0, exports.determineServerEndpoint)(location); }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunbookRepository = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var semver_1 = __nccwpck_require__(11383); -var basicRepository_1 = __nccwpck_require__(30970); -var RunbookRepository = /** @class */ (function (_super) { - __extends(RunbookRepository, _super); - function RunbookRepository(client) { - var _this = _super.call(this, "Runbooks", client) || this; - _this.integrationTestVersion = new semver_1.SemVer("0.0.0-local"); - _this.versionAfterWhichRunbookRunParametersAreAvailable = new semver_1.SemVer("2020.3.1"); - return _this; +exports.getServerEndpoint = getServerEndpoint; +var getResolver = function (base) { + var resolver = new resolver_1.Resolver(base); + return resolver.resolve.bind(resolver); +}; +exports.getResolver = getResolver; +var determineServerEndpoint = function (location) { + var endpoint = (0, exports.ensureSuffix)("//", "" + location.protocol) + location.host; + var path = (0, exports.ensurePrefix)("/", location.pathname); + if (path.length >= 1) { + var lastSegmentIndex = path.lastIndexOf("/"); + if (lastSegmentIndex >= 0) { + path = path.substring(0, lastSegmentIndex + 1); + } } - RunbookRepository.prototype.find = function (nameOrId, project) { - return __awaiter(this, void 0, void 0, function () { - var _a, runbooks; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (nameOrId.length === 0) - return [2 /*return*/]; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.get(nameOrId)]; - case 2: return [2 /*return*/, _b.sent()]; - case 3: - _a = _b.sent(); - return [3 /*break*/, 4]; - case 4: return [4 /*yield*/, this.list({ - partialName: nameOrId, - projectIds: [project.Id] - })]; - case 5: - runbooks = _b.sent(); - return [2 /*return*/, runbooks.Items.find(function (r) { return r.Name === nameOrId; })]; - } - }); - }); - }; - RunbookRepository.prototype.getRunbookEnvironments = function (runbook) { - return this.client.get(runbook.Links["RunbookEnvironments"]); - }; - RunbookRepository.prototype.getRunbookRunPreview = function (promotionTarget) { - return this.client.get(promotionTarget.Links["RunbookRunPreview"], { includeDisabledSteps: true }); - }; - RunbookRepository.prototype.getRunbookRunTemplate = function (runbook) { - return this.client.get(runbook.Links["RunbookRunTemplate"]); - }; - RunbookRepository.prototype.getRunbookSnapshots = function (runbook, args) { - return this.client.get(runbook.Links["RunbookSnapshots"], args); - }; - RunbookRepository.prototype.getRunbookSnapshotTemplate = function (runbook) { - return this.client.get(runbook.Links["RunbookSnapshotTemplate"]); - }; - RunbookRepository.prototype.run = function (runbook, runbookRun) { - return __awaiter(this, void 0, void 0, function () { - var supportsRunbookRunParameters, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - supportsRunbookRunParameters = this.serverSupportsRunbookRunParameters(this.client.getServerInformation().version); - if (!supportsRunbookRunParameters) return [3 /*break*/, 2]; - return [4 /*yield*/, this.runWithParameters(runbook, message_contracts_1.RunbookRunParameters.MapFrom(runbookRun))]; - case 1: - _a = (_b.sent())[0]; - return [3 /*break*/, 4]; - case 2: return [4 /*yield*/, this.client.post(runbook.Links["CreateRunbookRun"], runbookRun)]; - case 3: - _a = _b.sent(); - _b.label = 4; - case 4: return [2 /*return*/, _a]; - } - }); - }); - }; - RunbookRepository.prototype.runWithParameters = function (runbook, runbookRunParameters) { - return __awaiter(this, void 0, void 0, function () { - var serverVersion, serverSupportsRunbookRunParameters; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - serverVersion = this.client.getServerInformation().version; - serverSupportsRunbookRunParameters = this.serverSupportsRunbookRunParameters(serverVersion); - if (!serverSupportsRunbookRunParameters) - throw new Error("This Octopus Deploy server is an older version ".concat(serverVersion, " that does not yet support RunbookRunParameters. Please update your Octopus Deploy server to 2020.3.* or newer to access this feature.")); - return [4 /*yield*/, this.client.post(runbook.Links["CreateRunbookRun"], runbookRunParameters)]; - case 1: return [2 /*return*/, _a.sent()]; - } - }); - }); - }; - RunbookRepository.prototype.serverSupportsRunbookRunParameters = function (version) { - var serverVersion = new semver_1.SemVer(version); - // note: ensure the server version is >= *any* 2020.3.1 - return serverVersion >= this.versionAfterWhichRunbookRunParametersAreAvailable || serverVersion == this.integrationTestVersion; - }; - return RunbookRepository; -}(basicRepository_1.BasicRepository)); -exports.RunbookRepository = RunbookRepository; + endpoint = endpoint + path; + return endpoint; +}; +exports.determineServerEndpoint = determineServerEndpoint; +exports.ensurePrefix = (0, lodash_1.curry)(function (prefix, value) { return (!value.startsWith(prefix) ? "".concat(prefix).concat(value) : value); }); +exports.ensureSuffix = (0, lodash_1.curry)(function (suffix, value) { return (!value.endsWith(suffix) ? "".concat(value).concat(suffix) : value); }); +var typeSafeHasOwnProperty = function (target, key) { + return target.hasOwnProperty(key); +}; +exports.typeSafeHasOwnProperty = typeSafeHasOwnProperty; +var isPropertyDefinedAndNotNull = function (target, key) { + return (0, exports.typeSafeHasOwnProperty)(target, key) && target[key] !== null && target[key] !== undefined; +}; +exports.isPropertyDefinedAndNotNull = isPropertyDefinedAndNotNull; /***/ }), -/***/ 30242: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; +/***/ 4812: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunbookRunRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var RunbookRunRepository = /** @class */ (function (_super) { - __extends(RunbookRunRepository, _super); - function RunbookRunRepository(client) { - return _super.call(this, "RunbookRuns", client) || this; - } - return RunbookRunRepository; -}(basicRepository_1.BasicRepository)); -exports.RunbookRunRepository = RunbookRunRepository; +module.exports = +{ + parallel : __nccwpck_require__(8210), + serial : __nccwpck_require__(445), + serialOrdered : __nccwpck_require__(3578) +}; /***/ }), -/***/ 73544: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 1700: +/***/ ((module) => { -"use strict"; +// API +module.exports = abort; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunbookSnapshotRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var RunbookSnapshotRepository = /** @class */ (function (_super) { - __extends(RunbookSnapshotRepository, _super); - function RunbookSnapshotRepository(client) { - return _super.call(this, "RunbookSnapshots", client) || this; - } - RunbookSnapshotRepository.prototype.getRunbookRunPreviewForPromotionTarget = function (promotionTarget) { - return this.client.get(promotionTarget.Links["RunbookRunPreview"], { includeDisabledSteps: true }); - }; - RunbookSnapshotRepository.prototype.getRunbookRuns = function (runbookSnapshot, options) { - return this.client.get(runbookSnapshot.Links["RunbookRuns"], options); - }; - RunbookSnapshotRepository.prototype.getRunbookRunTemplate = function (runbookSnapshot) { - return this.client.get(runbookSnapshot.Links["RunbookRunTemplate"]); - }; - RunbookSnapshotRepository.prototype.snapshotVariables = function (runbookSnapshot) { - return this.client.post(runbookSnapshot.Links["SnapshotVariables"]); - }; - return RunbookSnapshotRepository; -}(basicRepository_1.BasicRepository)); -exports.RunbookSnapshotRepository = RunbookSnapshotRepository; +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + // reset leftover jobs + state.jobs = {}; +} -/***/ }), +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} -/***/ 63767: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; +/***/ }), -/* eslint-disable @typescript-eslint/no-explicit-any */ -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 = (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 })); -exports.SchedulerRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var SchedulerRepository = /** @class */ (function (_super) { - __extends(SchedulerRepository, _super); - function SchedulerRepository(client) { - return _super.call(this, "Scheduler", client) || this; - } - SchedulerRepository.prototype.getDetails = function (name, options) { - var args = __assign(__assign({}, options), { name: name }); - return this.client.get(this.client.getLink("Scheduler"), args); - }; - return SchedulerRepository; -}(basicRepository_1.BasicRepository)); -exports.SchedulerRepository = SchedulerRepository; +/***/ 2794: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var defer = __nccwpck_require__(5295); -/***/ }), +// API +module.exports = async; -/***/ 18774: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; -"use strict"; + // check if async happened + defer(function() { isAsync = true; }); -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ScopedUserRoleRepository = void 0; -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var ScopedUserRoleRepository = /** @class */ (function (_super) { - __extends(ScopedUserRoleRepository, _super); - function ScopedUserRoleRepository(client) { - return _super.call(this, "ScopedUserRoles", client) || this; + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); } - return ScopedUserRoleRepository; -}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); -exports.ScopedUserRoleRepository = ScopedUserRoleRepository; + }; +} /***/ }), -/***/ 96489: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 5295: +/***/ ((module) => { -"use strict"; +module.exports = defer; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ServerConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var ServerConfigurationRepository = /** @class */ (function (_super) { - __extends(ServerConfigurationRepository, _super); - function ServerConfigurationRepository(client) { - return _super.call(this, "ServerConfiguration", client) || this; - } - ServerConfigurationRepository.prototype.settings = function () { - return this.client.get(this.client.getLink("ServerConfigurationSettings")); - }; - return ServerConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.ServerConfigurationRepository = ServerConfigurationRepository; +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} /***/ }), -/***/ 84463: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9023: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var async = __nccwpck_require__(2794) + , abort = __nccwpck_require__(1700) + ; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ServerStatusRepository = void 0; -var ServerStatusRepository = /** @class */ (function () { - function ServerStatusRepository(client) { - this.client = client; +// API +module.exports = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; } - ServerStatusRepository.prototype.getServerStatus = function () { - return this.client.get(this.client.getLink("ServerStatus")); - }; - ServerStatusRepository.prototype.getLogs = function (status, args) { - return this.client.get(status.Links["RecentLogs"], args); - }; - ServerStatusRepository.prototype.getHealth = function (status) { - return this.client.get(status.Links["Health"]); - }; - ServerStatusRepository.prototype.getSystemInfo = function (status) { - return this.client.get(status.Links["SystemInfo"]); - }; - ServerStatusRepository.prototype.gcCollect = function (status) { - return this.client.post(status.Links["GCCollect"], status); - }; - ServerStatusRepository.prototype.getDocumentCounts = function (status) { - return this.client.get(status.Links["DocumentCounts"]); - }; - ServerStatusRepository.prototype.getExtensionStats = function () { - return this.client.get(this.client.getLink("ExtensionStats")); - }; - ServerStatusRepository.prototype.getTimezones = function () { - return this.client.get(this.client.getLink("Timezones")); - }; - return ServerStatusRepository; -}()); -exports.ServerStatusRepository = ServerStatusRepository; + // clean up jobs + delete state.jobs[key]; -/***/ }), + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } -/***/ 50924: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + // return salvaged results + callback(error, state.results); + }); +} -"use strict"; +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; -/* eslint-disable @typescript-eslint/no-explicit-any */ -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var SettingsRepository = /** @class */ (function (_super) { - __extends(SettingsRepository, _super); - function SettingsRepository(client) { - return _super.call(this, "Configuration", client) || this; - } - SettingsRepository.prototype.getById = function (id) { - return this.client.get(this.client.getLink("Configuration"), { id: id }); - }; - SettingsRepository.prototype.getValues = function (resource) { - return this.client.get(resource.Links["Values"]); - }; - SettingsRepository.prototype.getMetadata = function (resource) { - return this.client.get(resource.Links["Metadata"]); - }; - SettingsRepository.prototype.saveValues = function (metadataResource, resource) { - return this.client.put(metadataResource.Links["Values"], resource); - }; - return SettingsRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = SettingsRepository; + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; +} /***/ }), -/***/ 7025: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 2474: +/***/ ((module) => { -"use strict"; +// API +module.exports = state; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SmtpConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var SmtpConfigurationRepository = /** @class */ (function (_super) { - __extends(SmtpConfigurationRepository, _super); - function SmtpConfigurationRepository(client) { - return _super.call(this, "SmtpConfiguration", client) || this; - } - SmtpConfigurationRepository.prototype.IsConfigured = function () { - return this.client.get(this.client.getLink("SmtpIsConfigured")); - }; - return SmtpConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.SmtpConfigurationRepository = SmtpConfigurationRepository; +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} /***/ }), -/***/ 56836: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 7942: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var abort = __nccwpck_require__(1700) + , async = __nccwpck_require__(2794) + ; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SpaceRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var SpaceRepository = /** @class */ (function (_super) { - __extends(SpaceRepository, _super); - function SpaceRepository(client) { - return _super.call(this, "Spaces", client) || this; - } - SpaceRepository.prototype.search = function (keyword) { - return this.client.get(this.client.getLink("SpaceSearch"), { id: this.client.spaceId, keyword: keyword }); - }; - return SpaceRepository; -}(basicRepository_1.BasicRepository)); -exports.SpaceRepository = SpaceRepository; +// API +module.exports = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); +} /***/ }), -/***/ 94178: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 8210: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var iterate = __nccwpck_require__(9023) + , initState = __nccwpck_require__(2474) + , terminator = __nccwpck_require__(7942) + ; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var SubscriptionRepository = /** @class */ (function (_super) { - __extends(SubscriptionRepository, _super); - function SubscriptionRepository(client) { - return _super.call(this, "Subscriptions", client) || this; - } - return SubscriptionRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = SubscriptionRepository; +// Public API +module.exports = parallel; +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); -/***/ }), + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } -/***/ 50450: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); -"use strict"; + state.index++; + } -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var TagSetRepository = /** @class */ (function (_super) { - __extends(TagSetRepository, _super); - function TagSetRepository(client) { - return _super.call(this, "TagSets", client) || this; - } - TagSetRepository.prototype.sort = function (ids) { - return this.client.put(this.client.getLink("TagSetSortOrder"), ids); - }; - return TagSetRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = TagSetRepository; + return terminator.bind(state, callback); +} /***/ }), -/***/ 53573: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 445: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var serialOrdered = __nccwpck_require__(3578); -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 = (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 })); -exports.TaskRepository = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var lodash_1 = __nccwpck_require__(90250); -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var TaskRepository = /** @class */ (function (_super) { - __extends(TaskRepository, _super); - function TaskRepository(client) { - return _super.call(this, "Tasks", client) || this; - } - TaskRepository.prototype.createPerformIntegrityCheckTask = function () { - return this.createSystemTask(message_contracts_1.TaskName.SystemIntegrityCheck, "Check System Integrity", {}); - }; - TaskRepository.prototype.createSynchronizeCommunityStepTemplatesTask = function () { - return this.createSystemTask(message_contracts_1.TaskName.SyncCommunityActionTemplates, "Synchronize Community Step Templates", {}); - }; - TaskRepository.prototype.createConfigureLetsEncryptTask = function (letsEncryptArguments) { - return this.createSystemTask(message_contracts_1.TaskName.ConfigureLetsEncrypt, "Configure Let's Encrypt SSL Certificate", letsEncryptArguments); - }; - TaskRepository.prototype.createRenewLetsEncryptTask = function (letsEncryptArguments) { - return this.createSystemTask(message_contracts_1.TaskName.ConfigureLetsEncrypt, "Renew Let's Encrypt SSL Certificate", letsEncryptArguments); - }; - TaskRepository.prototype.createSendTestEmailTask = function (emailAddress) { - return this.createSystemTask(message_contracts_1.TaskName.TestEmail, "Send test email", { EmailAddress: emailAddress }); - }; - TaskRepository.prototype.createUpgradeTentaclesTask = function () { - return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, "Upgrade Tentacles", {}); - }; - TaskRepository.prototype.createUpgradeTentaclesTaskForEnvironment = function (environment, machineIds) { - var description = environment ? "Upgrade Tentacles in ".concat(environment.Name) : "Upgrade Tentacles"; - var upgradeTaskArguments = __assign({ RestrictedTo: message_contracts_1.TaskRestrictedTo.DeploymentTargets, MachineIds: machineIds }, (environment ? { EnvironmentId: environment.Id } : {})); - return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, description, upgradeTaskArguments); - }; - TaskRepository.prototype.createUpgradeTentacleOnMachineTask = function (machine) { - if (machine.Id !== null && machine.Id !== undefined) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, "Upgrade Tentacle on ".concat(machine.Name), { MachineIds: [machine.Id] }); - } - }; - TaskRepository.prototype.createUpgradeTentacleOnWorkerPoolTask = function (workerPool, machineIds) { - var description = workerPool ? "Upgrade Tentacles in ".concat(workerPool.Name) : "Upgrade Tentacles"; - var upgradeTaskArguments = __assign({ RestrictedTo: message_contracts_1.TaskRestrictedTo.Workers, MachineIds: machineIds }, (workerPool ? { WorkerPoolId: workerPool.Id } : {})); - return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, description, upgradeTaskArguments); - }; - TaskRepository.prototype.createUpgradeTentaclesTaskRestrictedTo = function (restrictedTo, MachineIds) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, "Upgrade Tentacles", { RestrictedTo: restrictedTo, MachineIds: MachineIds }); - }; - TaskRepository.prototype.createPerformHealthCheckTaskForEnvironment = function (environment, machineIds) { - var description = environment ? "Check deployment target health in ".concat(environment.Name) : "Check deployment target health"; - var healthCheckArguments = __assign({ Timeout: "00:05:00", OnlyTestConnection: false, RestrictedTo: message_contracts_1.TaskRestrictedTo.DeploymentTargets, MachineIds: machineIds }, (environment ? { EnvironmentId: environment.Id } : {})); - return this.createSpaceScopedTask(message_contracts_1.TaskName.Health, description, healthCheckArguments); - }; - TaskRepository.prototype.createPerformHealthCheckTaskForWorkerPool = function (workerPool, machineIds) { - var description = workerPool ? "Check worker health in ".concat(workerPool.Name) : "Check worker health"; - var healthCheckArguments = __assign({ Timeout: "00:05:00", OnlyTestConnection: false, RestrictedTo: message_contracts_1.TaskRestrictedTo.Workers, MachineIds: machineIds }, (workerPool ? { WorkerPoolId: workerPool.Id } : {})); - return this.createSpaceScopedTask(message_contracts_1.TaskName.Health, description, healthCheckArguments); - }; - TaskRepository.prototype.createHealthCheckTaskForMachine = function (machine) { - if (machine.Id !== null && machine.Id !== undefined) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.Health, "Check ".concat(machine.Name, " health"), { - Timeout: "00:05:00", - MachineIds: [machine.Id], - OnlyTestConnection: false, - }); - } - }; - TaskRepository.prototype.createHealthCheckTaskRestrictedTo = function (restrictedTo, machineIds) { - var description = restrictedTo === message_contracts_1.TaskRestrictedTo.Workers ? "Check worker health" : "Check deployment target health"; - return this.createSpaceScopedTask(message_contracts_1.TaskName.Health, description, { - Timeout: "00:05:00", - OnlyTestConnection: false, - RestrictedTo: restrictedTo, - MachineIds: machineIds, - }); - }; - TaskRepository.prototype.createUpdateCalamariOnTargetsTask = function (deploymentTargetIds) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.UpdateCalamari, "Update Calamari on Deployment Targets", { MachineIds: deploymentTargetIds }); - }; - TaskRepository.prototype.createUpdateCalamariOnWorkersTask = function (workerIds) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.UpdateCalamari, "Upgrade Calamari on Workers", { MachineIds: workerIds }); - }; - TaskRepository.prototype.createUpdateCalamariOnTargetTask = function (machine) { - if (machine.Id !== null && machine.Id !== undefined) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.UpdateCalamari, "Update Calamari on ".concat(machine.Name), { MachineIds: [machine.Id] }); - } - }; - TaskRepository.prototype.createSynchronizeBuiltInPackageRepositoryTask = function () { - return this.createSpaceScopedTask(message_contracts_1.TaskName.SynchronizeBuiltInPackageRepositoryIndex, "Re-index built-in package repository", {}); - }; - TaskRepository.prototype.createTestAzureAccountTask = function (azureAccountId) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.TestAccount, "Test Azure account", { AccountId: azureAccountId }); - }; - TaskRepository.prototype.createTestAwsAccountTask = function (awsAccountId) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.TestAccount, "Test Amazon Web Services account", { AccountId: awsAccountId }); - }; - TaskRepository.prototype.createTestGoogleCloudAccountTask = function (googleCloudAccountId) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.TestAccount, "Test Google Cloud account", { AccountId: googleCloudAccountId }); - }; - TaskRepository.prototype.createRunActionTemplateTask = function (targets, properties, template) { - var runActionTemplateArguments = __assign(__assign({}, targets), { Properties: properties, ActionTemplateId: template.Id }); - return this.createSpaceScopedTask(message_contracts_1.TaskName.AdHocScript, "Run step template: " + template.Name, runActionTemplateArguments); - }; - TaskRepository.prototype.createScriptConsoleTask = function (targets, syntax, scriptBody) { - var scriptConsoleArguments = __assign(__assign({}, targets), { Syntax: syntax, ScriptBody: scriptBody }); - return this.createSpaceScopedTask(message_contracts_1.TaskName.AdHocScript, "Script run from management console", scriptConsoleArguments); - }; - TaskRepository.prototype.create = function (resource, args) { - throw new Error("Can't create generic tasks. Instead, concrete task factory methods on the TaskRepository should be used to create tasks"); - }; - TaskRepository.prototype.details = function (task, args) { - return this.client.get(task.Links["Details"], args); - }; - TaskRepository.prototype.getQueuedBehind = function (task, args) { - var combinedParameters = this.extend(this.spacePartitionParameters(), args); - return this.client.get(task.Links["QueuedBehind"], combinedParameters); - }; - TaskRepository.prototype.getRaw = function (task) { - return this.client.getRaw(task.Links["Raw"]); - }; - TaskRepository.prototype.taskTypes = function () { - return this.client.get(this.client.getLink("TaskTypes"), {}); - }; - TaskRepository.prototype.filter = function (args) { - var combinedParameters = this.extend(this.spacePartitionParameters(), args); - return this.client.get(this.client.getLink("Tasks"), combinedParameters); - }; - TaskRepository.prototype.rerun = function (task) { - return this.client.post(task.Links["Rerun"]); - }; - TaskRepository.prototype.cancel = function (task) { - return this.client.post(task.Links["Cancel"]); - }; - TaskRepository.prototype.changeState = function (task, state, reason) { - return this.client.post(task.Links["State"], { state: state, reason: reason }); - }; - TaskRepository.prototype.list = function (args) { - return _super.prototype.list.call(this, args); - }; - TaskRepository.prototype.byIds = function (ids) { - var _this = this; - var batchSize = 300; - var idArrays = (0, lodash_1.chunk)(ids, batchSize); - var promises = idArrays.map(function (i) { - return _this.list({ ids: i, take: batchSize }); - }); - return Promise.all(promises).then(function (result) { return (0, lodash_1.flatMap)(result, function (c) { return c.Items; }); }); - }; - TaskRepository.prototype.createSystemTask = function (name, description, taskArguments) { - return _super.prototype.create.call(this, { - Name: name, - Description: description, - Arguments: taskArguments, - SpaceId: null, - }); - }; - TaskRepository.prototype.createSpaceScopedTask = function (name, description, taskArguments) { - if (!this.client.spaceId) { - throw new Error("Tried to create a space scoped task without being in the context of a space"); - } - return _super.prototype.create.call(this, { - Name: name, - Description: description, - Arguments: taskArguments, - SpaceId: this.client.spaceId, - }); - }; - return TaskRepository; -}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); -exports.TaskRepository = TaskRepository; +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} /***/ }), -/***/ 30986: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 3578: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var iterate = __nccwpck_require__(9023) + , initState = __nccwpck_require__(2474) + , terminator = __nccwpck_require__(7942) + ; -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 })); -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var TeamMembershipRepository = /** @class */ (function () { - function TeamMembershipRepository(client) { - this.client = client; +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); + + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; } - TeamMembershipRepository.prototype.getForUser = function (user, includeSystem) { - return this.client.get(this.client.getLink("TeamMembership"), __assign({ userId: user.Id }, (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)(this.client.spaceId, includeSystem))); - }; - TeamMembershipRepository.prototype.previewTeam = function (team) { - return this.client.post(this.client.getLink("TeamMembershipPreviewTeam"), team); - }; - return TeamMembershipRepository; -}()); -exports["default"] = TeamMembershipRepository; + state.index++; -/***/ }), + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } -/***/ 66168: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + // done here + callback(null, state.results); + }); -"use strict"; + return terminator.bind(state, callback); +} -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TeamRepository = void 0; -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var TeamRepository = /** @class */ (function (_super) { - __extends(TeamRepository, _super); - function TeamRepository(client) { - return _super.call(this, "Teams", client) || this; - } - TeamRepository.prototype.listScopedUserRoles = function (team) { - return this.client.get(team.Links["ScopedUserRoles"], this.spacePartitionParameters()); - }; - TeamRepository.prototype.list = function (args) { - return _super.prototype.list.call(this, args); - }; - return TeamRepository; -}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); -exports.TeamRepository = TeamRepository; +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} /***/ }), -/***/ 54198: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 6545: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = __nccwpck_require__(2618); + +/***/ }), + +/***/ 8104: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 = (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); -}; -var __awaiter = (this && this.__awaiter) || function (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()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; - } -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var TenantRepository = /** @class */ (function (_super) { - __extends(TenantRepository, _super); - function TenantRepository(client) { - return _super.call(this, "Tenants", client) || this; - } - TenantRepository.prototype.find = function (namesOrIds) { - return __awaiter(this, void 0, void 0, function () { - var environments, matchingEnvironments, _a, _loop_1, this_1, _i, namesOrIds_1, name_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (namesOrIds.length === 0) - return [2 /*return*/, []]; - environments = []; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.list({ - ids: namesOrIds, - })]; - case 2: - matchingEnvironments = _b.sent(); - environments.push.apply(environments, matchingEnvironments.Items); - return [3 /*break*/, 4]; - case 3: - _a = _b.sent(); - return [3 /*break*/, 4]; - case 4: - _loop_1 = function (name_1) { - var matchingEnvironments; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [4 /*yield*/, this_1.list({ - name: name_1, - })]; - case 1: - matchingEnvironments = _c.sent(); - environments.push.apply(environments, matchingEnvironments.Items.filter(function (e) { return e.Name.localeCompare(name_1, undefined, { sensitivity: 'base' }) === 0; })); - return [2 /*return*/]; - } - }); - }; - this_1 = this; - _i = 0, namesOrIds_1 = namesOrIds; - _b.label = 5; - case 5: - if (!(_i < namesOrIds_1.length)) return [3 /*break*/, 8]; - name_1 = namesOrIds_1[_i]; - return [5 /*yield**/, _loop_1(name_1)]; - case 6: - _b.sent(); - _b.label = 7; - case 7: - _i++; - return [3 /*break*/, 5]; - case 8: return [2 /*return*/, environments]; - } - }); - }); - }; - TenantRepository.prototype.status = function () { - return this.client.get(this.client.getLink("TenantsStatus")); - }; - TenantRepository.prototype.tagTest = function (tenantIds, tags) { - return this.client.get(this.client.getLink("TenantTagTest"), { tenantIds: tenantIds, tags: tags }); - }; - TenantRepository.prototype.getVariables = function (tenant) { - return this.client.get(tenant.Links["Variables"]); - }; - TenantRepository.prototype.setVariables = function (tenant, variables) { - return this.client.put(tenant.Links["Variables"], variables); - }; - TenantRepository.prototype.missingVariables = function (filterOptions, includeDetails) { - if (filterOptions === void 0) { filterOptions = {}; } - if (includeDetails === void 0) { includeDetails = false; } - var payload = { - environmentId: filterOptions.environmentId, - includeDetails: !!includeDetails, - projectId: filterOptions.projectId, - tenantId: filterOptions.tenantId, - }; - return this.client.get(this.client.getLink("TenantsMissingVariables"), payload); - }; - TenantRepository.prototype.list = function (args) { - return this.client.get(this.client.getLink("Tenants"), __assign({}, args)); - }; - return TenantRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = TenantRepository; - -/***/ }), - -/***/ 19652: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +var utils = __nccwpck_require__(328); +var settle = __nccwpck_require__(3211); +var buildFullPath = __nccwpck_require__(1934); +var buildURL = __nccwpck_require__(646); +var http = __nccwpck_require__(3685); +var https = __nccwpck_require__(5687); +var httpFollow = (__nccwpck_require__(7707).http); +var httpsFollow = (__nccwpck_require__(7707).https); +var url = __nccwpck_require__(7310); +var zlib = __nccwpck_require__(9796); +var VERSION = (__nccwpck_require__(4322).version); +var transitionalDefaults = __nccwpck_require__(936); +var AxiosError = __nccwpck_require__(2093); +var CanceledError = __nccwpck_require__(4098); -"use strict"; +var isHttps = /https:?/; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var TenantVariableRepository = /** @class */ (function (_super) { - __extends(TenantVariableRepository, _super); - function TenantVariableRepository(client) { - return _super.call(this, "TenantVariables", client) || this; - } - return TenantVariableRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = TenantVariableRepository; +var supportedProtocols = [ 'http:', 'https:', 'file:' ]; +/** + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} proxy + * @param {string} location + */ +function setProxy(options, proxy, location) { + options.hostname = proxy.host; + options.host = proxy.host; + options.port = proxy.port; + options.path = location; -/***/ }), + // Basic proxy authorization + if (proxy.auth) { + var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } -/***/ 99284: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + // If a proxy is used, any redirects must also pass through the proxy + options.beforeRedirect = function beforeRedirect(redirection) { + redirection.headers.host = redirection.host; + setProxy(redirection, proxy, redirection.href); + }; +} -"use strict"; +/*eslint consistent-return:0*/ +module.exports = function httpAdapter(config) { + return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { + var onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } -var __extends = (this && this.__extends) || (function () { - 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); + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + var resolve = function resolve(value) { + done(); + resolvePromise(value); }; - return function (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 rejected = false; + var reject = function reject(value) { + done(); + rejected = true; + rejectPromise(value); }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UpgradeConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var UpgradeConfigurationRepository = /** @class */ (function (_super) { - __extends(UpgradeConfigurationRepository, _super); - function UpgradeConfigurationRepository(client) { - return _super.call(this, "UpgradeConfiguration", client) || this; - } - return UpgradeConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.UpgradeConfigurationRepository = UpgradeConfigurationRepository; + var data = config.data; + var headers = config.headers; + var headerNames = {}; + Object.keys(headers).forEach(function storeLowerName(name) { + headerNames[name.toLowerCase()] = name; + }); -/***/ }), + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + if ('user-agent' in headerNames) { + // User-Agent is specified; handle case where no UA header is desired + if (!headers[headerNames['user-agent']]) { + delete headers[headerNames['user-agent']]; + } + // Otherwise, use specified value + } else { + // Only set header if it hasn't been set in config + headers['User-Agent'] = 'axios/' + VERSION; + } -/***/ 67597: -/***/ ((__unused_webpack_module, exports) => { + // support for https://www.npmjs.com/package/form-data api + if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) { + Object.assign(headers, data.getHeaders()); + } else if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(new AxiosError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + AxiosError.ERR_BAD_REQUEST, + config + )); + } -"use strict"; + if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { + return reject(new AxiosError( + 'Request body larger than maxBodyLength limit', + AxiosError.ERR_BAD_REQUEST, + config + )); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UserIdentityMetadataRepository = void 0; -var UserIdentityMetadataRepository = /** @class */ (function () { - function UserIdentityMetadataRepository(client) { - this.client = client; + // Add Content-Length header if data exists + if (!headerNames['content-length']) { + headers['Content-Length'] = data.length; + } } - UserIdentityMetadataRepository.prototype.all = function () { - return this.client.get(this.client.getLink("UserIdentityMetadata")); - }; - UserIdentityMetadataRepository.prototype.authenticationConfiguration = function (userId) { - return this.client.get(this.client.getLink("UserAuthentication"), { userId: userId }); - }; - return UserIdentityMetadataRepository; -}()); -exports.UserIdentityMetadataRepository = UserIdentityMetadataRepository; - - -/***/ }), -/***/ 41025: -/***/ ((__unused_webpack_module, exports) => { + // HTTP basic authentication + var auth = undefined; + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + auth = username + ':' + password; + } -"use strict"; + // Parse url + var fullPath = buildFullPath(config.baseURL, config.url); + var parsed = url.parse(fullPath); + var protocol = parsed.protocol || supportedProtocols[0]; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UserOnBoardingRepository = void 0; -var UserOnBoardingRepository = /** @class */ (function () { - function UserOnBoardingRepository(client) { - this.client = client; + if (supportedProtocols.indexOf(protocol) === -1) { + return reject(new AxiosError( + 'Unsupported protocol ' + protocol, + AxiosError.ERR_BAD_REQUEST, + config + )); } - UserOnBoardingRepository.prototype.get = function () { - return this.client.get(this.client.getLink("UserOnboarding")); - }; - return UserOnBoardingRepository; -}()); -exports.UserOnBoardingRepository = UserOnBoardingRepository; + if (!auth && parsed.auth) { + var urlAuth = parsed.auth.split(':'); + var urlUsername = urlAuth[0] || ''; + var urlPassword = urlAuth[1] || ''; + auth = urlUsername + ':' + urlPassword; + } -/***/ }), - -/***/ 27747: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (auth && headerNames.authorization) { + delete headers[headerNames.authorization]; + } -"use strict"; + var isHttpsRequest = isHttps.test(protocol); + var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UserPermissionRepository = void 0; -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var UserPermissionRepository = /** @class */ (function () { - function UserPermissionRepository(client) { - this.client = client; + try { + buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''); + } catch (err) { + var customErr = new Error(err.message); + customErr.config = config; + customErr.url = config.url; + customErr.exists = true; + reject(customErr); } - UserPermissionRepository.prototype.getAllPermissions = function (user, includeSystem) { - return this.client.get(user.Links["Permissions"], (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)("all", includeSystem)); - }; - UserPermissionRepository.prototype.getPermissionsForCurrentSpaceContext = function (user, includeSystem) { - return this.client.get(user.Links["Permissions"], (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)(this.client.spaceId, includeSystem)); - }; - UserPermissionRepository.prototype.getPermissionsConfigurationForAllParitions = function (user, includeSystem) { - return this.client.get(user.Links["PermissionsConfiguration"], (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)("all", includeSystem)); - }; - UserPermissionRepository.prototype.getPermissionsConfigurationForCurrentSpaceContext = function (user, includeSystem) { - return this.client.get(user.Links["PermissionsConfiguration"], (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)(this.client.spaceId, includeSystem)); - }; - return UserPermissionRepository; -}()); -exports.UserPermissionRepository = UserPermissionRepository; + var options = { + path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), + method: config.method.toUpperCase(), + headers: headers, + agent: agent, + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth: auth + }; -/***/ }), + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; + } -/***/ 10895: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + var proxy = config.proxy; + if (!proxy && proxy !== false) { + var proxyEnv = protocol.slice(0, -1) + '_proxy'; + var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; + if (proxyUrl) { + var parsedProxyUrl = url.parse(proxyUrl); + var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; + var shouldProxy = true; -"use strict"; + if (noProxyEnv) { + var noProxy = noProxyEnv.split(',').map(function trim(s) { + return s.trim(); + }); -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var UserRepository = /** @class */ (function (_super) { - __extends(UserRepository, _super); - function UserRepository(client) { - return _super.call(this, "Users", client) || this; - } - UserRepository.prototype.createApiKey = function (user, purpose, expires) { - return this.client.post(user.Links["ApiKeys"], { Purpose: purpose, Expires: expires }); - }; - UserRepository.prototype.getCurrent = function () { - return this.client.get(this.client.getLink("CurrentUser")); - }; - UserRepository.prototype.getSpaces = function (user) { - return this.client.get(user.Links["Spaces"]); - }; - UserRepository.prototype.getTriggers = function (user) { - return this.client.get(user.Links["Triggers"]); - }; - UserRepository.prototype.listApiKeys = function (user) { - return this.client.get(user.Links["ApiKeys"], { take: this.takeAll }); - }; - UserRepository.prototype.register = function (registerCommand) { - return this.client.post(this.client.getLink("Register"), registerCommand); - }; - UserRepository.prototype.revokeApiKey = function (apiKey) { - return this.client.del(apiKey.Links["Self"]); - }; - UserRepository.prototype.signIn = function (loginCommand) { - var _this = this; - return this.client.post(this.client.getLink("SignIn"), loginCommand).then(function (authenticatedUser) { - var antiforgeryToken = _this.client.getAntiforgeryToken(); - if (!antiforgeryToken) { - throw new Error("The required anti-forgery cookie is missing. Perhaps your browser " + "or another network device is blocking cookies? " + "See http://g.octopushq.com/CSRF for more details and troubleshooting."); + shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { + if (!proxyElement) { + return false; + } + if (proxyElement === '*') { + return true; + } + if (proxyElement[0] === '.' && + parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { + return true; } - return authenticatedUser; - }); - }; - UserRepository.prototype.signOut = function () { - return this.client.post(this.client.getLink("SignOut"), {}); - }; - return UserRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = UserRepository; - - -/***/ }), -/***/ 74126: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + return parsed.hostname === proxyElement; + }); + } -"use strict"; + if (shouldProxy) { + proxy = { + host: parsedProxyUrl.hostname, + port: parsedProxyUrl.port, + protocol: parsedProxyUrl.protocol + }; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var UserRoleRepository = /** @class */ (function (_super) { - __extends(UserRoleRepository, _super); - function UserRoleRepository(client) { - return _super.call(this, "UserRoles", client) || this; + if (parsedProxyUrl.auth) { + var proxyUrlAuth = parsedProxyUrl.auth.split(':'); + proxy.auth = { + username: proxyUrlAuth[0], + password: proxyUrlAuth[1] + }; + } + } + } } - return UserRoleRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = UserRoleRepository; - -/***/ }), + if (proxy) { + options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); + setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } -/***/ 72887: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + var transport; + var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsProxy ? https : http; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + if (config.beforeRedirect) { + options.beforeRedirect = config.beforeRedirect; + } + transport = isHttpsProxy ? httpsFollow : httpFollow; + } -"use strict"; + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } -/* eslint-disable @typescript-eslint/no-explicit-any */ -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var VariableRepository = /** @class */ (function (_super) { - __extends(VariableRepository, _super); - function VariableRepository(client) { - return _super.call(this, "Variables", client) || this; - } - // FIXME: cac-runbooks, need to be able to load variables for VCS runbooks too - VariableRepository.prototype.getNamesForDeploymentProcess = function (projectId, projectEnvironmentsFilter) { - return this.client.get(this.client.getLink("VariableNames"), { - project: projectId, - projectEnvironmentsFilter: projectEnvironmentsFilter ? projectEnvironmentsFilter.join(",") : projectEnvironmentsFilter, - }); - }; - VariableRepository.prototype.getNamesForRunbookProcess = function (projectId, runbookId, projectEnvironmentsFilter) { - return this.client.get(this.client.getLink("VariableNames"), { - project: projectId, - runbook: runbookId, - projectEnvironmentsFilter: projectEnvironmentsFilter ? projectEnvironmentsFilter.join(",") : projectEnvironmentsFilter, - }); - }; - VariableRepository.prototype.getSpecialVariableNames = function () { - return this.client.get(this.client.getLink("VariableNames"), {}); - }; - // FIXME: cac-runbooks, need to be able to load variables for VCS runbooks too - VariableRepository.prototype.preview = function (projectId, runbookId, actionId, environmentId, machineId, channelId, tenantId) { - return this.client.get(this.client.getLink("VariablePreview"), { - project: projectId, - runbook: runbookId, - environment: environmentId, - channel: channelId, - tenant: tenantId, - action: actionId, - machine: machineId, - }); - }; - return VariableRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = VariableRepository; + if (config.insecureHTTPParser) { + options.insecureHTTPParser = config.insecureHTTPParser; + } + // Create the request + var req = transport.request(options, function handleResponse(res) { + if (req.aborted) return; -/***/ }), + // uncompress the response body transparently if required + var stream = res; -/***/ 50210: -/***/ ((__unused_webpack_module, exports) => { + // return the last request in case of redirects + var lastRequest = res.req || req; -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VcsRunbookRepository = void 0; -var VcsRunbookRepository = /** @class */ (function () { - function VcsRunbookRepository(client, project, branch) { - this.client = client; - this.project = project; - this.branch = branch; - this.client = client; - } - VcsRunbookRepository.prototype.getBranch = function () { - if (!this.branch) - throw new Error("Can't use VCS Runbook Repository unless there is a branch available in the VCS Project"); - return this.branch; - }; - // TODO: @team-config-as-code create and pass in a command instead of the reasource - VcsRunbookRepository.prototype.create = function (newVcsRunbook) { - return this.client.create(this.getBranch().Links.Runbook, newVcsRunbook, {}); - }; - VcsRunbookRepository.prototype.del = function (vcsRunbook) { - return this.client.del(vcsRunbook.Links.Self, vcsRunbook); - }; - VcsRunbookRepository.prototype.get = function (id) { - return this.client.get(this.getBranch().Links.Runbook, { id: id }); - }; - VcsRunbookRepository.prototype.list = function (args) { - return this.client.get(this.getBranch().Links.Runbook, args); - }; - VcsRunbookRepository.prototype.modify = function (vcsRunbook) { - return this.client.update(vcsRunbook.Links.Self, vcsRunbook); - }; - return VcsRunbookRepository; -}()); -exports.VcsRunbookRepository = VcsRunbookRepository; + // if no content, is HEAD request or decompress disabled we should not decompress + if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { + switch (res.headers['content-encoding']) { + /*eslint default-case:0*/ + case 'gzip': + case 'compress': + case 'deflate': + // add the unzipper to the body stream processing pipeline + stream = stream.pipe(zlib.createUnzip()); + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + } + } -/***/ }), + var response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: res.headers, + config: config, + request: lastRequest + }; -/***/ 65737: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + if (config.responseType === 'stream') { + response.data = stream; + settle(resolve, reject, response); + } else { + var responseBuffer = []; + var totalResponseBytes = 0; + stream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; -"use strict"; + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + // stream.destoy() emit aborted event before calling reject() on Node.js v16 + rejected = true; + stream.destroy(); + reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); + } + }); -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __awaiter = (this && this.__awaiter) || function (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()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; - } -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.WorkerPoolsRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var WorkerPoolsRepository = /** @class */ (function (_super) { - __extends(WorkerPoolsRepository, _super); - function WorkerPoolsRepository(client) { - return _super.call(this, "WorkerPools", client) || this; - } - WorkerPoolsRepository.prototype.machines = function (workerPool, args) { - return this.client.get(workerPool.Links["Workers"], args); - }; - WorkerPoolsRepository.prototype.summary = function (args) { - return this.client.get(this.client.getLink("WorkerPoolsSummary"), args); - }; - WorkerPoolsRepository.prototype.sort = function (order) { - return this.client.put(this.client.getLink("WorkerPoolsSortOrder"), order); - }; - WorkerPoolsRepository.prototype.getSupportedPoolTypes = function () { - return this.client.get(this.client.getLink("WorkerPoolsSupportedTypes")); - }; - WorkerPoolsRepository.prototype.getDynamicWorkerTypes = function () { - return __awaiter(this, void 0, void 0, function () { - var result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.client.get(this.client.getLink("WorkerPoolsDynamicWorkerTypes"))]; - case 1: - result = _a.sent(); - return [2 /*return*/, result.WorkerTypes]; - } - }); + stream.on('aborted', function handlerStreamAborted() { + if (rejected) { + return; + } + stream.destroy(); + reject(new AxiosError( + 'maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError.ERR_BAD_RESPONSE, + config, + lastRequest + )); }); - }; - return WorkerPoolsRepository; -}(basicRepository_1.BasicRepository)); -exports.WorkerPoolsRepository = WorkerPoolsRepository; - - -/***/ }), -/***/ 91616: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + stream.on('error', function handleStreamError(err) { + if (req.aborted) return; + reject(AxiosError.from(err, null, config, lastRequest)); + }); -"use strict"; + stream.on('end', function handleStreamEnd() { + try { + var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); + if (config.responseType !== 'arraybuffer') { + responseData = responseData.toString(config.responseEncoding); + if (!config.responseEncoding || config.responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + response.data = responseData; + } catch (err) { + reject(AxiosError.from(err, null, config, response.request, response)); + } + settle(resolve, reject, response); + }); + } + }); -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.WorkerRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var WorkerRepository = /** @class */ (function (_super) { - __extends(WorkerRepository, _super); - function WorkerRepository(client) { - return _super.call(this, "Workers", client) || this; - } - WorkerRepository.prototype.discover = function (host, port, type, proxyId) { - return proxyId ? this.client.get(this.client.getLink("DiscoverWorker"), { host: host, port: port, type: type, proxyId: proxyId }) : this.client.get(this.client.getLink("DiscoverWorker"), { host: host, port: port, type: type }); - }; - WorkerRepository.prototype.getConnectionStatus = function (machine) { - return this.client.get(machine.Links["Connection"]); - }; - WorkerRepository.prototype.list = function (args) { - return this.client.get(this.client.getLink("Workers"), args); - }; - return WorkerRepository; -}(basicRepository_1.BasicRepository)); -exports.WorkerRepository = WorkerRepository; + // Handle errors + req.on('error', function handleRequestError(err) { + // @todo remove + // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; + reject(AxiosError.from(err, null, config, req)); + }); + // set tcp keep alive to prevent drop connection by peer + req.on('socket', function handleRequestSocket(socket) { + // default interval of sending ack packet is 1 minute + socket.setKeepAlive(true, 1000 * 60); + }); -/***/ }), + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + var timeout = parseInt(config.timeout, 10); -/***/ 43399: -/***/ ((__unused_webpack_module, exports) => { + if (isNaN(timeout)) { + reject(new AxiosError( + 'error trying to parse `config.timeout` to int', + AxiosError.ERR_BAD_OPTION_VALUE, + config, + req + )); -"use strict"; + return; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.WorkerShellsRepository = void 0; -var WorkerShellsRepository = /** @class */ (function () { - function WorkerShellsRepository(client) { - this.client = client; + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devoring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + req.abort(); + var transitional = config.transitional || transitionalDefaults; + reject(new AxiosError( + 'timeout of ' + timeout + 'ms exceeded', + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + req + )); + }); } - WorkerShellsRepository.prototype.all = function () { - return this.client.get(this.client.getLink("WorkerShells")); - }; - return WorkerShellsRepository; -}()); -exports.WorkerShellsRepository = WorkerShellsRepository; + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = function(cancel) { + if (req.aborted) return; -/***/ }), + req.abort(); + reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel); + }; -/***/ 871: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } -"use strict"; -var __awaiter = (this && this.__awaiter) || function (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()); - }); -}; -var __generator = (this && this.__generator) || function (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 }; + // Send the request + if (utils.isStream(data)) { + data.on('error', function handleStreamError(err) { + reject(AxiosError.from(err, config, null, req)); + }).pipe(req); + } else { + req.end(data); } + }); }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Repository = void 0; -var _1 = __nccwpck_require__(80586); -var accountRepository_1 = __nccwpck_require__(9507); -var actionTemplateRepository_1 = __nccwpck_require__(67895); -var artifactRepository_1 = __nccwpck_require__(89463); -var authenticationRepository_1 = __nccwpck_require__(42583); -var buildInformationRepository_1 = __nccwpck_require__(7946); -var certificateConfigurationRepository_1 = __nccwpck_require__(4776); -var certificateRepository_1 = __nccwpck_require__(41266); -var channelRepository_1 = __nccwpck_require__(94659); -var cloudTemplateRepository_1 = __nccwpck_require__(94203); -var communityActionTemplateRepository_1 = __nccwpck_require__(69039); -var dashboardConfigurationRepository_1 = __nccwpck_require__(66446); -var dashboardRepository_1 = __nccwpck_require__(20009); -var defectRepository_1 = __nccwpck_require__(81630); -var deploymentRepository_1 = __nccwpck_require__(91848); -var dynamicExtensionRepository_1 = __nccwpck_require__(27848); -var environmentRepository_1 = __nccwpck_require__(8183); -var eventRepository_1 = __nccwpck_require__(65269); -var externalSecurityGroupProviderRepository_1 = __nccwpck_require__(22999); -var externalSecurityGroupRepository_1 = __nccwpck_require__(4387); -var externalUsersRepository_1 = __nccwpck_require__(55459); -var featuresConfigurationRepository_1 = __nccwpck_require__(56116); -var feedRepository_1 = __nccwpck_require__(20037); -var importExportActions_1 = __nccwpck_require__(18029); -var interruptionRepository_1 = __nccwpck_require__(90977); -var inviteRepository_1 = __nccwpck_require__(15228); -var letsEncryptConfigurationRepository_1 = __nccwpck_require__(78681); -var libraryVariableRepository_1 = __nccwpck_require__(64693); -var licenseRepository_1 = __nccwpck_require__(51916); -var lifecycleRepository_1 = __nccwpck_require__(56946); -var machinePolicyRepository_1 = __nccwpck_require__(154); -var machineRepository_1 = __nccwpck_require__(53015); -var machineRoleRepository_1 = __nccwpck_require__(50197); -var machineShellsRepository_1 = __nccwpck_require__(1939); -var maintenanceConfigurationRepository_1 = __nccwpck_require__(94772); -var octopusServerNodeRepository_1 = __nccwpck_require__(34819); -var packageRepository_1 = __nccwpck_require__(53378); -var performanceConfigurationRepository_1 = __nccwpck_require__(21797); -var permissionDescriptionRepository_1 = __nccwpck_require__(97886); -var progressionRepository_1 = __nccwpck_require__(53127); -var projectGroupRepository_1 = __nccwpck_require__(38331); -var projectRepository_1 = __importDefault(__nccwpck_require__(52058)); -var projectTriggerRepository_1 = __nccwpck_require__(57502); -var proxyRepository_1 = __nccwpck_require__(7358); -var releasesRepository_1 = __nccwpck_require__(87252); -var retentionDefaultConfigurationRepository_1 = __nccwpck_require__(11050); -var runbookProcessRepository_1 = __nccwpck_require__(82404); -var runbookRepository_1 = __nccwpck_require__(18312); -var runbookRunRepository_1 = __nccwpck_require__(30242); -var runbookSnapshotRepository_1 = __nccwpck_require__(73544); -var schedulerRepository_1 = __nccwpck_require__(63767); -var scopedUserRoleRepository_1 = __nccwpck_require__(18774); -var serverConfigurationRepository_1 = __nccwpck_require__(96489); -var serverStatusRepository_1 = __nccwpck_require__(84463); -var settingsRepository_1 = __importDefault(__nccwpck_require__(50924)); -var smtpConfigurationRepository_1 = __nccwpck_require__(7025); -var spaceRepository_1 = __nccwpck_require__(56836); -var subscriptionRepository_1 = __importDefault(__nccwpck_require__(94178)); -var tagSetRepository_1 = __importDefault(__nccwpck_require__(50450)); -var taskRepository_1 = __nccwpck_require__(53573); -var teamMembershipRepository_1 = __importDefault(__nccwpck_require__(30986)); -var teamRepository_1 = __nccwpck_require__(66168); -var tenantRepository_1 = __importDefault(__nccwpck_require__(54198)); -var tenantVariableRepository_1 = __importDefault(__nccwpck_require__(19652)); -var upgradeConfigurationRepository_1 = __nccwpck_require__(99284); -var userIdentityMetadataRepository_1 = __nccwpck_require__(67597); -var userOnBoardingRepository_1 = __nccwpck_require__(41025); -var userPermissionRepository_1 = __nccwpck_require__(27747); -var userRepository_1 = __importDefault(__nccwpck_require__(10895)); -var userRoleRepository_1 = __importDefault(__nccwpck_require__(74126)); -var variableRepository_1 = __importDefault(__nccwpck_require__(72887)); -var workerPoolsRepository_1 = __nccwpck_require__(65737); -var workerRepository_1 = __nccwpck_require__(91616); -var workerShellsRepository_1 = __nccwpck_require__(43399); -// Repositories provide a helpful abstraction around the Octopus Deploy API -var Repository = /** @class */ (function () { - function Repository(client) { - var _this = this; - this.client = client; - this.takeAll = 2147483647; - this.takeDefaultPageSize = 30; // Only used when we don't rely on the default that's applied server-side. - this.resolve = function (path, uriTemplateParameters) { return _this.client.resolve(path, uriTemplateParameters); }; - this.accounts = new accountRepository_1.AccountRepository(client); - this.actionTemplates = new actionTemplateRepository_1.ActionTemplateRepository(client); - this.artifacts = new artifactRepository_1.ArtifactRepository(client); - this.authentication = new authenticationRepository_1.AuthenticationRepository(client); - this.buildInformation = new buildInformationRepository_1.BuildInformationRepository(client); - this.certificateConfiguration = new certificateConfigurationRepository_1.CertificateConfigurationRepository(client); - this.certificates = new certificateRepository_1.CertificateRepository(client); - this.cloudTemplates = new cloudTemplateRepository_1.CloudTemplateRepository(client); - this.communityActionTemplates = new communityActionTemplateRepository_1.CommunityActionTemplateRepository(client); - this.dashboardConfiguration = new dashboardConfigurationRepository_1.DashboardConfigurationRepository(client); - this.dashboards = new dashboardRepository_1.DashboardRepository(client); - this.defects = new defectRepository_1.DefectRepository(client); - this.deployments = new deploymentRepository_1.DeploymentRepository(client); - this.dynamicExtensions = new dynamicExtensionRepository_1.DynamicExtensionRepository(client); - this.environments = new environmentRepository_1.EnvironmentRepository(client); - this.events = new eventRepository_1.EventRepository(client); - this.externalSecurityGroupProviders = new externalSecurityGroupProviderRepository_1.ExternalSecurityGroupProviderRepository(client); - this.externalSecurityGroups = new externalSecurityGroupRepository_1.ExternalSecurityGroupRepository(client); - this.externalUsers = new externalUsersRepository_1.ExternalUsersRepository(client); - this.featuresConfiguration = new featuresConfigurationRepository_1.FeaturesConfigurationRepository(client); - this.feeds = new feedRepository_1.FeedRepository(client); - this.importExport = new importExportActions_1.ImportExportActions(client); - this.interruptions = new interruptionRepository_1.InterruptionRepository(client); - this.invitations = new inviteRepository_1.InvitationRepository(client); - this.letsEncryptConfiguration = new letsEncryptConfigurationRepository_1.LetsEncryptConfigurationRepository(client); - this.libraryVariableSets = new libraryVariableRepository_1.LibraryVariableRepository(client); - this.licenses = new licenseRepository_1.LicenseRepository(client); - this.lifecycles = new lifecycleRepository_1.LifecycleRepository(client); - this.machinePolicies = new machinePolicyRepository_1.MachinePolicyRepository(client); - this.machineRoles = new machineRoleRepository_1.MachineRoleRepository(client); - this.machineShells = new machineShellsRepository_1.MachineShellsRepository(client); - this.machines = new machineRepository_1.MachineRepository(client); - this.maintenanceConfiguration = new maintenanceConfigurationRepository_1.MaintenanceConfigurationRepository(client); - this.octopusServerNodes = new octopusServerNodeRepository_1.OctopusServerNodeRepository(client); - this.retentionDefaultConfiguration = new retentionDefaultConfigurationRepository_1.RetentionDefaultConfigurationRepository(client); - this.runbooks = new runbookRepository_1.RunbookRepository(client); - this.runbookProcess = new runbookProcessRepository_1.RunbookProcessRepository(client); - this.runbookSnapshots = new runbookSnapshotRepository_1.RunbookSnapshotRepository(client); - this.runbookRuns = new runbookRunRepository_1.RunbookRunRepository(client); - this.packages = new packageRepository_1.PackageRepository(client); - this.performanceConfiguration = new performanceConfigurationRepository_1.PerformanceConfigurationRepository(client); - this.permissionDescriptions = new permissionDescriptionRepository_1.PermissionDescriptionRepository(client); - this.progression = new progressionRepository_1.ProgressionRepository(client); - this.projectGroups = new projectGroupRepository_1.ProjectGroupRepository(client); - this.projects = new projectRepository_1.default(client); - this.channels = new channelRepository_1.ChannelRepository(this.projects, client); - this.deploymentProcesses = new _1.DeploymentProcessRepository(this.projects, client); - this.projectTriggers = new projectTriggerRepository_1.ProjectTriggerRepository(client); - this.proxies = new proxyRepository_1.ProxyRepository(client); - this.releases = new releasesRepository_1.ReleasesRepository(client); - this.scheduler = new schedulerRepository_1.SchedulerRepository(client); - this.scopedUserRoles = new scopedUserRoleRepository_1.ScopedUserRoleRepository(client); - this.serverStatus = new serverStatusRepository_1.ServerStatusRepository(client); - this.serverConfiguration = new serverConfigurationRepository_1.ServerConfigurationRepository(client); - this.settings = new settingsRepository_1.default(client); - this.smtpConfiguration = new smtpConfigurationRepository_1.SmtpConfigurationRepository(client); - this.spaces = new spaceRepository_1.SpaceRepository(client); - this.subscriptions = new subscriptionRepository_1.default(client); - this.tagSets = new tagSetRepository_1.default(client); - this.tasks = new taskRepository_1.TaskRepository(client); - this.teams = new teamRepository_1.TeamRepository(client); - this.tenants = new tenantRepository_1.default(client); - this.tenantVariables = new tenantVariableRepository_1.default(client); - this.upgradeConfiguration = new upgradeConfigurationRepository_1.UpgradeConfigurationRepository(client); - this.userIdentityMetadata = new userIdentityMetadataRepository_1.UserIdentityMetadataRepository(client); - this.userOnboarding = new userOnBoardingRepository_1.UserOnBoardingRepository(client); - this.userPermissions = new userPermissionRepository_1.UserPermissionRepository(client); - this.teamMembership = new teamMembershipRepository_1.default(client); - this.userRoles = new userRoleRepository_1.default(client); - this.users = new userRepository_1.default(client); - this.variables = new variableRepository_1.default(client); - this.getServerInformation = client.getServerInformation.bind(client); - this.workerPools = new workerPoolsRepository_1.WorkerPoolsRepository(client); - this.workerShells = new workerShellsRepository_1.WorkerShellsRepository(client); - this.workers = new workerRepository_1.WorkerRepository(client); - } - Object.defineProperty(Repository.prototype, "spaceId", { - get: function () { - return this.client.spaceId; - }, - enumerable: false, - configurable: true - }); - Repository.prototype.forSpace = function (space) { - return __awaiter(this, void 0, void 0, function () { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!(this.spaceId !== space.Id)) return [3 /*break*/, 2]; - _a = Repository.bind; - return [4 /*yield*/, this.client.forSpace(space.Id)]; - case 1: return [2 /*return*/, new (_a.apply(Repository, [void 0, _b.sent()]))()]; - case 2: return [2 /*return*/, this]; - } - }); - }); - }; - Repository.prototype.forSystem = function () { - return new Repository(this.client.forSystem()); - }; - Repository.prototype.switchToSpace = function (spaceIdOrName) { - return this.client.switchToSpace(spaceIdOrName); - }; - Repository.prototype.switchToSystem = function () { - this.client.switchToSystem(); - }; - return Repository; -}()); -exports.Repository = Repository; /***/ }), -/***/ 15435: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3454: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/***/ }), +var utils = __nccwpck_require__(328); +var settle = __nccwpck_require__(3211); +var cookies = __nccwpck_require__(1545); +var buildURL = __nccwpck_require__(646); +var buildFullPath = __nccwpck_require__(1934); +var parseHeaders = __nccwpck_require__(6455); +var isURLSameOrigin = __nccwpck_require__(3608); +var transitionalDefaults = __nccwpck_require__(936); +var AxiosError = __nccwpck_require__(2093); +var CanceledError = __nccwpck_require__(4098); +var parseProtocol = __nccwpck_require__(6107); -/***/ 28043: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + var onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } -"use strict"; + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/consistent-type-assertions */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Resolver = void 0; -var URI = __nccwpck_require__(34190); -var URITemplate = __nccwpck_require__(23423); -var Resolver = /** @class */ (function () { - function Resolver(baseUri) { - this.baseUri = baseUri; - this.baseUri = this.baseUri.endsWith("/") ? this.baseUri : this.baseUri + "/"; - var lastIndexOfMandatorySegment = this.baseUri.lastIndexOf("/api/"); - if (lastIndexOfMandatorySegment >= 1) { - this.baseUri = this.baseUri.substring(0, lastIndexOfMandatorySegment); - } - else { - if (this.baseUri.endsWith("/api")) { - this.baseUri = this.baseUri.substring(0, -4); - } - } - this.baseUri = this.baseUri.endsWith("/") ? this.baseUri.substring(0, this.baseUri.length - 1) : this.baseUri; - var parsed = URI(this.baseUri); - this.rootUri = parsed.scheme() + "://" + parsed.authority(); - this.rootUri = this.rootUri.endsWith("/") ? this.rootUri.substring(0, this.rootUri.length - 1) : this.rootUri; + if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) { + delete requestHeaders['Content-Type']; // Let the browser set it } - Resolver.prototype.resolve = function (path, uriTemplateParameters) { - if (!path) { - throw new Error("The link is not set to a value"); - } - if (path.startsWith("~/")) { - path = path.substring(1, path.length); - path = this.baseUri + path; - } - else { - path = this.rootUri + path; - } - var template = new URITemplate(path); - var result = template.expand(uriTemplateParameters || {}); - return result; - }; - return Resolver; -}()); -exports.Resolver = Resolver; + var request = new XMLHttpRequest(); -/***/ }), + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } -/***/ 82138: -/***/ ((__unused_webpack_module, exports) => { + var fullPath = buildFullPath(config.baseURL, config.url); -"use strict"; + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); -Object.defineProperty(exports, "__esModule", ({ value: true })); + // Set the request timeout in MS + request.timeout = config.timeout; + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; -/***/ }), + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); -/***/ 60232: -/***/ ((__unused_webpack_module, exports) => { + // Clean up request + request = null; + } -"use strict"; + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } -/***/ }), + reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); -/***/ 445: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // Clean up request + request = null; + }; -"use strict"; + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request)); -/* eslint-disable @typescript-eslint/no-non-null-assertion */ -/* eslint-disable no-eq-null */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Session = void 0; -var userPermissions_1 = __nccwpck_require__(54663); -var Session = /** @class */ (function () { - function Session() { - this.currentUser = undefined; - this.currentPermissions = undefined; - } - Session.prototype.start = function (user, features) { - console.info("Starting session for ".concat(user.DisplayName, " user.")); - this.currentUser = user; - }; - Session.prototype.end = function () { - if (this.currentUser) { - console.info("Ending session for ".concat(this.currentUser.DisplayName, " user.")); - } - this.currentUser = null; - this.currentPermissions = null; - }; - Session.prototype.refreshPermissions = function (userPermission) { - this.currentPermissions = userPermissions_1.UserPermissions.Create(userPermission.SpacePermissions, userPermission.SystemPermissions, userPermission.Teams); - }; - Session.prototype.isAuthenticated = function () { - return this.currentUser != null; + // Clean up request + request = null; }; - return Session; -}()); -exports.Session = Session; -exports["default"] = Session; + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + var transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + request)); -/***/ }), - -/***/ 31547: -/***/ ((__unused_webpack_module, exports) => { + // Clean up request + request = null; + }; -"use strict"; + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SubscriptionRecord = void 0; -var SubscriptionRecord = /** @class */ (function () { - function SubscriptionRecord() { - this.subscriptions = {}; + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } } - SubscriptionRecord.prototype.subscribe = function (registrationName, callback) { - var _this = this; - this.subscriptions[registrationName] = callback; - return function () { return _this.unsubscribe(registrationName); }; - }; - SubscriptionRecord.prototype.unsubscribe = function (registrationName) { - delete this.subscriptions[registrationName]; - }; - SubscriptionRecord.prototype.notify = function (predicate, data) { - var _this = this; - Object.keys(this.subscriptions) - .filter(predicate) - .forEach(function (key) { return _this.subscriptions[key](data); }); - }; - SubscriptionRecord.prototype.notifyAll = function (data) { - this.notify(function () { return true; }, data); - }; - SubscriptionRecord.prototype.notifySingle = function (registrationName, data) { - if (registrationName in this.subscriptions) { - this.subscriptions[registrationName](data); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); } - }; - return SubscriptionRecord; -}()); -exports.SubscriptionRecord = SubscriptionRecord; + }); + } + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } -/***/ }), + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } -/***/ 54663: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } -"use strict"; + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } -/* eslint-disable no-eq-null */ -/* eslint-disable @typescript-eslint/consistent-type-assertions */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isAccessToAllProjectGroups = exports.isAccessToAllTenants = exports.isAccessToAllEnvironments = exports.isAccessToAllProjects = exports.UserPermissions = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var UserPermissions = /** @class */ (function () { - function UserPermissions(spacePermissions, systemPermissions, teams) { - this.spacePermissions = spacePermissions; - this.systemPermissions = systemPermissions; - this.teams = teams; - } - UserPermissions.Create = function (spacePermissions, systemPermissions, teams) { - var ps = {}; - Object.keys(spacePermissions).forEach(function (permission) { - var permissionRestrictionInAllSpaces = spacePermissions[permission]; - permissionRestrictionInAllSpaces.forEach(function (permissionRestriction) { - var permissionsForSpace = ps[permissionRestriction.SpaceId]; - if (!permissionsForSpace) { - ps[permissionRestriction.SpaceId] = {}; - } - var internalPermission = convertUserPermissionRestrictionToInternalPermissions(permissionRestriction); - var restrictionsWithinSpace = ps[permissionRestriction.SpaceId][permission.toLowerCase()]; - if (!restrictionsWithinSpace) { - ps[permissionRestriction.SpaceId][permission.toLowerCase()] = []; - } - ps[permissionRestriction.SpaceId][permission.toLowerCase()].push(internalPermission); - }); - }); - return new UserPermissions(ps, systemPermissions.map(function (p) { return p.toLowerCase(); }), teams); - }; - UserPermissions.prototype.scopeToSystem = function () { - return new UserPermissions({}, this.systemPermissions, this.teams); - }; - UserPermissions.prototype.scopeToSpace = function (spaceId) { - var _a; - if (!spaceId) { - return new UserPermissions({}, [], this.teams); - } - var permissionsForSpace = this.spacePermissions[spaceId] || {}; - return new UserPermissions((_a = {}, _a[spaceId] = permissionsForSpace, _a), [], this.teams); - }; - UserPermissions.prototype.scopeToSpaceAndSystem = function (spaceId) { - var _a; - if (!spaceId) { - return new UserPermissions({}, this.systemPermissions, this.teams); + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = function(cancel) { + if (!request) { + return; } - var permissionsForSpace = this.spacePermissions[spaceId] || {}; - return new UserPermissions((_a = {}, _a[spaceId] = permissionsForSpace, _a), this.systemPermissions, this.teams); - }; - UserPermissions.prototype.hasAnyPermissions = function () { - var _this = this; - var hasAnySpacePermissions = Object.keys(this.spacePermissions).some(function (spaceId) { - return Object.keys(_this.spacePermissions[spaceId]).length > 0; - }); - var hasAnySystemPermissions = this.systemPermissions.length > 0; - return hasAnySpacePermissions || hasAnySystemPermissions; - }; - UserPermissions.prototype.firstAuthorized = function (permissions) { - var _this = this; - return permissions.find(function (p) { - return _this.hasSpacePermission(p) || _this.hasSystemPermission(p); - }); - }; - UserPermissions.prototype.hasPermissionInAnyScope = function (permission) { - return this.hasSpacePermission(permission) || this.hasSystemPermission(permission); - }; - UserPermissions.prototype.isAuthorized = function (authorization) { - var isInSystemPermissions = this.systemPermissions.includes(authorization.permission.toLowerCase()); - if (isInSystemPermissions) { - // these are not scoped, so if the permission is here, we're done they are Authorized - return true; - } - return this.isAuthorizedInAnySpace(authorization); - }; - UserPermissions.prototype.isAuthorizedInAnySpace = function (authorization) { - var _this = this; - return Object.keys(this.spacePermissions).some(function (spaceId) { - return isAuthorizedInSpecificSpace(_this.spacePermissions[spaceId]); - }); - function isAuthorizedInSpecificSpace(specificSpacePermissions) { - var restrictions = specificSpacePermissions[authorization.permission.toLowerCase()]; - if (!restrictions) { - // User doesn't have the permission in any scope - return false; - } - if (restrictions.length === 0) { - // No restrictions - return true; - } - for (var _i = 0, restrictions_1 = restrictions; _i < restrictions_1.length; _i++) { - var restriction = restrictions_1[_i]; - var allowed = true; - if (!isAccessToAllProjects(restriction.projectIds)) { - if (authorization.projectId == null || (!isWildcard(authorization.projectId) && !restriction.projectIds.includes(authorization.projectId.toLowerCase()))) { - allowed = false; - } - } - if (!isAccessToAllEnvironments(restriction.environmentIds)) { - if (authorization.environmentId == null || (!isWildcard(authorization.environmentId) && !restriction.environmentIds.includes(authorization.environmentId.toLowerCase()))) { - allowed = false; - } - } - if (!isAccessToAllProjectGroups(restriction.projectGroupIds)) { - if (authorization.projectGroupId == null || (!isWildcard(authorization.projectGroupId) && !restriction.projectGroupIds.includes(authorization.projectGroupId.toLowerCase()))) { - allowed = false; - } - } - if (!isAccessToAllTenants(restriction.tenantIds)) { - if (authorization.tenantId == null || (!isWildcard(authorization.tenantId) && !restriction.tenantIds.includes(authorization.tenantId.toLowerCase()))) { - allowed = false; - } - } - if (allowed) { - return true; - } - } - return false; - function isWildcard(s) { - return s === "*"; - } - } - }; - UserPermissions.prototype.isSpaceManager = function (space) { - var _this = this; - return space && space.SpaceManagersTeams.some(function (t) { return _this.teams.some(function (cpt) { return cpt.Id === t; }); }); - }; - UserPermissions.prototype.hasSpacePermission = function (permission) { - var _this = this; - var lowerCasePermission = permission.toLowerCase(); - return Object.keys(this.spacePermissions).some(function (spaceId) { - return !!_this.spacePermissions[spaceId][lowerCasePermission]; - }); - }; - UserPermissions.prototype.hasSystemPermission = function (permission) { - return this.systemPermissions.includes(permission.toLowerCase()); - }; - return UserPermissions; -}()); -exports.UserPermissions = UserPermissions; -// This type is distinct from `UserPermissionRestriction` because it is safer to have the "all" case represented by a non-array -// It is harder to make type mistakes this way, since you should be unable to assign the "all" string value to the array representing a subset of values -function convertUserPermissionRestrictionToInternalPermissions(permissionRestriction) { - var normalizedProjectRestrictions = (0, message_contracts_1.isAllProjects)(permissionRestriction.RestrictedToProjectIds) ? "Access to all projects" : permissionRestriction.RestrictedToProjectIds.map(function (id) { return id.toLowerCase(); }); - var normalizedEnvironmentRestrictions = (0, message_contracts_1.isAllEnvironments)(permissionRestriction.RestrictedToEnvironmentIds) - ? "Access to all environments" - : permissionRestriction.RestrictedToEnvironmentIds.map(function (id) { return id.toLowerCase(); }); - var normalizedProjectGroupIds = (0, message_contracts_1.isAllProjectGroups)(permissionRestriction.RestrictedToProjectGroupIds) - ? "Access to all project groups" - : permissionRestriction.RestrictedToProjectGroupIds.map(function (id) { return id.toLowerCase(); }); - var normalizedTenantIds = (0, message_contracts_1.isAllTenants)(permissionRestriction.RestrictedToTenantIds) ? "Access to all tenants" : permissionRestriction.RestrictedToTenantIds.map(function (id) { return id.toLowerCase(); }); - return { - projectIds: normalizedProjectRestrictions, - environmentIds: normalizedEnvironmentRestrictions, - projectGroupIds: normalizedProjectGroupIds, - tenantIds: normalizedTenantIds, - }; -} -function isAccessToAllProjects(restrictions) { - var accessToAllProjects = restrictions; - return typeof accessToAllProjects === "string" && accessToAllProjects === "Access to all projects"; -} -exports.isAccessToAllProjects = isAccessToAllProjects; -function isAccessToAllEnvironments(restrictions) { - var accessToAllEnvironments = restrictions; - return typeof accessToAllEnvironments === "string" && accessToAllEnvironments === "Access to all environments"; -} -exports.isAccessToAllEnvironments = isAccessToAllEnvironments; -function isAccessToAllTenants(restrictions) { - var accessToAllTenants = restrictions; - return typeof accessToAllTenants === "string" && accessToAllTenants === "Access to all tenants"; -} -exports.isAccessToAllTenants = isAccessToAllTenants; -function isAccessToAllProjectGroups(restrictions) { - var accessToAllProjectGroups = restrictions; - return typeof accessToAllProjectGroups === "string" && accessToAllProjectGroups === "Access to all project groups"; -} -exports.isAccessToAllProjectGroups = isAccessToAllProjectGroups; - + reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel); + request.abort(); + request = null; + }; -/***/ }), + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } -/***/ 47132: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + if (!requestData) { + requestData = null; + } -"use strict"; + var protocol = parseProtocol(fullPath); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isPropertyDefinedAndNotNull = exports.typeSafeHasOwnProperty = exports.ensureSuffix = exports.ensurePrefix = exports.determineServerEndpoint = exports.getResolver = exports.getServerEndpoint = exports.getQueryValue = void 0; -var lodash_1 = __nccwpck_require__(90250); -var urijs_1 = __importDefault(__nccwpck_require__(34190)); -var resolver_1 = __nccwpck_require__(28043); -var getQueryValue = function (key, location) { - var result; - (0, urijs_1.default)(location).hasQuery(key, function (value) { - result = value; - }); - return result; -}; -exports.getQueryValue = getQueryValue; -var getServerEndpoint = function (location) { - if (location === void 0) { location = window.location; } - return (0, exports.getQueryValue)("octopus.server", location.href) || (0, exports.determineServerEndpoint)(location); -}; -exports.getServerEndpoint = getServerEndpoint; -var getResolver = function (base) { - var resolver = new resolver_1.Resolver(base); - return resolver.resolve.bind(resolver); -}; -exports.getResolver = getResolver; -var determineServerEndpoint = function (location) { - var endpoint = (0, exports.ensureSuffix)("//", "" + location.protocol) + location.host; - var path = (0, exports.ensurePrefix)("/", location.pathname); - if (path.length >= 1) { - var lastSegmentIndex = path.lastIndexOf("/"); - if (lastSegmentIndex >= 0) { - path = path.substring(0, lastSegmentIndex + 1); - } + if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) { + reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + return; } - endpoint = endpoint + path; - return endpoint; -}; -exports.determineServerEndpoint = determineServerEndpoint; -exports.ensurePrefix = (0, lodash_1.curry)(function (prefix, value) { return (!value.startsWith(prefix) ? "".concat(prefix).concat(value) : value); }); -exports.ensureSuffix = (0, lodash_1.curry)(function (suffix, value) { return (!value.endsWith(suffix) ? "".concat(value).concat(suffix) : value); }); -var typeSafeHasOwnProperty = function (target, key) { - return target.hasOwnProperty(key); -}; -exports.typeSafeHasOwnProperty = typeSafeHasOwnProperty; -var isPropertyDefinedAndNotNull = function (target, key) { - return (0, exports.typeSafeHasOwnProperty)(target, key) && target[key] !== null && target[key] !== undefined; + + + // Send the request + request.send(requestData); + }); }; -exports.isPropertyDefinedAndNotNull = isPropertyDefinedAndNotNull; /***/ }), -/***/ 21843: -/***/ ((__unused_webpack_module, exports) => { +/***/ 2618: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AADCredentialType = void 0; -var AADCredentialType; -(function (AADCredentialType) { - AADCredentialType["ClientCredential"] = "ClientCredential"; - AADCredentialType["UserCredential"] = "UserCredential"; -})(AADCredentialType = exports.AADCredentialType || (exports.AADCredentialType = {})); -//# sourceMappingURL=aadCredentialType.js.map - -/***/ }), - -/***/ 88253: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +var utils = __nccwpck_require__(328); +var bind = __nccwpck_require__(7065); +var Axios = __nccwpck_require__(8178); +var mergeConfig = __nccwpck_require__(4831); +var defaults = __nccwpck_require__(1626); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=accountResource.js.map +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); -/***/ }), + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); -/***/ 35608: -/***/ ((__unused_webpack_module, exports) => { + // Copy context to instance + utils.extend(instance, context); -"use strict"; + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=accountResourceLinks.js.map + return instance; +} -/***/ }), +// Create the default instance to be exported +var axios = createInstance(defaults); -/***/ 34914: -/***/ ((__unused_webpack_module, exports) => { +// Expose Axios class to allow class inheritance +axios.Axios = Axios; -"use strict"; +// Expose Cancel & CancelToken +axios.CanceledError = __nccwpck_require__(4098); +axios.CancelToken = __nccwpck_require__(1587); +axios.isCancel = __nccwpck_require__(4057); +axios.VERSION = (__nccwpck_require__(4322).version); +axios.toFormData = __nccwpck_require__(470); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AccountType = void 0; -var AccountType; -(function (AccountType) { - AccountType["AmazonWebServicesAccount"] = "AmazonWebServicesAccount"; - AccountType["AzureServicePrincipal"] = "AzureServicePrincipal"; - AccountType["AzureSubscription"] = "AzureSubscription"; - AccountType["GoogleCloudAccount"] = "GoogleCloudAccount"; - AccountType["None"] = "None"; - AccountType["SshKeyPair"] = "SshKeyPair"; - AccountType["Token"] = "Token"; - AccountType["UsernamePassword"] = "UsernamePassword"; -})(AccountType = exports.AccountType || (exports.AccountType = {})); -//# sourceMappingURL=accountType.js.map - -/***/ }), - -/***/ 6687: -/***/ ((__unused_webpack_module, exports) => { +// Expose AxiosError class +axios.AxiosError = __nccwpck_require__(2093); -"use strict"; +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=accountUsageResource.js.map +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = __nccwpck_require__(4850); -/***/ }), +// Expose isAxiosError +axios.isAxiosError = __nccwpck_require__(650); -/***/ 7689: -/***/ ((__unused_webpack_module, exports) => { +module.exports = axios; -"use strict"; +// Allow use of default import syntax in TypeScript +module.exports["default"] = axios; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ActionExecutionLocation = void 0; -var ActionExecutionLocation; -(function (ActionExecutionLocation) { - ActionExecutionLocation["AlwaysOnTarget"] = "AlwaysOnTarget"; - ActionExecutionLocation["AlwaysOnServer"] = "AlwaysOnServer"; - ActionExecutionLocation["TargetOrServer"] = "TargetOrServer"; -})(ActionExecutionLocation = exports.ActionExecutionLocation || (exports.ActionExecutionLocation = {})); -//# sourceMappingURL=actionExecutionLocation.js.map /***/ }), -/***/ 9801: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1587: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ActionHandlerCategory = void 0; -var ActionHandlerCategory; -(function (ActionHandlerCategory) { - ActionHandlerCategory["Atlassian"] = "Atlassian"; - ActionHandlerCategory["Aws"] = "Aws"; - ActionHandlerCategory["Azure"] = "Azure"; - ActionHandlerCategory["BuiltInStep"] = "BuiltInStep"; - ActionHandlerCategory["Certificate"] = "Certificate"; - ActionHandlerCategory["Community"] = "Community"; - ActionHandlerCategory["CommunitySubCategory"] = "CommunitySubCategory"; - ActionHandlerCategory["Docker"] = "Docker"; - ActionHandlerCategory["GoogleCloud"] = "Google"; - ActionHandlerCategory["JavaAppServer"] = "JavaAppServer"; - ActionHandlerCategory["Kubernetes"] = "Kubernetes"; - ActionHandlerCategory["Other"] = "Other"; - ActionHandlerCategory["Package"] = "Package"; - ActionHandlerCategory["Script"] = "Script"; - ActionHandlerCategory["StepTemplate"] = "StepTemplate"; - ActionHandlerCategory["Terraform"] = "Terraform"; - ActionHandlerCategory["WindowsServer"] = "WindowsServer"; -})(ActionHandlerCategory = exports.ActionHandlerCategory || (exports.ActionHandlerCategory = {})); -//# sourceMappingURL=actionHandlerCategory.js.map - -/***/ }), - -/***/ 71517: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +var CanceledError = __nccwpck_require__(4098); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionInputs.js.map +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } -/***/ }), + var resolvePromise; -/***/ 6531: -/***/ ((__unused_webpack_module, exports) => { + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); -"use strict"; + var token = this; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionProperties.js.map + // eslint-disable-next-line func-names + this.promise.then(function(cancel) { + if (!token._listeners) return; -/***/ }), + var i; + var l = token._listeners.length; -/***/ 10136: -/***/ ((__unused_webpack_module, exports) => { + for (i = 0; i < l; i++) { + token._listeners[i](cancel); + } + token._listeners = null; + }); -"use strict"; + // eslint-disable-next-line func-names + this.promise.then = function(onfulfilled) { + var _resolve; + // eslint-disable-next-line func-names + var promise = new Promise(function(resolve) { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionTemplateCategoryResource.js.map + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; -/***/ }), + return promise; + }; -/***/ 9947: -/***/ ((__unused_webpack_module, exports) => { + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } -"use strict"; + token.reason = new CanceledError(message); + resolvePromise(token.reason); + }); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionTemplateParameterDisplaySettings.js.map +/** + * Throws a `CanceledError` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; -/***/ }), +/** + * Subscribe to the cancel signal + */ -/***/ 48998: -/***/ ((__unused_webpack_module, exports) => { +CancelToken.prototype.subscribe = function subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } -"use strict"; + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionTemplateParameterResource.js.map +/** + * Unsubscribe from the cancel signal + */ -/***/ }), +CancelToken.prototype.unsubscribe = function unsubscribe(listener) { + if (!this._listeners) { + return; + } + var index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } +}; -/***/ 47799: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; -"use strict"; +module.exports = CancelToken; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getFeedTypesForActionType = void 0; -var feedType_1 = __nccwpck_require__(30090); -function getFeedTypesForActionType(actionType) { - switch (actionType) { - case "Octopus.DockerRun": - return [feedType_1.FeedType.Docker, feedType_1.FeedType.AwsElasticContainerRegistry]; - case "Octopus.HelmChartUpgrade": - return [feedType_1.FeedType.Helm]; - case "Octopus.JavaArchive": - case "Octopus.TomcatDeploy": - case "Octopus.WildFlyDeploy": - return [feedType_1.FeedType.Nuget, feedType_1.FeedType.BuiltIn, feedType_1.FeedType.Maven]; - case "Octopus.TentaclePackage": - case "Octopus.TransferPackage": - return [ - feedType_1.FeedType.Nuget, - feedType_1.FeedType.BuiltIn, - feedType_1.FeedType.Maven, - feedType_1.FeedType.GitHub, - ]; - } - return []; -} -exports.getFeedTypesForActionType = getFeedTypesForActionType; -//# sourceMappingURL=actionTemplateResource.js.map /***/ }), -/***/ 34440: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4098: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionTemplateSearchResource.js.map - -/***/ }), - -/***/ 49241: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionTemplateUsageResource.js.map +var AxiosError = __nccwpck_require__(2093); +var utils = __nccwpck_require__(328); -/***/ }), +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function CanceledError(message) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED); + this.name = 'CanceledError'; +} -/***/ 53132: -/***/ ((__unused_webpack_module, exports) => { +utils.inherits(CanceledError, AxiosError, { + __CANCEL__: true +}); -"use strict"; +module.exports = CanceledError; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ActionUpdateOutcome = void 0; -var ActionUpdateOutcome; -(function (ActionUpdateOutcome) { - ActionUpdateOutcome["DefaultParamterValueMissing"] = "DefaultParamterValueMissing"; - ActionUpdateOutcome["ManualMergeRequired"] = "ManualMergeRequired"; - ActionUpdateOutcome["RemovedPackageInUse"] = "RemovedPackageInUse"; - ActionUpdateOutcome["Success"] = "Success"; -})(ActionUpdateOutcome = exports.ActionUpdateOutcome || (exports.ActionUpdateOutcome = {})); -//# sourceMappingURL=actionUpdateOutcome.js.map /***/ }), -/***/ 56543: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4057: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ActionUpdatePackageUsedBy = void 0; -var ActionUpdatePackageUsedBy; -(function (ActionUpdatePackageUsedBy) { - ActionUpdatePackageUsedBy["ChannelRule"] = "ChannelRule"; - ActionUpdatePackageUsedBy["ProjectReleaseCreationStrategy"] = "ProjectReleaseCreationStrategy"; - ActionUpdatePackageUsedBy["ProjectVersionStrategy"] = "ProjectVersionStrategy"; -})(ActionUpdatePackageUsedBy = exports.ActionUpdatePackageUsedBy || (exports.ActionUpdatePackageUsedBy = {})); -//# sourceMappingURL=actionUpdatePackageUsedBy.js.map - -/***/ }), - -/***/ 40407: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionUpdateRemovedPackageUsage.js.map /***/ }), -/***/ 99710: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8178: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionUpdateResource.js.map - -/***/ }), - -/***/ 34926: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionUpdateResultResource.js.map +var utils = __nccwpck_require__(328); +var buildURL = __nccwpck_require__(646); +var InterceptorManager = __nccwpck_require__(3214); +var dispatchRequest = __nccwpck_require__(5062); +var mergeConfig = __nccwpck_require__(4831); +var buildFullPath = __nccwpck_require__(1934); +var validator = __nccwpck_require__(1632); -/***/ }), +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} -/***/ 30597: -/***/ ((__unused_webpack_module, exports) => { +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } -"use strict"; + config = mergeConfig(this.defaults, config); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionsUpdateProcessResource.js.map + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } -/***/ }), + var transitional = config.transitional; -/***/ 80778: -/***/ ((__unused_webpack_module, exports) => { + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } -"use strict"; + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=agentlessEndpointResource.js.map + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; -/***/ }), + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); -/***/ 94582: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); -"use strict"; + var promise; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewAmazonWebServicesAccount = void 0; -var accountType_1 = __nccwpck_require__(34914); -function NewAmazonWebServicesAccount(name, accessKey, secretKey) { - return { - AccessKey: accessKey, - AccountType: accountType_1.AccountType.AmazonWebServicesAccount, - Name: name, - SecretKey: secretKey, - }; -} -exports.NewAmazonWebServicesAccount = NewAmazonWebServicesAccount; -//# sourceMappingURL=amazonWebServicesAccountResource.js.map + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; -/***/ }), + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); -/***/ 30939: -/***/ ((__unused_webpack_module, exports) => { + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } -"use strict"; + return promise; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=apiKeyCreatedResource.js.map -/***/ }), + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } -/***/ 18304: -/***/ ((__unused_webpack_module, exports) => { + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } -"use strict"; + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=apiKeyResource.js.map + return promise; +}; -/***/ }), +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + var fullPath = buildFullPath(config.baseURL, config.url); + return buildURL(fullPath, config.params, config.paramsSerializer); +}; -/***/ 58502: -/***/ ((__unused_webpack_module, exports) => { +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); -"use strict"; +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=artifactResource.js.map + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url: url, + data: data + })); + }; + } -/***/ }), + Axios.prototype[method] = generateHTTPMethod(); -/***/ 16089: -/***/ ((__unused_webpack_module, exports) => { + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); -"use strict"; +module.exports = Axios; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=authenticationError.js.map /***/ }), -/***/ 38639: -/***/ ((__unused_webpack_module, exports) => { +/***/ 2093: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AuthenticationProviderElement = void 0; -var AuthenticationProviderElement = (function () { - function AuthenticationProviderElement() { - this.CSSLinks = undefined; - this.FormsLoginEnabled = undefined; - this.IdentityType = undefined; - this.JavascriptLinks = undefined; - this.Links = undefined; - this.Name = undefined; - } - return AuthenticationProviderElement; -}()); -exports.AuthenticationProviderElement = AuthenticationProviderElement; -//# sourceMappingURL=authenticationProviderElement.js.map - -/***/ }), -/***/ 72866: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +var utils = __nccwpck_require__(328); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=authenticationResource.js.map - -/***/ }), - -/***/ 64699: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); +utils.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code, + status: this.response && this.response.status ? this.response.status : null }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AutoDeployActionResource = void 0; -var triggerActionResource_1 = __nccwpck_require__(59636); -var triggerActionType_1 = __nccwpck_require__(58574); -var AutoDeployActionResource = (function (_super) { - __extends(AutoDeployActionResource, _super); - function AutoDeployActionResource() { - var _this = _super.call(this) || this; - _this.ShouldRedeployWhenMachineHasBeenDeployedTo = undefined; - _this.ActionType = triggerActionType_1.TriggerActionType.AutoDeploy; - return _this; - } - return AutoDeployActionResource; -}(triggerActionResource_1.TriggerActionResource)); -exports.AutoDeployActionResource = AutoDeployActionResource; -//# sourceMappingURL=autoDeployActionResource.js.map - -/***/ }), + } +}); -/***/ 39349: -/***/ ((__unused_webpack_module, exports) => { +var prototype = AxiosError.prototype; +var descriptors = {}; -"use strict"; +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED' +// eslint-disable-next-line func-names +].forEach(function(code) { + descriptors[code] = {value: code}; +}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=awsElasticContainerRegistryFeedResource.js.map +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype, 'isAxiosError', {value: true}); -/***/ }), +// eslint-disable-next-line func-names +AxiosError.from = function(error, code, config, request, response, customProps) { + var axiosError = Object.create(prototype); -/***/ 92669: -/***/ ((__unused_webpack_module, exports) => { + utils.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }); -"use strict"; + AxiosError.call(axiosError, error.message, code, config, request, response); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=azureEnvironment.js.map + axiosError.name = error.name; -/***/ }), + customProps && Object.assign(axiosError, customProps); -/***/ 27134: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return axiosError; +}; -"use strict"; +module.exports = AxiosError; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewAzureServicePrincipalAccount = void 0; -var accountType_1 = __nccwpck_require__(34914); -function NewAzureServicePrincipalAccount(name, subscriptionId, tenantId, applicationId, applicationPassword) { - return { - AccountType: accountType_1.AccountType.AzureServicePrincipal, - ClientId: applicationId, - Name: name, - Password: applicationPassword, - SubscriptionNumber: subscriptionId, - TenantId: tenantId, - }; -} -exports.NewAzureServicePrincipalAccount = NewAzureServicePrincipalAccount; -//# sourceMappingURL=azureServicePrincipalAccountResource.js.map /***/ }), -/***/ 66707: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3214: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=azureWebSite.js.map - -/***/ }), -/***/ 27673: -/***/ ((__unused_webpack_module, exports) => { +var utils = __nccwpck_require__(328); -"use strict"; +function InterceptorManager() { + this.handlers = []; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=azureWebSiteSlot.js.map +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; -/***/ }), +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; -/***/ 60035: -/***/ ((__unused_webpack_module, exports) => { +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; -"use strict"; +module.exports = InterceptorManager; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=buildInformationResource.js.map /***/ }), -/***/ 91173: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1934: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=builtInFeedLinks.js.map - -/***/ }), -/***/ 42969: -/***/ ((__unused_webpack_module, exports) => { +var isAbsoluteURL = __nccwpck_require__(1301); +var combineURLs = __nccwpck_require__(7189); -"use strict"; +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=builtInFeedResource.js.map /***/ }), -/***/ 33477: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5062: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=builtInFeedStatsResource.js.map - -/***/ }), -/***/ 39021: -/***/ ((__unused_webpack_module, exports) => { +var utils = __nccwpck_require__(328); +var transformData = __nccwpck_require__(9812); +var isCancel = __nccwpck_require__(4057); +var defaults = __nccwpck_require__(1626); +var CanceledError = __nccwpck_require__(4098); -"use strict"; +/** + * Throws a `CanceledError` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=certificateConfigurationResource.js.map + if (config.signal && config.signal.aborted) { + throw new CanceledError(); + } +} -/***/ }), +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); -/***/ 50699: -/***/ ((__unused_webpack_module, exports) => { + // Ensure headers exist + config.headers = config.headers || {}; -"use strict"; + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=certificateResource.js.map + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); -/***/ }), + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); -/***/ 94840: -/***/ ((__unused_webpack_module, exports) => { + var adapter = config.adapter || defaults.adapter; -"use strict"; + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=certificateUsageResource.js.map + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); -/***/ }), + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); -/***/ 18754: -/***/ ((__unused_webpack_module, exports) => { + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } -"use strict"; + return Promise.reject(reason); + }); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=channelOclResource.js.map /***/ }), -/***/ 90097: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4831: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=channelProgressionResource.js.map - -/***/ }), -/***/ 52739: -/***/ ((__unused_webpack_module, exports) => { +var utils = __nccwpck_require__(328); -"use strict"; +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewChannel = void 0; -function NewChannel(name, projectId) { - return { - Name: name, - ProjectId: projectId, - }; -} -exports.NewChannel = NewChannel; -//# sourceMappingURL=channelResource.js.map + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } -/***/ }), + // eslint-disable-next-line consistent-return + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + return getMergedValue(undefined, config1[prop]); + } + } -/***/ 78766: -/***/ ((__unused_webpack_module, exports) => { + // eslint-disable-next-line consistent-return + function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(undefined, config2[prop]); + } + } -"use strict"; + // eslint-disable-next-line consistent-return + function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + return getMergedValue(undefined, config1[prop]); + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=channelVersionRuleResource.js.map + // eslint-disable-next-line consistent-return + function mergeDirectKeys(prop) { + if (prop in config2) { + return getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + return getMergedValue(undefined, config1[prop]); + } + } -/***/ }), + var mergeMap = { + 'url': valueFromConfig2, + 'method': valueFromConfig2, + 'data': valueFromConfig2, + 'baseURL': defaultToConfig2, + 'transformRequest': defaultToConfig2, + 'transformResponse': defaultToConfig2, + 'paramsSerializer': defaultToConfig2, + 'timeout': defaultToConfig2, + 'timeoutMessage': defaultToConfig2, + 'withCredentials': defaultToConfig2, + 'adapter': defaultToConfig2, + 'responseType': defaultToConfig2, + 'xsrfCookieName': defaultToConfig2, + 'xsrfHeaderName': defaultToConfig2, + 'onUploadProgress': defaultToConfig2, + 'onDownloadProgress': defaultToConfig2, + 'decompress': defaultToConfig2, + 'maxContentLength': defaultToConfig2, + 'maxBodyLength': defaultToConfig2, + 'beforeRedirect': defaultToConfig2, + 'transport': defaultToConfig2, + 'httpAgent': defaultToConfig2, + 'httpsAgent': defaultToConfig2, + 'cancelToken': defaultToConfig2, + 'socketPath': defaultToConfig2, + 'responseEncoding': defaultToConfig2, + 'validateStatus': mergeDirectKeys + }; -/***/ 21303: -/***/ ((__unused_webpack_module, exports) => { + utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { + var merge = mergeMap[prop] || mergeDeepProperties; + var configValue = merge(prop); + (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); -"use strict"; + return config; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=commitCommand.js.map /***/ }), -/***/ 3712: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3211: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=commitDetail.js.map - -/***/ }), -/***/ 27734: -/***/ ((__unused_webpack_module, exports) => { +var AxiosError = __nccwpck_require__(2093); -"use strict"; +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError( + 'Request failed with status code ' + response.status, + [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=commonTriggerResource.js.map /***/ }), -/***/ 19170: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CommunicationStyle = void 0; -var CommunicationStyle; -(function (CommunicationStyle) { - CommunicationStyle["AzureCloudService"] = "AzureCloudService"; - CommunicationStyle["AzureServiceFabricCluster"] = "AzureServiceFabricCluster"; - CommunicationStyle["AzureWebApp"] = "AzureWebApp"; - CommunicationStyle["Kubernetes"] = "Kubernetes"; - CommunicationStyle["None"] = "None"; - CommunicationStyle["OfflineDrop"] = "OfflineDrop"; - CommunicationStyle["Ssh"] = "Ssh"; - CommunicationStyle["StepPackage"] = "StepPackage"; - CommunicationStyle["TentacleActive"] = "TentacleActive"; - CommunicationStyle["TentaclePassive"] = "TentaclePassive"; -})(CommunicationStyle = exports.CommunicationStyle || (exports.CommunicationStyle = {})); -//# sourceMappingURL=communicationStyle.js.map - -/***/ }), - -/***/ 99930: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9812: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=communityActionTemplateResource.js.map -/***/ }), +var utils = __nccwpck_require__(328); +var defaults = __nccwpck_require__(1626); -/***/ 42546: -/***/ ((__unused_webpack_module, exports) => { +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); -"use strict"; + return data; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ControlType = void 0; -var ControlType; -(function (ControlType) { - ControlType["AmazonWebServicesAccount"] = "AmazonWebServicesAccount"; - ControlType["AzureAccount"] = "AzureAccount"; - ControlType["Certificate"] = "Certificate"; - ControlType["Checkbox"] = "Checkbox"; - ControlType["Custom"] = "Custom"; - ControlType["GoogleCloudAccount"] = "GoogleCloudAccount"; - ControlType["MultiLineText"] = "MultiLineText"; - ControlType["Package"] = "Package"; - ControlType["Select"] = "Select"; - ControlType["Sensitive"] = "Sensitive"; - ControlType["SingleLineText"] = "SingleLineText"; - ControlType["StepName"] = "StepName"; - ControlType["WorkerPool"] = "WorkerPool"; -})(ControlType = exports.ControlType || (exports.ControlType = {})); -//# sourceMappingURL=controlType.js.map /***/ }), -/***/ 83382: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7024: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +// eslint-disable-next-line strict +module.exports = __nccwpck_require__(4334); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=convertProjectToVersionControlledCommand.js.map /***/ }), -/***/ 20006: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1626: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardConfigurationResource.js.map -/***/ }), +var utils = __nccwpck_require__(328); +var normalizeHeaderName = __nccwpck_require__(6240); +var AxiosError = __nccwpck_require__(2093); +var transitionalDefaults = __nccwpck_require__(936); +var toFormData = __nccwpck_require__(470); -/***/ 26289: -/***/ ((__unused_webpack_module, exports) => { +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; -"use strict"; +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardEnvironmentResource.js.map +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __nccwpck_require__(3454); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = __nccwpck_require__(8104); + } + return adapter; +} -/***/ }), +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } -/***/ 64543: -/***/ ((__unused_webpack_module, exports) => { + return (encoder || JSON.stringify)(rawValue); +} -"use strict"; +var defaults = { -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardItemResource.js.map + transitional: transitionalDefaults, -/***/ }), + adapter: getDefaultAdapter(), -/***/ 88640: -/***/ ((__unused_webpack_module, exports) => { + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); -"use strict"; + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardProjectGroupResource.js.map + var isObjectPayload = utils.isObject(data); + var contentType = headers && headers['Content-Type']; -/***/ }), + var isFileList; -/***/ 21706: -/***/ ((__unused_webpack_module, exports) => { + if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) { + var _FormData = this.env && this.env.FormData; + return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData()); + } else if (isObjectPayload || contentType === 'application/json') { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } -"use strict"; + return data; + }], -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardProjectResource.js.map + transformResponse: [function transformResponse(data) { + var transitional = this.transitional || defaults.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; -/***/ }), + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } -/***/ 65120: -/***/ ((__unused_webpack_module, exports) => { + return data; + }], -"use strict"; + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardResource.js.map + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', -/***/ }), + maxContentLength: -1, + maxBodyLength: -1, -/***/ 60599: -/***/ ((__unused_webpack_module, exports) => { + env: { + FormData: __nccwpck_require__(7024) + }, -"use strict"; + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardTenantResource.js.map + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + } + } +}; -/***/ }), +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); -/***/ 61676: -/***/ ((__unused_webpack_module, exports) => { +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); -"use strict"; +module.exports = defaults; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=defectResource.js.map /***/ }), -/***/ 71615: -/***/ ((__unused_webpack_module, exports) => { +/***/ 936: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DefectStatus = void 0; -var DefectStatus; -(function (DefectStatus) { - DefectStatus["Resolved"] = "Resolved"; - DefectStatus["Unresolved"] = "Unresolved"; -})(DefectStatus = exports.DefectStatus || (exports.DefectStatus = {})); -//# sourceMappingURL=defectStatus.js.map - -/***/ }), - -/***/ 26994: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"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); -}; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (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; -}; -var __spreadArray = (this && this.__spreadArray) || function (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)); +module.exports = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InitialisePrimaryPackageReference = exports.SetPrimaryPackageReference = exports.SetNamedPackageReference = exports.GetNamedPackageReferences = exports.IsNamedPackageReference = exports.GetPrimaryPackageReference = exports.HasManualInterventionResponsibleTeams = exports.PackageReferenceNamesMatch = exports.RemovePrimaryPackageReference = exports.IsPrimaryPackageReference = exports.IsDeployReleaseAction = void 0; -var _ = __importStar(__nccwpck_require__(90250)); -var feedType_1 = __nccwpck_require__(30090); -var packageAcquisitionLocation_1 = __nccwpck_require__(37648); -var packageReference_1 = __nccwpck_require__(66933); -function parseCSV(val) { - if (!val || val === "") { - return []; - } - return val.split(","); -} -function IsDeployReleaseAction(action) { - return !!action.Properties["Octopus.Action.DeployRelease.ProjectId"]; -} -exports.IsDeployReleaseAction = IsDeployReleaseAction; -function IsPrimaryPackageReference(pkg) { - return !pkg.Name; -} -exports.IsPrimaryPackageReference = IsPrimaryPackageReference; -function RemovePrimaryPackageReference(packages) { - return _.filter(packages, function (pkg) { return !IsPrimaryPackageReference(pkg); }); -} -exports.RemovePrimaryPackageReference = RemovePrimaryPackageReference; -function PackageReferenceNamesMatch(nameA, nameB) { - if (!nameA) { - return !nameB; - } - return nameA === nameB; -} -exports.PackageReferenceNamesMatch = PackageReferenceNamesMatch; -function HasManualInterventionResponsibleTeams(action) { - return _.some(parseCSV(action.Properties["Octopus.Action.Manual.ResponsibleTeamIds"])); -} -exports.HasManualInterventionResponsibleTeams = HasManualInterventionResponsibleTeams; -function GetPrimaryPackageReference(packages) { - return packages === null || packages === void 0 ? void 0 : packages.find(function (pkg) { return IsPrimaryPackageReference(pkg); }); -} -exports.GetPrimaryPackageReference = GetPrimaryPackageReference; -function IsNamedPackageReference(pkg) { - return !!pkg.Name; -} -exports.IsNamedPackageReference = IsNamedPackageReference; -function GetNamedPackageReferences(packages) { - return RemovePrimaryPackageReference(packages); -} -exports.GetNamedPackageReferences = GetNamedPackageReferences; -function SetNamedPackageReference(name, updated, packages) { - return _.map(packages, function (pkg) { - if (!PackageReferenceNamesMatch(name, pkg.Name)) { - return pkg; - } - return __assign(__assign({}, pkg), updated); - }); -} -exports.SetNamedPackageReference = SetNamedPackageReference; -function SetPrimaryPackageReference(updated, packages) { - return _.map(packages, function (pkg) { - if (!IsPrimaryPackageReference(pkg)) { - return pkg; - } - return __assign(__assign({}, pkg), updated); - }); -} -exports.SetPrimaryPackageReference = SetPrimaryPackageReference; -function InitialisePrimaryPackageReference(packages, feeds, itemsKeyedBy) { - var primaryPackage = GetPrimaryPackageReference(packages); - if (primaryPackage) { - if (!primaryPackage.Properties.SelectionMode) { - primaryPackage.Properties.SelectionMode = packageReference_1.PackageSelectionMode.Immediate; - } - return __spreadArray([], packages, true); - } - var packagesWithoutDefault = RemovePrimaryPackageReference(packages); - var builtInFeed = feeds.find(function (f) { return f.FeedType === feedType_1.FeedType.BuiltIn; }); - var builtInFeedIdOrName = builtInFeed && builtInFeed[itemsKeyedBy]; - return __spreadArray([ - { - Id: null, - PackageId: null, - FeedId: builtInFeedIdOrName, - AcquisitionLocation: packageAcquisitionLocation_1.PackageAcquisitionLocation.Server, - Properties: { - SelectionMode: packageReference_1.PackageSelectionMode.Immediate, - }, - } - ], packagesWithoutDefault, true); -} -exports.InitialisePrimaryPackageReference = InitialisePrimaryPackageReference; -//# sourceMappingURL=deploymentActionResource.js.map -/***/ }), -/***/ 40633: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ }), -"use strict"; +/***/ 4322: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isDeploymentPreviewResource = void 0; -var utils_1 = __nccwpck_require__(12765); -function isDeploymentPreviewResource(resource) { - var converted = resource; - return (converted.Changes !== undefined && - (0, utils_1.typeSafeHasOwnProperty)(converted, "Changes")); -} -exports.isDeploymentPreviewResource = isDeploymentPreviewResource; -//# sourceMappingURL=deploymentPreviewResource.js.map +module.exports = { + "version": "0.27.2" +}; /***/ }), -/***/ 157: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 7065: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.processResourcePermission = exports.isRunbookProcessResource = exports.isDeploymentProcessResource = void 0; -var permission_1 = __nccwpck_require__(49346); -var utils_1 = __nccwpck_require__(12765); -function isDeploymentProcessResource(resource) { - if (resource === null || resource === undefined) { - return false; - } - var converted = resource; - return (!isRunbookProcessResource(resource) && - converted.Version !== undefined && - (0, utils_1.typeSafeHasOwnProperty)(converted, "Version")); -} -exports.isDeploymentProcessResource = isDeploymentProcessResource; -function isRunbookProcessResource(resource) { - if (resource === null || resource === undefined) { - return false; + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; } - var converted = resource; - return (converted.RunbookId !== undefined && - (0, utils_1.typeSafeHasOwnProperty)(converted, "RunbookId")); -} -exports.isRunbookProcessResource = isRunbookProcessResource; -function processResourcePermission(resource) { - var isRunbook = isRunbookProcessResource(resource); - return isRunbook ? permission_1.Permission.RunbookEdit : permission_1.Permission.ProcessEdit; -} -exports.processResourcePermission = processResourcePermission; -//# sourceMappingURL=deploymentProcessResource.js.map + return fn.apply(thisArg, args); + }; +}; + /***/ }), -/***/ 71976: -/***/ ((__unused_webpack_module, exports) => { +/***/ 646: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=deploymentResource.js.map -/***/ }), +var utils = __nccwpck_require__(328); -/***/ 81741: -/***/ ((__unused_webpack_module, exports) => { +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} -"use strict"; +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GuidedFailureMode = void 0; -var GuidedFailureMode; -(function (GuidedFailureMode) { - GuidedFailureMode["EnvironmentDefault"] = "EnvironmentDefault"; - GuidedFailureMode["Off"] = "Off"; - GuidedFailureMode["On"] = "On"; -})(GuidedFailureMode = exports.GuidedFailureMode || (exports.GuidedFailureMode = {})); -//# sourceMappingURL=deploymentSettingsResource.js.map + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; -/***/ }), + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } -/***/ 10322: -/***/ ((__unused_webpack_module, exports) => { + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } -"use strict"; + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PackageRequirement = exports.RunCondition = exports.StartTrigger = void 0; -var StartTrigger; -(function (StartTrigger) { - StartTrigger["StartWithPrevious"] = "StartWithPrevious"; - StartTrigger["StartAfterPrevious"] = "StartAfterPrevious"; -})(StartTrigger = exports.StartTrigger || (exports.StartTrigger = {})); -var RunCondition; -(function (RunCondition) { - RunCondition["Success"] = "Success"; - RunCondition["Failure"] = "Failure"; - RunCondition["Always"] = "Always"; - RunCondition["Variable"] = "Variable"; -})(RunCondition = exports.RunCondition || (exports.RunCondition = {})); -var PackageRequirement; -(function (PackageRequirement) { - PackageRequirement["LetOctopusDecide"] = "LetOctopusDecide"; - PackageRequirement["BeforePackageAcquisition"] = "BeforePackageAcquisition"; - PackageRequirement["AfterPackageAcquisition"] = "AfterPackageAcquisition"; -})(PackageRequirement = exports.PackageRequirement || (exports.PackageRequirement = {})); -//# sourceMappingURL=deploymentStepResource.js.map + serializedParams = parts.join('&'); + } -/***/ }), + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } -/***/ 9042: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } -"use strict"; + return url; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isDeploymentTarget = exports.NewDeploymentTarget = void 0; -var machineResource_1 = __nccwpck_require__(82705); -function NewDeploymentTarget(name, endpoint, environments, roles, tenantedDeploymentParticipation) { - return { - IsDisabled: false, - IsInProcess: false, - Endpoint: endpoint, - EnvironmentIds: environments.map(function (e) { return e.Id; }), - HasLatestCalamari: false, - HealthStatus: machineResource_1.MachineModelHealthStatus.Unknown, - Name: name, - MachinePolicyId: "", - Roles: roles, - TenantedDeploymentParticipation: tenantedDeploymentParticipation, - TenantIds: [], - TenantTags: [], - }; -} -exports.NewDeploymentTarget = NewDeploymentTarget; -function isDeploymentTarget(machine) { - return machine.EnvironmentIds !== undefined; -} -exports.isDeploymentTarget = isDeploymentTarget; -//# sourceMappingURL=deploymentTargetResource.js.map /***/ }), -/***/ 95369: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7189: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeploymentTargetTaskType = void 0; -var DeploymentTargetTaskType; -(function (DeploymentTargetTaskType) { - DeploymentTargetTaskType["Deployment"] = "Deployment"; - DeploymentTargetTaskType["RunbookRun"] = "RunbookRun"; -})(DeploymentTargetTaskType = exports.DeploymentTargetTaskType || (exports.DeploymentTargetTaskType = {})); -//# sourceMappingURL=deploymentTargetTaskType.js.map - -/***/ }), - -/***/ 48798: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=deploymentTemplateResource.js.map /***/ }), -/***/ 67788: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1545: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=deploymentTemplateStep.js.map -/***/ }), +var utils = __nccwpck_require__(328); -/***/ 69297: -/***/ ((__unused_webpack_module, exports) => { +module.exports = ( + utils.isStandardBrowserEnv() ? -"use strict"; + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=documentSummary.js.map + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } -/***/ }), + if (utils.isString(path)) { + cookie.push('path=' + path); + } -/***/ 33162: -/***/ ((__unused_webpack_module, exports) => { + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } -"use strict"; + if (secure === true) { + cookie.push('secure'); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dynamicExtensionsFeaturesMetadataResource.js.map + document.cookie = cookie.join('; '); + }, -/***/ }), + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, -/***/ 91606: -/***/ ((__unused_webpack_module, exports) => { + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : -"use strict"; + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dynamicExtensionsFeaturesValuesResource.js.map /***/ }), -/***/ 85284: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1301: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dynamicExtensionsScriptsResource.js.map - -/***/ }), - -/***/ 36747: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ConnectivityCheckResponseMessageCategory = exports.PropertyApplicabilityMode = void 0; -var PropertyApplicabilityMode; -(function (PropertyApplicabilityMode) { - PropertyApplicabilityMode["ApplicableIfHasAnyValue"] = "ApplicableIfHasAnyValue"; - PropertyApplicabilityMode["ApplicableIfHasNoValue"] = "ApplicableIfHasNoValue"; - PropertyApplicabilityMode["ApplicableIfSpecificValue"] = "ApplicableIfSpecificValue"; - PropertyApplicabilityMode["ApplicableIfNotSpecificValue"] = "ApplicableIfNotSpecificValue"; -})(PropertyApplicabilityMode = exports.PropertyApplicabilityMode || (exports.PropertyApplicabilityMode = {})); -var ConnectivityCheckResponseMessageCategory; -(function (ConnectivityCheckResponseMessageCategory) { - ConnectivityCheckResponseMessageCategory["Info"] = "Info"; - ConnectivityCheckResponseMessageCategory["Warning"] = "Warning"; - ConnectivityCheckResponseMessageCategory["Error"] = "Error"; -})(ConnectivityCheckResponseMessageCategory = exports.ConnectivityCheckResponseMessageCategory || (exports.ConnectivityCheckResponseMessageCategory = {})); -//# sourceMappingURL=dynamicFormResources.js.map /***/ }), -/***/ 34830: -/***/ ((__unused_webpack_module, exports) => { +/***/ 650: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EmailPriority = void 0; -var EmailPriority; -(function (EmailPriority) { - EmailPriority["Low"] = "Low"; - EmailPriority["Normal"] = "Normal"; - EmailPriority["High"] = "High"; -})(EmailPriority = exports.EmailPriority || (exports.EmailPriority = {})); -//# sourceMappingURL=emailPriority.js.map - -/***/ }), -/***/ 93373: -/***/ ((__unused_webpack_module, exports) => { +var utils = __nccwpck_require__(328); -"use strict"; +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return utils.isObject(payload) && (payload.isAxiosError === true); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewEndpoint = void 0; -function NewEndpoint(name, communicationStyle) { - return { - CommunicationStyle: communicationStyle, - Name: name, - }; -} -exports.NewEndpoint = NewEndpoint; -//# sourceMappingURL=endpointResource.js.map /***/ }), -/***/ 34042: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3608: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=environmentResource.js.map -/***/ }), +var utils = __nccwpck_require__(328); -/***/ 31719: -/***/ ((__unused_webpack_module, exports) => { +module.exports = ( + utils.isStandardBrowserEnv() ? -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=environmentResourceLinks.js.map - -/***/ }), - -/***/ 78157: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=environmentSummaryResource.js.map + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; -/***/ }), + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; -/***/ 47479: -/***/ ((__unused_webpack_module, exports) => { + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } -"use strict"; + urlParsingNode.setAttribute('href', href); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=environmentsSummaryResource.js.map + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } -/***/ }), + originURL = resolveURL(window.location.href); -/***/ 16470: -/***/ ((__unused_webpack_module, exports) => { + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : -"use strict"; + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=eventNotificationSubscription.js.map /***/ }), -/***/ 50710: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6240: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=eventNotificationSubscriptionFilter.js.map - -/***/ }), -/***/ 27811: -/***/ ((__unused_webpack_module, exports) => { +var utils = __nccwpck_require__(328); -"use strict"; +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=eventResource.js.map /***/ }), -/***/ 82718: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6455: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=extensionSettingsValues.js.map -/***/ }), +var utils = __nccwpck_require__(328); -/***/ 62851: -/***/ ((__unused_webpack_module, exports) => { +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; -"use strict"; +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=extensionsInfoResource.js.map + if (!headers) { return parsed; } -/***/ }), + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); -/***/ 28075: -/***/ ((__unused_webpack_module, exports) => { + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); -"use strict"; + return parsed; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=externalSecurityGroupProviderResource.js.map /***/ }), -/***/ 42769: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6107: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=featuresConfigurationResource.js.map - -/***/ }), - -/***/ 37877: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getFeedTypeLabel = exports.isContainerImageRegistry = exports.containerRegistryFeedTypes = exports.isOctopusProjectFeed = exports.feedTypeSupportsExtraction = exports.feedTypeCanSearchEmpty = void 0; -var feedType_1 = __nccwpck_require__(30090); -var lodash_1 = __nccwpck_require__(90250); -function feedTypeCanSearchEmpty(feed) { - return ![ - feedType_1.FeedType.Docker, - feedType_1.FeedType.AwsElasticContainerRegistry, - feedType_1.FeedType.Maven, - feedType_1.FeedType.GitHub, - ].includes(feed); -} -exports.feedTypeCanSearchEmpty = feedTypeCanSearchEmpty; -function feedTypeSupportsExtraction(feed) { - return ![feedType_1.FeedType.Docker, feedType_1.FeedType.AwsElasticContainerRegistry].includes(feed); -} -exports.feedTypeSupportsExtraction = feedTypeSupportsExtraction; -function isOctopusProjectFeed(feed) { - return feed === "OctopusProject"; -} -exports.isOctopusProjectFeed = isOctopusProjectFeed; -function containerRegistryFeedTypes() { - return [feedType_1.FeedType.Docker, feedType_1.FeedType.AwsElasticContainerRegistry]; -} -exports.containerRegistryFeedTypes = containerRegistryFeedTypes; -function isContainerImageRegistry(feed) { - return containerRegistryFeedTypes().includes(feed); -} -exports.isContainerImageRegistry = isContainerImageRegistry; -var getFeedTypeLabel = function (feedType) { - var requiresContainerImageRegistryFeed = feedType && - feedType.length >= 1 && - (0, lodash_1.every)(feedType, function (f) { return isContainerImageRegistry(f); }); - var requiresHelmChartFeed = feedType && feedType.length === 1 && feedType[0] === feedType_1.FeedType.Helm; - if (requiresContainerImageRegistryFeed) { - return "Container Image Registry"; - } - if (requiresHelmChartFeed) { - return "Helm Chart Repository"; - } - return "Package"; +module.exports = function parseProtocol(url) { + var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; }; -exports.getFeedTypeLabel = getFeedTypeLabel; -//# sourceMappingURL=feedResource.js.map - -/***/ }), - -/***/ 30090: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FeedType = void 0; -var FeedType; -(function (FeedType) { - FeedType["AwsElasticContainerRegistry"] = "AwsElasticContainerRegistry"; - FeedType["BuiltIn"] = "BuiltIn"; - FeedType["Docker"] = "Docker"; - FeedType["GitHub"] = "GitHub"; - FeedType["Helm"] = "Helm"; - FeedType["Maven"] = "Maven"; - FeedType["Nuget"] = "NuGet"; - FeedType["OctopusProject"] = "OctopusProject"; -})(FeedType = exports.FeedType || (exports.FeedType = {})); -//# sourceMappingURL=feedType.js.map - -/***/ }), - -/***/ 11110: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ControlType = void 0; -var ControlType; -(function (ControlType) { - ControlType["Checkbox"] = "Checkbox"; - ControlType["Paragraph"] = "Paragraph"; - ControlType["Button"] = "Button"; - ControlType["SubmitButtonGroup"] = "SubmitButtonGroup"; - ControlType["TextArea"] = "TextArea"; - ControlType["VariableValue"] = "VariableValue"; -})(ControlType = exports.ControlType || (exports.ControlType = {})); -//# sourceMappingURL=form.js.map /***/ }), -/***/ 24542: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 4850: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewGoogleCloudAccount = void 0; -var accountType_1 = __nccwpck_require__(34914); -function NewGoogleCloudAccount(name, jsonKey) { - return { - AccountType: accountType_1.AccountType.GoogleCloudAccount, - JsonKey: jsonKey, - Name: name, - }; -} -exports.NewGoogleCloudAccount = NewGoogleCloudAccount; -//# sourceMappingURL=googleCloudAccountResource.js.map - -/***/ }), - -/***/ 32471: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=identityMetadataResource.js.map /***/ }), -/***/ 20366: -/***/ ((__unused_webpack_module, exports) => { +/***/ 470: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=identityResource.js.map - -/***/ }), - -/***/ 60157: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +var utils = __nccwpck_require__(328); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IdentityType = void 0; -var IdentityType; -(function (IdentityType) { - IdentityType[IdentityType["Guest"] = 0] = "Guest"; - IdentityType[IdentityType["UsernamePassword"] = 1] = "UsernamePassword"; - IdentityType[IdentityType["ActiveDirectory"] = 2] = "ActiveDirectory"; - IdentityType[IdentityType["OAuth"] = 3] = "OAuth"; -})(IdentityType = exports.IdentityType || (exports.IdentityType = {})); -//# sourceMappingURL=identityType.js.map +/** + * Convert a data object to FormData + * @param {Object} obj + * @param {?Object} [formData] + * @returns {Object} + **/ -/***/ }), +function toFormData(obj, formData) { + // eslint-disable-next-line no-param-reassign + formData = formData || new FormData(); -/***/ 74561: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + var stack = []; -"use strict"; + function convertValue(value) { + if (value === null) return ''; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; + if (utils.isDate(value)) { + return value.toISOString(); } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(21843), exports); -__exportStar(__nccwpck_require__(88253), exports); -__exportStar(__nccwpck_require__(35608), exports); -__exportStar(__nccwpck_require__(34914), exports); -__exportStar(__nccwpck_require__(6687), exports); -__exportStar(__nccwpck_require__(7689), exports); -__exportStar(__nccwpck_require__(9801), exports); -__exportStar(__nccwpck_require__(71517), exports); -__exportStar(__nccwpck_require__(6531), exports); -__exportStar(__nccwpck_require__(30597), exports); -__exportStar(__nccwpck_require__(10136), exports); -__exportStar(__nccwpck_require__(9947), exports); -__exportStar(__nccwpck_require__(48998), exports); -__exportStar(__nccwpck_require__(47799), exports); -__exportStar(__nccwpck_require__(34440), exports); -__exportStar(__nccwpck_require__(49241), exports); -__exportStar(__nccwpck_require__(53132), exports); -__exportStar(__nccwpck_require__(56543), exports); -__exportStar(__nccwpck_require__(40407), exports); -__exportStar(__nccwpck_require__(99710), exports); -__exportStar(__nccwpck_require__(34926), exports); -__exportStar(__nccwpck_require__(80778), exports); -__exportStar(__nccwpck_require__(94582), exports); -__exportStar(__nccwpck_require__(30939), exports); -__exportStar(__nccwpck_require__(18304), exports); -__exportStar(__nccwpck_require__(58502), exports); -__exportStar(__nccwpck_require__(16089), exports); -__exportStar(__nccwpck_require__(38639), exports); -__exportStar(__nccwpck_require__(72866), exports); -__exportStar(__nccwpck_require__(64699), exports); -__exportStar(__nccwpck_require__(39349), exports); -__exportStar(__nccwpck_require__(92669), exports); -__exportStar(__nccwpck_require__(27134), exports); -__exportStar(__nccwpck_require__(66707), exports); -__exportStar(__nccwpck_require__(27673), exports); -__exportStar(__nccwpck_require__(60035), exports); -__exportStar(__nccwpck_require__(91173), exports); -__exportStar(__nccwpck_require__(42969), exports); -__exportStar(__nccwpck_require__(33477), exports); -__exportStar(__nccwpck_require__(39021), exports); -__exportStar(__nccwpck_require__(50699), exports); -__exportStar(__nccwpck_require__(94840), exports); -__exportStar(__nccwpck_require__(18754), exports); -__exportStar(__nccwpck_require__(90097), exports); -__exportStar(__nccwpck_require__(52739), exports); -__exportStar(__nccwpck_require__(78766), exports); -__exportStar(__nccwpck_require__(21303), exports); -__exportStar(__nccwpck_require__(3712), exports); -__exportStar(__nccwpck_require__(27734), exports); -__exportStar(__nccwpck_require__(19170), exports); -__exportStar(__nccwpck_require__(99930), exports); -__exportStar(__nccwpck_require__(42546), exports); -__exportStar(__nccwpck_require__(83382), exports); -__exportStar(__nccwpck_require__(20006), exports); -__exportStar(__nccwpck_require__(26289), exports); -__exportStar(__nccwpck_require__(64543), exports); -__exportStar(__nccwpck_require__(88640), exports); -__exportStar(__nccwpck_require__(21706), exports); -__exportStar(__nccwpck_require__(65120), exports); -__exportStar(__nccwpck_require__(60599), exports); -__exportStar(__nccwpck_require__(61676), exports); -__exportStar(__nccwpck_require__(71615), exports); -__exportStar(__nccwpck_require__(26994), exports); -__exportStar(__nccwpck_require__(40633), exports); -__exportStar(__nccwpck_require__(157), exports); -__exportStar(__nccwpck_require__(71976), exports); -__exportStar(__nccwpck_require__(81741), exports); -__exportStar(__nccwpck_require__(10322), exports); -__exportStar(__nccwpck_require__(9042), exports); -__exportStar(__nccwpck_require__(95369), exports); -__exportStar(__nccwpck_require__(48798), exports); -__exportStar(__nccwpck_require__(67788), exports); -__exportStar(__nccwpck_require__(69297), exports); -__exportStar(__nccwpck_require__(33162), exports); -__exportStar(__nccwpck_require__(91606), exports); -__exportStar(__nccwpck_require__(85284), exports); -__exportStar(__nccwpck_require__(36747), exports); -__exportStar(__nccwpck_require__(34830), exports); -__exportStar(__nccwpck_require__(93373), exports); -__exportStar(__nccwpck_require__(34042), exports); -__exportStar(__nccwpck_require__(31719), exports); -__exportStar(__nccwpck_require__(47479), exports); -__exportStar(__nccwpck_require__(78157), exports); -__exportStar(__nccwpck_require__(16470), exports); -__exportStar(__nccwpck_require__(50710), exports); -__exportStar(__nccwpck_require__(27811), exports); -__exportStar(__nccwpck_require__(82718), exports); -__exportStar(__nccwpck_require__(62851), exports); -__exportStar(__nccwpck_require__(28075), exports); -__exportStar(__nccwpck_require__(42769), exports); -__exportStar(__nccwpck_require__(37877), exports); -__exportStar(__nccwpck_require__(30090), exports); -__exportStar(__nccwpck_require__(24542), exports); -__exportStar(__nccwpck_require__(32471), exports); -__exportStar(__nccwpck_require__(20366), exports); -__exportStar(__nccwpck_require__(60157), exports); -__exportStar(__nccwpck_require__(5639), exports); -__exportStar(__nccwpck_require__(90938), exports); -__exportStar(__nccwpck_require__(56196), exports); -__exportStar(__nccwpck_require__(17700), exports); -__exportStar(__nccwpck_require__(3753), exports); -__exportStar(__nccwpck_require__(44688), exports); -__exportStar(__nccwpck_require__(32925), exports); -__exportStar(__nccwpck_require__(27467), exports); -__exportStar(__nccwpck_require__(82025), exports); -__exportStar(__nccwpck_require__(80464), exports); -__exportStar(__nccwpck_require__(92262), exports); -__exportStar(__nccwpck_require__(55847), exports); -__exportStar(__nccwpck_require__(92803), exports); -__exportStar(__nccwpck_require__(97218), exports); -__exportStar(__nccwpck_require__(54085), exports); -__exportStar(__nccwpck_require__(64605), exports); -__exportStar(__nccwpck_require__(95545), exports); -__exportStar(__nccwpck_require__(73927), exports); -__exportStar(__nccwpck_require__(57636), exports); -__exportStar(__nccwpck_require__(93176), exports); -__exportStar(__nccwpck_require__(72150), exports); -__exportStar(__nccwpck_require__(82705), exports); -__exportStar(__nccwpck_require__(59827), exports); -__exportStar(__nccwpck_require__(42463), exports); -__exportStar(__nccwpck_require__(51865), exports); -__exportStar(__nccwpck_require__(52939), exports); -__exportStar(__nccwpck_require__(22110), exports); -__exportStar(__nccwpck_require__(65688), exports); -__exportStar(__nccwpck_require__(72151), exports); -__exportStar(__nccwpck_require__(48920), exports); -__exportStar(__nccwpck_require__(84328), exports); -__exportStar(__nccwpck_require__(58858), exports); -__exportStar(__nccwpck_require__(81935), exports); -__exportStar(__nccwpck_require__(81286), exports); -__exportStar(__nccwpck_require__(12358), exports); -__exportStar(__nccwpck_require__(14239), exports); -__exportStar(__nccwpck_require__(17929), exports); -__exportStar(__nccwpck_require__(2847), exports); -__exportStar(__nccwpck_require__(50671), exports); -__exportStar(__nccwpck_require__(37648), exports); -__exportStar(__nccwpck_require__(35882), exports); -__exportStar(__nccwpck_require__(89010), exports); -__exportStar(__nccwpck_require__(66933), exports); -__exportStar(__nccwpck_require__(20928), exports); -__exportStar(__nccwpck_require__(79856), exports); -__exportStar(__nccwpck_require__(15259), exports); -__exportStar(__nccwpck_require__(60651), exports); -__exportStar(__nccwpck_require__(49346), exports); -__exportStar(__nccwpck_require__(54710), exports); -__exportStar(__nccwpck_require__(81148), exports); -__exportStar(__nccwpck_require__(32771), exports); -__exportStar(__nccwpck_require__(29703), exports); -__exportStar(__nccwpck_require__(70913), exports); -__exportStar(__nccwpck_require__(47875), exports); -__exportStar(__nccwpck_require__(62054), exports); -__exportStar(__nccwpck_require__(29029), exports); -__exportStar(__nccwpck_require__(95699), exports); -__exportStar(__nccwpck_require__(55795), exports); -__exportStar(__nccwpck_require__(24196), exports); -__exportStar(__nccwpck_require__(86630), exports); -__exportStar(__nccwpck_require__(70634), exports); -__exportStar(__nccwpck_require__(89763), exports); -__exportStar(__nccwpck_require__(97446), exports); -__exportStar(__nccwpck_require__(91535), exports); -__exportStar(__nccwpck_require__(40903), exports); -__exportStar(__nccwpck_require__(28620), exports); -__exportStar(__nccwpck_require__(13627), exports); -__exportStar(__nccwpck_require__(35168), exports); -__exportStar(__nccwpck_require__(43924), exports); -__exportStar(__nccwpck_require__(65898), exports); -__exportStar(__nccwpck_require__(91699), exports); -__exportStar(__nccwpck_require__(33437), exports); -__exportStar(__nccwpck_require__(97610), exports); -__exportStar(__nccwpck_require__(80014), exports); -__exportStar(__nccwpck_require__(25462), exports); -__exportStar(__nccwpck_require__(93411), exports); -__exportStar(__nccwpck_require__(22245), exports); -__exportStar(__nccwpck_require__(40496), exports); -__exportStar(__nccwpck_require__(42338), exports); -__exportStar(__nccwpck_require__(95297), exports); -__exportStar(__nccwpck_require__(96286), exports); -__exportStar(__nccwpck_require__(63216), exports); -__exportStar(__nccwpck_require__(62668), exports); -__exportStar(__nccwpck_require__(98411), exports); -__exportStar(__nccwpck_require__(36029), exports); -__exportStar(__nccwpck_require__(5899), exports); -__exportStar(__nccwpck_require__(11400), exports); -__exportStar(__nccwpck_require__(26571), exports); -__exportStar(__nccwpck_require__(19891), exports); -__exportStar(__nccwpck_require__(82034), exports); -__exportStar(__nccwpck_require__(77703), exports); -__exportStar(__nccwpck_require__(47106), exports); -__exportStar(__nccwpck_require__(34703), exports); -__exportStar(__nccwpck_require__(41816), exports); -__exportStar(__nccwpck_require__(24223), exports); -__exportStar(__nccwpck_require__(71606), exports); -__exportStar(__nccwpck_require__(63390), exports); -__exportStar(__nccwpck_require__(19038), exports); -__exportStar(__nccwpck_require__(39849), exports); -__exportStar(__nccwpck_require__(24752), exports); -__exportStar(__nccwpck_require__(54000), exports); -__exportStar(__nccwpck_require__(93704), exports); -__exportStar(__nccwpck_require__(49281), exports); -__exportStar(__nccwpck_require__(20114), exports); -__exportStar(__nccwpck_require__(93060), exports); -__exportStar(__nccwpck_require__(32196), exports); -__exportStar(__nccwpck_require__(82342), exports); -__exportStar(__nccwpck_require__(66197), exports); -__exportStar(__nccwpck_require__(95317), exports); -__exportStar(__nccwpck_require__(64507), exports); -__exportStar(__nccwpck_require__(26498), exports); -__exportStar(__nccwpck_require__(10171), exports); -__exportStar(__nccwpck_require__(37396), exports); -__exportStar(__nccwpck_require__(22152), exports); -__exportStar(__nccwpck_require__(33543), exports); -__exportStar(__nccwpck_require__(94565), exports); -__exportStar(__nccwpck_require__(32841), exports); -__exportStar(__nccwpck_require__(57461), exports); -__exportStar(__nccwpck_require__(24458), exports); -__exportStar(__nccwpck_require__(75507), exports); -__exportStar(__nccwpck_require__(42857), exports); -__exportStar(__nccwpck_require__(19863), exports); -__exportStar(__nccwpck_require__(50606), exports); -__exportStar(__nccwpck_require__(65252), exports); -__exportStar(__nccwpck_require__(51140), exports); -__exportStar(__nccwpck_require__(38664), exports); -__exportStar(__nccwpck_require__(44990), exports); -__exportStar(__nccwpck_require__(30874), exports); -__exportStar(__nccwpck_require__(87516), exports); -__exportStar(__nccwpck_require__(84199), exports); -__exportStar(__nccwpck_require__(84955), exports); -__exportStar(__nccwpck_require__(36445), exports); -__exportStar(__nccwpck_require__(20736), exports); -__exportStar(__nccwpck_require__(54797), exports); -__exportStar(__nccwpck_require__(68517), exports); -__exportStar(__nccwpck_require__(31113), exports); -__exportStar(__nccwpck_require__(67683), exports); -__exportStar(__nccwpck_require__(77693), exports); -__exportStar(__nccwpck_require__(70229), exports); -__exportStar(__nccwpck_require__(34170), exports); -__exportStar(__nccwpck_require__(58574), exports); -__exportStar(__nccwpck_require__(1033), exports); -__exportStar(__nccwpck_require__(30292), exports); -__exportStar(__nccwpck_require__(78010), exports); -__exportStar(__nccwpck_require__(54638), exports); -__exportStar(__nccwpck_require__(41823), exports); -__exportStar(__nccwpck_require__(69838), exports); -__exportStar(__nccwpck_require__(54861), exports); -__exportStar(__nccwpck_require__(45206), exports); -__exportStar(__nccwpck_require__(36604), exports); -__exportStar(__nccwpck_require__(50872), exports); -__exportStar(__nccwpck_require__(24456), exports); -__exportStar(__nccwpck_require__(7151), exports); -__exportStar(__nccwpck_require__(90269), exports); -__exportStar(__nccwpck_require__(32280), exports); -__exportStar(__nccwpck_require__(36186), exports); -__exportStar(__nccwpck_require__(71879), exports); -__exportStar(__nccwpck_require__(71283), exports); -__exportStar(__nccwpck_require__(63823), exports); -__exportStar(__nccwpck_require__(94620), exports); -__exportStar(__nccwpck_require__(82668), exports); -__exportStar(__nccwpck_require__(24090), exports); -__exportStar(__nccwpck_require__(3282), exports); -__exportStar(__nccwpck_require__(99028), exports); -__exportStar(__nccwpck_require__(44021), exports); -__exportStar(__nccwpck_require__(31613), exports); -__exportStar(__nccwpck_require__(48773), exports); -__exportStar(__nccwpck_require__(51578), exports); -__exportStar(__nccwpck_require__(30742), exports); -__exportStar(__nccwpck_require__(17678), exports); -__exportStar(__nccwpck_require__(51496), exports); -//# sourceMappingURL=index.js.map -/***/ }), + if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { + return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } -/***/ 5639: -/***/ ((__unused_webpack_module, exports) => { + return value; + } -"use strict"; + function build(data, parentKey) { + if (utils.isPlainObject(data) || utils.isArray(data)) { + if (stack.indexOf(data) !== -1) { + throw Error('Circular reference detected in ' + parentKey); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=interruptionResource.js.map + stack.push(data); -/***/ }), + utils.forEach(data, function each(value, key) { + if (utils.isUndefined(value)) return; + var fullKey = parentKey ? parentKey + '.' + key : key; + var arr; -/***/ 90938: -/***/ ((__unused_webpack_module, exports) => { + if (value && !parentKey && typeof value === 'object') { + if (utils.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) { + // eslint-disable-next-line func-names + arr.forEach(function(el) { + !utils.isUndefined(el) && formData.append(fullKey, convertValue(el)); + }); + return; + } + } -"use strict"; + build(value, fullKey); + }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=invitationResource.js.map + stack.pop(); + } else { + formData.append(parentKey, convertValue(data)); + } + } -/***/ }), + build(obj); -/***/ 56196: -/***/ ((__unused_webpack_module, exports) => { + return formData; +} -"use strict"; +module.exports = toFormData; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.KubernetesAuthenticationType = void 0; -var KubernetesAuthenticationType; -(function (KubernetesAuthenticationType) { - KubernetesAuthenticationType["KubernetesAws"] = "KubernetesAws"; - KubernetesAuthenticationType["KubernetesAzure"] = "KubernetesAzure"; - KubernetesAuthenticationType["KubernetesCertificate"] = "KubernetesCertificate"; - KubernetesAuthenticationType["KubernetesGoogleCloud"] = "KubernetesGoogleCloud"; - KubernetesAuthenticationType["KubernetesPodServiceAccount"] = "KubernetesPodService"; - KubernetesAuthenticationType["KubernetesStandard"] = "KubernetesStandard"; -})(KubernetesAuthenticationType = exports.KubernetesAuthenticationType || (exports.KubernetesAuthenticationType = {})); -//# sourceMappingURL=kubernetesAuthenticationType.js.map /***/ }), -/***/ 17700: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1632: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=letsEncryptConfigurationResource.js.map -/***/ }), +var VERSION = (__nccwpck_require__(4322).version); +var AxiosError = __nccwpck_require__(2093); -/***/ 3753: -/***/ ((__unused_webpack_module, exports) => { +var validators = {}; -"use strict"; +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=libraryVariableSetResource.js.map +var deprecatedWarnings = {}; -/***/ }), +/** + * Transitional option validator + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } -/***/ 44688: -/***/ ((__unused_webpack_module, exports) => { + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new AxiosError( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + AxiosError.ERR_DEPRECATED + ); + } -"use strict"; + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=libraryVariableSetUsageEntry.js.map + return validator ? validator(value, opt, opts) : true; + }; +}; -/***/ }), +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ -/***/ 32925: -/***/ ((__unused_webpack_module, exports) => { +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + } + } +} -"use strict"; +module.exports = { + assertOptions: assertOptions, + validators: validators +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=libraryVariableSetUsageResource.js.map /***/ }), -/***/ 27467: -/***/ ((__unused_webpack_module, exports) => { +/***/ 328: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=licenseResource.js.map - -/***/ }), - -/***/ 82025: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LicenseMessageDisposition = exports.PermissionsMode = exports.HostingEnvironment = void 0; -var HostingEnvironment; -(function (HostingEnvironment) { - HostingEnvironment["SelfHosted"] = "SelfHosted"; - HostingEnvironment["OctopusCloud"] = "OctopusCloud"; -})(HostingEnvironment = exports.HostingEnvironment || (exports.HostingEnvironment = {})); -var PermissionsMode; -(function (PermissionsMode) { - PermissionsMode["Unspecified"] = "Unspecified"; - PermissionsMode["Restricted"] = "Restricted"; - PermissionsMode["Full"] = "Full"; -})(PermissionsMode = exports.PermissionsMode || (exports.PermissionsMode = {})); -var LicenseMessageDisposition; -(function (LicenseMessageDisposition) { - LicenseMessageDisposition["Information"] = "Information"; - LicenseMessageDisposition["Warning"] = "Warning"; - LicenseMessageDisposition["Error"] = "Error"; -})(LicenseMessageDisposition = exports.LicenseMessageDisposition || (exports.LicenseMessageDisposition = {})); -//# sourceMappingURL=licenseStatusResource.js.map - -/***/ }), - -/***/ 80464: -/***/ ((__unused_webpack_module, exports) => { +var bind = __nccwpck_require__(7065); -"use strict"; +// utils is a library of generic helper functions non-specific to axios -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=lifecycleProgressionResource.js.map +var toString = Object.prototype.toString; -/***/ }), +// eslint-disable-next-line func-names +var kindOf = (function(cache) { + // eslint-disable-next-line func-names + return function(thing) { + var str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); + }; +})(Object.create(null)); -/***/ 92262: -/***/ ((__unused_webpack_module, exports) => { +function kindOfTest(type) { + type = type.toLowerCase(); + return function isKindOf(thing) { + return kindOf(thing) === type; + }; +} -"use strict"; +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return Array.isArray(val); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=lifecycleResource.js.map +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} -/***/ }), +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} -/***/ 55847: -/***/ ((__unused_webpack_module, exports) => { +/** + * Determine if a value is an ArrayBuffer + * + * @function + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +var isArrayBuffer = kindOfTest('ArrayBuffer'); -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=linksCollection.js.map +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} -/***/ }), +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} -/***/ 92803: -/***/ ((__unused_webpack_module, exports) => { +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} -"use strict"; +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=loginCommand.js.map +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (kindOf(val) !== 'object') { + return false; + } -/***/ }), + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} -/***/ 97218: -/***/ ((__unused_webpack_module, exports) => { +/** + * Determine if a value is a Date + * + * @function + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +var isDate = kindOfTest('Date'); -"use strict"; +/** + * Determine if a value is a File + * + * @function + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +var isFile = kindOfTest('File'); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=loginInitiatedResource.js.map +/** + * Determine if a value is a Blob + * + * @function + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +var isBlob = kindOfTest('Blob'); -/***/ }), +/** + * Determine if a value is a FileList + * + * @function + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +var isFileList = kindOfTest('FileList'); -/***/ 54085: -/***/ ((__unused_webpack_module, exports) => { +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} -"use strict"; +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=loginState.js.map +/** + * Determine if a value is a FormData + * + * @param {Object} thing The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(thing) { + var pattern = '[object FormData]'; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || + toString.call(thing) === pattern || + (isFunction(thing.toString) && thing.toString() === pattern) + ); +} -/***/ }), +/** + * Determine if a value is a URLSearchParams object + * @function + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +var isURLSearchParams = kindOfTest('URLSearchParams'); -/***/ 64605: -/***/ ((__unused_webpack_module, exports) => { +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} -"use strict"; +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeleteMachinesBehavior = void 0; -var DeleteMachinesBehavior; -(function (DeleteMachinesBehavior) { - DeleteMachinesBehavior["DoNotDelete"] = "DoNotDelete"; - DeleteMachinesBehavior["DeleteUnavailableMachines"] = "DeleteUnavailableMachines"; -})(DeleteMachinesBehavior = exports.DeleteMachinesBehavior || (exports.DeleteMachinesBehavior = {})); -//# sourceMappingURL=machineCleanupPolicy.js.map +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } -/***/ }), + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } -/***/ 95545: -/***/ ((__unused_webpack_module, exports) => { + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} -"use strict"; +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=machineConnectionStatus.js.map + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} -/***/ }), +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} -/***/ 73927: -/***/ ((__unused_webpack_module, exports) => { +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} -"use strict"; +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachineConnectivityBehavior = void 0; -var MachineConnectivityBehavior; -(function (MachineConnectivityBehavior) { - MachineConnectivityBehavior["ExpectedToBeOnline"] = "ExpectedToBeOnline"; - MachineConnectivityBehavior["MayBeOfflineAndCanBeSkipped"] = "MayBeOfflineAndCanBeSkipped"; -})(MachineConnectivityBehavior = exports.MachineConnectivityBehavior || (exports.MachineConnectivityBehavior = {})); -//# sourceMappingURL=machineConnectivityPolicy.js.map +function inherits(constructor, superConstructor, props, descriptors) { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + props && Object.assign(constructor.prototype, props); +} -/***/ }), +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function} [filter] + * @returns {Object} + */ -/***/ 57636: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +function toFlatObject(sourceObj, destObj, filter) { + var props; + var i; + var prop; + var merged = {}; -"use strict"; + destObj = destObj || {}; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachineFilterResource = void 0; -var triggerFilterResource_1 = __nccwpck_require__(1033); -var triggerFilterType_1 = __nccwpck_require__(30292); -var MachineFilterResource = (function (_super) { - __extends(MachineFilterResource, _super); - function MachineFilterResource() { - var _this = _super.call(this) || this; - _this.EnvironmentIds = undefined; - _this.Roles = undefined; - _this.EventGroups = undefined; - _this.EventCategories = undefined; - _this.FilterType = triggerFilterType_1.TriggerFilterType.MachineFilter; - return _this; + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if (!merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } } - return MachineFilterResource; -}(triggerFilterResource_1.TriggerFilterResource)); -exports.MachineFilterResource = MachineFilterResource; -//# sourceMappingURL=machineFilterResource.js.map - -/***/ }), + sourceObj = Object.getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); -/***/ 93176: -/***/ ((__unused_webpack_module, exports) => { + return destObj; +} -"use strict"; +/* + * determines whether a string ends with the characters of a specified string + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * @returns {boolean} + */ +function endsWith(str, searchString, position) { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + var lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HealthCheckType = void 0; -var HealthCheckType; -(function (HealthCheckType) { - HealthCheckType["RunScript"] = "RunScript"; - HealthCheckType["OnlyConnectivity"] = "OnlyConnectivity"; -})(HealthCheckType = exports.HealthCheckType || (exports.HealthCheckType = {})); -//# sourceMappingURL=machineHealthCheckPolicy.js.map -/***/ }), +/** + * Returns new array from array like object + * @param {*} [thing] + * @returns {Array} + */ +function toArray(thing) { + if (!thing) return null; + var i = thing.length; + if (isUndefined(i)) return null; + var arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +} -/***/ 72150: -/***/ ((__unused_webpack_module, exports) => { +// eslint-disable-next-line func-names +var isTypedArray = (function(TypedArray) { + // eslint-disable-next-line func-names + return function(thing) { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array)); -"use strict"; +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM, + inherits: inherits, + toFlatObject: toFlatObject, + kindOf: kindOf, + kindOfTest: kindOfTest, + endsWith: endsWith, + toArray: toArray, + isTypedArray: isTypedArray, + isFileList: isFileList +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=machinePolicyResource.js.map /***/ }), -/***/ 82705: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3682: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var register = __nccwpck_require__(4670) +var addHook = __nccwpck_require__(5549) +var removeHook = __nccwpck_require__(6819) -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachineModelHealthStatus = exports.NewMachine = void 0; -function NewMachine(name, endpoint) { - return { - IsDisabled: false, - IsInProcess: false, - Endpoint: endpoint, - HealthStatus: MachineModelHealthStatus.Unknown, - Name: name, - HasLatestCalamari: false, - MachinePolicyId: "", - }; -} -exports.NewMachine = NewMachine; -var MachineModelHealthStatus; -(function (MachineModelHealthStatus) { - MachineModelHealthStatus["Healthy"] = "Healthy"; - MachineModelHealthStatus["Unavailable"] = "Unavailable"; - MachineModelHealthStatus["Unknown"] = "Unknown"; - MachineModelHealthStatus["HasWarnings"] = "HasWarnings"; - MachineModelHealthStatus["Unhealthy"] = "Unhealthy"; -})(MachineModelHealthStatus = exports.MachineModelHealthStatus || (exports.MachineModelHealthStatus = {})); -//# sourceMappingURL=machineResource.js.map +// bind with array of arguments: https://stackoverflow.com/a/21792913 +var bind = Function.bind +var bindable = bind.bind(bind) -/***/ }), +function bindApi (hook, state, name) { + var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) + hook.api = { remove: removeHookRef } + hook.remove = removeHookRef -/***/ 59827: -/***/ ((__unused_webpack_module, exports) => { + ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { + var args = name ? [state, kind, name] : [state, kind] + hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) + }) +} -"use strict"; +function HookSingular () { + var singularHookName = 'h' + var singularHookState = { + registry: {} + } + var singularHook = register.bind(null, singularHookState, singularHookName) + bindApi(singularHook, singularHookState, singularHookName) + return singularHook +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=machineScriptPolicy.js.map +function HookCollection () { + var state = { + registry: {} + } -/***/ }), + var hook = register.bind(null, state) + bindApi(hook, state) -/***/ 42463: -/***/ ((__unused_webpack_module, exports) => { + return hook +} -"use strict"; +var collectionHookDeprecationMessageDisplayed = false +function Hook () { + if (!collectionHookDeprecationMessageDisplayed) { + console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') + collectionHookDeprecationMessageDisplayed = true + } + return HookCollection() +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TentacleUpdateBehavior = exports.CalamariUpdateBehavior = void 0; -var CalamariUpdateBehavior; -(function (CalamariUpdateBehavior) { - CalamariUpdateBehavior["UpdateOnDeployment"] = "UpdateOnDeployment"; - CalamariUpdateBehavior["UpdateOnNewMachine"] = "UpdateOnNewMachine"; - CalamariUpdateBehavior["UpdateAlways"] = "UpdateAlways"; -})(CalamariUpdateBehavior = exports.CalamariUpdateBehavior || (exports.CalamariUpdateBehavior = {})); -var TentacleUpdateBehavior; -(function (TentacleUpdateBehavior) { - TentacleUpdateBehavior["NeverUpdate"] = "NeverUpdate"; - TentacleUpdateBehavior["Update"] = "Update"; -})(TentacleUpdateBehavior = exports.TentacleUpdateBehavior || (exports.TentacleUpdateBehavior = {})); -//# sourceMappingURL=machineUpdatePolicy.js.map - -/***/ }), - -/***/ 51865: -/***/ ((__unused_webpack_module, exports) => { +Hook.Singular = HookSingular.bind() +Hook.Collection = HookCollection.bind() -"use strict"; +module.exports = Hook +// expose constructors as a named property for TypeScript +module.exports.Hook = Hook +module.exports.Singular = Hook.Singular +module.exports.Collection = Hook.Collection -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=maintenanceConfigurationResource.js.map /***/ }), -/***/ 52939: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=multiTenancyStatusResource.js.map +/***/ 5549: +/***/ ((module) => { -/***/ }), +module.exports = addHook; -/***/ 22110: -/***/ ((__unused_webpack_module, exports) => { +function addHook(state, kind, name, hook) { + var orig = hook; + if (!state.registry[name]) { + state.registry[name] = []; + } -"use strict"; + if (kind === "before") { + hook = function (method, options) { + return Promise.resolve() + .then(orig.bind(null, options)) + .then(method.bind(null, options)); + }; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=namedReferenceItem.js.map - -/***/ }), + if (kind === "after") { + hook = function (method, options) { + var result; + return Promise.resolve() + .then(method.bind(null, options)) + .then(function (result_) { + result = result_; + return orig(result, options); + }) + .then(function () { + return result; + }); + }; + } -/***/ 65688: -/***/ ((__unused_webpack_module, exports) => { + if (kind === "error") { + hook = function (method, options) { + return Promise.resolve() + .then(method.bind(null, options)) + .catch(function (error) { + return orig(error, options); + }); + }; + } -"use strict"; + state.registry[name].push({ + hook: hook, + orig: orig, + }); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=namedResource.js.map /***/ }), -/***/ 72151: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 4670: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=nonVcsRunbookResource.js.map +module.exports = register; -/***/ }), +function register(state, name, method, options) { + if (typeof method !== "function") { + throw new Error("method for before hook must be a function"); + } -/***/ 48920: -/***/ (function(__unused_webpack_module, exports) { + if (!options) { + options = {}; + } -"use strict"; + if (Array.isArray(name)) { + return name.reverse().reduce(function (callback, name) { + return register.bind(null, state, name, callback, options); + }, method)(); + } -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 = (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 })); -exports.OctopusError = void 0; -var OctopusError = (function (_super) { - __extends(OctopusError, _super); - function OctopusError(StatusCode, message) { - var _this = _super.call(this, message) || this; - _this.StatusCode = StatusCode; - _this.ErrorMessage = message; - _this.Errors = []; - Object.setPrototypeOf(_this, OctopusError.prototype); - return _this; + return Promise.resolve().then(function () { + if (!state.registry[name]) { + return method(options); } - OctopusError.create = function (statusCode, response) { - var e = new OctopusError(statusCode); - var n = __assign(__assign({}, e), response); - Object.setPrototypeOf(n, OctopusError.prototype); - return n; - }; - return OctopusError; -}(Error)); -exports.OctopusError = OctopusError; -//# sourceMappingURL=octopusError.js.map - -/***/ }), - -/***/ 84328: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=octopusProjectFeedResource.js.map - -/***/ }), -/***/ 58858: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + return state.registry[name].reduce(function (method, registered) { + return registered.hook.bind(null, method, options); + }, method)(); + }); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=octopusServerClusterSummaryResource.js.map /***/ }), -/***/ 81935: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6819: +/***/ ((module) => { -"use strict"; +module.exports = removeHook; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=octopusServerNodeDetailsResource.js.map +function removeHook(state, name, method) { + if (!state.registry[name]) { + return; + } -/***/ }), + var index = state.registry[name] + .map(function (registered) { + return registered.orig; + }) + .indexOf(method); -/***/ 81286: -/***/ ((__unused_webpack_module, exports) => { + if (index === -1) { + return; + } -"use strict"; + state.registry[name].splice(index, 1); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=octopusServerNodeResource.js.map /***/ }), -/***/ 12358: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5443: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var util = __nccwpck_require__(3837); +var Stream = (__nccwpck_require__(2781).Stream); +var DelayedStream = __nccwpck_require__(8611); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=octopusServerNodeSummaryResource.js.map +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; -/***/ }), + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; +} +util.inherits(CombinedStream, Stream); -/***/ 14239: -/***/ (function(__unused_webpack_module, exports) { +CombinedStream.create = function(options) { + var combinedStream = new this(); -"use strict"; + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } -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); + return combinedStream; }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createWarningsFromOctopusWarning = void 0; -function createWarningsFromOctopusWarning(warning) { - return { - message: warning.WarningMessage, - warnings: warning.Warnings || [], - parsedHelpLinks: warning.ParsedHelpLinks, - helpLink: warning.HelpLink, - helpText: warning.HelpText, - fieldWarnings: {}, - details: flattenWarningDetails(warning.Details), - }; -} -exports.createWarningsFromOctopusWarning = createWarningsFromOctopusWarning; -function joinWarningEntries(parentKey, entry) { - if (entry === void 0) { entry = {}; } - return Object.keys(entry).reduce(function (prev, key) { - var _a; - return (__assign(__assign({}, prev), (_a = {}, _a["".concat(parentKey, ":").concat(key)] = entry[key].join(", "), _a))); - }, {}); -} -function flattenWarningDetails(details) { - if (details === void 0) { details = {}; } - return Object.keys(details).reduce(function (prev, parentKey) { return (__assign(__assign({}, prev), joinWarningEntries(parentKey, details[parentKey]))); }, {}); -} -//# sourceMappingURL=octopusValidationResponse.js.map -/***/ }), +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; -/***/ 17929: -/***/ ((__unused_webpack_module, exports) => { +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); -"use strict"; + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=offlineDropDestinationResource.js.map + this._handleErrors(stream); -/***/ }), + if (this.pauseStreams) { + stream.pause(); + } + } -/***/ 2847: -/***/ ((__unused_webpack_module, exports) => { + this._streams.push(stream); + return this; +}; -"use strict"; +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OfflineDropDestinationType = void 0; -var OfflineDropDestinationType; -(function (OfflineDropDestinationType) { - OfflineDropDestinationType["Artifact"] = "Artifact"; - OfflineDropDestinationType["FileSystem"] = "FileSystem"; -})(OfflineDropDestinationType = exports.OfflineDropDestinationType || (exports.OfflineDropDestinationType = {})); -//# sourceMappingURL=offlineDropDestinationType.js.map +CombinedStream.prototype._getNext = function() { + this._currentStream = null; -/***/ }), + if (this._insideLoop) { + this._pendingNext = true; + return; // defer call + } -/***/ 50671: -/***/ ((__unused_webpack_module, exports) => { + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } +}; -"use strict"; +CombinedStream.prototype._realGetNext = function() { + var stream = this._streams.shift(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=onboardingResource.js.map -/***/ }), + if (typeof stream == 'undefined') { + this.end(); + return; + } -/***/ 37648: -/***/ ((__unused_webpack_module, exports) => { + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } -"use strict"; + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PackageAcquisitionLocation = void 0; -var PackageAcquisitionLocation; -(function (PackageAcquisitionLocation) { - PackageAcquisitionLocation["Server"] = "Server"; - PackageAcquisitionLocation["ExecutionTarget"] = "ExecutionTarget"; - PackageAcquisitionLocation["NotAcquired"] = "NotAcquired"; -})(PackageAcquisitionLocation = exports.PackageAcquisitionLocation || (exports.PackageAcquisitionLocation = {})); -//# sourceMappingURL=packageAcquisitionLocation.js.map + this._pipeNext(stream); + }.bind(this)); +}; -/***/ }), +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; -/***/ 35882: -/***/ ((__unused_webpack_module, exports) => { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } -"use strict"; + var value = stream; + this.write(value); + this._getNext(); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=packageDescriptionResource.js.map +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; -/***/ }), +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; -/***/ 89010: -/***/ ((__unused_webpack_module, exports) => { +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } -"use strict"; + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=packageFromBuiltInFeedResource.js.map +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } -/***/ }), + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; -/***/ 66933: -/***/ ((__unused_webpack_module, exports) => { +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); +}; -"use strict"; +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PackageSelectionMode = void 0; -var PackageSelectionMode; -(function (PackageSelectionMode) { - PackageSelectionMode["Immediate"] = "immediate"; - PackageSelectionMode["Deferred"] = "deferred"; -})(PackageSelectionMode = exports.PackageSelectionMode || (exports.PackageSelectionMode = {})); -//# sourceMappingURL=packageReference.js.map +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; +}; -/***/ }), +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } -/***/ 20928: -/***/ ((__unused_webpack_module, exports) => { + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); +}; -"use strict"; +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=packageResource.js.map + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } -/***/ }), + self.dataSize += stream.dataSize; + }); -/***/ 79856: -/***/ ((__unused_webpack_module, exports) => { + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; -"use strict"; +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=packageVersionResource.js.map /***/ }), -/***/ 15259: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8222: +/***/ ((module, exports, __nccwpck_require__) => { -"use strict"; +/* eslint-env browser */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=pagingCollection.js.map +/** + * This is the web browser implementation of `debug()`. + */ -/***/ }), +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; -/***/ 60651: -/***/ ((__unused_webpack_module, exports) => { + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); -"use strict"; +/** + * Colors. + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DashboardRenderMode = void 0; -var DashboardRenderMode; -(function (DashboardRenderMode) { - DashboardRenderMode["VirtualizeColumns"] = "VirtualizeColumns"; - DashboardRenderMode["VirtualizeRowsAndColumns"] = "VirtualizeRowsAndColumns"; -})(DashboardRenderMode = exports.DashboardRenderMode || (exports.DashboardRenderMode = {})); -//# sourceMappingURL=performanceConfigurationResource.js.map +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; -/***/ }), +/** + * 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 + */ -/***/ 49346: -/***/ ((__unused_webpack_module, exports) => { +// eslint-disable-next-line complexity +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' || window.process.__nwjs)) { + return true; + } -"use strict"; + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Permission = void 0; -var Permission; -(function (Permission) { - Permission["None"] = "None"; - Permission["AccountCreate"] = "AccountCreate"; - Permission["AccountDelete"] = "AccountDelete"; - Permission["AccountEdit"] = "AccountEdit"; - Permission["AccountView"] = "AccountView"; - Permission["ActionTemplateCreate"] = "ActionTemplateCreate"; - Permission["ActionTemplateDelete"] = "ActionTemplateDelete"; - Permission["ActionTemplateEdit"] = "ActionTemplateEdit"; - Permission["ActionTemplateView"] = "ActionTemplateView"; - Permission["AdministerSystem"] = "AdministerSystem"; - Permission["ArtifactCreate"] = "ArtifactCreate"; - Permission["ArtifactDelete"] = "ArtifactDelete"; - Permission["ArtifactEdit"] = "ArtifactEdit"; - Permission["ArtifactView"] = "ArtifactView"; - Permission["BuildInformationAdminister"] = "BuildInformationAdminister"; - Permission["BuildInformationPush"] = "BuildInformationPush"; - Permission["BuiltInFeedAdminister"] = "BuiltInFeedAdminister"; - Permission["BuiltInFeedDownload"] = "BuiltInFeedDownload"; - Permission["BuiltInFeedPush"] = "BuiltInFeedPush"; - Permission["CertificateCreate"] = "CertificateCreate"; - Permission["CertificateDelete"] = "CertificateDelete"; - Permission["CertificateEdit"] = "CertificateEdit"; - Permission["CertificateView"] = "CertificateView"; - Permission["CertificateExportPrivateKey"] = "CertificateExportPrivateKey"; - Permission["ConfigureServer"] = "ConfigureServer"; - Permission["DefectReport"] = "DefectReport"; - Permission["DefectResolve"] = "DefectResolve"; - Permission["DeploymentCreate"] = "DeploymentCreate"; - Permission["DeploymentDelete"] = "DeploymentDelete"; - Permission["DeploymentView"] = "DeploymentView"; - Permission["EnvironmentCreate"] = "EnvironmentCreate"; - Permission["EnvironmentDelete"] = "EnvironmentDelete"; - Permission["EnvironmentEdit"] = "EnvironmentEdit"; - Permission["EnvironmentView"] = "EnvironmentView"; - Permission["EventView"] = "EventView"; - Permission["FeedEdit"] = "FeedEdit"; - Permission["FeedView"] = "FeedView"; - Permission["InterruptionSubmit"] = "InterruptionSubmit"; - Permission["InterruptionView"] = "InterruptionView"; - Permission["InterruptionViewSubmitResponsible"] = "InterruptionViewSubmitResponsible"; - Permission["LibraryVariableSetCreate"] = "LibraryVariableSetCreate"; - Permission["LibraryVariableSetDelete"] = "LibraryVariableSetDelete"; - Permission["LibraryVariableSetEdit"] = "LibraryVariableSetEdit"; - Permission["LibraryVariableSetView"] = "LibraryVariableSetView"; - Permission["LifecycleCreate"] = "LifecycleCreate"; - Permission["LifecycleDelete"] = "LifecycleDelete"; - Permission["LifecycleEdit"] = "LifecycleEdit"; - Permission["LifecycleView"] = "LifecycleView"; - Permission["ReleaseCreate"] = "ReleaseCreate"; - Permission["ReleaseView"] = "ReleaseView"; - Permission["ReleaseEdit"] = "ReleaseEdit"; - Permission["ReleaseDelete"] = "ReleaseDelete"; - Permission["MachineCreate"] = "MachineCreate"; - Permission["MachineEdit"] = "MachineEdit"; - Permission["MachineView"] = "MachineView"; - Permission["MachineDelete"] = "MachineDelete"; - Permission["MachinePolicyCreate"] = "MachinePolicyCreate"; - Permission["MachinePolicyDelete"] = "MachinePolicyDelete"; - Permission["MachinePolicyEdit"] = "MachinePolicyEdit"; - Permission["MachinePolicyView"] = "MachinePolicyView"; - Permission["ProjectGroupCreate"] = "ProjectGroupCreate"; - Permission["ProjectGroupDelete"] = "ProjectGroupDelete"; - Permission["ProjectGroupEdit"] = "ProjectGroupEdit"; - Permission["ProjectGroupView"] = "ProjectGroupView"; - Permission["TenantCreate"] = "TenantCreate"; - Permission["TenantDelete"] = "TenantDelete"; - Permission["TenantEdit"] = "TenantEdit"; - Permission["TenantView"] = "TenantView"; - Permission["TagSetCreate"] = "TagSetCreate"; - Permission["TagSetDelete"] = "TagSetDelete"; - Permission["TagSetEdit"] = "TagSetEdit"; - Permission["ProcessEdit"] = "ProcessEdit"; - Permission["ProcessView"] = "ProcessView"; - Permission["ProjectCreate"] = "ProjectCreate"; - Permission["ProjectDelete"] = "ProjectDelete"; - Permission["ProjectEdit"] = "ProjectEdit"; - Permission["ProjectView"] = "ProjectView"; - Permission["ProxyCreate"] = "ProxyCreate"; - Permission["ProxyDelete"] = "ProxyDelete"; - Permission["ProxyEdit"] = "ProxyEdit"; - Permission["ProxyView"] = "ProxyView"; - Permission["RunbookEdit"] = "RunbookEdit"; - Permission["RunbookView"] = "RunbookView"; - Permission["RunbookRunCreate"] = "RunbookRunCreate"; - Permission["RunbookRunEdit"] = "RunbookRunEdit"; - Permission["RunbookRunView"] = "RunbookRunView"; - Permission["SpaceCreate"] = "SpaceCreate"; - Permission["SpaceDelete"] = "SpaceDelete"; - Permission["SpaceEdit"] = "SpaceEdit"; - Permission["SpaceView"] = "SpaceView"; - Permission["SubscriptionCreate"] = "SubscriptionCreate"; - Permission["SubscriptionDelete"] = "SubscriptionDelete"; - Permission["SubscriptionEdit"] = "SubscriptionEdit"; - Permission["SubscriptionView"] = "SubscriptionView"; - Permission["TaskCancel"] = "TaskCancel"; - Permission["TaskCreate"] = "TaskCreate"; - Permission["TaskEdit"] = "TaskEdit"; - Permission["TaskView"] = "TaskView"; - Permission["TeamCreate"] = "TeamCreate"; - Permission["TeamDelete"] = "TeamDelete"; - Permission["TeamEdit"] = "TeamEdit"; - Permission["TeamView"] = "TeamView"; - Permission["TriggerCreate"] = "TriggerCreate"; - Permission["TriggerDelete"] = "TriggerDelete"; - Permission["TriggerEdit"] = "TriggerEdit"; - Permission["TriggerView"] = "TriggerView"; - Permission["UserEdit"] = "UserEdit"; - Permission["UserInvite"] = "UserInvite"; - Permission["UserView"] = "UserView"; - Permission["UserRoleEdit"] = "UserRoleEdit"; - Permission["UserRoleView"] = "UserRoleView"; - Permission["VariableEdit"] = "VariableEdit"; - Permission["VariableEditUnscoped"] = "VariableEditUnscoped"; - Permission["VariableView"] = "VariableView"; - Permission["VariableViewUnscoped"] = "VariableViewUnscoped"; - Permission["WorkerEdit"] = "WorkerEdit"; - Permission["WorkerView"] = "WorkerView"; -})(Permission = exports.Permission || (exports.Permission = {})); -//# sourceMappingURL=permission.js.map + // 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+)/)); +} -/***/ }), +/** + * Colorize log arguments if enabled. + * + * @api public + */ -/***/ 54710: -/***/ ((__unused_webpack_module, exports) => { +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); -"use strict"; + if (!this.useColors) { + return; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=permissionDescriptions.js.map + const 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 + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); -/***/ 81148: -/***/ ((__unused_webpack_module, exports) => { + args.splice(lastC, 0, c); +} -"use strict"; +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=phaseResource.js.map +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} -/***/ }), +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } -/***/ 32771: -/***/ ((__unused_webpack_module, exports) => { + // 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; + } -"use strict"; + return r; +} -var _a; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProcessTypeAliasMap = exports.ProcessType = void 0; -var ProcessType; -(function (ProcessType) { - ProcessType["Deployment"] = "Deployment"; - ProcessType["Runbook"] = "Runbook"; -})(ProcessType = exports.ProcessType || (exports.ProcessType = {})); -exports.ProcessTypeAliasMap = (_a = {}, - _a[ProcessType.Deployment] = { - alias: { - noun: "deployment", - verb: "deploy", - plural: "deployments", - pastTense: "deployed", - preposition: "to", - }, - manifest: "Release", - }, - _a[ProcessType.Runbook] = { - alias: { - noun: "runbook", - verb: "run", - plural: "runs", - pastTense: "ran", - preposition: "on", - }, - manifest: "Snapshot", - }, - _a); -//# sourceMappingURL=processType.js.map +/** + * 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 { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} -/***/ 29703: -/***/ ((__unused_webpack_module, exports) => { +module.exports = __nccwpck_require__(6243)(exports); -"use strict"; +const {formatters} = module.exports; + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=progressionResource.js.map /***/ }), -/***/ 47875: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6243: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectExportRequest.js.map +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ -/***/ }), +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __nccwpck_require__(900); + createDebug.destroy = destroy; -/***/ 62054: -/***/ ((__unused_webpack_module, exports) => { + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); -"use strict"; + /** + * The currently active debug mode names, and names to skip. + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectExportResponse.js.map + createDebug.names = []; + createDebug.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". + */ + createDebug.formatters = {}; -/***/ 29029: -/***/ ((__unused_webpack_module, exports) => { + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; -"use strict"; + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectGroupResource.js.map + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; -/***/ }), + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; -/***/ 95699: -/***/ ((__unused_webpack_module, exports) => { + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } -"use strict"; + const self = debug; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectImportFile.js.map + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; -/***/ }), + args[0] = createDebug.coerce(args[0]); -/***/ 55795: -/***/ ((__unused_webpack_module, exports) => { + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } -"use strict"; + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectImportFileListResponse.js.map + // 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.) + createDebug.formatArgs.call(self, args); -/***/ 24196: -/***/ ((__unused_webpack_module, exports) => { + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } -"use strict"; + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectImportPreviewRequest.js.map + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } -/***/ }), + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); -/***/ 86630: -/***/ ((__unused_webpack_module, exports) => { + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } -"use strict"; + return debug; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectImportPreviewResponse.js.map + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } -/***/ }), + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; -/***/ 70634: -/***/ ((__unused_webpack_module, exports) => { + createDebug.names = []; + createDebug.skips = []; -"use strict"; + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectImportRequest.js.map + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } -/***/ }), + namespaces = split[i].replace(/\*/g, '.*?'); -/***/ 89763: -/***/ ((__unused_webpack_module, exports) => { + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } -"use strict"; + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectImportResponse.js.map + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } -/***/ }), + let i; + let len; -/***/ 97446: -/***/ ((__unused_webpack_module, exports) => { + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } -"use strict"; + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getBranchNameFromRouteParameter = exports.getURISafeBranchName = exports.isVcsBranchResource = exports.NewProject = exports.HasVersionControlledPersistenceSettings = exports.HasVcsProjectResourceLinks = exports.IsUsingUsernamePasswordAuth = exports.AuthenticationType = exports.PersistenceSettingsType = void 0; -var PersistenceSettingsType; -(function (PersistenceSettingsType) { - PersistenceSettingsType["VersionControlled"] = "VersionControlled"; - PersistenceSettingsType["Database"] = "Database"; -})(PersistenceSettingsType = exports.PersistenceSettingsType || (exports.PersistenceSettingsType = {})); -var AuthenticationType; -(function (AuthenticationType) { - AuthenticationType["Anonymous"] = "Anonymous"; - AuthenticationType["UsernamePassword"] = "UsernamePassword"; -})(AuthenticationType = exports.AuthenticationType || (exports.AuthenticationType = {})); -function IsUsingUsernamePasswordAuth(T) { - return (T.Type === - AuthenticationType.UsernamePassword); -} -exports.IsUsingUsernamePasswordAuth = IsUsingUsernamePasswordAuth; -function HasVcsProjectResourceLinks(links) { - return links.Branches !== undefined; -} -exports.HasVcsProjectResourceLinks = HasVcsProjectResourceLinks; -function HasVersionControlledPersistenceSettings(T) { - return T.Type === PersistenceSettingsType.VersionControlled; -} -exports.HasVersionControlledPersistenceSettings = HasVersionControlledPersistenceSettings; -function NewProject(name, projectGroup, lifecycle) { - return { - LifecycleId: lifecycle.Id, - Name: name, - ProjectGroupId: projectGroup.Id, - }; -} -exports.NewProject = NewProject; -function isVcsBranchResource(branch) { - return branch.Name !== undefined; -} -exports.isVcsBranchResource = isVcsBranchResource; -function getURISafeBranchName(branch) { - return encodeURIComponent(branch.Name); -} -exports.getURISafeBranchName = getURISafeBranchName; -function getBranchNameFromRouteParameter(routeParameter) { - if (routeParameter) { - return decodeURIComponent(routeParameter); - } - return undefined; -} -exports.getBranchNameFromRouteParameter = getBranchNameFromRouteParameter; -//# sourceMappingURL=projectResource.js.map + return false; + } -/***/ }), + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } -/***/ 91535: -/***/ ((__unused_webpack_module, exports) => { + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } -"use strict"; + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; +} + +module.exports = setup; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectSummary.js.map /***/ }), -/***/ 40903: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8237: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = __nccwpck_require__(8222); +} else { + module.exports = __nccwpck_require__(4874); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectUsage.js.map /***/ }), -/***/ 70913: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4874: +/***/ ((module, exports, __nccwpck_require__) => { -"use strict"; +/** + * Module dependencies. + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectedTeamReferenceDataItem.js.map +const tty = __nccwpck_require__(6224); +const util = __nccwpck_require__(3837); -/***/ }), +/** + * This is the Node.js implementation of `debug()`. + */ -/***/ 28620: -/***/ ((__unused_webpack_module, exports) => { +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); -"use strict"; +/** + * Colors. + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isSensitiveValue = exports.NewSensitiveValue = void 0; -function NewSensitiveValue(value, hint) { - return { - HasValue: true, - Hint: hint, - NewValue: value, - }; -} -exports.NewSensitiveValue = NewSensitiveValue; -function isSensitiveValue(value) { - if (typeof value === "string" || value === null) { - return false; - } - return Object.prototype.hasOwnProperty.call(value, "HasValue"); -} -exports.isSensitiveValue = isSensitiveValue; -//# sourceMappingURL=propertyValueResource.js.map +exports.colors = [6, 2, 3, 4, 5, 1]; -/***/ }), +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = __nccwpck_require__(9318); -/***/ 13627: -/***/ ((__unused_webpack_module, exports) => { + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} -"use strict"; +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=proxyResource.js.map +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); -/***/ }), + // Coerce string value into JS value + let 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); + } -/***/ 35168: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + obj[prop] = val; + return obj; +}, {}); -"use strict"; +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isProcessReferenceDataItem = void 0; -var utils_1 = __nccwpck_require__(12765); -function isProcessReferenceDataItem(item) { - if (!item) { - return false; - } - var converted = item; - return (0, utils_1.isPropertyDefinedAndNotNull)(converted, "ProcessType"); +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); } -exports.isProcessReferenceDataItem = isProcessReferenceDataItem; -//# sourceMappingURL=referenceDataItem.js.map -/***/ }), +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ -/***/ 43924: -/***/ ((__unused_webpack_module, exports) => { +function formatArgs(args) { + const {namespace: name, useColors} = this; -"use strict"; + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releaseChanges.js.map + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} -/***/ }), +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} -/***/ 65898: -/***/ ((__unused_webpack_module, exports) => { +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ -"use strict"; +function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releasePackageVersionBuildInformation.js.map +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // 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; + } +} -/***/ }), +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ -/***/ 91699: -/***/ ((__unused_webpack_module, exports) => { +function load() { + return process.env.DEBUG; +} -"use strict"; +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releasePackageVersionBuildInformationResource.js.map +function init(debug) { + debug.inspectOpts = {}; -/***/ }), + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} -/***/ 33437: -/***/ ((__unused_webpack_module, exports) => { +module.exports = __nccwpck_require__(6243)(exports); -"use strict"; +const {formatters} = module.exports; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releaseProgressionResource.js.map +/** + * Map %o to `util.inspect()`, all on a single line. + */ -/***/ }), +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; -/***/ 97610: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ -"use strict"; +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isRunbookSnapshotResource = exports.isReleaseResource = void 0; -var utils_1 = __nccwpck_require__(12765); -function isReleaseResource(resource) { - if (resource === undefined || resource === null) { - return false; - } - var converted = resource; - return (converted.Version !== undefined && - (0, utils_1.typeSafeHasOwnProperty)(converted, "Version")); -} -exports.isReleaseResource = isReleaseResource; -function isRunbookSnapshotResource(resource) { - if (resource === undefined || resource === null) { - return false; - } - var converted = resource; - return (converted.Name !== undefined && (0, utils_1.typeSafeHasOwnProperty)(converted, "Name")); -} -exports.isRunbookSnapshotResource = isRunbookSnapshotResource; -//# sourceMappingURL=releaseResource.js.map /***/ }), -/***/ 80014: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8611: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var Stream = (__nccwpck_require__(2781).Stream); +var util = __nccwpck_require__(3837); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releaseTemplateResource.js.map +module.exports = DelayedStream; +function DelayedStream() { + this.source = null; + this.dataSize = 0; + this.maxDataSize = 1024 * 1024; + this.pauseStream = true; -/***/ }), + this._maxDataSizeExceeded = false; + this._released = false; + this._bufferedEvents = []; +} +util.inherits(DelayedStream, Stream); -/***/ 25462: -/***/ ((__unused_webpack_module, exports) => { +DelayedStream.create = function(source, options) { + var delayedStream = new this(); -"use strict"; + options = options || {}; + for (var option in options) { + delayedStream[option] = options[option]; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releaseUsage.js.map + delayedStream.source = source; -/***/ }), + var realEmit = source.emit; + source.emit = function() { + delayedStream._handleEmit(arguments); + return realEmit.apply(source, arguments); + }; -/***/ 93411: -/***/ ((__unused_webpack_module, exports) => { + source.on('error', function() {}); + if (delayedStream.pauseStream) { + source.pause(); + } -"use strict"; + return delayedStream; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releaseUsageEntry.js.map +Object.defineProperty(DelayedStream.prototype, 'readable', { + configurable: true, + enumerable: true, + get: function() { + return this.source.readable; + } +}); -/***/ }), +DelayedStream.prototype.setEncoding = function() { + return this.source.setEncoding.apply(this.source, arguments); +}; -/***/ 22245: -/***/ ((__unused_webpack_module, exports) => { +DelayedStream.prototype.resume = function() { + if (!this._released) { + this.release(); + } -"use strict"; + this.source.resume(); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=resource.js.map +DelayedStream.prototype.pause = function() { + this.source.pause(); +}; -/***/ }), +DelayedStream.prototype.release = function() { + this._released = true; -/***/ 40496: -/***/ ((__unused_webpack_module, exports) => { + this._bufferedEvents.forEach(function(args) { + this.emit.apply(this, args); + }.bind(this)); + this._bufferedEvents = []; +}; -"use strict"; +DelayedStream.prototype.pipe = function() { + var r = Stream.prototype.pipe.apply(this, arguments); + this.resume(); + return r; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=resourceCollection.js.map +DelayedStream.prototype._handleEmit = function(args) { + if (this._released) { + this.emit.apply(this, args); + return; + } -/***/ }), + if (args[0] === 'data') { + this.dataSize += args[1].length; + this._checkIfMaxDataSizeExceeded(); + } -/***/ 42338: -/***/ ((__unused_webpack_module, exports) => { + this._bufferedEvents.push(args); +}; -"use strict"; +DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { + if (this._maxDataSizeExceeded) { + return; + } + + if (this.dataSize <= this.maxDataSize) { + return; + } + + this._maxDataSizeExceeded = true; + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' + this.emit('error', new Error(message)); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=resourceCollectionLinks.js.map /***/ }), -/***/ 95297: +/***/ 8932: /***/ ((__unused_webpack_module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=retentionDefaultConfigurationResource.js.map -/***/ }), +Object.defineProperty(exports, "__esModule", ({ value: true })); -/***/ 96286: -/***/ ((__unused_webpack_module, exports) => { +class Deprecation extends Error { + constructor(message) { + super(message); // Maintains proper stack trace (only available on V8) -"use strict"; + /* istanbul ignore next */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RetentionUnit = void 0; -var RetentionUnit; -(function (RetentionUnit) { - RetentionUnit["Days"] = "Days"; - RetentionUnit["Items"] = "Items"; -})(RetentionUnit = exports.RetentionUnit || (exports.RetentionUnit = {})); -//# sourceMappingURL=retentionPeriod.js.map + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } -/***/ }), + this.name = 'Deprecation'; + } -/***/ 63216: -/***/ ((__unused_webpack_module, exports) => { +} -"use strict"; +exports.Deprecation = Deprecation; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=rootResource.js.map /***/ }), -/***/ 41816: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1133: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunConditionForAction = void 0; -var RunConditionForAction; -(function (RunConditionForAction) { - RunConditionForAction["Success"] = "Success"; - RunConditionForAction["Variable"] = "Variable"; -})(RunConditionForAction = exports.RunConditionForAction || (exports.RunConditionForAction = {})); -//# sourceMappingURL=runConditionForAction.js.map - -/***/ }), - -/***/ 62668: -/***/ ((__unused_webpack_module, exports) => { +var debug; -"use strict"; +module.exports = function () { + if (!debug) { + try { + /* eslint global-require: off */ + debug = __nccwpck_require__(8237)("follow-redirects"); + } + catch (error) { /* */ } + if (typeof debug !== "function") { + debug = function () { /* */ }; + } + } + debug.apply(null, arguments); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunbookEnvironmentScope = void 0; -var RunbookEnvironmentScope; -(function (RunbookEnvironmentScope) { - RunbookEnvironmentScope["All"] = "All"; - RunbookEnvironmentScope["Specified"] = "Specified"; - RunbookEnvironmentScope["FromProjectLifecycles"] = "FromProjectLifecycles"; -})(RunbookEnvironmentScope = exports.RunbookEnvironmentScope || (exports.RunbookEnvironmentScope = {})); -//# sourceMappingURL=runbookEnvironmentScope.js.map /***/ }), -/***/ 98411: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookProcessResource.js.map - -/***/ }), +/***/ 7707: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ 36029: -/***/ ((__unused_webpack_module, exports) => { +var url = __nccwpck_require__(7310); +var URL = url.URL; +var http = __nccwpck_require__(3685); +var https = __nccwpck_require__(5687); +var Writable = (__nccwpck_require__(2781).Writable); +var assert = __nccwpck_require__(9491); +var debug = __nccwpck_require__(1133); -"use strict"; +// Create handlers that pass events from native requests +var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; +var eventHandlers = Object.create(null); +events.forEach(function (event) { + eventHandlers[event] = function (arg1, arg2, arg3) { + this._redirectable.emit(event, arg1, arg2, arg3); + }; +}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookProgressionResource.js.map +var InvalidUrlError = createErrorType( + "ERR_INVALID_URL", + "Invalid URL", + TypeError +); +// Error types with codes +var RedirectionError = createErrorType( + "ERR_FR_REDIRECTION_FAILURE", + "Redirected request failed" +); +var TooManyRedirectsError = createErrorType( + "ERR_FR_TOO_MANY_REDIRECTS", + "Maximum number of redirects exceeded" +); +var MaxBodyLengthExceededError = createErrorType( + "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", + "Request body larger than maxBodyLength limit" +); +var WriteAfterEndError = createErrorType( + "ERR_STREAM_WRITE_AFTER_END", + "write after end" +); -/***/ }), +// An HTTP(S) request that can be redirected +function RedirectableRequest(options, responseCallback) { + // Initialize the request + Writable.call(this); + this._sanitizeOptions(options); + this._options = options; + this._ended = false; + this._ending = false; + this._redirectCount = 0; + this._redirects = []; + this._requestBodyLength = 0; + this._requestBodyBuffers = []; -/***/ 5899: -/***/ ((__unused_webpack_module, exports) => { + // Attach a callback if passed + if (responseCallback) { + this.on("response", responseCallback); + } -"use strict"; + // React to responses of native requests + var self = this; + this._onNativeResponse = function (response) { + self._processResponse(response); + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IsNonVcsRunbook = void 0; -function IsNonVcsRunbook(runbook) { - return runbook.ProjectId !== undefined; + // Perform the first request + this._performRequest(); } -exports.IsNonVcsRunbook = IsNonVcsRunbook; -//# sourceMappingURL=runbookResource.js.map - -/***/ }), - -/***/ 11400: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookResourceLinks.js.map - -/***/ }), - -/***/ 26571: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunbookRunParameters = void 0; -var RunbookRunParameters = (function () { - function RunbookRunParameters() { - this.EnvironmentIds = []; - this.ExcludedMachineIds = []; - this.ForcePackageDownload = false; - this.SkipActions = []; - this.SpecificMachineIds = []; - this.UseDefaultSnapshot = true; - } - RunbookRunParameters.MapFrom = function (runbookRun) { - var _a, _b, _c; - return { - EnvironmentId: runbookRun.EnvironmentId, - ExcludedMachineIds: runbookRun.ExcludedMachineIds != null ? runbookRun.ExcludedMachineIds : [], - ForcePackageDownload: runbookRun.ForcePackageDownload, - FormValues: (_a = runbookRun.FormValues) !== null && _a !== void 0 ? _a : {}, - ProjectId: runbookRun.ProjectId, - QueueTime: (_b = runbookRun.QueueTime) === null || _b === void 0 ? void 0 : _b.toString(), - QueueTimeExpiry: (_c = runbookRun.QueueTimeExpiry) === null || _c === void 0 ? void 0 : _c.toString(), - RunbookId: runbookRun.RunbookId, - SkipActions: runbookRun.SkipActions != null ? runbookRun.SkipActions : [], - SpecificMachineIds: runbookRun.SpecificMachineIds != null ? runbookRun.SpecificMachineIds : [], - TenantId: runbookRun.TenantId, - UseDefaultSnapshot: true, - UseGuidedFailure: runbookRun.UseGuidedFailure, - }; - }; - return RunbookRunParameters; -}()); -exports.RunbookRunParameters = RunbookRunParameters; -//# sourceMappingURL=runbookRunParameters.js.map - -/***/ }), - -/***/ 19891: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +RedirectableRequest.prototype = Object.create(Writable.prototype); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookRunResource.js.map +RedirectableRequest.prototype.abort = function () { + abortRequest(this._currentRequest); + this.emit("abort"); +}; -/***/ }), +// Writes buffered data to the current native request +RedirectableRequest.prototype.write = function (data, encoding, callback) { + // Writing is not allowed if end has been called + if (this._ending) { + throw new WriteAfterEndError(); + } -/***/ 82034: -/***/ ((__unused_webpack_module, exports) => { + // Validate input and shift parameters if necessary + if (!isString(data) && !isBuffer(data)) { + throw new TypeError("data should be a string, Buffer or Uint8Array"); + } + if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } -"use strict"; + // Ignore empty buffers, since writing them doesn't invoke the callback + // https://github.com/nodejs/node/issues/22066 + if (data.length === 0) { + if (callback) { + callback(); + } + return; + } + // Only write when we don't exceed the maximum body length + if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { + this._requestBodyLength += data.length; + this._requestBodyBuffers.push({ data: data, encoding: encoding }); + this._currentRequest.write(data, encoding, callback); + } + // Error when we exceed the maximum body length + else { + this.emit("error", new MaxBodyLengthExceededError()); + this.abort(); + } +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookRunTemplateResource.js.map +// Ends the current native request +RedirectableRequest.prototype.end = function (data, encoding, callback) { + // Shift parameters if necessary + if (isFunction(data)) { + callback = data; + data = encoding = null; + } + else if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } -/***/ }), + // Write data if needed and end + if (!data) { + this._ended = this._ending = true; + this._currentRequest.end(null, null, callback); + } + else { + var self = this; + var currentRequest = this._currentRequest; + this.write(data, encoding, function () { + self._ended = true; + currentRequest.end(null, null, callback); + }); + this._ending = true; + } +}; -/***/ 47106: -/***/ ((__unused_webpack_module, exports) => { +// Sets a header value on the current native request +RedirectableRequest.prototype.setHeader = function (name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); +}; -"use strict"; +// Clears a header value on the current native request +RedirectableRequest.prototype.removeHeader = function (name) { + delete this._options.headers[name]; + this._currentRequest.removeHeader(name); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookSnapshotResource.js.map +// Global timeout for all underlying requests +RedirectableRequest.prototype.setTimeout = function (msecs, callback) { + var self = this; -/***/ }), + // Destroys the socket on timeout + function destroyOnTimeout(socket) { + socket.setTimeout(msecs); + socket.removeListener("timeout", socket.destroy); + socket.addListener("timeout", socket.destroy); + } -/***/ 34703: -/***/ ((__unused_webpack_module, exports) => { + // Sets up a timer to trigger a timeout event + function startTimer(socket) { + if (self._timeout) { + clearTimeout(self._timeout); + } + self._timeout = setTimeout(function () { + self.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); + } -"use strict"; + // Stops a timeout from triggering + function clearTimer() { + // Clear the timeout + if (self._timeout) { + clearTimeout(self._timeout); + self._timeout = null; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookSnapshotTemplateResource.js.map + // Clean up all attached listeners + self.removeListener("abort", clearTimer); + self.removeListener("error", clearTimer); + self.removeListener("response", clearTimer); + if (callback) { + self.removeListener("timeout", callback); + } + if (!self.socket) { + self._currentRequest.removeListener("socket", startTimer); + } + } -/***/ }), + // Attach callback if passed + if (callback) { + this.on("timeout", callback); + } -/***/ 77703: -/***/ ((__unused_webpack_module, exports) => { + // Start the timer if or when the socket is opened + if (this.socket) { + startTimer(this.socket); + } + else { + this._currentRequest.once("socket", startTimer); + } -"use strict"; + // Clean up on events + this.on("socket", destroyOnTimeout); + this.on("abort", clearTimer); + this.on("error", clearTimer); + this.on("response", clearTimer); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbooksDashboardItemResource.js.map + return this; +}; -/***/ }), +// Proxy all other public ClientRequest methods +[ + "flushHeaders", "getHeader", + "setNoDelay", "setSocketKeepAlive", +].forEach(function (method) { + RedirectableRequest.prototype[method] = function (a, b) { + return this._currentRequest[method](a, b); + }; +}); -/***/ 24223: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +// Proxy all public ClientRequest properties +["aborted", "connection", "socket"].forEach(function (property) { + Object.defineProperty(RedirectableRequest.prototype, property, { + get: function () { return this._currentRequest[property]; }, + }); +}); -"use strict"; +RedirectableRequest.prototype._sanitizeOptions = function (options) { + // Ensure headers are always present + if (!options.headers) { + options.headers = {}; + } -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunRunbookActionResource = exports.ScheduleIntervalResource = exports.DeployNewReleaseActionResource = exports.DeployLatestReleaseActionResource = exports.ScopedDeploymentActionResource = exports.CronTriggerScheduleResource = exports.DaysPerMonthTriggerScheduleResource = exports.ContinuousDailyTriggerScheduleResource = exports.OnceDailyTriggerScheduleResource = exports.TriggerScheduleIntervalResource = exports.TriggerScheduleResource = void 0; -var triggerActionResource_1 = __nccwpck_require__(59636); -var triggerActionType_1 = __nccwpck_require__(58574); -var triggerFilterResource_1 = __nccwpck_require__(1033); -var triggerFilterType_1 = __nccwpck_require__(30292); -var triggerScheduleIntervalType_1 = __nccwpck_require__(81599); -var TriggerScheduleResource = (function (_super) { - __extends(TriggerScheduleResource, _super); - function TriggerScheduleResource() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.Timezone = undefined; - return _this; - } - return TriggerScheduleResource; -}(triggerFilterResource_1.TriggerFilterResource)); -exports.TriggerScheduleResource = TriggerScheduleResource; -var TriggerScheduleIntervalResource = (function () { - function TriggerScheduleIntervalResource() { - this.Interval = triggerScheduleIntervalType_1.TriggerScheduleIntervalType.OnceDaily; - } - return TriggerScheduleIntervalResource; -}()); -exports.TriggerScheduleIntervalResource = TriggerScheduleIntervalResource; -var OnceDailyTriggerScheduleResource = (function (_super) { - __extends(OnceDailyTriggerScheduleResource, _super); - function OnceDailyTriggerScheduleResource() { - var _this = _super.call(this) || this; - _this.StartTime = undefined; - _this.DaysOfWeek = undefined; - _this.FilterType = triggerFilterType_1.TriggerFilterType.OnceDailySchedule; - return _this; - } - return OnceDailyTriggerScheduleResource; -}(TriggerScheduleResource)); -exports.OnceDailyTriggerScheduleResource = OnceDailyTriggerScheduleResource; -var ContinuousDailyTriggerScheduleResource = (function (_super) { - __extends(ContinuousDailyTriggerScheduleResource, _super); - function ContinuousDailyTriggerScheduleResource() { - var _this = _super.call(this) || this; - _this.RunAfter = undefined; - _this.RunUntil = undefined; - _this.Interval = triggerScheduleIntervalType_1.TriggerScheduleIntervalType.OnceHourly; - _this.DaysOfWeek = undefined; - _this.FilterType = triggerFilterType_1.TriggerFilterType.ContinuousDailySchedule; - return _this; - } - return ContinuousDailyTriggerScheduleResource; -}(TriggerScheduleResource)); -exports.ContinuousDailyTriggerScheduleResource = ContinuousDailyTriggerScheduleResource; -var DaysPerMonthTriggerScheduleResource = (function (_super) { - __extends(DaysPerMonthTriggerScheduleResource, _super); - function DaysPerMonthTriggerScheduleResource() { - var _this = _super.call(this) || this; - _this.StartTime = undefined; - _this.MonthlyScheduleType = undefined; - _this.DayOfWeek = undefined; - _this.FilterType = triggerFilterType_1.TriggerFilterType.DaysPerMonthSchedule; - return _this; - } - return DaysPerMonthTriggerScheduleResource; -}(TriggerScheduleResource)); -exports.DaysPerMonthTriggerScheduleResource = DaysPerMonthTriggerScheduleResource; -var CronTriggerScheduleResource = (function (_super) { - __extends(CronTriggerScheduleResource, _super); - function CronTriggerScheduleResource() { - var _this = _super.call(this) || this; - _this.CronExpression = undefined; - _this.FilterType = triggerFilterType_1.TriggerFilterType.CronExpressionSchedule; - return _this; - } - return CronTriggerScheduleResource; -}(TriggerScheduleResource)); -exports.CronTriggerScheduleResource = CronTriggerScheduleResource; -var ScopedDeploymentActionResource = (function (_super) { - __extends(ScopedDeploymentActionResource, _super); - function ScopedDeploymentActionResource() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.ChannelId = undefined; - _this.TenantIds = []; - _this.TenantTags = []; - _this.Variables = undefined; - return _this; - } - return ScopedDeploymentActionResource; -}(triggerActionResource_1.TriggerActionResource)); -exports.ScopedDeploymentActionResource = ScopedDeploymentActionResource; -var DeployLatestReleaseActionResource = (function (_super) { - __extends(DeployLatestReleaseActionResource, _super); - function DeployLatestReleaseActionResource() { - var _this = _super.call(this) || this; - _this.DestinationEnvironmentId = undefined; - _this.ActionType = triggerActionType_1.TriggerActionType.DeployLatestRelease; - _this.ShouldRedeployWhenReleaseIsCurrent = true; - _this.SourceEnvironmentIds = []; - return _this; - } - return DeployLatestReleaseActionResource; -}(ScopedDeploymentActionResource)); -exports.DeployLatestReleaseActionResource = DeployLatestReleaseActionResource; -var DeployNewReleaseActionResource = (function (_super) { - __extends(DeployNewReleaseActionResource, _super); - function DeployNewReleaseActionResource() { - var _this = _super.call(this) || this; - _this.EnvironmentId = undefined; - _this.VersionControlReference = undefined; - _this.ActionType = triggerActionType_1.TriggerActionType.DeployNewRelease; - return _this; + // Since http.request treats host as an alias of hostname, + // but the url module interprets host as hostname plus port, + // eliminate the host property to avoid confusion. + if (options.host) { + // Use hostname if set, because it has precedence + if (!options.hostname) { + options.hostname = options.host; } - return DeployNewReleaseActionResource; -}(ScopedDeploymentActionResource)); -exports.DeployNewReleaseActionResource = DeployNewReleaseActionResource; -var ScheduleIntervalResource = (function () { - function ScheduleIntervalResource() { - this.IntervalType = undefined; - this.IntervalValue = undefined; + delete options.host; + } + + // Complete the URL object when necessary + if (!options.pathname && options.path) { + var searchPos = options.path.indexOf("?"); + if (searchPos < 0) { + options.pathname = options.path; } - return ScheduleIntervalResource; -}()); -exports.ScheduleIntervalResource = ScheduleIntervalResource; -var RunRunbookActionResource = (function (_super) { - __extends(RunRunbookActionResource, _super); - function RunRunbookActionResource() { - var _this = _super.call(this) || this; - _this.EnvironmentIds = undefined; - _this.RunbookId = undefined; - _this.TenantIds = []; - _this.TenantTags = []; - _this.ActionType = triggerActionType_1.TriggerActionType.RunRunbook; - return _this; + else { + options.pathname = options.path.substring(0, searchPos); + options.search = options.path.substring(searchPos); } - return RunRunbookActionResource; -}(triggerActionResource_1.TriggerActionResource)); -exports.RunRunbookActionResource = RunRunbookActionResource; -//# sourceMappingURL=scheduledProjectTriggerResource.js.map - -/***/ }), + } +}; -/***/ 71606: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +// Executes the next native request (initial or redirect) +RedirectableRequest.prototype._performRequest = function () { + // Load the native protocol + var protocol = this._options.protocol; + var nativeProtocol = this._options.nativeProtocols[protocol]; + if (!nativeProtocol) { + this.emit("error", new TypeError("Unsupported protocol " + protocol)); + return; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scheduledTaskDetailsResource.js.map + // If specified, use the agent corresponding to the protocol + // (HTTP and HTTPS use different types of agents) + if (this._options.agents) { + var scheme = protocol.slice(0, -1); + this._options.agent = this._options.agents[scheme]; + } -/***/ }), + // Create the native request and set up its event handlers + var request = this._currentRequest = + nativeProtocol.request(this._options, this._onNativeResponse); + request._redirectable = this; + for (var event of events) { + request.on(event, eventHandlers[event]); + } -/***/ 19038: -/***/ ((__unused_webpack_module, exports) => { + // RFC7230§5.3.1: When making a request directly to an origin server, […] + // a client MUST send only the absolute path […] as the request-target. + this._currentUrl = /^\//.test(this._options.path) ? + url.format(this._options) : + // When making a request to a proxy, […] + // a client MUST send the target URI in absolute-form […]. + this._options.path; -"use strict"; + // End a redirected request + // (The first request must be ended explicitly with RedirectableRequest#end) + if (this._isRedirect) { + // Write the request entity and end + var i = 0; + var self = this; + var buffers = this._requestBodyBuffers; + (function writeNext(error) { + // Only write if this request has not been redirected yet + /* istanbul ignore else */ + if (request === self._currentRequest) { + // Report any write errors + /* istanbul ignore if */ + if (error) { + self.emit("error", error); + } + // Write the next buffer if there are still left + else if (i < buffers.length) { + var buffer = buffers[i++]; + /* istanbul ignore else */ + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); + } + } + // End the request if `end` has been called on us + else if (self._ended) { + request.end(); + } + } + }()); + } +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scopeSpecificationTypes.js.map +// Processes a response from the current native request +RedirectableRequest.prototype._processResponse = function (response) { + // Store the redirected response + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode: statusCode, + }); + } -/***/ }), + // RFC7231§6.4: The 3xx (Redirection) class of status code indicates + // that further action needs to be taken by the user agent in order to + // fulfill the request. If a Location header field is provided, + // the user agent MAY automatically redirect its request to the URI + // referenced by the Location field value, + // even if the specific status code is not understood. -/***/ 39849: -/***/ ((__unused_webpack_module, exports) => { + // If the response is not a redirect; return it as-is + var location = response.headers.location; + if (!location || this._options.followRedirects === false || + statusCode < 300 || statusCode >= 400) { + response.responseUrl = this._currentUrl; + response.redirects = this._redirects; + this.emit("response", response); -"use strict"; + // Clean up + this._requestBodyBuffers = []; + return; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scopeValues.js.map + // The response is a redirect, so abort the current request + abortRequest(this._currentRequest); + // Discard the remainder of the response to avoid waiting for data + response.destroy(); -/***/ }), + // RFC7231§6.4: A client SHOULD detect and intervene + // in cyclical redirections (i.e., "infinite" redirection loops). + if (++this._redirectCount > this._options.maxRedirects) { + this.emit("error", new TooManyRedirectsError()); + return; + } -/***/ 63390: -/***/ ((__unused_webpack_module, exports) => { + // Store the request headers if applicable + var requestHeaders; + var beforeRedirect = this._options.beforeRedirect; + if (beforeRedirect) { + requestHeaders = Object.assign({ + // The Host header was set by nativeProtocol.request + Host: response.req.getHeader("host"), + }, this._options.headers); + } -"use strict"; + // RFC7231§6.4: Automatic redirection needs to done with + // care for methods not known to be safe, […] + // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change + // the request method from POST to GET for the subsequent request. + var method = this._options.method; + if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || + // RFC7231§6.4.4: The 303 (See Other) status code indicates that + // the server is redirecting the user agent to a different resource […] + // A user agent can perform a retrieval request targeting that URI + // (a GET or HEAD request if using HTTP) […] + (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { + this._options.method = "GET"; + // Drop a possible entity and headers related to it + this._requestBodyBuffers = []; + removeMatchingHeaders(/^content-/i, this._options.headers); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scopedUserRoleResource.js.map + // Drop the Host header, as the redirect might lead to a different host + var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); -/***/ }), + // If the redirect is relative, carry over the host of the last request + var currentUrlParts = url.parse(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : + url.format(Object.assign(currentUrlParts, { host: currentHost })); -/***/ 24752: -/***/ ((__unused_webpack_module, exports) => { + // Determine the URL of the redirection + var redirectUrl; + try { + redirectUrl = url.resolve(currentUrl, location); + } + catch (cause) { + this.emit("error", new RedirectionError({ cause: cause })); + return; + } -"use strict"; + // Create the redirected request + debug("redirecting to", redirectUrl); + this._isRedirect = true; + var redirectUrlParts = url.parse(redirectUrl); + Object.assign(this._options, redirectUrlParts); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ScriptingLanguage = void 0; -var ScriptingLanguage; -(function (ScriptingLanguage) { - ScriptingLanguage["Bash"] = "Bash"; - ScriptingLanguage["CSharp"] = "CSharp"; - ScriptingLanguage["FSharp"] = "FSharp"; - ScriptingLanguage["PowerShell"] = "PowerShell"; - ScriptingLanguage["Python"] = "Python"; -})(ScriptingLanguage = exports.ScriptingLanguage || (exports.ScriptingLanguage = {})); -//# sourceMappingURL=scriptingLanguage.js.map + // Drop confidential headers when redirecting to a less secure protocol + // or to a different domain that is not a superdomain + if (redirectUrlParts.protocol !== currentUrlParts.protocol && + redirectUrlParts.protocol !== "https:" || + redirectUrlParts.host !== currentHost && + !isSubdomain(redirectUrlParts.host, currentHost)) { + removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); + } -/***/ }), + // Evaluate the beforeRedirect callback + if (isFunction(beforeRedirect)) { + var responseDetails = { + headers: response.headers, + statusCode: statusCode, + }; + var requestDetails = { + url: currentUrl, + method: method, + headers: requestHeaders, + }; + try { + beforeRedirect(this._options, responseDetails, requestDetails); + } + catch (err) { + this.emit("error", err); + return; + } + this._sanitizeOptions(this._options); + } -/***/ 54000: -/***/ ((__unused_webpack_module, exports) => { + // Perform the redirected request + try { + this._performRequest(); + } + catch (cause) { + this.emit("error", new RedirectionError({ cause: cause })); + } +}; -"use strict"; +// Wraps the key/value object of protocols with redirect functionality +function wrap(protocols) { + // Default settings + var exports = { + maxRedirects: 21, + maxBodyLength: 10 * 1024 * 1024, + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=serverConfigurationResource.js.map + // Wrap each protocol + var nativeProtocols = {}; + Object.keys(protocols).forEach(function (scheme) { + var protocol = scheme + ":"; + var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; + var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); -/***/ }), + // Executes a request, following redirects + function request(input, options, callback) { + // Parse parameters + if (isString(input)) { + var parsed; + try { + parsed = urlToOptions(new URL(input)); + } + catch (err) { + /* istanbul ignore next */ + parsed = url.parse(input); + } + if (!isString(parsed.protocol)) { + throw new InvalidUrlError({ input }); + } + input = parsed; + } + else if (URL && (input instanceof URL)) { + input = urlToOptions(input); + } + else { + callback = options; + options = input; + input = { protocol: protocol }; + } + if (isFunction(options)) { + callback = options; + options = null; + } -/***/ 93704: -/***/ ((__unused_webpack_module, exports) => { + // Set defaults + options = Object.assign({ + maxRedirects: exports.maxRedirects, + maxBodyLength: exports.maxBodyLength, + }, input, options); + options.nativeProtocols = nativeProtocols; + if (!isString(options.host) && !isString(options.hostname)) { + options.hostname = "::1"; + } -"use strict"; + assert.equal(options.protocol, protocol, "protocol mismatch"); + debug("options", options); + return new RedirectableRequest(options, callback); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=serverConfigurationSettingsSetResource.js.map + // Executes a GET request, following redirects + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; + } -/***/ }), + // Expose the properties on the wrapped protocol + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true }, + }); + }); + return exports; +} -/***/ 49281: -/***/ ((__unused_webpack_module, exports) => { +/* istanbul ignore next */ +function noop() { /* empty */ } -"use strict"; +// from https://github.com/nodejs/node/blob/master/lib/internal/url.js +function urlToOptions(urlObject) { + var options = { + protocol: urlObject.protocol, + hostname: urlObject.hostname.startsWith("[") ? + /* istanbul ignore next */ + urlObject.hostname.slice(1, -1) : + urlObject.hostname, + hash: urlObject.hash, + search: urlObject.search, + pathname: urlObject.pathname, + path: urlObject.pathname + urlObject.search, + href: urlObject.href, + }; + if (urlObject.port !== "") { + options.port = Number(urlObject.port); + } + return options; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=serverDocumentCount.js.map +function removeMatchingHeaders(regex, headers) { + var lastValue; + for (var header in headers) { + if (regex.test(header)) { + lastValue = headers[header]; + delete headers[header]; + } + } + return (lastValue === null || typeof lastValue === "undefined") ? + undefined : String(lastValue).trim(); +} -/***/ }), +function createErrorType(code, message, baseClass) { + // Create constructor + function CustomError(properties) { + Error.captureStackTrace(this, this.constructor); + Object.assign(this, properties || {}); + this.code = code; + this.message = this.cause ? message + ": " + this.cause.message : message; + } -/***/ 20114: -/***/ ((__unused_webpack_module, exports) => { + // Attach constructor and set default properties + CustomError.prototype = new (baseClass || Error)(); + CustomError.prototype.constructor = CustomError; + CustomError.prototype.name = "Error [" + code + "]"; + return CustomError; +} -"use strict"; +function abortRequest(request) { + for (var event of events) { + request.removeListener(event, eventHandlers[event]); + } + request.on("error", noop); + request.abort(); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=serverStatusHealthResource.js.map +function isSubdomain(subdomain, domain) { + assert(isString(subdomain) && isString(domain)); + var dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); +} -/***/ }), +function isString(value) { + return typeof value === "string" || value instanceof String; +} -/***/ 93060: -/***/ ((__unused_webpack_module, exports) => { +function isFunction(value) { + return typeof value === "function"; +} -"use strict"; +function isBuffer(value) { + return typeof value === "object" && ("length" in value); +} + +// Exports +module.exports = wrap({ http: http, https: https }); +module.exports.wrap = wrap; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=serverStatusResource.js.map /***/ }), -/***/ 32196: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4334: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var CombinedStream = __nccwpck_require__(5443); +var util = __nccwpck_require__(3837); +var path = __nccwpck_require__(1017); +var http = __nccwpck_require__(3685); +var https = __nccwpck_require__(5687); +var parseUrl = (__nccwpck_require__(7310).parse); +var fs = __nccwpck_require__(7147); +var Stream = (__nccwpck_require__(2781).Stream); +var mime = __nccwpck_require__(3583); +var asynckit = __nccwpck_require__(4812); +var populate = __nccwpck_require__(7142); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=serverTimezoneResource.js.map +// Public API +module.exports = FormData; -/***/ }), +// make it a Stream +util.inherits(FormData, CombinedStream); -/***/ 82342: -/***/ ((__unused_webpack_module, exports) => { +/** + * Create readable "multipart/form-data" streams. + * Can be used to submit forms + * and file uploads to other web applications. + * + * @constructor + * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream + */ +function FormData(options) { + if (!(this instanceof FormData)) { + return new FormData(options); + } -"use strict"; + this._overheadLength = 0; + this._valueLength = 0; + this._valuesToMeasure = []; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=settingsMetadataResource.js.map + CombinedStream.call(this); -/***/ }), + options = options || {}; + for (var option in options) { + this[option] = options[option]; + } +} -/***/ 66197: -/***/ ((__unused_webpack_module, exports) => { +FormData.LINE_BREAK = '\r\n'; +FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; -"use strict"; +FormData.prototype.append = function(field, value, options) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=settingsValuesResource.js.map + options = options || {}; -/***/ }), + // allow filename as single option + if (typeof options == 'string') { + options = {filename: options}; + } -/***/ 95317: -/***/ ((__unused_webpack_module, exports) => { + var append = CombinedStream.prototype.append.bind(this); -"use strict"; + // all that streamy business can't handle numbers + if (typeof value == 'number') { + value = '' + value; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=smtpConfigurationResource.js.map + // https://github.com/felixge/node-form-data/issues/38 + if (util.isArray(value)) { + // Please convert your array into string + // the way web server expects it + this._error(new Error('Arrays are not supported.')); + return; + } -/***/ }), + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(); -/***/ 64507: -/***/ ((__unused_webpack_module, exports) => { + append(header); + append(value); + append(footer); -"use strict"; + // pass along options.knownLength + this._trackLength(header, value, options); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=smtpIsConfiguredResource.js.map +FormData.prototype._trackLength = function(header, value, options) { + var valueLength = 0; -/***/ }), + // used w/ getLengthSync(), when length is known. + // e.g. for streaming directly from a remote server, + // w/ a known file a size, and not wanting to wait for + // incoming file to finish to get its size. + if (options.knownLength != null) { + valueLength += +options.knownLength; + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === 'string') { + valueLength = Buffer.byteLength(value); + } -/***/ 26498: -/***/ ((__unused_webpack_module, exports) => { + this._valueLength += valueLength; -"use strict"; + // @check why add CRLF? does this account for custom/multiple CRLFs? + this._overheadLength += + Buffer.byteLength(header) + + FormData.LINE_BREAK.length; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewSpace = void 0; -function NewSpace(name, spaceManagersTeams, spaceManagersTeamMembers) { - return { - Name: name, - SpaceManagersTeams: spaceManagersTeams === null || spaceManagersTeams === void 0 ? void 0 : spaceManagersTeams.map(function (t) { return t.Id; }), - SpaceManagersTeamMembers: spaceManagersTeamMembers === null || spaceManagersTeamMembers === void 0 ? void 0 : spaceManagersTeamMembers.map(function (u) { return u.Id; }), - }; -} -exports.NewSpace = NewSpace; -//# sourceMappingURL=spaceResource.js.map + // empty or either doesn't have path or not an http response or not a stream + if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) { + return; + } -/***/ }), + // no need to bother with the length + if (!options.knownLength) { + this._valuesToMeasure.push(value); + } +}; -/***/ 10171: -/***/ ((__unused_webpack_module, exports) => { +FormData.prototype._lengthRetriever = function(value, callback) { -"use strict"; + if (value.hasOwnProperty('fd')) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=spaceRootResource.js.map + // take read range into a account + // `end` = Infinity –> read file till the end + // + // TODO: Looks like there is bug in Node fs.createReadStream + // it doesn't respect `end` options without `start` options + // Fix it when node fixes it. + // https://github.com/joyent/node/issues/7819 + if (value.end != undefined && value.end != Infinity && value.start != undefined) { -/***/ }), + // when end specified + // no need to calculate range + // inclusive, starts with 0 + callback(null, value.end + 1 - (value.start ? value.start : 0)); -/***/ 37396: -/***/ ((__unused_webpack_module, exports) => { + // not that fast snoopy + } else { + // still need to fetch file size from fs + fs.stat(value.path, function(err, stat) { -"use strict"; + var fileSize; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=spaceScopedResource.js.map + if (err) { + callback(err); + return; + } -/***/ }), + // update final size based on the range options + fileSize = stat.size - (value.start ? value.start : 0); + callback(null, fileSize); + }); + } -/***/ 22152: -/***/ ((__unused_webpack_module, exports) => { + // or http response + } else if (value.hasOwnProperty('httpVersion')) { + callback(null, +value.headers['content-length']); -"use strict"; + // or request stream http://github.com/mikeal/request + } else if (value.hasOwnProperty('httpModule')) { + // wait till response come back + value.on('response', function(response) { + value.pause(); + callback(null, +response.headers['content-length']); + }); + value.resume(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=spaceSearchResult.js.map + // something else + } else { + callback('Unknown stream'); + } +}; -/***/ }), +FormData.prototype._multiPartHeader = function(field, value, options) { + // custom header specified (as string)? + // it becomes responsible for boundary + // (e.g. to handle extra CRLFs on .NET servers) + if (typeof options.header == 'string') { + return options.header; + } -/***/ 33543: -/***/ ((__unused_webpack_module, exports) => { + var contentDisposition = this._getContentDisposition(value, options); + var contentType = this._getContentType(value, options); -"use strict"; + var contents = ''; + var headers = { + // add custom disposition as third element or keep it two elements if not + 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + 'Content-Type': [].concat(contentType || []) + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=sshEndpointResource.js.map + // allow custom headers. + if (typeof options.header == 'object') { + populate(headers, options.header); + } -/***/ }), + var header; + for (var prop in headers) { + if (!headers.hasOwnProperty(prop)) continue; + header = headers[prop]; -/***/ 94565: -/***/ ((__unused_webpack_module, exports) => { + // skip nullish headers. + if (header == null) { + continue; + } -"use strict"; + // convert all headers to arrays. + if (!Array.isArray(header)) { + header = [header]; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=sshKeyPairAccountResource.js.map + // add non-empty headers. + if (header.length) { + contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; + } + } -/***/ }), + return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; +}; -/***/ 32841: -/***/ ((__unused_webpack_module, exports) => { +FormData.prototype._getContentDisposition = function(value, options) { -"use strict"; + var filename + , contentDisposition + ; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=stepPackage.js.map + if (typeof options.filepath === 'string') { + // custom filepath for relative paths + filename = path.normalize(options.filepath).replace(/\\/g, '/'); + } else if (options.filename || value.name || value.path) { + // custom filename take precedence + // formidable and the browser add a name property + // fs- and request- streams have path property + filename = path.basename(options.filename || value.name || value.path); + } else if (value.readable && value.hasOwnProperty('httpVersion')) { + // or try http response + filename = path.basename(value.client._httpMessage.path || ''); + } -/***/ }), + if (filename) { + contentDisposition = 'filename="' + filename + '"'; + } -/***/ 57461: -/***/ ((__unused_webpack_module, exports) => { + return contentDisposition; +}; -"use strict"; +FormData.prototype._getContentType = function(value, options) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=stepPackageDeploymentTargetType.js.map + // use custom content-type above all + var contentType = options.contentType; -/***/ }), + // or try `name` from formidable, browser + if (!contentType && value.name) { + contentType = mime.lookup(value.name); + } -/***/ 24458: -/***/ ((__unused_webpack_module, exports) => { + // or try `path` from fs-, request- streams + if (!contentType && value.path) { + contentType = mime.lookup(value.path); + } -"use strict"; + // or if it's http-reponse + if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { + contentType = value.headers['content-type']; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isStepPackageEndpointResource = void 0; -function isStepPackageEndpointResource(resource) { - return "StepPackageId" in resource && "DeploymentTargetTypeId" in resource; -} -exports.isStepPackageEndpointResource = isStepPackageEndpointResource; -//# sourceMappingURL=stepPackageEndpointResource.js.map + // or guess it from the filepath or filename + if (!contentType && (options.filepath || options.filename)) { + contentType = mime.lookup(options.filepath || options.filename); + } -/***/ }), + // fallback to the default content type if `value` is not simple value + if (!contentType && typeof value == 'object') { + contentType = FormData.DEFAULT_CONTENT_TYPE; + } -/***/ 75507: -/***/ ((__unused_webpack_module, exports) => { + return contentType; +}; -"use strict"; +FormData.prototype._multiPartFooter = function() { + return function(next) { + var footer = FormData.LINE_BREAK; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=stepPackageLinks.js.map + var lastPart = (this._streams.length === 0); + if (lastPart) { + footer += this._lastBoundary(); + } -/***/ }), + next(footer); + }.bind(this); +}; -/***/ 42857: -/***/ ((__unused_webpack_module, exports) => { +FormData.prototype._lastBoundary = function() { + return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; +}; -"use strict"; +FormData.prototype.getHeaders = function(userHeaders) { + var header; + var formHeaders = { + 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=stepUsage.js.map + for (header in userHeaders) { + if (userHeaders.hasOwnProperty(header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } + } -/***/ }), + return formHeaders; +}; -/***/ 19863: -/***/ ((__unused_webpack_module, exports) => { +FormData.prototype.setBoundary = function(boundary) { + this._boundary = boundary; +}; -"use strict"; +FormData.prototype.getBoundary = function() { + if (!this._boundary) { + this._generateBoundary(); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=stepUsageEntry.js.map + return this._boundary; +}; -/***/ }), +FormData.prototype.getBuffer = function() { + var dataBuffer = new Buffer.alloc( 0 ); + var boundary = this.getBoundary(); -/***/ 50606: -/***/ ((__unused_webpack_module, exports) => { + // Create the form content. Add Line breaks to the end of data. + for (var i = 0, len = this._streams.length; i < len; i++) { + if (typeof this._streams[i] !== 'function') { -"use strict"; + // Add content to the buffer. + if(Buffer.isBuffer(this._streams[i])) { + dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]); + }else { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isExistingSubscriptionResource = exports.SubscriptionType = void 0; -var SubscriptionType; -(function (SubscriptionType) { - SubscriptionType["Event"] = "Event"; -})(SubscriptionType = exports.SubscriptionType || (exports.SubscriptionType = {})); -function isExistingSubscriptionResource(T) { - return T.Links !== undefined; -} -exports.isExistingSubscriptionResource = isExistingSubscriptionResource; -//# sourceMappingURL=subscriptionResource.js.map + // Add break after content. + if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] ); + } + } + } -/***/ }), + // Add the footer and return the Buffer object. + return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] ); +}; -/***/ 65252: -/***/ ((__unused_webpack_module, exports) => { +FormData.prototype._generateBoundary = function() { + // This generates a 50 character boundary similar to those used by Firefox. + // They are optimized for boyer-moore parsing. + var boundary = '--------------------------'; + for (var i = 0; i < 24; i++) { + boundary += Math.floor(Math.random() * 10).toString(16); + } -"use strict"; + this._boundary = boundary; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=summaryResource.js.map +// Note: getLengthSync DOESN'T calculate streams length +// As workaround one can calculate file size manually +// and add it as knownLength option +FormData.prototype.getLengthSync = function() { + var knownLength = this._overheadLength + this._valueLength; -/***/ }), + // Don't get confused, there are 3 "internal" streams for each keyval pair + // so it basically checks if there is any value added to the form + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } -/***/ 51140: -/***/ ((__unused_webpack_module, exports) => { + // https://github.com/form-data/form-data/issues/40 + if (!this.hasKnownLength()) { + // Some async length retrievers are present + // therefore synchronous length calculation is false. + // Please use getLength(callback) to get proper length + this._error(new Error('Cannot calculate proper length in synchronous way.')); + } -"use strict"; + return knownLength; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=systemInfoResource.js.map +// Public API to check if length of added values is known +// https://github.com/form-data/form-data/issues/196 +// https://github.com/form-data/form-data/issues/262 +FormData.prototype.hasKnownLength = function() { + var hasKnownLength = true; -/***/ }), + if (this._valuesToMeasure.length) { + hasKnownLength = false; + } -/***/ 38664: -/***/ ((__unused_webpack_module, exports) => { + return hasKnownLength; +}; -"use strict"; +FormData.prototype.getLength = function(cb) { + var knownLength = this._overheadLength + this._valueLength; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tagResource.js.map + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } -/***/ }), + if (!this._valuesToMeasure.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } -/***/ 44990: -/***/ ((__unused_webpack_module, exports) => { + asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { + if (err) { + cb(err); + return; + } -"use strict"; + values.forEach(function(length) { + knownLength += length; + }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tagSetResource.js.map + cb(null, knownLength); + }); +}; -/***/ }), +FormData.prototype.submit = function(params, cb) { + var request + , options + , defaults = {method: 'post'} + ; -/***/ 30874: -/***/ ((__unused_webpack_module, exports) => { + // parse provided url if it's string + // or treat it as options object + if (typeof params == 'string') { -"use strict"; + params = parseUrl(params); + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname, + protocol: params.protocol + }, defaults); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ActivityLogEntryCategory = exports.ActivityStatus = void 0; -var ActivityStatus; -(function (ActivityStatus) { - ActivityStatus["Pending"] = "Pending"; - ActivityStatus["Running"] = "Running"; - ActivityStatus["Success"] = "Success"; - ActivityStatus["Failed"] = "Failed"; - ActivityStatus["Skipped"] = "Skipped"; - ActivityStatus["SuccessWithWarning"] = "SuccessWithWarning"; - ActivityStatus["Canceled"] = "Canceled"; -})(ActivityStatus = exports.ActivityStatus || (exports.ActivityStatus = {})); -var ActivityLogEntryCategory; -(function (ActivityLogEntryCategory) { - ActivityLogEntryCategory["Trace"] = "Trace"; - ActivityLogEntryCategory["Verbose"] = "Verbose"; - ActivityLogEntryCategory["Info"] = "Info"; - ActivityLogEntryCategory["Highlight"] = "Highlight"; - ActivityLogEntryCategory["Wait"] = "Wait"; - ActivityLogEntryCategory["Gap"] = "Gap"; - ActivityLogEntryCategory["Alert"] = "Alert"; - ActivityLogEntryCategory["Warning"] = "Warning"; - ActivityLogEntryCategory["Error"] = "Error"; - ActivityLogEntryCategory["Fatal"] = "Fatal"; - ActivityLogEntryCategory["Planned"] = "Planned"; - ActivityLogEntryCategory["Updated"] = "Updated"; - ActivityLogEntryCategory["Finished"] = "Finished"; - ActivityLogEntryCategory["Abandoned"] = "Abandoned"; -})(ActivityLogEntryCategory = exports.ActivityLogEntryCategory || (exports.ActivityLogEntryCategory = {})); -//# sourceMappingURL=taskDetailsResource.js.map + // use custom params + } else { -/***/ }), + options = populate(params, defaults); + // if no port provided use default one + if (!options.port) { + options.port = options.protocol == 'https:' ? 443 : 80; + } + } -/***/ 87516: -/***/ ((__unused_webpack_module, exports) => { + // put that good code in getHeaders to some use + options.headers = this.getHeaders(params.headers); -"use strict"; + // https if specified, fallback to http in any other case + if (options.protocol == 'https:') { + request = https.request(options); + } else { + request = http.request(options); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TaskName = void 0; -var TaskName; -(function (TaskName) { - TaskName["Health"] = "Health"; - TaskName["AdHocScript"] = "AdHocScript"; - TaskName["ConfigureLetsEncrypt"] = "ConfigureLetsEncrypt"; - TaskName["Upgrade"] = "Upgrade"; - TaskName["TestEmail"] = "TestEmail"; - TaskName["TestAccount"] = "TestAccount"; - TaskName["SystemIntegrityCheck"] = "SystemIntegrityCheck"; - TaskName["SyncCommunityActionTemplates"] = "SyncCommunityActionTemplates"; - TaskName["SynchronizeBuiltInPackageRepositoryIndex"] = "SynchronizeBuiltInPackageRepositoryIndex"; - TaskName["UpdateCalamari"] = "UpdateCalamari"; -})(TaskName = exports.TaskName || (exports.TaskName = {})); -//# sourceMappingURL=taskName.js.map - -/***/ }), - -/***/ 84199: -/***/ ((__unused_webpack_module, exports) => { + // get content length and fire away + this.getLength(function(err, length) { + if (err && err !== 'Unknown stream') { + this._error(err); + return; + } -"use strict"; + // add content length + if (length) { + request.setHeader('Content-Length', length); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=taskResource.js.map + this.pipe(request); + if (cb) { + var onResponse; -/***/ }), + var callback = function (error, responce) { + request.removeListener('error', callback); + request.removeListener('response', onResponse); -/***/ 84955: -/***/ ((__unused_webpack_module, exports) => { + return cb.call(this, error, responce); + }; -"use strict"; + onResponse = callback.bind(this, null); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TaskRestrictedTo = void 0; -var TaskRestrictedTo; -(function (TaskRestrictedTo) { - TaskRestrictedTo["DeploymentTargets"] = "DeploymentTargets"; - TaskRestrictedTo["Workers"] = "Workers"; - TaskRestrictedTo["Policies"] = "Policies"; - TaskRestrictedTo["Unrestricted"] = "Unrestricted"; -})(TaskRestrictedTo = exports.TaskRestrictedTo || (exports.TaskRestrictedTo = {})); -//# sourceMappingURL=taskRestrictedTo.js.map + request.on('error', callback); + request.on('response', onResponse); + } + }.bind(this)); -/***/ }), + return request; +}; -/***/ 36445: -/***/ ((__unused_webpack_module, exports) => { +FormData.prototype._error = function(err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit('error', err); + } +}; -"use strict"; +FormData.prototype.toString = function () { + return '[object FormData]'; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TaskState = void 0; -var TaskState; -(function (TaskState) { - TaskState["Canceled"] = "Canceled"; - TaskState["Cancelling"] = "Cancelling"; - TaskState["Executing"] = "Executing"; - TaskState["Failed"] = "Failed"; - TaskState["Queued"] = "Queued"; - TaskState["Success"] = "Success"; - TaskState["TimedOut"] = "TimedOut"; -})(TaskState = exports.TaskState || (exports.TaskState = {})); -//# sourceMappingURL=taskState.js.map /***/ }), -/***/ 20736: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=teamMembership.js.map +/***/ 7142: +/***/ ((module) => { -/***/ }), +// populates missing values +module.exports = function(dst, src) { -/***/ 54797: -/***/ ((__unused_webpack_module, exports) => { + Object.keys(src).forEach(function(prop) + { + dst[prop] = dst[prop] || src[prop]; + }); -"use strict"; + return dst; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=teamResource.js.map /***/ }), -/***/ 31113: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1621: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tenantMissingVariablesResource.js.map - -/***/ }), - -/***/ 67683: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +module.exports = (flag, argv = process.argv) => { + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tenantResource.js.map /***/ }), -/***/ 77693: +/***/ 3287: /***/ ((__unused_webpack_module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tenantVariableResource.js.map - -/***/ }), -/***/ 68517: -/***/ ((__unused_webpack_module, exports) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); -"use strict"; +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TenantedDeploymentMode = void 0; -var TenantedDeploymentMode; -(function (TenantedDeploymentMode) { - TenantedDeploymentMode["Untenanted"] = "Untenanted"; - TenantedDeploymentMode["TenantedOrUntenanted"] = "TenantedOrUntenanted"; - TenantedDeploymentMode["Tenanted"] = "Tenanted"; -})(TenantedDeploymentMode = exports.TenantedDeploymentMode || (exports.TenantedDeploymentMode = {})); -//# sourceMappingURL=tenantedDeploymentMode.js.map +function isObject(o) { + return Object.prototype.toString.call(o) === '[object Object]'; +} -/***/ }), +function isPlainObject(o) { + var ctor,prot; -/***/ 70229: -/***/ (function(__unused_webpack_module, exports) { + if (isObject(o) === false) return false; -"use strict"; + // If has modified constructor + ctor = o.constructor; + if (ctor === undefined) return true; -var __extends = (this && this.__extends) || (function () { - 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); - }; - return function (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 __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TimeSpanString = void 0; -var TimeSpanString = (function (_super) { - __extends(TimeSpanString, _super); - function TimeSpanString() { - return _super !== null && _super.apply(this, arguments) || this; - } - TimeSpanString.Zero = "00:00:00"; - TimeSpanString.OneHour = "0.01:00:00"; - TimeSpanString.TenSeconds = "00:00:10"; - return TimeSpanString; -}(String)); -exports.TimeSpanString = TimeSpanString; -//# sourceMappingURL=timeSpan.js.map + // If has modified prototype + prot = ctor.prototype; + if (isObject(prot) === false) return false; -/***/ }), + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; + } -/***/ 34170: -/***/ ((__unused_webpack_module, exports) => { + // Most likely a plain Object + return true; +} -"use strict"; +exports.isPlainObject = isPlainObject; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TriggerActionCategory = void 0; -var TriggerActionCategory; -(function (TriggerActionCategory) { - TriggerActionCategory["Deployment"] = "Deployment"; - TriggerActionCategory["Runbook"] = "Runbook"; -})(TriggerActionCategory = exports.TriggerActionCategory || (exports.TriggerActionCategory = {})); -//# sourceMappingURL=triggerActionCategory.js.map /***/ }), -/***/ 59636: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 250: +/***/ (function(module, exports, __nccwpck_require__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TriggerActionResource = void 0; -var TriggerActionResource = (function () { - function TriggerActionResource() { - this.ActionType = undefined; - } - return TriggerActionResource; -}()); -exports.TriggerActionResource = TriggerActionResource; -//# sourceMappingURL=triggerActionResource.js.map +/* module decorator */ module = __nccwpck_require__.nmd(module); +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { -/***/ }), + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; -/***/ 58574: -/***/ ((__unused_webpack_module, exports) => { + /** Used as the semantic version number. */ + var VERSION = '4.17.21'; -"use strict"; + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TriggerActionType = void 0; -var TriggerActionType; -(function (TriggerActionType) { - TriggerActionType["AutoDeploy"] = "AutoDeploy"; - TriggerActionType["DeployLatestRelease"] = "DeployLatestRelease"; - TriggerActionType["DeployNewRelease"] = "DeployNewRelease"; - TriggerActionType["RunRunbook"] = "RunRunbook"; -})(TriggerActionType = exports.TriggerActionType || (exports.TriggerActionType = {})); -//# sourceMappingURL=triggerActionType.js.map + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function', + INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; -/***/ }), + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; -/***/ 1033: -/***/ ((__unused_webpack_module, exports) => { + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; -"use strict"; + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TriggerFilterResource = void 0; -var TriggerFilterResource = (function () { - function TriggerFilterResource() { - this.FilterType = undefined; - } - return TriggerFilterResource; -}()); -exports.TriggerFilterResource = TriggerFilterResource; -//# sourceMappingURL=triggerFilterResource.js.map + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; -/***/ }), + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; -/***/ 30292: -/***/ ((__unused_webpack_module, exports) => { + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; -"use strict"; + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TriggerFilterType = void 0; -var TriggerFilterType; -(function (TriggerFilterType) { - TriggerFilterType["CronExpressionSchedule"] = "CronExpressionSchedule"; - TriggerFilterType["ContinuousDailySchedule"] = "ContinuousDailySchedule"; - TriggerFilterType["DaysPerMonthSchedule"] = "DaysPerMonthSchedule"; - TriggerFilterType["MachineFilter"] = "MachineFilter"; - TriggerFilterType["OnceDailySchedule"] = "OnceDailySchedule"; -})(TriggerFilterType = exports.TriggerFilterType || (exports.TriggerFilterType = {})); -//# sourceMappingURL=triggerFilterType.js.map + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; -/***/ }), + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; -/***/ 78010: -/***/ ((__unused_webpack_module, exports) => { + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; -"use strict"; + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isExistingTriggerResource = void 0; -function isExistingTriggerResource(resource) { - return resource.Links !== undefined; -} -exports.isExistingTriggerResource = isExistingTriggerResource; -//# sourceMappingURL=triggerResource.js.map + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; -/***/ }), + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; -/***/ 81599: -/***/ ((__unused_webpack_module, exports) => { + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; -"use strict"; + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TriggerScheduleIntervalType = void 0; -var TriggerScheduleIntervalType; -(function (TriggerScheduleIntervalType) { - TriggerScheduleIntervalType["OnceDaily"] = "OnceDaily"; - TriggerScheduleIntervalType["OnceHourly"] = "OnceHourly"; - TriggerScheduleIntervalType["OnceEveryMinute"] = "OnceEveryMinute"; -})(TriggerScheduleIntervalType = exports.TriggerScheduleIntervalType || (exports.TriggerScheduleIntervalType = {})); -//# sourceMappingURL=triggerScheduleIntervalType.js.map + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); -/***/ }), + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; -/***/ 54638: -/***/ ((__unused_webpack_module, exports) => { + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; -"use strict"; + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UpgradeNotificationMode = void 0; -var UpgradeNotificationMode; -(function (UpgradeNotificationMode) { - UpgradeNotificationMode["AlwaysShow"] = "AlwaysShow"; - UpgradeNotificationMode["ShowOnlyMajorMinor"] = "ShowOnlyMajorMinor"; - UpgradeNotificationMode["NeverShow"] = "NeverShow"; -})(UpgradeNotificationMode = exports.UpgradeNotificationMode || (exports.UpgradeNotificationMode = {})); -//# sourceMappingURL=upgradeConfigurationResource.js.map + /** Used to match leading whitespace. */ + var reTrimStart = /^\s+/; -/***/ }), + /** Used to match a single whitespace character. */ + var reWhitespace = /\s/; -/***/ 41823: -/***/ ((__unused_webpack_module, exports) => { + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; -"use strict"; + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=userAuthenticationResource.js.map + /** + * Used to validate the `validate` option in `_.template` variable. + * + * Forbids characters which could potentially change the meaning of the function argument definition: + * - "()," (modification of function parameters) + * - "=" (default value) + * - "[]{}" (destructuring of function parameters) + * - "/" (beginning of a comment) + * - whitespace + */ + var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; -/***/ }), + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; -/***/ 69838: -/***/ ((__unused_webpack_module, exports) => { + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; -"use strict"; + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=userIdentityMetadataResource.js.map + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; -/***/ }), + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; -/***/ 45206: -/***/ ((__unused_webpack_module, exports) => { + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; -"use strict"; + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isAllProjectGroups = exports.isAllTenants = exports.isAllEnvironments = exports.isAllProjects = void 0; -function isAllProjects(restrictions) { - var allProjects = restrictions; - return (allProjects.length === 1 && - (allProjects[0] === "projects-all" || - allProjects[0] === "projects-unrelated")); -} -exports.isAllProjects = isAllProjects; -function isAllEnvironments(restrictions) { - var allEnvironments = restrictions; - return (allEnvironments.length === 1 && - (allEnvironments[0] === "environments-all" || - allEnvironments[0] === "environments-unrelated")); -} -exports.isAllEnvironments = isAllEnvironments; -function isAllTenants(restrictions) { - var allTenants = restrictions; - return (allTenants.length === 1 && - (allTenants[0] === "tenants-all" || allTenants[0] === "tenants-unrelated")); -} -exports.isAllTenants = isAllTenants; -function isAllProjectGroups(restrictions) { - var allProjectGroups = restrictions; - return (allProjectGroups.length === 1 && - (allProjectGroups[0] === "projectgroups-all" || - allProjectGroups[0] === "projectgroups-unrelated")); -} -exports.isAllProjectGroups = isAllProjectGroups; -//# sourceMappingURL=userPermissionRestriction.js.map - -/***/ }), - -/***/ 36604: -/***/ ((__unused_webpack_module, exports) => { + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=userPermissionSetResource.js.map - -/***/ }), + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; -/***/ 50872: -/***/ ((__unused_webpack_module, exports) => { + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; -"use strict"; + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=userResource.js.map + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; -/***/ }), + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; -/***/ 24456: -/***/ ((__unused_webpack_module, exports) => { + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; -"use strict"; + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UserRoleConstants = void 0; -exports.UserRoleConstants = { - SpaceManagerRole: "userroles-spacemanager", -}; -//# sourceMappingURL=userRoleResource.js.map + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); -/***/ }), + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); -/***/ 54861: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); -"use strict"; + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewUsernamePasswordAccount = void 0; -var accountType_1 = __nccwpck_require__(34914); -function NewUsernamePasswordAccount(name, username, password) { - return { - AccountType: accountType_1.AccountType.UsernamePassword, - Name: name, - Password: password, - Username: username, - }; -} -exports.NewUsernamePasswordAccount = NewUsernamePasswordAccount; -//# sourceMappingURL=usernamePasswordAccountResource.js.map + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; -/***/ }), + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; -/***/ 12765: -/***/ ((__unused_webpack_module, exports) => { + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; -"use strict"; + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isPropertyDefinedAndNotNull = exports.typeSafeHasOwnProperty = void 0; -var typeSafeHasOwnProperty = function (target, key) { - return target.hasOwnProperty(key); -}; -exports.typeSafeHasOwnProperty = typeSafeHasOwnProperty; -var isPropertyDefinedAndNotNull = function (target, key) { - return ((0, exports.typeSafeHasOwnProperty)(target, key) && - target[key] !== null && - target[key] !== undefined); -}; -exports.isPropertyDefinedAndNotNull = isPropertyDefinedAndNotNull; -//# sourceMappingURL=utils.js.map + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; -/***/ }), + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; -/***/ 7151: -/***/ ((__unused_webpack_module, exports) => { + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; -"use strict"; + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=variablePromptOptions.js.map + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; -/***/ }), + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; -/***/ 90269: -/***/ ((__unused_webpack_module, exports) => { + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; -"use strict"; + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=variableResource.js.map + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); -/***/ }), + /** Detect free variable `exports`. */ + var freeExports = true && exports && !exports.nodeType && exports; -/***/ 32280: -/***/ ((__unused_webpack_module, exports) => { + /** Detect free variable `module`. */ + var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; -"use strict"; + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VariableSetContentType = void 0; -var VariableSetContentType; -(function (VariableSetContentType) { - VariableSetContentType["Variables"] = "Variables"; - VariableSetContentType["ScriptModule"] = "ScriptModule"; -})(VariableSetContentType = exports.VariableSetContentType || (exports.VariableSetContentType = {})); -//# sourceMappingURL=variableSetContentType.js.map + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; -/***/ }), + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; -/***/ 36186: -/***/ ((__unused_webpack_module, exports) => { + if (types) { + return types; + } -"use strict"; + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=variableSetResource.js.map + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; -/***/ }), + /*--------------------------------------------------------------------------*/ -/***/ 71283: -/***/ ((__unused_webpack_module, exports) => { + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } -"use strict"; + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VariableType = void 0; -var VariableType; -(function (VariableType) { - VariableType["AmazonWebServicesAccount"] = "AmazonWebServicesAccount"; - VariableType["AzureAccount"] = "AzureAccount"; - VariableType["Certificate"] = "Certificate"; - VariableType["GoogleCloudAccount"] = "GoogleCloudAccount"; - VariableType["Sensitive"] = "Sensitive"; - VariableType["String"] = "String"; - VariableType["WorkerPool"] = "WorkerPool"; -})(VariableType = exports.VariableType || (exports.VariableType = {})); -//# sourceMappingURL=variableType.js.map - -/***/ }), - -/***/ 71879: -/***/ ((__unused_webpack_module, exports) => { + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } -"use strict"; + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=variablesScopedToEnvironmentResponse.js.map + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } -/***/ }), + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; -/***/ 63823: -/***/ ((__unused_webpack_module, exports) => { + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } -"use strict"; + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=vcsRunbookResourceLinks.js.map + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } -/***/ }), + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; -/***/ 94620: -/***/ ((__unused_webpack_module, exports) => { + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } -"use strict"; + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getBasePathToShowByDefault = exports.branchNameToShowByDefault = void 0; -exports.branchNameToShowByDefault = "main"; -var getBasePathToShowByDefault = function (projectName) { - return ".octopus/".concat(projectName); -}; -exports.getBasePathToShowByDefault = getBasePathToShowByDefault; -//# sourceMappingURL=versionControlledResource.js.map + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; -/***/ }), + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } -/***/ 82668: -/***/ ((__unused_webpack_module, exports) => { + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); -"use strict"; + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=versionRuleTestResponse.js.map + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; -/***/ }), + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } -/***/ 51496: -/***/ ((__unused_webpack_module, exports) => { + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; -"use strict"; + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workItemLink.js.map + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } -/***/ }), + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; -/***/ 24090: -/***/ ((__unused_webpack_module, exports) => { + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } -"use strict"; + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isWorkerMachine = void 0; -function isWorkerMachine(machine) { - return machine.WorkerPoolIds !== undefined; -} -exports.isWorkerMachine = isWorkerMachine; -//# sourceMappingURL=workerMachineResource.js.map + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } -/***/ }), + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } -/***/ 3282: -/***/ ((__unused_webpack_module, exports) => { + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } -"use strict"; + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerPoolResource.js.map + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } -/***/ }), + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } -/***/ 99028: -/***/ ((__unused_webpack_module, exports) => { + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; -"use strict"; + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerPoolResourceBase.js.map + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } -/***/ }), + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } -/***/ 48773: -/***/ ((__unused_webpack_module, exports) => { + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } -"use strict"; + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerPoolSummary.js.map + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } -/***/ }), + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; -/***/ 51578: -/***/ ((__unused_webpack_module, exports) => { + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } -"use strict"; + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerPoolSummaryResource.js.map + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } -/***/ }), + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); -/***/ 30742: -/***/ ((__unused_webpack_module, exports) => { + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } -"use strict"; + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.WorkerPoolType = void 0; -var WorkerPoolType; -(function (WorkerPoolType) { - WorkerPoolType["Static"] = "StaticWorkerPool"; - WorkerPoolType["Dynamic"] = "DynamicWorkerPool"; -})(WorkerPoolType = exports.WorkerPoolType || (exports.WorkerPoolType = {})); -//# sourceMappingURL=workerPoolType.js.map + /** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ + function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; + } -/***/ }), + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } -/***/ 44021: -/***/ ((__unused_webpack_module, exports) => { + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } -"use strict"; + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerPoolsSummaryResource.js.map + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; -/***/ }), + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } -/***/ 31613: -/***/ ((__unused_webpack_module, exports) => { + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; -"use strict"; + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerPoolsSupportedTypesResource.js.map + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; -/***/ }), + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } -/***/ 17678: -/***/ ((__unused_webpack_module, exports) => { + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); -"use strict"; + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerToolsLatestImages.js.map + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } -/***/ }), + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } -/***/ 14812: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } -module.exports = -{ - parallel : __nccwpck_require__(8210), - serial : __nccwpck_require__(50445), - serialOrdered : __nccwpck_require__(3578) -}; + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; -/***/ }), + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } -/***/ 1700: -/***/ ((module) => { + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); -// API -module.exports = abort; - -/** - * Aborts leftover active jobs - * - * @param {object} state - current state object - */ -function abort(state) -{ - Object.keys(state.jobs).forEach(clean.bind(state)); - - // reset leftover jobs - state.jobs = {}; -} + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } -/** - * Cleans up leftover job by invoking abort function for the provided job id - * - * @this state - * @param {string|number} key - job id to abort - */ -function clean(key) -{ - if (typeof this.jobs[key] == 'function') - { - this.jobs[key](); + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; } -} + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; -/***/ }), + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } -/***/ 72794: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); -var defer = __nccwpck_require__(15295); + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } -// API -module.exports = async; + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); -/** - * Runs provided callback asynchronously - * even if callback itself is not - * - * @param {function} callback - callback to invoke - * @returns {function} - augmented callback - */ -function async(callback) -{ - var isAsync = false; + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } - // check if async happened - defer(function() { isAsync = true; }); + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; - return function async_callback(err, result) - { - if (isAsync) - { - callback(err, result); + while (++index < length) { + if (array[index] === value) { + return index; + } } - else - { - defer(function nextTick_callback() - { - callback(err, result); - }); + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } } - }; -} + return index; + } + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } -/***/ }), + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } -/***/ 15295: -/***/ ((module) => { + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ + function trimmedEndIndex(string) { + var index = string.length; -module.exports = defer; + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; + } -/** - * Runs provided function on next iteration of the event loop - * - * @param {function} fn - function to run - */ -function defer(fn) -{ - var nextTick = typeof setImmediate == 'function' - ? setImmediate - : ( - typeof process == 'object' && typeof process.nextTick == 'function' - ? process.nextTick - : null - ); + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); - if (nextTick) - { - nextTick(fn); - } - else - { - setTimeout(fn, 0); + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; } -} + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } -/***/ }), + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } -/***/ 9023: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /*--------------------------------------------------------------------------*/ -var async = __nccwpck_require__(72794) - , abort = __nccwpck_require__(1700) - ; + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); -// API -module.exports = iterate; + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; -/** - * Iterates over each job object - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {object} state - current job status - * @param {function} callback - invoked when all elements processed - */ -function iterate(list, iterator, state, callback) -{ - // store current index - var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; - state.jobs[key] = runJob(iterator, key, list[key], function(error, output) - { - // don't repeat yourself - // skip secondary callbacks - if (!(key in state.jobs)) - { - return; - } + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; - // clean up jobs - delete state.jobs[key]; + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; - if (error) - { - // don't process rest of the results - // stop still active jobs - // and reset the list - abort(state); - } - else - { - state.results[key] = output; - } + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; - // return salvaged results - callback(error, state.results); - }); -} + /** Used to generate unique IDs. */ + var idCounter = 0; -/** - * Runs iterator over provided job element - * - * @param {function} iterator - iterator to invoke - * @param {string|number} key - key/index of the element in the list of jobs - * @param {mixed} item - job description - * @param {function} callback - invoked after iterator is done with the job - * @returns {function|mixed} - job abort function or something else - */ -function runJob(iterator, key, item, callback) -{ - var aborter; + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); - // allow shortcut if iterator expects only two arguments - if (iterator.length == 2) - { - aborter = iterator(item, async(callback)); - } - // otherwise go with full three arguments - else - { - aborter = iterator(item, key, async(callback)); - } + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; - return aborter; -} + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; -/***/ }), + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); -/***/ 42474: -/***/ ((module) => { + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; -// API -module.exports = state; + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); -/** - * Creates initial state object - * for iteration over list - * - * @param {array|object} list - list to iterate over - * @param {function|null} sortMethod - function to use for keys sort, - * or `null` to keep them as is - * @returns {object} - initial state object - */ -function state(list, sortMethod) -{ - var isNamedList = !Array.isArray(list) - , initState = - { - index : 0, - keyedList: isNamedList || sortMethod ? Object.keys(list) : null, - jobs : {}, - results : isNamedList ? {} : [], - size : isNamedList ? Object.keys(list).length : list.length - } - ; + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; - if (sortMethod) - { - // sort array keys based on it's values - // sort object's keys just on own merit - initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) - { - return sortMethod(list[a], list[b]); - }); - } + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; - return initState; -} + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; -/***/ }), + /** Used to lookup unminified function names. */ + var realNames = {}; -/***/ 37942: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); -var abort = __nccwpck_require__(1700) - , async = __nccwpck_require__(72794) - ; + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; -// API -module.exports = terminator; + /*------------------------------------------------------------------------*/ -/** - * Terminates jobs in the attached state context - * - * @this AsyncKitState# - * @param {function} callback - final callback to invoke after termination - */ -function terminator(callback) -{ - if (!Object.keys(this.jobs).length) - { - return; - } + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } - // fast forward iteration index - this.index = this.size; + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); - // abort jobs - abort(this); + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } - // send back results we have so far - async(callback)(null, this.results); -} + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { -/***/ }), + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, -/***/ 8210: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, -var iterate = __nccwpck_require__(9023) - , initState = __nccwpck_require__(42474) - , terminator = __nccwpck_require__(37942) - ; + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, -// Public API -module.exports = parallel; + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', -/** - * Runs iterator over provided array elements in parallel - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function parallel(list, iterator, callback) -{ - var state = initState(list); + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { - while (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, function(error, result) - { - if (error) - { - callback(error, result); - return; + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash } + }; - // looks like it's the last one - if (Object.keys(state.jobs).length === 0) - { - callback(null, state.results); - return; - } - }); + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; - state.index++; - } + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; - return terminator.bind(state, callback); -} + /*------------------------------------------------------------------------*/ + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } -/***/ }), + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } -/***/ 50445: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } -var serialOrdered = __nccwpck_require__(3578); + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); -// Public API -module.exports = serial; + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; -/** - * Runs iterator over provided array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serial(list, iterator, callback) -{ - return serialOrdered(list, iterator, null, callback); -} + outer: + while (length-- && resIndex < takeCount) { + index += dir; + var iterIndex = -1, + value = array[index]; -/***/ }), + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); -/***/ 3578: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } -var iterate = __nccwpck_require__(9023) - , initState = __nccwpck_require__(42474) - , terminator = __nccwpck_require__(37942) - ; + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; -// Public API -module.exports = serialOrdered; -// sorting helpers -module.exports.ascending = ascending; -module.exports.descending = descending; + /*------------------------------------------------------------------------*/ -/** - * Runs iterator over provided sorted array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} sortMethod - custom sort function - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serialOrdered(list, iterator, sortMethod, callback) -{ - var state = initState(list, sortMethod); + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; - iterate(list, iterator, state, function iteratorHandler(error, result) - { - if (error) - { - callback(error, result); - return; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } - state.index++; - - // are we there yet? - if (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, iteratorHandler); - return; + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; } - // done here - callback(null, state.results); - }); - - return terminator.bind(state, callback); -} + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } -/* - * -- Sort methods - */ + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } -/** - * sort helper to sort array elements in ascending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function ascending(a, b) -{ - return a < b ? -1 : a > b ? 1 : 0; -} - -/** - * sort helper to sort array elements in descending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function descending(a, b) -{ - return -1 * ascending(a, b); -} - - -/***/ }), - -/***/ 96545: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = __nccwpck_require__(52618); - -/***/ }), - -/***/ 68104: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } -var utils = __nccwpck_require__(20328); -var settle = __nccwpck_require__(13211); -var buildFullPath = __nccwpck_require__(41934); -var buildURL = __nccwpck_require__(30646); -var http = __nccwpck_require__(13685); -var https = __nccwpck_require__(95687); -var httpFollow = (__nccwpck_require__(67707).http); -var httpsFollow = (__nccwpck_require__(67707).https); -var url = __nccwpck_require__(57310); -var zlib = __nccwpck_require__(59796); -var VERSION = (__nccwpck_require__(94322).version); -var transitionalDefaults = __nccwpck_require__(40936); -var AxiosError = __nccwpck_require__(72093); -var CanceledError = __nccwpck_require__(34098); + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; -var isHttps = /https:?/; + /*------------------------------------------------------------------------*/ -var supportedProtocols = [ 'http:', 'https:', 'file:' ]; + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; -/** - * - * @param {http.ClientRequestArgs} options - * @param {AxiosProxyConfig} proxy - * @param {string} location - */ -function setProxy(options, proxy, location) { - options.hostname = proxy.host; - options.host = proxy.host; - options.port = proxy.port; - options.path = location; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } - // Basic proxy authorization - if (proxy.auth) { - var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); - options.headers['Proxy-Authorization'] = 'Basic ' + base64; - } + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } - // If a proxy is used, any redirects must also pass through the proxy - options.beforeRedirect = function beforeRedirect(redirection) { - redirection.headers.host = redirection.host; - setProxy(redirection, proxy, redirection.href); - }; -} + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); -/*eslint consistent-return:0*/ -module.exports = function httpAdapter(config) { - return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { - var onCanceled; - function done() { - if (config.cancelToken) { - config.cancelToken.unsubscribe(onCanceled); + if (index < 0) { + return false; } - - if (config.signal) { - config.signal.removeEventListener('abort', onCanceled); + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); } + --this.size; + return true; } - var resolve = function resolve(value) { - done(); - resolvePromise(value); - }; - var rejected = false; - var reject = function reject(value) { - done(); - rejected = true; - rejectPromise(value); - }; - var data = config.data; - var headers = config.headers; - var headerNames = {}; - Object.keys(headers).forEach(function storeLowerName(name) { - headerNames[name.toLowerCase()] = name; - }); + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); - // Set User-Agent (required by some servers) - // See https://github.com/axios/axios/issues/69 - if ('user-agent' in headerNames) { - // User-Agent is specified; handle case where no UA header is desired - if (!headers[headerNames['user-agent']]) { - delete headers[headerNames['user-agent']]; - } - // Otherwise, use specified value - } else { - // Only set header if it hasn't been set in config - headers['User-Agent'] = 'axios/' + VERSION; + return index < 0 ? undefined : data[index][1]; } - // support for https://www.npmjs.com/package/form-data api - if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) { - Object.assign(headers, data.getHeaders()); - } else if (data && !utils.isStream(data)) { - if (Buffer.isBuffer(data)) { - // Nothing to do... - } else if (utils.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils.isString(data)) { - data = Buffer.from(data, 'utf-8'); - } else { - return reject(new AxiosError( - 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', - AxiosError.ERR_BAD_REQUEST, - config - )); - } + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } - if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { - return reject(new AxiosError( - 'Request body larger than maxBodyLength limit', - AxiosError.ERR_BAD_REQUEST, - config - )); - } + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); - // Add Content-Length header if data exists - if (!headerNames['content-length']) { - headers['Content-Length'] = data.length; + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; } + return this; } - // HTTP basic authentication - var auth = undefined; - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password || ''; - auth = username + ':' + password; - } + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; - // Parse url - var fullPath = buildFullPath(config.baseURL, config.url); - var parsed = url.parse(fullPath); - var protocol = parsed.protocol || supportedProtocols[0]; + /*------------------------------------------------------------------------*/ - if (supportedProtocols.indexOf(protocol) === -1) { - return reject(new AxiosError( - 'Unsupported protocol ' + protocol, - AxiosError.ERR_BAD_REQUEST, - config - )); - } + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; - if (!auth && parsed.auth) { - var urlAuth = parsed.auth.split(':'); - var urlUsername = urlAuth[0] || ''; - var urlPassword = urlAuth[1] || ''; - auth = urlUsername + ':' + urlPassword; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } - if (auth && headerNames.authorization) { - delete headers[headerNames.authorization]; + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; } - var isHttpsRequest = isHttps.test(protocol); - var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; - - try { - buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''); - } catch (err) { - var customErr = new Error(err.message); - customErr.config = config; - customErr.url = config.url; - customErr.exists = true; - reject(customErr); + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; } - var options = { - path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), - method: config.method.toUpperCase(), - headers: headers, - agent: agent, - agents: { http: config.httpAgent, https: config.httpsAgent }, - auth: auth - }; + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } - if (config.socketPath) { - options.socketPath = config.socketPath; - } else { - options.hostname = parsed.hostname; - options.port = parsed.port; + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); } - var proxy = config.proxy; - if (!proxy && proxy !== false) { - var proxyEnv = protocol.slice(0, -1) + '_proxy'; - var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; - if (proxyUrl) { - var parsedProxyUrl = url.parse(proxyUrl); - var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; - var shouldProxy = true; + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; - if (noProxyEnv) { - var noProxy = noProxyEnv.split(',').map(function trim(s) { - return s.trim(); - }); + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } - shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { - if (!proxyElement) { - return false; - } - if (proxyElement === '*') { - return true; - } - if (proxyElement[0] === '.' && - parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { - return true; - } + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; - return parsed.hostname === proxyElement; - }); - } + /*------------------------------------------------------------------------*/ - if (shouldProxy) { - proxy = { - host: parsedProxyUrl.hostname, - port: parsedProxyUrl.port, - protocol: parsedProxyUrl.protocol - }; + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; - if (parsedProxyUrl.auth) { - var proxyUrlAuth = parsedProxyUrl.auth.split(':'); - proxy.auth = { - username: proxyUrlAuth[0], - password: proxyUrlAuth[1] - }; - } - } + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); } } - if (proxy) { - options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); - setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; } - var transport; - var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); - if (config.transport) { - transport = config.transport; - } else if (config.maxRedirects === 0) { - transport = isHttpsProxy ? https : http; - } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; - } - if (config.beforeRedirect) { - options.beforeRedirect = config.beforeRedirect; - } - transport = isHttpsProxy ? httpsFollow : httpFollow; + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); } - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; - } + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; - if (config.insecureHTTPParser) { - options.insecureHTTPParser = config.insecureHTTPParser; + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; } - // Create the request - var req = transport.request(options, function handleResponse(res) { - if (req.aborted) return; + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } - // uncompress the response body transparently if required - var stream = res; + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); - // return the last request in case of redirects - var lastRequest = res.req || req; + this.size = data.size; + return result; + } + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } - // if no content, is HEAD request or decompress disabled we should not decompress - if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { - switch (res.headers['content-encoding']) { - /*eslint default-case:0*/ - case 'gzip': - case 'compress': - case 'deflate': - // add the unzipper to the body stream processing pipeline - stream = stream.pipe(zlib.createUnzip()); + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } - // remove the content-encoding in order to not confuse downstream operations - delete res.headers['content-encoding']; - break; + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; } + data = this.__data__ = new MapCache(pairs); } + data.set(key, value); + this.size = data.size; + return this; + } - var response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: res.headers, - config: config, - request: lastRequest - }; - - if (config.responseType === 'stream') { - response.data = stream; - settle(resolve, reject, response); - } else { - var responseBuffer = []; - var totalResponseBytes = 0; - stream.on('data', function handleStreamData(chunk) { - responseBuffer.push(chunk); - totalResponseBytes += chunk.length; - - // make sure the content length is not over the maxContentLength if specified - if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { - // stream.destoy() emit aborted event before calling reject() on Node.js v16 - rejected = true; - stream.destroy(); - reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); - } - }); - - stream.on('aborted', function handlerStreamAborted() { - if (rejected) { - return; - } - stream.destroy(); - reject(new AxiosError( - 'maxContentLength size of ' + config.maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest - )); - }); - - stream.on('error', function handleStreamError(err) { - if (req.aborted) return; - reject(AxiosError.from(err, null, config, lastRequest)); - }); - - stream.on('end', function handleStreamEnd() { - try { - var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); - if (config.responseType !== 'arraybuffer') { - responseData = responseData.toString(config.responseEncoding); - if (!config.responseEncoding || config.responseEncoding === 'utf8') { - responseData = utils.stripBOM(responseData); - } - } - response.data = responseData; - } catch (err) { - reject(AxiosError.from(err, null, config, response.request, response)); - } - settle(resolve, reject, response); - }); - } - }); - - // Handle errors - req.on('error', function handleRequestError(err) { - // @todo remove - // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; - reject(AxiosError.from(err, null, config, req)); - }); - - // set tcp keep alive to prevent drop connection by peer - req.on('socket', function handleRequestSocket(socket) { - // default interval of sending ack packet is 1 minute - socket.setKeepAlive(true, 1000 * 60); - }); + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; - // Handle request timeout - if (config.timeout) { - // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. - var timeout = parseInt(config.timeout, 10); + /*------------------------------------------------------------------------*/ - if (isNaN(timeout)) { - reject(new AxiosError( - 'error trying to parse `config.timeout` to int', - AxiosError.ERR_BAD_OPTION_VALUE, - config, - req - )); + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; - return; + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } } - - // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. - // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. - // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. - // And then these socket which be hang up will devoring CPU little by little. - // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. - req.setTimeout(timeout, function handleRequestTimeout() { - req.abort(); - var transitional = config.transitional || transitionalDefaults; - reject(new AxiosError( - 'timeout of ' + timeout + 'ms exceeded', - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - req - )); - }); + return result; } - if (config.cancelToken || config.signal) { - // Handle cancellation - // eslint-disable-next-line func-names - onCanceled = function(cancel) { - if (req.aborted) return; - - req.abort(); - reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel); - }; - - config.cancelToken && config.cancelToken.subscribe(onCanceled); - if (config.signal) { - config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); - } + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; } - - // Send the request - if (utils.isStream(data)) { - data.on('error', function handleStreamError(err) { - reject(AxiosError.from(err, config, null, req)); - }).pipe(req); - } else { - req.end(data); + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } - }); -}; - - -/***/ }), -/***/ 3454: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var utils = __nccwpck_require__(20328); -var settle = __nccwpck_require__(13211); -var cookies = __nccwpck_require__(21545); -var buildURL = __nccwpck_require__(30646); -var buildFullPath = __nccwpck_require__(41934); -var parseHeaders = __nccwpck_require__(86455); -var isURLSameOrigin = __nccwpck_require__(33608); -var transitionalDefaults = __nccwpck_require__(40936); -var AxiosError = __nccwpck_require__(72093); -var CanceledError = __nccwpck_require__(34098); -var parseProtocol = __nccwpck_require__(66107); + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } -module.exports = function xhrAdapter(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - var requestData = config.data; - var requestHeaders = config.headers; - var responseType = config.responseType; - var onCanceled; - function done() { - if (config.cancelToken) { - config.cancelToken.unsubscribe(onCanceled); + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); } + } - if (config.signal) { - config.signal.removeEventListener('abort', onCanceled); + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); } } - if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) { - delete requestHeaders['Content-Type']; // Let the browser set it + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; } - var request = new XMLHttpRequest(); - - // HTTP basic authentication - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; - requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; } - var fullPath = buildFullPath(config.baseURL, config.url); - - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } - // Set the request timeout in MS - request.timeout = config.timeout; + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } - function onloadend() { - if (!request) { - return; + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; } - // Prepare the response - var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; - var responseData = !responseType || responseType === 'text' || responseType === 'json' ? - request.responseText : request.response; - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; + } - settle(function _resolve(value) { - resolve(value); - done(); - }, function _reject(err) { - reject(err); - done(); - }, response); + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; - // Clean up request - request = null; + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; } - if ('onloadend' in request) { - // Use onloadend if available - request.onloadend = onloadend; - } else { - // Listen for ready state to emulate onloadend - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { - return; + if (lower !== undefined) { + number = number >= lower ? number : lower; } - // readystate handler is calling before onerror or ontimeout handlers, - // so we should call onloadend on the next 'tick' - setTimeout(onloadend); - }; - } - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; } + return number; + } - reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError() { - // Real errors are hidden from us by the browser - // onerror should only fire if it's a network error - reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request)); - - // Clean up request - request = null; - }; + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; - // Handle timeout - request.ontimeout = function handleTimeout() { - var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; - var transitional = config.transitional || transitionalDefaults; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); } - reject(new AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - request)); - - // Clean up request - request = null; - }; + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - if (utils.isStandardBrowserEnv()) { - // Add xsrf header - var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? - cookies.read(config.xsrfCookieName) : - undefined; + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); - if (xsrfValue) { - requestHeaders[config.xsrfHeaderName] = xsrfValue; + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); } - } - // Add headers to the request - if ('setRequestHeader' in request) { - utils.forEach(requestHeaders, function setRequestHeader(val, key) { - if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { - // Remove Content-Type if data is undefined - delete requestHeaders[key]; - } else { - // Otherwise add header to the request - request.setRequestHeader(key, val); + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); + return result; } - // Add withCredentials to request if needed - if (!utils.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; } - // Add responseType to request if needed - if (responseType && responseType !== 'json') { - request.responseType = config.responseType; - } + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; - // Handle progress if needed - if (typeof config.onDownloadProgress === 'function') { - request.addEventListener('progress', config.onDownloadProgress); + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; } - // Not all browsers support upload events - if (typeof config.onUploadProgress === 'function' && request.upload) { - request.upload.addEventListener('progress', config.onUploadProgress); + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); } - if (config.cancelToken || config.signal) { - // Handle cancellation - // eslint-disable-next-line func-names - onCanceled = function(cancel) { - if (!request) { - return; - } - reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel); - request.abort(); - request = null; - }; + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; - config.cancelToken && config.cancelToken.subscribe(onCanceled); - if (config.signal) { - config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + if (!length) { + return result; } - } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); - if (!requestData) { - requestData = null; + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; } - var protocol = parseProtocol(fullPath); + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); - if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) { - reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); - return; - } + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } - // Send the request - request.send(requestData); - }); -}; + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + while (++index < length) { + var value = array[index], + current = iteratee(value); -/***/ }), + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } -/***/ 52618: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; -"use strict"; + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } -var utils = __nccwpck_require__(20328); -var bind = __nccwpck_require__(77065); -var Axios = __nccwpck_require__(98178); -var mergeConfig = __nccwpck_require__(74831); -var defaults = __nccwpck_require__(21626); + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * @return {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - var context = new Axios(defaultConfig); - var instance = bind(Axios.prototype.request, context); + predicate || (predicate = isFlattenable); + result || (result = []); - // Copy axios.prototype to instance - utils.extend(instance, Axios.prototype, context); + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } - // Copy context to instance - utils.extend(instance, context); + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); - // Factory for creating new instances - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); - return instance; -} + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } -// Create the default instance to be exported -var axios = createInstance(defaults); + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } -// Expose Axios class to allow class inheritance -axios.Axios = Axios; + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } -// Expose Cancel & CancelToken -axios.CanceledError = __nccwpck_require__(34098); -axios.CancelToken = __nccwpck_require__(71587); -axios.isCancel = __nccwpck_require__(64057); -axios.VERSION = (__nccwpck_require__(94322).version); -axios.toFormData = __nccwpck_require__(20470); + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); -// Expose AxiosError class -axios.AxiosError = __nccwpck_require__(72093); + var index = 0, + length = path.length; -// alias for CanceledError for backward compatibility -axios.Cancel = axios.CanceledError; - -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); -}; -axios.spread = __nccwpck_require__(74850); - -// Expose isAxiosError -axios.isAxiosError = __nccwpck_require__(60650); - -module.exports = axios; - -// Allow use of default import syntax in TypeScript -module.exports["default"] = axios; + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } -/***/ }), + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } -/***/ 71587: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } -"use strict"; + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } -var CanceledError = __nccwpck_require__(34098); + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @class - * @param {Function} executor The executor function. - */ -function CancelToken(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; - var resolvePromise; + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); + var index = -1, + seen = caches[0]; - var token = this; + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; - // eslint-disable-next-line func-names - this.promise.then(function(cancel) { - if (!token._listeners) return; + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } - var i; - var l = token._listeners.length; + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } - for (i = 0; i < l; i++) { - token._listeners[i](cancel); + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); } - token._listeners = null; - }); - // eslint-disable-next-line func-names - this.promise.then = function(onfulfilled) { - var _resolve; - // eslint-disable-next-line func-names - var promise = new Promise(function(resolve) { - token.subscribe(resolve); - _resolve = resolve; - }).then(onfulfilled); + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } - return promise; - }; + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } - executor(function cancel(message) { - if (token.reason) { - // Cancellation has already been requested - return; + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } - token.reason = new CanceledError(message); - resolvePromise(token.reason); - }); -} + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); -/** - * Throws a `CanceledError` if cancellation has been requested. - */ -CancelToken.prototype.throwIfRequested = function throwIfRequested() { - if (this.reason) { - throw this.reason; - } -}; + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; -/** - * Subscribe to the cancel signal - */ + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; -CancelToken.prototype.subscribe = function subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; - } -}; + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; -/** - * Unsubscribe from the cancel signal - */ + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } -CancelToken.prototype.unsubscribe = function unsubscribe(listener) { - if (!this._listeners) { - return; - } - var index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); - } -}; + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } -/** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ -CancelToken.source = function source() { - var cancel; - var token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token: token, - cancel: cancel - }; -}; + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; -module.exports = CancelToken; + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } -/***/ }), + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } -/***/ 34098: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } -"use strict"; + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } -var AxiosError = __nccwpck_require__(72093); -var utils = __nccwpck_require__(20328); + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } -/** - * A `CanceledError` is an object that is thrown when an operation is canceled. - * - * @class - * @param {string=} message The message. - */ -function CanceledError(message) { - // eslint-disable-next-line no-eq-null,eqeqeq - AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED); - this.name = 'CanceledError'; -} - -utils.inherits(CanceledError, AxiosError, { - __CANCEL__: true -}); + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } -module.exports = CanceledError; + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } -/***/ }), + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } -/***/ 64057: -/***/ ((module) => { + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; -"use strict"; + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } -module.exports = function isCancel(value) { - return !!(value && value.__CANCEL__); -}; + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; -/***/ }), + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } -/***/ 98178: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); -"use strict"; + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + var isCommon = newValue === undefined; -var utils = __nccwpck_require__(20328); -var buildURL = __nccwpck_require__(30646); -var InterceptorManager = __nccwpck_require__(3214); -var dispatchRequest = __nccwpck_require__(85062); -var mergeConfig = __nccwpck_require__(74831); -var buildFullPath = __nccwpck_require__(41934); -var validator = __nccwpck_require__(51632); + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); -var validators = validator.validators; -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - */ -function Axios(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; -} + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } -/** - * Dispatch a request - * - * @param {Object} config The config specific for this request (merged with this.defaults) - */ -Axios.prototype.request = function request(configOrUrl, config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof configOrUrl === 'string') { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; - } + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } - config = mergeConfig(this.defaults, config); + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } - // Set config.method - if (config.method) { - config.method = config.method.toLowerCase(); - } else if (this.defaults.method) { - config.method = this.defaults.method.toLowerCase(); - } else { - config.method = 'get'; - } + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - var transitional = config.transitional; + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); - if (transitional !== undefined) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators.boolean), - forcedJSONParsing: validators.transitional(validators.boolean), - clarifyTimeoutError: validators.transitional(validators.boolean) - }, false); - } + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } - // filter out skipped interceptors - var requestInterceptorChain = []; - var synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); } - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); - var responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } - var promise; + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } - if (!synchronousRequestInterceptors) { - var chain = [dispatchRequest, undefined]; + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; - Array.prototype.unshift.apply(chain, requestInterceptorChain); - chain = chain.concat(responseInterceptorChain); + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; - promise = Promise.resolve(config); - while (chain.length) { - promise = promise.then(chain.shift(), chain.shift()); + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; } - return promise; - } - + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; - var newConfig = config; - while (requestInterceptorChain.length) { - var onFulfilled = requestInterceptorChain.shift(); - var onRejected = requestInterceptorChain.shift(); - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected(error); - break; + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; } - } - - try { - promise = dispatchRequest(newConfig); - } catch (error) { - return Promise.reject(error); - } - while (responseInterceptorChain.length) { - promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); - } + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } - return promise; -}; + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); -Axios.prototype.getUri = function getUri(config) { - config = mergeConfig(this.defaults, config); - var fullPath = buildFullPath(config.baseURL, config.url); - return buildURL(fullPath, config.params, config.paramsSerializer); -}; + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } -// Provide aliases for supported request methods -utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: (config || {}).data - })); - }; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - /*eslint func-names:0*/ - - function generateHTTPMethod(isForm) { - return function httpMethod(url, data, config) { - return this.request(mergeConfig(config || {}, { - method: method, - headers: isForm ? { - 'Content-Type': 'multipart/form-data' - } : {}, - url: url, - data: data - })); - }; - } - - Axios.prototype[method] = generateHTTPMethod(); + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); - Axios.prototype[method + 'Form'] = generateHTTPMethod(true); -}); + return result; + } -module.exports = Axios; + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } -/***/ }), + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } -/***/ 72093: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); -"use strict"; + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; -var utils = __nccwpck_require__(20328); + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } -/** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [config] The config. - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The created error. - */ -function AxiosError(message, code, config, request, response) { - Error.call(this); - this.message = message; - this.name = 'AxiosError'; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - response && (this.response = response); -} + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } -utils.inherits(AxiosError, Error, { - toJSON: function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: this.config, - code: this.code, - status: this.response && this.response.status ? this.response.status : null + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; }; - } -}); - -var prototype = AxiosError.prototype; -var descriptors = {}; - -[ - 'ERR_BAD_OPTION_VALUE', - 'ERR_BAD_OPTION', - 'ECONNABORTED', - 'ETIMEDOUT', - 'ERR_NETWORK', - 'ERR_FR_TOO_MANY_REDIRECTS', - 'ERR_DEPRECATED', - 'ERR_BAD_RESPONSE', - 'ERR_BAD_REQUEST', - 'ERR_CANCELED' -// eslint-disable-next-line func-names -].forEach(function(code) { - descriptors[code] = {value: code}; -}); - -Object.defineProperties(AxiosError, descriptors); -Object.defineProperty(prototype, 'isAxiosError', {value: true}); - -// eslint-disable-next-line func-names -AxiosError.from = function(error, code, config, request, response, customProps) { - var axiosError = Object.create(prototype); - - utils.toFlatObject(error, axiosError, function filter(obj) { - return obj !== Error.prototype; - }); - - AxiosError.call(axiosError, error.message, code, config, request, response); - axiosError.name = error.name; + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; - customProps && Object.assign(axiosError, customProps); + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } - return axiosError; -}; + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; -module.exports = AxiosError; + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } -/***/ }), + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; -/***/ 3214: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } -"use strict"; + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; -var utils = __nccwpck_require__(20328); + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } -function InterceptorManager() { - this.handlers = []; -} + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + var low = 0, + high = array == null ? 0 : array.length; + if (high === 0) { + return 0; + } -/** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ -InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled: fulfilled, - rejected: rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; -}; + value = iteratee(value); + var valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; -/** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - */ -InterceptorManager.prototype.eject = function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } -}; + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); -/** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - */ -InterceptorManager.prototype.forEach = function forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); } - }); -}; - -module.exports = InterceptorManager; + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; -/***/ }), + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; -/***/ 41934: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } -"use strict"; + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } -var isAbsoluteURL = __nccwpck_require__(41301); -var combineURLs = __nccwpck_require__(57189); + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * @returns {string} The combined full path - */ -module.exports = function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -}; - - -/***/ }), - -/***/ 85062: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var utils = __nccwpck_require__(20328); -var transformData = __nccwpck_require__(19812); -var isCancel = __nccwpck_require__(64057); -var defaults = __nccwpck_require__(21626); -var CanceledError = __nccwpck_require__(34098); + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; -/** - * Throws a `CanceledError` if cancellation has been requested. - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } - if (config.signal && config.signal.aborted) { - throw new CanceledError(); - } -} + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * @returns {Promise} The Promise to be fulfilled - */ -module.exports = function dispatchRequest(config) { - throwIfCancellationRequested(config); + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } - // Ensure headers exist - config.headers = config.headers || {}; + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; - // Transform request data - config.data = transformData.call( - config, - config.data, - config.headers, - config.transformRequest - ); + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} - // Flatten headers - config.headers = utils.merge( - config.headers.common || {}, - config.headers[config.method] || {}, - config.headers - ); + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } - utils.forEach( - ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], - function cleanHeaderConfig(method) { - delete config.headers[method]; + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); } - ); - var adapter = config.adapter || defaults.adapter; + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); + while (++index < length) { + var array = arrays[index], + othIndex = -1; - // Transform response data - response.data = transformData.call( - config, - response.data, - response.headers, - config.transformResponse - ); + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; - // Transform response data - if (reason && reason.response) { - reason.response.data = transformData.call( - config, - reason.response.data, - reason.response.headers, - config.transformResponse - ); + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); } + return result; } - return Promise.reject(reason); - }); -}; - + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } -/***/ }), + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } -/***/ 74831: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } -"use strict"; + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } -var utils = __nccwpck_require__(20328); + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * @returns {Object} New object resulting from merging config2 to config1 - */ -module.exports = function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config2 = config2 || {}; - var config = {}; + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - function getMergedValue(target, source) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge(target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); + buffer.copy(result); + return result; } - return source; - } - // eslint-disable-next-line consistent-return - function mergeDeepProperties(prop) { - if (!utils.isUndefined(config2[prop])) { - return getMergedValue(config1[prop], config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - return getMergedValue(undefined, config1[prop]); + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; } - } - // eslint-disable-next-line consistent-return - function valueFromConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - return getMergedValue(undefined, config2[prop]); + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } - } - // eslint-disable-next-line consistent-return - function defaultToConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - return getMergedValue(undefined, config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - return getMergedValue(undefined, config1[prop]); + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; } - } - // eslint-disable-next-line consistent-return - function mergeDirectKeys(prop) { - if (prop in config2) { - return getMergedValue(config1[prop], config2[prop]); - } else if (prop in config1) { - return getMergedValue(undefined, config1[prop]); + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } - } - var mergeMap = { - 'url': valueFromConfig2, - 'method': valueFromConfig2, - 'data': valueFromConfig2, - 'baseURL': defaultToConfig2, - 'transformRequest': defaultToConfig2, - 'transformResponse': defaultToConfig2, - 'paramsSerializer': defaultToConfig2, - 'timeout': defaultToConfig2, - 'timeoutMessage': defaultToConfig2, - 'withCredentials': defaultToConfig2, - 'adapter': defaultToConfig2, - 'responseType': defaultToConfig2, - 'xsrfCookieName': defaultToConfig2, - 'xsrfHeaderName': defaultToConfig2, - 'onUploadProgress': defaultToConfig2, - 'onDownloadProgress': defaultToConfig2, - 'decompress': defaultToConfig2, - 'maxContentLength': defaultToConfig2, - 'maxBodyLength': defaultToConfig2, - 'beforeRedirect': defaultToConfig2, - 'transport': defaultToConfig2, - 'httpAgent': defaultToConfig2, - 'httpsAgent': defaultToConfig2, - 'cancelToken': defaultToConfig2, - 'socketPath': defaultToConfig2, - 'responseEncoding': defaultToConfig2, - 'validateStatus': mergeDirectKeys - }; + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } - utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { - var merge = mergeMap[prop] || mergeDeepProperties; - var configValue = merge(prop); - (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); - }); + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); - return config; -}; + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } -/***/ }), - -/***/ 13211: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } -var AxiosError = __nccwpck_require__(72093); + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - */ -module.exports = function settle(resolve, reject, response) { - var validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(new AxiosError( - 'Request failed with status code ' + response.status, - [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], - response.config, - response.request, - response - )); - } -}; + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; -/***/ }), + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } -/***/ 19812: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; -"use strict"; + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); -var utils = __nccwpck_require__(20328); -var defaults = __nccwpck_require__(21626); + var index = -1, + length = props.length; -/** - * Transform the data for a request or a response - * - * @param {Object|String} data The data to be transformed - * @param {Array} headers The headers for the request or response - * @param {Array|Function} fns A single function or Array of functions - * @returns {*} The resulting transformed data - */ -module.exports = function transformData(data, headers, fns) { - var context = this || defaults; - /*eslint no-param-reassign:0*/ - utils.forEach(fns, function transform(fn) { - data = fn.call(context, data, headers); - }); + while (++index < length) { + var key = props[index]; - return data; -}; + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } -/***/ }), + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } -/***/ 17024: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } -// eslint-disable-next-line strict -module.exports = __nccwpck_require__(64334); + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } -/***/ }), + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; -/***/ 21626: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; -"use strict"; + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); -var utils = __nccwpck_require__(20328); -var normalizeHeaderName = __nccwpck_require__(36240); -var AxiosError = __nccwpck_require__(72093); -var transitionalDefaults = __nccwpck_require__(40936); -var toFormData = __nccwpck_require__(20470); + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } -var DEFAULT_CONTENT_TYPE = { - 'Content-Type': 'application/x-www-form-urlencoded' -}; + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; -function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { - headers['Content-Type'] = value; - } -} + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } -function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== 'undefined') { - // For browsers use XHR adapter - adapter = __nccwpck_require__(3454); - } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { - // For node use HTTP adapter - adapter = __nccwpck_require__(68104); - } - return adapter; -} + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); -function stringifySafely(rawValue, parser, encoder) { - if (utils.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); } + return wrapper; } - } - - return (encoder || JSON.stringify)(rawValue); -} -var defaults = { + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); - transitional: transitionalDefaults, + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; - adapter: getDefaultAdapter(), + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, 'Accept'); - normalizeHeaderName(headers, 'Content-Type'); + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); - if (utils.isFormData(data) || - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); - return data.toString(); + return chr[methodName]() + trailing; + }; } - var isObjectPayload = utils.isObject(data); - var contentType = headers && headers['Content-Type']; + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } - var isFileList; + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); - if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) { - var _FormData = this.env && this.env.FormData; - return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData()); - } else if (isObjectPayload || contentType === 'application/json') { - setContentTypeIfUnset(headers, 'application/json'); - return stringifySafely(data); + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; } - return data; - }], + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); - transformResponse: [function transformResponse(data) { - var transitional = this.transitional || defaults.transitional; - var silentJSONParsing = transitional && transitional.silentJSONParsing; - var forcedJSONParsing = transitional && transitional.forcedJSONParsing; - var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); - if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { - try { - return JSON.parse(data); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); - } - throw e; + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); } + return wrapper; } - return data; - }], + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; - maxContentLength: -1, - maxBodyLength: -1, + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; - env: { - FormData: __nccwpck_require__(17024) - }, + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; - headers: { - common: { - 'Accept': 'application/json, text/plain, */*' + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); } - } -}; -utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { - defaults.headers[method] = {}; -}); + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); -}); + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; -module.exports = defaults; + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } -/***/ }), + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } -/***/ 40936: -/***/ ((module) => { + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } -"use strict"; + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); -module.exports = { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false -}; + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); -/***/ }), + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; -/***/ 94322: -/***/ ((module) => { + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } -module.exports = { - "version": "0.27.2" -}; + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } -/***/ }), + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } -/***/ 77065: -/***/ ((module) => { + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; -"use strict"; + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; -module.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); } - return fn.apply(thisArg, args); - }; -}; + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); -/***/ }), - -/***/ 30646: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } -"use strict"; + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } -var utils = __nccwpck_require__(20328); + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; -function encode(val) { - return encodeURIComponent(val). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%20/g, '+'). - replace(/%5B/gi, '['). - replace(/%5D/gi, ']'); -} + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @returns {string} The formatted url - */ -module.exports = function buildURL(url, params, paramsSerializer) { - /*eslint no-param-reassign:0*/ - if (!params) { - return url; - } + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); - var serializedParams; - if (paramsSerializer) { - serializedParams = paramsSerializer(params); - } else if (utils.isURLSearchParams(params)) { - serializedParams = params.toString(); - } else { - var parts = []; + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; - utils.forEach(params, function serialize(val, key) { - if (val === null || typeof val === 'undefined') { - return; + if (data) { + mergeData(newData, data); } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); - if (utils.isArray(val)) { - key = key + '[]'; - } else { - val = [val]; + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); } - - utils.forEach(val, function parseValue(v) { - if (utils.isDate(v)) { - v = v.toISOString(); - } else if (utils.isObject(v)) { - v = JSON.stringify(v); - } - parts.push(encode(key) + '=' + encode(v)); - }); - }); - - serializedParams = parts.join('&'); - } - - if (serializedParams) { - var hashmarkIndex = url.indexOf('#'); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); } - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - - return url; -}; + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } -/***/ }), + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } -/***/ 57189: -/***/ ((module) => { + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; -"use strict"; + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + stack.set(array, other); + stack.set(other, array); -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * @returns {string} The combined URL - */ -module.exports = function combineURLs(baseURL, relativeURL) { - return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') - : baseURL; -}; + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } -/***/ }), + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; -/***/ 21545: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; -"use strict"; + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + case errorTag: + return object.name == other.name && object.message == other.message; -var utils = __nccwpck_require__(20328); + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); -module.exports = ( - utils.isStandardBrowserEnv() ? + case mapTag: + var convert = mapToArray; - // Standard browser envs support document.cookie - (function standardBrowserEnv() { - return { - write: function write(name, value, expires, path, domain, secure) { - var cookie = []; - cookie.push(name + '=' + encodeURIComponent(value)); + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); - if (utils.isNumber(expires)) { - cookie.push('expires=' + new Date(expires).toGMTString()); + if (object.size != other.size && !isPartial) { + return false; } - - if (utils.isString(path)) { - cookie.push('path=' + path); + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; } + bitmask |= COMPARE_UNORDERED_FLAG; - if (utils.isString(domain)) { - cookie.push('domain=' + domain); - } + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; - if (secure === true) { - cookie.push('secure'); + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); } + } + return false; + } - document.cookie = cookie.join('; '); - }, - - read: function read(name) { - var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); - return (match ? decodeURIComponent(match[3]) : null); - }, + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; - remove: function remove(name) { - this.write(name, '', Date.now() - 86400000); + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; } - }; - })() : - - // Non standard browser env (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return { - write: function write() {}, - read: function read() { return null; }, - remove: function remove() {} - }; - })() -); - - -/***/ }), - -/***/ 41301: -/***/ ((module) => { - -"use strict"; + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -module.exports = function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); -}; + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } -/***/ }), + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } -/***/ 60650: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } -"use strict"; + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; -var utils = __nccwpck_require__(20328); + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -module.exports = function isAxiosError(payload) { - return utils.isObject(payload) && (payload.isAxiosError === true); -}; + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } -/***/ }), + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } -/***/ 33608: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } -"use strict"; + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + while (length--) { + var key = result[length], + value = object[key]; -var utils = __nccwpck_require__(20328); + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } -module.exports = ( - utils.isStandardBrowserEnv() ? + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } - // Standard browser envs have full support of the APIs needed to test - // whether the request URL is of the same origin as current location. - (function standardBrowserEnv() { - var msie = /(msie|trident)/i.test(navigator.userAgent); - var urlParsingNode = document.createElement('a'); - var originURL; + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; - /** - * Parse a URL to discover it's components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function resolveURL(url) { - var href = url; + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; } + } + return result; + } - urlParsingNode.setAttribute('href', href); + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); } + return result; + }; - originURL = resolveURL(window.location.href); + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestURL The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - return function isURLSameOrigin(requestURL) { - var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; - return (parsed.protocol === originURL.protocol && - parsed.host === originURL.host); - }; - })() : + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; - // Non standard browser envs (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; }; - })() -); + } + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; -/***/ }), + while (++index < length) { + var data = transforms[index], + size = data.size; -/***/ 36240: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } -"use strict"; + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); -var utils = __nccwpck_require__(20328); + var index = -1, + length = path.length, + result = false; -module.exports = function normalizeHeaderName(headers, normalizedName) { - utils.forEach(headers, function processHeader(value, name) { - if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { - headers[normalizedName] = value; - delete headers[name]; + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); } - }); -}; + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); -/***/ }), + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } -/***/ 86455: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } -"use strict"; + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + case boolTag: + case dateTag: + return new Ctor(+object); -var utils = __nccwpck_require__(20328); + case dataViewTag: + return cloneDataView(object, isDeep); -// Headers whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -var ignoreDuplicateOf = [ - 'age', 'authorization', 'content-length', 'content-type', 'etag', - 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', - 'last-modified', 'location', 'max-forwards', 'proxy-authorization', - 'referer', 'retry-after', 'user-agent' -]; + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} headers Headers needing to be parsed - * @returns {Object} Headers parsed into an object - */ -module.exports = function parseHeaders(headers) { - var parsed = {}; - var key; - var val; - var i; + case mapTag: + return new Ctor; - if (!headers) { return parsed; } + case numberTag: + case stringTag: + return new Ctor(object); - utils.forEach(headers.split('\n'), function parser(line) { - i = line.indexOf(':'); - key = utils.trim(line.substr(0, i)).toLowerCase(); - val = utils.trim(line.substr(i + 1)); + case regexpTag: + return cloneRegExp(object); - if (key) { - if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { - return; + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); } - if (key === 'set-cookie') { - parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); - } else { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } - }); - return parsed; -}; + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; -/***/ }), + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } -/***/ 66107: -/***/ ((module) => { + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } -"use strict"; + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } -module.exports = function parseProtocol(url) { - var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); - return match && match[1] || ''; -}; + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } -/***/ }), + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } -/***/ 74850: -/***/ ((module) => { + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; -"use strict"; + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + return value === proto; + } -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * var args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * @returns {Function} - */ -module.exports = function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -}; + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } -/***/ }), + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); -/***/ 20470: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var cache = result.cache; + return result; + } -"use strict"; + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); -var utils = __nccwpck_require__(20328); + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; -/** - * Convert a data object to FormData - * @param {Object} obj - * @param {?Object} [formData] - * @returns {Object} - **/ + return data; + } -function toFormData(obj, formData) { - // eslint-disable-next-line no-param-reassign - formData = formData || new FormData(); + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } - var stack = []; + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } - function convertValue(value) { - if (value === null) return ''; + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); - if (utils.isDate(value)) { - return value.toISOString(); + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; } - if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { - return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); } - return value; - } + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); - function build(data, parentKey) { - if (utils.isPlainObject(data) || utils.isArray(data)) { - if (stack.indexOf(data) !== -1) { - throw Error('Circular reference detected in ' + parentKey); + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } + return array; + } - stack.push(data); - - utils.forEach(data, function each(value, key) { - if (utils.isUndefined(value)) return; - var fullKey = parentKey ? parentKey + '.' + key : key; - var arr; - - if (value && !parentKey && typeof value === 'object') { - if (utils.endsWith(key, '{}')) { - // eslint-disable-next-line no-param-reassign - value = JSON.stringify(value); - } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) { - // eslint-disable-next-line func-names - arr.forEach(function(el) { - !utils.isUndefined(el) && formData.append(fullKey, convertValue(el)); - }); - return; - } - } + /** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } - build(value, fullKey); - }); + if (key == '__proto__') { + return; + } - stack.pop(); - } else { - formData.append(parentKey, convertValue(data)); + return object[key]; } - } - - build(obj); - return formData; -} + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); -module.exports = toFormData; + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); -/***/ }), + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } -/***/ 51632: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; -"use strict"; + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } -var VERSION = (__nccwpck_require__(94322).version); -var AxiosError = __nccwpck_require__(72093); + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; -var validators = {}; + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; -// eslint-disable-next-line func-names -['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { - validators[type] = function validator(thing) { - return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; -}); + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } -var deprecatedWarnings = {}; + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); -/** - * Transitional option validator - * @param {function|boolean?} validator - set to false if the transitional option has been removed - * @param {string?} version - deprecated version / removed since version - * @param {string?} message - some message with additional info - * @returns {function} - */ -validators.transitional = function transitional(validator, version, message) { - function formatMessage(opt, desc) { - return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); - } + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } - // eslint-disable-next-line func-names - return function(value, opt, opts) { - if (validator === false) { - throw new AxiosError( - formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), - AxiosError.ERR_DEPRECATED - ); + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; } - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn( - formatMessage( - opt, - ' has been deprecated since v' + version + ' and will be removed in the near future' - ) - ); + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); } - return validator ? validator(value, opt, opts) : true; - }; -}; + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } -/** - * Assert object's properties type - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - */ + /*------------------------------------------------------------------------*/ -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object') { - throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); - } - var keys = Object.keys(options); - var i = keys.length; - while (i-- > 0) { - var opt = keys[i]; - var validator = schema[opt]; - if (validator) { - var value = options[opt]; - var result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); } - continue; - } - if (allowUnknown !== true) { - throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); - } - } -} - -module.exports = { - assertOptions: assertOptions, - validators: validators -}; - + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); -/***/ }), + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } -/***/ 20328: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; -"use strict"; + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; -var bind = __nccwpck_require__(77065); + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } -// utils is a library of generic helper functions non-specific to axios + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); -var toString = Object.prototype.toString; + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); -// eslint-disable-next-line func-names -var kindOf = (function(cache) { - // eslint-disable-next-line func-names - return function(thing) { - var str = toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); - }; -})(Object.create(null)); + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); -function kindOfTest(type) { - type = type.toLowerCase(); - return function isKindOf(thing) { - return kindOf(thing) === type; - }; -} + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } -/** - * Determine if a value is an Array - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Array, otherwise false - */ -function isArray(val) { - return Array.isArray(val); -} + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } -/** - * Determine if a value is undefined - * - * @param {Object} val The value to test - * @returns {boolean} True if the value is undefined, otherwise false - */ -function isUndefined(val) { - return typeof val === 'undefined'; -} + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } -/** - * Determine if a value is a Buffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) - && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); -} + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } -/** - * Determine if a value is an ArrayBuffer - * - * @function - * @param {Object} val The value to test - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -var isArrayBuffer = kindOfTest('ArrayBuffer'); + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); + } -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - var result; - if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { - result = ArrayBuffer.isView(val); - } else { - result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); - } - return result; -} - -/** - * Determine if a value is a String - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a String, otherwise false - */ -function isString(val) { - return typeof val === 'string'; -} - -/** - * Determine if a value is a Number - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Number, otherwise false - */ -function isNumber(val) { - return typeof val === 'number'; -} - -/** - * Determine if a value is an Object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Object, otherwise false - */ -function isObject(val) { - return val !== null && typeof val === 'object'; -} - -/** - * Determine if a value is a plain Object - * - * @param {Object} val The value to test - * @return {boolean} True if value is a plain Object, otherwise false - */ -function isPlainObject(val) { - if (kindOf(val) !== 'object') { - return false; - } - - var prototype = Object.getPrototypeOf(val); - return prototype === null || prototype === Object.prototype; -} + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } -/** - * Determine if a value is a Date - * - * @function - * @param {Object} val The value to test - * @returns {boolean} True if value is a Date, otherwise false - */ -var isDate = kindOfTest('Date'); + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } -/** - * Determine if a value is a File - * - * @function - * @param {Object} val The value to test - * @returns {boolean} True if value is a File, otherwise false - */ -var isFile = kindOfTest('File'); + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } -/** - * Determine if a value is a Blob - * - * @function - * @param {Object} val The value to test - * @returns {boolean} True if value is a Blob, otherwise false - */ -var isBlob = kindOfTest('Blob'); + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } -/** - * Determine if a value is a FileList - * - * @function - * @param {Object} val The value to test - * @returns {boolean} True if value is a File, otherwise false - */ -var isFileList = kindOfTest('FileList'); + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; -/** - * Determine if a value is a Function - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -function isFunction(val) { - return toString.call(val) === '[object Function]'; -} + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } -/** - * Determine if a value is a Stream - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Stream, otherwise false - */ -function isStream(val) { - return isObject(val) && isFunction(val.pipe); -} + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } -/** - * Determine if a value is a FormData - * - * @param {Object} thing The value to test - * @returns {boolean} True if value is an FormData, otherwise false - */ -function isFormData(thing) { - var pattern = '[object FormData]'; - return thing && ( - (typeof FormData === 'function' && thing instanceof FormData) || - toString.call(thing) === pattern || - (isFunction(thing.toString) && thing.toString() === pattern) - ); -} + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } -/** - * Determine if a value is a URLSearchParams object - * @function - * @param {Object} val The value to test - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -var isURLSearchParams = kindOfTest('URLSearchParams'); + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } -/** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * @returns {String} The String freed of excess whitespace - */ -function trim(str) { - return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); -} + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); -/** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - */ -function isStandardBrowserEnv() { - if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || - navigator.product === 'NativeScript' || - navigator.product === 'NS')) { - return false; - } - return ( - typeof window !== 'undefined' && - typeof document !== 'undefined' - ); -} + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - */ -function forEach(obj, fn) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); - if (isArray(obj)) { - // Iterate over array values - for (var i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Iterate over object keys - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - fn.call(null, obj[key], key, obj); + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); } - } -} -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * var result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * @returns {Object} Result of all merge properties - */ -function merge(/* obj1, obj2, obj3, ... */) { - var result = {}; - function assignValue(val, key) { - if (isPlainObject(result[key]) && isPlainObject(val)) { - result[key] = merge(result[key], val); - } else if (isPlainObject(val)) { - result[key] = merge({}, val); - } else if (isArray(val)) { - result[key] = val.slice(); - } else { - result[key] = val; - } - } - - for (var i = 0, l = arguments.length; i < l; i++) { - forEach(arguments[i], assignValue); - } - return result; -} - -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * @return {Object} The resulting value of object a - */ -function extend(a, b, thisArg) { - forEach(b, function assignValue(val, key) { - if (thisArg && typeof val === 'function') { - a[key] = bind(val, thisArg); - } else { - a[key] = val; + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; } - }); - return a; -} - -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * @return {string} content value without BOM - */ -function stripBOM(content) { - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1); - } - return content; -} - -/** - * Inherit the prototype methods from one constructor into another - * @param {function} constructor - * @param {function} superConstructor - * @param {object} [props] - * @param {object} [descriptors] - */ - -function inherits(constructor, superConstructor, props, descriptors) { - constructor.prototype = Object.create(superConstructor.prototype, descriptors); - constructor.prototype.constructor = constructor; - props && Object.assign(constructor.prototype, props); -} - -/** - * Resolve object with deep prototype chain to a flat object - * @param {Object} sourceObj source object - * @param {Object} [destObj] - * @param {Function} [filter] - * @returns {Object} - */ - -function toFlatObject(sourceObj, destObj, filter) { - var props; - var i; - var prop; - var merged = {}; - - destObj = destObj || {}; - do { - props = Object.getOwnPropertyNames(sourceObj); - i = props.length; - while (i-- > 0) { - prop = props[i]; - if (!merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); } - sourceObj = Object.getPrototypeOf(sourceObj); - } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); - - return destObj; -} - -/* - * determines whether a string ends with the characters of a specified string - * @param {String} str - * @param {String} searchString - * @param {Number} [position= 0] - * @returns {boolean} - */ -function endsWith(str, searchString, position) { - str = String(str); - if (position === undefined || position > str.length) { - position = str.length; - } - position -= searchString.length; - var lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; -} - - -/** - * Returns new array from array like object - * @param {*} [thing] - * @returns {Array} - */ -function toArray(thing) { - if (!thing) return null; - var i = thing.length; - if (isUndefined(i)) return null; - var arr = new Array(i); - while (i-- > 0) { - arr[i] = thing[i]; - } - return arr; -} - -// eslint-disable-next-line func-names -var isTypedArray = (function(TypedArray) { - // eslint-disable-next-line func-names - return function(thing) { - return TypedArray && thing instanceof TypedArray; - }; -})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array)); - -module.exports = { - isArray: isArray, - isArrayBuffer: isArrayBuffer, - isBuffer: isBuffer, - isFormData: isFormData, - isArrayBufferView: isArrayBufferView, - isString: isString, - isNumber: isNumber, - isObject: isObject, - isPlainObject: isPlainObject, - isUndefined: isUndefined, - isDate: isDate, - isFile: isFile, - isBlob: isBlob, - isFunction: isFunction, - isStream: isStream, - isURLSearchParams: isURLSearchParams, - isStandardBrowserEnv: isStandardBrowserEnv, - forEach: forEach, - merge: merge, - extend: extend, - trim: trim, - stripBOM: stripBOM, - inherits: inherits, - toFlatObject: toFlatObject, - kindOf: kindOf, - kindOfTest: kindOfTest, - endsWith: endsWith, - toArray: toArray, - isTypedArray: isTypedArray, - isFileList: isFileList -}; + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } -/***/ }), - -/***/ 9417: -/***/ ((module) => { + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); -"use strict"; + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } - var r = range(a, b, str); + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; + return result; + }); - if (ai >= 0 && bi > 0) { - if(a===b) { - return [ai, bi]; - } - begs = []; - left = str.length; + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); } - - bi = str.indexOf(b, i + 1); } - - i = ai < bi && ai >= 0 ? ai : bi; + basePullAt(array, indexes); + return result; } - if (begs.length) { - result = [ left, right ]; + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); } - } - - return result; -} - -/***/ }), - -/***/ 83682: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var register = __nccwpck_require__(44670) -var addHook = __nccwpck_require__(5549) -var removeHook = __nccwpck_require__(6819) + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } -// bind with array of arguments: https://stackoverflow.com/a/21792913 -var bind = Function.bind -var bindable = bind.bind(bind) - -function bindApi (hook, state, name) { - var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) - hook.api = { remove: removeHookRef } - hook.remove = removeHookRef - - ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { - var args = name ? [state, kind, name] : [state, kind] - hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) - }) -} + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } -function HookSingular () { - var singularHookName = 'h' - var singularHookState = { - registry: {} - } - var singularHook = register.bind(null, singularHookState, singularHookName) - bindApi(singularHook, singularHookState, singularHookName) - return singularHook -} + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } -function HookCollection () { - var state = { - registry: {} - } + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } - var hook = register.bind(null, state) - bindApi(hook, state) + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } - return hook -} + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } -var collectionHookDeprecationMessageDisplayed = false -function Hook () { - if (!collectionHookDeprecationMessageDisplayed) { - console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') - collectionHookDeprecationMessageDisplayed = true - } - return HookCollection() -} + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } -Hook.Singular = HookSingular.bind() -Hook.Collection = HookCollection.bind() + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } -module.exports = Hook -// expose constructors as a named property for TypeScript -module.exports.Hook = Hook -module.exports.Singular = Hook.Singular -module.exports.Collection = Hook.Collection + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; + } + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } -/***/ }), + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } -/***/ 5549: -/***/ ((module) => { + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } -module.exports = addHook; + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } -function addHook(state, kind, name, hook) { - var orig = hook; - if (!state.registry[name]) { - state.registry[name] = []; - } + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } - if (kind === "before") { - hook = function (method, options) { - return Promise.resolve() - .then(orig.bind(null, options)) - .then(method.bind(null, options)); - }; - } + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); - if (kind === "after") { - hook = function (method, options) { - var result; - return Promise.resolve() - .then(method.bind(null, options)) - .then(function (result_) { - result = result_; - return orig(result, options); - }) - .then(function () { - return result; - }); - }; - } + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); - if (kind === "error") { - hook = function (method, options) { - return Promise.resolve() - .then(method.bind(null, options)) - .catch(function (error) { - return orig(error, options); - }); - }; - } + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); - state.registry[name].push({ - hook: hook, - orig: orig, - }); -} - - -/***/ }), - -/***/ 44670: -/***/ ((module) => { - -module.exports = register; - -function register(state, name, method, options) { - if (typeof method !== "function") { - throw new Error("method for before hook must be a function"); - } - - if (!options) { - options = {}; - } - - if (Array.isArray(name)) { - return name.reverse().reduce(function (callback, name) { - return register.bind(null, state, name, callback, options); - }, method)(); - } - - return Promise.resolve().then(function () { - if (!state.registry[name]) { - return method(options); + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; } - return state.registry[name].reduce(function (method, registered) { - return registered.hook.bind(null, method, options); - }, method)(); - }); -} - - -/***/ }), - -/***/ 6819: -/***/ ((module) => { - -module.exports = removeHook; - -function removeHook(state, name, method) { - if (!state.registry[name]) { - return; - } - - var index = state.registry[name] - .map(function (registered) { - return registered.orig; - }) - .indexOf(method); + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } - if (index === -1) { - return; - } + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } - state.registry[name].splice(index, 1); -} + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } -/***/ }), + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); -/***/ 85443: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); -var util = __nccwpck_require__(73837); -var Stream = (__nccwpck_require__(12781).Stream); -var DelayedStream = __nccwpck_require__(18611); + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); - this._released = false; - this._streams = []; - this._currentStream = null; - this._insideLoop = false; - this._pendingNext = false; -} -util.inherits(CombinedStream, Stream); + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); -CombinedStream.create = function(options) { - var combinedStream = new this(); + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } - return combinedStream; -}; + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); + /*------------------------------------------------------------------------*/ - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - stream.on('data', this._checkDataSize.bind(this)); - stream = newStream; + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; } - this._handleErrors(stream); + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } - if (this.pauseStreams) { - stream.pause(); + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); } - } - this._streams.push(stream); - return this; -}; - -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; -}; - -CombinedStream.prototype._getNext = function() { - this._currentStream = null; - - if (this._insideLoop) { - this._pendingNext = true; - return; // defer call - } - - this._insideLoop = true; - try { - do { - this._pendingNext = false; - this._realGetNext(); - } while (this._pendingNext); - } finally { - this._insideLoop = false; - } -}; + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + */ + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; -CombinedStream.prototype._realGetNext = function() { - var stream = this._streams.shift(); + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } - if (typeof stream == 'undefined') { - this.end(); - return; - } + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); + return { 'done': done, 'value': value }; } - this._pipeNext(stream); - }.bind(this)); -}; + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)); - stream.pipe(this, {end: false}); - return; - } + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } - var value = stream; - this.write(value); - this._getNext(); -}; + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); - }); -}; + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; + /*------------------------------------------------------------------------*/ -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); - this.emit('pause'); -}; + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); - this.emit('resume'); -}; + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(findLastIndex); -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; - -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; - this._emitError(new Error(message)); -}; + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); } - self.dataSize += stream.dataSize; - }); + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } -}; + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; -/***/ }), + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); -/***/ 28222: -/***/ ((module, exports, __nccwpck_require__) => { + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); -/* eslint-env browser */ + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } -/** - * This is the web browser implementation of `debug()`. - */ + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); -exports.destroy = (() => { - let warned = false; + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); - return () => { - if (!warned) { - warned = true; - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - }; -})(); + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; -/** - * Colors. - */ + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } -exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' -]; - -/** - * 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 - */ - -// eslint-disable-next-line complexity -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' || window.process.__nwjs)) { - return true; - } - - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; - // 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+)/)); -} + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } -/** - * Colorize log arguments if enabled. - * - * @api public - */ + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } - if (!this.useColors) { - return; - } + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } - // 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 - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } - args.splice(lastC, 0, c); -} + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } -/** - * Invokes `console.debug()` when available. - * No-op when `console.debug` is not a "function". - * If `console.debug` is not available, falls back - * to `console.log`. - * - * @api public - */ -exports.log = console.debug || console.log || (() => {}); + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] + */ + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} + /*------------------------------------------------------------------------*/ -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug'); - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = ctxNow || function() { + return root.Date.now(); + }; - // 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; -} + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } -/** - * 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 - */ + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } -module.exports = __nccwpck_require__(46243)(exports); + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); -const {formatters} = module.exports; + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; -/***/ }), + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } -/***/ 46243: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = __nccwpck_require__(80900); - createDebug.destroy = destroy; + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } - /** - * The currently active debug mode names, and names to skip. - */ + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; - createDebug.names = []; - createDebug.skips = []; + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } - /** - * 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". - */ - createDebug.formatters = {}; + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; + function trailingEdge(time) { + timerId = undefined; - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); - const self = debug; + lastArgs = arguments; + lastThis = this; + lastCallTime = time; - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } - args[0] = createDebug.coerce(args[0]); + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return '%'; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const 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; - }); + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + // Expose `MapCache`. + memoize.Cache = MapCache; - Object.defineProperty(debug, 'enabled', { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; + } - return enabledCache; - }, - set: v => { - enableOverride = v; - } - }); + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } - // Env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); - return debug; - } + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); - createDebug.names = []; - createDebug.skips = []; + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } - namespaces = split[i].replace(/\*/g, '.*?'); + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } - } + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - let i; - let len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - - return false; - } - - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } - /** - * XXX DO NOT USE. This is a temporary stub function. - * XXX It WILL be removed in the next major release. - */ - function destroy() { - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } - createDebug.enable(createDebug.load()); + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } - return createDebug; -} + /*------------------------------------------------------------------------*/ -module.exports = setup; + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } -/***/ }), + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } -/***/ 38237: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } -/** - * Detect Electron renderer / nwjs process, which is node, but we should - * treat as a browser. - */ + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = __nccwpck_require__(28222); -} else { - module.exports = __nccwpck_require__(35332); -} + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } -/***/ }), + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + var gt = createRelationalOperation(baseGt); -/***/ 35332: -/***/ ((module, exports, __nccwpck_require__) => { + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); -/** - * Module dependencies. - */ + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; -const tty = __nccwpck_require__(76224); -const util = __nccwpck_require__(73837); + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; -/** - * This is the Node.js implementation of `debug()`. - */ + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.destroy = util.deprecate( - () => {}, - 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' -); + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -try { - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) - // eslint-disable-next-line import/no-extraneous-dependencies - const supportsColor = __nccwpck_require__(59318); - - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } -} catch (error) { - // Swallow - we only care if `supports-color` is available; it doesn't have to be. -} - -/** - * 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(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - - // Coerce string value into JS value - let 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; -}, {}); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - return 'colors' in exports.inspectOpts ? - Boolean(exports.inspectOpts.colors) : - tty.isatty(process.stderr.fd); -} - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs(args) { - const {namespace: name, useColors} = this; - - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; - - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} - -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } - return new Date().toISOString() + ' '; -} - -/** - * Invokes `util.format()` with the specified arguments and writes to stderr. - */ - -function log(...args) { - return process.stderr.write(util.format(...args) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - // 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; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * 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 = {}; - - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} - -module.exports = __nccwpck_require__(46243)(exports); - -const {formatters} = module.exports; - -/** - * Map %o to `util.inspect()`, all on a single line. - */ - -formatters.o = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .split('\n') - .map(str => str.trim()) - .join(' '); -}; - -/** - * Map %O to `util.inspect()`, allowing multiple lines if needed. - */ - -formatters.O = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; - - -/***/ }), - -/***/ 18611: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var Stream = (__nccwpck_require__(12781).Stream); -var util = __nccwpck_require__(73837); - -module.exports = DelayedStream; -function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; -} -util.inherits(DelayedStream, Stream); - -DelayedStream.create = function(source, options) { - var delayedStream = new this(); - - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - - delayedStream.source = source; - - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - - source.on('error', function() {}); - if (delayedStream.pauseStream) { - source.pause(); - } - - return delayedStream; -}; - -Object.defineProperty(DelayedStream.prototype, 'readable', { - configurable: true, - enumerable: true, - get: function() { - return this.source.readable; - } -}); - -DelayedStream.prototype.setEncoding = function() { - return this.source.setEncoding.apply(this.source, arguments); -}; - -DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - - this.source.resume(); -}; - -DelayedStream.prototype.pause = function() { - this.source.pause(); -}; - -DelayedStream.prototype.release = function() { - this._released = true; - - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; -}; - -DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; -}; - -DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - - if (args[0] === 'data') { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - - this._bufferedEvents.push(args); -}; - -DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - - if (this.dataSize <= this.maxDataSize) { - return; - } - - this._maxDataSizeExceeded = true; - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this.emit('error', new Error(message)); -}; - - -/***/ }), - -/***/ 58932: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -class Deprecation extends Error { - constructor(message) { - super(message); // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - - this.name = 'Deprecation'; - } - -} - -exports.Deprecation = Deprecation; - - -/***/ }), - -/***/ 31133: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var debug; - -module.exports = function () { - if (!debug) { - try { - /* eslint global-require: off */ - debug = __nccwpck_require__(38237)("follow-redirects"); - } - catch (error) { /* */ } - if (typeof debug !== "function") { - debug = function () { /* */ }; - } - } - debug.apply(null, arguments); -}; - - -/***/ }), - -/***/ 67707: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var url = __nccwpck_require__(57310); -var URL = url.URL; -var http = __nccwpck_require__(13685); -var https = __nccwpck_require__(95687); -var Writable = (__nccwpck_require__(12781).Writable); -var assert = __nccwpck_require__(39491); -var debug = __nccwpck_require__(31133); - -// Create handlers that pass events from native requests -var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; -var eventHandlers = Object.create(null); -events.forEach(function (event) { - eventHandlers[event] = function (arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; -}); - -// Error types with codes -var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "Redirected request failed" -); -var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded" -); -var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" -); -var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" -); - -// An HTTP(S) request that can be redirected -function RedirectableRequest(options, responseCallback) { - // Initialize the request - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - - // Attach a callback if passed - if (responseCallback) { - this.on("response", responseCallback); - } - - // React to responses of native requests - var self = this; - this._onNativeResponse = function (response) { - self._processResponse(response); - }; - - // Perform the first request - this._performRequest(); -} -RedirectableRequest.prototype = Object.create(Writable.prototype); - -RedirectableRequest.prototype.abort = function () { - abortRequest(this._currentRequest); - this.emit("abort"); -}; - -// Writes buffered data to the current native request -RedirectableRequest.prototype.write = function (data, encoding, callback) { - // Writing is not allowed if end has been called - if (this._ending) { - throw new WriteAfterEndError(); - } - - // Validate input and shift parameters if necessary - if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (typeof encoding === "function") { - callback = encoding; - encoding = null; - } - - // Ignore empty buffers, since writing them doesn't invoke the callback - // https://github.com/nodejs/node/issues/22066 - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - // Only write when we don't exceed the maximum body length - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data: data, encoding: encoding }); - this._currentRequest.write(data, encoding, callback); - } - // Error when we exceed the maximum body length - else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } -}; - -// Ends the current native request -RedirectableRequest.prototype.end = function (data, encoding, callback) { - // Shift parameters if necessary - if (typeof data === "function") { - callback = data; - data = encoding = null; - } - else if (typeof encoding === "function") { - callback = encoding; - encoding = null; - } - - // Write data if needed and end - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } - else { - var self = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function () { - self._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } -}; - -// Sets a header value on the current native request -RedirectableRequest.prototype.setHeader = function (name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); -}; - -// Clears a header value on the current native request -RedirectableRequest.prototype.removeHeader = function (name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); -}; - -// Global timeout for all underlying requests -RedirectableRequest.prototype.setTimeout = function (msecs, callback) { - var self = this; - - // Destroys the socket on timeout - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } - - // Sets up a timer to trigger a timeout event - function startTimer(socket) { - if (self._timeout) { - clearTimeout(self._timeout); - } - self._timeout = setTimeout(function () { - self.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - - // Stops a timeout from triggering - function clearTimer() { - // Clear the timeout - if (self._timeout) { - clearTimeout(self._timeout); - self._timeout = null; - } - - // Clean up all attached listeners - self.removeListener("abort", clearTimer); - self.removeListener("error", clearTimer); - self.removeListener("response", clearTimer); - if (callback) { - self.removeListener("timeout", callback); - } - if (!self.socket) { - self._currentRequest.removeListener("socket", startTimer); - } - } - - // Attach callback if passed - if (callback) { - this.on("timeout", callback); - } - - // Start the timer if or when the socket is opened - if (this.socket) { - startTimer(this.socket); - } - else { - this._currentRequest.once("socket", startTimer); - } - - // Clean up on events - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - - return this; -}; - -// Proxy all other public ClientRequest methods -[ - "flushHeaders", "getHeader", - "setNoDelay", "setSocketKeepAlive", -].forEach(function (method) { - RedirectableRequest.prototype[method] = function (a, b) { - return this._currentRequest[method](a, b); - }; -}); - -// Proxy all public ClientRequest properties -["aborted", "connection", "socket"].forEach(function (property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function () { return this._currentRequest[property]; }, - }); -}); - -RedirectableRequest.prototype._sanitizeOptions = function (options) { - // Ensure headers are always present - if (!options.headers) { - options.headers = {}; - } - - // Since http.request treats host as an alias of hostname, - // but the url module interprets host as hostname plus port, - // eliminate the host property to avoid confusion. - if (options.host) { - // Use hostname if set, because it has precedence - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - - // Complete the URL object when necessary - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } - else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } -}; - - -// Executes the next native request (initial or redirect) -RedirectableRequest.prototype._performRequest = function () { - // Load the native protocol - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - this.emit("error", new TypeError("Unsupported protocol " + protocol)); - return; - } - - // If specified, use the agent corresponding to the protocol - // (HTTP and HTTPS use different types of agents) - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; - } - - // Create the native request and set up its event handlers - var request = this._currentRequest = - nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); - } - - // RFC7230§5.3.1: When making a request directly to an origin server, […] - // a client MUST send only the absolute path […] as the request-target. - this._currentUrl = /^\//.test(this._options.path) ? - url.format(this._options) : - // When making a request to a proxy, […] - // a client MUST send the target URI in absolute-form […]. - this._currentUrl = this._options.path; - - // End a redirected request - // (The first request must be ended explicitly with RedirectableRequest#end) - if (this._isRedirect) { - // Write the request entity and end - var i = 0; - var self = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - // Only write if this request has not been redirected yet - /* istanbul ignore else */ - if (request === self._currentRequest) { - // Report any write errors - /* istanbul ignore if */ - if (error) { - self.emit("error", error); - } - // Write the next buffer if there are still left - else if (i < buffers.length) { - var buffer = buffers[i++]; - /* istanbul ignore else */ - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } - // End the request if `end` has been called on us - else if (self._ended) { - request.end(); - } - } - }()); - } -}; - -// Processes a response from the current native request -RedirectableRequest.prototype._processResponse = function (response) { - // Store the redirected response - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode: statusCode, - }); - } - - // RFC7231§6.4: The 3xx (Redirection) class of status code indicates - // that further action needs to be taken by the user agent in order to - // fulfill the request. If a Location header field is provided, - // the user agent MAY automatically redirect its request to the URI - // referenced by the Location field value, - // even if the specific status code is not understood. - - // If the response is not a redirect; return it as-is - var location = response.headers.location; - if (!location || this._options.followRedirects === false || - statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - - // Clean up - this._requestBodyBuffers = []; - return; - } - - // The response is a redirect, so abort the current request - abortRequest(this._currentRequest); - // Discard the remainder of the response to avoid waiting for data - response.destroy(); - - // RFC7231§6.4: A client SHOULD detect and intervene - // in cyclical redirections (i.e., "infinite" redirection loops). - if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new TooManyRedirectsError()); - return; - } - - // Store the request headers if applicable - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - // The Host header was set by nativeProtocol.request - Host: response.req.getHeader("host"), - }, this._options.headers); - } - - // RFC7231§6.4: Automatic redirection needs to done with - // care for methods not known to be safe, […] - // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change - // the request method from POST to GET for the subsequent request. - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || - // RFC7231§6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource […] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) […] - (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - // Drop a possible entity and headers related to it - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } - - // Drop the Host header, as the redirect might lead to a different host - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); - - // If the redirect is relative, carry over the host of the last request - var currentUrlParts = url.parse(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : - url.format(Object.assign(currentUrlParts, { host: currentHost })); - - // Determine the URL of the redirection - var redirectUrl; - try { - redirectUrl = url.resolve(currentUrl, location); - } - catch (cause) { - this.emit("error", new RedirectionError(cause)); - return; - } - - // Create the redirected request - debug("redirecting to", redirectUrl); - this._isRedirect = true; - var redirectUrlParts = url.parse(redirectUrl); - Object.assign(this._options, redirectUrlParts); - - // Drop confidential headers when redirecting to a less secure protocol - // or to a different domain that is not a superdomain - if (redirectUrlParts.protocol !== currentUrlParts.protocol && - redirectUrlParts.protocol !== "https:" || - redirectUrlParts.host !== currentHost && - !isSubdomain(redirectUrlParts.host, currentHost)) { - removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); - } - - // Evaluate the beforeRedirect callback - if (typeof beforeRedirect === "function") { - var responseDetails = { - headers: response.headers, - statusCode: statusCode, - }; - var requestDetails = { - url: currentUrl, - method: method, - headers: requestHeaders, - }; - try { - beforeRedirect(this._options, responseDetails, requestDetails); - } - catch (err) { - this.emit("error", err); - return; - } - this._sanitizeOptions(this._options); - } - - // Perform the redirected request - try { - this._performRequest(); - } - catch (cause) { - this.emit("error", new RedirectionError(cause)); - } -}; - -// Wraps the key/value object of protocols with redirect functionality -function wrap(protocols) { - // Default settings - var exports = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024, - }; - - // Wrap each protocol - var nativeProtocols = {}; - Object.keys(protocols).forEach(function (scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); - - // Executes a request, following redirects - function request(input, options, callback) { - // Parse parameters - if (typeof input === "string") { - var urlStr = input; - try { - input = urlToOptions(new URL(urlStr)); - } - catch (err) { - /* istanbul ignore next */ - input = url.parse(urlStr); - } - } - else if (URL && (input instanceof URL)) { - input = urlToOptions(input); - } - else { - callback = options; - options = input; - input = { protocol: protocol }; - } - if (typeof options === "function") { - callback = options; - options = null; - } - - // Set defaults - options = Object.assign({ - maxRedirects: exports.maxRedirects, - maxBodyLength: exports.maxBodyLength, - }, input, options); - options.nativeProtocols = nativeProtocols; - - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } - - // Executes a GET request, following redirects - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } - - // Expose the properties on the wrapped protocol - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true }, - }); - }); - return exports; -} - -/* istanbul ignore next */ -function noop() { /* empty */ } - -// from https://github.com/nodejs/node/blob/master/lib/internal/url.js -function urlToOptions(urlObject) { - var options = { - protocol: urlObject.protocol, - hostname: urlObject.hostname.startsWith("[") ? - /* istanbul ignore next */ - urlObject.hostname.slice(1, -1) : - urlObject.hostname, - hash: urlObject.hash, - search: urlObject.search, - pathname: urlObject.pathname, - path: urlObject.pathname + urlObject.search, - href: urlObject.href, - }; - if (urlObject.port !== "") { - options.port = Number(urlObject.port); - } - return options; -} - -function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return (lastValue === null || typeof lastValue === "undefined") ? - undefined : String(lastValue).trim(); -} - -function createErrorType(code, defaultMessage) { - function CustomError(cause) { - Error.captureStackTrace(this, this.constructor); - if (!cause) { - this.message = defaultMessage; - } - else { - this.message = defaultMessage + ": " + cause.message; - this.cause = cause; - } - } - CustomError.prototype = new Error(); - CustomError.prototype.constructor = CustomError; - CustomError.prototype.name = "Error [" + code + "]"; - CustomError.prototype.code = code; - return CustomError; -} - -function abortRequest(request) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.abort(); -} - -function isSubdomain(subdomain, domain) { - const dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); -} - -// Exports -module.exports = wrap({ http: http, https: https }); -module.exports.wrap = wrap; - - -/***/ }), - -/***/ 64334: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var CombinedStream = __nccwpck_require__(85443); -var util = __nccwpck_require__(73837); -var path = __nccwpck_require__(71017); -var http = __nccwpck_require__(13685); -var https = __nccwpck_require__(95687); -var parseUrl = (__nccwpck_require__(57310).parse); -var fs = __nccwpck_require__(57147); -var Stream = (__nccwpck_require__(12781).Stream); -var mime = __nccwpck_require__(43583); -var asynckit = __nccwpck_require__(14812); -var populate = __nccwpck_require__(17142); - -// Public API -module.exports = FormData; - -// make it a Stream -util.inherits(FormData, CombinedStream); - -/** - * Create readable "multipart/form-data" streams. - * Can be used to submit forms - * and file uploads to other web applications. - * - * @constructor - * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream - */ -function FormData(options) { - if (!(this instanceof FormData)) { - return new FormData(options); - } - - this._overheadLength = 0; - this._valueLength = 0; - this._valuesToMeasure = []; - - CombinedStream.call(this); - - options = options || {}; - for (var option in options) { - this[option] = options[option]; - } -} - -FormData.LINE_BREAK = '\r\n'; -FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; - -FormData.prototype.append = function(field, value, options) { - - options = options || {}; - - // allow filename as single option - if (typeof options == 'string') { - options = {filename: options}; - } - - var append = CombinedStream.prototype.append.bind(this); - - // all that streamy business can't handle numbers - if (typeof value == 'number') { - value = '' + value; - } - - // https://github.com/felixge/node-form-data/issues/38 - if (util.isArray(value)) { - // Please convert your array into string - // the way web server expects it - this._error(new Error('Arrays are not supported.')); - return; - } - - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(); - - append(header); - append(value); - append(footer); - - // pass along options.knownLength - this._trackLength(header, value, options); -}; - -FormData.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - - // used w/ getLengthSync(), when length is known. - // e.g. for streaming directly from a remote server, - // w/ a known file a size, and not wanting to wait for - // incoming file to finish to get its size. - if (options.knownLength != null) { - valueLength += +options.knownLength; - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === 'string') { - valueLength = Buffer.byteLength(value); - } - - this._valueLength += valueLength; - - // @check why add CRLF? does this account for custom/multiple CRLFs? - this._overheadLength += - Buffer.byteLength(header) + - FormData.LINE_BREAK.length; - - // empty or either doesn't have path or not an http response or not a stream - if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) { - return; - } - - // no need to bother with the length - if (!options.knownLength) { - this._valuesToMeasure.push(value); - } -}; - -FormData.prototype._lengthRetriever = function(value, callback) { - - if (value.hasOwnProperty('fd')) { - - // take read range into a account - // `end` = Infinity –> read file till the end - // - // TODO: Looks like there is bug in Node fs.createReadStream - // it doesn't respect `end` options without `start` options - // Fix it when node fixes it. - // https://github.com/joyent/node/issues/7819 - if (value.end != undefined && value.end != Infinity && value.start != undefined) { - - // when end specified - // no need to calculate range - // inclusive, starts with 0 - callback(null, value.end + 1 - (value.start ? value.start : 0)); - - // not that fast snoopy - } else { - // still need to fetch file size from fs - fs.stat(value.path, function(err, stat) { - - var fileSize; - - if (err) { - callback(err); - return; - } - - // update final size based on the range options - fileSize = stat.size - (value.start ? value.start : 0); - callback(null, fileSize); - }); - } - - // or http response - } else if (value.hasOwnProperty('httpVersion')) { - callback(null, +value.headers['content-length']); - - // or request stream http://github.com/mikeal/request - } else if (value.hasOwnProperty('httpModule')) { - // wait till response come back - value.on('response', function(response) { - value.pause(); - callback(null, +response.headers['content-length']); - }); - value.resume(); - - // something else - } else { - callback('Unknown stream'); - } -}; - -FormData.prototype._multiPartHeader = function(field, value, options) { - // custom header specified (as string)? - // it becomes responsible for boundary - // (e.g. to handle extra CRLFs on .NET servers) - if (typeof options.header == 'string') { - return options.header; - } - - var contentDisposition = this._getContentDisposition(value, options); - var contentType = this._getContentType(value, options); - - var contents = ''; - var headers = { - // add custom disposition as third element or keep it two elements if not - 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), - // if no content type. allow it to be empty array - 'Content-Type': [].concat(contentType || []) - }; - - // allow custom headers. - if (typeof options.header == 'object') { - populate(headers, options.header); - } - - var header; - for (var prop in headers) { - if (!headers.hasOwnProperty(prop)) continue; - header = headers[prop]; - - // skip nullish headers. - if (header == null) { - continue; - } - - // convert all headers to arrays. - if (!Array.isArray(header)) { - header = [header]; - } - - // add non-empty headers. - if (header.length) { - contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; - } - } - - return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; -}; - -FormData.prototype._getContentDisposition = function(value, options) { - - var filename - , contentDisposition - ; - - if (typeof options.filepath === 'string') { - // custom filepath for relative paths - filename = path.normalize(options.filepath).replace(/\\/g, '/'); - } else if (options.filename || value.name || value.path) { - // custom filename take precedence - // formidable and the browser add a name property - // fs- and request- streams have path property - filename = path.basename(options.filename || value.name || value.path); - } else if (value.readable && value.hasOwnProperty('httpVersion')) { - // or try http response - filename = path.basename(value.client._httpMessage.path || ''); - } - - if (filename) { - contentDisposition = 'filename="' + filename + '"'; - } - - return contentDisposition; -}; - -FormData.prototype._getContentType = function(value, options) { - - // use custom content-type above all - var contentType = options.contentType; - - // or try `name` from formidable, browser - if (!contentType && value.name) { - contentType = mime.lookup(value.name); - } - - // or try `path` from fs-, request- streams - if (!contentType && value.path) { - contentType = mime.lookup(value.path); - } - - // or if it's http-reponse - if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { - contentType = value.headers['content-type']; - } - - // or guess it from the filepath or filename - if (!contentType && (options.filepath || options.filename)) { - contentType = mime.lookup(options.filepath || options.filename); - } - - // fallback to the default content type if `value` is not simple value - if (!contentType && typeof value == 'object') { - contentType = FormData.DEFAULT_CONTENT_TYPE; - } - - return contentType; -}; - -FormData.prototype._multiPartFooter = function() { - return function(next) { - var footer = FormData.LINE_BREAK; - - var lastPart = (this._streams.length === 0); - if (lastPart) { - footer += this._lastBoundary(); - } - - next(footer); - }.bind(this); -}; - -FormData.prototype._lastBoundary = function() { - return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; -}; - -FormData.prototype.getHeaders = function(userHeaders) { - var header; - var formHeaders = { - 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() - }; - - for (header in userHeaders) { - if (userHeaders.hasOwnProperty(header)) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - } - - return formHeaders; -}; - -FormData.prototype.setBoundary = function(boundary) { - this._boundary = boundary; -}; - -FormData.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } - - return this._boundary; -}; - -FormData.prototype.getBuffer = function() { - var dataBuffer = new Buffer.alloc( 0 ); - var boundary = this.getBoundary(); - - // Create the form content. Add Line breaks to the end of data. - for (var i = 0, len = this._streams.length; i < len; i++) { - if (typeof this._streams[i] !== 'function') { - - // Add content to the buffer. - if(Buffer.isBuffer(this._streams[i])) { - dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]); - }else { - dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]); - } - - // Add break after content. - if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) { - dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] ); - } - } - } - - // Add the footer and return the Buffer object. - return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] ); -}; - -FormData.prototype._generateBoundary = function() { - // This generates a 50 character boundary similar to those used by Firefox. - // They are optimized for boyer-moore parsing. - var boundary = '--------------------------'; - for (var i = 0; i < 24; i++) { - boundary += Math.floor(Math.random() * 10).toString(16); - } - - this._boundary = boundary; -}; - -// Note: getLengthSync DOESN'T calculate streams length -// As workaround one can calculate file size manually -// and add it as knownLength option -FormData.prototype.getLengthSync = function() { - var knownLength = this._overheadLength + this._valueLength; - - // Don't get confused, there are 3 "internal" streams for each keyval pair - // so it basically checks if there is any value added to the form - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - // https://github.com/form-data/form-data/issues/40 - if (!this.hasKnownLength()) { - // Some async length retrievers are present - // therefore synchronous length calculation is false. - // Please use getLength(callback) to get proper length - this._error(new Error('Cannot calculate proper length in synchronous way.')); - } - - return knownLength; -}; - -// Public API to check if length of added values is known -// https://github.com/form-data/form-data/issues/196 -// https://github.com/form-data/form-data/issues/262 -FormData.prototype.hasKnownLength = function() { - var hasKnownLength = true; - - if (this._valuesToMeasure.length) { - hasKnownLength = false; - } - - return hasKnownLength; -}; - -FormData.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - if (!this._valuesToMeasure.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } - - asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { - if (err) { - cb(err); - return; - } - - values.forEach(function(length) { - knownLength += length; - }); - - cb(null, knownLength); - }); -}; - -FormData.prototype.submit = function(params, cb) { - var request - , options - , defaults = {method: 'post'} - ; - - // parse provided url if it's string - // or treat it as options object - if (typeof params == 'string') { - - params = parseUrl(params); - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname, - protocol: params.protocol - }, defaults); - - // use custom params - } else { - - options = populate(params, defaults); - // if no port provided use default one - if (!options.port) { - options.port = options.protocol == 'https:' ? 443 : 80; - } - } - - // put that good code in getHeaders to some use - options.headers = this.getHeaders(params.headers); - - // https if specified, fallback to http in any other case - if (options.protocol == 'https:') { - request = https.request(options); - } else { - request = http.request(options); - } - - // get content length and fire away - this.getLength(function(err, length) { - if (err && err !== 'Unknown stream') { - this._error(err); - return; - } - - // add content length - if (length) { - request.setHeader('Content-Length', length); - } - - this.pipe(request); - if (cb) { - var onResponse; - - var callback = function (error, responce) { - request.removeListener('error', callback); - request.removeListener('response', onResponse); - - return cb.call(this, error, responce); - }; - - onResponse = callback.bind(this, null); - - request.on('error', callback); - request.on('response', onResponse); - } - }.bind(this)); - - return request; -}; - -FormData.prototype._error = function(err) { - if (!this.error) { - this.error = err; - this.pause(); - this.emit('error', err); - } -}; - -FormData.prototype.toString = function () { - return '[object FormData]'; -}; - - -/***/ }), - -/***/ 17142: -/***/ ((module) => { - -// populates missing values -module.exports = function(dst, src) { - - Object.keys(src).forEach(function(prop) - { - dst[prop] = dst[prop] || src[prop]; - }); - - return dst; -}; - - -/***/ }), - -/***/ 46863: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = realpath -realpath.realpath = realpath -realpath.sync = realpathSync -realpath.realpathSync = realpathSync -realpath.monkeypatch = monkeypatch -realpath.unmonkeypatch = unmonkeypatch - -var fs = __nccwpck_require__(57147) -var origRealpath = fs.realpath -var origRealpathSync = fs.realpathSync - -var version = process.version -var ok = /^v[0-5]\./.test(version) -var old = __nccwpck_require__(71734) - -function newError (er) { - return er && er.syscall === 'realpath' && ( - er.code === 'ELOOP' || - er.code === 'ENOMEM' || - er.code === 'ENAMETOOLONG' - ) -} - -function realpath (p, cache, cb) { - if (ok) { - return origRealpath(p, cache, cb) - } - - if (typeof cache === 'function') { - cb = cache - cache = null - } - origRealpath(p, cache, function (er, result) { - if (newError(er)) { - old.realpath(p, cache, cb) - } else { - cb(er, result) - } - }) -} - -function realpathSync (p, cache) { - if (ok) { - return origRealpathSync(p, cache) - } - - try { - return origRealpathSync(p, cache) - } catch (er) { - if (newError(er)) { - return old.realpathSync(p, cache) - } else { - throw er - } - } -} - -function monkeypatch () { - fs.realpath = realpath - fs.realpathSync = realpathSync -} - -function unmonkeypatch () { - fs.realpath = origRealpath - fs.realpathSync = origRealpathSync -} - - -/***/ }), - -/***/ 71734: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var pathModule = __nccwpck_require__(71017); -var isWindows = process.platform === 'win32'; -var fs = __nccwpck_require__(57147); - -// JavaScript implementation of realpath, ported from node pre-v6 - -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - var callback; - if (DEBUG) { - var backtrace = new Error; - callback = debugCallback; - } else - callback = missingCallback; - - return callback; - - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } - } - - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - else if (!process.noDeprecation) { - var msg = 'fs: missing callback ' + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } - } -} - -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} - -var normalize = pathModule.normalize; - -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} - -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} - -exports.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } - - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } - - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } - - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - - if (cache) cache[original] = p; - - return p; -}; - - -exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; - } - - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } - - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } - - return fs.lstat(base, gotStat); - } - - function gotStat(err, stat) { - if (err) return cb(err); - - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } - - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); - - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } - - function gotTarget(err, target, base) { - if (err) return cb(err); - - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } - - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } -}; - - -/***/ }), - -/***/ 47625: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var fs = __nccwpck_require__(57147) -var path = __nccwpck_require__(71017) -var minimatch = __nccwpck_require__(36453) -var isAbsolute = (__nccwpck_require__(71017).isAbsolute) -var Minimatch = minimatch.Minimatch - -function alphasort (a, b) { - return a.localeCompare(b, 'en') -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } - - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute - self.fs = options.fs || fs - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = path.resolve(cwd) - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - self.nomount = !!options.nomount - - if (process.platform === "win32") { - self.root = self.root.replace(/\\/g, "/") - self.cwd = self.cwd.replace(/\\/g, "/") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - } - - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true - // always treat \ in patterns as escapes, not path separators - options.allowWindowsEscape = true - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') - - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - - -/***/ }), - -/***/ 91957: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var rp = __nccwpck_require__(46863) -var minimatch = __nccwpck_require__(36453) -var Minimatch = minimatch.Minimatch -var inherits = __nccwpck_require__(44124) -var EE = (__nccwpck_require__(82361).EventEmitter) -var path = __nccwpck_require__(71017) -var assert = __nccwpck_require__(39491) -var isAbsolute = (__nccwpck_require__(71017).isAbsolute) -var globSync = __nccwpck_require__(29010) -var common = __nccwpck_require__(47625) -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = __nccwpck_require__(52492) -var util = __nccwpck_require__(73837) -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = __nccwpck_require__(1223) - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } - - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin -} - -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - - if (!pattern) - return false - - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - this._processing = 0 - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - var sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - sync = false - - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() - } - } - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || - isAbsolute(pattern.map(function (p) { - return typeof p === 'string' ? p : '[*]' - }).join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (isIgnored(this, e)) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = isAbsolute(e) ? e : this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) - e = abs - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - self.fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() - - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - self.fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } - - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - self.fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return self.fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return cb() - - return cb(null, c, stat) -} - - -/***/ }), - -/***/ 51046: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var balanced = __nccwpck_require__(9417); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m) return [str]; - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - if (/\$$/.test(m.pre)) { - for (var k = 0; k < post.length; k++) { - var expansion = pre+ '{' + m.body + '}' + post[k]; - expansions.push(expansion); - } - } else { - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = []; - - for (var j = 0; j < n.length; j++) { - N.push.apply(N, expand(n[j], false)); - } - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - } - - return expansions; -} - - - -/***/ }), - -/***/ 73438: -/***/ ((module) => { - -const isWindows = typeof process === 'object' && - process && - process.platform === 'win32' -module.exports = isWindows ? { sep: '\\' } : { sep: '/' } - - -/***/ }), - -/***/ 36453: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const minimatch = module.exports = (p, pattern, options = {}) => { - assertValidPattern(pattern) - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - return new Minimatch(pattern, options).match(p) -} - -module.exports = minimatch - -const path = __nccwpck_require__(73438) -minimatch.sep = path.sep - -const GLOBSTAR = Symbol('globstar **') -minimatch.GLOBSTAR = GLOBSTAR -const expand = __nccwpck_require__(51046) - -const plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -const qmark = '[^/]' - -// * => any number of characters -const star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -const twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -const twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// "abc" -> { a:true, b:true, c:true } -const charSet = s => s.split('').reduce((set, c) => { - set[c] = true - return set -}, {}) - -// characters that need to be escaped in RegExp. -const reSpecials = charSet('().*{}+?[]^$\\!') - -// characters that indicate we have to add the pattern start -const addPatternStartSet = charSet('[.(') - -// normalizes slashes. -const slashSplit = /\/+/ - -minimatch.filter = (pattern, options = {}) => - (p, i, list) => minimatch(p, pattern, options) - -const ext = (a, b = {}) => { - const t = {} - Object.keys(a).forEach(k => t[k] = a[k]) - Object.keys(b).forEach(k => t[k] = b[k]) - return t -} - -minimatch.defaults = def => { - if (!def || typeof def !== 'object' || !Object.keys(def).length) { - return minimatch - } - - const orig = minimatch - - const m = (p, pattern, options) => orig(p, pattern, ext(def, options)) - m.Minimatch = class Minimatch extends orig.Minimatch { - constructor (pattern, options) { - super(pattern, ext(def, options)) - } - } - m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch - m.filter = (pattern, options) => orig.filter(pattern, ext(def, options)) - m.defaults = options => orig.defaults(ext(def, options)) - m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options)) - m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options)) - m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options)) - - return m -} - - - - - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options) - -const braceExpand = (pattern, options = {}) => { - assertValidPattern(pattern) - - // Thanks to Yeting Li for - // improving this regexp to avoid a ReDOS vulnerability. - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -const MAX_PATTERN_LENGTH = 1024 * 64 -const assertValidPattern = pattern => { - if (typeof pattern !== 'string') { - throw new TypeError('invalid pattern') - } - - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError('pattern is too long') - } -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -const SUBPARSE = Symbol('subparse') - -minimatch.makeRe = (pattern, options) => - new Minimatch(pattern, options || {}).makeRe() - -minimatch.match = (list, pattern, options = {}) => { - const mm = new Minimatch(pattern, options) - list = list.filter(f => mm.match(f)) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -// replace stuff like \* with * -const globUnescape = s => s.replace(/\\(.)/g, '$1') -const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') - -class Minimatch { - constructor (pattern, options) { - assertValidPattern(pattern) - - if (!options) options = {} - - this.options = options - this.set = [] - this.pattern = pattern - this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || - options.allowWindowsEscape === false - if (this.windowsPathsNoEscape) { - this.pattern = this.pattern.replace(/\\/g, '/') - } - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - this.partial = !!options.partial - - // make the set of regexps etc. - this.make() - } - - debug () {} - - make () { - const pattern = this.pattern - const options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - let set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = (...args) => console.error(...args) - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(s => s.split(slashSplit)) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map((s, si, set) => s.map(this.parse, this)) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(s => s.indexOf(false) === -1) - - this.debug(this.pattern, set) - - this.set = set - } - - parseNegate () { - if (this.options.nonegate) return - - const pattern = this.pattern - let negate = false - let negateOffset = 0 - - for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate - } - - // set partial to true to test if, for example, - // "/a/b" matches the start of "/*/b/*/d" - // Partial means, if you run out of file before you run - // out of pattern, then that's fine, as long as all - // the parts match. - matchOne (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - /* istanbul ignore if */ - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - hit = f === p - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else /* istanbul ignore else */ if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - return (fi === fl - 1) && (file[fi] === '') - } - - // should be unreachable. - /* istanbul ignore next */ - throw new Error('wtf?') - } - - braceExpand () { - return braceExpand(this.pattern, this.options) - } - - parse (pattern, isSub) { - assertValidPattern(pattern) - - const options = this.options - - // shortcuts - if (pattern === '**') { - if (!options.noglobstar) - return GLOBSTAR - else - pattern = '*' - } - if (pattern === '') return '' - - let re = '' - let hasMagic = !!options.nocase - let escaping = false - // ? => one single character - const patternListStack = [] - const negativeLists = [] - let stateChar - let inClass = false - let reClassStart = -1 - let classStart = -1 - let cs - let pl - let sp - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - const patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - - const clearStateChar = () => { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - this.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping) { - /* istanbul ignore next - completely not allowed, even escaped. */ - if (c === '/') { - return false - } - - if (reSpecials[c]) { - re += '\\' - } - re += c - escaping = false - continue - } - - switch (c) { - /* istanbul ignore next */ - case '/': { - // Should already be path-split by now. - return false - } - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - this.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length) { - re += '\\|' - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (reSpecials[c] && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - break - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - let tail - tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => { - /* istanbul ignore else - should already be done */ - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - const t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - const addPatternStart = addPatternStartSet[re.charAt(0)] - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (let n = negativeLists.length - 1; n > -1; n--) { - const nl = negativeLists[n] - - const nlBefore = re.slice(0, nl.reStart) - const nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - let nlAfter = re.slice(nl.reEnd) - const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - const openParensBefore = nlBefore.split('(').length - 1 - let cleanAfter = nlAfter - for (let i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - const dollar = nlAfter === '' && isSub !== SUBPARSE ? '$' : '' - re = nlBefore + nlFirst + nlAfter + dollar + nlLast - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - const flags = options.nocase ? 'i' : '' - try { - return Object.assign(new RegExp('^' + re + '$', flags), { - _glob: pattern, - _src: re, - }) - } catch (er) /* istanbul ignore next - should be impossible */ { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - } - - makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - const set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - const options = this.options - - const twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - const flags = options.nocase ? 'i' : '' - - // coalesce globstars and regexpify non-globstar patterns - // if it's the only item, then we just do one twoStar - // if it's the first, and there are more, prepend (\/|twoStar\/)? to next - // if it's the last, append (\/twoStar|) to previous - // if it's in the middle, append (\/|\/twoStar\/) to previous - // then filter out GLOBSTAR symbols - let re = set.map(pattern => { - pattern = pattern.map(p => - typeof p === 'string' ? regExpEscape(p) - : p === GLOBSTAR ? GLOBSTAR - : p._src - ).reduce((set, p) => { - if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) { - set.push(p) - } - return set - }, []) - pattern.forEach((p, i) => { - if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) { - return - } - if (i === 0) { - if (pattern.length > 1) { - pattern[i+1] = '(?:\\\/|' + twoStar + '\\\/)?' + pattern[i+1] - } else { - pattern[i] = twoStar - } - } else if (i === pattern.length - 1) { - pattern[i-1] += '(?:\\\/|' + twoStar + ')?' - } else { - pattern[i-1] += '(?:\\\/|\\\/' + twoStar + '\\\/)' + pattern[i+1] - pattern[i+1] = GLOBSTAR - } - }) - return pattern.filter(p => p !== GLOBSTAR).join('/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) /* istanbul ignore next - should be impossible */ { - this.regexp = false - } - return this.regexp - } - - match (f, partial = this.partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - const options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - const set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - let filename - for (let i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (let i = 0; i < set.length; i++) { - const pattern = set[i] - let file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - const hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate - } - - static defaults (def) { - return minimatch.defaults(def).Minimatch - } -} - -minimatch.Minimatch = Minimatch - - -/***/ }), - -/***/ 29010: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = globSync -globSync.GlobSync = GlobSync - -var rp = __nccwpck_require__(46863) -var minimatch = __nccwpck_require__(36453) -var Minimatch = minimatch.Minimatch -var Glob = (__nccwpck_require__(91957).Glob) -var util = __nccwpck_require__(73837) -var path = __nccwpck_require__(71017) -var assert = __nccwpck_require__(39491) -var isAbsolute = (__nccwpck_require__(71017).isAbsolute) -var common = __nccwpck_require__(47625) -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert.ok(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert.ok(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || - isAbsolute(pattern.map(function (p) { - return typeof p === 'string' ? p : '[*]' - }).join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return - - var abs = this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) { - e = abs - } - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null - } - } - - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, this.fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } - } - - if (lstat && lstat.isSymbolicLink()) { - try { - stat = this.fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - - -/***/ }), - -/***/ 31621: -/***/ ((module) => { - -"use strict"; - - -module.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf('--'); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -}; - - -/***/ }), - -/***/ 52492: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var wrappy = __nccwpck_require__(62940) -var reqs = Object.create(null) -var once = __nccwpck_require__(1223) - -module.exports = wrappy(inflight) - -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) - } -} - -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) - - // XXX It's somewhat ambiguous whether a new callback added in this - // pass should be queued for later execution if something in the - // list of callbacks throws, or if it should just be discarded. - // However, it's such an edge case that it hardly matters, and either - // choice is likely as surprising as the other. - // As it happens, we do go ahead and schedule it for later execution. - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - } finally { - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] - } - } - }) -} - -function slice (args) { - var length = args.length - var array = [] - - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} - - -/***/ }), - -/***/ 44124: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -try { - var util = __nccwpck_require__(73837); - /* istanbul ignore next */ - if (typeof util.inherits !== 'function') throw ''; - module.exports = util.inherits; -} catch (e) { - /* istanbul ignore next */ - module.exports = __nccwpck_require__(8544); -} - - -/***/ }), - -/***/ 8544: -/***/ ((module) => { - -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }) - } - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } - } -} - - -/***/ }), - -/***/ 63287: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -function isObject(o) { - return Object.prototype.toString.call(o) === '[object Object]'; -} - -function isPlainObject(o) { - var ctor,prot; - - if (isObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (ctor === undefined) return true; - - // If has modified prototype - prot = ctor.prototype; - if (isObject(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; -} - -exports.isPlainObject = isPlainObject; - - -/***/ }), - -/***/ 90250: -/***/ (function(module, exports, __nccwpck_require__) { - -/* module decorator */ module = __nccwpck_require__.nmd(module); -/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - - /** Used as the semantic version number. */ - var VERSION = '4.17.21'; - - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - - /** Error message constants. */ - var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', - FUNC_ERROR_TEXT = 'Expected a function', - INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used as the maximum memoize cache size. */ - var MAX_MEMOIZE_SIZE = 500; - - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; - - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; - - /** Used to compose bitmasks for value comparisons. */ - var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - - /** Used to compose bitmasks for function metadata. */ - var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_BOUND_FLAG = 4, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64, - WRAP_ARY_FLAG = 128, - WRAP_REARG_FLAG = 256, - WRAP_FLIP_FLAG = 512; - - /** Used as default options for `_.truncate`. */ - var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; - - /** Used to detect hot functions by number of calls within a span of milliseconds. */ - var HOT_COUNT = 800, - HOT_SPAN = 16; - - /** Used to indicate the type of lazy iteratees. */ - var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2, - LAZY_WHILE_FLAG = 3; - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - - /** Used to associate wrap methods with their bit flags. */ - var wrapFlags = [ - ['ary', WRAP_ARY_FLAG], - ['bind', WRAP_BIND_FLAG], - ['bindKey', WRAP_BIND_KEY_FLAG], - ['curry', WRAP_CURRY_FLAG], - ['curryRight', WRAP_CURRY_RIGHT_FLAG], - ['flip', WRAP_FLIP_FLAG], - ['partial', WRAP_PARTIAL_FLAG], - ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], - ['rearg', WRAP_REARG_FLAG] - ]; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - asyncTag = '[object AsyncFunction]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - domExcTag = '[object DOMException]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - nullTag = '[object Null]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - proxyTag = '[object Proxy]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - undefinedTag = '[object Undefined]', - weakMapTag = '[object WeakMap]', - weakSetTag = '[object WeakSet]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, - reUnescapedHtml = /[&<>"']/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, - reEvaluate = /<%([\s\S]+?)%>/g, - reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); - - /** Used to match leading whitespace. */ - var reTrimStart = /^\s+/; - - /** Used to match a single whitespace character. */ - var reWhitespace = /\s/; - - /** Used to match wrap detail comments. */ - var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, - reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, - reSplitDetails = /,? & /; - - /** Used to match words composed of alphanumeric characters. */ - var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; - - /** - * Used to validate the `validate` option in `_.template` variable. - * - * Forbids characters which could potentially change the meaning of the function argument definition: - * - "()," (modification of function parameters) - * - "=" (default value) - * - "[]{}" (destructuring of function parameters) - * - "/" (beginning of a comment) - * - whitespace - */ - var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** - * Used to match - * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). - */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** Used to match Latin Unicode letters (excluding mathematical operators). */ - var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; - - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - - /** Used to compose unicode character classes. */ - var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsDingbatRange = '\\u2700-\\u27bf', - rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', - rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', - rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', - rsPunctuationRange = '\\u2000-\\u206f', - rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', - rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', - rsVarRange = '\\ufe0e\\ufe0f', - rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; - - /** Used to compose unicode capture groups. */ - var rsApos = "['\u2019]", - rsAstral = '[' + rsAstralRange + ']', - rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsDigits = '\\d+', - rsDingbat = '[' + rsDingbatRange + ']', - rsLower = '[' + rsLowerRange + ']', - rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsUpper = '[' + rsUpperRange + ']', - rsZWJ = '\\u200d'; - - /** Used to compose unicode regexes. */ - var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', - rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', - rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', - rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', - reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', - rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - - /** Used to match apostrophes. */ - var reApos = RegExp(rsApos, 'g'); - - /** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ - var reComboMark = RegExp(rsCombo, 'g'); - - /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - - /** Used to match complex or compound words. */ - var reUnicodeWord = RegExp([ - rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', - rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, - rsUpper + '+' + rsOptContrUpper, - rsOrdUpper, - rsOrdLower, - rsDigits, - rsEmoji - ].join('|'), 'g'); - - /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); - - /** Used to detect strings that need a more robust regexp to match words. */ - var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - - /** Used to assign default `context` object properties. */ - var contextProps = [ - 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', - 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', - 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', - 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', - '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' - ]; - - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = - cloneableTags[boolTag] = cloneableTags[dateTag] = - cloneableTags[float32Tag] = cloneableTags[float64Tag] = - cloneableTags[int8Tag] = cloneableTags[int16Tag] = - cloneableTags[int32Tag] = cloneableTags[mapTag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[setTag] = - cloneableTags[stringTag] = cloneableTags[symbolTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; - - /** Used to map Latin Unicode letters to basic Latin letters. */ - var deburredLetters = { - // Latin-1 Supplement block. - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss', - // Latin Extended-A block. - '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', - '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', - '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', - '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', - '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', - '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', - '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', - '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', - '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', - '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', - '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', - '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', - '\u0134': 'J', '\u0135': 'j', - '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', - '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', - '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', - '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', - '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', - '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', - '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', - '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', - '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', - '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', - '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', - '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', - '\u0163': 't', '\u0165': 't', '\u0167': 't', - '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', - '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', - '\u0174': 'W', '\u0175': 'w', - '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', - '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', - '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', - '\u0132': 'IJ', '\u0133': 'ij', - '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 's' - }; - - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" - }; - - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - /** Built-in method references without a dependency on `root`. */ - var freeParseFloat = parseFloat, - freeParseInt = parseInt; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** Detect free variable `exports`. */ - var freeExports = true && exports && !exports.nodeType && exports; - - /** Detect free variable `module`. */ - var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; - - /** Detect free variable `process` from Node.js. */ - var freeProcess = moduleExports && freeGlobal.process; - - /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; - - if (types) { - return types; - } - - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} - }()); - - /* Node.js helper references. */ - var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, - nodeIsDate = nodeUtil && nodeUtil.isDate, - nodeIsMap = nodeUtil && nodeUtil.isMap, - nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, - nodeIsSet = nodeUtil && nodeUtil.isSet, - nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - - /*--------------------------------------------------------------------------*/ - - /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ - function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - - /** - * A specialized version of `baseAggregator` for arrays. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); - } - return accumulator; - } - - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.forEachRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array == null ? 0 : array.length; - - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.every` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; - } - - /** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; - } - - /** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; - } - - /** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; - } - - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; - } - - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array == null ? 0 : array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - /** - * A specialized version of `_.reduceRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the last element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } - - /** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - - /** - * Gets the size of an ASCII `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - var asciiSize = baseProperty('length'); - - /** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function asciiToArray(string) { - return string.split(''); - } - - /** - * Splits an ASCII `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function asciiWords(string) { - return string.match(reAsciiWord) || []; - } - - /** - * The base implementation of methods like `_.findKey` and `_.findLastKey`, - * without support for iteratee shorthands, which iterates over `collection` - * using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFindKey(collection, predicate, eachFunc) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = key; - return false; - } - }); - return result; - } - - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); - } - - /** - * This function is like `baseIndexOf` except that it accepts a comparator. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @param {Function} comparator The comparator invoked per element. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOfWith(array, value, fromIndex, comparator) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (comparator(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ - function baseIsNaN(value) { - return value !== value; - } - - /** - * The base implementation of `_.mean` and `_.meanBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the mean. - */ - function baseMean(array, iteratee) { - var length = array == null ? 0 : array.length; - return length ? (baseSum(array, iteratee) / length) : NAN; - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * The base implementation of `_.propertyOf` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyOf(object) { - return function(key) { - return object == null ? undefined : object[key]; - }; - } - - /** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of - * `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.sortBy` which uses `comparer` to define the - * sort order of `array` and replaces criteria objects with their corresponding - * values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ - function baseSortBy(array, comparer) { - var length = array.length; - - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; - } - - /** - * The base implementation of `_.sum` and `_.sumBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ - function baseSum(array, iteratee) { - var result, - index = -1, - length = array.length; - - while (++index < length) { - var current = iteratee(array[index]); - if (current !== undefined) { - result = result === undefined ? current : (result + current); - } - } - return result; - } - - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - - /** - * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array - * of key-value pairs for `object` corresponding to the property names of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the key-value pairs. - */ - function baseToPairs(object, props) { - return arrayMap(props, function(key) { - return [key, object[key]]; - }); - } - - /** - * The base implementation of `_.trim`. - * - * @private - * @param {string} string The string to trim. - * @returns {string} Returns the trimmed string. - */ - function baseTrim(string) { - return string - ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') - : string; - } - - /** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ - function baseUnary(func) { - return function(value) { - return func(value); - }; - } - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); - } - - /** - * Checks if a `cache` value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function cacheHas(cache, key) { - return cache.has(key); - } - - /** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ - function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; - - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } - - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ - function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; - - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } - - /** - * Gets the number of `placeholder` occurrences in `array`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} placeholder The placeholder to search for. - * @returns {number} Returns the placeholder count. - */ - function countHolders(array, placeholder) { - var length = array.length, - result = 0; - - while (length--) { - if (array[length] === placeholder) { - ++result; - } - } - return result; - } - - /** - * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A - * letters to basic Latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - var deburrLetter = basePropertyOf(deburredLetters); - - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - var escapeHtmlChar = basePropertyOf(htmlEscapes); - - /** - * Used by `_.template` to escape characters for inclusion in compiled string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } - - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } - - /** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ - function hasUnicode(string) { - return reHasUnicode.test(string); - } - - /** - * Checks if `string` contains a word composed of Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a word is found, else `false`. - */ - function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); - } - - /** - * Converts `iterator` to an array. - * - * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. - */ - function iteratorToArray(iterator) { - var data, - result = []; - - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; - } - - /** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } - - /** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } - - /** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value === placeholder || value === PLACEHOLDER) { - array[index] = PLACEHOLDER; - result[resIndex++] = index; - } - } - return result; - } - - /** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } - - /** - * Converts `set` to its value-value pairs. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the value-value pairs. - */ - function setToPairs(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = [value, value]; - }); - return result; - } - - /** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * A specialized version of `_.lastIndexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictLastIndexOf(array, value, fromIndex) { - var index = fromIndex + 1; - while (index--) { - if (array[index] === value) { - return index; - } - } - return index; - } - - /** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ - function stringSize(string) { - return hasUnicode(string) - ? unicodeSize(string) - : asciiSize(string); - } - - /** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); - } - - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. - */ - function trimmedEndIndex(string) { - var index = string.length; - - while (index-- && reWhitespace.test(string.charAt(index))) {} - return index; - } - - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - var unescapeHtmlChar = basePropertyOf(htmlUnescapes); - - /** - * Gets the size of a Unicode `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - function unicodeSize(string) { - var result = reUnicode.lastIndex = 0; - while (reUnicode.test(string)) { - ++result; - } - return result; - } - - /** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function unicodeToArray(string) { - return string.match(reUnicode) || []; - } - - /** - * Splits a Unicode `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function unicodeWords(string) { - return string.match(reUnicodeWord) || []; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Create a new pristine `lodash` function using the `context` object. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Util - * @param {Object} [context=root] The context object. - * @returns {Function} Returns a new `lodash` function. - * @example - * - * _.mixin({ 'foo': _.constant('foo') }); - * - * var lodash = _.runInContext(); - * lodash.mixin({ 'bar': lodash.constant('bar') }); - * - * _.isFunction(_.foo); - * // => true - * _.isFunction(_.bar); - * // => false - * - * lodash.isFunction(lodash.foo); - * // => false - * lodash.isFunction(lodash.bar); - * // => true - * - * // Create a suped-up `defer` in Node.js. - * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; - */ - var runInContext = (function runInContext(context) { - context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); - - /** Built-in constructor references. */ - var Array = context.Array, - Date = context.Date, - Error = context.Error, - Function = context.Function, - Math = context.Math, - Object = context.Object, - RegExp = context.RegExp, - String = context.String, - TypeError = context.TypeError; - - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - - /** Used to detect overreaching core-js shims. */ - var coreJsData = context['__core-js_shared__']; - - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to generate unique IDs. */ - var idCounter = 0; - - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var nativeObjectToString = objectProto.toString; - - /** Used to infer the `Object` constructor. */ - var objectCtorString = funcToString.call(Object); - - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = root._; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Built-in value references. */ - var Buffer = moduleExports ? context.Buffer : undefined, - Symbol = context.Symbol, - Uint8Array = context.Uint8Array, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, - symIterator = Symbol ? Symbol.iterator : undefined, - symToStringTag = Symbol ? Symbol.toStringTag : undefined; - - var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} - }()); - - /** Mocked built-ins. */ - var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, - ctxNow = Date && Date.now !== root.Date.now && Date.now, - ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeCeil = Math.ceil, - nativeFloor = Math.floor, - nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeIsFinite = context.isFinite, - nativeJoin = arrayProto.join, - nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max, - nativeMin = Math.min, - nativeNow = Date.now, - nativeParseInt = context.parseInt, - nativeRandom = Math.random, - nativeReverse = arrayProto.reverse; - - /* Built-in method references that are verified to be native. */ - var DataView = getNative(context, 'DataView'), - Map = getNative(context, 'Map'), - Promise = getNative(context, 'Promise'), - Set = getNative(context, 'Set'), - WeakMap = getNative(context, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - - /** Used to store function metadata. */ - var metaMap = WeakMap && new WeakMap; - - /** Used to lookup unminified function names. */ - var realNames = {}; - - /** Used to detect maps, sets, and weakmaps. */ - var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps `value` to enable implicit method - * chain sequences. Methods that operate on and return arrays, collections, - * and functions can be chained together. Methods that retrieve a single value - * or may return a primitive value will automatically end the chain sequence - * and return the unwrapped value. Otherwise, the value must be unwrapped - * with `_#value`. - * - * Explicit chain sequences, which must be unwrapped with `_#value`, may be - * enabled using `_.chain`. - * - * The execution of chained methods is lazy, that is, it's deferred until - * `_#value` is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. - * Shortcut fusion is an optimization to merge iteratee calls; this avoids - * the creation of intermediate arrays and can greatly reduce the number of - * iteratee executions. Sections of a chain sequence qualify for shortcut - * fusion if the section is applied to an array and iteratees accept only - * one argument. The heuristic for whether a section qualifies for shortcut - * fusion is subject to change. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, - * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, - * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, - * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, - * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, - * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, - * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, - * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, - * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, - * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, - * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, - * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, - * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, - * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, - * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, - * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, - * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, - * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, - * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, - * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, - * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, - * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, - * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, - * `zipObject`, `zipObjectDeep`, and `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, - * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, - * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, - * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, - * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, - * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, - * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, - * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, - * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, - * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, - * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, - * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, - * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, - * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, - * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, - * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, - * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, - * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, - * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, - * `upperFirst`, `value`, and `words` - * - * @name _ - * @constructor - * @category Seq - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2, 3]); - * - * // Returns an unwrapped value. - * wrapped.reduce(_.add); - * // => 6 - * - * // Returns a wrapped value. - * var squares = wrapped.map(square); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; - }()); - - /** - * The function whose prototype chain sequence wrappers inherit from. - * - * @private - */ - function baseLodash() { - // No operation performed. - } - - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable explicit method chain sequences. - */ - function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined; - } - - /** - * By default, the template delimiters used by lodash are like those in - * embedded Ruby (ERB) as well as ES2015 template strings. Change the - * following template settings to use alternative delimiters. - * - * @static - * @memberOf _ - * @type {Object} - */ - lodash.templateSettings = { - - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'escape': reEscape, - - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'evaluate': reEvaluate, - - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'interpolate': reInterpolate, - - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type {string} - */ - 'variable': '', - - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type {Object} - */ - 'imports': { - - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type {Function} - */ - '_': lodash - } - }; - - // Ensure wrappers are instances of `baseLodash`. - lodash.prototype = baseLodash.prototype; - lodash.prototype.constructor = lodash; - - LodashWrapper.prototype = baseCreate(baseLodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @constructor - * @param {*} value The value to wrap. - */ - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH; - this.__views__ = []; - } - - /** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ - function lazyClone() { - var result = new LazyWrapper(this.__wrapped__); - result.__actions__ = copyArray(this.__actions__); - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = copyArray(this.__iteratees__); - result.__takeCount__ = this.__takeCount__; - result.__views__ = copyArray(this.__views__); - return result; - } - - /** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ - function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; - } - - /** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ - function lazyValue() { - var array = this.__wrapped__.value(), - dir = this.__dir__, - isArr = isArray(array), - isRight = dir < 0, - arrLength = isArr ? array.length : 0, - view = getView(0, arrLength, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - iteratees = this.__iteratees__, - iterLength = iteratees.length, - resIndex = 0, - takeCount = nativeMin(length, this.__takeCount__); - - if (!isArr || (!isRight && arrLength == length && takeCount == length)) { - return baseWrapperValue(array, this.__actions__); - } - var result = []; - - outer: - while (length-- && resIndex < takeCount) { - index += dir; - - var iterIndex = -1, - value = array[index]; - - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); - - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - result[resIndex++] = value; - } - return result; - } - - // Ensure `LazyWrapper` is an instance of `baseLodash`. - LazyWrapper.prototype = baseCreate(baseLodash.prototype); - LazyWrapper.prototype.constructor = LazyWrapper; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; - } - - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; - } - - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; - } - - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); - } - - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } - - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - - /*------------------------------------------------------------------------*/ - - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - this.size = 0; - } - - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; - } - - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; - } - - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } - - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } - - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } - - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; - } - - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } - - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } - - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; - } - - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - /*------------------------------------------------------------------------*/ - - /** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } - } - - /** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ - function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; - } - - /** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ - function setCacheHas(value) { - return this.__data__.has(value); - } - - // Add methods to `SetCache`. - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; - } - - /** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ - function stackClear() { - this.__data__ = new ListCache; - this.size = 0; - } - - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; - } - - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - return this.__data__.get(key); - } - - /** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function stackHas(key) { - return this.__data__.has(key); - } - - /** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ - function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; - } - - // Add methods to `Stack`. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ - function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; - } - - /** - * A specialized version of `_.sample` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @returns {*} Returns the random element. - */ - function arraySample(array) { - var length = array.length; - return length ? array[baseRandom(0, length - 1)] : undefined; - } - - /** - * A specialized version of `_.sampleSize` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ - function arraySampleSize(array, n) { - return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); - } - - /** - * A specialized version of `_.shuffle` for arrays. - * - * @private - * @param {Array} array The array to shuffle. - * @returns {Array} Returns the new shuffled array. - */ - function arrayShuffle(array) { - return shuffleSelf(copyArray(array)); - } - - /** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } - - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } - - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - - /** - * Aggregates elements of `collection` on `accumulator` with keys transformed - * by `iteratee` and values set by `setter`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { - setter(accumulator, value, iteratee(value), collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); - } - - /** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); - } - - /** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } - } - - /** - * The base implementation of `_.at` without support for individual paths. - * - * @private - * @param {Object} object The object to iterate over. - * @param {string[]} paths The property paths to pick. - * @returns {Array} Returns the picked elements. - */ - function baseAt(object, paths) { - var index = -1, - length = paths.length, - result = Array(length), - skip = object == null; - - while (++index < length) { - result[index] = skip ? undefined : get(object, paths[index]); - } - return result; - } - - /** - * The base implementation of `_.clamp` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - */ - function baseClamp(number, lower, upper) { - if (number === number) { - if (upper !== undefined) { - number = number <= upper ? number : upper; - } - if (lower !== undefined) { - number = number >= lower ? number : lower; - } - } - return number; - } - - /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (isSet(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - } else if (isMap(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - } - - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); - - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; - } - - /** - * The base implementation of `_.conforms` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new spec function. - */ - function baseConforms(source) { - var props = keys(source); - return function(object) { - return baseConformsTo(object, source, props); - }; - } - - /** - * The base implementation of `_.conformsTo` which accepts `props` to check. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - */ - function baseConformsTo(object, source, props) { - var length = props.length; - if (object == null) { - return !length; - } - object = Object(object); - while (length--) { - var key = props[length], - predicate = source[key], - value = object[key]; - - if ((value === undefined && !(key in object)) || !predicate(value)) { - return false; - } - } - return true; - } - - /** - * The base implementation of `_.delay` and `_.defer` which accepts `args` - * to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Array} args The arguments to provide to `func`. - * @returns {number|Object} Returns the timer id or timeout object. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee == null ? value : iteratee(value); - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); - - /** - * The base implementation of `_.forEachRight` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEachRight = createBaseEach(baseForOwnRight, true); - - /** - * The base implementation of `_.every` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; - } - - /** - * The base implementation of methods like `_.max` and `_.min` which accepts a - * `comparator` to determine the extremum value. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The iteratee invoked per iteration. - * @param {Function} comparator The comparator used to compare values. - * @returns {*} Returns the extremum value. - */ - function baseExtremum(array, iteratee, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index], - current = iteratee(value); - - if (current != null && (computed === undefined - ? (current === current && !isSymbol(current)) - : comparator(current, computed) - )) { - var computed = current, - result = value; - } - } - return result; - } - - /** - * The base implementation of `_.fill` without an iteratee call guard. - * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - */ - function baseFill(array, value, start, end) { - var length = array.length; - - start = toInteger(start); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : toInteger(end); - if (end < 0) { - end += length; - } - end = start > end ? 0 : toLength(end); - while (start < end) { - array[start++] = value; - } - return array; - } - - /** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } - - /** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); - - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; - } - - /** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseForRight = createBaseFor(true); - - /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); - } - - /** - * The base implementation of `_.forOwnRight` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwnRight(object, iteratee) { - return object && baseForRight(object, iteratee, keys); - } - - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from `props`. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the function names. - */ - function baseFunctions(object, props) { - return arrayFilter(props, function(key) { - return isFunction(object[key]); - }); - } - - /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = castPath(path, object); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; - } - - /** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ - function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); - } - - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); - } - - /** - * The base implementation of `_.gt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - */ - function baseGt(value, other) { - return value > other; - } - - /** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - return object != null && hasOwnProperty.call(object, key); - } - - /** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHasIn(object, key) { - return object != null && key in Object(object); - } - - /** - * The base implementation of `_.inRange` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to check. - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - */ - function baseInRange(number, start, end) { - return number >= nativeMin(start, end) && number < nativeMax(start, end); - } - - /** - * The base implementation of methods like `_.intersection`, without support - * for iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - */ - function baseIntersection(arrays, iteratee, comparator) { - var includes = comparator ? arrayIncludesWith : arrayIncludes, - length = arrays[0].length, - othLength = arrays.length, - othIndex = othLength, - caches = Array(othLength), - maxLength = Infinity, - result = []; - - while (othIndex--) { - var array = arrays[othIndex]; - if (othIndex && iteratee) { - array = arrayMap(array, baseUnary(iteratee)); - } - maxLength = nativeMin(array.length, maxLength); - caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) - ? new SetCache(othIndex && array) - : undefined; - } - array = arrays[0]; - - var index = -1, - seen = caches[0]; - - outer: - while (++index < length && result.length < maxLength) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (!(seen - ? cacheHas(seen, computed) - : includes(result, computed, comparator) - )) { - othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if (!(cache - ? cacheHas(cache, computed) - : includes(arrays[othIndex], computed, comparator)) - ) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.invert` and `_.invertBy` which inverts - * `object` with values transformed by `iteratee` and set by `setter`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform values. - * @param {Object} accumulator The initial inverted object. - * @returns {Function} Returns `accumulator`. - */ - function baseInverter(object, setter, iteratee, accumulator) { - baseForOwn(object, function(value, key, object) { - setter(accumulator, iteratee(value), key, object); - }); - return accumulator; - } - - /** - * The base implementation of `_.invoke` without support for individual - * method arguments. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ - function baseInvoke(object, path, args) { - path = castPath(path, object); - object = parent(object, path); - var func = object == null ? object : object[toKey(last(path))]; - return func == null ? undefined : apply(func, object, args); - } - - /** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ - function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; - } - - /** - * The base implementation of `_.isArrayBuffer` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - */ - function baseIsArrayBuffer(value) { - return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; - } - - /** - * The base implementation of `_.isDate` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - */ - function baseIsDate(value) { - return isObjectLike(value) && baseGetTag(value) == dateTag; - } - - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {boolean} bitmask The bitmask flags. - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Function} [customizer] The function to customize comparisons. - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); - } - - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : getTag(object), - othTag = othIsArr ? arrayTag : getTag(other); - - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; - - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - if (isSameTag && isBuffer(object)) { - if (!isBuffer(other)) { - return false; - } - objIsArr = true; - objIsObj = false; - } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); - } - if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; - - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); - } - - /** - * The base implementation of `_.isMap` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - */ - function baseIsMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; - } - - /** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) - : result - )) { - return false; - } - } - } - return true; - } - - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } - - /** - * The base implementation of `_.isRegExp` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - */ - function baseIsRegExp(value) { - return isObjectLike(value) && baseGetTag(value) == regexpTag; - } - - /** - * The base implementation of `_.isSet` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - */ - function baseIsSet(value) { - return isObjectLike(value) && getTag(value) == setTag; - } - - /** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ - function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; - } - - /** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ - function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); - } - - /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; - } - - /** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - - /** - * The base implementation of `_.lt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - */ - function baseLt(value, other) { - return value < other; - } - - /** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } - - /** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; - } - - /** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; - } - - /** - * The base implementation of `_.merge` without support for multiple sources. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - baseFor(source, function(srcValue, key) { - stack || (stack = new Stack); - if (isObject(srcValue)) { - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer - ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) - : undefined; - - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }, keysIn); - } - - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object, key), - srcValue = safeGet(source, key), - stacked = stack.get(srcValue); - - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer - ? customizer(objValue, srcValue, (key + ''), object, source, stack) - : undefined; - - var isCommon = newValue === undefined; - - if (isCommon) { - var isArr = isArray(srcValue), - isBuff = !isArr && isBuffer(srcValue), - isTyped = !isArr && !isBuff && isTypedArray(srcValue); - - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray(objValue)) { - newValue = objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } - else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); - } - else { - newValue = []; - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || isFunction(objValue)) { - newValue = initCloneObject(srcValue); - } - } - else { - isCommon = false; - } - } - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); - } - assignMergeValue(object, key, newValue); - } - - /** - * The base implementation of `_.nth` which doesn't coerce arguments. - * - * @private - * @param {Array} array The array to query. - * @param {number} n The index of the element to return. - * @returns {*} Returns the nth element of `array`. - */ - function baseNth(array, n) { - var length = array.length; - if (!length) { - return; - } - n += n < 0 ? length : 0; - return isIndex(n, length) ? array[n] : undefined; - } - - /** - * The base implementation of `_.orderBy` without param guards. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {string[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. - */ - function baseOrderBy(collection, iteratees, orders) { - if (iteratees.length) { - iteratees = arrayMap(iteratees, function(iteratee) { - if (isArray(iteratee)) { - return function(value) { - return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); - } - } - return iteratee; - }); - } else { - iteratees = [identity]; - } - - var index = -1; - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - - var result = baseMap(collection, function(value, key, collection) { - var criteria = arrayMap(iteratees, function(iteratee) { - return iteratee(value); - }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); - - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); - } - - /** - * The base implementation of `_.pick` without support for individual - * property identifiers. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @returns {Object} Returns the new object. - */ - function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { - return hasIn(object, path); - }); - } - - /** - * The base implementation of `_.pickBy` without support for iteratee shorthands. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @param {Function} predicate The function invoked per property. - * @returns {Object} Returns the new object. - */ - function basePickBy(object, paths, predicate) { - var index = -1, - length = paths.length, - result = {}; - - while (++index < length) { - var path = paths[index], - value = baseGet(object, path); - - if (predicate(value, path)) { - baseSet(result, castPath(path, object), value); - } - } - return result; - } - - /** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; - } - - /** - * The base implementation of `_.pullAllBy` without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. - */ - function basePullAll(array, values, iteratee, comparator) { - var indexOf = comparator ? baseIndexOfWith : baseIndexOf, - index = -1, - length = values.length, - seen = array; - - if (array === values) { - values = copyArray(values); - } - if (iteratee) { - seen = arrayMap(array, baseUnary(iteratee)); - } - while (++index < length) { - var fromIndex = 0, - value = values[index], - computed = iteratee ? iteratee(value) : value; - - while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } - } - return array; - } - - /** - * The base implementation of `_.pullAt` without support for individual - * indexes or capturing the removed elements. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0, - lastIndex = length - 1; - - while (length--) { - var index = indexes[length]; - if (length == lastIndex || index !== previous) { - var previous = index; - if (isIndex(index)) { - splice.call(array, index, 1); - } else { - baseUnset(array, index); - } - } - } - return array; - } - - /** - * The base implementation of `_.random` without support for returning - * floating-point numbers. - * - * @private - * @param {number} lower The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the random number. - */ - function baseRandom(lower, upper) { - return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); - } - - /** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the range of numbers. - */ - function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; - } - - /** - * The base implementation of `_.repeat` which doesn't coerce arguments. - * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. - */ - function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; - } - - /** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ - function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); - } - - /** - * The base implementation of `_.sample`. - * - * @private - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - */ - function baseSample(collection) { - return arraySample(values(collection)); - } - - /** - * The base implementation of `_.sampleSize` without param guards. - * - * @private - * @param {Array|Object} collection The collection to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ - function baseSampleSize(collection, n) { - var array = values(collection); - return shuffleSelf(array, baseClamp(n, 0, array.length)); - } - - /** - * The base implementation of `_.set`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ - function baseSet(object, path, value, customizer) { - if (!isObject(object)) { - return object; - } - path = castPath(path, object); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = toKey(path[index]), - newValue = value; - - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { - return object; - } - - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = isObject(objValue) - ? objValue - : (isIndex(path[index + 1]) ? [] : {}); - } - } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object; - } - - /** - * The base implementation of `setData` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; - }; - - /** - * The base implementation of `setToString` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); - }; - - /** - * The base implementation of `_.shuffle`. - * - * @private - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - */ - function baseShuffle(collection) { - return shuffleSelf(values(collection)); - } - - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - /** - * The base implementation of `_.some` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; - } - - /** - * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which - * performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function baseSortedIndex(array, value, retHighest) { - var low = 0, - high = array == null ? low : array.length; - - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; - - if (computed !== null && !isSymbol(computed) && - (retHighest ? (computed <= value) : (computed < value))) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return baseSortedIndexBy(array, value, identity, retHighest); - } - - /** - * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` - * which invokes `iteratee` for `value` and each element of `array` to compute - * their sort ranking. The iteratee is invoked with one argument; (value). - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The iteratee invoked per element. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function baseSortedIndexBy(array, value, iteratee, retHighest) { - var low = 0, - high = array == null ? 0 : array.length; - if (high === 0) { - return 0; - } - - value = iteratee(value); - var valIsNaN = value !== value, - valIsNull = value === null, - valIsSymbol = isSymbol(value), - valIsUndefined = value === undefined; - - while (low < high) { - var mid = nativeFloor((low + high) / 2), - computed = iteratee(array[mid]), - othIsDefined = computed !== undefined, - othIsNull = computed === null, - othIsReflexive = computed === computed, - othIsSymbol = isSymbol(computed); - - if (valIsNaN) { - var setLow = retHighest || othIsReflexive; - } else if (valIsUndefined) { - setLow = othIsReflexive && (retHighest || othIsDefined); - } else if (valIsNull) { - setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); - } else if (valIsSymbol) { - setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); - } else if (othIsNull || othIsSymbol) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); - } - - /** - * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseSortedUniq(array, iteratee) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (!index || !eq(computed, seen)) { - var seen = computed; - result[resIndex++] = value === 0 ? 0 : value; - } - } - return result; - } - - /** - * The base implementation of `_.toNumber` which doesn't ensure correct - * conversions of binary, hexadecimal, or octal string values. - * - * @private - * @param {*} value The value to process. - * @returns {number} Returns the number. - */ - function baseToNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - return +value; - } - - /** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.unset`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The property path to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - */ - function baseUnset(object, path) { - path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; - } - - /** - * The base implementation of `_.update`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to update. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ - function baseUpdate(object, path, updater, customizer) { - return baseSet(object, path, updater(baseGet(object, path)), customizer); - } - - /** - * The base implementation of methods like `_.dropWhile` and `_.takeWhile` - * without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. - */ - function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length) && - predicate(array[index], index, array)) {} - - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); - } - - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to perform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ - function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); - } - return arrayReduce(actions, function(result, action) { - return action.func.apply(action.thisArg, arrayPush([result], action.args)); - }, result); - } - - /** - * The base implementation of methods like `_.xor`, without support for - * iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. - */ - function baseXor(arrays, iteratee, comparator) { - var length = arrays.length; - if (length < 2) { - return length ? baseUniq(arrays[0]) : []; - } - var index = -1, - result = Array(length); - - while (++index < length) { - var array = arrays[index], - othIndex = -1; - - while (++othIndex < length) { - if (othIndex != index) { - result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); - } - } - } - return baseUniq(baseFlatten(result, 1), iteratee, comparator); - } - - /** - * This base implementation of `_.zipObject` which assigns values using `assignFunc`. - * - * @private - * @param {Array} props The property identifiers. - * @param {Array} values The property values. - * @param {Function} assignFunc The function to assign values. - * @returns {Object} Returns the new object. - */ - function baseZipObject(props, values, assignFunc) { - var index = -1, - length = props.length, - valsLength = values.length, - result = {}; - - while (++index < length) { - var value = index < valsLength ? values[index] : undefined; - assignFunc(result, props[index], value); - } - return result; - } - - /** - * Casts `value` to an empty array if it's not an array like object. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array|Object} Returns the cast array-like object. - */ - function castArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; - } - - /** - * Casts `value` to `identity` if it's not a function. - * - * @private - * @param {*} value The value to inspect. - * @returns {Function} Returns cast function. - */ - function castFunction(value) { - return typeof value == 'function' ? value : identity; - } - - /** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. - */ - function castPath(value, object) { - if (isArray(value)) { - return value; - } - return isKey(value, object) ? [value] : stringToPath(toString(value)); - } - - /** - * A `baseRest` alias which can be replaced with `identity` by module - * replacement plugins. - * - * @private - * @type {Function} - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ - var castRest = baseRest; - - /** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ - function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); - } - - /** - * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). - * - * @private - * @param {number|Object} id The timer id or timeout object of the timer to clear. - */ - var clearTimeout = ctxClearTimeout || function(id) { - return root.clearTimeout(id); - }; - - /** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - - buffer.copy(result); - return result; - } - - /** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; - } - - /** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); - } - - /** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; - } - - /** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ - function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; - } - - /** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); - } - - /** - * Compares values to sort them in ascending order. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function compareAscending(value, other) { - if (value !== other) { - var valIsDefined = value !== undefined, - valIsNull = value === null, - valIsReflexive = value === value, - valIsSymbol = isSymbol(value); - - var othIsDefined = other !== undefined, - othIsNull = other === null, - othIsReflexive = other === other, - othIsSymbol = isSymbol(other); - - if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || - (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || - (valIsNull && othIsDefined && othIsReflexive) || - (!valIsDefined && othIsReflexive) || - !valIsReflexive) { - return 1; - } - if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || - (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || - (othIsNull && valIsDefined && valIsReflexive) || - (!othIsDefined && valIsReflexive) || - !othIsReflexive) { - return -1; - } - } - return 0; - } - - /** - * Used by `_.orderBy` to compare multiple properties of a value to another - * and stable sort them. - * - * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, - * specify an order of "desc" for descending or "asc" for ascending sort order - * of corresponding values. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {boolean[]|string[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; - - while (++index < length) { - var result = compareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - var order = orders[index]; - return result * (order == 'desc' ? -1 : 1); - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; - } - - /** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgs(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersLength = holders.length, - leftIndex = -1, - leftLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(leftLength + rangeLength), - isUncurried = !isCurried; - - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - } - while (rangeLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; - } - - /** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgsRight(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersIndex = -1, - holdersLength = holders.length, - rightIndex = -1, - rightLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(rangeLength + rightLength), - isUncurried = !isCurried; - - while (++argsIndex < rangeLength) { - result[argsIndex] = args[argsIndex]; - } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; - } - } - return result; - } - - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; - } - - /** - * Copies own symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); - } - - /** - * Copies own and inherited symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); - } - - /** - * Creates a function like `_.groupBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} [initializer] The accumulator object initializer. - * @returns {Function} Returns the new aggregator function. - */ - function createAggregator(setter, initializer) { - return function(collection, iteratee) { - var func = isArray(collection) ? arrayAggregator : baseAggregator, - accumulator = initializer ? initializer() : {}; - - return func(collection, setter, getIteratee(iteratee, 2), accumulator); - }; - } - - /** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - - /** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - - /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createBind(func, bitmask, thisArg) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, arguments); - } - return wrapper; - } - - /** - * Creates a function like `_.lowerFirst`. - * - * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new case function. - */ - function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - - var strSymbols = hasUnicode(string) - ? stringToArray(string) - : undefined; - - var chr = strSymbols - ? strSymbols[0] - : string.charAt(0); - - var trailing = strSymbols - ? castSlice(strSymbols, 1).join('') - : string.slice(1); - - return chr[methodName]() + trailing; - }; - } - - /** - * Creates a function like `_.camelCase`. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ - function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); - }; - } - - /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ - function createCtor(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. See - // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } - - /** - * Creates a function that wraps `func` to enable currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {number} arity The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createCurry(func, bitmask, arity) { - var Ctor = createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length, - placeholder = getHolder(wrapper); - - while (index--) { - args[index] = arguments[index]; - } - var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) - ? [] - : replaceHolders(args, placeholder); - - length -= holders.length; - if (length < arity) { - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, undefined, - args, holders, undefined, undefined, arity - length); - } - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return apply(fn, this, args); - } - return wrapper; - } - - /** - * Creates a `_.find` or `_.findLast` function. - * - * @private - * @param {Function} findIndexFunc The function to find the collection index. - * @returns {Function} Returns the new find function. - */ - function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object(collection); - if (!isArrayLike(collection)) { - var iteratee = getIteratee(predicate, 3); - collection = keys(collection); - predicate = function(key) { return iteratee(iterable[key], key, iterable); }; - } - var index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; - }; - } - - /** - * Creates a `_.flow` or `_.flowRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. - */ - function createFlow(fromRight) { - return flatRest(function(funcs) { - var length = funcs.length, - index = length, - prereq = LodashWrapper.prototype.thru; - - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (prereq && !wrapper && getFuncName(func) == 'wrapper') { - var wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined; - - if (data && isLaziable(data[0]) && - data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && - !data[4].length && data[9] == 1 - ) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) - ? wrapper[funcName]() - : wrapper.thru(func); - } - } - return function() { - var args = arguments, - value = args[0]; - - if (wrapper && args.length == 1 && isArray(value)) { - return wrapper.plant(value).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : value; - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }); - } - - /** - * Creates a function that wraps `func` to invoke it with optional `this` - * binding of `thisArg`, partial application, and currying. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided - * to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & WRAP_ARY_FLAG, - isBind = bitmask & WRAP_BIND_FLAG, - isBindKey = bitmask & WRAP_BIND_KEY_FLAG, - isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), - isFlip = bitmask & WRAP_FLIP_FLAG, - Ctor = isBindKey ? undefined : createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length; - - while (index--) { - args[index] = arguments[index]; - } - if (isCurried) { - var placeholder = getHolder(wrapper), - holdersCount = countHolders(args, placeholder); - } - if (partials) { - args = composeArgs(args, partials, holders, isCurried); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight, isCurried); - } - length -= holdersCount; - if (isCurried && length < arity) { - var newHolders = replaceHolders(args, placeholder); - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, thisArg, - args, newHolders, argPos, ary, arity - length - ); - } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; - - length = args.length; - if (argPos) { - args = reorder(args, argPos); - } else if (isFlip && length > 1) { - args.reverse(); - } - if (isAry && ary < length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtor(fn); - } - return fn.apply(thisBinding, args); - } - return wrapper; - } - - /** - * Creates a function like `_.invertBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} toIteratee The function to resolve iteratees. - * @returns {Function} Returns the new inverter function. - */ - function createInverter(setter, toIteratee) { - return function(object, iteratee) { - return baseInverter(object, setter, toIteratee(iteratee), {}); - }; - } - - /** - * Creates a function that performs a mathematical operation on two values. - * - * @private - * @param {Function} operator The function to perform the operation. - * @param {number} [defaultValue] The value used for `undefined` arguments. - * @returns {Function} Returns the new mathematical operation function. - */ - function createMathOperation(operator, defaultValue) { - return function(value, other) { - var result; - if (value === undefined && other === undefined) { - return defaultValue; - } - if (value !== undefined) { - result = value; - } - if (other !== undefined) { - if (result === undefined) { - return other; - } - if (typeof value == 'string' || typeof other == 'string') { - value = baseToString(value); - other = baseToString(other); - } else { - value = baseToNumber(value); - other = baseToNumber(other); - } - result = operator(value, other); - } - return result; - }; - } - - /** - * Creates a function like `_.over`. - * - * @private - * @param {Function} arrayFunc The function to iterate over iteratees. - * @returns {Function} Returns the new over function. - */ - function createOver(arrayFunc) { - return flatRest(function(iteratees) { - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - return baseRest(function(args) { - var thisArg = this; - return arrayFunc(iteratees, function(iteratee) { - return apply(iteratee, thisArg, args); - }); - }); - }); - } - - /** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ - function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return hasUnicode(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); - } - - /** - * Creates a function that wraps `func` to invoke it with the `this` binding - * of `thisArg` and `partials` prepended to the arguments it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to - * the new function. - * @returns {Function} Returns the new wrapped function. - */ - function createPartial(func, bitmask, thisArg, partials) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return apply(fn, isBind ? thisArg : this, args); - } - return wrapper; - } - - /** - * Creates a `_.range` or `_.rangeRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new range function. - */ - function createRange(fromRight) { - return function(start, end, step) { - if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; - } - // Ensure the sign of `-0` is preserved. - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); - return baseRange(start, end, step, fromRight); - }; - } - - /** - * Creates a function that performs a relational operation on two values. - * - * @private - * @param {Function} operator The function to perform the operation. - * @returns {Function} Returns the new relational operation function. - */ - function createRelationalOperation(operator) { - return function(value, other) { - if (!(typeof value == 'string' && typeof other == 'string')) { - value = toNumber(value); - other = toNumber(other); - } - return operator(value, other); - }; - } - - /** - * Creates a function that wraps `func` to continue currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {Function} wrapFunc The function to create the `func` wrapper. - * @param {*} placeholder The placeholder value. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { - var isCurry = bitmask & WRAP_CURRY_FLAG, - newHolders = isCurry ? holders : undefined, - newHoldersRight = isCurry ? undefined : holders, - newPartials = isCurry ? partials : undefined, - newPartialsRight = isCurry ? undefined : partials; - - bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); - - if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { - bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); - } - var newData = [ - func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, - newHoldersRight, argPos, ary, arity - ]; - - var result = wrapFunc.apply(undefined, newData); - if (isLaziable(func)) { - setData(result, newData); - } - result.placeholder = placeholder; - return setWrapToString(result, func, bitmask); - } - - /** - * Creates a function like `_.round`. - * - * @private - * @param {string} methodName The name of the `Math` method to use when rounding. - * @returns {Function} Returns the new round function. - */ - function createRound(methodName) { - var func = Math[methodName]; - return function(number, precision) { - number = toNumber(number); - precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); - if (precision && nativeIsFinite(number)) { - // Shift with exponential notation to avoid floating-point issues. - // See [MDN](https://mdn.io/round#Examples) for more details. - var pair = (toString(number) + 'e').split('e'), - value = func(pair[0] + 'e' + (+pair[1] + precision)); - - pair = (toString(value) + 'e').split('e'); - return +(pair[0] + 'e' + (+pair[1] - precision)); - } - return func(number); - }; - } - - /** - * Creates a set object of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ - var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); - }; - - /** - * Creates a `_.toPairs` or `_.toPairsIn` function. - * - * @private - * @param {Function} keysFunc The function to get the keys of a given object. - * @returns {Function} Returns the new pairs function. - */ - function createToPairs(keysFunc) { - return function(object) { - var tag = getTag(object); - if (tag == mapTag) { - return mapToArray(object); - } - if (tag == setTag) { - return setToPairs(object); - } - return baseToPairs(object, keysFunc(object)); - }; - } - - /** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * 512 - `_.flip` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); - partials = holders = undefined; - } - ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); - arity = arity === undefined ? arity : toInteger(arity); - length -= holders ? holders.length : 0; - - if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; - - partials = holders = undefined; - } - var data = isBindKey ? undefined : getData(func); - - var newData = [ - func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, - argPos, ary, arity - ]; - - if (data) { - mergeData(newData, data); - } - func = newData[0]; - bitmask = newData[1]; - thisArg = newData[2]; - partials = newData[3]; - holders = newData[4]; - arity = newData[9] = newData[9] === undefined - ? (isBindKey ? 0 : func.length) - : nativeMax(newData[9] - length, 0); - - if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { - bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); - } - if (!bitmask || bitmask == WRAP_BIND_FLAG) { - var result = createBind(func, bitmask, thisArg); - } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { - result = createCurry(func, bitmask, arity); - } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { - result = createPartial(func, bitmask, thisArg, partials); - } else { - result = createHybrid.apply(undefined, newData); - } - var setter = data ? baseSetData : setData; - return setWrapToString(setter(result, newData), func, bitmask); - } - - /** - * Used by `_.defaults` to customize its `_.assignIn` use to assign properties - * of source objects to the destination object for all destination properties - * that resolve to `undefined`. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. - */ - function customDefaultsAssignIn(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; - } - return objValue; - } - - /** - * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source - * objects into destination objects that are passed thru. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to merge. - * @param {Object} object The parent object of `objValue`. - * @param {Object} source The parent object of `srcValue`. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - * @returns {*} Returns the value to assign. - */ - function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { - if (isObject(objValue) && isObject(srcValue)) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); - stack['delete'](srcValue); - } - return objValue; - } - - /** - * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain - * objects. - * - * @private - * @param {*} value The value to inspect. - * @param {string} key The key of the property to inspect. - * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. - */ - function customOmitClone(value) { - return isPlainObject(value) ? undefined : value; - } - - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Check that cyclic values are equal. - var arrStacked = stack.get(array); - var othStacked = stack.get(other); - if (arrStacked && othStacked) { - return arrStacked == other && othStacked == array; - } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; - - stack.set(array, other); - stack.set(other, array); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; - } - - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; - - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG; - convert || (convert = setToArray); - - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= COMPARE_UNORDERED_FLAG; - - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack['delete'](object); - return result; - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; - } - - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = getAllKeys(object), - objLength = objProps.length, - othProps = getAllKeys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Check that cyclic values are equal. - var objStacked = stack.get(object); - var othStacked = stack.get(other); - if (objStacked && othStacked) { - return objStacked == other && othStacked == object; - } - var result = true; - stack.set(object, other); - stack.set(other, object); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - stack['delete'](other); - return result; - } - - /** - * A specialized version of `baseRest` which flattens the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ - function flatRest(func) { - return setToString(overRest(func, undefined, flatten), func + ''); - } - - /** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); - } - - /** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); - } - - /** - * Gets metadata for `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. - */ - var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); - }; - - /** - * Gets the name of `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. - */ - function getFuncName(func) { - var result = (func.name + ''), - array = realNames[result], - length = hasOwnProperty.call(realNames, result) ? array.length : 0; - - while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } - } - return result; - } - - /** - * Gets the argument placeholder value for `func`. - * - * @private - * @param {Function} func The function to inspect. - * @returns {*} Returns the placeholder value. - */ - function getHolder(func) { - var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; - return object.placeholder; - } - - /** - * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, - * this function returns the custom method, otherwise it returns `baseIteratee`. - * If arguments are provided, the chosen function is invoked with them and - * its result is returned. - * - * @private - * @param {*} [value] The value to convert to an iteratee. - * @param {number} [arity] The arity of the created iteratee. - * @returns {Function} Returns the chosen function or its result. - */ - function getIteratee() { - var result = lodash.iteratee || iteratee; - result = result === iteratee ? baseIteratee : result; - return arguments.length ? result(arguments[0], arguments[1]) : result; - } - - /** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; - } - - /** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ - function getMatchData(object) { - var result = keys(object), - length = result.length; - - while (length--) { - var key = result[length], - value = object[key]; - - result[length] = [key, value, isStrictComparable(value)]; - } - return result; - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } - - /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ - function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; - } - - /** - * Creates an array of the own enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); - }; - - /** - * Creates an array of the own and inherited enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); - } - return result; - }; - - /** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - var getTag = baseGetTag; - - // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. - if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; - } - - /** - * Gets the view, applying any `transforms` to the `start` and `end` positions. - * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} transforms The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. - */ - function getView(start, end, transforms) { - var index = -1, - length = transforms.length; - - while (++index < length) { - var data = transforms[index], - size = data.size; - - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - return { 'start': start, 'end': end }; - } - - /** - * Extracts wrapper details from the `source` body comment. - * - * @private - * @param {string} source The source to inspect. - * @returns {Array} Returns the wrapper details. - */ - function getWrapDetails(source) { - var match = source.match(reWrapDetails); - return match ? match[1].split(reSplitDetails) : []; - } - - /** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ - function hasPath(object, path, hasFunc) { - path = castPath(path, object); - - var index = -1, - length = path.length, - result = false; - - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result || ++index != length) { - return result; - } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); - } - - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } - - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; - } - - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return new Ctor; - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return new Ctor; - - case symbolTag: - return cloneSymbol(object); - } - } - - /** - * Inserts wrapper `details` in a comment at the top of the `source` body. - * - * @private - * @param {string} source The source to modify. - * @returns {Array} details The details to insert. - * @returns {string} Returns the modified source. - */ - function insertWrapDetails(source, details) { - var length = details.length; - if (!length) { - return source; - } - var lastIndex = length - 1; - details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; - details = details.join(length > 2 ? ', ' : ' '); - return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); - } - - /** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ - function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); - } - - /** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; - } - - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); - } - - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); - } - - /** - * Checks if `func` has a lazy counterpart. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, - * else `false`. - */ - function isLaziable(func) { - var funcName = getFuncName(func), - other = lodash[funcName]; - - if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { - return false; - } - if (func === other) { - return true; - } - var data = getData(other); - return !!data && func === data[0]; - } - - /** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } - - /** - * Checks if `func` is capable of being masked. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `func` is maskable, else `false`. - */ - var isMaskable = coreJsData ? isFunction : stubFalse; - - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; - } - - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } - - /** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; - } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; - } - - /** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. - * - * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. - */ - function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); - - var cache = result.cache; - return result; - } - - /** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers used to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and - * `_.rearg` modify function arguments, making the order in which they are - * executed important, preventing the merging of metadata. However, we make - * an exception for a safe combined case where curried functions have `_.ary` - * and or `_.rearg` applied. - * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. - */ - function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); - - var isCombo = - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || - ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); - - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & WRAP_BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : value; - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = value; - } - // Use source `ary` if it's smaller. - if (srcBitmask & WRAP_ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - - return data; - } - - /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; - } - - /** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } - - /** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ - function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; - } - - /** - * Gets the parent value at `path` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. - */ - function parent(object, path) { - return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); - } - - /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. - * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. - */ - function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = copyArray(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; - } - - /** - * Gets the value at `key`, unless `key` is "__proto__" or "constructor". - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function safeGet(object, key) { - if (key === 'constructor' && typeof object[key] === 'function') { - return; - } - - if (key == '__proto__') { - return; - } - - return object[key]; - } - - /** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity - * function to avoid garbage collection pauses in V8. See - * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) - * for more details. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var setData = shortOut(baseSetData); - - /** - * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @returns {number|Object} Returns the timer id or timeout object. - */ - var setTimeout = ctxSetTimeout || function(func, wait) { - return root.setTimeout(func, wait); - }; - - /** - * Sets the `toString` method of `func` to return `string`. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var setToString = shortOut(baseSetToString); - - /** - * Sets the `toString` method of `wrapper` to mimic the source of `reference` - * with wrapper details in a comment at the top of the source body. - * - * @private - * @param {Function} wrapper The function to modify. - * @param {Function} reference The reference function. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Function} Returns `wrapper`. - */ - function setWrapToString(wrapper, reference, bitmask) { - var source = (reference + ''); - return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); - } - - /** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. - * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. - */ - function shortOut(func) { - var count = 0, - lastCalled = 0; - - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined, arguments); - }; - } - - /** - * A specialized version of `_.shuffle` which mutates and sets the size of `array`. - * - * @private - * @param {Array} array The array to shuffle. - * @param {number} [size=array.length] The size of `array`. - * @returns {Array} Returns `array`. - */ - function shuffleSelf(array, size) { - var index = -1, - length = array.length, - lastIndex = length - 1; - - size = size === undefined ? length : size; - while (++index < size) { - var rand = baseRandom(index, lastIndex), - value = array[rand]; - - array[rand] = array[index]; - array[index] = value; - } - array.length = size; - return array; - } - - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - var stringToPath = memoizeCapped(function(string) { - var result = []; - if (string.charCodeAt(0) === 46 /* . */) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - }); - - /** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ - function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } - - /** - * Updates wrapper `details` based on `bitmask` flags. - * - * @private - * @returns {Array} details The details to modify. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Array} Returns `details`. - */ - function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { - var value = '_.' + pair[0]; - if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { - details.push(value); - } - }); - return details.sort(); - } - - /** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ - function wrapperClone(wrapper) { - if (wrapper instanceof LazyWrapper) { - return wrapper.clone(); - } - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - result.__index__ = wrapper.__index__; - result.__values__ = wrapper.__values__; - return result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of elements split into groups the length of `size`. - * If `array` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the new array of chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ - function chunk(array, size, guard) { - if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { - size = 1; - } else { - size = nativeMax(toInteger(size), 0); - } - var length = array == null ? 0 : array.length; - if (!length || size < 1) { - return []; - } - var index = 0, - resIndex = 0, - result = Array(nativeCeil(length / size)); - - while (index < length) { - result[resIndex++] = baseSlice(array, index, (index += size)); - } - return result; - } - - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[resIndex++] = value; - } - } - return result; - } - - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - function concat() { - var length = arguments.length; - if (!length) { - return []; - } - var args = Array(length - 1), - array = arguments[0], - index = length; - - while (index--) { - args[index - 1] = arguments[index]; - } - return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); - } - - /** - * Creates an array of `array` values not included in the other given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * **Note:** Unlike `_.pullAll`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.without, _.xor - * @example - * - * _.difference([2, 1], [2, 3]); - * // => [1] - */ - var difference = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) - : []; - }); - - /** - * This method is like `_.difference` except that it accepts `iteratee` which - * is invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * **Note:** Unlike `_.pullAllBy`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2] - * - * // The `_.property` iteratee shorthand. - * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var differenceBy = baseRest(function(array, values) { - var iteratee = last(values); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) - : []; - }); - - /** - * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The order and - * references of result values are determined by the first array. The comparator - * is invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.pullAllWith`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - var differenceWith = baseRest(function(array, values) { - var comparator = last(values); - if (isArrayLikeObject(comparator)) { - comparator = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) - : []; - }); - - /** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function drop(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function dropRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.dropRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney'] - * - * // The `_.matches` iteratee shorthand. - * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropRightWhile(users, ['active', false]); - * // => objects for ['barney'] - * - * // The `_.property` iteratee shorthand. - * _.dropRightWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true, true) - : []; - } - - /** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.dropWhile(users, function(o) { return !o.active; }); - * // => objects for ['pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.dropWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropWhile(users, ['active', false]); - * // => objects for ['pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.dropWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true) - : []; - } - - /** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.2.0 - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8, 10], '*', 1, 3); - * // => [4, '*', '*', 10] - */ - function fill(array, value, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); - } - - /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 - * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 - */ - function findIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseFindIndex(array, getIteratee(predicate, 3), index); - } - - /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 - * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 - * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 - */ - function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = fromIndex < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); - } - return baseFindIndex(array, getIteratee(predicate, 3), index, true); - } - - /** - * Flattens `array` a single level deep. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] - */ - function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; - } - - /** - * Recursively flattens `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, [3, [4]], 5]]); - * // => [1, 2, 3, 4, 5] - */ - function flattenDeep(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, INFINITY) : []; - } - - /** - * Recursively flatten `array` up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Array - * @param {Array} array The array to flatten. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * var array = [1, [2, [3, [4]], 5]]; - * - * _.flattenDepth(array, 1); - * // => [1, 2, [3, [4]], 5] - * - * _.flattenDepth(array, 2); - * // => [1, 2, 3, [4], 5] - */ - function flattenDepth(array, depth) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(array, depth); - } - - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. - * @example - * - * _.fromPairs([['a', 1], ['b', 2]]); - * // => { 'a': 1, 'b': 2 } - */ - function fromPairs(pairs) { - var index = -1, - length = pairs == null ? 0 : pairs.length, - result = {}; - - while (++index < length) { - var pair = pairs[index]; - result[pair[0]] = pair[1]; - } - return result; - } - - /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias first - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.head([1, 2, 3]); - * // => 1 - * - * _.head([]); - * // => undefined - */ - function head(array) { - return (array && array.length) ? array[0] : undefined; - } - - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the - * offset from the end of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // Search from the `fromIndex`. - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - function indexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseIndexOf(array, value, index); - } - - /** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ - function initial(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 0, -1) : []; - } - - /** - * Creates an array of unique values that are included in all given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersection([2, 1], [2, 3]); - * // => [2] - */ - var intersection = baseRest(function(arrays) { - var mapped = arrayMap(arrays, castArrayLikeObject); - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped) - : []; - }); - - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [2.1] - * - * // The `_.property` iteratee shorthand. - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - var intersectionBy = baseRest(function(arrays) { - var iteratee = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - if (iteratee === last(mapped)) { - iteratee = undefined; - } else { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, getIteratee(iteratee, 2)) - : []; - }); - - /** - * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The order and references - * of result values are determined by the first array. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - var intersectionWith = baseRest(function(arrays) { - var comparator = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - comparator = typeof comparator == 'function' ? comparator : undefined; - if (comparator) { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, undefined, comparator) - : []; - }); - - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to convert. - * @param {string} [separator=','] The element separator. - * @returns {string} Returns the joined string. - * @example - * - * _.join(['a', 'b', 'c'], '~'); - * // => 'a~b~c' - */ - function join(array, separator) { - return array == null ? '' : nativeJoin.call(array, separator); - } - - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined; - } - - /** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // Search from the `fromIndex`. - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - */ - function lastIndexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); - } - return value === value - ? strictLastIndexOf(array, value, index) - : baseFindIndex(array, baseIsNaN, index, true); - } - - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth - * element from the end is returned. - * - * @static - * @memberOf _ - * @since 4.11.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=0] The index of the element to return. - * @returns {*} Returns the nth element of `array`. - * @example - * - * var array = ['a', 'b', 'c', 'd']; - * - * _.nth(array, 1); - * // => 'b' - * - * _.nth(array, -2); - * // => 'c'; - */ - function nth(array, n) { - return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; - } - - /** - * Removes all given values from `array` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` - * to remove elements from an array by predicate. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; - * - * _.pull(array, 'a', 'c'); - * console.log(array); - * // => ['b', 'b'] - */ - var pull = baseRest(pullAll); - - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; - * - * _.pullAll(array, ['a', 'c']); - * console.log(array); - * // => ['b', 'b'] - */ - function pullAll(array, values) { - return (array && array.length && values && values.length) - ? basePullAll(array, values) - : array; - } - - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - function pullAllBy(array, values, iteratee) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, getIteratee(iteratee, 2)) - : array; - } - - /** - * This method is like `_.pullAll` except that it accepts `comparator` which - * is invoked to compare elements of `array` to `values`. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - function pullAllWith(array, values, comparator) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, undefined, comparator) - : array; - } - - /** - * Removes elements from `array` corresponding to `indexes` and returns an - * array of removed elements. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = ['a', 'b', 'c', 'd']; - * var pulled = _.pullAt(array, [1, 3]); - * - * console.log(array); - * // => ['a', 'c'] - * - * console.log(pulled); - * // => ['b', 'd'] - */ - var pullAt = flatRest(function(array, indexes) { - var length = array == null ? 0 : array.length, - result = baseAt(array, indexes); - - basePullAt(array, arrayMap(indexes, function(index) { - return isIndex(index, length) ? +index : index; - }).sort(compareAscending)); - - return result; - }); - - /** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is invoked - * with three arguments: (value, index, array). - * - * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` - * to pull elements from an array by value. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ - function remove(array, predicate) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = getIteratee(predicate, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; - } - - /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.reverse(array); - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function reverse(array) { - return array == null ? array : nativeReverse.call(array); - } - - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of - * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are - * returned. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - else { - start = start == null ? 0 : toInteger(start); - end = end === undefined ? length : toInteger(end); - } - return baseSlice(array, start, end); - } - - /** - * Uses a binary search to determine the lowest index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - */ - function sortedIndex(array, value) { - return baseSortedIndex(array, value); - } - - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; - * - * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); - * // => 0 - */ - function sortedIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); - } - - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([4, 5, 5, 5, 6], 5); - * // => 1 - */ - function sortedIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value); - if (index < length && eq(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedLastIndex([4, 5, 5, 5, 6], 5); - * // => 4 - */ - function sortedLastIndex(array, value) { - return baseSortedIndex(array, value, true); - } - - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; - * - * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 1 - * - * // The `_.property` iteratee shorthand. - * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); - * // => 1 - */ - function sortedLastIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); - } - - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); - * // => 3 - */ - function sortedLastIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value, true) - 1; - if (eq(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] - */ - function sortedUniq(array) { - return (array && array.length) - ? baseSortedUniq(array) - : []; - } - - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.3] - */ - function sortedUniqBy(array, iteratee) { - return (array && array.length) - ? baseSortedUniq(array, getIteratee(iteratee, 2)) - : []; - } - - /** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.tail([1, 2, 3]); - * // => [2, 3] - */ - function tail(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 1, length) : []; - } - - /** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ - function take(array, n, guard) { - if (!(array && array.length)) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ - function takeRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.takeRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeRightWhile(users, ['active', false]); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.takeRightWhile(users, 'active'); - * // => [] - */ - function takeRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), false, true) - : []; - } - - /** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.takeWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matches` iteratee shorthand. - * _.takeWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeWhile(users, ['active', false]); - * // => objects for ['barney', 'fred'] - * - * // The `_.property` iteratee shorthand. - * _.takeWhile(users, 'active'); - * // => [] - */ - function takeWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3)) - : []; - } - - /** - * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([2], [1, 2]); - * // => [2, 1] - */ - var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); - }); - - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which uniqueness is computed. Result values are chosen from the first - * array in which the value occurs. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.unionBy([2.1], [1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - var unionBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); - }); - - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. Result values are chosen from - * the first array in which the value occurs. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var unionWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); - }); - - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. The order of result values is determined by the order they occur - * in the array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ - function uniq(array) { - return (array && array.length) ? baseUniq(array) : []; - } - - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The order of result values is determined by the - * order they occur in the array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniqBy(array, iteratee) { - return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; - } - - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The order of result values is - * determined by the order they occur in the array.The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - function uniqWith(array, comparator) { - comparator = typeof comparator == 'function' ? comparator : undefined; - return (array && array.length) ? baseUniq(array, undefined, comparator) : []; - } - - /** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @since 1.2.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] - * - * _.unzip(zipped); - * // => [['a', 'b'], [1, 2], [true, false]] - */ - function unzip(array) { - if (!(array && array.length)) { - return []; - } - var length = 0; - array = arrayFilter(array, function(group) { - if (isArrayLikeObject(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - return baseTimes(length, function(index) { - return arrayMap(array, baseProperty(index)); - }); - } - - /** - * This method is like `_.unzip` except that it accepts `iteratee` to specify - * how regrouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee=_.identity] The function to combine - * regrouped values. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] - * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] - */ - function unzipWith(array, iteratee) { - if (!(array && array.length)) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - return arrayMap(result, function(group) { - return apply(iteratee, undefined, group); - }); - } - - /** - * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.pull`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.xor - * @example - * - * _.without([2, 1, 2, 3], 1, 2); - * // => [3] - */ - var without = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, values) - : []; - }); - - /** - * Creates an array of unique values that is the - * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the given arrays. The order of result values is determined by the order - * they occur in the arrays. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.without - * @example - * - * _.xor([2, 1], [2, 3]); - * // => [1, 3] - */ - var xor = baseRest(function(arrays) { - return baseXor(arrayFilter(arrays, isArrayLikeObject)); - }); - - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which by which they're compared. The order of result values is determined - * by the order they occur in the arrays. The iteratee is invoked with one - * argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2, 3.4] - * - * // The `_.property` iteratee shorthand. - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var xorBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); - }); - - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The order of result values is - * determined by the order they occur in the arrays. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var xorWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); - }); - - /** - * Creates an array of grouped elements, the first of which contains the - * first elements of the given arrays, the second of which contains the - * second elements of the given arrays, and so on. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] - */ - var zip = baseRest(unzip); - - /** - * This method is like `_.fromPairs` except that it accepts two arrays, - * one of property identifiers and one of corresponding values. - * - * @static - * @memberOf _ - * @since 0.4.0 - * @category Array - * @param {Array} [props=[]] The property identifiers. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject(['a', 'b'], [1, 2]); - * // => { 'a': 1, 'b': 2 } - */ - function zipObject(props, values) { - return baseZipObject(props || [], values || [], assignValue); - } - - /** - * This method is like `_.zipObject` except that it supports property paths. - * - * @static - * @memberOf _ - * @since 4.1.0 - * @category Array - * @param {Array} [props=[]] The property identifiers. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); - * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } - */ - function zipObjectDeep(props, values) { - return baseZipObject(props || [], values || [], baseSet); - } - - /** - * This method is like `_.zip` except that it accepts `iteratee` to specify - * how grouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee=_.identity] The function to combine - * grouped values. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { - * return a + b + c; - * }); - * // => [111, 222] - */ - var zipWith = baseRest(function(arrays) { - var length = arrays.length, - iteratee = length > 1 ? arrays[length - 1] : undefined; - - iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; - return unzipWith(arrays, iteratee); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` wrapper instance that wraps `value` with explicit method - * chain sequences enabled. The result of such sequences must be unwrapped - * with `_#value`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Seq - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _ - * .chain(users) - * .sortBy('age') - * .map(function(o) { - * return o.user + ' is ' + o.age; - * }) - * .head() - * .value(); - * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } - - /** - * This method invokes `interceptor` and returns `value`. The interceptor - * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain sequence in order to modify intermediate results. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * // Mutate input array. - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ - function tap(value, interceptor) { - interceptor(value); - return value; - } - - /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * The purpose of this method is to "pass thru" values replacing intermediate - * results in a method chain sequence. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ - function thru(value, interceptor) { - return interceptor(value); - } - - /** - * This method is the wrapper version of `_.at`. - * - * @name at - * @memberOf _ - * @since 1.0.0 - * @category Seq - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _(object).at(['a[0].b.c', 'a[1]']).value(); - * // => [3, 4] - */ - var wrapperAt = flatRest(function(paths) { - var length = paths.length, - start = length ? paths[0] : 0, - value = this.__wrapped__, - interceptor = function(object) { return baseAt(object, paths); }; - - if (length > 1 || this.__actions__.length || - !(value instanceof LazyWrapper) || !isIndex(start)) { - return this.thru(interceptor); - } - value = value.slice(start, +start + (length ? 1 : 0)); - value.__actions__.push({ - 'func': thru, - 'args': [interceptor], - 'thisArg': undefined - }); - return new LodashWrapper(value, this.__chain__).thru(function(array) { - if (length && !array.length) { - array.push(undefined); - } - return array; - }); - }); - - /** - * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. - * - * @name chain - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // A sequence without explicit chaining. - * _(users).head(); - * // => { 'user': 'barney', 'age': 36 } - * - * // A sequence with explicit chaining. - * _(users) - * .chain() - * .head() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } - - /** - * Executes the chain sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapped = wrapped.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapped.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ - function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); - } - - /** - * Gets the next value on a wrapped object following the - * [iterator protocol](https://mdn.io/iteration_protocols#iterator). - * - * @name next - * @memberOf _ - * @since 4.0.0 - * @category Seq - * @returns {Object} Returns the next iterator value. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped.next(); - * // => { 'done': false, 'value': 1 } - * - * wrapped.next(); - * // => { 'done': false, 'value': 2 } - * - * wrapped.next(); - * // => { 'done': true, 'value': undefined } - */ - function wrapperNext() { - if (this.__values__ === undefined) { - this.__values__ = toArray(this.value()); - } - var done = this.__index__ >= this.__values__.length, - value = done ? undefined : this.__values__[this.__index__++]; - - return { 'done': done, 'value': value }; - } - - /** - * Enables the wrapper to be iterable. - * - * @name Symbol.iterator - * @memberOf _ - * @since 4.0.0 - * @category Seq - * @returns {Object} Returns the wrapper object. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped[Symbol.iterator]() === wrapped; - * // => true - * - * Array.from(wrapped); - * // => [1, 2] - */ - function wrapperToIterator() { - return this; - } - - /** - * Creates a clone of the chain sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @param {*} value The value to plant. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2]).map(square); - * var other = wrapped.plant([3, 4]); - * - * other.value(); - * // => [9, 16] - * - * wrapped.value(); - * // => [1, 4] - */ - function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - clone.__index__ = 0; - clone.__values__ = undefined; - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; - } - - /** - * This method is the wrapper version of `_.reverse`. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - var wrapped = value; - if (this.__actions__.length) { - wrapped = new LazyWrapper(this); - } - wrapped = wrapped.reverse(); - wrapped.__actions__.push({ - 'func': thru, - 'args': [reverse], - 'thisArg': undefined - }); - return new LodashWrapper(wrapped, this.__chain__); - } - return this.thru(reverse); - } - - /** - * Executes the chain sequence to resolve the unwrapped value. - * - * @name value - * @memberOf _ - * @since 0.1.0 - * @alias toJSON, valueOf - * @category Seq - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the number of times the key was returned by `iteratee`. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': 1, '6': 2 } - * - * // The `_.property` iteratee shorthand. - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ - var countBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - ++result[key]; - } else { - baseAssignValue(result, key, 1); - } - }); - - /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * **Note:** This method returns `true` for - * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because - * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of - * elements of empty collections. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false - */ - function every(collection, predicate, guard) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * **Note:** Unlike `_.remove`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.reject - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] - * - * // Combining several predicates using `_.overEvery` or `_.overSome`. - * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); - * // => objects for ['fred', 'barney'] - */ - function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' - * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' - */ - var find = createFind(findIndex); - - /** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=collection.length-1] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ - var findLast = createFind(findLastIndex); - - /** - * Creates a flattened array of values by running each element in `collection` - * thru `iteratee` and flattening the mapped results. The iteratee is invoked - * with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [n, n]; - * } - * - * _.flatMap([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee), 1); - } - - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - function flatMapDeep(collection, iteratee) { - return baseFlatten(map(collection, iteratee), INFINITY); - } - - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - function flatMapDepth(collection, iteratee, depth) { - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(map(collection, iteratee), depth); - } - - /** - * Iterates over elements of `collection` and invokes `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" - * property are iterated like arrays. To avoid this behavior use `_.forIn` - * or `_.forOwn` for object iteration. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEachRight - * @example - * - * _.forEach([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `1` then `2`. - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forEach(collection, iteratee) { - var func = isArray(collection) ? arrayEach : baseEach; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @alias eachRight - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEach - * @example - * - * _.forEachRight([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `2` then `1`. - */ - function forEachRight(collection, iteratee) { - var func = isArray(collection) ? arrayEachRight : baseEachRight; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The order of grouped values - * is determined by the order they occur in `collection`. The corresponding - * value of each key is an array of elements responsible for generating the - * key. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': [4.2], '6': [6.1, 6.3] } - * - * // The `_.property` iteratee shorthand. - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - baseAssignValue(result, key, [value]); - } - }); - - /** - * Checks if `value` is in `collection`. If `collection` is a string, it's - * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'a': 1, 'b': 2 }, 1); - * // => true - * - * _.includes('abcd', 'bc'); - * // => true - */ - function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); - } - - /** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `path` is a function, it's invoked - * for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke each method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invokeMap([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - var invokeMap = baseRest(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); - }); - return result; - }); - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the last element responsible for generating the key. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var array = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.keyBy(array, function(o) { - * return String.fromCharCode(o.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.keyBy(array, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - */ - var keyBy = createAggregator(function(result, value, key) { - baseAssignValue(result, key, value); - }); - - /** - * Creates an array of values by running each element in `collection` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, - * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, - * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, - * `template`, `trim`, `trimEnd`, `trimStart`, and `words` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - * @example - * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] - * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] - * The iteratees to sort by. - * @param {string[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // Sort by `user` in ascending order and by `age` in descending order. - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] - */ - function orderBy(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - orders = guard ? undefined : orders; - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseOrderBy(collection, iteratees, orders); - } - - /** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, the second of which - * contains elements `predicate` returns falsey for. The predicate is - * invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * _.partition(users, function(o) { return o.active; }); - * // => objects for [['fred'], ['barney', 'pebbles']] - * - * // The `_.matches` iteratee shorthand. - * _.partition(users, { 'age': 1, 'active': false }); - * // => objects for [['pebbles'], ['barney', 'fred']] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.partition(users, ['active', false]); - * // => objects for [['barney', 'pebbles'], ['fred']] - * - * // The `_.property` iteratee shorthand. - * _.partition(users, 'active'); - * // => objects for [['fred'], ['barney', 'pebbles']] - */ - var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); - }, function() { return [[], []]; }); - - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` thru `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not given, the first element of `collection` is used as the initial - * value. The iteratee is invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, - * and `sortBy` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduceRight - * @example - * - * _.reduce([1, 2], function(sum, n) { - * return sum + n; - * }, 0); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) - */ - function reduce(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduce : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); - } - - /** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduce - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - function reduceRight(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduceRight : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); - } - - /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.filter - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * _.reject(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.reject(users, { 'age': 40, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.reject(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.reject(users, 'active'); - * // => objects for ['barney'] - */ - function reject(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, negate(getIteratee(predicate, 3))); - } - - /** - * Gets a random element from `collection`. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - */ - function sample(collection) { - var func = isArray(collection) ? arraySample : baseSample; - return func(collection); - } - - /** - * Gets `n` random elements at unique keys from `collection` up to the - * size of `collection`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @param {number} [n=1] The number of elements to sample. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the random elements. - * @example - * - * _.sampleSize([1, 2, 3], 2); - * // => [3, 1] - * - * _.sampleSize([1, 2, 3], 4); - * // => [2, 3, 1] - */ - function sampleSize(collection, n, guard) { - if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - var func = isArray(collection) ? arraySampleSize : baseSampleSize; - return func(collection, n); - } - - /** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ - function shuffle(collection) { - var func = isArray(collection) ? arrayShuffle : baseShuffle; - return func(collection); - } - - /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable string keyed properties for objects. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the collection size. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - if (collection == null) { - return 0; - } - if (isArrayLike(collection)) { - return isString(collection) ? stringSize(collection) : collection.length; - } - var tag = getTag(collection); - if (tag == mapTag || tag == setTag) { - return collection.size; - } - return baseKeys(collection).length; - } - - /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * Iteration is stopped once `predicate` returns truthy. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.some(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.some(users, 'active'); - * // => true - */ - function some(collection, predicate, guard) { - var func = isArray(collection) ? arraySome : baseSome; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection thru each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[])} [iteratees=[_.identity]] - * The iteratees to sort by. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 30 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, [function(o) { return o.user; }]); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] - */ - var sortBy = baseRest(function(collection, iteratees) { - if (collection == null) { - return []; - } - var length = iteratees.length; - if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees = [iteratees[0]]; - } - return baseOrderBy(collection, baseFlatten(iteratees, 1), []); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ - var now = ctxNow || function() { - return root.Date.now(); - }; - - /*------------------------------------------------------------------------*/ - - /** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it's called `n` or more times. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => Logs 'done saving!' after the two async saves have completed. - */ - function after(n, func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - - /** - * Creates a function that invokes `func`, with up to `n` arguments, - * ignoring any additional arguments. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new capped function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ - function ary(func, n, guard) { - n = guard ? undefined : n; - n = (func && n == null) ? func.length : n; - return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); - } - - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => Allows adding up to 4 contacts to the list. - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and `partials` prepended to the arguments it receives. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * function greet(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // Bound with placeholders. - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ - var bind = baseRest(function(func, thisArg, partials) { - var bitmask = WRAP_BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bind)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(func, bitmask, thisArg, partials, holders); - }); - - /** - * Creates a function that invokes the method at `object[key]` with `partials` - * prepended to the arguments it receives. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. See - * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Function - * @param {Object} object The object to invoke the method on. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // Bound with placeholders. - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ - var bindKey = baseRest(function(object, key, partials) { - var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bindKey)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(key, bitmask, object, partials, holders); - }); - - /** - * Creates a function that accepts arguments of `func` and either invokes - * `func` returning its result, if at least `arity` number of arguments have - * been provided, or returns a function that accepts the remaining `func` - * arguments, and so on. The arity of `func` may be specified if `func.length` - * is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ - function curry(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curry.placeholder; - return result; - } - - /** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ - function curryRight(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryRight.placeholder; - return result; - } - - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ - function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - timeWaiting = wait - timeSinceLastCall; - - return maxing - ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) - : timeWaiting; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - clearTimeout(timerId); - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } - - /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => Logs 'deferred' after one millisecond. - */ - var defer = baseRest(function(func, args) { - return baseDelay(func, 1, args); - }); - - /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => Logs 'later' after one second. - */ - var delay = baseRest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); - }); - - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new flipped function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - function flip(func) { - return createWrap(func, WRAP_FLIP_FLAG); - } - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; - } - - // Expose `MapCache`. - memoize.Cache = MapCache; - - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new negated function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - var args = arguments; - switch (args.length) { - case 0: return !predicate.call(this); - case 1: return !predicate.call(this, args[0]); - case 2: return !predicate.call(this, args[0], args[1]); - case 3: return !predicate.call(this, args[0], args[1], args[2]); - } - return !predicate.apply(this, args); - }; - } - - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first invocation. The `func` is - * invoked with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // => `createApplication` is invoked once - */ - function once(func) { - return before(2, func); - } - - /** - * Creates a function that invokes `func` with its arguments transformed. - * - * @static - * @since 4.0.0 - * @memberOf _ - * @category Function - * @param {Function} func The function to wrap. - * @param {...(Function|Function[])} [transforms=[_.identity]] - * The argument transforms. - * @returns {Function} Returns the new function. - * @example - * - * function doubled(n) { - * return n * 2; - * } - * - * function square(n) { - * return n * n; - * } - * - * var func = _.overArgs(function(x, y) { - * return [x, y]; - * }, [square, doubled]); - * - * func(9, 3); - * // => [81, 6] - * - * func(10, 5); - * // => [100, 10] - */ - var overArgs = castRest(function(func, transforms) { - transforms = (transforms.length == 1 && isArray(transforms[0])) - ? arrayMap(transforms[0], baseUnary(getIteratee())) - : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); - - var funcsLength = transforms.length; - return baseRest(function(args) { - var index = -1, - length = nativeMin(args.length, funcsLength); - - while (++index < length) { - args[index] = transforms[index].call(this, args[index]); - } - return apply(func, this, args); - }); - }); - - /** - * Creates a function that invokes `func` with `partials` prepended to the - * arguments it receives. This method is like `_.bind` except it does **not** - * alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @since 0.2.0 - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // Partially applied with placeholders. - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ - var partial = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partial)); - return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); - }); - - /** - * This method is like `_.partial` except that partially applied arguments - * are appended to the arguments it receives. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // Partially applied with placeholders. - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ - var partialRight = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partialRight)); - return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); - }); - - /** - * Creates a function that invokes `func` with arguments arranged according - * to the specified `indexes` where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, [2, 0, 1]); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - */ - var rearg = flatRest(function(func, indexes) { - return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); - }); - - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start === undefined ? start : toInteger(start); - return baseRest(func, start); - } - - /** - * Creates a function that invokes `func` with the `this` binding of the - * create function and an array of arguments much like - * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). - * - * **Note:** This method is based on the - * [spread operator](https://mdn.io/spread_operator). - * - * @static - * @memberOf _ - * @since 3.2.0 - * @category Function - * @param {Function} func The function to spread arguments over. - * @param {number} [start=0] The start position of the spread. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 - */ - function spread(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start == null ? 0 : nativeMax(toInteger(start), 0); - return baseRest(function(args) { - var array = args[start], - otherArgs = castSlice(args, 0, start); - - if (array) { - arrayPush(otherArgs, array); - } - return apply(func, this, otherArgs); - }); - } - - /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed `func` invocations and a `flush` method to - * immediately invoke them. Provide `options` to indicate whether `func` - * should be invoked on the leading and/or trailing edge of the `wait` - * timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the throttled function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=true] - * Specify invoking on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); - * jQuery(element).on('click', throttled); - * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { - 'leading': leading, - 'maxWait': wait, - 'trailing': trailing - }); - } - - /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - * @example - * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] - */ - function unary(func) { - return ary(func, 1); - } - - /** - * Creates a function that provides `value` to `wrapper` as its first - * argument. Any additional arguments provided to the function are appended - * to those provided to the `wrapper`. The wrapper is invoked with the `this` - * binding of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {*} value The value to wrap. - * @param {Function} [wrapper=identity] The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

' + func(text) + '

'; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

fred, barney, & pebbles

' - */ - function wrap(value, wrapper) { - return partial(castFunction(wrapper), value); - } - - /*------------------------------------------------------------------------*/ - - /** - * Casts `value` as an array if it's not one. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Lang - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast array. - * @example - * - * _.castArray(1); - * // => [1] - * - * _.castArray({ 'a': 1 }); - * // => [{ 'a': 1 }] - * - * _.castArray('abc'); - * // => ['abc'] - * - * _.castArray(null); - * // => [null] - * - * _.castArray(undefined); - * // => [undefined] - * - * _.castArray(); - * // => [] - * - * var array = [1, 2, 3]; - * console.log(_.castArray(array) === array); - * // => true - */ - function castArray() { - if (!arguments.length) { - return []; - } - var value = arguments[0]; - return isArray(value) ? value : [value]; - } - - /** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @see _.cloneDeep - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true - */ - function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); - } - - /** - * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined`, - * cloning is handled by the method instead. The `customizer` is invoked with - * up to four arguments; (value [, index|key, object, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the cloned value. - * @see _.cloneDeepWith - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * } - * - * var el = _.cloneWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 0 - */ - function cloneWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); - } - - /** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @see _.clone - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ - function cloneDeep(value) { - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); - } - - /** - * This method is like `_.cloneWith` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the deep cloned value. - * @see _.cloneWith - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * } - * - * var el = _.cloneDeepWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 20 - */ - function cloneDeepWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); - } - - /** - * Checks if `object` conforms to `source` by invoking the predicate - * properties of `source` with the corresponding property values of `object`. - * - * **Note:** This method is equivalent to `_.conforms` when `source` is - * partially applied. - * - * @static - * @memberOf _ - * @since 4.14.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * - * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); - * // => true - * - * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); - * // => false - */ - function conformsTo(object, source) { - return source == null || baseConformsTo(object, source, keys(source)); - } - - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - /** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - * @see _.lt - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ - var gt = createRelationalOperation(baseGt); - - /** - * Checks if `value` is greater than or equal to `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to - * `other`, else `false`. - * @see _.lte - * @example - * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true - * - * _.gte(1, 3); - * // => false - */ - var gte = createRelationalOperation(function(value, other) { - return value >= other; - }); - - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); - }; - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is classified as an `ArrayBuffer` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - * @example - * - * _.isArrayBuffer(new ArrayBuffer(2)); - * // => true - * - * _.isArrayBuffer(new Array(2)); - * // => false - */ - var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && baseGetTag(value) == boolTag); - } - - /** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ - var isBuffer = nativeIsBuffer || stubFalse; - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; - - /** - * Checks if `value` is likely a DOM element. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); - } - - /** - * Checks if `value` is an empty object, collection, map, or set. - * - * Objects are considered empty if they have no own enumerable string keyed - * properties. - * - * Array-like values such as `arguments` objects, arrays, buffers, strings, or - * jQuery-like collections are considered empty if they have a `length` of `0`. - * Similarly, maps and sets are considered empty if they have a `size` of `0`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || - isBuffer(value) || isTypedArray(value) || isArguments(value))) { - return !value.length; - } - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } - if (isPrototype(value)) { - return !baseKeys(value).length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are compared by strict equality, i.e. `===`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - function isEqual(value, other) { - return baseIsEqual(value, other); - } - - /** - * This method is like `_.isEqual` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with up to - * six arguments: (objValue, othValue [, index|key, object, other, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - function isEqualWith(value, other, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; - } - - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - if (!isObjectLike(value)) { - return false; - } - var tag = baseGetTag(value); - return tag == errorTag || tag == domExcTag || - (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on - * [`Number.isFinite`](https://mdn.io/Number/isFinite). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(3); - * // => true - * - * _.isFinite(Number.MIN_VALUE); - * // => true - * - * _.isFinite(Infinity); - * // => false - * - * _.isFinite('3'); - * // => false - */ - function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; - } - - /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on - * [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ - function isInteger(value) { - return typeof value == 'number' && value == toInteger(value); - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return value != null && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `Map` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - * @example - * - * _.isMap(new Map); - * // => true - * - * _.isMap(new WeakMap); - * // => false - */ - var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; - - /** - * Performs a partial deep comparison between `object` and `source` to - * determine if `object` contains equivalent property values. - * - * **Note:** This method is equivalent to `_.matches` when `source` is - * partially applied. - * - * Partial comparisons will match empty array and empty object `source` - * values against any array or object value, respectively. See `_.isEqual` - * for a list of supported value comparisons. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * - * _.isMatch(object, { 'b': 2 }); - * // => true - * - * _.isMatch(object, { 'b': 1 }); - * // => false - */ - function isMatch(object, source) { - return object === source || baseIsMatch(object, source, getMatchData(source)); - } - - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with five - * arguments: (objValue, srcValue, index|key, object, source). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - function isMatchWith(object, source, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseIsMatch(object, source, getMatchData(source), customizer); - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is based on - * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as - * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for - * `undefined` and other non-number values. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some - // ActiveX objects in IE. - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is a pristine native function. - * - * **Note:** This method can't reliably detect native functions in the presence - * of the core-js package because core-js circumvents this kind of detection. - * Despite multiple requests, the core-js maintainer has made it clear: any - * attempt to fix the detection will be obstructed. As a result, we're left - * with little choice but to throw an error. Unfortunately, this also affects - * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), - * which rely on core-js. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (isMaskable(value)) { - throw new Error(CORE_ERROR_TEXT); - } - return baseIsNative(value); - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is `null` or `undefined`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - function isNil(value) { - return value == null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are - * classified as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a number, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && baseGetTag(value) == numberTag); - } - - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; - } - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; - - /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on - * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ - function isSafeInteger(value) { - return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is classified as a `Set` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - * @example - * - * _.isSet(new Set); - * // => true - * - * _.isSet(new WeakSet); - * // => false - */ - var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a string, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); - } - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); - } - - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - - /** - * Checks if `value` is `undefined`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Checks if `value` is classified as a `WeakMap` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. - * @example - * - * _.isWeakMap(new WeakMap); - * // => true - * - * _.isWeakMap(new Map); - * // => false - */ - function isWeakMap(value) { - return isObjectLike(value) && getTag(value) == weakMapTag; - } - - /** - * Checks if `value` is classified as a `WeakSet` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. - * @example - * - * _.isWeakSet(new WeakSet); - * // => true - * - * _.isWeakSet(new Set); - * // => false - */ - function isWeakSet(value) { - return isObjectLike(value) && baseGetTag(value) == weakSetTag; - } - - /** - * Checks if `value` is less than `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - * @see _.gt - * @example - * - * _.lt(1, 3); - * // => true - * - * _.lt(3, 3); - * // => false - * - * _.lt(3, 1); - * // => false - */ - var lt = createRelationalOperation(baseLt); - - /** - * Checks if `value` is less than or equal to `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to - * `other`, else `false`. - * @see _.gte - * @example - * - * _.lte(1, 3); - * // => true - * - * _.lte(3, 3); - * // => true - * - * _.lte(3, 1); - * // => false - */ - var lte = createRelationalOperation(function(value, other) { - return value <= other; - }); - - /** - * Converts `value` to an array. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * _.toArray({ 'a': 1, 'b': 2 }); - * // => [1, 2] - * - * _.toArray('abc'); - * // => ['a', 'b', 'c'] - * - * _.toArray(1); - * // => [] - * - * _.toArray(null); - * // => [] - */ - function toArray(value) { - if (!value) { - return []; - } - if (isArrayLike(value)) { - return isString(value) ? stringToArray(value) : copyArray(value); - } - if (symIterator && value[symIterator]) { - return iteratorToArray(value[symIterator]()); - } - var tag = getTag(value), - func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); - - return func(value); - } - - /** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ - function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; - } - - /** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ - function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; - } - - /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toLength(3.2); - * // => 3 - * - * _.toLength(Number.MIN_VALUE); - * // => 0 - * - * _.toLength(Infinity); - * // => 4294967295 - * - * _.toLength('3.2'); - * // => 3 - */ - function toLength(value) { - return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; - } - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = baseTrim(value); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); - } - - /** - * Converts `value` to a plain object flattening inherited enumerable string - * keyed properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return copyObject(value, keysIn(value)); - } - - /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toSafeInteger(3.2); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 - * - * _.toSafeInteger('3.2'); - * // => 3 - */ - function toSafeInteger(value) { - return value - ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) - : (value === 0 ? value : 0); - } - - /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - return value == null ? '' : baseToString(value); - } - - /*------------------------------------------------------------------------*/ - - /** - * Assigns own enumerable string keyed properties of source objects to the - * destination object. Source objects are applied from left to right. - * Subsequent sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assignIn - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assign({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3 } - */ - var assign = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; - } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); - } - } - }); - - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assign - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assignIn({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } - */ - var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); - }); - - /** - * This method is like `_.assignIn` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); - }); - - /** - * This method is like `_.assign` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignInWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keys(source), object, customizer); - }); - - /** - * Creates an array of values corresponding to `paths` of `object`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Array} Returns the picked values. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _.at(object, ['a[0].b.c', 'a[1]']); - * // => [3, 4] - */ - var at = flatRest(baseAt); - - /** - * Creates an object that inherits from the `prototype` object. If a - * `properties` object is given, its own enumerable string keyed properties - * are assigned to the created object. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties) { - var result = baseCreate(prototype); - return properties == null ? result : baseAssign(result, properties); - } - - /** - * Assigns own and inherited enumerable string keyed properties of source - * objects to the destination object for all destination properties that - * resolve to `undefined`. Source objects are applied from left to right. - * Once a property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaultsDeep - * @example - * - * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var defaults = baseRest(function(object, sources) { - object = Object(object); - - var index = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length = 1; - } - - while (++index < length) { - var source = sources[index]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; - - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object[key]; - - if (value === undefined || - (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { - object[key] = source[key]; - } - } - } - - return object; - }); - - /** - * This method is like `_.defaults` except that it recursively assigns - * default properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaults - * @example - * - * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); - * // => { 'a': { 'b': 2, 'c': 3 } } - */ - var defaultsDeep = baseRest(function(args) { - args.push(undefined, customDefaultsMerge); - return apply(mergeWith, undefined, args); - }); - - /** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(o) { return o.age < 40; }); - * // => 'barney' (iteration order is not guaranteed) - * - * // The `_.matches` iteratee shorthand. - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findKey(users, 'active'); - * // => 'barney' - */ - function findKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); - } - - /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(o) { return o.age < 40; }); - * // => returns 'pebbles' assuming `_.findKey` returns 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ - function findLastKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); - } - - /** - * Iterates over own and inherited enumerable string keyed properties of an - * object and invokes `iteratee` for each property. The iteratee is invoked - * with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forInRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). - */ - function forIn(object, iteratee) { - return object == null - ? object - : baseFor(object, getIteratee(iteratee, 3), keysIn); - } - - /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forIn - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. - */ - function forInRight(object, iteratee) { - return object == null - ? object - : baseForRight(object, getIteratee(iteratee, 3), keysIn); - } - - /** - * Iterates over own enumerable string keyed properties of an object and - * invokes `iteratee` for each property. The iteratee is invoked with three - * arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwnRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forOwn(object, iteratee) { - return object && baseForOwn(object, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwn - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. - */ - function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, getIteratee(iteratee, 3)); - } - - /** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functionsIn - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ - function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); - } - - /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functions - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ - function functionsIn(object) { - return object == null ? [] : baseFunctions(object, keysIn(object)); - } - - /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; - } - - /** - * Checks if `path` is a direct property of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': 2 } }; - * var other = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b'); - * // => true - * - * _.has(object, ['a', 'b']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - function has(object, path) { - return object != null && hasPath(object, path, baseHas); - } - - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); - } - - /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite - * property assignments of previous values. - * - * @static - * @memberOf _ - * @since 0.7.0 - * @category Object - * @param {Object} object The object to invert. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } - */ - var invert = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } - - result[value] = key; - }, constant(identity)); - - /** - * This method is like `_.invert` except that the inverted object is generated - * from the results of running each element of `object` thru `iteratee`. The - * corresponding inverted value of each inverted key is an array of keys - * responsible for generating the inverted value. The iteratee is invoked - * with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.1.0 - * @category Object - * @param {Object} object The object to invert. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invertBy(object); - * // => { '1': ['a', 'c'], '2': ['b'] } - * - * _.invertBy(object, function(value) { - * return 'group' + value; - * }); - * // => { 'group1': ['a', 'c'], 'group2': ['b'] } - */ - var invertBy = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } - - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - }, getIteratee); - - /** - * Invokes the method at `path` of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - * @example - * - * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; - * - * _.invoke(object, 'a[0].b.c.slice', 1, 3); - * // => [2, 3] - */ - var invoke = baseRest(baseInvoke); - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); - } - - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } - - /** - * The opposite of `_.mapValues`; this method creates an object with the - * same values as `object` and keys generated by running each own enumerable - * string keyed property of `object` thru `iteratee`. The iteratee is invoked - * with three arguments: (value, key, object). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapValues - * @example - * - * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); - * // => { 'a1': 1, 'b2': 2 } - */ - function mapKeys(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, iteratee(value, key, object), value); - }); - return result; - } - - /** - * Creates an object with the same keys as `object` and values generated - * by running each own enumerable string keyed property of `object` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, key, object). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapKeys - * @example - * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; - * - * _.mapValues(users, function(o) { return o.age; }); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - * - * // The `_.property` iteratee shorthand. - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - */ - function mapValues(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, key, iteratee(value, key, object)); - }); - return result; - } - - /** - * This method is like `_.assign` except that it recursively merges own and - * inherited enumerable string keyed properties of source objects into the - * destination object. Source properties that resolve to `undefined` are - * skipped if a destination value exists. Array and plain object properties - * are merged recursively. Other objects and value types are overridden by - * assignment. Source objects are applied from left to right. Subsequent - * sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var object = { - * 'a': [{ 'b': 2 }, { 'd': 4 }] - * }; - * - * var other = { - * 'a': [{ 'c': 3 }, { 'e': 5 }] - * }; - * - * _.merge(object, other); - * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } - */ - var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); - }); - - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined`, merging is handled by the - * method instead. The `customizer` is invoked with six arguments: - * (objValue, srcValue, key, object, source, stack). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} customizer The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { 'a': [1], 'b': [2] }; - * var other = { 'a': [3], 'b': [4] }; - * - * _.mergeWith(object, other, customizer); - * // => { 'a': [1, 3], 'b': [2, 4] } - */ - var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { - baseMerge(object, source, srcIndex, customizer); - }); - - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable property paths of `object` that are not omitted. - * - * **Note:** This method is considerably slower than `_.pick`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to omit. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - var omit = flatRest(function(object, paths) { - var result = {}; - if (object == null) { - return result; - } - var isDeep = false; - paths = arrayMap(paths, function(path) { - path = castPath(path, object); - isDeep || (isDeep = path.length > 1); - return path; - }); - copyObject(object, getAllKeysIn(object), result); - if (isDeep) { - result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); - } - var length = paths.length; - while (length--) { - baseUnset(result, paths[length]); - } - return result; - }); - - /** - * The opposite of `_.pickBy`; this method creates an object composed of - * the own and inherited enumerable string keyed properties of `object` that - * `predicate` doesn't return truthy for. The predicate is invoked with two - * arguments: (value, key). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - function omitBy(object, predicate) { - return pickBy(object, negate(getIteratee(predicate))); - } - - /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); - }); - - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - function pickBy(object, predicate) { - if (object == null) { - return {}; - } - var props = arrayMap(getAllKeysIn(object), function(prop) { - return [prop]; - }); - predicate = getIteratee(predicate); - return basePickBy(object, props, function(value, path) { - return predicate(value, path[0]); - }); - } - - /** - * This method is like `_.get` except that if the resolved value is a - * function it's invoked with the `this` binding of its parent object and - * its result is returned. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a[0].b.c3', 'default'); - * // => 'default' - * - * _.result(object, 'a[0].b.c3', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - path = castPath(path, object); - - var index = -1, - length = path.length; - - // Ensure the loop is entered when path is empty. - if (!length) { - length = 1; - object = undefined; - } - while (++index < length) { - var value = object == null ? undefined : object[toKey(path[index])]; - if (value === undefined) { - index = length; - value = defaultValue; - } - object = isFunction(value) ? value.call(object) : value; - } - return object; - } - - /** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, - * it's created. Arrays are created for missing index properties while objects - * are created for all other missing properties. Use `_.setWith` to customize - * `path` creation. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 - * - * _.set(object, ['x', '0', 'y', 'z'], 5); - * console.log(object.x[0].y.z); - * // => 5 - */ - function set(object, path, value) { - return object == null ? object : baseSet(object, path, value); - } - - /** - * This method is like `_.set` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * var object = {}; - * - * _.setWith(object, '[0][1]', 'a', Object); - * // => { '0': { '1': 'a' } } - */ - function setWith(object, path, value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseSet(object, path, value, customizer); - } - - /** - * Creates an array of own enumerable string keyed-value pairs for `object` - * which can be consumed by `_.fromPairs`. If `object` is a map or set, its - * entries are returned. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias entries - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairs(new Foo); - * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) - */ - var toPairs = createToPairs(keys); - - /** - * Creates an array of own and inherited enumerable string keyed-value pairs - * for `object` which can be consumed by `_.fromPairs`. If `object` is a map - * or set, its entries are returned. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias entriesIn - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairsIn(new Foo); - * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) - */ - var toPairsIn = createToPairs(keysIn); - - /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own - * enumerable string keyed properties thru `iteratee`, with each invocation - * potentially mutating the `accumulator` object. If `accumulator` is not - * provided, a new object with the same `[[Prototype]]` will be used. The - * iteratee is invoked with four arguments: (accumulator, value, key, object). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @returns {*} Returns the accumulated value. - * @example - * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }, []); - * // => [4, 9] - * - * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } - */ - function transform(object, iteratee, accumulator) { - var isArr = isArray(object), - isArrLike = isArr || isBuffer(object) || isTypedArray(object); - - iteratee = getIteratee(iteratee, 4); - if (accumulator == null) { - var Ctor = object && object.constructor; - if (isArrLike) { - accumulator = isArr ? new Ctor : []; - } - else if (isObject(object)) { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; - } - else { - accumulator = {}; - } - } - (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; - } - - /** - * Removes the property at `path` of `object`. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 7 } }] }; - * _.unset(object, 'a[0].b.c'); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - * - * _.unset(object, ['a', '0', 'b', 'c']); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - */ - function unset(object, path) { - return object == null ? true : baseUnset(object, path); - } - - /** - * This method is like `_.set` except that accepts `updater` to produce the - * value to set. Use `_.updateWith` to customize `path` creation. The `updater` - * is invoked with one argument: (value). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.update(object, 'a[0].b.c', function(n) { return n * n; }); - * console.log(object.a[0].b.c); - * // => 9 - * - * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); - * console.log(object.x[0].y.z); - * // => 0 - */ - function update(object, path, updater) { - return object == null ? object : baseUpdate(object, path, castFunction(updater)); - } - - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - function updateWith(object, path, updater, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); - } - - /** - * Creates an array of the own enumerable string keyed property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return object == null ? [] : baseValues(object, keys(object)); - } - - /** - * Creates an array of the own and inherited enumerable string keyed property - * values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) - */ - function valuesIn(object) { - return object == null ? [] : baseValues(object, keysIn(object)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Number - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - function clamp(number, lower, upper) { - if (upper === undefined) { - upper = lower; - lower = undefined; - } - if (upper !== undefined) { - upper = toNumber(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; - } - return baseClamp(toNumber(number), lower, upper); - } - - /** - * Checks if `n` is between `start` and up to, but not including, `end`. If - * `end` is not specified, it's set to `start` with `start` then set to `0`. - * If `start` is greater than `end` the params are swapped to support - * negative ranges. - * - * @static - * @memberOf _ - * @since 3.3.0 - * @category Number - * @param {number} number The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - * @see _.range, _.rangeRight - * @example - * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); - * // => true - * - * _.inRange(5.2, 4); - * // => false - * - * _.inRange(-3, -2, -6); - * // => true - */ - function inRange(number, start, end) { - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - number = toNumber(number); - return baseInRange(number, start, end); - } - - /** - * Produces a random number between the inclusive `lower` and `upper` bounds. - * If only one argument is provided a number between `0` and the given number - * is returned. If `floating` is `true`, or either `lower` or `upper` are - * floats, a floating-point number is returned instead of an integer. - * - * **Note:** JavaScript follows the IEEE-754 standard for resolving - * floating-point values which can produce unexpected results. - * - * @static - * @memberOf _ - * @since 0.7.0 - * @category Number - * @param {number} [lower=0] The lower bound. - * @param {number} [upper=1] The upper bound. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. - * @example - * - * _.random(0, 5); - * // => an integer between 0 and 5 - * - * _.random(5); - * // => also an integer between 0 and 5 - * - * _.random(5, true); - * // => a floating-point number between 0 and 5 - * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 - */ - function random(lower, upper, floating) { - if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { - upper = floating = undefined; - } - if (floating === undefined) { - if (typeof upper == 'boolean') { - floating = upper; - upper = undefined; - } - else if (typeof lower == 'boolean') { - floating = lower; - lower = undefined; - } - } - if (lower === undefined && upper === undefined) { - lower = 0; - upper = 1; - } - else { - lower = toFinite(lower); - if (upper === undefined) { - upper = lower; - lower = 0; - } else { - upper = toFinite(upper); - } - } - if (lower > upper) { - var temp = lower; - lower = upper; - upper = temp; - } - if (floating || lower % 1 || upper % 1) { - var rand = nativeRandom(); - return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); - } - return baseRandom(lower, upper); - } - - /*------------------------------------------------------------------------*/ - - /** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar--'); - * // => 'fooBar' - * - * _.camelCase('__FOO_BAR__'); - * // => 'fooBar' - */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); - }); - - /** - * Converts the first character of `string` to upper case and the remaining - * to lower case. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('FRED'); - * // => 'Fred' - */ - function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); - } - - /** - * Deburrs `string` by converting - * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) - * letters to basic Latin letters and removing - * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ - function deburr(string) { - string = toString(string); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); - } - - /** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search up to. - * @returns {boolean} Returns `true` if `string` ends with `target`, - * else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ - function endsWith(string, target, position) { - string = toString(string); - target = baseToString(target); - - var length = string.length; - position = position === undefined - ? length - : baseClamp(toInteger(position), 0, length); - - var end = position; - position -= target.length; - return position >= 0 && string.slice(position, end) == target; - } - - /** - * Converts the characters "&", "<", ">", '"', and "'" in `string` to their - * corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional - * characters use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. See - * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * When working with HTML you should always - * [quote attribute values](http://wonko.com/post/html-escaping) to reduce - * XSS vectors. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /** - * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", - * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https://lodash\.com/\)' - */ - function escapeRegExp(string) { - string = toString(string); - return (string && reHasRegExpChar.test(string)) - ? string.replace(reRegExpChar, '\\$&') - : string; - } - - /** - * Converts `string` to - * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__FOO_BAR__'); - * // => 'foo-bar' - */ - var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); - - /** - * Converts `string`, as space separated words, to lower case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the lower cased string. - * @example - * - * _.lowerCase('--Foo-Bar--'); - * // => 'foo bar' - * - * _.lowerCase('fooBar'); - * // => 'foo bar' - * - * _.lowerCase('__FOO_BAR__'); - * // => 'foo bar' - */ - var lowerCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + word.toLowerCase(); - }); - - /** - * Converts the first character of `string` to lower case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.lowerFirst('Fred'); - * // => 'fred' - * - * _.lowerFirst('FRED'); - * // => 'fRED' - */ - var lowerFirst = createCaseFirst('toLowerCase'); - - /** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ - function pad(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - if (!length || strLength >= length) { - return string; - } - var mid = (length - strLength) / 2; - return ( - createPadding(nativeFloor(mid), chars) + - string + - createPadding(nativeCeil(mid), chars) - ); - } - - /** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padEnd('abc', 6); - * // => 'abc ' - * - * _.padEnd('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padEnd('abc', 3); - * // => 'abc' - */ - function padEnd(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (string + createPadding(length - strLength, chars)) - : string; - } - - /** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padStart('abc', 6); - * // => ' abc' - * - * _.padStart('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padStart('abc', 3); - * // => 'abc' - */ - function padStart(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (createPadding(length - strLength, chars) + string) - : string; - } - - /** - * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a - * hexadecimal, in which case a `radix` of `16` is used. - * - * **Note:** This method aligns with the - * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category String - * @param {string} string The string to convert. - * @param {number} [radix=10] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {number} Returns the converted integer. - * @example - * - * _.parseInt('08'); - * // => 8 - * - * _.map(['6', '08', '10'], _.parseInt); - * // => [6, 8, 10] - */ - function parseInt(string, radix, guard) { - if (guard || radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); - } - - /** - * Repeats the given string `n` times. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to repeat. - * @param {number} [n=1] The number of times to repeat the string. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {string} Returns the repeated string. - * @example - * - * _.repeat('*', 3); - * // => '***' - * - * _.repeat('abc', 2); - * // => 'abcabc' - * - * _.repeat('abc', 0); - * // => '' - */ - function repeat(string, n, guard) { - if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - return baseRepeat(toString(string), n); - } - - /** - * Replaces matches for `pattern` in `string` with `replacement`. - * - * **Note:** This method is based on - * [`String#replace`](https://mdn.io/String/replace). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to modify. - * @param {RegExp|string} pattern The pattern to replace. - * @param {Function|string} replacement The match replacement. - * @returns {string} Returns the modified string. - * @example - * - * _.replace('Hi Fred', 'Fred', 'Barney'); - * // => 'Hi Barney' - */ - function replace() { - var args = arguments, - string = toString(args[0]); - - return args.length < 3 ? string : string.replace(args[1], args[2]); - } - - /** - * Converts `string` to - * [snake case](https://en.wikipedia.org/wiki/Snake_case). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the snake cased string. - * @example - * - * _.snakeCase('Foo Bar'); - * // => 'foo_bar' - * - * _.snakeCase('fooBar'); - * // => 'foo_bar' - * - * _.snakeCase('--FOO-BAR--'); - * // => 'foo_bar' - */ - var snakeCase = createCompounder(function(result, word, index) { - return result + (index ? '_' : '') + word.toLowerCase(); - }); - - /** - * Splits `string` by `separator`. - * - * **Note:** This method is based on - * [`String#split`](https://mdn.io/String/split). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to split. - * @param {RegExp|string} separator The separator pattern to split by. - * @param {number} [limit] The length to truncate results to. - * @returns {Array} Returns the string segments. - * @example - * - * _.split('a-b-c', '-', 2); - * // => ['a', 'b'] - */ - function split(string, separator, limit) { - if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { - separator = limit = undefined; - } - limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; - if (!limit) { - return []; - } - string = toString(string); - if (string && ( - typeof separator == 'string' || - (separator != null && !isRegExp(separator)) - )) { - separator = baseToString(separator); - if (!separator && hasUnicode(string)) { - return castSlice(stringToArray(string), 0, limit); - } - } - return string.split(separator, limit); - } - - /** - * Converts `string` to - * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). - * - * @static - * @memberOf _ - * @since 3.1.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the start cased string. - * @example - * - * _.startCase('--foo-bar--'); - * // => 'Foo Bar' - * - * _.startCase('fooBar'); - * // => 'Foo Bar' - * - * _.startCase('__FOO_BAR__'); - * // => 'FOO BAR' - */ - var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + upperFirst(word); - }); - - /** - * Checks if `string` starts with the given target string. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, - * else `false`. - * @example - * - * _.startsWith('abc', 'a'); - * // => true - * - * _.startsWith('abc', 'b'); - * // => false - * - * _.startsWith('abc', 'b', 1); - * // => true - */ - function startsWith(string, target, position) { - string = toString(string); - position = position == null - ? 0 - : baseClamp(toInteger(position), 0, string.length); - - target = baseToString(target); - return string.slice(position, position + target.length) == target; - } - - /** - * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML-escape interpolated data properties in - * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data - * properties may be accessed as free variables in the template. If a setting - * object is given, it takes precedence over `_.templateSettings` values. - * - * **Note:** In the development build `_.template` utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * for easier debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category String - * @param {string} [string=''] The template string. - * @param {Object} [options={}] The options object. - * @param {RegExp} [options.escape=_.templateSettings.escape] - * The HTML "escape" delimiter. - * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] - * The "evaluate" delimiter. - * @param {Object} [options.imports=_.templateSettings.imports] - * An object to import into the template as free variables. - * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] - * The "interpolate" delimiter. - * @param {string} [options.sourceURL='lodash.templateSources[n]'] - * The sourceURL of the compiled template. - * @param {string} [options.variable='obj'] - * The data object variable name. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the compiled template function. - * @example - * - * // Use the "interpolate" delimiter to create a compiled template. - * var compiled = _.template('hello <%= user %>!'); - * compiled({ 'user': 'fred' }); - * // => 'hello fred!' - * - * // Use the HTML "escape" delimiter to escape data property values. - * var compiled = _.template('<%- value %>'); - * compiled({ 'value': '