diff --git a/.github/workflows/caching-example.yml b/.github/workflows/caching-example.yml index e22e5d5b..8df889a5 100644 --- a/.github/workflows/caching-example.yml +++ b/.github/workflows/caching-example.yml @@ -14,7 +14,9 @@ on: jobs: caching-example: # prevent cronjobs from running on forks - if: (github.event_name == 'schedule' && github.repository == 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') + if: + (github.event_name == 'schedule' && github.repository == + 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') name: Caching runs-on: "ubuntu-latest" steps: diff --git a/.github/workflows/example-1.yml b/.github/workflows/example-1.yml index d950f405..0de933a7 100644 --- a/.github/workflows/example-1.yml +++ b/.github/workflows/example-1.yml @@ -14,7 +14,9 @@ on: jobs: example-1: # prevent cronjobs from running on forks - if: (github.event_name == 'schedule' && github.repository == 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') + if: + (github.event_name == 'schedule' && github.repository == + 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: diff --git a/.github/workflows/example-2.yml b/.github/workflows/example-2.yml index 9bb9d96c..659107c6 100644 --- a/.github/workflows/example-2.yml +++ b/.github/workflows/example-2.yml @@ -14,7 +14,9 @@ on: jobs: example-2-linux: # prevent cronjobs from running on forks - if: (github.event_name == 'schedule' && github.repository == 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') + if: + (github.event_name == 'schedule' && github.repository == + 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') name: Ex2 Linux runs-on: "ubuntu-latest" steps: diff --git a/.github/workflows/example-3.yml b/.github/workflows/example-3.yml index 5f3a804d..a73f7fe1 100644 --- a/.github/workflows/example-3.yml +++ b/.github/workflows/example-3.yml @@ -14,7 +14,9 @@ on: jobs: example-3: # prevent cronjobs from running on forks - if: (github.event_name == 'schedule' && github.repository == 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') + if: + (github.event_name == 'schedule' && github.repository == + 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') name: Ex3 Linux runs-on: "ubuntu-latest" defaults: diff --git a/.github/workflows/example-4.yml b/.github/workflows/example-4.yml index 350b1778..10507e8e 100644 --- a/.github/workflows/example-4.yml +++ b/.github/workflows/example-4.yml @@ -14,7 +14,9 @@ on: jobs: example-4: # prevent cronjobs from running on forks - if: (github.event_name == 'schedule' && github.repository == 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') + if: + (github.event_name == 'schedule' && github.repository == + 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') name: Ex4 Linux runs-on: "ubuntu-latest" defaults: diff --git a/.github/workflows/example-5.yml b/.github/workflows/example-5.yml index 0b04cebc..b5ccd5de 100644 --- a/.github/workflows/example-5.yml +++ b/.github/workflows/example-5.yml @@ -14,7 +14,9 @@ on: jobs: example-5-linux: # prevent cronjobs from running on forks - if: (github.event_name == 'schedule' && github.repository == 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') + if: + (github.event_name == 'schedule' && github.repository == + 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') name: Ex5 PyPy Linux Local runs-on: "ubuntu-latest" env: diff --git a/.github/workflows/example-6.yml b/.github/workflows/example-6.yml index 4325ad7c..bea7b048 100644 --- a/.github/workflows/example-6.yml +++ b/.github/workflows/example-6.yml @@ -14,7 +14,9 @@ on: jobs: example-6: # prevent cronjobs from running on forks - if: (github.event_name == 'schedule' && github.repository == 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') + if: + (github.event_name == 'schedule' && github.repository == + 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') name: Ex6 (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: diff --git a/.github/workflows/example-7.yml b/.github/workflows/example-7.yml index b5fd54c7..282a94f9 100644 --- a/.github/workflows/example-7.yml +++ b/.github/workflows/example-7.yml @@ -14,7 +14,9 @@ on: jobs: example-7: # prevent cronjobs from running on forks - if: (github.event_name == 'schedule' && github.repository == 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') + if: + (github.event_name == 'schedule' && github.repository == + 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') name: Ex7 Explicit runs-on: ${{ matrix.os }} defaults: diff --git a/.github/workflows/example-8.yml b/.github/workflows/example-8.yml index 65b8e2c7..35462dc0 100644 --- a/.github/workflows/example-8.yml +++ b/.github/workflows/example-8.yml @@ -14,7 +14,9 @@ on: jobs: example-8: # prevent cronjobs from running on forks - if: (github.event_name == 'schedule' && github.repository == 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') + if: + (github.event_name == 'schedule' && github.repository == + 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') name: Ex8 (${{ matrix.python-version }}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 60b04e08..0f3eee9d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,9 @@ on: jobs: lint: # prevent cronjobs from running on forks - if: (github.event_name == 'schedule' && github.repository == 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') + if: + (github.event_name == 'schedule' && github.repository == + 'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') name: Lint runs-on: "ubuntu-latest" defaults: diff --git a/dist/delete/index.js b/dist/delete/index.js index 2a63678b..c792eb59 100644 --- a/dist/delete/index.js +++ b/dist/delete/index.js @@ -344,6 +344,712 @@ function copyFile(srcFile, destFile, force) { } //# sourceMappingURL=io.js.map +/***/ }), + +/***/ 9: +/***/ (function(__unusedmodule, exports, __webpack_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 __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const os = __importStar(__webpack_require__(87)); +const events = __importStar(__webpack_require__(614)); +const child = __importStar(__webpack_require__(129)); +const path = __importStar(__webpack_require__(622)); +const io = __importStar(__webpack_require__(1)); +const ioUtil = __importStar(__webpack_require__(672)); +/* eslint-disable @typescript-eslint/unbound-method */ +const IS_WINDOWS = process.platform === 'win32'; +/* + * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. + */ +class ToolRunner extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); + } + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; + } + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } + } + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool + if (IS_WINDOWS) { + // Windows + cmd file + if (this._isCmdFile()) { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows + verbatim + else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows (regular) + else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } + } + } + else { + // OSX/Linux - this can likely be improved with some form of quoting. + // creating processes on Unix is fundamentally different than Windows. + // on Unix, execvp() takes an arg array. + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + return cmd; + } + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + // the rest of the string ... + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); + } + strBuffer = s; + } + catch (err) { + // streaming lines to console is best effort. Don't fail a build. + this._debug(`error processing line. Failed with error ${err}`); + } + } + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env['COMSPEC'] || 'cmd.exe'; + } + } + return this.toolPath; + } + _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += ' '; + argline += options.windowsVerbatimArguments + ? a + : this._windowsQuoteCmdArg(a); + } + argline += '"'; + return [argline]; + } + } + return this.args; + } + _endsWith(str, end) { + return str.endsWith(end); + } + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return (this._endsWith(upperToolPath, '.CMD') || + this._endsWith(upperToolPath, '.BAT')); + } + _windowsQuoteCmdArg(arg) { + // for .exe, apply the normal quoting rules that libuv applies + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); + } + // otherwise apply quoting rules specific to the cmd.exe command line parser. + // the libuv rules are generic and are not designed specifically for cmd.exe + // command line parser. + // + // for a detailed description of the cmd.exe command line parser, refer to + // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 + // need quotes for empty arg + if (!arg) { + return '""'; + } + // determine whether the arg needs to be quoted + const cmdSpecialChars = [ + ' ', + '\t', + '&', + '(', + ')', + '[', + ']', + '{', + '}', + '^', + '=', + ';', + '!', + "'", + '+', + ',', + '`', + '~', + '|', + '<', + '>', + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some(x => x === char)) { + needsQuotes = true; + break; + } + } + // short-circuit if quotes not needed + if (!needsQuotes) { + return arg; + } + // the following quoting rules are very similar to the rules that by libuv applies. + // + // 1) wrap the string in quotes + // + // 2) double-up quotes - i.e. " => "" + // + // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately + // doesn't work well with a cmd.exe command line. + // + // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. + // for example, the command line: + // foo.exe "myarg:""my val""" + // is parsed by a .NET console app into an arg array: + // [ "myarg:\"my val\"" ] + // which is the same end result when applying libuv quoting rules. although the actual + // command line from libuv quoting rules would look like: + // foo.exe "myarg:\"my val\"" + // + // 3) double-up slashes that precede a quote, + // e.g. hello \world => "hello \world" + // hello\"world => "hello\\""world" + // hello\\"world => "hello\\\\""world" + // hello world\ => "hello world\\" + // + // technically this is not required for a cmd.exe command line, or the batch argument parser. + // the reasons for including this as a .cmd quoting rule are: + // + // a) this is optimized for the scenario where the argument is passed from the .cmd file to an + // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. + // + // b) it's what we've been doing previously (by deferring to node default behavior) and we + // haven't heard any complaints about that aspect. + // + // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be + // escaped when used on the command line directly - even though within a .cmd file % can be escaped + // by using %%. + // + // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts + // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. + // + // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would + // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the + // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args + // to an external program. + // + // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. + // % can be escaped within a .cmd file. + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; // double the slash + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; // double the quote + } + else { + quoteHit = false; + } + } + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _uvQuoteCmdArg(arg) { + // Tool runner wraps child_process.spawn() and needs to apply the same quoting as + // Node in certain cases where the undocumented spawn option windowsVerbatimArguments + // is used. + // + // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, + // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), + // pasting copyright notice from Node within this function: + // + // Copyright Joyent, Inc. and other Node contributors. All rights reserved. + // + // 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. + if (!arg) { + // Need double quotation for empty argument + return '""'; + } + if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { + // No quotation needed + return arg; + } + if (!arg.includes('"') && !arg.includes('\\')) { + // No embedded double quotes or backslashes, so I can just wrap + // quote marks around the whole thing. + return `"${arg}"`; + } + // Expected input/output: + // input : hello"world + // output: "hello\"world" + // input : hello""world + // output: "hello\"\"world" + // input : hello\world + // output: hello\world + // input : hello\\world + // output: hello\\world + // input : hello\"world + // output: "hello\\\"world" + // input : hello\\"world + // output: "hello\\\\\"world" + // input : hello world\ + // output: "hello world\\" - note the comment in libuv actually reads "hello world\" + // but it appears the comment is wrong, it should be "hello world\\" + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '\\'; + } + else { + quoteHit = false; + } + } + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _cloneExecOptions(options) { + options = options || {}; + const result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 10000 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + } + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result['windowsVerbatimArguments'] = + options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) { + result.argv0 = `"${toolPath}"`; + } + return result; + } + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number + */ + exec() { + return __awaiter(this, void 0, void 0, function* () { + // root the tool path if it is unrooted and contains relative pathing + if (!ioUtil.isRooted(this.toolPath) && + (this.toolPath.includes('/') || + (IS_WINDOWS && this.toolPath.includes('\\')))) { + // prefer options.cwd if it is specified, however options.cwd may also need to be rooted + this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + // if the tool is only a file name, then resolve it from the PATH + // otherwise verify it exists (add extension on Windows if necessary) + this.toolPath = yield io.which(this.toolPath, true); + return new Promise((resolve, reject) => { + this._debug(`exec tool: ${this.toolPath}`); + this._debug('arguments:'); + for (const arg of this.args) { + this._debug(` ${arg}`); + } + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + } + const state = new ExecState(optionsNonNull, this.toolPath); + state.on('debug', (message) => { + this._debug(message); + }); + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + const stdbuffer = ''; + if (cp.stdout) { + cp.stdout.on('data', (data) => { + if (this.options.listeners && this.options.listeners.stdout) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + const errbuffer = ''; + if (cp.stderr) { + cp.stderr.on('data', (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) { + this.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && + optionsNonNull.errStream && + optionsNonNull.outStream) { + const s = optionsNonNull.failOnStdErr + ? optionsNonNull.errStream + : optionsNonNull.outStream; + s.write(data); + } + this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) { + this.options.listeners.errline(line); + } + }); + }); + } + cp.on('error', (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on('exit', (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on('close', (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on('done', (error, exitCode) => { + if (stdbuffer.length > 0) { + this.emit('stdline', stdbuffer); + } + if (errbuffer.length > 0) { + this.emit('errline', errbuffer); + } + cp.removeAllListeners(); + if (error) { + reject(error); + } + else { + resolve(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error('child process missing stdin'); + } + cp.stdin.end(this.options.input); + } + }); + }); + } +} +exports.ToolRunner = ToolRunner; +/** + * Convert an arg string to an array of args. Handles escaping + * + * @param argString string of arguments + * @returns string[] array of arguments + */ +function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ''; + function append(c) { + // we only escape double quotes. + if (escaped && c !== '"') { + arg += '\\'; + } + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } + else { + append(c); + } + continue; + } + if (c === '\\' && escaped) { + append(c); + continue; + } + if (c === '\\' && inQuotes) { + escaped = true; + continue; + } + if (c === ' ' && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ''; + } + continue; + } + append(c); + } + if (arg.length > 0) { + args.push(arg.trim()); + } + return args; +} +exports.argStringToArray = argStringToArray; +class ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; // tracks whether the process has exited and stdio is closed + this.processError = ''; + this.processExitCode = 0; + this.processExited = false; // tracks whether the process has exited + this.processStderr = false; // tracks whether stderr was written to + this.delay = 10000; // 10 seconds + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error('toolPath must not be empty'); + } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; + } + } + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } + else if (this.processExited) { + this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this); + } + } + _debug(message) { + this.emit('debug', message); + } + _setResult() { + // determine whether there is an error + let error; + if (this.processExited) { + if (this.processError) { + error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + } + else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + } + else if (this.processStderr && this.options.failOnStdErr) { + error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + } + } + // clear the timeout + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit('done', error, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / + 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); + } +} +//# sourceMappingURL=toolrunner.js.map + +/***/ }), + +/***/ 58: +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PYTHON_SPEC = exports.PROFILES = exports.WIN_PERMS_FOLDERS = exports.BASE_ENV_NAMES = exports.ENV_VAR_CONDA_PKGS = exports.CONDA_CACHE_FOLDER = exports.MINICONDA_BASE_URL = exports.IS_UNIX = exports.IS_LINUX = exports.IS_MAC = exports.IS_WINDOWS = exports.PLATFORM = exports.MINICONDA_DIR_PATH = exports.CONDARC_PATH = exports.BOOTSTRAP_CONDARC = exports.FORCED_ERRORS = exports.IGNORED_WARNINGS = exports.KNOWN_EXTENSIONS = exports.OS_NAMES = exports.ARCHITECTURES = void 0; +const path_1 = __webpack_require__(622); +const os_1 = __webpack_require__(87); +exports.ARCHITECTURES = { + x64: "x86_64", + x86: "x86", + ARM64: "aarch64", + ARM32: "armv7l", +}; +exports.OS_NAMES = { + win32: "Windows", + darwin: "MacOSX", + linux: "Linux", +}; +exports.KNOWN_EXTENSIONS = [".exe", ".sh"]; +/** + * errors that are always probably spurious + */ +exports.IGNORED_WARNINGS = [ + // appear on win install, we can swallow them + `menuinst_win32`, + `Unable to register environment`, + `0%|`, + // appear on certain Linux/OSX installers + `Please run using "bash"`, + // old condas don't know what to do with these + `Key 'use_only_tar_bz2' is not a known primitive parameter.`, +]; +/** + * warnings that should be errors + */ +exports.FORCED_ERRORS = [ + // conda env create will ignore invalid sections and move on + `EnvironmentSectionNotValid`, +]; +/** + * avoid spurious conda warnings before we have a chance to update them + */ +exports.BOOTSTRAP_CONDARC = "notify_outdated_conda: false"; +/** + * the conda config file + */ +exports.CONDARC_PATH = path_1.join(os_1.homedir(), ".condarc"); +exports.MINICONDA_DIR_PATH = process.env["CONDA"] || ""; +exports.PLATFORM = process.platform; +exports.IS_WINDOWS = exports.PLATFORM === "win32"; +exports.IS_MAC = exports.PLATFORM === "darwin"; +exports.IS_LINUX = exports.PLATFORM === "linux"; +exports.IS_UNIX = exports.IS_MAC || exports.IS_LINUX; +exports.MINICONDA_BASE_URL = "https://repo.anaconda.com/miniconda/"; +/** Where to put files. Should eventually be configurable */ +exports.CONDA_CACHE_FOLDER = "conda_pkgs_dir"; +/** the environment variable exported */ +exports.ENV_VAR_CONDA_PKGS = "CONDA_PKGS_DIR"; +exports.BASE_ENV_NAMES = ["root", "base", ""]; +/** folders that need user ownership on windows */ +exports.WIN_PERMS_FOLDERS = [ + "condabin/", + "Scripts/", + "shell/", + "etc/profile.d/", + "/Lib/site-packages/xonsh/", +]; +exports.PROFILES = [ + ".bashrc", + ".bash_profile", + ".config/fish/config.fish", + ".profile", + ".tcshrc", + ".xonshrc", + ".zshrc", + ".config/powershell/profile.ps1", + "Documents/PowerShell/profile.ps1", + "Documents/WindowsPowerShell/profile.ps1", +]; +/** + * A regular expression for detecting whether a spec is the python package, not + * all of which are valid in all settings. + * + * Some examples: + * - python + * - python 3 + * - python>3 + * - python!=2 + * - conda-forge::python + * + * @see https://docs.conda.io/projects/conda-build/en/latest/resources/package-spec.html#package-match-specifications + */ +exports.PYTHON_SPEC = /^(.*::)?python($|\s\=\<\>\!\|)/i; + + /***/ }), /***/ 82: @@ -420,46 +1126,6 @@ exports.issueCommand = issueCommand; module.exports = require("child_process"); -/***/ }), - -/***/ 163: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.cacheFolder = exports.ENV_VAR_CONDA_PKGS = void 0; -const os = __importStar(__webpack_require__(87)); -const path = __importStar(__webpack_require__(622)); -/** Where to put files. Should eventually be configurable */ -const CONDA_CACHE_FOLDER = "conda_pkgs_dir"; -/** the environment variable exported */ -exports.ENV_VAR_CONDA_PKGS = "CONDA_PKGS_DIR"; -function cacheFolder() { - return path.join(os.homedir(), CONDA_CACHE_FOLDER); -} -exports.cacheFolder = cacheFolder; - - /***/ }), /***/ 251: @@ -501,7 +1167,7 @@ const os = __importStar(__webpack_require__(87)); const path = __importStar(__webpack_require__(622)); const core = __importStar(__webpack_require__(470)); const io = __importStar(__webpack_require__(1)); -const utils = __importStar(__webpack_require__(163)); +const utils = __importStar(__webpack_require__(567)); function run() { return __awaiter(this, void 0, void 0, function* () { try { @@ -546,6 +1212,13 @@ module.exports = require("assert"); /***/ }), +/***/ 413: +/***/ (function(module) { + +module.exports = require("stream"); + +/***/ }), + /***/ 431: /***/ (function(__unusedmodule, exports, __webpack_require__) { @@ -877,6 +1550,118 @@ exports.getState = getState; /***/ }), +/***/ 567: +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.execute = exports.makeSpec = exports.cacheFolder = exports.isBaseEnv = void 0; +const os = __importStar(__webpack_require__(87)); +const path = __importStar(__webpack_require__(622)); +const constants = __importStar(__webpack_require__(58)); +const core = __importStar(__webpack_require__(470)); +const stream = __importStar(__webpack_require__(413)); +const exec = __importStar(__webpack_require__(986)); +function isBaseEnv(envName) { + return constants.BASE_ENV_NAMES.includes(envName); +} +exports.isBaseEnv = isBaseEnv; +/** + * Get the cache folder + * + * TODO: this should probably be configurable + */ +function cacheFolder() { + return path.join(os.homedir(), constants.CONDA_CACHE_FOLDER); +} +exports.cacheFolder = cacheFolder; +/** + * create a spec string. Generally favors '=' unless specified more tightly + */ +function makeSpec(pkg, spec) { + if (spec.match(/=<>!\|/)) { + return `${pkg}${spec}`; + } + else { + return `${pkg}=${spec}`; + } +} +exports.makeSpec = makeSpec; +/** + * Run exec.exec with error handling + */ +function execute(command) { + return __awaiter(this, void 0, void 0, function* () { + let options = { + errStream: new stream.Writable(), + listeners: { + stdout: (data) => { + const stringData = data.toString(); + for (const forced_error of constants.FORCED_ERRORS) { + if (stringData.includes(forced_error)) { + throw new Error(`"${command}" failed with "${forced_error}"`); + } + } + return data; + }, + stderr: (data) => { + const stringData = data.toString(); + for (const ignore of constants.IGNORED_WARNINGS) { + if (stringData.includes(ignore)) { + return; + } + } + core.warning(stringData); + }, + }, + }; + const rc = yield exec.exec(command[0], command.slice(1), options); + if (rc !== 0) { + throw Error(`${command[0]} exited with error code ${rc}`); + } + }); +} +exports.execute = execute; + + +/***/ }), + +/***/ 614: +/***/ (function(module) { + +module.exports = require("events"); + +/***/ }), + /***/ 622: /***/ (function(module) { @@ -1098,6 +1883,57 @@ function isUnixExecutable(stats) { module.exports = require("fs"); +/***/ }), + +/***/ 986: +/***/ (function(__unusedmodule, exports, __webpack_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 __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const tr = __importStar(__webpack_require__(9)); +/** + * Exec a command. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code + */ +function exec(commandLine, args, options) { + return __awaiter(this, void 0, void 0, function* () { + const commandArgs = tr.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + } + // Path to tool to execute should be first arg + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); +} +exports.exec = exec; +//# sourceMappingURL=exec.js.map + /***/ }) /******/ }); \ No newline at end of file diff --git a/dist/setup/index.js b/dist/setup/index.js index 39765b8d..7cc27cc3 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -1027,7 +1027,7 @@ class ExecState extends events.EventEmitter { /***/ (function(module, __unusedexports, __webpack_require__) { var baseGetTag = __webpack_require__(51), - isObject = __webpack_require__(323); + isObject = __webpack_require__(988); /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', @@ -1115,38 +1115,58 @@ module.exports = setCacheAdd; /***/ }), /* 21 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var baseGet = __webpack_require__(356), - baseSet = __webpack_require__(847), - castPath = __webpack_require__(929); - -/** - * 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); +/***/ (function(__unusedmodule, exports, __webpack_require__) { - if (predicate(value, path)) { - baseSet(result, castPath(path, object), value); - } - } - return result; -} +"use strict"; -module.exports = basePickBy; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ensureSimple = void 0; +const core = __importStar(__webpack_require__(470)); +const utils = __importStar(__webpack_require__(567)); +exports.ensureSimple = { + label: "create (simple)", + provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { + var _a, _b, _c; + core.info(JSON.stringify(options)); + return !(((_b = (_a = options.envSpec) === null || _a === void 0 ? void 0 : _a.explicit) === null || _b === void 0 ? void 0 : _b.length) || + Object.keys(((_c = options.envSpec) === null || _c === void 0 ? void 0 : _c.yaml) || {}).length); + }), + condaArgs: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { + const args = ["create", "--name", inputs.activateEnvironment]; + if (inputs.pythonVersion) { + args.push(utils.makeSpec("python", inputs.pythonVersion)); + } + return args; + }), +}; /***/ }), @@ -1195,13 +1215,27 @@ module.exports = new Schema({ __webpack_require__(809), __webpack_require__(228), __webpack_require__(44), - __webpack_require__(312) + __webpack_require__(675) ] }); /***/ }), -/* 24 */, +/* 24 */ +/***/ (function(module, __unusedexports, __webpack_require__) { + +"use strict"; + + +var Type = __webpack_require__(750); + +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); + + +/***/ }), /* 25 */, /* 26 */, /* 27 */, @@ -1230,7 +1264,7 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -const semver = __importStar(__webpack_require__(280)); +const semver = __importStar(__webpack_require__(779)); const core_1 = __webpack_require__(470); // needs to be require for core node modules to be mocked /* eslint @typescript-eslint/no-require-imports: 0 */ @@ -1528,9 +1562,9 @@ exports.update = function(arr, parent) { /*eslint-disable max-len*/ -var common = __webpack_require__(740); +var common = __webpack_require__(344); var YAMLException = __webpack_require__(556); -var Type = __webpack_require__(945); +var Type = __webpack_require__(750); function compileList(schema, name, result) { @@ -1641,8 +1675,8 @@ module.exports = Schema; "use strict"; -var common = __webpack_require__(740); -var Type = __webpack_require__(945); +var common = __webpack_require__(344); +var Type = __webpack_require__(750); function isHexCode(c) { return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || @@ -1826,7 +1860,7 @@ var _Object$setPrototypeO; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -var finished = __webpack_require__(287); +var finished = __webpack_require__(740); var kLastResolve = Symbol('lastResolve'); var kLastReject = Symbol('lastReject'); @@ -2031,7 +2065,98 @@ module.exports = createReadableStreamAsyncIterator; /***/ }), /* 47 */, /* 48 */, -/* 49 */, +/* 49 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.installBaseTools = void 0; +const core = __importStar(__webpack_require__(470)); +const conda = __importStar(__webpack_require__(259)); +const update_conda_1 = __webpack_require__(715); +const update_mamba_1 = __webpack_require__(269); +const update_python_1 = __webpack_require__(113); +const update_conda_build_1 = __webpack_require__(234); +/** + * The providers of tool updates: order isn't _really_ important + */ +const providers = [ + update_conda_1.updateConda, + update_mamba_1.updateMamba, + update_python_1.updatePython, + update_conda_build_1.updateCondaBuild, +]; +/** + * Update the 'base' env with relevant tools + * + * Do this in one step to avoid multiple solves + */ +function installBaseTools(inputs, options) { + return __awaiter(this, void 0, void 0, function* () { + let tools = []; + let postInstallOptions = Object.assign({}, options); + let postInstallActions = []; + for (const provider of providers) { + if (yield provider.provides(inputs, options)) { + core.info(provider.label); + const toolUpdates = yield provider.toolPackages(inputs, options); + tools.push(...toolUpdates.tools); + postInstallOptions = Object.assign(Object.assign({}, postInstallOptions), toolUpdates.options); + if (provider.postInstall) { + postInstallActions.push(provider.postInstall); + } + } + } + if (tools.length) { + yield conda.condaCommand(["install", "--name", "base", ...tools], + // use the original `options`, as we can't guarantee `mamba` is available + // TODO: allow declaring that the installer already has `mamba` + options); + // now use the new options, as we may have a new conda/mamba with more supported + // options that previously failed + yield conda.applyCondaConfiguration(inputs, postInstallOptions); + if (postInstallActions.length) { + for (const action of postInstallActions) { + yield action(inputs, postInstallOptions); + } + } + } + return postInstallOptions; + }); +} +exports.installBaseTools = installBaseTools; + + +/***/ }), /* 50 */, /* 51 */ /***/ (function(module, __unusedexports, __webpack_require__) { @@ -2353,7 +2478,104 @@ exports.CODE_POINT_SEQUENCES = { /***/ }), /* 57 */, -/* 58 */, +/* 58 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PYTHON_SPEC = exports.PROFILES = exports.WIN_PERMS_FOLDERS = exports.BASE_ENV_NAMES = exports.ENV_VAR_CONDA_PKGS = exports.CONDA_CACHE_FOLDER = exports.MINICONDA_BASE_URL = exports.IS_UNIX = exports.IS_LINUX = exports.IS_MAC = exports.IS_WINDOWS = exports.PLATFORM = exports.MINICONDA_DIR_PATH = exports.CONDARC_PATH = exports.BOOTSTRAP_CONDARC = exports.FORCED_ERRORS = exports.IGNORED_WARNINGS = exports.KNOWN_EXTENSIONS = exports.OS_NAMES = exports.ARCHITECTURES = void 0; +const path_1 = __webpack_require__(622); +const os_1 = __webpack_require__(87); +exports.ARCHITECTURES = { + x64: "x86_64", + x86: "x86", + ARM64: "aarch64", + ARM32: "armv7l", +}; +exports.OS_NAMES = { + win32: "Windows", + darwin: "MacOSX", + linux: "Linux", +}; +exports.KNOWN_EXTENSIONS = [".exe", ".sh"]; +/** + * errors that are always probably spurious + */ +exports.IGNORED_WARNINGS = [ + // appear on win install, we can swallow them + `menuinst_win32`, + `Unable to register environment`, + `0%|`, + // appear on certain Linux/OSX installers + `Please run using "bash"`, + // old condas don't know what to do with these + `Key 'use_only_tar_bz2' is not a known primitive parameter.`, +]; +/** + * warnings that should be errors + */ +exports.FORCED_ERRORS = [ + // conda env create will ignore invalid sections and move on + `EnvironmentSectionNotValid`, +]; +/** + * avoid spurious conda warnings before we have a chance to update them + */ +exports.BOOTSTRAP_CONDARC = "notify_outdated_conda: false"; +/** + * the conda config file + */ +exports.CONDARC_PATH = path_1.join(os_1.homedir(), ".condarc"); +exports.MINICONDA_DIR_PATH = process.env["CONDA"] || ""; +exports.PLATFORM = process.platform; +exports.IS_WINDOWS = exports.PLATFORM === "win32"; +exports.IS_MAC = exports.PLATFORM === "darwin"; +exports.IS_LINUX = exports.PLATFORM === "linux"; +exports.IS_UNIX = exports.IS_MAC || exports.IS_LINUX; +exports.MINICONDA_BASE_URL = "https://repo.anaconda.com/miniconda/"; +/** Where to put files. Should eventually be configurable */ +exports.CONDA_CACHE_FOLDER = "conda_pkgs_dir"; +/** the environment variable exported */ +exports.ENV_VAR_CONDA_PKGS = "CONDA_PKGS_DIR"; +exports.BASE_ENV_NAMES = ["root", "base", ""]; +/** folders that need user ownership on windows */ +exports.WIN_PERMS_FOLDERS = [ + "condabin/", + "Scripts/", + "shell/", + "etc/profile.d/", + "/Lib/site-packages/xonsh/", +]; +exports.PROFILES = [ + ".bashrc", + ".bash_profile", + ".config/fish/config.fish", + ".profile", + ".tcshrc", + ".xonshrc", + ".zshrc", + ".config/powershell/profile.ps1", + "Documents/PowerShell/profile.ps1", + "Documents/WindowsPowerShell/profile.ps1", +]; +/** + * A regular expression for detecting whether a spec is the python package, not + * all of which are valid in all settings. + * + * Some examples: + * - python + * - python 3 + * - python>3 + * - python!=2 + * - conda-forge::python + * + * @see https://docs.conda.io/projects/conda-build/en/latest/resources/package-spec.html#package-match-specifications + */ +exports.PYTHON_SPEC = /^(.*::)?python($|\s\=\<\>\!\|)/i; + + +/***/ }), /* 59 */, /* 60 */ /***/ (function(module, __unusedexports, __webpack_require__) { @@ -2370,7 +2592,7 @@ var Tokenizer = __webpack_require__(990), doctype = __webpack_require__(334), foreignContent = __webpack_require__(298), UNICODE = __webpack_require__(56), - HTML = __webpack_require__(621); + HTML = __webpack_require__(141); //Aliases var $ = HTML.TAG_NAMES, @@ -5218,7 +5440,7 @@ module.exports = initCloneObject; var doctype = __webpack_require__(334), - DOCUMENT_MODE = __webpack_require__(621).DOCUMENT_MODE; + DOCUMENT_MODE = __webpack_require__(141).DOCUMENT_MODE; //Conversion tables for DOM Level1 structure emulation @@ -5875,33 +6097,36 @@ module.exports = identity; /* 86 */ /***/ (function(module, __unusedexports, __webpack_require__) { -module.exports = ProxyHandler; +var baseGet = __webpack_require__(356), + baseSet = __webpack_require__(847), + castPath = __webpack_require__(929); -function ProxyHandler(cbs) { - this._cbs = cbs || {}; -} +/** + * 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 = {}; -var EVENTS = __webpack_require__(818).EVENTS; -Object.keys(EVENTS).forEach(function(name) { - if (EVENTS[name] === 0) { - name = "on" + name; - ProxyHandler.prototype[name] = function() { - if (this._cbs[name]) this._cbs[name](); - }; - } else if (EVENTS[name] === 1) { - name = "on" + name; - ProxyHandler.prototype[name] = function(a) { - if (this._cbs[name]) this._cbs[name](a); - }; - } else if (EVENTS[name] === 2) { - name = "on" + name; - ProxyHandler.prototype[name] = function(a, b) { - if (this._cbs[name]) this._cbs[name](a, b); - }; - } else { - throw Error("wrong number of arguments"); + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); } -}); + } + return result; +} + +module.exports = basePickBy; /***/ }), @@ -6012,7 +6237,7 @@ module.exports = equalArrays; -var common = __webpack_require__(740); +var common = __webpack_require__(344); function Mark(name, buffer, position, line, column) { @@ -6113,56 +6338,14 @@ exports.flatten = function(options) { /***/ }), /* 98 */, -/* 99 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var Symbol = __webpack_require__(498), - arrayMap = __webpack_require__(727), - isArray = __webpack_require__(143), - isSymbol = __webpack_require__(186); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * 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; -} - -module.exports = baseToString; - - -/***/ }), +/* 99 */, /* 100 */ /***/ (function(module, __unusedexports, __webpack_require__) { "use strict"; -var Type = __webpack_require__(945); +var Type = __webpack_require__(750); var _hasOwnProperty = Object.prototype.hasOwnProperty; @@ -6236,7 +6419,7 @@ var DomUtils = module.exports; [ __webpack_require__(654), - __webpack_require__(845), + __webpack_require__(979), __webpack_require__(128), __webpack_require__(937), __webpack_require__(588), @@ -6282,7 +6465,57 @@ module.exports = assignMergeValue; /***/ }), /* 111 */, /* 112 */, -/* 113 */, +/* 113 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updatePython = void 0; +const utils = __importStar(__webpack_require__(567)); +exports.updatePython = { + label: "Update python", + provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { return !!(inputs.pythonVersion && utils.isBaseEnv(inputs.activateEnvironment)); }), + toolPackages: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { + let updates = { + tools: [], + options, + }; + updates.tools.push(utils.makeSpec("python", inputs.pythonVersion)); + return updates; + }), +}; + + +/***/ }), /* 114 */, /* 115 */, /* 116 */, @@ -6295,7 +6528,7 @@ module.exports = assignMergeValue; var ParserStream = __webpack_require__(396), inherits = __webpack_require__(669).inherits, - $ = __webpack_require__(621).TAG_NAMES; + $ = __webpack_require__(141).TAG_NAMES; var PlainTextConversionStream = module.exports = function (options) { ParserStream.call(this, options); @@ -6506,12 +6739,12 @@ module.exports = compile; module.exports.compileUnsafe = compileUnsafe; module.exports.compileToken = compileToken; -var parse = __webpack_require__(442), +var parse = __webpack_require__(950), DomUtils = __webpack_require__(104), isTag = DomUtils.isTag, Rules = __webpack_require__(123), sortRules = __webpack_require__(642), - BaseFuncs = __webpack_require__(142), + BaseFuncs = __webpack_require__(312), trueFunc = BaseFuncs.trueFunc, falseFunc = BaseFuncs.falseFunc, procedure = __webpack_require__(926); @@ -6700,7 +6933,7 @@ filters.matches = function(next, token, options, context){ var DomUtils = __webpack_require__(104), hasAttrib = DomUtils.hasAttrib, getAttributeValue = DomUtils.getAttributeValue, - falseFunc = __webpack_require__(142).falseFunc; + falseFunc = __webpack_require__(312).falseFunc; //https://github.com/slevithan/XRegExp/blob/master/src/xregexp.js#L469 var reChars = /[-[\]{}()*+?.,\\^$|#\s]/g; @@ -7208,289 +7441,285 @@ exports.isHtml = function(str) { /***/ }), /* 141 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { +/***/ (function(__unusedmodule, exports) { "use strict"; -var net = __webpack_require__(631); -var tls = __webpack_require__(16); -var http = __webpack_require__(605); -var https = __webpack_require__(211); -var events = __webpack_require__(614); -var assert = __webpack_require__(357); -var util = __webpack_require__(669); - - -exports.httpOverHttp = httpOverHttp; -exports.httpsOverHttp = httpsOverHttp; -exports.httpOverHttps = httpOverHttps; -exports.httpsOverHttps = httpsOverHttps; +var NS = exports.NAMESPACES = { + HTML: 'http://www.w3.org/1999/xhtml', + MATHML: 'http://www.w3.org/1998/Math/MathML', + SVG: 'http://www.w3.org/2000/svg', + XLINK: 'http://www.w3.org/1999/xlink', + XML: 'http://www.w3.org/XML/1998/namespace', + XMLNS: 'http://www.w3.org/2000/xmlns/' +}; +exports.ATTRS = { + TYPE: 'type', + ACTION: 'action', + ENCODING: 'encoding', + PROMPT: 'prompt', + NAME: 'name', + COLOR: 'color', + FACE: 'face', + SIZE: 'size' +}; -function httpOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - return agent; -} +exports.DOCUMENT_MODE = { + NO_QUIRKS: 'no-quirks', + QUIRKS: 'quirks', + LIMITED_QUIRKS: 'limited-quirks' +}; -function httpsOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; -} +var $ = exports.TAG_NAMES = { + A: 'a', + ADDRESS: 'address', + ANNOTATION_XML: 'annotation-xml', + APPLET: 'applet', + AREA: 'area', + ARTICLE: 'article', + ASIDE: 'aside', -function httpOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - return agent; -} + B: 'b', + BASE: 'base', + BASEFONT: 'basefont', + BGSOUND: 'bgsound', + BIG: 'big', + BLOCKQUOTE: 'blockquote', + BODY: 'body', + BR: 'br', + BUTTON: 'button', -function httpsOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; -} + CAPTION: 'caption', + CENTER: 'center', + CODE: 'code', + COL: 'col', + COLGROUP: 'colgroup', + DD: 'dd', + DESC: 'desc', + DETAILS: 'details', + DIALOG: 'dialog', + DIR: 'dir', + DIV: 'div', + DL: 'dl', + DT: 'dt', -function TunnelingAgent(options) { - var self = this; - self.options = options || {}; - self.proxyOptions = self.options.proxy || {}; - self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; - self.requests = []; - self.sockets = []; + EM: 'em', + EMBED: 'embed', - self.on('free', function onFree(socket, host, port, localAddress) { - var options = toOptions(host, port, localAddress); - for (var i = 0, len = self.requests.length; i < len; ++i) { - var pending = self.requests[i]; - if (pending.host === options.host && pending.port === options.port) { - // Detect the request to connect same origin server, - // reuse the connection. - self.requests.splice(i, 1); - pending.request.onSocket(socket); - return; - } - } - socket.destroy(); - self.removeSocket(socket); - }); -} -util.inherits(TunnelingAgent, events.EventEmitter); + FIELDSET: 'fieldset', + FIGCAPTION: 'figcaption', + FIGURE: 'figure', + FONT: 'font', + FOOTER: 'footer', + FOREIGN_OBJECT: 'foreignObject', + FORM: 'form', + FRAME: 'frame', + FRAMESET: 'frameset', -TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { - var self = this; - var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); + H1: 'h1', + H2: 'h2', + H3: 'h3', + H4: 'h4', + H5: 'h5', + H6: 'h6', + HEAD: 'head', + HEADER: 'header', + HGROUP: 'hgroup', + HR: 'hr', + HTML: 'html', - if (self.sockets.length >= this.maxSockets) { - // We are over limit so we'll add it to the queue. - self.requests.push(options); - return; - } + I: 'i', + IMG: 'img', + IMAGE: 'image', + INPUT: 'input', + IFRAME: 'iframe', - // If we are under maxSockets create a new one. - self.createSocket(options, function(socket) { - socket.on('free', onFree); - socket.on('close', onCloseOrRemove); - socket.on('agentRemove', onCloseOrRemove); - req.onSocket(socket); + KEYGEN: 'keygen', - function onFree() { - self.emit('free', socket, options); - } + LABEL: 'label', + LI: 'li', + LINK: 'link', + LISTING: 'listing', - function onCloseOrRemove(err) { - self.removeSocket(socket); - socket.removeListener('free', onFree); - socket.removeListener('close', onCloseOrRemove); - socket.removeListener('agentRemove', onCloseOrRemove); - } - }); -}; + MAIN: 'main', + MALIGNMARK: 'malignmark', + MARQUEE: 'marquee', + MATH: 'math', + MENU: 'menu', + MENUITEM: 'menuitem', + META: 'meta', + MGLYPH: 'mglyph', + MI: 'mi', + MO: 'mo', + MN: 'mn', + MS: 'ms', + MTEXT: 'mtext', -TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { - var self = this; - var placeholder = {}; - self.sockets.push(placeholder); + NAV: 'nav', + NOBR: 'nobr', + NOFRAMES: 'noframes', + NOEMBED: 'noembed', + NOSCRIPT: 'noscript', - var connectOptions = mergeOptions({}, self.proxyOptions, { - method: 'CONNECT', - path: options.host + ':' + options.port, - agent: false, - headers: { - host: options.host + ':' + options.port - } - }); - if (options.localAddress) { - connectOptions.localAddress = options.localAddress; - } - if (connectOptions.proxyAuth) { - connectOptions.headers = connectOptions.headers || {}; - connectOptions.headers['Proxy-Authorization'] = 'Basic ' + - new Buffer(connectOptions.proxyAuth).toString('base64'); - } + OBJECT: 'object', + OL: 'ol', + OPTGROUP: 'optgroup', + OPTION: 'option', - debug('making CONNECT request'); - var connectReq = self.request(connectOptions); - connectReq.useChunkedEncodingByDefault = false; // for v0.6 - connectReq.once('response', onResponse); // for v0.6 - connectReq.once('upgrade', onUpgrade); // for v0.6 - connectReq.once('connect', onConnect); // for v0.7 or later - connectReq.once('error', onError); - connectReq.end(); + P: 'p', + PARAM: 'param', + PLAINTEXT: 'plaintext', + PRE: 'pre', - function onResponse(res) { - // Very hacky. This is necessary to avoid http-parser leaks. - res.upgrade = true; - } + RB: 'rb', + RP: 'rp', + RT: 'rt', + RTC: 'rtc', + RUBY: 'ruby', - function onUpgrade(res, socket, head) { - // Hacky. - process.nextTick(function() { - onConnect(res, socket, head); - }); - } + S: 's', + SCRIPT: 'script', + SECTION: 'section', + SELECT: 'select', + SOURCE: 'source', + SMALL: 'small', + SPAN: 'span', + STRIKE: 'strike', + STRONG: 'strong', + STYLE: 'style', + SUB: 'sub', + SUMMARY: 'summary', + SUP: 'sup', - function onConnect(res, socket, head) { - connectReq.removeAllListeners(); - socket.removeAllListeners(); + TABLE: 'table', + TBODY: 'tbody', + TEMPLATE: 'template', + TEXTAREA: 'textarea', + TFOOT: 'tfoot', + TD: 'td', + TH: 'th', + THEAD: 'thead', + TITLE: 'title', + TR: 'tr', + TRACK: 'track', + TT: 'tt', - if (res.statusCode !== 200) { - debug('tunneling socket could not be established, statusCode=%d', - res.statusCode); - socket.destroy(); - var error = new Error('tunneling socket could not be established, ' + - 'statusCode=' + res.statusCode); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - return; - } - if (head.length > 0) { - debug('got illegal response body from proxy'); - socket.destroy(); - var error = new Error('got illegal response body from proxy'); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - return; - } - debug('tunneling connection has established'); - self.sockets[self.sockets.indexOf(placeholder)] = socket; - return cb(socket); - } + U: 'u', + UL: 'ul', - function onError(cause) { - connectReq.removeAllListeners(); + SVG: 'svg', - debug('tunneling socket could not be established, cause=%s\n', - cause.message, cause.stack); - var error = new Error('tunneling socket could not be established, ' + - 'cause=' + cause.message); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - } -}; + VAR: 'var', -TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { - var pos = this.sockets.indexOf(socket) - if (pos === -1) { - return; - } - this.sockets.splice(pos, 1); + WBR: 'wbr', - var pending = this.requests.shift(); - if (pending) { - // If we have pending requests and a socket gets closed a new one - // needs to be created to take over in the pool for the one that closed. - this.createSocket(pending, function(socket) { - pending.request.onSocket(socket); - }); - } + XMP: 'xmp' }; -function createSecureSocket(options, cb) { - var self = this; - TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { - var hostHeader = options.request.getHeader('host'); - var tlsOptions = mergeOptions({}, self.options, { - socket: socket, - servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host - }); - - // 0 is dummy port for v0.6 - var secureSocket = tls.connect(0, tlsOptions); - self.sockets[self.sockets.indexOf(socket)] = secureSocket; - cb(secureSocket); - }); -} - - -function toOptions(host, port, localAddress) { - if (typeof host === 'string') { // since v0.10 - return { - host: host, - port: port, - localAddress: localAddress - }; - } - return host; // for v0.11 or later -} +var SPECIAL_ELEMENTS = exports.SPECIAL_ELEMENTS = Object.create(null); -function mergeOptions(target) { - for (var i = 1, len = arguments.length; i < len; ++i) { - var overrides = arguments[i]; - if (typeof overrides === 'object') { - var keys = Object.keys(overrides); - for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { - var k = keys[j]; - if (overrides[k] !== undefined) { - target[k] = overrides[k]; - } - } - } - } - return target; -} +SPECIAL_ELEMENTS[NS.HTML] = Object.create(null); +SPECIAL_ELEMENTS[NS.HTML][$.ADDRESS] = true; +SPECIAL_ELEMENTS[NS.HTML][$.APPLET] = true; +SPECIAL_ELEMENTS[NS.HTML][$.AREA] = true; +SPECIAL_ELEMENTS[NS.HTML][$.ARTICLE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.ASIDE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BASE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BASEFONT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BGSOUND] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BLOCKQUOTE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BODY] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BR] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BUTTON] = true; +SPECIAL_ELEMENTS[NS.HTML][$.CAPTION] = true; +SPECIAL_ELEMENTS[NS.HTML][$.CENTER] = true; +SPECIAL_ELEMENTS[NS.HTML][$.COL] = true; +SPECIAL_ELEMENTS[NS.HTML][$.COLGROUP] = true; +SPECIAL_ELEMENTS[NS.HTML][$.DD] = true; +SPECIAL_ELEMENTS[NS.HTML][$.DETAILS] = true; +SPECIAL_ELEMENTS[NS.HTML][$.DIR] = true; +SPECIAL_ELEMENTS[NS.HTML][$.DIV] = true; +SPECIAL_ELEMENTS[NS.HTML][$.DL] = true; +SPECIAL_ELEMENTS[NS.HTML][$.DT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.EMBED] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FIELDSET] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FIGCAPTION] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FIGURE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FOOTER] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FORM] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FRAME] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FRAMESET] = true; +SPECIAL_ELEMENTS[NS.HTML][$.H1] = true; +SPECIAL_ELEMENTS[NS.HTML][$.H2] = true; +SPECIAL_ELEMENTS[NS.HTML][$.H3] = true; +SPECIAL_ELEMENTS[NS.HTML][$.H4] = true; +SPECIAL_ELEMENTS[NS.HTML][$.H5] = true; +SPECIAL_ELEMENTS[NS.HTML][$.H6] = true; +SPECIAL_ELEMENTS[NS.HTML][$.HEAD] = true; +SPECIAL_ELEMENTS[NS.HTML][$.HEADER] = true; +SPECIAL_ELEMENTS[NS.HTML][$.HGROUP] = true; +SPECIAL_ELEMENTS[NS.HTML][$.HR] = true; +SPECIAL_ELEMENTS[NS.HTML][$.HTML] = true; +SPECIAL_ELEMENTS[NS.HTML][$.IFRAME] = true; +SPECIAL_ELEMENTS[NS.HTML][$.IMG] = true; +SPECIAL_ELEMENTS[NS.HTML][$.INPUT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.LI] = true; +SPECIAL_ELEMENTS[NS.HTML][$.LINK] = true; +SPECIAL_ELEMENTS[NS.HTML][$.LISTING] = true; +SPECIAL_ELEMENTS[NS.HTML][$.MAIN] = true; +SPECIAL_ELEMENTS[NS.HTML][$.MARQUEE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.MENU] = true; +SPECIAL_ELEMENTS[NS.HTML][$.META] = true; +SPECIAL_ELEMENTS[NS.HTML][$.NAV] = true; +SPECIAL_ELEMENTS[NS.HTML][$.NOEMBED] = true; +SPECIAL_ELEMENTS[NS.HTML][$.NOFRAMES] = true; +SPECIAL_ELEMENTS[NS.HTML][$.NOSCRIPT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.OBJECT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.OL] = true; +SPECIAL_ELEMENTS[NS.HTML][$.P] = true; +SPECIAL_ELEMENTS[NS.HTML][$.PARAM] = true; +SPECIAL_ELEMENTS[NS.HTML][$.PLAINTEXT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.PRE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.SCRIPT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.SECTION] = true; +SPECIAL_ELEMENTS[NS.HTML][$.SELECT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.SOURCE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.STYLE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.SUMMARY] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TABLE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TBODY] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TD] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TEMPLATE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TEXTAREA] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TFOOT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TH] = true; +SPECIAL_ELEMENTS[NS.HTML][$.THEAD] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TITLE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TR] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TRACK] = true; +SPECIAL_ELEMENTS[NS.HTML][$.UL] = true; +SPECIAL_ELEMENTS[NS.HTML][$.WBR] = true; +SPECIAL_ELEMENTS[NS.HTML][$.XMP] = true; +SPECIAL_ELEMENTS[NS.MATHML] = Object.create(null); +SPECIAL_ELEMENTS[NS.MATHML][$.MI] = true; +SPECIAL_ELEMENTS[NS.MATHML][$.MO] = true; +SPECIAL_ELEMENTS[NS.MATHML][$.MN] = true; +SPECIAL_ELEMENTS[NS.MATHML][$.MS] = true; +SPECIAL_ELEMENTS[NS.MATHML][$.MTEXT] = true; +SPECIAL_ELEMENTS[NS.MATHML][$.ANNOTATION_XML] = true; -var debug; -if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug = function() { - var args = Array.prototype.slice.call(arguments); - if (typeof args[0] === 'string') { - args[0] = 'TUNNEL: ' + args[0]; - } else { - args.unshift('TUNNEL:'); - } - console.error.apply(console, args); - } -} else { - debug = function() {}; -} -exports.debug = debug; // for test +SPECIAL_ELEMENTS[NS.SVG] = Object.create(null); +SPECIAL_ELEMENTS[NS.SVG][$.TITLE] = true; +SPECIAL_ELEMENTS[NS.SVG][$.FOREIGN_OBJECT] = true; +SPECIAL_ELEMENTS[NS.SVG][$.DESC] = true; /***/ }), -/* 142 */ -/***/ (function(module) { - -module.exports = { - trueFunc: function trueFunc(){ - return true; - }, - falseFunc: function falseFunc(){ - return false; - } -}; - -/***/ }), +/* 142 */, /* 143 */ /***/ (function(module) { @@ -7529,7 +7758,7 @@ module.exports = isArray; /***/ (function(module, __unusedexports, __webpack_require__) { var isFunction = __webpack_require__(10), - isLength = __webpack_require__(198); + isLength = __webpack_require__(611); /** * Checks if `value` is array-like. A value is considered array-like if it's @@ -7683,63 +7912,7 @@ SafeBuffer.allocUnsafeSlow = function (size) { /***/ }), /* 150 */, /* 151 */, -/* 152 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var arrayReduce = __webpack_require__(445), - baseEach = __webpack_require__(804), - baseIteratee = __webpack_require__(295), - baseReduce = __webpack_require__(942), - isArray = __webpack_require__(143); - -/** - * 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, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach); -} - -module.exports = reduce; - - -/***/ }), +/* 152 */, /* 153 */, /* 154 */ /***/ (function(module, __unusedexports, __webpack_require__) { @@ -7839,45 +8012,7 @@ module.exports = Uint8Array; /***/ }), /* 162 */, -/* 163 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.cacheFolder = exports.ENV_VAR_CONDA_PKGS = void 0; -const os = __importStar(__webpack_require__(87)); -const path = __importStar(__webpack_require__(622)); -/** Where to put files. Should eventually be configurable */ -const CONDA_CACHE_FOLDER = "conda_pkgs_dir"; -/** the environment variable exported */ -exports.ENV_VAR_CONDA_PKGS = "CONDA_PKGS_DIR"; -function cacheFolder() { - return path.join(os.homedir(), CONDA_CACHE_FOLDER); -} -exports.cacheFolder = cacheFolder; - - -/***/ }), +/* 163 */, /* 164 */, /* 165 */, /* 166 */, @@ -8350,22 +8485,7 @@ module.exports = Parser; /***/ }), /* 179 */, -/* 180 */ -/***/ (function(module) { - -/** - * The function whose prototype chain sequence wrappers inherit from. - * - * @private - */ -function baseLodash() { - // No operation performed. -} - -module.exports = baseLodash; - - -/***/ }), +/* 180 */, /* 181 */, /* 182 */, /* 183 */, @@ -8458,7 +8578,7 @@ var select = __webpack_require__(720), forEach: __webpack_require__(774), reject: __webpack_require__(434), filter: __webpack_require__(391), - reduce: __webpack_require__(152) + reduce: __webpack_require__(211) }; exports.find = function(selectorOrHaystack) { @@ -8884,47 +9004,7 @@ exports.addBack = function(selector) { /* 195 */, /* 196 */, /* 197 */, -/* 198 */ -/***/ (function(module) { - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * 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; -} - -module.exports = isLength; - - -/***/ }), +/* 198 */, /* 199 */, /* 200 */, /* 201 */, @@ -8970,7 +9050,7 @@ module.exports = getFuncName; /***/ (function(module, __unusedexports, __webpack_require__) { var baseCreate = __webpack_require__(782), - baseLodash = __webpack_require__(180); + baseLodash = __webpack_require__(681); /** * The base constructor for creating `lodash` wrapper objects. @@ -9036,9 +9116,60 @@ module.exports = DataView; /***/ }), /* 211 */ -/***/ (function(module) { +/***/ (function(module, __unusedexports, __webpack_require__) { + +var arrayReduce = __webpack_require__(445), + baseEach = __webpack_require__(804), + baseIteratee = __webpack_require__(295), + baseReduce = __webpack_require__(942), + isArray = __webpack_require__(143); + +/** + * 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, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach); +} + +module.exports = reduce; -module.exports = require("https"); /***/ }), /* 212 */, @@ -10556,7 +10687,7 @@ function indexOf(xs, x) { "use strict"; -var Type = __webpack_require__(945); +var Type = __webpack_require__(750); function resolveYamlBoolean(data) { if (data === null) return false; @@ -10821,7 +10952,55 @@ module.exports = { /***/ }), /* 233 */, -/* 234 */, +/* 234 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateCondaBuild = void 0; +const utils = __importStar(__webpack_require__(567)); +exports.updateCondaBuild = { + label: "Update conda-build", + provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { return inputs.condaBuildVersion !== ""; }), + toolPackages: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { + return { + tools: [utils.makeSpec("conda-build", inputs.condaBuildVersion)], + options, + }; + }), +}; + + +/***/ }), /* 235 */, /* 236 */, /* 237 */, @@ -10863,7 +11042,7 @@ function destroyer(stream, reading, writing, callback) { stream.on('close', function () { closed = true; }); - if (eos === undefined) eos = __webpack_require__(287); + if (eos === undefined) eos = __webpack_require__(740); eos(stream, { readable: reading, writable: writing @@ -11758,7 +11937,7 @@ exports.serializeArray = function() { "use strict"; -var HTML = __webpack_require__(621); +var HTML = __webpack_require__(141); //Aliases var $ = HTML.TAG_NAMES, @@ -12207,7 +12386,7 @@ function parse(formula){ var isFunction = __webpack_require__(10), isMasked = __webpack_require__(159), - isObject = __webpack_require__(323), + isObject = __webpack_require__(988), toSource = __webpack_require__(473); /** @@ -12475,7 +12654,7 @@ module.exports = baseIsMatch; /* 258 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var isObject = __webpack_require__(323); +var isObject = __webpack_require__(988); /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. @@ -12493,7 +12672,304 @@ module.exports = isStrictComparable; /***/ }), -/* 259 */, +/* 259 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.copyConfig = exports.bootstrapConfig = exports.applyCondaConfiguration = exports.condaInit = exports.condaCommand = exports.condaExecutable = exports.condaBasePath = void 0; +const path = __importStar(__webpack_require__(622)); +const os = __importStar(__webpack_require__(87)); +const fs = __importStar(__webpack_require__(747)); +const io = __importStar(__webpack_require__(1)); +const core = __importStar(__webpack_require__(470)); +const constants = __importStar(__webpack_require__(58)); +const utils = __importStar(__webpack_require__(567)); +/** + * Provide current location of miniconda or location where it will be installed + */ +function condaBasePath(options) { + let condaPath = constants.MINICONDA_DIR_PATH; + if (!options.useBundled) { + if (constants.IS_MAC) { + condaPath = "/Users/runner/miniconda3"; + } + else { + condaPath += "3"; + } + } + return condaPath; +} +exports.condaBasePath = condaBasePath; +/** + * Provide cross platform location of conda/mamba executable + */ +function condaExecutable(options) { + const dir = condaBasePath(options); + let condaExe; + let commandName; + commandName = options.useMamba ? "mamba" : "conda"; + commandName = constants.IS_WINDOWS ? commandName + ".bat" : commandName; + condaExe = path.join(dir, "condabin", commandName); + return condaExe; +} +exports.condaExecutable = condaExecutable; +/** + * Run Conda command + */ +function condaCommand(cmd, options) { + return __awaiter(this, void 0, void 0, function* () { + const command = [condaExecutable(options), ...cmd]; + yield utils.execute(command); + }); +} +exports.condaCommand = condaCommand; +/** + * Initialize Conda + */ +function condaInit(inputs, options) { + return __awaiter(this, void 0, void 0, function* () { + const isValidActivate = utils.isBaseEnv(inputs.activateEnvironment); + const autoActivateBase = inputs.condaConfig.auto_activate_base === "true"; + if (options.useBundled) { + yield fixPermissions(options); + } + // Remove profile files + if (inputs.removeProfiles == "true") { + for (let rc of constants.PROFILES) { + try { + let file = path.join(os.homedir(), rc); + if (fs.existsSync(file)) { + core.info(`Removing "${file}"`); + yield io.rmRF(file); + } + } + catch (err) { + core.warning(err); + } + } + } + // Run conda init + for (let cmd of ["--all"]) { + yield utils.execute([condaExecutable(options), "init", cmd]); + } + // Rename files + let source = ""; + let dest = ""; + switch (constants.PLATFORM) { + case "linux": + source = ".bashrc"; + dest = ".profile"; + break; + case "darwin": + source = ".bash_profile"; + dest = ".profile"; + break; + default: + break; + } + if (source && dest) { + core.info(`Renaming "~/${source}" to "~/${dest}"\n`); + yield io.mv(path.join(os.homedir(), source), path.join(os.homedir(), dest)); + } + // PowerShell profiles + let powerExtraText = ` + # ----------------------------------------------------------------------------`; + if (isValidActivate) { + powerExtraText += ` + # Conda Setup Action: Custom activation + conda activate ${inputs.activateEnvironment}`; + } + powerExtraText += ` + # ----------------------------------------------------------------------------`; + // Bash profiles + let bashExtraText = ` + # ---------------------------------------------------------------------------- + # Conda Setup Action: Basic configuration + set -eo pipefail`; + if (isValidActivate) { + bashExtraText += ` + # Conda Setup Action: Custom activation + conda activate ${inputs.activateEnvironment}`; + bashExtraText += ` + # ----------------------------------------------------------------------------`; + } + // Batch profiles + let batchExtraText = ` + :: ---------------------------------------------------------------------------`; + if (autoActivateBase) { + batchExtraText += ` + :: Conda Setup Action: Activate base + @CALL "%CONDA_BAT%" activate base`; + } + if (isValidActivate) { + batchExtraText += ` + :: Conda Setup Action: Custom activation + @CALL "%CONDA_BAT%" activate ${inputs.activateEnvironment}`; + } + batchExtraText += ` + :: Conda Setup Action: Basic configuration + @SETLOCAL EnableExtensions + @SETLOCAL DisableDelayedExpansion + :: ---------------------------------------------------------------------------`; + let extraShells; + const shells = { + "~/.bash_profile": bashExtraText, + "~/.profile": bashExtraText, + "~/.zshrc": bashExtraText, + "~/.config/fish/config.fish": bashExtraText, + "~/.tcshrc": bashExtraText, + "~/.xonshrc": bashExtraText, + "~/.config/powershell/profile.ps1": powerExtraText, + "~/Documents/PowerShell/profile.ps1": powerExtraText, + "~/Documents/WindowsPowerShell/profile.ps1": powerExtraText, + }; + if (options.useBundled) { + extraShells = { + "C:/Miniconda/etc/profile.d/conda.sh": bashExtraText, + "C:/Miniconda/etc/fish/conf.d/conda.fish": bashExtraText, + "C:/Miniconda/condabin/conda_hook.bat": batchExtraText, + }; + } + else { + extraShells = { + "C:/Miniconda3/etc/profile.d/conda.sh": bashExtraText, + "C:/Miniconda3/etc/fish/conf.d/conda.fish": bashExtraText, + "C:/Miniconda3/condabin/conda_hook.bat": batchExtraText, + }; + } + const allShells = Object.assign(Object.assign({}, shells), extraShells); + Object.keys(allShells).forEach((key) => { + let filePath = key.replace("~", os.homedir()); + const text = allShells[key]; + if (fs.existsSync(filePath)) { + core.info(`Append to "${filePath}":\n ${text} \n`); + fs.appendFileSync(filePath, text); + } + }); + }); +} +exports.condaInit = condaInit; +/** + * fix permissions for bundled miniconda installs + */ +function fixPermissions(options) { + return __awaiter(this, void 0, void 0, function* () { + switch (constants.PLATFORM) { + case "darwin": + yield utils.execute([ + "sudo", + "chown", + "-R", + `${process.env.USER}:staff`, + condaBasePath(options), + ]); + break; + case "win32": + for (let folder of constants.WIN_PERMS_FOLDERS) { + const ownPath = path.join(condaBasePath(options), folder); + if (fs.existsSync(ownPath)) { + yield utils.execute(["takeown", "/f", ownPath, "/r", "/d", "y"]); + } + } + break; + default: + break; + } + }); +} +/** + * Setup Conda configuration + */ +function applyCondaConfiguration(inputs, options) { + var _a, _b, _c; + return __awaiter(this, void 0, void 0, function* () { + const configEntries = Object.entries(inputs.condaConfig); + // channels are special: if specified as an action input, these take priority + let channels = inputs.condaConfig.channels + .trim() + .split(/[,\n]/) + .map((c) => c.trim()) + .filter((c) => c.length); + if (!channels.length && ((_c = (_b = (_a = options.envSpec) === null || _a === void 0 ? void 0 : _a.yaml) === null || _b === void 0 ? void 0 : _b.channels) === null || _c === void 0 ? void 0 : _c.length)) { + channels = options.envSpec.yaml.channels; + } + // LIFO: reverse order to preserve higher priority as listed in the option + for (const channel of channels.reverse()) { + core.info(`Adding channel '${channel}'`); + yield condaCommand(["config", "--add", "channels", channel], options); + } + // all other options + for (const [key, value] of configEntries) { + if (value.trim().length === 0 || key === "channels") { + continue; + } + core.info(`${key}: ${value}`); + try { + yield condaCommand(["config", "--set", key, value], options); + } + catch (err) { + core.warning(err); + } + } + // log all config + yield condaCommand(["config", "--show-sources"], options); + yield condaCommand(["config", "--show"], options); + }); +} +exports.applyCondaConfiguration = applyCondaConfiguration; +/** + * Create a baseline .condarc + */ +function bootstrapConfig() { + return __awaiter(this, void 0, void 0, function* () { + yield fs.promises.writeFile(constants.CONDARC_PATH, constants.BOOTSTRAP_CONDARC); + }); +} +exports.bootstrapConfig = bootstrapConfig; +/** + * Copy the given condarc file into place + */ +function copyConfig(inputs) { + return __awaiter(this, void 0, void 0, function* () { + const sourcePath = path.join(process.env["GITHUB_WORKSPACE"] || "", inputs.condaConfigFile); + core.info(`Copying "${sourcePath}" to "${constants.CONDARC_PATH}..."`); + yield io.cp(sourcePath, constants.CONDARC_PATH); + }); +} +exports.copyConfig = copyConfig; + + +/***/ }), /* 260 */ /***/ (function(module, __unusedexports, __webpack_require__) { @@ -12722,7 +13198,116 @@ FormattingElementList.prototype.getElementEntry = function (element) { /***/ }), /* 263 */, /* 264 */, -/* 265 */, +/* 265 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseInputs = void 0; +const path = __importStar(__webpack_require__(622)); +const core = __importStar(__webpack_require__(470)); +const constants = __importStar(__webpack_require__(58)); +const urlExt = (url) => path.posix.extname(new URL(url).pathname); +/** + * + */ +const RULES = [ + (i, c) => !!(i.condaVersion && c.auto_update_conda === "true") && + `only one of 'conda-version: ${i.condaVersion}' or 'auto-update-conda: true' may be provided`, + (i) => !!(i.pythonVersion && !i.activateEnvironment) && + `'python-version: ${i.pythonVersion}' requires 'activate-environment: true'`, + (i, c) => !!(i.mambaVersion && !c.channels.includes("conda-forge")) && + `'mamba-version: ${i.mambaVersion}' requires 'conda-forge' to be included in 'channels'`, + (i) => !!(i.installerUrl && i.minicondaVersion) && + `only one of 'installer-url' and 'miniconda-version' may be provided`, + (i) => !!(i.installerUrl && + !constants.KNOWN_EXTENSIONS.includes(urlExt(i.installerUrl))) && + `'installer-url' extension '${urlExt(i.installerUrl)}' must be one of: ${constants.KNOWN_EXTENSIONS}`, + (i) => !!(i.minicondaVersion && i.architecture !== "x64") && + `'architecture: ${i.architecture}' requires "miniconda-version"`, + (i) => !!(i.architecture === "x86" && constants.IS_LINUX) && + `'architecture: ${i.architecture}' is not supported by recent versions of Miniconda`, +]; +/* + * Parse, validate, and normalize string-ish inputs from `with` + */ +function parseInputs() { + return __awaiter(this, void 0, void 0, function* () { + const inputs = Object.freeze({ + activateEnvironment: core.getInput("activate-environment"), + architecture: core.getInput("architecture"), + condaBuildVersion: core.getInput("conda-build-version"), + condaConfigFile: core.getInput("condarc-file"), + condaVersion: core.getInput("conda-version"), + environmentFile: core.getInput("environment-file"), + installerUrl: core.getInput("installer-url"), + mambaVersion: core.getInput("mamba-version"), + minicondaVersion: core.getInput("miniconda-version"), + pythonVersion: core.getInput("python-version"), + removeProfiles: core.getInput("remove-profiles"), + condaConfig: Object.freeze({ + add_anaconda_token: core.getInput("add-anaconda-token"), + add_pip_as_python_dependency: core.getInput("add-pip-as-python-dependency"), + allow_softlinks: core.getInput("allow-softlinks"), + auto_activate_base: core.getInput("auto-activate-base"), + auto_update_conda: core.getInput("auto-update-conda"), + channel_alias: core.getInput("channel-alias"), + channel_priority: core.getInput("channel-priority"), + channels: core.getInput("channels"), + show_channel_urls: core.getInput("show-channel-urls"), + use_only_tar_bz2: core.getInput("use-only-tar-bz2"), + // these are always set to avoid terminal issues + always_yes: "true", + changeps1: "false", + }), + }); + const errors = RULES.reduce((errors, rule) => { + const msg = rule(inputs, inputs.condaConfig); + if (msg) { + core.error(msg); + errors.push(msg); + } + return errors; + }, []); + if (errors.length) { + throw Error(`${errors.length} errors found in action inputs`); + } + return Object.freeze(inputs); + }); +} +exports.parseInputs = parseInputs; + + +/***/ }), /* 266 */, /* 267 */, /* 268 */ @@ -12757,7 +13342,68 @@ module.exports = listCacheSet; /***/ }), -/* 269 */, +/* 269 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateMamba = void 0; +const fs = __importStar(__webpack_require__(747)); +const core = __importStar(__webpack_require__(470)); +const constants = __importStar(__webpack_require__(58)); +const utils = __importStar(__webpack_require__(567)); +const conda = __importStar(__webpack_require__(259)); +exports.updateMamba = { + label: "Update mamba", + provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { return inputs.mambaVersion !== ""; }), + toolPackages: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { + core.warning(`Mamba support is still experimental and can result in differently solved environments!`); + return { + tools: [utils.makeSpec("mamba", inputs.mambaVersion)], + options, + }; + }), + postInstall: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { + if (constants.IS_WINDOWS) { + // add bat-less forwarder for bash users on Windows + const mambaBat = conda.condaExecutable(options).replace("\\", "/"); + const contents = `bash.exe -c "exec '${mambaBat}' $*"`; + fs.writeFileSync(mambaBat.slice(0, -4), contents); + } + }), +}; + + +/***/ }), /* 270 */, /* 271 */, /* 272 */ @@ -12796,7 +13442,7 @@ module.exports = {"amp":"&","apos":"'","gt":">","lt":"<","quot":"\""}; "use strict"; -var DOCUMENT_MODE = __webpack_require__(621).DOCUMENT_MODE; +var DOCUMENT_MODE = __webpack_require__(141).DOCUMENT_MODE; //Node construction exports.createDocument = function () { @@ -13011,3781 +13657,3247 @@ exports.isElementNode = function (node) { /* 278 */, /* 279 */, /* 280 */ -/***/ (function(module, exports) { +/***/ (function(module, __unusedexports, __webpack_require__) { -exports = module.exports = SemVer +var Symbol = __webpack_require__(498), + arrayMap = __webpack_require__(727), + isArray = __webpack_require__(143), + isSymbol = __webpack_require__(186); -var debug -/* istanbul ignore next */ -if (typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function () { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift('SEMVER') - console.log.apply(console, args) +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * 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; } -} else { - debug = function () {} + 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; } -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0' +module.exports = baseToString; -var MAX_LENGTH = 256 -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16 +/***/ }), +/* 281 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -// The actual regexps go on exports.re -var re = exports.re = [] -var src = exports.src = [] -var t = exports.tokens = {} -var R = 0 +var ElementType = __webpack_require__(855); -function tok (n) { - t[n] = R++ +var re_whitespace = /\s+/g; +var NodePrototype = __webpack_require__(798); +var ElementPrototype = __webpack_require__(402); + +function DomHandler(callback, options, elementCB){ + if(typeof callback === "object"){ + elementCB = options; + options = callback; + callback = null; + } else if(typeof options === "function"){ + elementCB = options; + options = defaultOpts; + } + this._callback = callback; + this._options = options || defaultOpts; + this._elementCB = elementCB; + this.dom = []; + this._done = false; + this._tagStack = []; + this._parser = this._parser || null; } -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. +//default options +var defaultOpts = { + normalizeWhitespace: false, //Replace all whitespace with single spaces + withStartIndices: false, //Add startIndex properties to nodes + withEndIndices: false, //Add endIndex properties to nodes +}; -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. +DomHandler.prototype.onparserinit = function(parser){ + this._parser = parser; +}; -tok('NUMERICIDENTIFIER') -src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' -tok('NUMERICIDENTIFIERLOOSE') -src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' +//Resets the handler back to starting state +DomHandler.prototype.onreset = function(){ + DomHandler.call(this, this._callback, this._options, this._elementCB); +}; -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. +//Signals the handler that parsing is done +DomHandler.prototype.onend = function(){ + if(this._done) return; + this._done = true; + this._parser = null; + this._handleCallback(null); +}; -tok('NONNUMERICIDENTIFIER') -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' +DomHandler.prototype._handleCallback = +DomHandler.prototype.onerror = function(error){ + if(typeof this._callback === "function"){ + this._callback(error, this.dom); + } else { + if(error) throw error; + } +}; -// ## Main Version -// Three dot-separated numeric identifiers. +DomHandler.prototype.onclosetag = function(){ + //if(this._tagStack.pop().name !== name) this._handleCallback(Error("Tagname didn't match!")); + + var elem = this._tagStack.pop(); -tok('MAINVERSION') -src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIER] + ')' + if(this._options.withEndIndices && elem){ + elem.endIndex = this._parser.endIndex; + } -tok('MAINVERSIONLOOSE') -src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' + if(this._elementCB) this._elementCB(elem); +}; -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. +DomHandler.prototype._createDomElement = function(properties){ + if (!this._options.withDomLvl1) return properties; -tok('PRERELEASEIDENTIFIER') -src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + - '|' + src[t.NONNUMERICIDENTIFIER] + ')' + var element; + if (properties.type === "tag") { + element = Object.create(ElementPrototype); + } else { + element = Object.create(NodePrototype); + } -tok('PRERELEASEIDENTIFIERLOOSE') -src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + - '|' + src[t.NONNUMERICIDENTIFIER] + ')' + for (var key in properties) { + if (properties.hasOwnProperty(key)) { + element[key] = properties[key]; + } + } -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. + return element; +}; -tok('PRERELEASE') -src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + - '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' +DomHandler.prototype._addDomElement = function(element){ + var parent = this._tagStack[this._tagStack.length - 1]; + var siblings = parent ? parent.children : this.dom; + var previousSibling = siblings[siblings.length - 1]; -tok('PRERELEASELOOSE') -src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' + element.next = null; -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. + if(this._options.withStartIndices){ + element.startIndex = this._parser.startIndex; + } + if(this._options.withEndIndices){ + element.endIndex = this._parser.endIndex; + } -tok('BUILDIDENTIFIER') -src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' + if(previousSibling){ + element.prev = previousSibling; + previousSibling.next = element; + } else { + element.prev = null; + } -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. + siblings.push(element); + element.parent = parent || null; +}; -tok('BUILD') -src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + - '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' +DomHandler.prototype.onopentag = function(name, attribs){ + var properties = { + type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag, + name: name, + attribs: attribs, + children: [] + }; -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. + var element = this._createDomElement(properties); -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. + this._addDomElement(element); -tok('FULL') -tok('FULLPLAIN') -src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + - src[t.PRERELEASE] + '?' + - src[t.BUILD] + '?' + this._tagStack.push(element); +}; -src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' +DomHandler.prototype.ontext = function(data){ + //the ignoreWhitespace is officially dropped, but for now, + //it's an alias for normalizeWhitespace + var normalize = this._options.normalizeWhitespace || this._options.ignoreWhitespace; -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -tok('LOOSEPLAIN') -src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + - src[t.PRERELEASELOOSE] + '?' + - src[t.BUILD] + '?' + var lastTag; -tok('LOOSE') -src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' + if(!this._tagStack.length && this.dom.length && (lastTag = this.dom[this.dom.length-1]).type === ElementType.Text){ + if(normalize){ + lastTag.data = (lastTag.data + data).replace(re_whitespace, " "); + } else { + lastTag.data += data; + } + } else { + if( + this._tagStack.length && + (lastTag = this._tagStack[this._tagStack.length - 1]) && + (lastTag = lastTag.children[lastTag.children.length - 1]) && + lastTag.type === ElementType.Text + ){ + if(normalize){ + lastTag.data = (lastTag.data + data).replace(re_whitespace, " "); + } else { + lastTag.data += data; + } + } else { + if(normalize){ + data = data.replace(re_whitespace, " "); + } -tok('GTLT') -src[t.GTLT] = '((?:<|>)?=?)' + var element = this._createDomElement({ + data: data, + type: ElementType.Text + }); -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -tok('XRANGEIDENTIFIERLOOSE') -src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' -tok('XRANGEIDENTIFIER') -src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' + this._addDomElement(element); + } + } +}; -tok('XRANGEPLAIN') -src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:' + src[t.PRERELEASE] + ')?' + - src[t.BUILD] + '?' + - ')?)?' +DomHandler.prototype.oncomment = function(data){ + var lastTag = this._tagStack[this._tagStack.length - 1]; -tok('XRANGEPLAINLOOSE') -src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[t.PRERELEASELOOSE] + ')?' + - src[t.BUILD] + '?' + - ')?)?' + if(lastTag && lastTag.type === ElementType.Comment){ + lastTag.data += data; + return; + } -tok('XRANGE') -src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' -tok('XRANGELOOSE') -src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' + var properties = { + data: data, + type: ElementType.Comment + }; -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -tok('COERCE') -src[t.COERCE] = '(^|[^\\d])' + - '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])' -tok('COERCERTL') -re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') + var element = this._createDomElement(properties); -// Tilde ranges. -// Meaning is "reasonably at or greater than" -tok('LONETILDE') -src[t.LONETILDE] = '(?:~>?)' + this._addDomElement(element); + this._tagStack.push(element); +}; -tok('TILDETRIM') -src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' -re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') -var tildeTrimReplace = '$1~' +DomHandler.prototype.oncdatastart = function(){ + var properties = { + children: [{ + data: "", + type: ElementType.Text + }], + type: ElementType.CDATA + }; -tok('TILDE') -src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' -tok('TILDELOOSE') -src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' + var element = this._createDomElement(properties); -// Caret ranges. -// Meaning is "at least and backwards compatible with" -tok('LONECARET') -src[t.LONECARET] = '(?:\\^)' + this._addDomElement(element); + this._tagStack.push(element); +}; -tok('CARETTRIM') -src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' -re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') -var caretTrimReplace = '$1^' +DomHandler.prototype.oncommentend = DomHandler.prototype.oncdataend = function(){ + this._tagStack.pop(); +}; -tok('CARET') -src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' -tok('CARETLOOSE') -src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' +DomHandler.prototype.onprocessinginstruction = function(name, data){ + var element = this._createDomElement({ + name: name, + data: data, + type: ElementType.Directive + }); -// A simple gt/lt/eq thing, or just "" to indicate "any version" -tok('COMPARATORLOOSE') -src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' -tok('COMPARATOR') -src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' + this._addDomElement(element); +}; -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -tok('COMPARATORTRIM') -src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + - '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' +module.exports = DomHandler; -// this one has to use the /g flag -re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') -var comparatorTrimReplace = '$1$2$3' -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -tok('HYPHENRANGE') -src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[t.XRANGEPLAIN] + ')' + - '\\s*$' +/***/ }), +/* 282 */, +/* 283 */, +/* 284 */, +/* 285 */ +/***/ (function(__unusedmodule, exports) { -tok('HYPHENRANGELOOSE') -src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[t.XRANGEPLAINLOOSE] + ')' + - '\\s*$' +"use strict"; -// Star ranges basically just allow anything at all. -tok('STAR') -src[t.STAR] = '(<|>)?=?\\s*\\*' +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ensureExplicit = void 0; +exports.ensureExplicit = { + label: "create (explicit)", + provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { var _a, _b; return !!((_b = (_a = options.envSpec) === null || _a === void 0 ? void 0 : _a.explicit) === null || _b === void 0 ? void 0 : _b.length); }), + condaArgs: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { + if (inputs.pythonVersion) { + throw Error(`'python-version: ${inputs.pythonVersion}' is incompatible with an explicit 'environmentFile`); + } + return [ + "create", + "--name", + inputs.activateEnvironment, + "--file", + inputs.environmentFile, + ]; + }), +}; -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]) - if (!re[i]) { - re[i] = new RegExp(src[i]) - } -} -exports.parse = parse -function parse (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false +/***/ }), +/* 286 */, +/* 287 */, +/* 288 */ +/***/ (function(module) { + +/** + * 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; +} - if (version instanceof SemVer) { - return version - } +module.exports = baseFindIndex; - if (typeof version !== 'string') { - return null - } - if (version.length > MAX_LENGTH) { - return null - } +/***/ }), +/* 289 */, +/* 290 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - var r = options.loose ? re[t.LOOSE] : re[t.FULL] - if (!r.test(version)) { - return null - } +var isArray = __webpack_require__(143), + isSymbol = __webpack_require__(186); - try { - return new SemVer(version, options) - } catch (er) { - return null +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * 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)); } -exports.valid = valid -function valid (version, options) { - var v = parse(version, options) - return v ? v.version : null -} +module.exports = isKey; -exports.clean = clean -function clean (version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} -exports.SemVer = SemVer +/***/ }), +/* 291 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -function SemVer (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version) - } +var copyArray = __webpack_require__(239), + isIndex = __webpack_require__(160); - if (version.length > MAX_LENGTH) { - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - } +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; - if (!(this instanceof SemVer)) { - return new SemVer(version, options) +/** + * 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; +} - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose +module.exports = reorder; - var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) - if (!m) { - throw new TypeError('Invalid Version: ' + version) - } +/***/ }), +/* 292 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - this.raw = version +var constant = __webpack_require__(817), + defineProperty = __webpack_require__(382), + identity = __webpack_require__(83); - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] +/** + * 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 + }); +}; - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } +module.exports = baseSetToString; - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } +/***/ }), +/* 293 */ +/***/ (function(module) { - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map(function (id) { - if (/^[0-9]+$/.test(id)) { - var num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } +module.exports = require("buffer"); - this.build = m[5] ? m[5].split('.') : [] - this.format() -} +/***/ }), +/* 294 */, +/* 295 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -SemVer.prototype.format = function () { - this.version = this.major + '.' + this.minor + '.' + this.patch - if (this.prerelease.length) { - this.version += '-' + this.prerelease.join('.') +var baseMatches = __webpack_require__(974), + baseMatchesProperty = __webpack_require__(728), + identity = __webpack_require__(83), + isArray = __webpack_require__(143), + property = __webpack_require__(927); + +/** + * 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; } - return this.version + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); } -SemVer.prototype.toString = function () { - return this.version -} +module.exports = baseIteratee; -SemVer.prototype.compare = function (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - return this.compareMain(other) || this.comparePre(other) -} +/***/ }), +/* 296 */, +/* 297 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -SemVer.prototype.compareMain = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +var arrayMap = __webpack_require__(727), + baseIteratee = __webpack_require__(295), + baseMap = __webpack_require__(852), + isArray = __webpack_require__(143); - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) +/** + * 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, baseIteratee(iteratee, 3)); } -SemVer.prototype.comparePre = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } +module.exports = map; - var i = 0 - do { - var a = this.prerelease[i] - var b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) -} -SemVer.prototype.compareBuild = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +/***/ }), +/* 298 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { - var i = 0 - do { - var a = this.build[i] - var b = other.build[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) -} +"use strict"; -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier) - this.inc('pre', identifier) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier) - } - this.inc('pre', identifier) - break - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0] - } else { - var i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } - } - break +var Tokenizer = __webpack_require__(990), + HTML = __webpack_require__(141); - default: - throw new Error('invalid increment argument: ' + release) - } - this.format() - this.raw = this.version - return this -} +//Aliases +var $ = HTML.TAG_NAMES, + NS = HTML.NAMESPACES, + ATTRS = HTML.ATTRS; -exports.inc = inc -function inc (version, release, loose, identifier) { - if (typeof (loose) === 'string') { - identifier = loose - loose = undefined - } - try { - return new SemVer(version, loose).inc(release, identifier).version - } catch (er) { - return null - } -} +//MIME types +var MIME_TYPES = { + TEXT_HTML: 'text/html', + APPLICATION_XML: 'application/xhtml+xml' +}; -exports.diff = diff -function diff (version1, version2) { - if (eq(version1, version2)) { - return null - } else { - var v1 = parse(version1) - var v2 = parse(version2) - var prefix = '' - if (v1.prerelease.length || v2.prerelease.length) { - prefix = 'pre' - var defaultResult = 'prerelease' - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } - } - } - return defaultResult // may be undefined - } -} +//Attributes +var DEFINITION_URL_ATTR = 'definitionurl', + ADJUSTED_DEFINITION_URL_ATTR = 'definitionURL', + SVG_ATTRS_ADJUSTMENT_MAP = { + 'attributename': 'attributeName', + 'attributetype': 'attributeType', + 'basefrequency': 'baseFrequency', + 'baseprofile': 'baseProfile', + 'calcmode': 'calcMode', + 'clippathunits': 'clipPathUnits', + 'diffuseconstant': 'diffuseConstant', + 'edgemode': 'edgeMode', + 'filterunits': 'filterUnits', + 'glyphref': 'glyphRef', + 'gradienttransform': 'gradientTransform', + 'gradientunits': 'gradientUnits', + 'kernelmatrix': 'kernelMatrix', + 'kernelunitlength': 'kernelUnitLength', + 'keypoints': 'keyPoints', + 'keysplines': 'keySplines', + 'keytimes': 'keyTimes', + 'lengthadjust': 'lengthAdjust', + 'limitingconeangle': 'limitingConeAngle', + 'markerheight': 'markerHeight', + 'markerunits': 'markerUnits', + 'markerwidth': 'markerWidth', + 'maskcontentunits': 'maskContentUnits', + 'maskunits': 'maskUnits', + 'numoctaves': 'numOctaves', + 'pathlength': 'pathLength', + 'patterncontentunits': 'patternContentUnits', + 'patterntransform': 'patternTransform', + 'patternunits': 'patternUnits', + 'pointsatx': 'pointsAtX', + 'pointsaty': 'pointsAtY', + 'pointsatz': 'pointsAtZ', + 'preservealpha': 'preserveAlpha', + 'preserveaspectratio': 'preserveAspectRatio', + 'primitiveunits': 'primitiveUnits', + 'refx': 'refX', + 'refy': 'refY', + 'repeatcount': 'repeatCount', + 'repeatdur': 'repeatDur', + 'requiredextensions': 'requiredExtensions', + 'requiredfeatures': 'requiredFeatures', + 'specularconstant': 'specularConstant', + 'specularexponent': 'specularExponent', + 'spreadmethod': 'spreadMethod', + 'startoffset': 'startOffset', + 'stddeviation': 'stdDeviation', + 'stitchtiles': 'stitchTiles', + 'surfacescale': 'surfaceScale', + 'systemlanguage': 'systemLanguage', + 'tablevalues': 'tableValues', + 'targetx': 'targetX', + 'targety': 'targetY', + 'textlength': 'textLength', + 'viewbox': 'viewBox', + 'viewtarget': 'viewTarget', + 'xchannelselector': 'xChannelSelector', + 'ychannelselector': 'yChannelSelector', + 'zoomandpan': 'zoomAndPan' + }, + XML_ATTRS_ADJUSTMENT_MAP = { + 'xlink:actuate': {prefix: 'xlink', name: 'actuate', namespace: NS.XLINK}, + 'xlink:arcrole': {prefix: 'xlink', name: 'arcrole', namespace: NS.XLINK}, + 'xlink:href': {prefix: 'xlink', name: 'href', namespace: NS.XLINK}, + 'xlink:role': {prefix: 'xlink', name: 'role', namespace: NS.XLINK}, + 'xlink:show': {prefix: 'xlink', name: 'show', namespace: NS.XLINK}, + 'xlink:title': {prefix: 'xlink', name: 'title', namespace: NS.XLINK}, + 'xlink:type': {prefix: 'xlink', name: 'type', namespace: NS.XLINK}, + 'xml:base': {prefix: 'xml', name: 'base', namespace: NS.XML}, + 'xml:lang': {prefix: 'xml', name: 'lang', namespace: NS.XML}, + 'xml:space': {prefix: 'xml', name: 'space', namespace: NS.XML}, + 'xmlns': {prefix: '', name: 'xmlns', namespace: NS.XMLNS}, + 'xmlns:xlink': {prefix: 'xmlns', name: 'xlink', namespace: NS.XMLNS} -exports.compareIdentifiers = compareIdentifiers + }; -var numeric = /^[0-9]+$/ -function compareIdentifiers (a, b) { - var anum = numeric.test(a) - var bnum = numeric.test(b) +//SVG tag names adjustment map +var SVG_TAG_NAMES_ADJUSTMENT_MAP = exports.SVG_TAG_NAMES_ADJUSTMENT_MAP = { + 'altglyph': 'altGlyph', + 'altglyphdef': 'altGlyphDef', + 'altglyphitem': 'altGlyphItem', + 'animatecolor': 'animateColor', + 'animatemotion': 'animateMotion', + 'animatetransform': 'animateTransform', + 'clippath': 'clipPath', + 'feblend': 'feBlend', + 'fecolormatrix': 'feColorMatrix', + 'fecomponenttransfer': 'feComponentTransfer', + 'fecomposite': 'feComposite', + 'feconvolvematrix': 'feConvolveMatrix', + 'fediffuselighting': 'feDiffuseLighting', + 'fedisplacementmap': 'feDisplacementMap', + 'fedistantlight': 'feDistantLight', + 'feflood': 'feFlood', + 'fefunca': 'feFuncA', + 'fefuncb': 'feFuncB', + 'fefuncg': 'feFuncG', + 'fefuncr': 'feFuncR', + 'fegaussianblur': 'feGaussianBlur', + 'feimage': 'feImage', + 'femerge': 'feMerge', + 'femergenode': 'feMergeNode', + 'femorphology': 'feMorphology', + 'feoffset': 'feOffset', + 'fepointlight': 'fePointLight', + 'fespecularlighting': 'feSpecularLighting', + 'fespotlight': 'feSpotLight', + 'fetile': 'feTile', + 'feturbulence': 'feTurbulence', + 'foreignobject': 'foreignObject', + 'glyphref': 'glyphRef', + 'lineargradient': 'linearGradient', + 'radialgradient': 'radialGradient', + 'textpath': 'textPath' +}; - if (anum && bnum) { - a = +a - b = +b - } +//Tags that causes exit from foreign content +var EXITS_FOREIGN_CONTENT = Object.create(null); - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} +EXITS_FOREIGN_CONTENT[$.B] = true; +EXITS_FOREIGN_CONTENT[$.BIG] = true; +EXITS_FOREIGN_CONTENT[$.BLOCKQUOTE] = true; +EXITS_FOREIGN_CONTENT[$.BODY] = true; +EXITS_FOREIGN_CONTENT[$.BR] = true; +EXITS_FOREIGN_CONTENT[$.CENTER] = true; +EXITS_FOREIGN_CONTENT[$.CODE] = true; +EXITS_FOREIGN_CONTENT[$.DD] = true; +EXITS_FOREIGN_CONTENT[$.DIV] = true; +EXITS_FOREIGN_CONTENT[$.DL] = true; +EXITS_FOREIGN_CONTENT[$.DT] = true; +EXITS_FOREIGN_CONTENT[$.EM] = true; +EXITS_FOREIGN_CONTENT[$.EMBED] = true; +EXITS_FOREIGN_CONTENT[$.H1] = true; +EXITS_FOREIGN_CONTENT[$.H2] = true; +EXITS_FOREIGN_CONTENT[$.H3] = true; +EXITS_FOREIGN_CONTENT[$.H4] = true; +EXITS_FOREIGN_CONTENT[$.H5] = true; +EXITS_FOREIGN_CONTENT[$.H6] = true; +EXITS_FOREIGN_CONTENT[$.HEAD] = true; +EXITS_FOREIGN_CONTENT[$.HR] = true; +EXITS_FOREIGN_CONTENT[$.I] = true; +EXITS_FOREIGN_CONTENT[$.IMG] = true; +EXITS_FOREIGN_CONTENT[$.LI] = true; +EXITS_FOREIGN_CONTENT[$.LISTING] = true; +EXITS_FOREIGN_CONTENT[$.MENU] = true; +EXITS_FOREIGN_CONTENT[$.META] = true; +EXITS_FOREIGN_CONTENT[$.NOBR] = true; +EXITS_FOREIGN_CONTENT[$.OL] = true; +EXITS_FOREIGN_CONTENT[$.P] = true; +EXITS_FOREIGN_CONTENT[$.PRE] = true; +EXITS_FOREIGN_CONTENT[$.RUBY] = true; +EXITS_FOREIGN_CONTENT[$.S] = true; +EXITS_FOREIGN_CONTENT[$.SMALL] = true; +EXITS_FOREIGN_CONTENT[$.SPAN] = true; +EXITS_FOREIGN_CONTENT[$.STRONG] = true; +EXITS_FOREIGN_CONTENT[$.STRIKE] = true; +EXITS_FOREIGN_CONTENT[$.SUB] = true; +EXITS_FOREIGN_CONTENT[$.SUP] = true; +EXITS_FOREIGN_CONTENT[$.TABLE] = true; +EXITS_FOREIGN_CONTENT[$.TT] = true; +EXITS_FOREIGN_CONTENT[$.U] = true; +EXITS_FOREIGN_CONTENT[$.UL] = true; +EXITS_FOREIGN_CONTENT[$.VAR] = true; -exports.rcompareIdentifiers = rcompareIdentifiers -function rcompareIdentifiers (a, b) { - return compareIdentifiers(b, a) -} +//Check exit from foreign content +exports.causesExit = function (startTagToken) { + var tn = startTagToken.tagName; + var isFontWithAttrs = tn === $.FONT && (Tokenizer.getTokenAttr(startTagToken, ATTRS.COLOR) !== null || + Tokenizer.getTokenAttr(startTagToken, ATTRS.SIZE) !== null || + Tokenizer.getTokenAttr(startTagToken, ATTRS.FACE) !== null); -exports.major = major -function major (a, loose) { - return new SemVer(a, loose).major -} + return isFontWithAttrs ? true : EXITS_FOREIGN_CONTENT[tn]; +}; -exports.minor = minor -function minor (a, loose) { - return new SemVer(a, loose).minor -} +//Token adjustments +exports.adjustTokenMathMLAttrs = function (token) { + for (var i = 0; i < token.attrs.length; i++) { + if (token.attrs[i].name === DEFINITION_URL_ATTR) { + token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR; + break; + } + } +}; -exports.patch = patch -function patch (a, loose) { - return new SemVer(a, loose).patch -} +exports.adjustTokenSVGAttrs = function (token) { + for (var i = 0; i < token.attrs.length; i++) { + var adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; -exports.compare = compare -function compare (a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)) -} + if (adjustedAttrName) + token.attrs[i].name = adjustedAttrName; + } +}; -exports.compareLoose = compareLoose -function compareLoose (a, b) { - return compare(a, b, true) -} +exports.adjustTokenXMLAttrs = function (token) { + for (var i = 0; i < token.attrs.length; i++) { + var adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; -exports.compareBuild = compareBuild -function compareBuild (a, b, loose) { - var versionA = new SemVer(a, loose) - var versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} + if (adjustedAttrEntry) { + token.attrs[i].prefix = adjustedAttrEntry.prefix; + token.attrs[i].name = adjustedAttrEntry.name; + token.attrs[i].namespace = adjustedAttrEntry.namespace; + } + } +}; -exports.rcompare = rcompare -function rcompare (a, b, loose) { - return compare(b, a, loose) -} +exports.adjustTokenSVGTagName = function (token) { + var adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP[token.tagName]; -exports.sort = sort -function sort (list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(a, b, loose) - }) -} + if (adjustedTagName) + token.tagName = adjustedTagName; +}; -exports.rsort = rsort -function rsort (list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(b, a, loose) - }) +//Integration points +function isMathMLTextIntegrationPoint(tn, ns) { + return ns === NS.MATHML && (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS || tn === $.MTEXT); } -exports.gt = gt -function gt (a, b, loose) { - return compare(a, b, loose) > 0 -} +function isHtmlIntegrationPoint(tn, ns, attrs) { + if (ns === NS.MATHML && tn === $.ANNOTATION_XML) { + for (var i = 0; i < attrs.length; i++) { + if (attrs[i].name === ATTRS.ENCODING) { + var value = attrs[i].value.toLowerCase(); -exports.lt = lt -function lt (a, b, loose) { - return compare(a, b, loose) < 0 -} + return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML; + } + } + } -exports.eq = eq -function eq (a, b, loose) { - return compare(a, b, loose) === 0 + return ns === NS.SVG && (tn === $.FOREIGN_OBJECT || tn === $.DESC || tn === $.TITLE); } -exports.neq = neq -function neq (a, b, loose) { - return compare(a, b, loose) !== 0 -} +exports.isIntegrationPoint = function (tn, ns, attrs, foreignNS) { + if ((!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs)) + return true; -exports.gte = gte -function gte (a, b, loose) { - return compare(a, b, loose) >= 0 -} + if ((!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns)) + return true; -exports.lte = lte -function lte (a, b, loose) { - return compare(a, b, loose) <= 0 -} + return false; +}; -exports.cmp = cmp -function cmp (a, op, b, loose) { - switch (op) { - case '===': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a === b - case '!==': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a !== b +/***/ }), +/* 299 */, +/* 300 */, +/* 301 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - case '': - case '=': - case '==': - return eq(a, b, loose) +var isArrayLike = __webpack_require__(146), + isObjectLike = __webpack_require__(337); - case '!=': - return neq(a, b, loose) +/** + * 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); +} - case '>': - return gt(a, b, loose) +module.exports = isArrayLikeObject; - case '>=': - return gte(a, b, loose) - case '<': - return lt(a, b, loose) +/***/ }), +/* 302 */, +/* 303 */, +/* 304 */ +/***/ (function(module) { - case '<=': - return lte(a, b, loose) +module.exports = require("string_decoder"); - default: - throw new TypeError('Invalid operator: ' + op) - } -} +/***/ }), +/* 305 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -exports.Comparator = Comparator -function Comparator (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +var assignMergeValue = __webpack_require__(110), + cloneBuffer = __webpack_require__(744), + cloneTypedArray = __webpack_require__(422), + copyArray = __webpack_require__(239), + initCloneObject = __webpack_require__(66), + isArguments = __webpack_require__(460), + isArray = __webpack_require__(143), + isArrayLikeObject = __webpack_require__(301), + isBuffer = __webpack_require__(546), + isFunction = __webpack_require__(10), + isObject = __webpack_require__(988), + isPlainObject = __webpack_require__(585), + isTypedArray = __webpack_require__(850), + safeGet = __webpack_require__(807), + toPlainObject = __webpack_require__(808); - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } +/** + * 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 (!(this instanceof Comparator)) { - return new Comparator(comp, options) + if (stacked) { + assignMergeValue(object, key, stacked); + return; } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) + var isCommon = newValue === undefined; - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); - debug('comp', this) + 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); } -var ANY = {} -Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - var m = comp.match(r) +module.exports = baseMergeDeep; - if (!m) { - throw new TypeError('Invalid comparator: ' + comp) - } - - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } -} +/***/ }), +/* 306 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { -Comparator.prototype.toString = function () { - return this.value -} +var inverseXML = getInverseObj(__webpack_require__(273)), + xmlReplacer = getInverseReplacer(inverseXML); -Comparator.prototype.test = function (version) { - debug('Comparator.test', version, this.options.loose) +exports.XML = getInverse(inverseXML, xmlReplacer); - if (this.semver === ANY || version === ANY) { - return true - } +var inverseHTML = getInverseObj(__webpack_require__(252)), + htmlReplacer = getInverseReplacer(inverseHTML); - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } +exports.HTML = getInverse(inverseHTML, htmlReplacer); - return cmp(version, this.operator, this.semver, this.options) +function getInverseObj(obj) { + return Object.keys(obj) + .sort() + .reduce(function(inverse, name) { + inverse[obj[name]] = "&" + name + ";"; + return inverse; + }, {}); } -Comparator.prototype.intersects = function (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } +function getInverseReplacer(inverse) { + var single = [], + multiple = []; - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } + Object.keys(inverse).forEach(function(k) { + if (k.length === 1) { + single.push("\\" + k); + } else { + multiple.push(k); + } + }); - var rangeTmp + //TODO add ranges + multiple.unshift("[" + single.join("") + "]"); - if (this.operator === '') { - if (this.value === '') { - return true - } - rangeTmp = new Range(comp.value, options) - return satisfies(this.value, rangeTmp, options) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - rangeTmp = new Range(this.value, options) - return satisfies(comp.semver, rangeTmp, options) - } + return new RegExp(multiple.join("|"), "g"); +} - var sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - var sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - var sameSemVer = this.semver.version === comp.semver.version - var differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - var oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')) - var oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')) +var re_nonASCII = /[^\0-\x7F]/g, + re_astralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; - return sameDirectionIncreasing || sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +function singleCharReplacer(c) { + return ( + "&#x" + + c + .charCodeAt(0) + .toString(16) + .toUpperCase() + + ";" + ); } -exports.Range = Range -function Range (range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +function astralReplacer(c) { + // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + var high = c.charCodeAt(0); + var low = c.charCodeAt(1); + var codePoint = (high - 0xd800) * 0x400 + low - 0xdc00 + 0x10000; + return "&#x" + codePoint.toString(16).toUpperCase() + ";"; +} - if (range instanceof Range) { - if (range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease) { - return range - } else { - return new Range(range.raw, options) +function getInverse(inverse, re) { + function func(name) { + return inverse[name]; } - } - if (range instanceof Comparator) { - return new Range(range.value, options) - } + return function(data) { + return data + .replace(re, func) + .replace(re_astralSymbols, astralReplacer) + .replace(re_nonASCII, singleCharReplacer); + }; +} - if (!(this instanceof Range)) { - return new Range(range, options) - } +var re_xmlChars = getInverseReplacer(inverseXML); - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease +function escapeXML(data) { + return data + .replace(re_xmlChars, singleCharReplacer) + .replace(re_astralSymbols, astralReplacer) + .replace(re_nonASCII, singleCharReplacer); +} - // First, split based on boolean or || - this.raw = range - this.set = range.split(/\s*\|\|\s*/).map(function (range) { - return this.parseRange(range.trim()) - }, this).filter(function (c) { - // throw out any that are not relevant for whatever reason - return c.length - }) +exports.escape = escapeXML; - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) - } - this.format() -} +/***/ }), +/* 307 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { -Range.prototype.format = function () { - this.range = this.set.map(function (comps) { - return comps.join(' ').trim() - }).join('||').trim() - return this.range -} +var encode = __webpack_require__(306), + decode = __webpack_require__(253); -Range.prototype.toString = function () { - return this.range -} +exports.decode = function(data, level) { + return (!level || level <= 0 ? decode.XML : decode.HTML)(data); +}; -Range.prototype.parseRange = function (range) { - var loose = this.options.loose - range = range.trim() - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[t.COMPARATORTRIM]) +exports.decodeStrict = function(data, level) { + return (!level || level <= 0 ? decode.XML : decode.HTMLStrict)(data); +}; - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) +exports.encode = function(data, level) { + return (!level || level <= 0 ? encode.XML : encode.HTML)(data); +}; - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) +exports.encodeXML = encode.XML; - // normalize spaces - range = range.split(/\s+/).join(' ') +exports.encodeHTML4 = exports.encodeHTML5 = exports.encodeHTML = encode.HTML; - // At this point, the range is completely trimmed and - // ready to be split into comparators. +exports.decodeXML = exports.decodeXMLStrict = decode.XML; - var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - var set = range.split(' ').map(function (comp) { - return parseComparator(comp, this.options) - }, this).join(' ').split(/\s+/) - if (this.options.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function (comp) { - return !!comp.match(compRe) - }) - } - set = set.map(function (comp) { - return new Comparator(comp, this.options) - }, this) +exports.decodeHTML4 = exports.decodeHTML5 = exports.decodeHTML = decode.HTML; - return set -} +exports.decodeHTML4Strict = exports.decodeHTML5Strict = exports.decodeHTMLStrict = decode.HTMLStrict; -Range.prototype.intersects = function (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } +exports.escape = encode.escape; - return this.set.some(function (thisComparators) { - return ( - isSatisfiable(thisComparators, options) && - range.set.some(function (rangeComparators) { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every(function (thisComparator) { - return rangeComparators.every(function (rangeComparator) { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) -} -// take a set of comparators and determine whether there -// exists a version which can satisfy it -function isSatisfiable (comparators, options) { - var result = true - var remainingComparators = comparators.slice() - var testComparator = remainingComparators.pop() +/***/ }), +/* 308 */, +/* 309 */, +/* 310 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - while (result && remainingComparators.length) { - result = remainingComparators.every(function (otherComparator) { - return testComparator.intersects(otherComparator, options) - }) +var castPath = __webpack_require__(929), + isArguments = __webpack_require__(460), + isArray = __webpack_require__(143), + isIndex = __webpack_require__(160), + isLength = __webpack_require__(611), + toKey = __webpack_require__(503); - testComparator = remainingComparators.pop() - } +/** + * 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); - return result -} + var index = -1, + length = path.length, + result = false; -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators -function toComparators (range, options) { - return new Range(range, options).set.map(function (comp) { - return comp.map(function (c) { - return c.value - }).join(' ').trim().split(' ') - }) + 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)); } -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator (comp, options) { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} +module.exports = hasPath; -function isX (id) { - return !id || id.toLowerCase() === 'x' || id === '*' -} -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceTilde(comp, options) - }).join(' ') -} +/***/ }), +/* 311 */, +/* 312 */ +/***/ (function(module) { -function replaceTilde (comp, options) { - var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, function (_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr) - var ret +module.exports = { + trueFunc: function trueFunc(){ + return true; + }, + falseFunc: function falseFunc(){ + return false; + } +}; - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else if (pr) { - debug('replaceTilde pr', pr) - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } else { - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } +/***/ }), +/* 313 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { - debug('tilde return', ret) - return ret - }) -} +"use strict"; -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceCaret(comp, options) - }).join(' ') +Object.defineProperty(exports, "__esModule", { value: true }); +const url = __webpack_require__(835); +function getProxyUrl(reqUrl) { + let usingSsl = reqUrl.protocol === 'https:'; + let proxyUrl; + if (checkBypass(reqUrl)) { + return proxyUrl; + } + let proxyVar; + if (usingSsl) { + proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY']; + } + else { + proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; + } + if (proxyVar) { + proxyUrl = url.parse(proxyVar); + } + return proxyUrl; } - -function replaceCaret (comp, options) { - debug('caret', comp, options) - var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - return comp.replace(r, function (_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr) - var ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - if (M === '0') { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else { - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + (+M + 1) + '.0.0' - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' +exports.getProxyUrl = getProxyUrl; +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; + if (!noProxy) { + return false; + } + // Determine the request port + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } + else if (reqUrl.protocol === 'http:') { + reqPort = 80; + } + else if (reqUrl.protocol === 'https:') { + reqPort = 443; + } + // Format the request hostname and hostname with port + let upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === 'number') { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + // Compare request host against noproxy + for (let upperNoProxyItem of noProxy + .split(',') + .map(x => x.trim().toUpperCase()) + .filter(x => x)) { + if (upperReqHosts.some(x => x === upperNoProxyItem)) { + return true; } - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0' - } } - - debug('caret return', ret) - return ret - }) + return false; } +exports.checkBypass = checkBypass; -function replaceXRanges (comp, options) { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map(function (comp) { - return replaceXRange(comp, options) - }).join(' ') -} -function replaceXRange (comp, options) { - comp = comp.trim() - var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, function (ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - var xM = isX(M) - var xm = xM || isX(m) - var xp = xm || isX(p) - var anyX = xp - - if (gtlt === '=' && anyX) { - gtlt = '' - } - - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 +/***/ }), +/* 314 */, +/* 315 */ +/***/ (function(module) { - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 +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 } - } - - ret = gtlt + M + '.' + m + '.' + p + pr - } else if (xm) { - ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr - } else if (xp) { - ret = '>=' + M + '.' + m + '.0' + pr + - ' <' + M + '.' + (+m + 1) + '.0' + pr - } - - debug('xRange return', ret) - - return ret - }) -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars (comp, options) { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], '') -} - -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = '>=' + fM + '.0.0' - } else if (isX(fp)) { - from = '>=' + fM + '.' + fm + '.0' - } else { - from = '>=' + from - } - - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = '<' + (+tM + 1) + '.0.0' - } else if (isX(tp)) { - to = '<' + tM + '.' + (+tm + 1) + '.0' - } else if (tpr) { - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr - } else { - to = '<=' + to - } - - return (from + ' ' + to).trim() -} - -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function (version) { - if (!version) { - return false - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false + }) } - } - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return 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 } } - return false } -function testSet (set, version, options) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } - - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === ANY) { - continue - } - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false - } - - return true -} -exports.satisfies = satisfies -function satisfies (version, range, options) { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} +/***/ }), +/* 316 */ +/***/ (function(module) { -exports.maxSatisfying = maxSatisfying -function maxSatisfying (versions, range, options) { - var max = null - var maxSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; -exports.minSatisfying = minSatisfying -function minSatisfying (versions, range, options) { - var min = null - var minSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null +/** + * 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); } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } + 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 min + return !predicate.apply(this, args); + }; } -exports.minVersion = minVersion -function minVersion (range, loose) { - range = new Range(range, loose) - - var minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } - - minver = null - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] +module.exports = negate; - comparators.forEach(function (comparator) { - // Clone to avoid manipulating the comparator's semver object. - var compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!minver || gt(minver, compver)) { - minver = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error('Unexpected operation: ' + comparator.operator) - } - }) - } - if (minver && range.test(minver)) { - return minver - } +/***/ }), +/* 317 */, +/* 318 */, +/* 319 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - return null -} +var baseIsNative = __webpack_require__(248), + getValue = __webpack_require__(879); -exports.validRange = validRange -function validRange (range, options) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } +/** + * 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; } -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr -function ltr (version, range, options) { - return outside(version, range, '<', options) -} +module.exports = getNative; -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr -function gtr (version, range, options) { - return outside(version, range, '>', options) -} -exports.outside = outside -function outside (version, range, hilo, options) { - version = new SemVer(version, options) - range = new Range(range, options) +/***/ }), +/* 320 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - var gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } +var basePick = __webpack_require__(362), + flatRest = __webpack_require__(521); - // If it satisifes the range it is not outside - if (satisfies(version, range, options)) { - return false - } +/** + * 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); +}); - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. +module.exports = pick; - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] - var high = null - var low = null +/***/ }), +/* 321 */, +/* 322 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - comparators.forEach(function (comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) +var baseCreate = __webpack_require__(782), + isObject = __webpack_require__(988); - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false +/** + * 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 the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; } -exports.prerelease = prerelease -function prerelease (version, options) { - var parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} +module.exports = createCtor; -exports.intersects = intersects -function intersects (r1, r2, options) { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} -exports.coerce = coerce -function coerce (version, options) { - if (version instanceof SemVer) { - return version - } +/***/ }), +/* 323 */, +/* 324 */, +/* 325 */, +/* 326 */, +/* 327 */, +/* 328 */, +/* 329 */, +/* 330 */, +/* 331 */, +/* 332 */, +/* 333 */, +/* 334 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { - if (typeof version === 'number') { - version = String(version) - } +"use strict"; - if (typeof version !== 'string') { - return null - } - options = options || {} +var DOCUMENT_MODE = __webpack_require__(141).DOCUMENT_MODE; - var match = null - if (!options.rtl) { - match = version.match(re[t.COERCE]) - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - var next - while ((next = re[t.COERCERTL].exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next - } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length - } - // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 - } +//Const +var VALID_DOCTYPE_NAME = 'html', + QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd', + QUIRKS_MODE_PUBLIC_ID_PREFIXES = [ + '+//silmaril//dtd html pro v0r11 19970101//en', + '-//advasoft ltd//dtd html 3.0 aswedit + extensions//en', + '-//as//dtd html 3.0 aswedit + extensions//en', + '-//ietf//dtd html 2.0 level 1//en', + '-//ietf//dtd html 2.0 level 2//en', + '-//ietf//dtd html 2.0 strict level 1//en', + '-//ietf//dtd html 2.0 strict level 2//en', + '-//ietf//dtd html 2.0 strict//en', + '-//ietf//dtd html 2.0//en', + '-//ietf//dtd html 2.1e//en', + '-//ietf//dtd html 3.0//en', + '-//ietf//dtd html 3.0//en//', + '-//ietf//dtd html 3.2 final//en', + '-//ietf//dtd html 3.2//en', + '-//ietf//dtd html 3//en', + '-//ietf//dtd html level 0//en', + '-//ietf//dtd html level 0//en//2.0', + '-//ietf//dtd html level 1//en', + '-//ietf//dtd html level 1//en//2.0', + '-//ietf//dtd html level 2//en', + '-//ietf//dtd html level 2//en//2.0', + '-//ietf//dtd html level 3//en', + '-//ietf//dtd html level 3//en//3.0', + '-//ietf//dtd html strict level 0//en', + '-//ietf//dtd html strict level 0//en//2.0', + '-//ietf//dtd html strict level 1//en', + '-//ietf//dtd html strict level 1//en//2.0', + '-//ietf//dtd html strict level 2//en', + '-//ietf//dtd html strict level 2//en//2.0', + '-//ietf//dtd html strict level 3//en', + '-//ietf//dtd html strict level 3//en//3.0', + '-//ietf//dtd html strict//en', + '-//ietf//dtd html strict//en//2.0', + '-//ietf//dtd html strict//en//3.0', + '-//ietf//dtd html//en', + '-//ietf//dtd html//en//2.0', + '-//ietf//dtd html//en//3.0', + '-//metrius//dtd metrius presentational//en', + '-//microsoft//dtd internet explorer 2.0 html strict//en', + '-//microsoft//dtd internet explorer 2.0 html//en', + '-//microsoft//dtd internet explorer 2.0 tables//en', + '-//microsoft//dtd internet explorer 3.0 html strict//en', + '-//microsoft//dtd internet explorer 3.0 html//en', + '-//microsoft//dtd internet explorer 3.0 tables//en', + '-//netscape comm. corp.//dtd html//en', + '-//netscape comm. corp.//dtd strict html//en', + '-//o\'reilly and associates//dtd html 2.0//en', + '-//o\'reilly and associates//dtd html extended 1.0//en', + '-//spyglass//dtd html 2.0 extended//en', + '-//sq//dtd html 2.0 hotmetal + extensions//en', + '-//sun microsystems corp.//dtd hotjava html//en', + '-//sun microsystems corp.//dtd hotjava strict html//en', + '-//w3c//dtd html 3 1995-03-24//en', + '-//w3c//dtd html 3.2 draft//en', + '-//w3c//dtd html 3.2 final//en', + '-//w3c//dtd html 3.2//en', + '-//w3c//dtd html 3.2s draft//en', + '-//w3c//dtd html 4.0 frameset//en', + '-//w3c//dtd html 4.0 transitional//en', + '-//w3c//dtd html experimental 19960712//en', + '-//w3c//dtd html experimental 970421//en', + '-//w3c//dtd w3 html//en', + '-//w3o//dtd w3 html 3.0//en', + '-//w3o//dtd w3 html 3.0//en//', + '-//webtechs//dtd mozilla html 2.0//en', + '-//webtechs//dtd mozilla html//en' + ], + QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIXES.concat([ + '-//w3c//dtd html 4.01 frameset//', + '-//w3c//dtd html 4.01 transitional//' + ]), + QUIRKS_MODE_PUBLIC_IDS = [ + '-//w3o//dtd w3 html strict 3.0//en//', + '-/w3c/dtd html 4.0 transitional/en', + 'html' + ], + LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = [ + '-//W3C//DTD XHTML 1.0 Frameset//', + '-//W3C//DTD XHTML 1.0 Transitional//' + ], + LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = LIMITED_QUIRKS_PUBLIC_ID_PREFIXES.concat([ + '-//W3C//DTD HTML 4.01 Frameset//', + '-//W3C//DTD HTML 4.01 Transitional//' + ]); - if (match === null) { - return null - } - return parse(match[2] + - '.' + (match[3] || '0') + - '.' + (match[4] || '0'), options) -} +//Utils +function enquoteDoctypeId(id) { + var quote = id.indexOf('"') !== -1 ? '\'' : '"'; + return quote + id + quote; +} -/***/ }), -/* 281 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +function hasPrefix(publicId, prefixes) { + for (var i = 0; i < prefixes.length; i++) { + if (publicId.indexOf(prefixes[i]) === 0) + return true; + } -var ElementType = __webpack_require__(855); + return false; +} -var re_whitespace = /\s+/g; -var NodePrototype = __webpack_require__(555); -var ElementPrototype = __webpack_require__(402); -function DomHandler(callback, options, elementCB){ - if(typeof callback === "object"){ - elementCB = options; - options = callback; - callback = null; - } else if(typeof options === "function"){ - elementCB = options; - options = defaultOpts; - } - this._callback = callback; - this._options = options || defaultOpts; - this._elementCB = elementCB; - this.dom = []; - this._done = false; - this._tagStack = []; - this._parser = this._parser || null; -} +//API +exports.getDocumentMode = function (name, publicId, systemId) { + if (name !== VALID_DOCTYPE_NAME) + return DOCUMENT_MODE.QUIRKS; -//default options -var defaultOpts = { - normalizeWhitespace: false, //Replace all whitespace with single spaces - withStartIndices: false, //Add startIndex properties to nodes - withEndIndices: false, //Add endIndex properties to nodes -}; + if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) + return DOCUMENT_MODE.QUIRKS; -DomHandler.prototype.onparserinit = function(parser){ - this._parser = parser; -}; + if (publicId !== null) { + publicId = publicId.toLowerCase(); -//Resets the handler back to starting state -DomHandler.prototype.onreset = function(){ - DomHandler.call(this, this._callback, this._options, this._elementCB); -}; + if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1) + return DOCUMENT_MODE.QUIRKS; -//Signals the handler that parsing is done -DomHandler.prototype.onend = function(){ - if(this._done) return; - this._done = true; - this._parser = null; - this._handleCallback(null); -}; + var prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES; -DomHandler.prototype._handleCallback = -DomHandler.prototype.onerror = function(error){ - if(typeof this._callback === "function"){ - this._callback(error, this.dom); - } else { - if(error) throw error; - } -}; + if (hasPrefix(publicId, prefixes)) + return DOCUMENT_MODE.QUIRKS; -DomHandler.prototype.onclosetag = function(){ - //if(this._tagStack.pop().name !== name) this._handleCallback(Error("Tagname didn't match!")); - - var elem = this._tagStack.pop(); + prefixes = systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES; - if(this._options.withEndIndices && elem){ - elem.endIndex = this._parser.endIndex; - } + if (hasPrefix(publicId, prefixes)) + return DOCUMENT_MODE.LIMITED_QUIRKS; + } - if(this._elementCB) this._elementCB(elem); + return DOCUMENT_MODE.NO_QUIRKS; }; -DomHandler.prototype._createDomElement = function(properties){ - if (!this._options.withDomLvl1) return properties; +exports.serializeContent = function (name, publicId, systemId) { + var str = '!DOCTYPE '; - var element; - if (properties.type === "tag") { - element = Object.create(ElementPrototype); - } else { - element = Object.create(NodePrototype); - } + if (name) + str += name; - for (var key in properties) { - if (properties.hasOwnProperty(key)) { - element[key] = properties[key]; - } - } + if (publicId !== null) + str += ' PUBLIC ' + enquoteDoctypeId(publicId); - return element; -}; + else if (systemId !== null) + str += ' SYSTEM'; -DomHandler.prototype._addDomElement = function(element){ - var parent = this._tagStack[this._tagStack.length - 1]; - var siblings = parent ? parent.children : this.dom; - var previousSibling = siblings[siblings.length - 1]; + if (systemId !== null) + str += ' ' + enquoteDoctypeId(systemId); - element.next = null; + return str; +}; - if(this._options.withStartIndices){ - element.startIndex = this._parser.startIndex; - } - if(this._options.withEndIndices){ - element.endIndex = this._parser.endIndex; - } - if(previousSibling){ - element.prev = previousSibling; - previousSibling.next = element; - } else { - element.prev = null; - } +/***/ }), +/* 335 */, +/* 336 */, +/* 337 */ +/***/ (function(module) { - siblings.push(element); - element.parent = parent || null; -}; +/** + * 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'; +} -DomHandler.prototype.onopentag = function(name, attribs){ - var properties = { - type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag, - name: name, - attribs: attribs, - children: [] - }; +module.exports = isObjectLike; - var element = this._createDomElement(properties); - this._addDomElement(element); +/***/ }), +/* 338 */ +/***/ (function(module) { - this._tagStack.push(element); -}; +/** + * 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); +} -DomHandler.prototype.ontext = function(data){ - //the ignoreWhitespace is officially dropped, but for now, - //it's an alias for normalizeWhitespace - var normalize = this._options.normalizeWhitespace || this._options.ignoreWhitespace; +module.exports = eq; - var lastTag; - if(!this._tagStack.length && this.dom.length && (lastTag = this.dom[this.dom.length-1]).type === ElementType.Text){ - if(normalize){ - lastTag.data = (lastTag.data + data).replace(re_whitespace, " "); - } else { - lastTag.data += data; - } - } else { - if( - this._tagStack.length && - (lastTag = this._tagStack[this._tagStack.length - 1]) && - (lastTag = lastTag.children[lastTag.children.length - 1]) && - lastTag.type === ElementType.Text - ){ - if(normalize){ - lastTag.data = (lastTag.data + data).replace(re_whitespace, " "); - } else { - lastTag.data += data; - } - } else { - if(normalize){ - data = data.replace(re_whitespace, " "); - } +/***/ }), +/* 339 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { - var element = this._createDomElement({ - data: data, - type: ElementType.Text - }); +"use strict"; - this._addDomElement(element); - } - } +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.urlDownloader = void 0; +const _base_1 = __webpack_require__(895); +exports.urlDownloader = { + label: "download a custom installer by URL", + provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { return !!inputs.installerUrl; }), + installerPath: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { + return { + localInstallerPath: yield _base_1.ensureLocalInstaller({ + url: inputs.installerUrl, + }), + options: Object.assign(Object.assign({}, options), { useBundled: false }), + }; + }), }; -DomHandler.prototype.oncomment = function(data){ - var lastTag = this._tagStack[this._tagStack.length - 1]; - - if(lastTag && lastTag.type === ElementType.Comment){ - lastTag.data += data; - return; - } - - var properties = { - data: data, - type: ElementType.Comment - }; - var element = this._createDomElement(properties); +/***/ }), +/* 340 */, +/* 341 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - this._addDomElement(element); - this._tagStack.push(element); -}; +var baseFor = __webpack_require__(354), + keys = __webpack_require__(863); -DomHandler.prototype.oncdatastart = function(){ - var properties = { - children: [{ - data: "", - type: ElementType.Text - }], - type: ElementType.CDATA - }; +/** + * 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); +} - var element = this._createDomElement(properties); +module.exports = baseForOwn; - this._addDomElement(element); - this._tagStack.push(element); -}; -DomHandler.prototype.oncommentend = DomHandler.prototype.oncdataend = function(){ - this._tagStack.pop(); -}; +/***/ }), +/* 342 */, +/* 343 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -DomHandler.prototype.onprocessinginstruction = function(name, data){ - var element = this._createDomElement({ - name: name, - data: data, - type: ElementType.Directive - }); +var isKeyable = __webpack_require__(511); - this._addDomElement(element); -}; +/** + * 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; +} -module.exports = DomHandler; +module.exports = getMapData; /***/ }), -/* 282 */, -/* 283 */, -/* 284 */, -/* 285 */, -/* 286 */, -/* 287 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +/* 344 */ +/***/ (function(module) { "use strict"; -// Ported from https://github.com/mafintosh/end-of-stream with -// permission from the author, Mathias Buus (@mafintosh). -var ERR_STREAM_PREMATURE_CLOSE = __webpack_require__(563).codes.ERR_STREAM_PREMATURE_CLOSE; -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; +function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); +} - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - callback.apply(this, args); - }; +function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); } -function noop() {} -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; +function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + + return [ sequence ]; } -function eos(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - callback = once(callback || noop); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - var onlegacyfinish = function onlegacyfinish() { - if (!stream.writable) onfinish(); - }; +function extend(target, source) { + var index, length, key, sourceKeys; - var writableEnded = stream._writableState && stream._writableState.finished; + if (source) { + sourceKeys = Object.keys(source); - var onfinish = function onfinish() { - writable = false; - writableEnded = true; - if (!readable) callback.call(stream); - }; + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } - var readableEnded = stream._readableState && stream._readableState.endEmitted; + return target; +} - var onend = function onend() { - readable = false; - readableEnded = true; - if (!writable) callback.call(stream); - }; - var onerror = function onerror(err) { - callback.call(stream, err); - }; +function repeat(string, count) { + var result = '', cycle; - var onclose = function onclose() { - var err; + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } + return result; +} - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; - var onrequest = function onrequest() { - stream.req.on('finish', onfinish); - }; +function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); +} - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest();else stream.on('request', onrequest); - } else if (writable && !stream._writableState) { - // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - return function () { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -} +module.exports.isNothing = isNothing; +module.exports.isObject = isObject; +module.exports.toArray = toArray; +module.exports.repeat = repeat; +module.exports.isNegativeZero = isNegativeZero; +module.exports.extend = extend; -module.exports = eos; /***/ }), -/* 288 */ +/* 345 */, +/* 346 */, +/* 347 */, +/* 348 */ /***/ (function(module) { /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. * * @private - * @param {Array} array The array to inspect. + * @param {Array} [array] The array to iterate over. * @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`. + * @returns {Array} Returns the new filtered array. */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; } } - return -1; + return result; } -module.exports = baseFindIndex; +module.exports = arrayFilter; /***/ }), -/* 289 */, -/* 290 */ +/* 349 */ +/***/ (function(module) { + +"use strict"; + + +module.exports = function mergeOptions(defaults, options) { + options = options || Object.create(null); + + return [defaults, options].reduce(function (merged, optObj) { + Object.keys(optObj).forEach(function (key) { + merged[key] = optObj[key]; + }); + + return merged; + }, Object.create(null)); +}; + + +/***/ }), +/* 350 */, +/* 351 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var isArray = __webpack_require__(143), - isSymbol = __webpack_require__(186); +var isPrototype = __webpack_require__(514), + nativeKeys = __webpack_require__(773); -/** Used to match property names within property paths. */ -var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/; +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Checks if `value` is a property name and not a property path. + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @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`. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ -function isKey(value, object) { - if (isArray(value)) { - return false; +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); + return result; } -module.exports = isKey; +module.exports = baseKeys; /***/ }), -/* 291 */ +/* 352 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var copyArray = __webpack_require__(239), - isIndex = __webpack_require__(160); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; +var baseGet = __webpack_require__(356); /** - * 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. + * A specialized version of `baseProperty` which supports deep paths. * * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. */ -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; +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; } -module.exports = reorder; +module.exports = basePropertyDeep; /***/ }), -/* 292 */ +/* 353 */, +/* 354 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var constant = __webpack_require__(817), - defineProperty = __webpack_require__(382), - identity = __webpack_require__(83); +var createBaseFor = __webpack_require__(795); /** - * The base implementation of `setToString` without support for hot loop shorting. + * 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 {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. + * @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 baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); -}; - -module.exports = baseSetToString; - +var baseFor = createBaseFor(); -/***/ }), -/* 293 */ -/***/ (function(module) { +module.exports = baseFor; -module.exports = require("buffer"); /***/ }), -/* 294 */, -/* 295 */ +/* 355 */, +/* 356 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var baseMatches = __webpack_require__(974), - baseMatchesProperty = __webpack_require__(728), - identity = __webpack_require__(83), - isArray = __webpack_require__(143), - property = __webpack_require__(927); +var castPath = __webpack_require__(929), + toKey = __webpack_require__(503); /** - * The base implementation of `_.iteratee`. + * The base implementation of `_.get` without support for default values. * * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. */ -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); +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 property(value); + return (index && index == length) ? object : undefined; } -module.exports = baseIteratee; +module.exports = baseGet; /***/ }), -/* 296 */, -/* 297 */ +/* 357 */ +/***/ (function(module) { + +module.exports = require("assert"); + +/***/ }), +/* 358 */, +/* 359 */, +/* 360 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var arrayMap = __webpack_require__(727), - baseIteratee = __webpack_require__(295), - baseMap = __webpack_require__(852), - isArray = __webpack_require__(143); +var baseHasIn = __webpack_require__(754), + hasPath = __webpack_require__(310); /** - * 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` + * Checks if `path` is a direct or inherited property of `object`. * * @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. + * @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 * - * function square(n) { - * return n * n; - * } + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * - * _.map([4, 8], square); - * // => [16, 64] + * _.hasIn(object, 'a'); + * // => true * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) + * _.hasIn(object, 'a.b'); + * // => true * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; + * _.hasIn(object, ['a', 'b']); + * // => true * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] + * _.hasIn(object, 'b'); + * // => false */ -function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, baseIteratee(iteratee, 3)); +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); } -module.exports = map; +module.exports = hasIn; /***/ }), -/* 298 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { +/* 361 */, +/* 362 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -"use strict"; +var basePickBy = __webpack_require__(86), + hasIn = __webpack_require__(360); +/** + * 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); + }); +} -var Tokenizer = __webpack_require__(990), - HTML = __webpack_require__(621); +module.exports = basePick; -//Aliases -var $ = HTML.TAG_NAMES, - NS = HTML.NAMESPACES, - ATTRS = HTML.ATTRS; +/***/ }), +/* 363 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -//MIME types -var MIME_TYPES = { - TEXT_HTML: 'text/html', - APPLICATION_XML: 'application/xhtml+xml' -}; +var baseAssignValue = __webpack_require__(772), + eq = __webpack_require__(338); -//Attributes -var DEFINITION_URL_ATTR = 'definitionurl', - ADJUSTED_DEFINITION_URL_ATTR = 'definitionURL', - SVG_ATTRS_ADJUSTMENT_MAP = { - 'attributename': 'attributeName', - 'attributetype': 'attributeType', - 'basefrequency': 'baseFrequency', - 'baseprofile': 'baseProfile', - 'calcmode': 'calcMode', - 'clippathunits': 'clipPathUnits', - 'diffuseconstant': 'diffuseConstant', - 'edgemode': 'edgeMode', - 'filterunits': 'filterUnits', - 'glyphref': 'glyphRef', - 'gradienttransform': 'gradientTransform', - 'gradientunits': 'gradientUnits', - 'kernelmatrix': 'kernelMatrix', - 'kernelunitlength': 'kernelUnitLength', - 'keypoints': 'keyPoints', - 'keysplines': 'keySplines', - 'keytimes': 'keyTimes', - 'lengthadjust': 'lengthAdjust', - 'limitingconeangle': 'limitingConeAngle', - 'markerheight': 'markerHeight', - 'markerunits': 'markerUnits', - 'markerwidth': 'markerWidth', - 'maskcontentunits': 'maskContentUnits', - 'maskunits': 'maskUnits', - 'numoctaves': 'numOctaves', - 'pathlength': 'pathLength', - 'patterncontentunits': 'patternContentUnits', - 'patterntransform': 'patternTransform', - 'patternunits': 'patternUnits', - 'pointsatx': 'pointsAtX', - 'pointsaty': 'pointsAtY', - 'pointsatz': 'pointsAtZ', - 'preservealpha': 'preserveAlpha', - 'preserveaspectratio': 'preserveAspectRatio', - 'primitiveunits': 'primitiveUnits', - 'refx': 'refX', - 'refy': 'refY', - 'repeatcount': 'repeatCount', - 'repeatdur': 'repeatDur', - 'requiredextensions': 'requiredExtensions', - 'requiredfeatures': 'requiredFeatures', - 'specularconstant': 'specularConstant', - 'specularexponent': 'specularExponent', - 'spreadmethod': 'spreadMethod', - 'startoffset': 'startOffset', - 'stddeviation': 'stdDeviation', - 'stitchtiles': 'stitchTiles', - 'surfacescale': 'surfaceScale', - 'systemlanguage': 'systemLanguage', - 'tablevalues': 'tableValues', - 'targetx': 'targetX', - 'targety': 'targetY', - 'textlength': 'textLength', - 'viewbox': 'viewBox', - 'viewtarget': 'viewTarget', - 'xchannelselector': 'xChannelSelector', - 'ychannelselector': 'yChannelSelector', - 'zoomandpan': 'zoomAndPan' - }, - XML_ATTRS_ADJUSTMENT_MAP = { - 'xlink:actuate': {prefix: 'xlink', name: 'actuate', namespace: NS.XLINK}, - 'xlink:arcrole': {prefix: 'xlink', name: 'arcrole', namespace: NS.XLINK}, - 'xlink:href': {prefix: 'xlink', name: 'href', namespace: NS.XLINK}, - 'xlink:role': {prefix: 'xlink', name: 'role', namespace: NS.XLINK}, - 'xlink:show': {prefix: 'xlink', name: 'show', namespace: NS.XLINK}, - 'xlink:title': {prefix: 'xlink', name: 'title', namespace: NS.XLINK}, - 'xlink:type': {prefix: 'xlink', name: 'type', namespace: NS.XLINK}, - 'xml:base': {prefix: 'xml', name: 'base', namespace: NS.XML}, - 'xml:lang': {prefix: 'xml', name: 'lang', namespace: NS.XML}, - 'xml:space': {prefix: 'xml', name: 'space', namespace: NS.XML}, - 'xmlns': {prefix: '', name: 'xmlns', namespace: NS.XMLNS}, - 'xmlns:xlink': {prefix: 'xmlns', name: 'xlink', namespace: NS.XMLNS} +/** Used for built-in method references. */ +var objectProto = Object.prototype; - }; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -//SVG tag names adjustment map -var SVG_TAG_NAMES_ADJUSTMENT_MAP = exports.SVG_TAG_NAMES_ADJUSTMENT_MAP = { - 'altglyph': 'altGlyph', - 'altglyphdef': 'altGlyphDef', - 'altglyphitem': 'altGlyphItem', - 'animatecolor': 'animateColor', - 'animatemotion': 'animateMotion', - 'animatetransform': 'animateTransform', - 'clippath': 'clipPath', - 'feblend': 'feBlend', - 'fecolormatrix': 'feColorMatrix', - 'fecomponenttransfer': 'feComponentTransfer', - 'fecomposite': 'feComposite', - 'feconvolvematrix': 'feConvolveMatrix', - 'fediffuselighting': 'feDiffuseLighting', - 'fedisplacementmap': 'feDisplacementMap', - 'fedistantlight': 'feDistantLight', - 'feflood': 'feFlood', - 'fefunca': 'feFuncA', - 'fefuncb': 'feFuncB', - 'fefuncg': 'feFuncG', - 'fefuncr': 'feFuncR', - 'fegaussianblur': 'feGaussianBlur', - 'feimage': 'feImage', - 'femerge': 'feMerge', - 'femergenode': 'feMergeNode', - 'femorphology': 'feMorphology', - 'feoffset': 'feOffset', - 'fepointlight': 'fePointLight', - 'fespecularlighting': 'feSpecularLighting', - 'fespotlight': 'feSpotLight', - 'fetile': 'feTile', - 'feturbulence': 'feTurbulence', - 'foreignobject': 'foreignObject', - 'glyphref': 'glyphRef', - 'lineargradient': 'linearGradient', - 'radialgradient': 'radialGradient', - 'textpath': 'textPath' -}; - -//Tags that causes exit from foreign content -var EXITS_FOREIGN_CONTENT = Object.create(null); - -EXITS_FOREIGN_CONTENT[$.B] = true; -EXITS_FOREIGN_CONTENT[$.BIG] = true; -EXITS_FOREIGN_CONTENT[$.BLOCKQUOTE] = true; -EXITS_FOREIGN_CONTENT[$.BODY] = true; -EXITS_FOREIGN_CONTENT[$.BR] = true; -EXITS_FOREIGN_CONTENT[$.CENTER] = true; -EXITS_FOREIGN_CONTENT[$.CODE] = true; -EXITS_FOREIGN_CONTENT[$.DD] = true; -EXITS_FOREIGN_CONTENT[$.DIV] = true; -EXITS_FOREIGN_CONTENT[$.DL] = true; -EXITS_FOREIGN_CONTENT[$.DT] = true; -EXITS_FOREIGN_CONTENT[$.EM] = true; -EXITS_FOREIGN_CONTENT[$.EMBED] = true; -EXITS_FOREIGN_CONTENT[$.H1] = true; -EXITS_FOREIGN_CONTENT[$.H2] = true; -EXITS_FOREIGN_CONTENT[$.H3] = true; -EXITS_FOREIGN_CONTENT[$.H4] = true; -EXITS_FOREIGN_CONTENT[$.H5] = true; -EXITS_FOREIGN_CONTENT[$.H6] = true; -EXITS_FOREIGN_CONTENT[$.HEAD] = true; -EXITS_FOREIGN_CONTENT[$.HR] = true; -EXITS_FOREIGN_CONTENT[$.I] = true; -EXITS_FOREIGN_CONTENT[$.IMG] = true; -EXITS_FOREIGN_CONTENT[$.LI] = true; -EXITS_FOREIGN_CONTENT[$.LISTING] = true; -EXITS_FOREIGN_CONTENT[$.MENU] = true; -EXITS_FOREIGN_CONTENT[$.META] = true; -EXITS_FOREIGN_CONTENT[$.NOBR] = true; -EXITS_FOREIGN_CONTENT[$.OL] = true; -EXITS_FOREIGN_CONTENT[$.P] = true; -EXITS_FOREIGN_CONTENT[$.PRE] = true; -EXITS_FOREIGN_CONTENT[$.RUBY] = true; -EXITS_FOREIGN_CONTENT[$.S] = true; -EXITS_FOREIGN_CONTENT[$.SMALL] = true; -EXITS_FOREIGN_CONTENT[$.SPAN] = true; -EXITS_FOREIGN_CONTENT[$.STRONG] = true; -EXITS_FOREIGN_CONTENT[$.STRIKE] = true; -EXITS_FOREIGN_CONTENT[$.SUB] = true; -EXITS_FOREIGN_CONTENT[$.SUP] = true; -EXITS_FOREIGN_CONTENT[$.TABLE] = true; -EXITS_FOREIGN_CONTENT[$.TT] = true; -EXITS_FOREIGN_CONTENT[$.U] = true; -EXITS_FOREIGN_CONTENT[$.UL] = true; -EXITS_FOREIGN_CONTENT[$.VAR] = true; - -//Check exit from foreign content -exports.causesExit = function (startTagToken) { - var tn = startTagToken.tagName; - var isFontWithAttrs = tn === $.FONT && (Tokenizer.getTokenAttr(startTagToken, ATTRS.COLOR) !== null || - Tokenizer.getTokenAttr(startTagToken, ATTRS.SIZE) !== null || - Tokenizer.getTokenAttr(startTagToken, ATTRS.FACE) !== null); - - return isFontWithAttrs ? true : EXITS_FOREIGN_CONTENT[tn]; -}; - -//Token adjustments -exports.adjustTokenMathMLAttrs = function (token) { - for (var i = 0; i < token.attrs.length; i++) { - if (token.attrs[i].name === DEFINITION_URL_ATTR) { - token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR; - break; - } - } -}; - -exports.adjustTokenSVGAttrs = function (token) { - for (var i = 0; i < token.attrs.length; i++) { - var adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; - - if (adjustedAttrName) - token.attrs[i].name = adjustedAttrName; - } -}; - -exports.adjustTokenXMLAttrs = function (token) { - for (var i = 0; i < token.attrs.length; i++) { - var adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; - - if (adjustedAttrEntry) { - token.attrs[i].prefix = adjustedAttrEntry.prefix; - token.attrs[i].name = adjustedAttrEntry.name; - token.attrs[i].namespace = adjustedAttrEntry.namespace; - } - } -}; - -exports.adjustTokenSVGTagName = function (token) { - var adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP[token.tagName]; - - if (adjustedTagName) - token.tagName = adjustedTagName; -}; - -//Integration points -function isMathMLTextIntegrationPoint(tn, ns) { - return ns === NS.MATHML && (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS || tn === $.MTEXT); +/** + * 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); + } } -function isHtmlIntegrationPoint(tn, ns, attrs) { - if (ns === NS.MATHML && tn === $.ANNOTATION_XML) { - for (var i = 0; i < attrs.length; i++) { - if (attrs[i].name === ATTRS.ENCODING) { - var value = attrs[i].value.toLowerCase(); +module.exports = assignValue; - return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML; - } - } - } - return ns === NS.SVG && (tn === $.FOREIGN_OBJECT || tn === $.DESC || tn === $.TITLE); -} +/***/ }), +/* 364 */, +/* 365 */, +/* 366 */, +/* 367 */, +/* 368 */, +/* 369 */, +/* 370 */, +/* 371 */, +/* 372 */, +/* 373 */, +/* 374 */, +/* 375 */, +/* 376 */, +/* 377 */, +/* 378 */, +/* 379 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -exports.isIntegrationPoint = function (tn, ns, attrs, foreignNS) { - if ((!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs)) - return true; +var getNative = __webpack_require__(319), + root = __webpack_require__(824); - if ((!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns)) - return true; +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); - return false; -}; +module.exports = WeakMap; /***/ }), -/* 299 */, -/* 300 */, -/* 301 */ +/* 380 */, +/* 381 */, +/* 382 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var isArrayLike = __webpack_require__(146), - isObjectLike = __webpack_require__(337); - -/** - * 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); -} - -module.exports = isArrayLikeObject; +var getNative = __webpack_require__(319); +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); -/***/ }), -/* 302 */, -/* 303 */, -/* 304 */ -/***/ (function(module) { +module.exports = defineProperty; -module.exports = require("string_decoder"); /***/ }), -/* 305 */ +/* 383 */, +/* 384 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var assignMergeValue = __webpack_require__(110), - cloneBuffer = __webpack_require__(744), - cloneTypedArray = __webpack_require__(422), - copyArray = __webpack_require__(239), - initCloneObject = __webpack_require__(66), - isArguments = __webpack_require__(460), - isArray = __webpack_require__(143), - isArrayLikeObject = __webpack_require__(301), - isBuffer = __webpack_require__(546), - isFunction = __webpack_require__(10), - isObject = __webpack_require__(323), - isPlainObject = __webpack_require__(585), - isTypedArray = __webpack_require__(850), - safeGet = __webpack_require__(807), - toPlainObject = __webpack_require__(808); +var LazyWrapper = __webpack_require__(922), + getData = __webpack_require__(418), + getFuncName = __webpack_require__(202), + lodash = __webpack_require__(751); /** - * 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. + * Checks if `func` has a lazy counterpart. * * @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. + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. */ -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); +function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; - 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 (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return 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); + if (func === other) { + return true; } - assignMergeValue(object, key, newValue); + var data = getData(other); + return !!data && func === data[0]; } -module.exports = baseMergeDeep; +module.exports = isLaziable; /***/ }), -/* 306 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -var inverseXML = getInverseObj(__webpack_require__(273)), - xmlReplacer = getInverseReplacer(inverseXML); - -exports.XML = getInverse(inverseXML, xmlReplacer); - -var inverseHTML = getInverseObj(__webpack_require__(252)), - htmlReplacer = getInverseReplacer(inverseHTML); - -exports.HTML = getInverse(inverseHTML, htmlReplacer); - -function getInverseObj(obj) { - return Object.keys(obj) - .sort() - .reduce(function(inverse, name) { - inverse[obj[name]] = "&" + name + ";"; - return inverse; - }, {}); -} - -function getInverseReplacer(inverse) { - var single = [], - multiple = []; - - Object.keys(inverse).forEach(function(k) { - if (k.length === 1) { - single.push("\\" + k); - } else { - multiple.push(k); - } - }); +/* 385 */, +/* 386 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - //TODO add ranges - multiple.unshift("[" + single.join("") + "]"); +"use strict"; - return new RegExp(multiple.join("|"), "g"); -} -var re_nonASCII = /[^\0-\x7F]/g, - re_astralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; +var Type = __webpack_require__(750); -function singleCharReplacer(c) { - return ( - "&#x" + - c - .charCodeAt(0) - .toString(16) - .toUpperCase() + - ";" - ); +function resolveJavascriptUndefined() { + return true; } -function astralReplacer(c) { - // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - var high = c.charCodeAt(0); - var low = c.charCodeAt(1); - var codePoint = (high - 0xd800) * 0x400 + low - 0xdc00 + 0x10000; - return "&#x" + codePoint.toString(16).toUpperCase() + ";"; +function constructJavascriptUndefined() { + /*eslint-disable no-undefined*/ + return undefined; } -function getInverse(inverse, re) { - function func(name) { - return inverse[name]; - } - - return function(data) { - return data - .replace(re, func) - .replace(re_astralSymbols, astralReplacer) - .replace(re_nonASCII, singleCharReplacer); - }; +function representJavascriptUndefined() { + return ''; } -var re_xmlChars = getInverseReplacer(inverseXML); - -function escapeXML(data) { - return data - .replace(re_xmlChars, singleCharReplacer) - .replace(re_astralSymbols, astralReplacer) - .replace(re_nonASCII, singleCharReplacer); +function isUndefined(object) { + return typeof object === 'undefined'; } -exports.escape = escapeXML; - - -/***/ }), -/* 307 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -var encode = __webpack_require__(306), - decode = __webpack_require__(253); - -exports.decode = function(data, level) { - return (!level || level <= 0 ? decode.XML : decode.HTML)(data); -}; - -exports.decodeStrict = function(data, level) { - return (!level || level <= 0 ? decode.XML : decode.HTMLStrict)(data); -}; - -exports.encode = function(data, level) { - return (!level || level <= 0 ? encode.XML : encode.HTML)(data); -}; - -exports.encodeXML = encode.XML; - -exports.encodeHTML4 = exports.encodeHTML5 = exports.encodeHTML = encode.HTML; - -exports.decodeXML = exports.decodeXMLStrict = decode.XML; - -exports.decodeHTML4 = exports.decodeHTML5 = exports.decodeHTML = decode.HTML; - -exports.decodeHTML4Strict = exports.decodeHTML5Strict = exports.decodeHTMLStrict = decode.HTMLStrict; - -exports.escape = encode.escape; +module.exports = new Type('tag:yaml.org,2002:js/undefined', { + kind: 'scalar', + resolve: resolveJavascriptUndefined, + construct: constructJavascriptUndefined, + predicate: isUndefined, + represent: representJavascriptUndefined +}); /***/ }), -/* 308 */, -/* 309 */, -/* 310 */ +/* 387 */, +/* 388 */, +/* 389 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var castPath = __webpack_require__(929), +var baseTimes = __webpack_require__(553), isArguments = __webpack_require__(460), isArray = __webpack_require__(143), + isBuffer = __webpack_require__(546), isIndex = __webpack_require__(160), - isLength = __webpack_require__(198), - toKey = __webpack_require__(503); + isTypedArray = __webpack_require__(850); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Checks if `path` exists on `object`. + * Creates an array of the enumerable property names of the array-like `value`. * * @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`. + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. */ -function hasPath(object, path, hasFunc) { - path = castPath(path, object); - - var index = -1, - length = path.length, - result = false; +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; - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; + 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); } - 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)); + return result; } -module.exports = hasPath; +module.exports = arrayLikeKeys; /***/ }), -/* 311 */, -/* 312 */ +/* 390 */, +/* 391 */ /***/ (function(module, __unusedexports, __webpack_require__) { -"use strict"; - +var arrayFilter = __webpack_require__(348), + baseFilter = __webpack_require__(793), + baseIteratee = __webpack_require__(295), + isArray = __webpack_require__(143); -var common = __webpack_require__(740); -var Type = __webpack_require__(945); +/** + * 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, baseIteratee(predicate, 3)); +} -var YAML_FLOAT_PATTERN = new RegExp( - // 2.5e4, 2.5 and integers - '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + - // .2e4, .2 - // special case, seems not from spec - '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + - // 20:59 - '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + - // .inf - '|[-+]?\\.(?:inf|Inf|INF)' + - // .nan - '|\\.(?:nan|NaN|NAN))$'); +module.exports = filter; -function resolveYamlFloat(data) { - if (data === null) return false; - if (!YAML_FLOAT_PATTERN.test(data) || - // Quick hack to not allow integers end with `_` - // Probably should update regexp & check speed - data[data.length - 1] === '_') { - return false; - } +/***/ }), +/* 392 */, +/* 393 */ +/***/ (function(module) { - return true; +/** + * 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)); + }; } -function constructYamlFloat(data) { - var value, sign, base, digits; +module.exports = overArg; - value = data.replace(/_/g, '').toLowerCase(); - sign = value[0] === '-' ? -1 : 1; - digits = []; - if ('+-'.indexOf(value[0]) >= 0) { - value = value.slice(1); - } +/***/ }), +/* 394 */, +/* 395 */, +/* 396 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - if (value === '.inf') { - return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; +"use strict"; - } else if (value === '.nan') { - return NaN; - } else if (value.indexOf(':') >= 0) { - value.split(':').forEach(function (v) { - digits.unshift(parseFloat(v, 10)); - }); +var WritableStream = __webpack_require__(413).Writable, + inherits = __webpack_require__(669).inherits, + Parser = __webpack_require__(60); - value = 0.0; - base = 1; +var ParserStream = module.exports = function (options) { + WritableStream.call(this); - digits.forEach(function (d) { - value += d * base; - base *= 60; - }); + this.parser = new Parser(options); - return sign * value; + this.lastChunkWritten = false; + this.writeCallback = null; + this.pausedByScript = false; - } - return sign * parseFloat(value, 10); -} + this.document = this.parser.treeAdapter.createDocument(); + this.pendingHtmlInsertions = []; -var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + this._resume = this._resume.bind(this); + this._documentWrite = this._documentWrite.bind(this); + this._scriptHandler = this._scriptHandler.bind(this); -function representYamlFloat(object, style) { - var res; + this.parser._bootstrap(this.document, null); +}; - if (isNaN(object)) { - switch (style) { - case 'lowercase': return '.nan'; - case 'uppercase': return '.NAN'; - case 'camelcase': return '.NaN'; - } - } else if (Number.POSITIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '.inf'; - case 'uppercase': return '.INF'; - case 'camelcase': return '.Inf'; - } - } else if (Number.NEGATIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '-.inf'; - case 'uppercase': return '-.INF'; - case 'camelcase': return '-.Inf'; +inherits(ParserStream, WritableStream); + +//WritableStream implementation +ParserStream.prototype._write = function (chunk, encoding, callback) { + this.writeCallback = callback; + this.parser.tokenizer.write(chunk.toString('utf8'), this.lastChunkWritten); + this._runParsingLoop(); +}; + +ParserStream.prototype.end = function (chunk, encoding, callback) { + this.lastChunkWritten = true; + WritableStream.prototype.end.call(this, chunk || '', encoding, callback); +}; + +//Scriptable parser implementation +ParserStream.prototype._runParsingLoop = function () { + this.parser.runParsingLoopForCurrentChunk(this.writeCallback, this._scriptHandler); +}; + +ParserStream.prototype._resume = function () { + if (!this.pausedByScript) + throw new Error('Parser was already resumed'); + + while (this.pendingHtmlInsertions.length) { + var html = this.pendingHtmlInsertions.pop(); + + this.parser.tokenizer.insertHtmlAtCurrentPos(html); } - } else if (common.isNegativeZero(object)) { - return '-0.0'; - } - res = object.toString(10); + this.pausedByScript = false; - // JS stringifier can build scientific format without dots: 5e-100, - // while YAML requres dot: 5.e-100. Fix it with simple hack + //NOTE: keep parsing if we don't wait for the next input chunk + if (this.parser.tokenizer.active) + this._runParsingLoop(); +}; - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; -} +ParserStream.prototype._documentWrite = function (html) { + if (!this.parser.stopped) + this.pendingHtmlInsertions.push(html); +}; -function isFloat(object) { - return (Object.prototype.toString.call(object) === '[object Number]') && - (object % 1 !== 0 || common.isNegativeZero(object)); -} +ParserStream.prototype._scriptHandler = function (scriptElement) { + if (this.listeners('script').length) { + this.pausedByScript = true; + this.emit('script', scriptElement, this._documentWrite, this._resume); + } + else + this._runParsingLoop(); +}; -module.exports = new Type('tag:yaml.org,2002:float', { - kind: 'scalar', - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: 'lowercase' -}); /***/ }), -/* 313 */, -/* 314 */, -/* 315 */ -/***/ (function(module) { +/* 397 */, +/* 398 */, +/* 399 */, +/* 400 */, +/* 401 */, +/* 402 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -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 - } - } -} +// DOM-Level-1-compliant structure +var NodePrototype = __webpack_require__(798); +var ElementPrototype = module.exports = Object.create(NodePrototype); + +var domLvl1 = { + tagName: "name" +}; + +Object.keys(domLvl1).forEach(function(key) { + var shorthand = domLvl1[key]; + Object.defineProperty(ElementPrototype, key, { + get: function() { + return this[shorthand] || null; + }, + set: function(val) { + this[shorthand] = val; + return val; + } + }); +}); /***/ }), -/* 316 */ -/***/ (function(module) { +/* 403 */, +/* 404 */, +/* 405 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; +var MapCache = __webpack_require__(978), + setCacheAdd = __webpack_require__(20), + setCacheHas = __webpack_require__(945); /** - * 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; - * } + * Creates an array cache object to store unique values. * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] + * @private + * @constructor + * @param {Array} [values] The values to cache. */ -function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); } - 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); - }; } -module.exports = negate; +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; /***/ }), -/* 317 */, -/* 318 */, -/* 319 */ +/* 406 */, +/* 407 */, +/* 408 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var baseIsNative = __webpack_require__(248), - getValue = __webpack_require__(879); +var Symbol = __webpack_require__(498), + isArguments = __webpack_require__(460), + isArray = __webpack_require__(143); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; /** - * Gets the native function at `key` of `object`. + * Checks if `value` is a flattenable `arguments` object or array. * * @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`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); } -module.exports = getNative; +module.exports = isFlattenable; /***/ }), -/* 320 */ +/* 409 */, +/* 410 */, +/* 411 */, +/* 412 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var basePick = __webpack_require__(362), - flatRest = __webpack_require__(521); +var baseGetTag = __webpack_require__(51), + isLength = __webpack_require__(611), + isObjectLike = __webpack_require__(337); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +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 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; /** - * 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 }; + * The base implementation of `_.isTypedArray` without Node.js optimizations. * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ -var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); -}); +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} -module.exports = pick; +module.exports = baseIsTypedArray; /***/ }), -/* 321 */, -/* 322 */ +/* 413 */ +/***/ (function(module) { + +module.exports = require("stream"); + +/***/ }), +/* 414 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var baseCreate = __webpack_require__(782), - isObject = __webpack_require__(323); +"use strict"; -/** - * 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; - }; -} -module.exports = createCtor; +var yaml = __webpack_require__(819); + + +module.exports = yaml; /***/ }), -/* 323 */ +/* 415 */, +/* 416 */, +/* 417 */ /***/ (function(module) { +module.exports = require("crypto"); + +/***/ }), +/* 418 */ +/***/ (function(module, __unusedexports, __webpack_require__) { + +var metaMap = __webpack_require__(156), + noop = __webpack_require__(439); + /** - * 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('')`) + * Gets metadata for `func`. * - * @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 + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); -} +var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); +}; -module.exports = isObject; +module.exports = getData; /***/ }), -/* 324 */, -/* 325 */, -/* 326 */, -/* 327 */, -/* 328 */, -/* 329 */, -/* 330 */, -/* 331 */, -/* 332 */, -/* 333 */, -/* 334 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { +/* 419 */, +/* 420 */, +/* 421 */, +/* 422 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -"use strict"; +var cloneArrayBuffer = __webpack_require__(600); +/** + * 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); +} -var DOCUMENT_MODE = __webpack_require__(621).DOCUMENT_MODE; +module.exports = cloneTypedArray; -//Const -var VALID_DOCTYPE_NAME = 'html', - QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd', - QUIRKS_MODE_PUBLIC_ID_PREFIXES = [ - '+//silmaril//dtd html pro v0r11 19970101//en', - '-//advasoft ltd//dtd html 3.0 aswedit + extensions//en', - '-//as//dtd html 3.0 aswedit + extensions//en', - '-//ietf//dtd html 2.0 level 1//en', - '-//ietf//dtd html 2.0 level 2//en', - '-//ietf//dtd html 2.0 strict level 1//en', - '-//ietf//dtd html 2.0 strict level 2//en', - '-//ietf//dtd html 2.0 strict//en', - '-//ietf//dtd html 2.0//en', - '-//ietf//dtd html 2.1e//en', - '-//ietf//dtd html 3.0//en', - '-//ietf//dtd html 3.0//en//', - '-//ietf//dtd html 3.2 final//en', - '-//ietf//dtd html 3.2//en', - '-//ietf//dtd html 3//en', - '-//ietf//dtd html level 0//en', - '-//ietf//dtd html level 0//en//2.0', - '-//ietf//dtd html level 1//en', - '-//ietf//dtd html level 1//en//2.0', - '-//ietf//dtd html level 2//en', - '-//ietf//dtd html level 2//en//2.0', - '-//ietf//dtd html level 3//en', - '-//ietf//dtd html level 3//en//3.0', - '-//ietf//dtd html strict level 0//en', - '-//ietf//dtd html strict level 0//en//2.0', - '-//ietf//dtd html strict level 1//en', - '-//ietf//dtd html strict level 1//en//2.0', - '-//ietf//dtd html strict level 2//en', - '-//ietf//dtd html strict level 2//en//2.0', - '-//ietf//dtd html strict level 3//en', - '-//ietf//dtd html strict level 3//en//3.0', - '-//ietf//dtd html strict//en', - '-//ietf//dtd html strict//en//2.0', - '-//ietf//dtd html strict//en//3.0', - '-//ietf//dtd html//en', - '-//ietf//dtd html//en//2.0', - '-//ietf//dtd html//en//3.0', - '-//metrius//dtd metrius presentational//en', - '-//microsoft//dtd internet explorer 2.0 html strict//en', - '-//microsoft//dtd internet explorer 2.0 html//en', - '-//microsoft//dtd internet explorer 2.0 tables//en', - '-//microsoft//dtd internet explorer 3.0 html strict//en', - '-//microsoft//dtd internet explorer 3.0 html//en', - '-//microsoft//dtd internet explorer 3.0 tables//en', - '-//netscape comm. corp.//dtd html//en', - '-//netscape comm. corp.//dtd strict html//en', - '-//o\'reilly and associates//dtd html 2.0//en', - '-//o\'reilly and associates//dtd html extended 1.0//en', - '-//spyglass//dtd html 2.0 extended//en', - '-//sq//dtd html 2.0 hotmetal + extensions//en', - '-//sun microsystems corp.//dtd hotjava html//en', - '-//sun microsystems corp.//dtd hotjava strict html//en', - '-//w3c//dtd html 3 1995-03-24//en', - '-//w3c//dtd html 3.2 draft//en', - '-//w3c//dtd html 3.2 final//en', - '-//w3c//dtd html 3.2//en', - '-//w3c//dtd html 3.2s draft//en', - '-//w3c//dtd html 4.0 frameset//en', - '-//w3c//dtd html 4.0 transitional//en', - '-//w3c//dtd html experimental 19960712//en', - '-//w3c//dtd html experimental 970421//en', - '-//w3c//dtd w3 html//en', - '-//w3o//dtd w3 html 3.0//en', - '-//w3o//dtd w3 html 3.0//en//', - '-//webtechs//dtd mozilla html 2.0//en', - '-//webtechs//dtd mozilla html//en' - ], - QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIXES.concat([ - '-//w3c//dtd html 4.01 frameset//', - '-//w3c//dtd html 4.01 transitional//' - ]), - QUIRKS_MODE_PUBLIC_IDS = [ - '-//w3o//dtd w3 html strict 3.0//en//', - '-/w3c/dtd html 4.0 transitional/en', - 'html' - ], - LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = [ - '-//W3C//DTD XHTML 1.0 Frameset//', - '-//W3C//DTD XHTML 1.0 Transitional//' - ], - LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = LIMITED_QUIRKS_PUBLIC_ID_PREFIXES.concat([ - '-//W3C//DTD HTML 4.01 Frameset//', - '-//W3C//DTD HTML 4.01 Transitional//' - ]); +/***/ }), +/* 423 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -//Utils -function enquoteDoctypeId(id) { - var quote = id.indexOf('"') !== -1 ? '\'' : '"'; +var getNative = __webpack_require__(319), + root = __webpack_require__(824); - return quote + id + quote; -} +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); -function hasPrefix(publicId, prefixes) { - for (var i = 0; i < prefixes.length; i++) { - if (publicId.indexOf(prefixes[i]) === 0) - return true; - } +module.exports = Set; - return false; -} +/***/ }), +/* 424 */, +/* 425 */, +/* 426 */, +/* 427 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -//API -exports.getDocumentMode = function (name, publicId, systemId) { - if (name !== VALID_DOCTYPE_NAME) - return DOCUMENT_MODE.QUIRKS; +module.exports = __webpack_require__(413); - if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) - return DOCUMENT_MODE.QUIRKS; - if (publicId !== null) { - publicId = publicId.toLowerCase(); +/***/ }), +/* 428 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1) - return DOCUMENT_MODE.QUIRKS; +var baseToString = __webpack_require__(280); - var prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES; +/** + * 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); +} - if (hasPrefix(publicId, prefixes)) - return DOCUMENT_MODE.QUIRKS; +module.exports = toString; - prefixes = systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES; - if (hasPrefix(publicId, prefixes)) - return DOCUMENT_MODE.LIMITED_QUIRKS; - } +/***/ }), +/* 429 */, +/* 430 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - return DOCUMENT_MODE.NO_QUIRKS; -}; +var apply = __webpack_require__(512); -exports.serializeContent = function (name, publicId, systemId) { - var str = '!DOCTYPE '; +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; - if (name) - str += name; +/** + * 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 (publicId !== null) - str += ' PUBLIC ' + enquoteDoctypeId(publicId); + 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); + }; +} - else if (systemId !== null) - str += ' SYSTEM'; +module.exports = overRest; - if (systemId !== null) - str += ' ' + enquoteDoctypeId(systemId); - return str; -}; +/***/ }), +/* 431 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const os = __importStar(__webpack_require__(87)); +const utils_1 = __webpack_require__(82); +/** + * Commands + * + * Command Format: + * ::name key=value,key=value::message + * + * Examples: + * ::warning::This is the message + * ::set-env name=MY_VAR::some value + */ +function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.EOL); +} +exports.issueCommand = issueCommand; +function issue(name, message = '') { + issueCommand(name, {}, message); +} +exports.issue = issue; +const CMD_STRING = '::'; +class Command { + constructor(command, properties, message) { + if (!command) { + command = 'missing.command'; + } + this.command = command; + this.properties = properties; + this.message = message; + } + toString() { + let cmdStr = CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += ' '; + let first = true; + for (const key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) { + first = false; + } + else { + cmdStr += ','; + } + cmdStr += `${key}=${escapeProperty(val)}`; + } + } + } + } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; + } +} +function escapeData(s) { + return utils_1.toCommandValue(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A'); +} +function escapeProperty(s) { + return utils_1.toCommandValue(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A') + .replace(/:/g, '%3A') + .replace(/,/g, '%2C'); +} +//# sourceMappingURL=command.js.map /***/ }), -/* 335 */, -/* 336 */, -/* 337 */ -/***/ (function(module) { +/* 432 */, +/* 433 */, +/* 434 */ +/***/ (function(module, __unusedexports, __webpack_require__) { + +var arrayFilter = __webpack_require__(348), + baseFilter = __webpack_require__(793), + baseIteratee = __webpack_require__(295), + isArray = __webpack_require__(143), + negate = __webpack_require__(316); /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. * * @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`. + * @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 * - * _.isObjectLike({}); - * // => true + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; * - * _.isObjectLike([1, 2, 3]); - * // => true + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] * - * _.isObjectLike(_.noop); - * // => false + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] * - * _.isObjectLike(null); - * // => false + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; +function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(baseIteratee(predicate, 3))); } -module.exports = isObjectLike; +module.exports = reject; /***/ }), -/* 338 */ +/* 435 */, +/* 436 */, +/* 437 */, +/* 438 */ /***/ (function(module) { /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. + * 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; +} + +module.exports = setToArray; + + +/***/ }), +/* 439 */ +/***/ (function(module) { + +/** + * This method returns `undefined`. * * @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`. + * @since 2.3.0 + * @category Util * @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 + * _.times(2, _.noop); + * // => [undefined, undefined] */ -function eq(value, other) { - return value === other || (value !== value && other !== other); +function noop() { + // No operation performed. } -module.exports = eq; +module.exports = noop; /***/ }), -/* 339 */ +/* 440 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var arrayEach = __webpack_require__(698), - arrayIncludes = __webpack_require__(260); +var memoizeCapped = __webpack_require__(138); -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - 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 to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; -/** 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] -]; +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; /** - * Updates wrapper `details` based on `bitmask` flags. + * Converts `string` to a property path array. * * @private - * @returns {Array} details The details to modify. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Array} Returns `details`. + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. */ -function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { - var value = '_.' + pair[0]; - if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { - details.push(value); - } +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 details.sort(); -} - -module.exports = updateWrapDetails; - - -/***/ }), -/* 340 */, -/* 341 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var baseFor = __webpack_require__(354), - keys = __webpack_require__(863); - -/** - * 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); -} - -module.exports = baseForOwn; - - -/***/ }), -/* 342 */, -/* 343 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var isKeyable = __webpack_require__(511); - -/** - * 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; -} + return result; +}); -module.exports = getMapData; +module.exports = stringToPath; /***/ }), -/* 344 */, -/* 345 */, -/* 346 */, -/* 347 */, -/* 348 */ +/* 441 */, +/* 442 */, +/* 443 */, +/* 444 */, +/* 445 */ /***/ (function(module) { /** - * A specialized version of `_.filter` for arrays without support for + * A specialized version of `_.reduce` 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. + * @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 arrayFilter(array, predicate) { +function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; + length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[++index]; + } while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } + accumulator = iteratee(accumulator, array[index], index, array); } - return result; + return accumulator; } -module.exports = arrayFilter; +module.exports = arrayReduce; /***/ }), -/* 349 */ -/***/ (function(module) { - -"use strict"; +/* 446 */, +/* 447 */, +/* 448 */, +/* 449 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { +var domEach = __webpack_require__(140).domEach, + _ = { + pick: __webpack_require__(320), + }; -module.exports = function mergeOptions(defaults, options) { - options = options || Object.create(null); +var toString = Object.prototype.toString; - return [defaults, options].reduce(function (merged, optObj) { - Object.keys(optObj).forEach(function (key) { - merged[key] = optObj[key]; - }); +/** + * Set / Get css. + * + * @param {String|Object} prop + * @param {String} val + * @return {self} + * @api public + */ - return merged; - }, Object.create(null)); +exports.css = function(prop, val) { + if (arguments.length === 2 || + // When `prop` is a "plain" object + (toString.call(prop) === '[object Object]')) { + return domEach(this, function(idx, el) { + setCss(el, prop, val, idx); + }); + } else { + return getCss(this[0], prop); + } }; +/** + * Set styles of all elements. + * + * @param {String|Object} prop + * @param {String} val + * @param {Number} idx - optional index within the selection + * @return {self} + * @api private + */ -/***/ }), -/* 350 */, -/* 351 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var isPrototype = __webpack_require__(514), - nativeKeys = __webpack_require__(773); +function setCss(el, prop, val, idx) { + if ('string' == typeof prop) { + var styles = getCss(el); + if (typeof val === 'function') { + val = val.call(el, idx, styles[prop]); + } -/** Used for built-in method references. */ -var objectProto = Object.prototype; + if (val === '') { + delete styles[prop]; + } else if (val != null) { + styles[prop] = val; + } -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + el.attribs.style = stringify(styles); + } else if ('object' == typeof prop) { + Object.keys(prop).forEach(function(k){ + setCss(el, k, prop[k]); + }); + } +} /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * Get parsed styles of the first element. * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * @param {String} prop + * @return {Object} + * @api private */ -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); - } + +function getCss(el, prop) { + var styles = parse(el.attribs.style); + if (typeof prop === 'string') { + return styles[prop]; + } else if (Array.isArray(prop)) { + return _.pick(styles, prop); + } else { + return styles; } - return result; } -module.exports = baseKeys; - - -/***/ }), -/* 352 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - - -var esprima; +/** + * Stringify `obj` to styles. + * + * @param {Object} obj + * @return {Object} + * @api private + */ -// Browserified version does not have esprima -// -// 1. For node.js just require module as deps -// 2. For browser try to require mudule via external AMD system. -// If not found - try to fallback to window.esprima. If not -// found too - then fail to parse. -// -try { - // workaround to exclude package from browserify list. - var _require = require; - esprima = _require('esprima'); -} catch (_) { - /* eslint-disable no-redeclare */ - /* global window */ - if (typeof window !== 'undefined') esprima = window.esprima; +function stringify(obj) { + return Object.keys(obj || {}) + .reduce(function(str, prop){ + return str += '' + + (str ? ' ' : '') + + prop + + ': ' + + obj[prop] + + ';'; + }, ''); } -var Type = __webpack_require__(945); - -function resolveJavascriptFunction(data) { - if (data === null) return false; +/** + * Parse `styles`. + * + * @param {String} styles + * @return {Object} + * @api private + */ - try { - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }); +function parse(styles) { + styles = (styles || '').trim(); - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - return false; - } + if (!styles) return {}; - return true; - } catch (err) { - return false; - } + return styles + .split(';') + .reduce(function(obj, str){ + var n = str.indexOf(':'); + // skip if there is no :, or if it is the first/last character + if (n < 1 || n === str.length-1) return obj; + obj[str.slice(0,n).trim()] = str.slice(n+1).trim(); + return obj; + }, {}); } -function constructJavascriptFunction(data) { - /*jslint evil:true*/ - - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - throw new Error('Failed to resolve function'); - } - - ast.body[0].expression.params.forEach(function (param) { - params.push(param.name); - }); - body = ast.body[0].expression.body.range; +/***/ }), +/* 450 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - // Esprima's ranges include the first '{' and the last '}' characters on - // function expressions. So cut them out. - if (ast.body[0].expression.body.type === 'BlockStatement') { - /*eslint-disable no-new-func*/ - return new Function(params, source.slice(body[0] + 1, body[1] - 1)); - } - // ES6 arrow functions can omit the BlockStatement. In that case, just return - // the body. - /*eslint-disable no-new-func*/ - return new Function(params, 'return ' + source.slice(body[0], body[1])); -} +"use strict"; -function representJavascriptFunction(object /*, style*/) { - return object.toString(); -} -function isFunction(object) { - return Object.prototype.toString.call(object) === '[object Function]'; -} +var Type = __webpack_require__(750); -module.exports = new Type('tag:yaml.org,2002:js/function', { +module.exports = new Type('tag:yaml.org,2002:str', { kind: 'scalar', - resolve: resolveJavascriptFunction, - construct: constructJavascriptFunction, - predicate: isFunction, - represent: representJavascriptFunction + construct: function (data) { return data !== null ? data : ''; } }); /***/ }), -/* 353 */, -/* 354 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var createBaseFor = __webpack_require__(795); +/* 451 */ +/***/ (function(module) { /** - * 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`. + * This method returns `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(); - -module.exports = baseFor; - - -/***/ }), -/* 355 */, -/* 356 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var castPath = __webpack_require__(929), - toKey = __webpack_require__(503); - -/** - * The base implementation of `_.get` without support for default values. + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. + * _.times(2, _.stubFalse); + * // => [false, false] */ -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; +function stubFalse() { + return false; } -module.exports = baseGet; +module.exports = stubFalse; /***/ }), -/* 357 */ +/* 452 */, +/* 453 */, +/* 454 */, +/* 455 */ /***/ (function(module) { -module.exports = require("assert"); - -/***/ }), -/* 358 */, -/* 359 */, -/* 360 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var baseHasIn = __webpack_require__(754), - hasPath = __webpack_require__(310); - /** - * 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 + * The base implementation of `_.isNaN` without support for number objects. * - * _.hasIn(object, 'b'); - * // => false + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ -function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); +function baseIsNaN(value) { + return value !== value; } -module.exports = hasIn; +module.exports = baseIsNaN; /***/ }), -/* 361 */, -/* 362 */ +/* 456 */, +/* 457 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var basePickBy = __webpack_require__(21), - hasIn = __webpack_require__(360); +var arrayEach = __webpack_require__(698), + arrayIncludes = __webpack_require__(260); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + 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 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] +]; /** - * The base implementation of `_.pick` without support for individual - * property identifiers. + * Updates wrapper `details` based on `bitmask` flags. * * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @returns {Object} Returns the new object. + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. */ -function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { - return hasIn(object, path); +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(); } -module.exports = basePick; +module.exports = updateWrapDetails; /***/ }), -/* 363 */ +/* 458 */, +/* 459 */, +/* 460 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var baseAssignValue = __webpack_require__(772), - eq = __webpack_require__(338); +var baseIsArguments = __webpack_require__(208), + isObjectLike = __webpack_require__(337); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -16793,3407 +16905,4422 @@ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + /** - * 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. + * Checks if `value` is likely an `arguments` object. * - * @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); - } -} + * @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'); +}; -module.exports = assignValue; +module.exports = isArguments; /***/ }), -/* 364 */, -/* 365 */, -/* 366 */, -/* 367 */, -/* 368 */, -/* 369 */, -/* 370 */, -/* 371 */, -/* 372 */, -/* 373 */, -/* 374 */, -/* 375 */, -/* 376 */, -/* 377 */, -/* 378 */, -/* 379 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +/* 461 */, +/* 462 */, +/* 463 */, +/* 464 */, +/* 465 */, +/* 466 */, +/* 467 */, +/* 468 */ +/***/ (function(__unusedmodule, exports) { -var getNative = __webpack_require__(319), - root = __webpack_require__(824); +"use strict"; -/* Built-in method references that are verified to be native. */ -var WeakMap = getNative(root, 'WeakMap'); +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bundledMinicondaUser = void 0; +exports.bundledMinicondaUser = { + label: "use bundled Miniconda", + provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { + return (inputs.minicondaVersion === "" && + inputs.architecture === "x64" && + inputs.installerUrl === ""); + }), + installerPath: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { + return { + localInstallerPath: "", + options: Object.assign(Object.assign({}, options), { useBundled: true }), + }; + }), +}; -module.exports = WeakMap; +/***/ }), +/* 469 */, +/* 470 */ +/***/ (function(__unusedmodule, exports, __webpack_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 __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const command_1 = __webpack_require__(431); +const file_command_1 = __webpack_require__(102); +const utils_1 = __webpack_require__(82); +const os = __importStar(__webpack_require__(87)); +const path = __importStar(__webpack_require__(622)); +/** + * The code to exit an action + */ +var ExitCode; +(function (ExitCode) { + /** + * A code indicating that the action was successful + */ + ExitCode[ExitCode["Success"] = 0] = "Success"; + /** + * A code indicating that the action was a failure + */ + ExitCode[ExitCode["Failure"] = 1] = "Failure"; +})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); +//----------------------------------------------------------------------- +// Variables +//----------------------------------------------------------------------- +/** + * Sets env variable for this action and future actions in the job + * @param name the name of the variable to set + * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function exportVariable(name, val) { + const convertedVal = utils_1.toCommandValue(val); + process.env[name] = convertedVal; + const filePath = process.env['GITHUB_ENV'] || ''; + if (filePath) { + const delimiter = '_GitHubActionsFileCommandDelimeter_'; + const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; + file_command_1.issueCommand('ENV', commandValue); + } + else { + command_1.issueCommand('set-env', { name }, convertedVal); + } +} +exports.exportVariable = exportVariable; +/** + * Registers a secret which will get masked from logs + * @param secret value of the secret + */ +function setSecret(secret) { + command_1.issueCommand('add-mask', {}, secret); +} +exports.setSecret = setSecret; +/** + * Prepends inputPath to the PATH (for this action and future actions) + * @param inputPath + */ +function addPath(inputPath) { + const filePath = process.env['GITHUB_PATH'] || ''; + if (filePath) { + file_command_1.issueCommand('PATH', inputPath); + } + else { + command_1.issueCommand('add-path', {}, inputPath); + } + process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; +} +exports.addPath = addPath; +/** + * Gets the value of an input. The value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string + */ +function getInput(name, options) { + const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; + if (options && options.required && !val) { + throw new Error(`Input required and not supplied: ${name}`); + } + return val.trim(); +} +exports.getInput = getInput; +/** + * Sets the value of an output. + * + * @param name name of the output to set + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function setOutput(name, value) { + command_1.issueCommand('set-output', { name }, value); +} +exports.setOutput = setOutput; +/** + * Enables or disables the echoing of commands into stdout for the rest of the step. + * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. + * + */ +function setCommandEcho(enabled) { + command_1.issue('echo', enabled ? 'on' : 'off'); +} +exports.setCommandEcho = setCommandEcho; +//----------------------------------------------------------------------- +// Results +//----------------------------------------------------------------------- +/** + * Sets the action status to failed. + * When the action exits it will be with an exit code of 1 + * @param message add error issue message + */ +function setFailed(message) { + process.exitCode = ExitCode.Failure; + error(message); +} +exports.setFailed = setFailed; +//----------------------------------------------------------------------- +// Logging Commands +//----------------------------------------------------------------------- +/** + * Gets whether Actions Step Debug is on or not + */ +function isDebug() { + return process.env['RUNNER_DEBUG'] === '1'; +} +exports.isDebug = isDebug; +/** + * Writes debug message to user log + * @param message debug message + */ +function debug(message) { + command_1.issueCommand('debug', {}, message); +} +exports.debug = debug; +/** + * Adds an error issue + * @param message error issue message. Errors will be converted to string via toString() + */ +function error(message) { + command_1.issue('error', message instanceof Error ? message.toString() : message); +} +exports.error = error; +/** + * Adds an warning issue + * @param message warning issue message. Errors will be converted to string via toString() + */ +function warning(message) { + command_1.issue('warning', message instanceof Error ? message.toString() : message); +} +exports.warning = warning; +/** + * Writes info to log with console.log. + * @param message info message + */ +function info(message) { + process.stdout.write(message + os.EOL); +} +exports.info = info; +/** + * Begin an output group. + * + * Output until the next `groupEnd` will be foldable in this group + * + * @param name The name of the output group + */ +function startGroup(name) { + command_1.issue('group', name); +} +exports.startGroup = startGroup; +/** + * End an output group. + */ +function endGroup() { + command_1.issue('endgroup'); +} +exports.endGroup = endGroup; +/** + * Wrap an asynchronous function call in a group. + * + * Returns the same type as the function itself. + * + * @param name The name of the group + * @param fn The function to wrap in the group + */ +function group(name, fn) { + return __awaiter(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } + finally { + endGroup(); + } + return result; + }); +} +exports.group = group; +//----------------------------------------------------------------------- +// Wrapper action state +//----------------------------------------------------------------------- +/** + * Saves state for current action, the state can only be retrieved by this action's post job execution. + * + * @param name name of the state to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function saveState(name, value) { + command_1.issueCommand('save-state', { name }, value); +} +exports.saveState = saveState; +/** + * Gets the value of an state set by this action's main execution. + * + * @param name name of the state to get + * @returns string + */ +function getState(name) { + return process.env[`STATE_${name}`] || ''; +} +exports.getState = getState; +//# sourceMappingURL=core.js.map /***/ }), -/* 380 */, -/* 381 */, -/* 382 */ +/* 471 */, +/* 472 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var getNative = __webpack_require__(319); +var assignValue = __webpack_require__(363), + copyObject = __webpack_require__(875), + createAssigner = __webpack_require__(797), + isArrayLike = __webpack_require__(146), + isPrototype = __webpack_require__(514), + keys = __webpack_require__(863); -var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} -}()); +/** Used for built-in method references. */ +var objectProto = Object.prototype; -module.exports = defineProperty; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * 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]); + } + } +}); + +module.exports = assign; /***/ }), -/* 383 */, -/* 384 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +/* 473 */ +/***/ (function(module) { -var LazyWrapper = __webpack_require__(798), - getData = __webpack_require__(418), - getFuncName = __webpack_require__(202), - lodash = __webpack_require__(751); +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; /** - * Checks if `func` has a lazy counterpart. + * Converts `func` to its source code. * * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, - * else `false`. + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. */ -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; +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} } - var data = getData(other); - return !!data && func === data[0]; + return ''; } -module.exports = isLaziable; +module.exports = toSource; /***/ }), -/* 385 */, -/* 386 */ +/* 474 */, +/* 475 */, +/* 476 */, +/* 477 */, +/* 478 */, +/* 479 */, +/* 480 */, +/* 481 */, +/* 482 */, +/* 483 */, +/* 484 */, +/* 485 */, +/* 486 */, +/* 487 */, +/* 488 */, +/* 489 */, +/* 490 */, +/* 491 */, +/* 492 */, +/* 493 */, +/* 494 */ /***/ (function(module, __unusedexports, __webpack_require__) { -"use strict"; +var rng = __webpack_require__(139); +var bytesToUuid = __webpack_require__(722); +function v4(options, buf, offset) { + var i = buf && offset || 0; -var Type = __webpack_require__(945); + if (typeof(options) == 'string') { + buf = options === 'binary' ? new Array(16) : null; + options = null; + } + options = options || {}; -function resolveJavascriptUndefined() { - return true; -} + var rnds = options.random || (options.rng || rng)(); -function constructJavascriptUndefined() { - /*eslint-disable no-undefined*/ - return undefined; -} + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; -function representJavascriptUndefined() { - return ''; -} + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ++ii) { + buf[i + ii] = rnds[ii]; + } + } -function isUndefined(object) { - return typeof object === 'undefined'; + return buf || bytesToUuid(rnds); } -module.exports = new Type('tag:yaml.org,2002:js/undefined', { - kind: 'scalar', - resolve: resolveJavascriptUndefined, - construct: constructJavascriptUndefined, - predicate: isUndefined, - represent: representJavascriptUndefined -}); +module.exports = v4; /***/ }), -/* 387 */, -/* 388 */, -/* 389 */ +/* 495 */, +/* 496 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var baseTimes = __webpack_require__(553), - isArguments = __webpack_require__(460), - isArray = __webpack_require__(143), - isBuffer = __webpack_require__(546), - isIndex = __webpack_require__(160), - isTypedArray = __webpack_require__(850); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +var arrayPush = __webpack_require__(883), + isFlattenable = __webpack_require__(408); /** - * Creates an array of the enumerable property names of the array-like `value`. + * The base implementation of `_.flatten` with support for restricting flattening. * * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. + * @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 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; +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.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); + 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; } -module.exports = arrayLikeKeys; +module.exports = baseFlatten; /***/ }), -/* 390 */, -/* 391 */ +/* 497 */, +/* 498 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var arrayFilter = __webpack_require__(348), - baseFilter = __webpack_require__(793), - baseIteratee = __webpack_require__(295), - isArray = __webpack_require__(143); - -/** - * 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, baseIteratee(predicate, 3)); -} - -module.exports = filter; - - -/***/ }), -/* 392 */, -/* 393 */ -/***/ (function(module) { +var root = __webpack_require__(824); -/** - * 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)); - }; -} +/** Built-in value references. */ +var Symbol = root.Symbol; -module.exports = overArg; +module.exports = Symbol; /***/ }), -/* 394 */, -/* 395 */, -/* 396 */ +/* 499 */, +/* 500 */, +/* 501 */, +/* 502 */ /***/ (function(module, __unusedexports, __webpack_require__) { -"use strict"; - - -var WritableStream = __webpack_require__(413).Writable, - inherits = __webpack_require__(669).inherits, - Parser = __webpack_require__(60); - -var ParserStream = module.exports = function (options) { - WritableStream.call(this); - - this.parser = new Parser(options); - - this.lastChunkWritten = false; - this.writeCallback = null; - this.pausedByScript = false; - - this.document = this.parser.treeAdapter.createDocument(); - - this.pendingHtmlInsertions = []; - - this._resume = this._resume.bind(this); - this._documentWrite = this._documentWrite.bind(this); - this._scriptHandler = this._scriptHandler.bind(this); +/* + Module dependencies +*/ +var ElementType = __webpack_require__(855); +var entities = __webpack_require__(307); - this.parser._bootstrap(this.document, null); +var unencodedElements = { + __proto__: null, + style: true, + script: true, + xmp: true, + iframe: true, + noembed: true, + noframes: true, + plaintext: true, + noscript: true }; -inherits(ParserStream, WritableStream); +/* + Format attributes +*/ +function formatAttrs(attributes, opts) { + if (!attributes) return; -//WritableStream implementation -ParserStream.prototype._write = function (chunk, encoding, callback) { - this.writeCallback = callback; - this.parser.tokenizer.write(chunk.toString('utf8'), this.lastChunkWritten); - this._runParsingLoop(); -}; + var output = '', + value; -ParserStream.prototype.end = function (chunk, encoding, callback) { - this.lastChunkWritten = true; - WritableStream.prototype.end.call(this, chunk || '', encoding, callback); -}; + // Loop through the attributes + for (var key in attributes) { + value = attributes[key]; + if (output) { + output += ' '; + } -//Scriptable parser implementation -ParserStream.prototype._runParsingLoop = function () { - this.parser.runParsingLoopForCurrentChunk(this.writeCallback, this._scriptHandler); -}; + output += key; + if ((value !== null && value !== '') || opts.xmlMode) { + output += '="' + (opts.decodeEntities ? entities.encodeXML(value) : value) + '"'; + } + } -ParserStream.prototype._resume = function () { - if (!this.pausedByScript) - throw new Error('Parser was already resumed'); + return output; +} - while (this.pendingHtmlInsertions.length) { - var html = this.pendingHtmlInsertions.pop(); +/* + Self-enclosing tags (stolen from node-htmlparser) +*/ +var singleTag = { + __proto__: null, + area: true, + base: true, + basefont: true, + br: true, + col: true, + command: true, + embed: true, + frame: true, + hr: true, + img: true, + input: true, + isindex: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true, +}; - this.parser.tokenizer.insertHtmlAtCurrentPos(html); - } - this.pausedByScript = false; +var render = module.exports = function(dom, opts) { + if (!Array.isArray(dom) && !dom.cheerio) dom = [dom]; + opts = opts || {}; - //NOTE: keep parsing if we don't wait for the next input chunk - if (this.parser.tokenizer.active) - this._runParsingLoop(); -}; + var output = ''; -ParserStream.prototype._documentWrite = function (html) { - if (!this.parser.stopped) - this.pendingHtmlInsertions.push(html); -}; + for(var i = 0; i < dom.length; i++){ + var elem = dom[i]; -ParserStream.prototype._scriptHandler = function (scriptElement) { - if (this.listeners('script').length) { - this.pausedByScript = true; - this.emit('script', scriptElement, this._documentWrite, this._resume); - } + if (elem.type === 'root') + output += render(elem.children, opts); + else if (ElementType.isTag(elem)) + output += renderTag(elem, opts); + else if (elem.type === ElementType.Directive) + output += renderDirective(elem); + else if (elem.type === ElementType.Comment) + output += renderComment(elem); + else if (elem.type === ElementType.CDATA) + output += renderCdata(elem); else - this._runParsingLoop(); -}; - + output += renderText(elem, opts); + } + return output; +}; -/***/ }), -/* 397 */, -/* 398 */, -/* 399 */, -/* 400 */, -/* 401 */, -/* 402 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +function renderTag(elem, opts) { + // Handle SVG + if (elem.name === "svg") opts = {decodeEntities: opts.decodeEntities, xmlMode: true}; -// DOM-Level-1-compliant structure -var NodePrototype = __webpack_require__(555); -var ElementPrototype = module.exports = Object.create(NodePrototype); + var tag = '<' + elem.name, + attribs = formatAttrs(elem.attribs, opts); -var domLvl1 = { - tagName: "name" -}; + if (attribs) { + tag += ' ' + attribs; + } -Object.keys(domLvl1).forEach(function(key) { - var shorthand = domLvl1[key]; - Object.defineProperty(ElementPrototype, key, { - get: function() { - return this[shorthand] || null; - }, - set: function(val) { - this[shorthand] = val; - return val; - } - }); -}); + if ( + opts.xmlMode + && (!elem.children || elem.children.length === 0) + ) { + tag += '/>'; + } else { + tag += '>'; + if (elem.children) { + tag += render(elem.children, opts); + } + if (!singleTag[elem.name] || opts.xmlMode) { + tag += ''; + } + } -/***/ }), -/* 403 */, -/* 404 */, -/* 405 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + return tag; +} -var MapCache = __webpack_require__(978), - setCacheAdd = __webpack_require__(20), - setCacheHas = __webpack_require__(657); +function renderDirective(elem) { + return '<' + elem.data + '>'; +} -/** - * - * 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; +function renderText(elem, opts) { + var data = elem.data || ''; - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); + // if entities weren't decoded, no need to encode them back + if (opts.decodeEntities && !(elem.parent && elem.parent.name in unencodedElements)) { + data = entities.encodeXML(data); } + + return data; } -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; +function renderCdata(elem) { + return ''; +} -module.exports = SetCache; +function renderComment(elem) { + return ''; +} /***/ }), -/* 406 */, -/* 407 */, -/* 408 */ +/* 503 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var Symbol = __webpack_require__(498), - isArguments = __webpack_require__(460), - isArray = __webpack_require__(143); +var isSymbol = __webpack_require__(186); -/** Built-in value references. */ -var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; /** - * Checks if `value` is a flattenable `arguments` object or array. + * Converts `value` to a string key if it's not a string or symbol. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. */ -function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } -module.exports = isFlattenable; +module.exports = toKey; /***/ }), -/* 409 */, -/* 410 */, -/* 411 */, -/* 412 */ +/* 504 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var baseGetTag = __webpack_require__(51), - isLength = __webpack_require__(198), - isObjectLike = __webpack_require__(337); +var DomHandler = __webpack_require__(281); +var DomUtils = __webpack_require__(104); -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; +//TODO: make this a streamable handler +function FeedHandler(callback, options) { + this.init(callback, options); +} -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]'; +__webpack_require__(689)(FeedHandler, DomHandler); -/** 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; +FeedHandler.prototype.init = DomHandler; -/** - * 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)]; +function getElements(what, where) { + return DomUtils.getElementsByTagName(what, where, true); +} +function getOneElement(what, where) { + return DomUtils.getElementsByTagName(what, where, true, 1)[0]; +} +function fetch(what, where, recurse) { + return DomUtils.getText( + DomUtils.getElementsByTagName(what, where, recurse, 1) + ).trim(); } -module.exports = baseIsTypedArray; - +function addConditionally(obj, prop, what, where, recurse) { + var tmp = fetch(what, where, recurse); + if (tmp) obj[prop] = tmp; +} -/***/ }), -/* 413 */ -/***/ (function(module) { +var isValidFeed = function(value) { + return value === "rss" || value === "feed" || value === "rdf:RDF"; +}; -module.exports = require("stream"); +FeedHandler.prototype.onend = function() { + var feed = {}, + feedRoot = getOneElement(isValidFeed, this.dom), + tmp, + childs; -/***/ }), -/* 414 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + if (feedRoot) { + if (feedRoot.name === "feed") { + childs = feedRoot.children; -"use strict"; + feed.type = "atom"; + addConditionally(feed, "id", "id", childs); + addConditionally(feed, "title", "title", childs); + if ( + (tmp = getOneElement("link", childs)) && + (tmp = tmp.attribs) && + (tmp = tmp.href) + ) + feed.link = tmp; + addConditionally(feed, "description", "subtitle", childs); + if ((tmp = fetch("updated", childs))) feed.updated = new Date(tmp); + addConditionally(feed, "author", "email", childs, true); + feed.items = getElements("entry", childs).map(function(item) { + var entry = {}, + tmp; + item = item.children; -var yaml = __webpack_require__(819); - - -module.exports = yaml; - - -/***/ }), -/* 415 */, -/* 416 */, -/* 417 */ -/***/ (function(module) { - -module.exports = require("crypto"); - -/***/ }), -/* 418 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var metaMap = __webpack_require__(156), - noop = __webpack_require__(439); - -/** - * 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); -}; - -module.exports = getData; - - -/***/ }), -/* 419 */, -/* 420 */, -/* 421 */, -/* 422 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var cloneArrayBuffer = __webpack_require__(600); - -/** - * 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); -} - -module.exports = cloneTypedArray; - - -/***/ }), -/* 423 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var getNative = __webpack_require__(319), - root = __webpack_require__(824); - -/* Built-in method references that are verified to be native. */ -var Set = getNative(root, 'Set'); - -module.exports = Set; - - -/***/ }), -/* 424 */, -/* 425 */, -/* 426 */, -/* 427 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = __webpack_require__(413); - - -/***/ }), -/* 428 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var baseToString = __webpack_require__(99); - -/** - * 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); -} - -module.exports = toString; - - -/***/ }), -/* 429 */, -/* 430 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + addConditionally(entry, "id", "id", item); + addConditionally(entry, "title", "title", item); + if ( + (tmp = getOneElement("link", item)) && + (tmp = tmp.attribs) && + (tmp = tmp.href) + ) + entry.link = tmp; + if ((tmp = fetch("summary", item) || fetch("content", item))) + entry.description = tmp; + if ((tmp = fetch("updated", item))) + entry.pubDate = new Date(tmp); + return entry; + }); + } else { + childs = getOneElement("channel", feedRoot.children).children; -var apply = __webpack_require__(512); + feed.type = feedRoot.name.substr(0, 3); + feed.id = ""; + addConditionally(feed, "title", "title", childs); + addConditionally(feed, "link", "link", childs); + addConditionally(feed, "description", "description", childs); + if ((tmp = fetch("lastBuildDate", childs))) + feed.updated = new Date(tmp); + addConditionally(feed, "author", "managingEditor", childs, true); -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; + feed.items = getElements("item", feedRoot.children).map(function( + item + ) { + var entry = {}, + tmp; -/** - * 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); + item = item.children; - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; + addConditionally(entry, "id", "guid", item); + addConditionally(entry, "title", "title", item); + addConditionally(entry, "link", "link", item); + addConditionally(entry, "description", "description", item); + if ((tmp = fetch("pubDate", item))) + entry.pubDate = new Date(tmp); + return entry; + }); + } } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; -} + this.dom = feed; + DomHandler.prototype._handleCallback.call( + this, + feedRoot ? null : Error("couldn't find root of feed") + ); +}; -module.exports = overRest; +module.exports = FeedHandler; /***/ }), -/* 431 */ +/* 505 */, +/* 506 */ /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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 (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; +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()); + }); +}; Object.defineProperty(exports, "__esModule", { value: true }); -const os = __importStar(__webpack_require__(87)); -const utils_1 = __webpack_require__(82); +exports.setCacheVariable = exports.setPathVariables = void 0; +const core = __importStar(__webpack_require__(470)); +const path = __importStar(__webpack_require__(622)); +const conda = __importStar(__webpack_require__(259)); +const constants = __importStar(__webpack_require__(58)); +const utils = __importStar(__webpack_require__(567)); /** - * Commands - * - * Command Format: - * ::name key=value,key=value::message - * - * Examples: - * ::warning::This is the message - * ::set-env name=MY_VAR::some value + * Add Conda executable to PATH */ -function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os.EOL); -} -exports.issueCommand = issueCommand; -function issue(name, message = '') { - issueCommand(name, {}, message); -} -exports.issue = issue; -const CMD_STRING = '::'; -class Command { - constructor(command, properties, message) { - if (!command) { - command = 'missing.command'; - } - this.command = command; - this.properties = properties; - this.message = message; - } - toString() { - let cmdStr = CMD_STRING + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += ' '; - let first = true; - for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - const val = this.properties[key]; - if (val) { - if (first) { - first = false; - } - else { - cmdStr += ','; - } - cmdStr += `${key}=${escapeProperty(val)}`; - } - } - } +function setPathVariables(options) { + return __awaiter(this, void 0, void 0, function* () { + const condaBin = path.join(conda.condaBasePath(options), "condabin"); + const condaPath = conda.condaBasePath(options); + core.info(`Add "${condaBin}" to PATH`); + core.addPath(condaBin); + if (!options.useBundled) { + core.info(`Set 'CONDA="${condaPath}"'`); + core.exportVariable("CONDA", condaPath); } - cmdStr += `${CMD_STRING}${escapeData(this.message)}`; - return cmdStr; - } -} -function escapeData(s) { - return utils_1.toCommandValue(s) - .replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A'); + }); } -function escapeProperty(s) { - return utils_1.toCommandValue(s) - .replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A') - .replace(/:/g, '%3A') - .replace(/,/g, '%2C'); +exports.setPathVariables = setPathVariables; +/** + * Ensure the conda cache path is available as a variable + */ +function setCacheVariable(options) { + return __awaiter(this, void 0, void 0, function* () { + const folder = utils.cacheFolder(); + yield conda.condaCommand(["config", "--add", "pkgs_dirs", folder], options); + core.exportVariable(constants.ENV_VAR_CONDA_PKGS, folder); + }); } -//# sourceMappingURL=command.js.map +exports.setCacheVariable = setCacheVariable; + /***/ }), -/* 432 */, -/* 433 */, -/* 434 */ +/* 507 */ /***/ (function(module, __unusedexports, __webpack_require__) { -var arrayFilter = __webpack_require__(348), - baseFilter = __webpack_require__(793), - baseIteratee = __webpack_require__(295), - isArray = __webpack_require__(143), - negate = __webpack_require__(316); +var MapCache = __webpack_require__(978); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. + * 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 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 + * @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 users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; * - * _.reject(users, function(o) { return !o.active; }); - * // => objects for ['fred'] + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] * - * // The `_.matches` iteratee shorthand. - * _.reject(users, { 'age': 40, 'active': true }); - * // => objects for ['barney'] + * values(other); + * // => [3, 4] * - * // The `_.matchesProperty` iteratee shorthand. - * _.reject(users, ['active', false]); - * // => objects for ['fred'] + * object.a = 2; + * values(object); + * // => [1, 2] * - * // The `_.property` iteratee shorthand. - * _.reject(users, 'active'); - * // => objects for ['barney'] + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; */ -function reject(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, negate(baseIteratee(predicate, 3))); +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; } -module.exports = reject; +// Expose `MapCache`. +memoize.Cache = MapCache; + +module.exports = memoize; /***/ }), -/* 435 */, -/* 436 */ +/* 508 */, +/* 509 */ /***/ (function(module) { -/** Used to match wrap detail comments. */ -var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; - /** - * Inserts wrapper `details` in a comment at the top of the `source` body. + * The base implementation of `_.property` without support for deep paths. * * @private - * @param {string} source The source to modify. - * @returns {Array} details The details to insert. - * @returns {string} Returns the modified source. + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. */ -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'); +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; } -module.exports = insertWrapDetails; +module.exports = baseProperty; /***/ }), -/* 437 */, -/* 438 */ -/***/ (function(module) { +/* 510 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { /** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. + * Module dependencies */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} +var serialize = __webpack_require__(502), + defaultOptions = __webpack_require__(97).default, + flattenOptions = __webpack_require__(97).flatten, + select = __webpack_require__(720), + parse = __webpack_require__(37), + _ = { + merge: __webpack_require__(587), + defaults: __webpack_require__(605) + }; -module.exports = setToArray; +/** + * $.load(str) + */ +exports.load = function(content, options, isDocument) { + var Cheerio = __webpack_require__(739); -/***/ }), -/* 439 */ -/***/ (function(module) { + options = _.defaults(flattenOptions(options || {}), defaultOptions); -/** - * This method returns `undefined`. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Util - * @example - * - * _.times(2, _.noop); - * // => [undefined, undefined] - */ -function noop() { - // No operation performed. -} + if (isDocument === void 0) + isDocument = true; -module.exports = noop; + var root = parse(content, options, isDocument); + var initialize = function(selector, context, r, opts) { + if (!(this instanceof initialize)) { + return new initialize(selector, context, r, opts); + } + opts = _.defaults(opts || {}, options); + return Cheerio.call(this, selector, context, r || root, opts); + }; -/***/ }), -/* 440 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + // Ensure that selections created by the "loaded" `initialize` function are + // true Cheerio instances. + initialize.prototype = Object.create(Cheerio.prototype); + initialize.prototype.constructor = initialize; -var memoizeCapped = __webpack_require__(138); + // Mimic jQuery's prototype alias for plugin authors. + initialize.fn = initialize.prototype; -/** Used to match property names within property paths. */ -var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + // Keep a reference to the top-level scope so we can chain methods that implicitly + // resolve selectors; e.g. $("").(".bar"), which otherwise loses ._root + initialize.prototype._originalRoot = root; -/** Used to match backslashes in property paths. */ -var reEscapeChar = /\\(\\)?/g; - -/** - * 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; -}); - -module.exports = stringToPath; + // Add in the static methods + _.merge(initialize, exports); + // Add in the root + initialize._root = root; + // store options + initialize._options = options; -/***/ }), -/* 441 */, -/* 442 */ -/***/ (function(module) { + return initialize; +}; -"use strict"; +/* +* Helper function +*/ +function render(that, dom, options) { + if (!dom) { + if (that._root && that._root.children) { + dom = that._root.children; + } else { + return ''; + } + } else if (typeof dom === 'string') { + dom = select(dom, that._root, options); + } -module.exports = parse; + return serialize(dom, options); +} -var re_name = /^(?:\\.|[\w\-\u00b0-\uFFFF])+/, - re_escape = /\\([\da-f]{1,6}\s?|(\s)|.)/ig, - //modified version of https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L87 - re_attr = /^\s*((?:\\.|[\w\u00b0-\uFFFF\-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF\-])*)|)|)\s*(i)?\]/; +/** + * $.html([selector | dom], [options]) + */ -var actionTypes = { - __proto__: null, - "undefined": "exists", - "": "equals", - "~": "element", - "^": "start", - "$": "end", - "*": "any", - "!": "not", - "|": "hyphen" -}; +exports.html = function(dom, options) { + // be flexible about parameters, sometimes we call html(), + // with options as only parameter + // check dom argument for dom element specific properties + // assume there is no 'length' or 'type' properties in the options object + if (Object.prototype.toString.call(dom) === '[object Object]' && !options && !('length' in dom) && !('type' in dom)) + { + options = dom; + dom = undefined; + } -var simpleSelectors = { - __proto__: null, - ">": "child", - "<": "parent", - "~": "sibling", - "+": "adjacent" -}; + // sometimes $.html() used without preloading html + // so fallback non existing options to the default ones + options = _.defaults(flattenOptions(options || {}), this._options, defaultOptions); -var attribSelectors = { - __proto__: null, - "#": ["id", "equals"], - ".": ["class", "element"] + return render(this, dom, options); }; -//pseudos, whose data-property is parsed as well -var unpackPseudos = { - __proto__: null, - "has": true, - "not": true, - "matches": true -}; +/** + * $.xml([selector | dom]) + */ -var stripQuotesFromPseudos = { - __proto__: null, - "contains": true, - "icontains": true -}; +exports.xml = function(dom) { + var options = _.defaults({xml: true}, this._options); -var quotes = { - __proto__: null, - "\"": true, - "'": true + return render(this, dom, options); }; -//unescape function taken from https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L139 -function funescape( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - // BMP codepoint - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); -} - -function unescapeCSS(str){ - return str.replace(re_escape, funescape); -} +/** + * $.text(dom) + */ -function isWhitespace(c){ - return c === " " || c === "\n" || c === "\t" || c === "\f" || c === "\r"; -} +exports.text = function(elems) { + if (!elems) { + elems = this.root(); + } -function parse(selector, options){ - var subselects = []; + var ret = '', + len = elems.length, + elem; - selector = parseSelector(subselects, selector + "", options); + for (var i = 0; i < len; i++) { + elem = elems[i]; + if (elem.type === 'text') ret += elem.data; + else if (elem.children && elem.type !== 'comment' && elem.tagName !== 'script' && elem.tagName !== 'style') { + ret += exports.text(elem.children); + } + } - if(selector !== ""){ - throw new SyntaxError("Unmatched selector: " + selector); - } + return ret; +}; - return subselects; -} +/** + * $.parseHTML(data [, context ] [, keepScripts ]) + * Parses a string into an array of DOM nodes. The `context` argument has no + * meaning for Cheerio, but it is maintained for API compatibility with jQuery. + */ +exports.parseHTML = function(data, context, keepScripts) { + var parsed; -function parseSelector(subselects, selector, options){ - var tokens = [], - sawWS = false, - data, firstChar, name, quot; + if (!data || typeof data !== 'string') { + return null; + } - function getName(){ - var sub = selector.match(re_name)[0]; - selector = selector.substr(sub.length); - return unescapeCSS(sub); - } + if (typeof context === 'boolean') { + keepScripts = context; + } - function stripWhitespace(start){ - while(isWhitespace(selector.charAt(start))) start++; - selector = selector.substr(start); - } + parsed = this.load(data, defaultOptions, false); + if (!keepScripts) { + parsed('script').remove(); + } - function isEscaped(pos) { - var slashCount = 0; + // The `children` array is used by Cheerio internally to group elements that + // share the same parents. When nodes created through `parseHTML` are + // inserted into previously-existing DOM structures, they will be removed + // from the `children` array. The results of `parseHTML` should remain + // constant across these operations, so a shallow copy should be returned. + return parsed.root()[0].children.slice(); +}; - while (selector.charAt(--pos) === "\\") slashCount++; - return (slashCount & 1) === 1; - } +/** + * $.root() + */ +exports.root = function() { + return this(this._root); +}; - stripWhitespace(0); +/** + * $.contains() + */ +exports.contains = function(container, contained) { - while(selector !== ""){ - firstChar = selector.charAt(0); + // According to the jQuery API, an element does not "contain" itself + if (contained === container) { + return false; + } - if(isWhitespace(firstChar)){ - sawWS = true; - stripWhitespace(1); - } else if(firstChar in simpleSelectors){ - tokens.push({type: simpleSelectors[firstChar]}); - sawWS = false; + // Step up the descendants, stopping when the root element is reached + // (signaled by `.parent` returning a reference to the same object) + while (contained && contained !== contained.parent) { + contained = contained.parent; + if (contained === container) { + return true; + } + } - stripWhitespace(1); - } else if(firstChar === ","){ - if(tokens.length === 0){ - throw new SyntaxError("empty sub-selector"); - } - subselects.push(tokens); - tokens = []; - sawWS = false; - stripWhitespace(1); - } else { - if(sawWS){ - if(tokens.length > 0){ - tokens.push({type: "descendant"}); - } - sawWS = false; - } + return false; +}; - if(firstChar === "*"){ - selector = selector.substr(1); - tokens.push({type: "universal"}); - } else if(firstChar in attribSelectors){ - selector = selector.substr(1); - tokens.push({ - type: "attribute", - name: attribSelectors[firstChar][0], - action: attribSelectors[firstChar][1], - value: getName(), - ignoreCase: false - }); - } else if(firstChar === "["){ - selector = selector.substr(1); - data = selector.match(re_attr); - if(!data){ - throw new SyntaxError("Malformed attribute selector: " + selector); - } - selector = selector.substr(data[0].length); - name = unescapeCSS(data[1]); +/** + * $.merge() + */ - if( - !options || ( - "lowerCaseAttributeNames" in options ? - options.lowerCaseAttributeNames : - !options.xmlMode - ) - ){ - name = name.toLowerCase(); - } +exports.merge = function(arr1, arr2) { + if(!(isArrayLike(arr1) && isArrayLike(arr2))){ + return; + } + var newLength = arr1.length + arr2.length; + var i = 0; + while(i < arr2.length){ + arr1[i + arr1.length] = arr2[i]; + i++; + } + arr1.length = newLength; + return arr1; +}; - tokens.push({ - type: "attribute", - name: name, - action: actionTypes[data[2]], - value: unescapeCSS(data[4] || data[5] || ""), - ignoreCase: !!data[6] - }); +function isArrayLike(item){ + if(Array.isArray(item)){ + return true; + } + if(typeof item !== 'object'){ + return false; + } + if(!item.hasOwnProperty('length')){ + return false; + } + if(typeof item.length !== 'number') { + return false; + } + if(item.length < 0){ + return false; + } + var i = 0; + while(i < item.length){ + if(!(i in item)){ + return false; + } + i++; + } + return true; +} - } else if(firstChar === ":"){ - if(selector.charAt(1) === ":"){ - selector = selector.substr(2); - tokens.push({type: "pseudo-element", name: getName().toLowerCase()}); - continue; - } - selector = selector.substr(1); +/***/ }), +/* 511 */ +/***/ (function(module) { - name = getName().toLowerCase(); - data = null; +/** + * 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); +} - if(selector.charAt(0) === "("){ - if(name in unpackPseudos){ - quot = selector.charAt(1); - var quoted = quot in quotes; +module.exports = isKeyable; - selector = selector.substr(quoted + 1); - data = []; - selector = parseSelector(data, selector, options); +/***/ }), +/* 512 */ +/***/ (function(module) { - if(quoted){ - if(selector.charAt(0) !== quot){ - throw new SyntaxError("unmatched quotes in :" + name); - } else { - selector = selector.substr(1); - } - } +/** + * 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); +} - if(selector.charAt(0) !== ")"){ - throw new SyntaxError("missing closing parenthesis in :" + name + " " + selector); - } +module.exports = apply; - selector = selector.substr(1); - } else { - var pos = 1, counter = 1; - for(; counter > 0 && pos < selector.length; pos++){ - if(selector.charAt(pos) === "(" && !isEscaped(pos)) counter++; - else if(selector.charAt(pos) === ")" && !isEscaped(pos)) counter--; - } +/***/ }), +/* 513 */, +/* 514 */ +/***/ (function(module) { - if(counter){ - throw new SyntaxError("parenthesis not matched"); - } +/** Used for built-in method references. */ +var objectProto = Object.prototype; - data = selector.substr(1, pos - 2); - selector = selector.substr(pos); +/** + * 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; - if(name in stripQuotesFromPseudos){ - quot = data.charAt(0); + return value === proto; +} - if(quot === data.slice(-1) && quot in quotes){ - data = data.slice(1, -1); - } +module.exports = isPrototype; - data = unescapeCSS(data); - } - } - } - tokens.push({type: "pseudo", name: name, data: data}); - } else if(re_name.test(selector)){ - name = getName(); +/***/ }), +/* 515 */, +/* 516 */, +/* 517 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - if(!options || ("lowerCaseTags" in options ? options.lowerCaseTags : !options.xmlMode)){ - name = name.toLowerCase(); - } +var isStrictComparable = __webpack_require__(258), + keys = __webpack_require__(863); - tokens.push({type: "tag", name: name}); - } else { - if(tokens.length && tokens[tokens.length - 1].type === "descendant"){ - tokens.pop(); - } - addToken(subselects, tokens); - return selector; - } - } - } +/** + * 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; - addToken(subselects, tokens); + while (length--) { + var key = result[length], + value = object[key]; - return selector; + result[length] = [key, value, isStrictComparable(value)]; + } + return result; } -function addToken(subselects, tokens){ - if(subselects.length > 0 && tokens.length === 0){ - throw new SyntaxError("empty sub-selector"); - } - - subselects.push(tokens); -} +module.exports = getMatchData; /***/ }), -/* 443 */, -/* 444 */, -/* 445 */ -/***/ (function(module) { +/* 518 */, +/* 519 */, +/* 520 */, +/* 521 */ +/***/ (function(module, __unusedexports, __webpack_require__) { + +var flatten = __webpack_require__(938), + overRest = __webpack_require__(430), + setToString = __webpack_require__(70); /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. + * A specialized version of `baseRest` which flattens the rest array. * * @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. + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. */ -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; +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); } -module.exports = arrayReduce; +module.exports = flatRest; /***/ }), -/* 446 */, -/* 447 */, -/* 448 */, -/* 449 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { +/* 522 */, +/* 523 */, +/* 524 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -var domEach = __webpack_require__(140).domEach, - _ = { - pick: __webpack_require__(320), - }; +"use strict"; -var toString = Object.prototype.toString; -/** - * Set / Get css. - * - * @param {String|Object} prop - * @param {String} val - * @return {self} - * @api public - */ +var Mixin = __webpack_require__(785), + inherits = __webpack_require__(669).inherits, + UNICODE = __webpack_require__(56); -exports.css = function(prop, val) { - if (arguments.length === 2 || - // When `prop` is a "plain" object - (toString.call(prop) === '[object Object]')) { - return domEach(this, function(idx, el) { - setCss(el, prop, val, idx); - }); - } else { - return getCss(this[0], prop); - } -}; +//Aliases +var $ = UNICODE.CODE_POINTS; -/** - * Set styles of all elements. - * - * @param {String|Object} prop - * @param {String} val - * @param {Number} idx - optional index within the selection - * @return {self} - * @api private - */ +var PositionTrackingPreprocessorMixin = module.exports = function (preprocessor) { + // NOTE: avoid installing tracker twice + if (!preprocessor.__locTracker) { + preprocessor.__locTracker = this; -function setCss(el, prop, val, idx) { - if ('string' == typeof prop) { - var styles = getCss(el); - if (typeof val === 'function') { - val = val.call(el, idx, styles[prop]); - } + Mixin.call(this, preprocessor); - if (val === '') { - delete styles[prop]; - } else if (val != null) { - styles[prop] = val; + this.preprocessor = preprocessor; + this.isEol = false; + this.lineStartPos = 0; + this.droppedBufferSize = 0; + + this.col = -1; + this.line = 1; } - el.attribs.style = stringify(styles); - } else if ('object' == typeof prop) { - Object.keys(prop).forEach(function(k){ - setCss(el, k, prop[k]); - }); - } -} + return preprocessor.__locTracker; +}; -/** - * Get parsed styles of the first element. - * - * @param {String} prop - * @return {Object} - * @api private - */ +inherits(PositionTrackingPreprocessorMixin, Mixin); -function getCss(el, prop) { - var styles = parse(el.attribs.style); - if (typeof prop === 'string') { - return styles[prop]; - } else if (Array.isArray(prop)) { - return _.pick(styles, prop); - } else { - return styles; - } -} +Object.defineProperty(PositionTrackingPreprocessorMixin.prototype, 'offset', { + get: function () { + return this.droppedBufferSize + this.preprocessor.pos; + } +}); -/** - * Stringify `obj` to styles. - * - * @param {Object} obj - * @return {Object} - * @api private - */ +PositionTrackingPreprocessorMixin.prototype._getOverriddenMethods = function (mxn, orig) { + return { + advance: function () { + var cp = orig.advance.call(this); -function stringify(obj) { - return Object.keys(obj || {}) - .reduce(function(str, prop){ - return str += '' - + (str ? ' ' : '') - + prop - + ': ' - + obj[prop] - + ';'; - }, ''); -} + //NOTE: LF should be in the last column of the line + if (mxn.isEol) { + mxn.isEol = false; + mxn.line++; + mxn.lineStartPos = mxn.offset; + } -/** - * Parse `styles`. - * - * @param {String} styles - * @return {Object} - * @api private - */ + if (cp === $.LINE_FEED) + mxn.isEol = true; -function parse(styles) { - styles = (styles || '').trim(); + mxn.col = mxn.offset - mxn.lineStartPos + 1; - if (!styles) return {}; + return cp; + }, - return styles - .split(';') - .reduce(function(obj, str){ - var n = str.indexOf(':'); - // skip if there is no :, or if it is the first/last character - if (n < 1 || n === str.length-1) return obj; - obj[str.slice(0,n).trim()] = str.slice(n+1).trim(); - return obj; - }, {}); -} + retreat: function () { + orig.retreat.call(this); + mxn.isEol = false; + mxn.col = mxn.offset - mxn.lineStartPos + 1; + }, -/***/ }), -/* 450 */, -/* 451 */ -/***/ (function(module) { + dropParsedChunk: function () { + var prevPos = this.pos; -/** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ -function stubFalse() { - return false; -} + orig.dropParsedChunk.call(this); -module.exports = stubFalse; + mxn.droppedBufferSize += prevPos - this.pos; + } + }; +}; /***/ }), -/* 452 */, -/* 453 */, -/* 454 */, -/* 455 */ -/***/ (function(module) { +/* 525 */, +/* 526 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = __importStar(__webpack_require__(747)); +const core = __importStar(__webpack_require__(470)); +const input = __importStar(__webpack_require__(265)); +const constants = __importStar(__webpack_require__(58)); +const installer = __importStar(__webpack_require__(555)); +const env = __importStar(__webpack_require__(956)); +const conda = __importStar(__webpack_require__(259)); +const outputs = __importStar(__webpack_require__(506)); +const baseTools = __importStar(__webpack_require__(49)); /** - * 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`. + * Main conda setup method to handle all configuration options */ -function baseIsNaN(value) { - return value !== value; +function setupMiniconda(inputs) { + return __awaiter(this, void 0, void 0, function* () { + // initialize options, preferring a pre-bundled miniconda, but not yet ready to decide to use mamba + let options = { + useBundled: true, + useMamba: false, + }; + yield core.group(`Creating bootstrap .condarc file in ${constants.CONDARC_PATH}...`, conda.bootstrapConfig); + const installerInfo = yield core.group("Ensuring installer...", () => installer.getLocalInstallerPath(inputs, options)); + options = Object.assign(Object.assign({}, options), installerInfo.options); + const basePath = conda.condaBasePath(options); + if (installerInfo.localInstallerPath && !options.useBundled) { + yield core.group("Running installer...", () => installer.runInstaller(installerInfo.localInstallerPath, basePath)); + } + if (!fs.existsSync(basePath)) { + throw Error(`No installed conda 'base' enviroment found at ${basePath}`); + } + yield core.group("Setup environment variables...", () => outputs.setPathVariables(options)); + if (inputs.condaConfigFile) { + yield core.group("Copying condarc file...", () => conda.copyConfig(inputs)); + } + // for potential 'channels' + options.envSpec = yield core.group("Parsing environment...", () => env.getEnvSpec(inputs)); + yield core.group("Configuring conda package cache...", () => outputs.setCacheVariable(options)); + yield core.group("Applying initial configuration...", () => conda.applyCondaConfiguration(inputs, options)); + yield core.group("Initializing conda shell integration...", () => conda.condaInit(inputs, options)); + const toolOptions = yield core.group("Adding tools to 'base' env", () => baseTools.installBaseTools(inputs, options)); + // `useMamba` may have changed + options = Object.assign(Object.assign({}, options), toolOptions); + if (inputs.activateEnvironment) { + yield core.group("Ensuring environment...", () => env.ensureEnvironment(inputs, options)); + } + }); } - -module.exports = baseIsNaN; +/** + * Run + */ +function run() { + return __awaiter(this, void 0, void 0, function* () { + try { + const inputs = yield core.group("Gathering Inputs...", input.parseInputs); + yield setupMiniconda(inputs); + } + catch (err) { + core.setFailed(err.message); + } + }); +} +void run(); +exports.default = run; /***/ }), -/* 456 */, -/* 457 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +/* 527 */, +/* 528 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ensureYaml = void 0; +const fs = __importStar(__webpack_require__(747)); +const os = __importStar(__webpack_require__(87)); +const path = __importStar(__webpack_require__(622)); +const yaml = __importStar(__webpack_require__(414)); +const core = __importStar(__webpack_require__(470)); +const constants = __importStar(__webpack_require__(58)); +const utils = __importStar(__webpack_require__(567)); +const providers = [ + { + label: "python", + provides: (inputs) => !!inputs.pythonVersion, + specMatch: constants.PYTHON_SPEC, + spec: ({ pythonVersion }) => utils.makeSpec("python", pythonVersion), + }, +]; +exports.ensureYaml = { + label: "env update", + provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { var _a; return !!Object.keys(((_a = options.envSpec) === null || _a === void 0 ? void 0 : _a.yaml) || {}).length; }), + condaArgs: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { + var _b; + const yamlData = (_b = options.envSpec) === null || _b === void 0 ? void 0 : _b.yaml; + if (yamlData == null) { + throw Error(`'environment-file: ${inputs.environmentFile}' appears to be malformed`); + } + let envFile = inputs.environmentFile; + let patchesApplied = []; + // make a copy, update with each patch + let dependencies = [ + ...(yamlData.dependencies || []), + ]; + for (const provider of providers) { + if (!provider.provides(inputs, options)) { + continue; + } + const newSpec = provider.spec(inputs, options); + let didPatch = false; + let patchedDeps = []; + for (const spec of dependencies || []) { + // ignore pip + if (!(spec instanceof String) || !spec.match(constants.PYTHON_SPEC)) { + patchedDeps.push(spec); + continue; + } + patchedDeps.push(newSpec); + didPatch = true; + } + // if there was nothing to patch, just append + if (!didPatch) { + patchedDeps.push(newSpec); + } + patchesApplied.push(newSpec); + dependencies = patchedDeps; + } + if (patchesApplied.length) { + const patchedYaml = yaml.safeDump(Object.assign(Object.assign({}, yamlData), { dependencies })); + envFile = path.join(os.tmpdir(), "environment-patched.yml"); + core.info(`Making copy of 'environment-file: ${inputs.environmentFile}'\n${patchedYaml}`); + fs.writeFileSync(envFile, patchedYaml, "utf8"); + } + return [ + "env", + "update", + "--name", + inputs.activateEnvironment, + "--file", + envFile, + ]; + }), +}; -/*eslint-disable max-len,no-use-before-define*/ - -var common = __webpack_require__(740); -var YAMLException = __webpack_require__(556); -var Mark = __webpack_require__(93); -var DEFAULT_SAFE_SCHEMA = __webpack_require__(723); -var DEFAULT_FULL_SCHEMA = __webpack_require__(910); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; - - -var CHOMPING_CLIP = 1; -var CHOMPING_STRIP = 2; -var CHOMPING_KEEP = 3; - - -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; -var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - - -function _class(obj) { return Object.prototype.toString.call(obj); } - -function is_EOL(c) { - return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); -} - -function is_WHITE_SPACE(c) { - return (c === 0x09/* Tab */) || (c === 0x20/* Space */); -} - -function is_WS_OR_EOL(c) { - return (c === 0x09/* Tab */) || - (c === 0x20/* Space */) || - (c === 0x0A/* LF */) || - (c === 0x0D/* CR */); -} - -function is_FLOW_INDICATOR(c) { - return c === 0x2C/* , */ || - c === 0x5B/* [ */ || - c === 0x5D/* ] */ || - c === 0x7B/* { */ || - c === 0x7D/* } */; -} - -function fromHexCode(c) { - var lc; - - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - /*eslint-disable no-bitwise*/ - lc = c | 0x20; +/***/ }), +/* 529 */, +/* 530 */, +/* 531 */, +/* 532 */, +/* 533 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { - if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { - return lc - 0x61 + 10; - } +"use strict"; - return -1; +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 __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const core = __importStar(__webpack_require__(470)); +const io = __importStar(__webpack_require__(1)); +const fs = __importStar(__webpack_require__(747)); +const mm = __importStar(__webpack_require__(31)); +const os = __importStar(__webpack_require__(87)); +const path = __importStar(__webpack_require__(622)); +const httpm = __importStar(__webpack_require__(539)); +const semver = __importStar(__webpack_require__(779)); +const stream = __importStar(__webpack_require__(413)); +const util = __importStar(__webpack_require__(669)); +const v4_1 = __importDefault(__webpack_require__(494)); +const exec_1 = __webpack_require__(986); +const assert_1 = __webpack_require__(357); +const retry_helper_1 = __webpack_require__(952); +class HTTPError extends Error { + constructor(httpStatusCode) { + super(`Unexpected HTTP response: ${httpStatusCode}`); + this.httpStatusCode = httpStatusCode; + Object.setPrototypeOf(this, new.target.prototype); + } } - -function escapedHexLen(c) { - if (c === 0x78/* x */) { return 2; } - if (c === 0x75/* u */) { return 4; } - if (c === 0x55/* U */) { return 8; } - return 0; +exports.HTTPError = HTTPError; +const IS_WINDOWS = process.platform === 'win32'; +const IS_MAC = process.platform === 'darwin'; +const userAgent = 'actions/tool-cache'; +/** + * Download a tool from an url and stream it into a file + * + * @param url url of tool to download + * @param dest path to download tool + * @param auth authorization header + * @returns path to downloaded tool + */ +function downloadTool(url, dest, auth) { + return __awaiter(this, void 0, void 0, function* () { + dest = dest || path.join(_getTempDirectory(), v4_1.default()); + yield io.mkdirP(path.dirname(dest)); + core.debug(`Downloading ${url}`); + core.debug(`Destination ${dest}`); + const maxAttempts = 3; + const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10); + const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20); + const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds); + return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () { + return yield downloadToolAttempt(url, dest || '', auth); + }), (err) => { + if (err instanceof HTTPError && err.httpStatusCode) { + // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests + if (err.httpStatusCode < 500 && + err.httpStatusCode !== 408 && + err.httpStatusCode !== 429) { + return false; + } + } + // Otherwise retry + return true; + }); + }); } - -function fromDecimalCode(c) { - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - return -1; +exports.downloadTool = downloadTool; +function downloadToolAttempt(url, dest, auth) { + return __awaiter(this, void 0, void 0, function* () { + if (fs.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); + } + // Get the response headers + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false + }); + let headers; + if (auth) { + core.debug('set auth'); + headers = { + authorization: auth + }; + } + const response = yield http.get(url, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError(response.message.statusCode); + core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + // Download the response body + const pipeline = util.promisify(stream.pipeline); + const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs.createWriteStream(dest)); + core.debug('download complete'); + succeeded = true; + return dest; + } + finally { + // Error, delete dest before retry + if (!succeeded) { + core.debug('download failed'); + try { + yield io.rmRF(dest); + } + catch (err) { + core.debug(`Failed to delete '${dest}'. ${err.message}`); + } + } + } + }); } - -function simpleEscapeSequence(c) { - /* eslint-disable indent */ - return (c === 0x30/* 0 */) ? '\x00' : - (c === 0x61/* a */) ? '\x07' : - (c === 0x62/* b */) ? '\x08' : - (c === 0x74/* t */) ? '\x09' : - (c === 0x09/* Tab */) ? '\x09' : - (c === 0x6E/* n */) ? '\x0A' : - (c === 0x76/* v */) ? '\x0B' : - (c === 0x66/* f */) ? '\x0C' : - (c === 0x72/* r */) ? '\x0D' : - (c === 0x65/* e */) ? '\x1B' : - (c === 0x20/* Space */) ? ' ' : - (c === 0x22/* " */) ? '\x22' : - (c === 0x2F/* / */) ? '/' : - (c === 0x5C/* \ */) ? '\x5C' : - (c === 0x4E/* N */) ? '\x85' : - (c === 0x5F/* _ */) ? '\xA0' : - (c === 0x4C/* L */) ? '\u2028' : - (c === 0x50/* P */) ? '\u2029' : ''; +/** + * Extract a .7z file + * + * @param file path to the .7z file + * @param dest destination directory. Optional. + * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this + * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will + * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is + * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line + * interface, it is smaller than the full command line interface, and it does support long paths. At the + * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website. + * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path + * to 7zr.exe can be pass to this function. + * @returns path to the destination directory + */ +function extract7z(file, dest, _7zPath) { + return __awaiter(this, void 0, void 0, function* () { + assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS'); + assert_1.ok(file, 'parameter "file" is required'); + dest = yield _createExtractFolder(dest); + const originalCwd = process.cwd(); + process.chdir(dest); + if (_7zPath) { + try { + const logLevel = core.isDebug() ? '-bb1' : '-bb0'; + const args = [ + 'x', + logLevel, + '-bd', + '-sccUTF-8', + file + ]; + const options = { + silent: true + }; + yield exec_1.exec(`"${_7zPath}"`, args, options); + } + finally { + process.chdir(originalCwd); + } + } + else { + const escapedScript = path + .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1') + .replace(/'/g, "''") + .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines + const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); + const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ''); + const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`; + const args = [ + '-NoLogo', + '-Sta', + '-NoProfile', + '-NonInteractive', + '-ExecutionPolicy', + 'Unrestricted', + '-Command', + command + ]; + const options = { + silent: true + }; + try { + const powershellPath = yield io.which('powershell', true); + yield exec_1.exec(`"${powershellPath}"`, args, options); + } + finally { + process.chdir(originalCwd); + } + } + return dest; + }); } - -function charFromCodepoint(c) { - if (c <= 0xFFFF) { - return String.fromCharCode(c); - } - // Encode UTF-16 surrogate pair - // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF - return String.fromCharCode( - ((c - 0x010000) >> 10) + 0xD800, - ((c - 0x010000) & 0x03FF) + 0xDC00 - ); +exports.extract7z = extract7z; +/** + * Extract a compressed tar archive + * + * @param file path to the tar + * @param dest destination directory. Optional. + * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional. + * @returns path to the destination directory + */ +function extractTar(file, dest, flags = 'xz') { + return __awaiter(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); + } + // Create dest + dest = yield _createExtractFolder(dest); + // Determine whether GNU tar + core.debug('Checking tar --version'); + let versionOutput = ''; + yield exec_1.exec('tar --version', [], { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => (versionOutput += data.toString()), + stderr: (data) => (versionOutput += data.toString()) + } + }); + core.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR'); + // Initialize args + let args; + if (flags instanceof Array) { + args = flags; + } + else { + args = [flags]; + } + if (core.isDebug() && !flags.includes('v')) { + args.push('-v'); + } + let destArg = dest; + let fileArg = file; + if (IS_WINDOWS && isGnuTar) { + args.push('--force-local'); + destArg = dest.replace(/\\/g, '/'); + // Technically only the dest needs to have `/` but for aesthetic consistency + // convert slashes in the file arg too. + fileArg = file.replace(/\\/g, '/'); + } + if (isGnuTar) { + // Suppress warnings when using GNU tar to extract archives created by BSD tar + args.push('--warning=no-unknown-keyword'); + } + args.push('-C', destArg, '-f', fileArg); + yield exec_1.exec(`tar`, args); + return dest; + }); } - -var simpleEscapeCheck = new Array(256); // integer, for fast access -var simpleEscapeMap = new Array(256); -for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); +exports.extractTar = extractTar; +/** + * Extract a xar compatible archive + * + * @param file path to the archive + * @param dest destination directory. Optional. + * @param flags flags for the xar. Optional. + * @returns path to the destination directory + */ +function extractXar(file, dest, flags = []) { + return __awaiter(this, void 0, void 0, function* () { + assert_1.ok(IS_MAC, 'extractXar() not supported on current OS'); + assert_1.ok(file, 'parameter "file" is required'); + dest = yield _createExtractFolder(dest); + let args; + if (flags instanceof Array) { + args = flags; + } + else { + args = [flags]; + } + args.push('-x', '-C', dest, '-f', file); + if (core.isDebug()) { + args.push('-v'); + } + const xarPath = yield io.which('xar', true); + yield exec_1.exec(`"${xarPath}"`, _unique(args)); + return dest; + }); } - - -function State(input, options) { - this.input = input; - - this.filename = options['filename'] || null; - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.onWarning = options['onWarning'] || null; - this.legacy = options['legacy'] || false; - this.json = options['json'] || false; - this.listener = options['listener'] || null; - - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; - - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; - - this.documents = []; - - /* - this.version; - this.checkLineBreaks; - this.tagMap; - this.anchorMap; - this.tag; - this.anchor; - this.kind; - this.result;*/ - +exports.extractXar = extractXar; +/** + * Extract a zip + * + * @param file path to the zip + * @param dest destination directory. Optional. + * @returns path to the destination directory + */ +function extractZip(file, dest) { + return __awaiter(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); + } + dest = yield _createExtractFolder(dest); + if (IS_WINDOWS) { + yield extractZipWin(file, dest); + } + else { + yield extractZipNix(file, dest); + } + return dest; + }); } - - -function generateError(state, message) { - return new YAMLException( - message, - new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); +exports.extractZip = extractZip; +function extractZipWin(file, dest) { + return __awaiter(this, void 0, void 0, function* () { + // build the powershell command + const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines + const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ''); + const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`; + // run powershell + const powershellPath = yield io.which('powershell', true); + const args = [ + '-NoLogo', + '-Sta', + '-NoProfile', + '-NonInteractive', + '-ExecutionPolicy', + 'Unrestricted', + '-Command', + command + ]; + yield exec_1.exec(`"${powershellPath}"`, args); + }); } - -function throwError(state, message) { - throw generateError(state, message); +function extractZipNix(file, dest) { + return __awaiter(this, void 0, void 0, function* () { + const unzipPath = yield io.which('unzip', true); + const args = [file]; + if (!core.isDebug()) { + args.unshift('-q'); + } + yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest }); + }); } - -function throwWarning(state, message) { - if (state.onWarning) { - state.onWarning.call(null, generateError(state, message)); - } +/** + * Caches a directory and installs it into the tool cacheDir + * + * @param sourceDir the directory to cache into tools + * @param tool tool name + * @param version version of the tool. semver format + * @param arch architecture of the tool. Optional. Defaults to machine architecture + */ +function cacheDir(sourceDir, tool, version, arch) { + return __awaiter(this, void 0, void 0, function* () { + version = semver.clean(version) || version; + arch = arch || os.arch(); + core.debug(`Caching tool ${tool} ${version} ${arch}`); + core.debug(`source dir: ${sourceDir}`); + if (!fs.statSync(sourceDir).isDirectory()) { + throw new Error('sourceDir is not a directory'); + } + // Create the tool dir + const destPath = yield _createToolPath(tool, version, arch); + // copy each child item. do not move. move can fail on Windows + // due to anti-virus software having an open handle on a file. + for (const itemName of fs.readdirSync(sourceDir)) { + const s = path.join(sourceDir, itemName); + yield io.cp(s, destPath, { recursive: true }); + } + // write .complete + _completeToolPath(tool, version, arch); + return destPath; + }); } - - -var directiveHandlers = { - - YAML: function handleYamlDirective(state, name, args) { - - var match, major, minor; - - if (state.version !== null) { - throwError(state, 'duplication of %YAML directive'); - } - - if (args.length !== 1) { - throwError(state, 'YAML directive accepts exactly one argument'); - } - - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - - if (match === null) { - throwError(state, 'ill-formed argument of the YAML directive'); - } - - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - - if (major !== 1) { - throwError(state, 'unacceptable YAML version of the document'); - } - - state.version = args[0]; - state.checkLineBreaks = (minor < 2); - - if (minor !== 1 && minor !== 2) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, - - TAG: function handleTagDirective(state, name, args) { - - var handle, prefix; - - if (args.length !== 2) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } - - handle = args[0]; - prefix = args[1]; - - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); +exports.cacheDir = cacheDir; +/** + * Caches a downloaded file (GUID) and installs it + * into the tool cache with a given targetName + * + * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid. + * @param targetFile the name of the file name in the tools directory + * @param tool tool name + * @param version version of the tool. semver format + * @param arch architecture of the tool. Optional. Defaults to machine architecture + */ +function cacheFile(sourceFile, targetFile, tool, version, arch) { + return __awaiter(this, void 0, void 0, function* () { + version = semver.clean(version) || version; + arch = arch || os.arch(); + core.debug(`Caching tool ${tool} ${version} ${arch}`); + core.debug(`source file: ${sourceFile}`); + if (!fs.statSync(sourceFile).isFile()) { + throw new Error('sourceFile is not a file'); + } + // create the tool dir + const destFolder = yield _createToolPath(tool, version, arch); + // copy instead of move. move can fail on Windows due to + // anti-virus software having an open handle on a file. + const destPath = path.join(destFolder, targetFile); + core.debug(`destination file ${destPath}`); + yield io.cp(sourceFile, destPath); + // write .complete + _completeToolPath(tool, version, arch); + return destFolder; + }); +} +exports.cacheFile = cacheFile; +/** + * Finds the path to a tool version in the local installed tool cache + * + * @param toolName name of the tool + * @param versionSpec version of the tool + * @param arch optional arch. defaults to arch of computer + */ +function find(toolName, versionSpec, arch) { + if (!toolName) { + throw new Error('toolName parameter is required'); } - - if (_hasOwnProperty.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + if (!versionSpec) { + throw new Error('versionSpec parameter is required'); } - - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + arch = arch || os.arch(); + // attempt to resolve an explicit version + if (!_isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions(toolName, arch); + const match = _evaluateVersions(localVersions, versionSpec); + versionSpec = match; } - - state.tagMap[handle] = prefix; - } -}; - - -function captureSegment(state, start, end, checkJson) { - var _position, _length, _character, _result; - - if (start < end) { - _result = state.input.slice(start, end); - - if (checkJson) { - for (_position = 0, _length = _result.length; _position < _length; _position += 1) { - _character = _result.charCodeAt(_position); - if (!(_character === 0x09 || - (0x20 <= _character && _character <= 0x10FFFF))) { - throwError(state, 'expected valid JSON character'); + // check for the explicit version in the cache + let toolPath = ''; + if (versionSpec) { + versionSpec = semver.clean(versionSpec) || ''; + const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch); + core.debug(`checking cache: ${cachePath}`); + if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) { + core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); + toolPath = cachePath; + } + else { + core.debug('not found'); } - } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state, 'the stream contains non-printable characters'); } - - state.result += _result; - } + return toolPath; } - -function mergeMappings(state, destination, source, overridableKeys) { - var sourceKeys, key, index, quantity; - - if (!common.isObject(source)) { - throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); - } - - sourceKeys = Object.keys(source); - - for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { - key = sourceKeys[index]; - - if (!_hasOwnProperty.call(destination, key)) { - destination[key] = source[key]; - overridableKeys[key] = true; +exports.find = find; +/** + * Finds the paths to all versions of a tool that are installed in the local tool cache + * + * @param toolName name of the tool + * @param arch optional arch. defaults to arch of computer + */ +function findAllVersions(toolName, arch) { + const versions = []; + arch = arch || os.arch(); + const toolPath = path.join(_getCacheDirectory(), toolName); + if (fs.existsSync(toolPath)) { + const children = fs.readdirSync(toolPath); + for (const child of children) { + if (_isExplicitVersion(child)) { + const fullPath = path.join(toolPath, child, arch || ''); + if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) { + versions.push(child); + } + } + } } - } + return versions; } - -function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { - var index, quantity; - - // The output is a plain object here, so keys can only be strings. - // We need to convert keyNode to a string, but doing so can hang the process - // (deeply nested arrays that explode exponentially using aliases). - if (Array.isArray(keyNode)) { - keyNode = Array.prototype.slice.call(keyNode); - - for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { - if (Array.isArray(keyNode[index])) { - throwError(state, 'nested arrays are not supported inside keys'); - } - - if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { - keyNode[index] = '[object Object]'; - } +exports.findAllVersions = findAllVersions; +function getManifestFromRepo(owner, repo, auth, branch = 'master') { + return __awaiter(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient('tool-cache'); + const headers = {}; + if (auth) { + core.debug('set auth'); + headers.authorization = auth; + } + const response = yield http.getJson(treeUrl, headers); + if (!response.result) { + return releases; + } + let manifestUrl = ''; + for (const item of response.result.tree) { + if (item.path === 'versions-manifest.json') { + manifestUrl = item.url; + break; + } + } + headers['accept'] = 'application/vnd.github.VERSION.raw'; + let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody(); + if (versionsRaw) { + // shouldn't be needed but protects against invalid json saved with BOM + versionsRaw = versionsRaw.replace(/^\uFEFF/, ''); + try { + releases = JSON.parse(versionsRaw); + } + catch (_a) { + core.debug('Invalid json'); + } + } + return releases; + }); +} +exports.getManifestFromRepo = getManifestFromRepo; +function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) { + return __awaiter(this, void 0, void 0, function* () { + // wrap the internal impl + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); +} +exports.findFromManifest = findFromManifest; +function _createExtractFolder(dest) { + return __awaiter(this, void 0, void 0, function* () { + if (!dest) { + // create a temp dir + dest = path.join(_getTempDirectory(), v4_1.default()); + } + yield io.mkdirP(dest); + return dest; + }); +} +function _createToolPath(tool, version, arch) { + return __awaiter(this, void 0, void 0, function* () { + const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || ''); + core.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io.rmRF(folderPath); + yield io.rmRF(markerPath); + yield io.mkdirP(folderPath); + return folderPath; + }); +} +function _completeToolPath(tool, version, arch) { + const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || ''); + const markerPath = `${folderPath}.complete`; + fs.writeFileSync(markerPath, ''); + core.debug('finished caching tool'); +} +function _isExplicitVersion(versionSpec) { + const c = semver.clean(versionSpec) || ''; + core.debug(`isExplicit: ${c}`); + const valid = semver.valid(c) != null; + core.debug(`explicit? ${valid}`); + return valid; +} +function _evaluateVersions(versions, versionSpec) { + let version = ''; + core.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver.gt(a, b)) { + return 1; + } + return -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; + } } - } - - // Avoid code execution in load() via toString property - // (still use its own toString for arrays, timestamps, - // and whatever user schema extensions happen to have @@toStringTag) - if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { - keyNode = '[object Object]'; - } - - - keyNode = String(keyNode); - - if (_result === null) { - _result = {}; - } - - if (keyTag === 'tag:yaml.org,2002:merge') { - if (Array.isArray(valueNode)) { - for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state, _result, valueNode[index], overridableKeys); - } - } else { - mergeMappings(state, _result, valueNode, overridableKeys); + if (version) { + core.debug(`matched: ${version}`); } - } else { - if (!state.json && - !_hasOwnProperty.call(overridableKeys, keyNode) && - _hasOwnProperty.call(_result, keyNode)) { - state.line = startLine || state.line; - state.position = startPos || state.position; - throwError(state, 'duplicated mapping key'); + else { + core.debug('match not found'); } - _result[keyNode] = valueNode; - delete overridableKeys[keyNode]; - } - - return _result; + return version; +} +/** + * Gets RUNNER_TOOL_CACHE + */ +function _getCacheDirectory() { + const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || ''; + assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined'); + return cacheDirectory; +} +/** + * Gets RUNNER_TEMP + */ +function _getTempDirectory() { + const tempDirectory = process.env['RUNNER_TEMP'] || ''; + assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined'); + return tempDirectory; +} +/** + * Gets a global variable + */ +function _getGlobal(key, defaultValue) { + /* eslint-disable @typescript-eslint/no-explicit-any */ + const value = global[key]; + /* eslint-enable @typescript-eslint/no-explicit-any */ + return value !== undefined ? value : defaultValue; +} +/** + * Returns an array of unique values. + * @param values Values to make unique. + */ +function _unique(values) { + return Array.from(new Set(values)); } +//# sourceMappingURL=tool-cache.js.map -function readLineBreak(state) { - var ch; +/***/ }), +/* 534 */, +/* 535 */, +/* 536 */, +/* 537 */, +/* 538 */, +/* 539 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { - ch = state.input.charCodeAt(state.position); +"use strict"; - if (ch === 0x0A/* LF */) { - state.position++; - } else if (ch === 0x0D/* CR */) { - state.position++; - if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { - state.position++; +Object.defineProperty(exports, "__esModule", { value: true }); +const url = __webpack_require__(835); +const http = __webpack_require__(876); +const https = __webpack_require__(583); +const pm = __webpack_require__(313); +let tunnel; +var HttpCodes; +(function (HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); +var Headers; +(function (Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; +})(Headers = exports.Headers || (exports.Headers = {})); +var MediaTypes; +(function (MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; +})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); +/** + * Returns the proxy URL, depending upon the supplied url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ +function getProxyUrl(serverUrl) { + let proxyUrl = pm.getProxyUrl(url.parse(serverUrl)); + return proxyUrl ? proxyUrl.href : ''; +} +exports.getProxyUrl = getProxyUrl; +const HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect +]; +const HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout +]; +const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; +const ExponentialBackoffCeiling = 10; +const ExponentialBackoffTimeSlice = 5; +class HttpClientResponse { + constructor(message) { + this.message = message; + } + readBody() { + return new Promise(async (resolve, reject) => { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + }); } - } else { - throwError(state, 'a line break is expected'); - } - - state.line += 1; - state.lineStart = state.position; } - -function skipSeparationSpace(state, allowComments, checkIndent) { - var lineBreaks = 0, - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + let parsedUrl = url.parse(requestUrl); + return parsedUrl.protocol === 'https:'; +} +exports.isHttps = isHttps; +class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; + } + } } - - if (allowComments && ch === 0x23/* # */) { - do { - ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + options(requestUrl, additionalHeaders) { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); } - - if (is_EOL(ch)) { - readLineBreak(state); - - ch = state.input.charCodeAt(state.position); - lineBreaks++; - state.lineIndent = 0; - - while (ch === 0x20/* Space */) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - } else { - break; + get(requestUrl, additionalHeaders) { + return this.request('GET', requestUrl, null, additionalHeaders || {}); } - } - - if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { - throwWarning(state, 'deficient indentation'); - } - - return lineBreaks; -} - -function testDocumentSeparator(state) { - var _position = state.position, - ch; - - ch = state.input.charCodeAt(_position); - - // Condition state.position === state.lineStart is tested - // in parent on each call, for efficiency. No needs to test here again. - if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && - ch === state.input.charCodeAt(_position + 1) && - ch === state.input.charCodeAt(_position + 2)) { - - _position += 3; - - ch = state.input.charCodeAt(_position); - - if (ch === 0 || is_WS_OR_EOL(ch)) { - return true; + del(requestUrl, additionalHeaders) { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); } - } - - return false; -} - -function writeFoldedLines(state, count) { - if (count === 1) { - state.result += ' '; - } else if (count > 1) { - state.result += common.repeat('\n', count - 1); - } -} - - -function readPlainScalar(state, nodeIndent, withinFlowCollection) { - var preceding, - following, - captureStart, - captureEnd, - hasPendingContent, - _line, - _lineStart, - _lineIndent, - _kind = state.kind, - _result = state.result, - ch; - - ch = state.input.charCodeAt(state.position); - - if (is_WS_OR_EOL(ch) || - is_FLOW_INDICATOR(ch) || - ch === 0x23/* # */ || - ch === 0x26/* & */ || - ch === 0x2A/* * */ || - ch === 0x21/* ! */ || - ch === 0x7C/* | */ || - ch === 0x3E/* > */ || - ch === 0x27/* ' */ || - ch === 0x22/* " */ || - ch === 0x25/* % */ || - ch === 0x40/* @ */ || - ch === 0x60/* ` */) { - return false; - } - - if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; + post(requestUrl, data, additionalHeaders) { + return this.request('POST', requestUrl, data, additionalHeaders || {}); } - } - - state.kind = 'scalar'; - state.result = ''; - captureStart = captureEnd = state.position; - hasPendingContent = false; - - while (ch !== 0) { - if (ch === 0x3A/* : */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - break; - } - - } else if (ch === 0x23/* # */) { - preceding = state.input.charCodeAt(state.position - 1); - - if (is_WS_OR_EOL(preceding)) { - break; - } - - } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || - withinFlowCollection && is_FLOW_INDICATOR(ch)) { - break; - - } else if (is_EOL(ch)) { - _line = state.line; - _lineStart = state.lineStart; - _lineIndent = state.lineIndent; - skipSeparationSpace(state, false, -1); - - if (state.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch = state.input.charCodeAt(state.position); - continue; - } else { - state.position = captureEnd; - state.line = _line; - state.lineStart = _lineStart; - state.lineIndent = _lineIndent; - break; - } + patch(requestUrl, data, additionalHeaders) { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); } - - if (hasPendingContent) { - captureSegment(state, captureStart, captureEnd, false); - writeFoldedLines(state, state.line - _line); - captureStart = captureEnd = state.position; - hasPendingContent = false; + put(requestUrl, data, additionalHeaders) { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); } - - if (!is_WHITE_SPACE(ch)) { - captureEnd = state.position + 1; + head(requestUrl, additionalHeaders) { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return this.request(verb, requestUrl, stream, additionalHeaders); + } + /** + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + */ + async getJson(requestUrl, additionalHeaders = {}) { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + let res = await this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async postJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async putJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async patchJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + async request(verb, requestUrl, data, headers) { + if (this._disposed) { + throw new Error('Client has already been disposed.'); + } + let parsedUrl = url.parse(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 + ? this._maxRetries + 1 + : 1; + let numTries = 0; + let response; + while (numTries < maxTries) { + response = await this.requestRaw(info, data); + // Check if it's an authentication challenge + if (response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (let i = 0; i < this.handlers.length; i++) { + if (this.handlers[i].canHandleAuthentication(response)) { + authenticationHandler = this.handlers[i]; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 && + this._allowRedirects && + redirectsRemaining > 0) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + let parsedRedirectUrl = url.parse(redirectUrl); + if (parsedUrl.protocol == 'https:' && + parsedUrl.protocol != parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade) { + throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + await response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (let header in headers) { + // header names are case insensitive + if (header.toLowerCase() === 'authorization') { + delete headers[header]; + } + } + } + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = await this.requestRaw(info, data); + redirectsRemaining--; + } + if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + await response.readBody(); + await this._performExponentialBackoff(numTries); + } + } + return response; + } + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info, data) { + return new Promise((resolve, reject) => { + let callbackForResult = function (err, res) { + if (err) { + reject(err); + } + resolve(res); + }; + this.requestRawWithCallback(info, data, callbackForResult); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + let socket; + if (typeof data === 'string') { + info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); + } + let callbackCalled = false; + let handleResult = (err, res) => { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + }; + let req = info.httpModule.request(info.options, (msg) => { + let res = new HttpClientResponse(msg); + handleResult(null, res); + }); + req.on('socket', sock => { + socket = sock; + }); + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { + if (socket) { + socket.end(); + } + handleResult(new Error('Request timeout: ' + info.options.path), null); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err, null); + }); + if (data && typeof data === 'string') { + req.write(data, 'utf8'); + } + if (data && typeof data !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); + } + else { + req.end(); + } + } + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + let parsedUrl = url.parse(serverUrl); + return this._getAgent(parsedUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port + ? parseInt(info.parsedUrl.port) + : defaultPort; + info.options.path = + (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers['user-agent'] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers) { + this.handlers.forEach(handler => { + handler.prepareRequest(info.options); + }); + } + return info; + } + _mergeHeaders(headers) { + const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent; + let proxyUrl = pm.getProxyUrl(parsedUrl); + let useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; + } + if (this._keepAlive && !useProxy) { + agent = this._agent; + } + // if agent is already assigned use that agent. + if (!!agent) { + return agent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (!!this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + if (useProxy) { + // If using proxy, need tunnel + if (!tunnel) { + tunnel = __webpack_require__(856); + } + const agentOptions = { + maxSockets: maxSockets, + keepAlive: this._keepAlive, + proxy: { + proxyAuth: proxyUrl.auth, + host: proxyUrl.hostname, + port: proxyUrl.port + } + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } + else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + // if reusing agent across request and tunneling agent isn't assigned create a new agent + if (this._keepAlive && !agent) { + const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; + } + // if not using private agent and tunnel agent isn't setup then use global agent + if (!agent) { + agent = usingSsl ? https.globalAgent : http.globalAgent; + } + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); + } + return agent; + } + _performExponentialBackoff(retryNumber) { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + } + static dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + let a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; + } + async _processResponse(res, options) { + return new Promise(async (resolve, reject) => { + const statusCode = res.message.statusCode; + const response = { + statusCode: statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode == HttpCodes.NotFound) { + resolve(response); + } + let obj; + let contents; + // get the result from the body + try { + contents = await res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, HttpClient.dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + response.result = obj; + } + response.headers = res.message.headers; + } + catch (err) { + // Invalid resource (contents not json); leaving result obj null + } + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; + } + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; + } + else { + msg = 'Failed request: (' + statusCode + ')'; + } + let err = new Error(msg); + // attach statusCode and body obj (if available) to the error object + err['statusCode'] = statusCode; + if (response.result) { + err['result'] = response.result; + } + reject(err); + } + else { + resolve(response); + } + }); } - - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, captureEnd, false); - - if (state.result) { - return true; - } - - state.kind = _kind; - state.result = _result; - return false; } +exports.HttpClient = HttpClient; -function readSingleQuotedScalar(state, nodeIndent) { - var ch, - captureStart, captureEnd; - ch = state.input.charCodeAt(state.position); +/***/ }), +/* 540 */ +/***/ (function(module) { - if (ch !== 0x27/* ' */) { - return false; +/** + * 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; +} - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; +module.exports = nativeKeysIn; - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x27/* ' */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - if (ch === 0x27/* ' */) { - captureStart = state.position; - state.position++; - captureEnd = state.position; - } else { - return true; - } +/***/ }), +/* 541 */, +/* 542 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; +var apply = __webpack_require__(512), + createCtor = __webpack_require__(322), + createHybrid = __webpack_require__(224), + createRecurry = __webpack_require__(673), + getHolder = __webpack_require__(683), + replaceHolders = __webpack_require__(944), + root = __webpack_require__(824); - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a single quoted scalar'); +/** + * 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); - } else { - state.position++; - captureEnd = state.position; + 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); - throwError(state, 'unexpected end of the stream within a single quoted scalar'); + 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; } -function readDoubleQuotedScalar(state, nodeIndent) { - var captureStart, - captureEnd, - hexLength, - hexResult, - tmp, - ch; +module.exports = createCurry; - ch = state.input.charCodeAt(state.position); - if (ch !== 0x22/* " */) { - return false; - } +/***/ }), +/* 543 */, +/* 544 */, +/* 545 */, +/* 546 */ +/***/ (function(module, exports, __webpack_require__) { - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; +/* module decorator */ module = __webpack_require__.nmd(module); +var root = __webpack_require__(824), + stubFalse = __webpack_require__(451); - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x22/* " */) { - captureSegment(state, captureStart, state.position, true); - state.position++; - return true; +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; - } else if (ch === 0x5C/* \ */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (is_EOL(ch)) { - skipSeparationSpace(state, false, nodeIndent); - - // TODO: rework to inline fn with no type cast? - } else if (ch < 256 && simpleEscapeCheck[ch]) { - state.result += simpleEscapeMap[ch]; - state.position++; +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; - for (; hexLength > 0; hexLength--) { - ch = state.input.charCodeAt(++state.position); +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; - if ((tmp = fromHexCode(ch)) >= 0) { - hexResult = (hexResult << 4) + tmp; +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; - } else { - throwError(state, 'expected hexadecimal character'); - } - } +/** + * 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; - state.result += charFromCodepoint(hexResult); +module.exports = isBuffer; - state.position++; - } else { - throwError(state, 'unknown escape sequence'); - } +/***/ }), +/* 547 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - captureStart = captureEnd = state.position; +var createCtor = __webpack_require__(322), + root = __webpack_require__(824); - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1; - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a double quoted scalar'); +/** + * 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); - } else { - state.position++; - captureEnd = state.position; - } + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); } - - throwError(state, 'unexpected end of the stream within a double quoted scalar'); + return wrapper; } -function readFlowCollection(state, nodeIndent) { - var readNext = true, - _line, - _tag = state.tag, - _result, - _anchor = state.anchor, - following, - terminator, - isPair, - isExplicitPair, - isMapping, - overridableKeys = {}, - keyNode, - keyTag, - valueNode, - ch; - - ch = state.input.charCodeAt(state.position); +module.exports = createBind; - if (ch === 0x5B/* [ */) { - terminator = 0x5D;/* ] */ - isMapping = false; - _result = []; - } else if (ch === 0x7B/* { */) { - terminator = 0x7D;/* } */ - isMapping = true; - _result = {}; - } else { - return false; - } - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } +/***/ }), +/* 548 */, +/* 549 */, +/* 550 */, +/* 551 */, +/* 552 */, +/* 553 */ +/***/ (function(module) { - ch = state.input.charCodeAt(++state.position); +/** + * 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 (ch !== 0) { - skipSeparationSpace(state, true, nodeIndent); + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} - ch = state.input.charCodeAt(state.position); +module.exports = baseTimes; - if (ch === terminator) { - state.position++; - state.tag = _tag; - state.anchor = _anchor; - state.kind = isMapping ? 'mapping' : 'sequence'; - state.result = _result; - return true; - } else if (!readNext) { - throwError(state, 'missed comma between flow collection entries'); - } - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; +/***/ }), +/* 554 */, +/* 555 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { - if (ch === 0x3F/* ? */) { - following = state.input.charCodeAt(state.position + 1); +"use strict"; - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; - state.position++; - skipSeparationSpace(state, true, nodeIndent); - } - } +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.runInstaller = exports.getLocalInstallerPath = void 0; +const path = __importStar(__webpack_require__(622)); +const core = __importStar(__webpack_require__(470)); +const utils = __importStar(__webpack_require__(567)); +const download_miniconda_1 = __webpack_require__(768); +const download_url_1 = __webpack_require__(339); +const bundled_miniconda_1 = __webpack_require__(468); +/** + * Providers of installers. + */ +const providers = [ + bundled_miniconda_1.bundledMinicondaUser, + download_url_1.urlDownloader, + download_miniconda_1.minicondaDownloader, +]; +/** see if any provider */ +function getLocalInstallerPath(inputs, options) { + return __awaiter(this, void 0, void 0, function* () { + for (const provider of providers) { + core.info(`Can we ${provider.label}?`); + if (yield provider.provides(inputs, options)) { + core.info(`... will ${provider.label}`); + return provider.installerPath(inputs, options); + } + } + throw Error(`No installer could be found for the given inputs`); + }); +} +exports.getLocalInstallerPath = getLocalInstallerPath; +/** + * Install Miniconda + * + * @param installerPath must have an appropriate extension for this platform + */ +function runInstaller(installerPath, outputPath) { + return __awaiter(this, void 0, void 0, function* () { + const installerExtension = path.extname(installerPath); + let command; + switch (installerExtension) { + case ".exe": + /* From https://docs.anaconda.com/anaconda/install/silent-mode/ + /D= - Destination installation path. + - Must be the last argument. + - Do not wrap in quotation marks. + - Required if you use /S. + For the above reasons, this is treated a monolithic arg + */ + command = [ + `"${installerPath}" /InstallationType=JustMe /RegisterPython=0 /S /D=${outputPath}`, + ]; + break; + case ".sh": + command = ["bash", installerPath, "-f", "-b", "-p", outputPath]; + break; + default: + throw Error(`Unknown installer extension: ${installerExtension}`); + } + yield utils.execute(command); + }); +} +exports.runInstaller = runInstaller; - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state.tag; - keyNode = state.result; - skipSeparationSpace(state, true, nodeIndent); - ch = state.input.charCodeAt(state.position); +/***/ }), +/* 556 */ +/***/ (function(module) { - if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { - isPair = true; - ch = state.input.charCodeAt(++state.position); - skipSeparationSpace(state, true, nodeIndent); - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state.result; - } +"use strict"; +// YAML error class. http://stackoverflow.com/questions/8458984 +// - if (isMapping) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); - } else if (isPair) { - _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); - } else { - _result.push(keyNode); - } - skipSeparationSpace(state, true, nodeIndent); +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); - ch = state.input.charCodeAt(state.position); + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); - if (ch === 0x2C/* , */) { - readNext = true; - ch = state.input.charCodeAt(++state.position); - } else { - readNext = false; - } + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; } - - throwError(state, 'unexpected end of the stream within a flow collection'); } -function readBlockScalar(state, nodeIndent) { - var captureStart, - folding, - chomping = CHOMPING_CLIP, - didReadContent = false, - detectedIndent = false, - textIndent = nodeIndent, - emptyLines = 0, - atMoreIndented = false, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x7C/* | */) { - folding = false; - } else if (ch === 0x3E/* > */) { - folding = true; - } else { - return false; - } - state.kind = 'scalar'; - state.result = ''; +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; - while (ch !== 0) { - ch = state.input.charCodeAt(++state.position); - if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { - if (CHOMPING_CLIP === chomping) { - chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; - } else { - throwError(state, 'repeat of a chomping mode identifier'); - } +YAMLException.prototype.toString = function toString(compact) { + var result = this.name + ': '; - } else if ((tmp = fromDecimalCode(ch)) >= 0) { - if (tmp === 0) { - throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); - } else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else { - throwError(state, 'repeat of an indentation width identifier'); - } + result += this.reason || '(unknown reason)'; - } else { - break; - } + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); } - if (is_WHITE_SPACE(ch)) { - do { ch = state.input.charCodeAt(++state.position); } - while (is_WHITE_SPACE(ch)); + return result; +}; - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (ch !== 0)); - } - } - while (ch !== 0) { - readLineBreak(state); - state.lineIndent = 0; +module.exports = YAMLException; - ch = state.input.charCodeAt(state.position); - while ((!detectedIndent || state.lineIndent < textIndent) && - (ch === 0x20/* Space */)) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } +/***/ }), +/* 557 */, +/* 558 */, +/* 559 */, +/* 560 */, +/* 561 */, +/* 562 */, +/* 563 */ +/***/ (function(module) { - if (!detectedIndent && state.lineIndent > textIndent) { - textIndent = state.lineIndent; - } +"use strict"; - if (is_EOL(ch)) { - emptyLines++; - continue; - } - // End of the scalar. - if (state.lineIndent < textIndent) { +const codes = {}; - // Perform the chomping. - if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } else if (chomping === CHOMPING_CLIP) { - if (didReadContent) { // i.e. only if the scalar is not empty. - state.result += '\n'; - } - } +function createErrorType(code, message, Base) { + if (!Base) { + Base = Error + } - // Break this `while` cycle and go to the funciton's epilogue. - break; + function getMessage (arg1, arg2, arg3) { + if (typeof message === 'string') { + return message + } else { + return message(arg1, arg2, arg3) } + } - // Folded style: use fancy rules to handle line breaks. - if (folding) { - - // Lines starting with white space characters (more-indented lines) are not folded. - if (is_WHITE_SPACE(ch)) { - atMoreIndented = true; - // except for the first content line (cf. Example 8.1) - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - - // End of more-indented block. - } else if (atMoreIndented) { - atMoreIndented = false; - state.result += common.repeat('\n', emptyLines + 1); + class NodeError extends Base { + constructor (arg1, arg2, arg3) { + super(getMessage(arg1, arg2, arg3)); + } + } - // Just one line break - perceive as the same line. - } else if (emptyLines === 0) { - if (didReadContent) { // i.e. only if we have already read some scalar content. - state.result += ' '; - } + NodeError.prototype.name = Base.name; + NodeError.prototype.code = code; - // Several line breaks - perceive as different lines. - } else { - state.result += common.repeat('\n', emptyLines); - } + codes[code] = NodeError; +} - // Literal style: just add exact number of line breaks between content lines. +// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js +function oneOf(expected, thing) { + if (Array.isArray(expected)) { + const len = expected.length; + expected = expected.map((i) => String(i)); + if (len > 2) { + return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + + expected[len - 1]; + } else if (len === 2) { + return `one of ${thing} ${expected[0]} or ${expected[1]}`; } else { - // Keep all line breaks except the header line break. - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + return `of ${thing} ${expected[0]}`; } + } else { + return `of ${thing} ${String(expected)}`; + } +} - didReadContent = true; - detectedIndent = true; - emptyLines = 0; - captureStart = state.position; +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith +function startsWith(str, search, pos) { + return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; +} - while (!is_EOL(ch) && (ch !== 0)) { - ch = state.input.charCodeAt(++state.position); - } +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith +function endsWith(str, search, this_len) { + if (this_len === undefined || this_len > str.length) { + this_len = str.length; + } + return str.substring(this_len - search.length, this_len) === search; +} - captureSegment(state, captureStart, state.position, false); +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes +function includes(str, search, start) { + if (typeof start !== 'number') { + start = 0; } - return true; + if (start + search.length > str.length) { + return false; + } else { + return str.indexOf(search, start) !== -1; + } } -function readBlockSequence(state, nodeIndent) { - var _line, - _tag = state.tag, - _anchor = state.anchor, - _result = [], - following, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; +createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { + return 'The value "' + value + '" is invalid for option "' + name + '"' +}, TypeError); +createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { + // determiner: 'must be' or 'must not be' + let determiner; + if (typeof expected === 'string' && startsWith(expected, 'not ')) { + determiner = 'must not be'; + expected = expected.replace(/^not /, ''); + } else { + determiner = 'must be'; } - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { + let msg; + if (endsWith(name, ' argument')) { + // For cases like 'first argument' + msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; + } else { + const type = includes(name, '.') ? 'property' : 'argument'; + msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; + } - if (ch !== 0x2D/* - */) { - break; - } - - following = state.input.charCodeAt(state.position + 1); - - if (!is_WS_OR_EOL(following)) { - break; - } - - detected = true; - state.position++; + msg += `. Received type ${typeof actual}`; + return msg; +}, TypeError); +createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); +createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { + return 'The ' + name + ' method is not implemented' +}); +createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); +createErrorType('ERR_STREAM_DESTROYED', function (name) { + return 'Cannot call ' + name + ' after a stream was destroyed'; +}); +createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); +createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); +createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); +createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); +createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { + return 'Unknown encoding: ' + arg +}, TypeError); +createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); - if (skipSeparationSpace(state, true, -1)) { - if (state.lineIndent <= nodeIndent) { - _result.push(null); - ch = state.input.charCodeAt(state.position); - continue; - } - } +module.exports.codes = codes; - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state.result); - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); +/***/ }), +/* 564 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { - throwError(state, 'bad indentation of a sequence entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } +var ListCache = __webpack_require__(670); - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'sequence'; - state.result = _result; - return true; - } - return false; +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; } -function readBlockMapping(state, nodeIndent, flowIndent) { - var following, - allowCompact, - _line, - _pos, - _tag = state.tag, - _anchor = state.anchor, - _result = {}, - overridableKeys = {}, - keyTag = null, - keyNode = null, - valueNode = null, - atExplicitKey = false, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } +module.exports = stackClear; - ch = state.input.charCodeAt(state.position); - while (ch !== 0) { - following = state.input.charCodeAt(state.position + 1); - _line = state.line; // Save the current line. - _pos = state.position; +/***/ }), +/* 565 */, +/* 566 */, +/* 567 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { - // - // Explicit notation case. There are two separate blocks: - // first for the key (denoted by "?") and second for the value (denoted by ":") - // - if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { +"use strict"; - if (ch === 0x3F/* ? */) { - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.execute = exports.makeSpec = exports.cacheFolder = exports.isBaseEnv = void 0; +const os = __importStar(__webpack_require__(87)); +const path = __importStar(__webpack_require__(622)); +const constants = __importStar(__webpack_require__(58)); +const core = __importStar(__webpack_require__(470)); +const stream = __importStar(__webpack_require__(413)); +const exec = __importStar(__webpack_require__(986)); +function isBaseEnv(envName) { + return constants.BASE_ENV_NAMES.includes(envName); +} +exports.isBaseEnv = isBaseEnv; +/** + * Get the cache folder + * + * TODO: this should probably be configurable + */ +function cacheFolder() { + return path.join(os.homedir(), constants.CONDA_CACHE_FOLDER); +} +exports.cacheFolder = cacheFolder; +/** + * create a spec string. Generally favors '=' unless specified more tightly + */ +function makeSpec(pkg, spec) { + if (spec.match(/=<>!\|/)) { + return `${pkg}${spec}`; + } + else { + return `${pkg}=${spec}`; + } +} +exports.makeSpec = makeSpec; +/** + * Run exec.exec with error handling + */ +function execute(command) { + return __awaiter(this, void 0, void 0, function* () { + let options = { + errStream: new stream.Writable(), + listeners: { + stdout: (data) => { + const stringData = data.toString(); + for (const forced_error of constants.FORCED_ERRORS) { + if (stringData.includes(forced_error)) { + throw new Error(`"${command}" failed with "${forced_error}"`); + } + } + return data; + }, + stderr: (data) => { + const stringData = data.toString(); + for (const ignore of constants.IGNORED_WARNINGS) { + if (stringData.includes(ignore)) { + return; + } + } + core.warning(stringData); + }, + }, + }; + const rc = yield exec.exec(command[0], command.slice(1), options); + if (rc !== 0) { + throw Error(`${command[0]} exited with error code ${rc}`); } + }); +} +exports.execute = execute; - detected = true; - atExplicitKey = true; - allowCompact = true; - } else if (atExplicitKey) { - // i.e. 0x3A/* : */ === character after the explicit key. - atExplicitKey = false; - allowCompact = true; +/***/ }), +/* 568 */, +/* 569 */, +/* 570 */, +/* 571 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - } else { - throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); - } +var baseFindIndex = __webpack_require__(288), + baseIsNaN = __webpack_require__(455), + strictIndexOf = __webpack_require__(34); - state.position += 1; - ch = following; +/** + * 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); +} - // - // Implicit notation case. Flow-style node as the key first, then ":", and the value. - // - } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { +module.exports = baseIndexOf; - if (state.line === _line) { - ch = state.input.charCodeAt(state.position); - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } +/***/ }), +/* 572 */, +/* 573 */, +/* 574 */ +/***/ (function(module, exports, __webpack_require__) { - if (ch === 0x3A/* : */) { - ch = state.input.charCodeAt(++state.position); +var Stream = __webpack_require__(413); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream.Readable; + Object.assign(module.exports, Stream); + module.exports.Stream = Stream; +} else { + exports = module.exports = __webpack_require__(226); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = __webpack_require__(241); + exports.Duplex = __webpack_require__(831); + exports.Transform = __webpack_require__(925); + exports.PassThrough = __webpack_require__(882); + exports.finished = __webpack_require__(740); + exports.pipeline = __webpack_require__(238); +} - if (!is_WS_OR_EOL(ch)) { - throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); - } - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } +/***/ }), +/* 575 */, +/* 576 */, +/* 577 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = state.tag; - keyNode = state.result; +"use strict"; - } else if (detected) { - throwError(state, 'can not read an implicit mapping pair; a colon is missed'); - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } +var Type = __webpack_require__(750); - } else if (detected) { - throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); - } else { - break; // Reading is done. Go to the epilogue. - } - // - // Common reading code for both explicit and implicit notations. - // - if (state.line === _line || state.lineIndent > nodeIndent) { - if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = state.result; - } else { - valueNode = state.result; - } - } +/***/ }), +/* 578 */, +/* 579 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - if (!atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); - keyTag = keyNode = valueNode = null; - } +var copyObject = __webpack_require__(875), + createAssigner = __webpack_require__(797), + keysIn = __webpack_require__(971); - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - } +/** + * 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); +}); - if (state.lineIndent > nodeIndent && (ch !== 0)) { - throwError(state, 'bad indentation of a mapping entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } +module.exports = assignIn; - // - // Epilogue. - // - // Special case: last mapping's node contains only the key in explicit notation. - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - } +/***/ }), +/* 580 */, +/* 581 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - // Expose the resulting mapping. - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'mapping'; - state.result = _result; - } +"use strict"; +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 - return detected; -} -function readTagProperty(state) { - var _position, - isVerbatim = false, - isNamed = false, - tagHandle, - tagName, - ch; - ch = state.input.charCodeAt(state.position); - if (ch !== 0x21/* ! */) return false; - if (state.tag !== null) { - throwError(state, 'duplication of a tag property'); - } +var Schema = __webpack_require__(43); - ch = state.input.charCodeAt(++state.position); - if (ch === 0x3C/* < */) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); +module.exports = new Schema({ + explicit: [ + __webpack_require__(450), + __webpack_require__(921), + __webpack_require__(24) + ] +}); - } else if (ch === 0x21/* ! */) { - isNamed = true; - tagHandle = '!!'; - ch = state.input.charCodeAt(++state.position); - } else { - tagHandle = '!'; - } +/***/ }), +/* 582 */, +/* 583 */ +/***/ (function(module) { - _position = state.position; +module.exports = require("https"); - if (isVerbatim) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && ch !== 0x3E/* > */); +/***/ }), +/* 584 */, +/* 585 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - if (state.position < state.length) { - tagName = state.input.slice(_position, state.position); - ch = state.input.charCodeAt(++state.position); - } else { - throwError(state, 'unexpected end of the stream within a verbatim tag'); - } - } else { - while (ch !== 0 && !is_WS_OR_EOL(ch)) { +var baseGetTag = __webpack_require__(51), + getPrototype = __webpack_require__(931), + isObjectLike = __webpack_require__(337); - if (ch === 0x21/* ! */) { - if (!isNamed) { - tagHandle = state.input.slice(_position - 1, state.position + 1); +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; - if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state, 'named tag handle cannot contain such characters'); - } +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; - isNamed = true; - _position = state.position + 1; - } else { - throwError(state, 'tag suffix cannot contain exclamation marks'); - } - } +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; - ch = state.input.charCodeAt(++state.position); - } +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - tagName = state.input.slice(_position, state.position); +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); - if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state, 'tag suffix cannot contain flow indicator characters'); - } +/** + * 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; } - - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state, 'tag name cannot contain such characters: ' + tagName); + 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; +} - if (isVerbatim) { - state.tag = tagName; - - } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { - state.tag = state.tagMap[tagHandle] + tagName; +module.exports = isPlainObject; - } else if (tagHandle === '!') { - state.tag = '!' + tagName; - } else if (tagHandle === '!!') { - state.tag = 'tag:yaml.org,2002:' + tagName; +/***/ }), +/* 586 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - } else { - throwError(state, 'undeclared tag handle "' + tagHandle + '"'); - } +var getAllKeys = __webpack_require__(706); - return true; -} +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; -function readAnchorProperty(state) { - var _position, - ch; +/** Used for built-in method references. */ +var objectProto = Object.prototype; - ch = state.input.charCodeAt(state.position); +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - if (ch !== 0x26/* & */) 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 (state.anchor !== null) { - throwError(state, 'duplication of an anchor property'); + if (objLength != othLength && !isPartial) { + return false; } - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } } - - if (state.position === _position) { - throwError(state, 'name of an anchor node must contain at least one character'); + // 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); - state.anchor = state.input.slice(_position, state.position); - return true; -} - -function readAlias(state) { - var _position, alias, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x2A/* * */) return false; - - ch = state.input.charCodeAt(++state.position); - _position = state.position; + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); + 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; - if (state.position === _position) { - throwError(state, 'name of an alias node must contain at least one character'); + // 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; +} - alias = state.input.slice(_position, state.position); +module.exports = equalObjects; - if (!state.anchorMap.hasOwnProperty(alias)) { - throwError(state, 'unidentified alias "' + alias + '"'); - } - state.result = state.anchorMap[alias]; - skipSeparationSpace(state, true, -1); - return true; -} +/***/ }), +/* 587 */ +/***/ (function(module, __unusedexports, __webpack_require__) { -function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, - allowBlockScalars, - allowBlockCollections, - indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ +var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); +}); - state.tag = null; - state.anchor = null; - state.kind = null; - state.result = null; +module.exports = merge; - allowBlockStyles = allowBlockScalars = allowBlockCollections = - CONTEXT_BLOCK_OUT === nodeContext || - CONTEXT_BLOCK_IN === nodeContext; - if (allowToSeek) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; +/***/ }), +/* 588 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { - if (state.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } - } +var ElementType = __webpack_require__(855); +var isTag = exports.isTag = ElementType.isTag; - if (indentStatus === 1) { - while (readTagProperty(state) || readAnchorProperty(state)) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; +exports.testElement = function(options, element){ + for(var key in options){ + if(!options.hasOwnProperty(key)); + else if(key === "tag_name"){ + if(!isTag(element) || !options.tag_name(element.name)){ + return false; + } + } else if(key === "tag_type"){ + if(!options.tag_type(element.type)) return false; + } else if(key === "tag_contains"){ + if(isTag(element) || !options.tag_contains(element.data)){ + return false; + } + } else if(!element.attribs || !options[key](element.attribs[key])){ + return false; + } + } + return true; +}; - if (state.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } else { - allowBlockCollections = false; - } - } - } +var Checks = { + tag_name: function(name){ + if(typeof name === "function"){ + return function(elem){ return isTag(elem) && name(elem.name); }; + } else if(name === "*"){ + return isTag; + } else { + return function(elem){ return isTag(elem) && elem.name === name; }; + } + }, + tag_type: function(type){ + if(typeof type === "function"){ + return function(elem){ return type(elem.type); }; + } else { + return function(elem){ return elem.type === type; }; + } + }, + tag_contains: function(data){ + if(typeof data === "function"){ + return function(elem){ return !isTag(elem) && data(elem.data); }; + } else { + return function(elem){ return !isTag(elem) && elem.data === data; }; + } + } +}; - if (allowBlockCollections) { - allowBlockCollections = atNewLine || allowCompact; - } +function getAttribCheck(attrib, value){ + if(typeof value === "function"){ + return function(elem){ return elem.attribs && value(elem.attribs[attrib]); }; + } else { + return function(elem){ return elem.attribs && elem.attribs[attrib] === value; }; + } +} - if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { - flowIndent = parentIndent; - } else { - flowIndent = parentIndent + 1; - } +function combineFuncs(a, b){ + return function(elem){ + return a(elem) || b(elem); + }; +} - blockIndent = state.position - state.lineStart; +exports.getElements = function(options, element, recurse, limit){ + var funcs = Object.keys(options).map(function(key){ + var value = options[key]; + return key in Checks ? Checks[key](value) : getAttribCheck(key, value); + }); - if (indentStatus === 1) { - if (allowBlockCollections && - (readBlockSequence(state, blockIndent) || - readBlockMapping(state, blockIndent, flowIndent)) || - readFlowCollection(state, flowIndent)) { - hasContent = true; - } else { - if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || - readSingleQuotedScalar(state, flowIndent) || - readDoubleQuotedScalar(state, flowIndent)) { - hasContent = true; + return funcs.length === 0 ? [] : this.filter( + funcs.reduce(combineFuncs), + element, recurse, limit + ); +}; - } else if (readAlias(state)) { - hasContent = true; +exports.getElementById = function(id, element, recurse){ + if(!Array.isArray(element)) element = [element]; + return this.findOne(getAttribCheck("id", id), element, recurse !== false); +}; - if (state.tag !== null || state.anchor !== null) { - throwError(state, 'alias node should not have any properties'); - } +exports.getElementsByTagName = function(name, element, recurse, limit){ + return this.filter(Checks.tag_name(name), element, recurse, limit); +}; - } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; +exports.getElementsByTagType = function(type, element, recurse, limit){ + return this.filter(Checks.tag_type(type), element, recurse, limit); +}; - if (state.tag === null) { - state.tag = '?'; - } - } - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else if (indentStatus === 0) { - // Special case: block sequences are allowed to have same indentation level as the parent. - // http://www.yaml.org/spec/1.2/spec.html#id2799784 - hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); - } - } +/***/ }), +/* 589 */ +/***/ (function(module, __unusedexports, __webpack_require__) { - if (state.tag !== null && state.tag !== '!') { - if (state.tag === '?') { - // Implicit resolving is not allowed for non-scalar types, and '?' - // non-specific tag is only automatically assigned to plain scalars. - // - // We only need to check kind conformity in case user explicitly assigns '?' - // tag, for example like this: "! [0]" - // - if (state.result !== null && state.kind !== 'scalar') { - throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); - } +/* + pseudo selectors - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { - type = state.implicitTypes[typeIndex]; + --- - if (type.resolve(state.result)) { // `state.result` updated in resolver if matched - state.result = type.construct(state.result); - state.tag = type.tag; - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - break; - } - } - } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { - type = state.typeMap[state.kind || 'fallback'][state.tag]; + they are available in two forms: + * filters called when the selector + is compiled and return a function + that needs to return next() + * pseudos get called on execution + they need to return a boolean +*/ - if (state.result !== null && type.kind !== state.kind) { - throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); - } +var DomUtils = __webpack_require__(104), + isTag = DomUtils.isTag, + getText = DomUtils.getText, + getParent = DomUtils.getParent, + getChildren = DomUtils.getChildren, + getSiblings = DomUtils.getSiblings, + hasAttrib = DomUtils.hasAttrib, + getName = DomUtils.getName, + getAttribute= DomUtils.getAttributeValue, + getNCheck = __webpack_require__(79), + checkAttrib = __webpack_require__(126).rules.equals, + BaseFuncs = __webpack_require__(312), + trueFunc = BaseFuncs.trueFunc, + falseFunc = BaseFuncs.falseFunc; - if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched - throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); - } else { - state.result = type.construct(state.result); - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else { - throwError(state, 'unknown tag !<' + state.tag + '>'); - } - } +//helper methods +function getFirstElement(elems){ + for(var i = 0; elems && i < elems.length; i++){ + if(isTag(elems[i])) return elems[i]; + } +} - if (state.listener !== null) { - state.listener('close', state); - } - return state.tag !== null || state.anchor !== null || hasContent; +function getAttribFunc(name, value){ + var data = {name: name, value: value}; + return function attribFunc(next){ + return checkAttrib(next, data); + }; } -function readDocument(state) { - var documentStart = state.position, - _position, - directiveName, - directiveArgs, - hasDirectives = false, - ch; +function getChildFunc(next){ + return function(elem){ + return !!getParent(elem) && next(elem); + }; +} - state.version = null; - state.checkLineBreaks = state.legacy; - state.tagMap = {}; - state.anchorMap = {}; +var filters = { + contains: function(next, text){ + return function contains(elem){ + return next(elem) && getText(elem).indexOf(text) >= 0; + }; + }, + icontains: function(next, text){ + var itext = text.toLowerCase(); + return function icontains(elem){ + return next(elem) && + getText(elem).toLowerCase().indexOf(itext) >= 0; + }; + }, - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - skipSeparationSpace(state, true, -1); + //location specific methods + "nth-child": function(next, rule){ + var func = getNCheck(rule); - ch = state.input.charCodeAt(state.position); + if(func === falseFunc) return func; + if(func === trueFunc) return getChildFunc(next); - if (state.lineIndent > 0 || ch !== 0x25/* % */) { - break; - } + return function nthChild(elem){ + var siblings = getSiblings(elem); - hasDirectives = true; - ch = state.input.charCodeAt(++state.position); - _position = state.position; + for(var i = 0, pos = 0; i < siblings.length; i++){ + if(isTag(siblings[i])){ + if(siblings[i] === elem) break; + else pos++; + } + } - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } + return func(pos) && next(elem); + }; + }, + "nth-last-child": function(next, rule){ + var func = getNCheck(rule); - directiveName = state.input.slice(_position, state.position); - directiveArgs = []; + if(func === falseFunc) return func; + if(func === trueFunc) return getChildFunc(next); - if (directiveName.length < 1) { - throwError(state, 'directive name must not be less than one character in length'); - } + return function nthLastChild(elem){ + var siblings = getSiblings(elem); - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } + for(var pos = 0, i = siblings.length - 1; i >= 0; i--){ + if(isTag(siblings[i])){ + if(siblings[i] === elem) break; + else pos++; + } + } - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && !is_EOL(ch)); - break; - } + return func(pos) && next(elem); + }; + }, + "nth-of-type": function(next, rule){ + var func = getNCheck(rule); - if (is_EOL(ch)) break; + if(func === falseFunc) return func; + if(func === trueFunc) return getChildFunc(next); - _position = state.position; + return function nthOfType(elem){ + var siblings = getSiblings(elem); - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } + for(var pos = 0, i = 0; i < siblings.length; i++){ + if(isTag(siblings[i])){ + if(siblings[i] === elem) break; + if(getName(siblings[i]) === getName(elem)) pos++; + } + } - directiveArgs.push(state.input.slice(_position, state.position)); - } + return func(pos) && next(elem); + }; + }, + "nth-last-of-type": function(next, rule){ + var func = getNCheck(rule); - if (ch !== 0) readLineBreak(state); + if(func === falseFunc) return func; + if(func === trueFunc) return getChildFunc(next); - if (_hasOwnProperty.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state, directiveName, directiveArgs); - } else { - throwWarning(state, 'unknown document directive "' + directiveName + '"'); - } - } + return function nthLastOfType(elem){ + var siblings = getSiblings(elem); - skipSeparationSpace(state, true, -1); + for(var pos = 0, i = siblings.length - 1; i >= 0; i--){ + if(isTag(siblings[i])){ + if(siblings[i] === elem) break; + if(getName(siblings[i]) === getName(elem)) pos++; + } + } - if (state.lineIndent === 0 && - state.input.charCodeAt(state.position) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { - state.position += 3; - skipSeparationSpace(state, true, -1); + return func(pos) && next(elem); + }; + }, - } else if (hasDirectives) { - throwError(state, 'directives end mark is expected'); - } + //TODO determine the actual root element + root: function(next){ + return function(elem){ + return !getParent(elem) && next(elem); + }; + }, - composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state, true, -1); + scope: function(next, rule, options, context){ + if(!context || context.length === 0){ + //equivalent to :root + return filters.root(next); + } - if (state.checkLineBreaks && - PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { - throwWarning(state, 'non-ASCII line breaks are interpreted as content'); - } + if(context.length === 1){ + //NOTE: can't be unpacked, as :has uses this for side-effects + return function(elem){ + return context[0] === elem && next(elem); + }; + } - state.documents.push(state.result); + return function(elem){ + return context.indexOf(elem) >= 0 && next(elem); + }; + }, - if (state.position === state.lineStart && testDocumentSeparator(state)) { + //jQuery extensions (others follow as pseudos) + checkbox: getAttribFunc("type", "checkbox"), + file: getAttribFunc("type", "file"), + password: getAttribFunc("type", "password"), + radio: getAttribFunc("type", "radio"), + reset: getAttribFunc("type", "reset"), + image: getAttribFunc("type", "image"), + submit: getAttribFunc("type", "submit") +}; - if (state.input.charCodeAt(state.position) === 0x2E/* . */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - } - return; - } +//while filters are precompiled, pseudos get called when they are needed +var pseudos = { + empty: function(elem){ + return !getChildren(elem).some(function(elem){ + return isTag(elem) || elem.type === "text"; + }); + }, - if (state.position < (state.length - 1)) { - throwError(state, 'end of the stream or a document separator is expected'); - } else { - return; - } -} + "first-child": function(elem){ + return getFirstElement(getSiblings(elem)) === elem; + }, + "last-child": function(elem){ + var siblings = getSiblings(elem); + for(var i = siblings.length - 1; i >= 0; i--){ + if(siblings[i] === elem) return true; + if(isTag(siblings[i])) break; + } -function loadDocuments(input, options) { - input = String(input); - options = options || {}; + return false; + }, + "first-of-type": function(elem){ + var siblings = getSiblings(elem); - if (input.length !== 0) { + for(var i = 0; i < siblings.length; i++){ + if(isTag(siblings[i])){ + if(siblings[i] === elem) return true; + if(getName(siblings[i]) === getName(elem)) break; + } + } - // Add tailing `\n` if not exists - if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && - input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { - input += '\n'; - } + return false; + }, + "last-of-type": function(elem){ + var siblings = getSiblings(elem); - // Strip BOM - if (input.charCodeAt(0) === 0xFEFF) { - input = input.slice(1); - } - } + for(var i = siblings.length-1; i >= 0; i--){ + if(isTag(siblings[i])){ + if(siblings[i] === elem) return true; + if(getName(siblings[i]) === getName(elem)) break; + } + } - var state = new State(input, options); + return false; + }, + "only-of-type": function(elem){ + var siblings = getSiblings(elem); - var nullpos = input.indexOf('\0'); + for(var i = 0, j = siblings.length; i < j; i++){ + if(isTag(siblings[i])){ + if(siblings[i] === elem) continue; + if(getName(siblings[i]) === getName(elem)) return false; + } + } - if (nullpos !== -1) { - state.position = nullpos; - throwError(state, 'null byte is not allowed in input'); - } + return true; + }, + "only-child": function(elem){ + var siblings = getSiblings(elem); - // Use 0 as string terminator. That significantly simplifies bounds check. - state.input += '\0'; + for(var i = 0; i < siblings.length; i++){ + if(isTag(siblings[i]) && siblings[i] !== elem) return false; + } - while (state.input.charCodeAt(state.position) === 0x20/* Space */) { - state.lineIndent += 1; - state.position += 1; - } + return true; + }, - while (state.position < (state.length - 1)) { - readDocument(state); - } + //:matches(a, area, link)[href] + link: function(elem){ + return hasAttrib(elem, "href"); + }, + visited: falseFunc, //seems to be a valid implementation + //TODO: :any-link once the name is finalized (as an alias of :link) - return state.documents; -} + //forms + //to consider: :target + //:matches([selected], select:not([multiple]):not(> option[selected]) > option:first-of-type) + selected: function(elem){ + if(hasAttrib(elem, "selected")) return true; + else if(getName(elem) !== "option") return false; -function loadAll(input, iterator, options) { - if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { - options = iterator; - iterator = null; - } + //the first