diff --git a/.github/composite_actions/log_cw_metric/action.yaml b/.github/composite_actions/log_cw_metric/action.yaml new file mode 100644 index 0000000000..a7fa41ea7c --- /dev/null +++ b/.github/composite_actions/log_cw_metric/action.yaml @@ -0,0 +1,61 @@ +name: Log CW Metric +description: Test to log a CW metric +inputs: + # For getting failing step + job-status: + description: Used to determine if we track success or failure. + required: true + job-identifier: + description: For differentiating jobs of a run. + required: true + github-token: + required: true + description: Github token for requesting failing steps. + repo: + required: true + description: Github repo + run-id: + required: true + description: Github Action Run Id + + # Global Metric Dimensions + metricName: + description: Name of the metric to track in Cloudwatch. + required: true + testType: + description: canary, integration, unit testType. + required: true + category: + description: analytics, api, authenticator, etc. + required: true + workflowName: + description: The Github Action workflow.yaml file name. ie "AmplifyCanaries". + required: true + + # FlutterDart Workflows Metric Dimensions + framework: + description: flutter, dart. + required: false + flutterDartChannel: + description: beta, stable. + required: false + dartVersion: + description: 3, 2.19, 2.18, etc. + required: false + flutterVersion: + description: 3.10.6, 3.10.5, etc. + required: false + dartCompiler: + description: dart2js, ddc, dart, dart2wasm. + required: false + + # Platform Workflows Metric Dimensions + platform: + description: android, ios, web, linux, windows. + required: false + platformVersion: + description: ios-14.5, ios-16, android-25-x86, etc. + required: false +runs: + using: "node16" + main: "dist/index.mjs" diff --git a/.github/composite_actions/log_cw_metric/dist/index.mjs b/.github/composite_actions/log_cw_metric/dist/index.mjs new file mode 100644 index 0000000000..f88759e1b9 --- /dev/null +++ b/.github/composite_actions/log_cw_metric/dist/index.mjs @@ -0,0 +1,6953 @@ +import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; +/******/ var __webpack_modules__ = ({ + +/***/ 9483: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +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.issue = exports.issueCommand = void 0; +const os = __importStar(__nccwpck_require__(2037)); +const utils_1 = __nccwpck_require__(2994); +/** + * 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 + +/***/ }), + +/***/ 7733: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +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.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; +const command_1 = __nccwpck_require__(9483); +const file_command_1 = __nccwpck_require__(8541); +const utils_1 = __nccwpck_require__(2994); +const os = __importStar(__nccwpck_require__(2037)); +const path = __importStar(__nccwpck_require__(1017)); +const oidc_utils_1 = __nccwpck_require__(2422); +/** + * 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) { + return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val)); + } + 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.issueFileCommand('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. + * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. + * Returns an empty string if the value is not defined. + * + * @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}`); + } + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); +} +exports.getInput = getInput; +/** + * Gets the values of an multiline input. Each value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string[] + * + */ +function getMultilineInput(name, options) { + const inputs = getInput(name, options) + .split('\n') + .filter(x => x !== ''); + if (options && options.trimWhitespace === false) { + return inputs; + } + return inputs.map(input => input.trim()); +} +exports.getMultilineInput = getMultilineInput; +/** + * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. + * Support boolean input list: `true | True | TRUE | false | False | FALSE` . + * The return value is also in boolean type. + * ref: https://yaml.org/spec/1.2/spec.html#id2804923 + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns boolean + */ +function getBooleanInput(name, options) { + const trueValue = ['true', 'True', 'TRUE']; + const falseValue = ['false', 'False', 'FALSE']; + const val = getInput(name, options); + if (trueValue.includes(val)) + return true; + if (falseValue.includes(val)) + return false; + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); +} +exports.getBooleanInput = getBooleanInput; +/** + * 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) { + const filePath = process.env['GITHUB_OUTPUT'] || ''; + if (filePath) { + return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value)); + } + process.stdout.write(os.EOL); + command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(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() + * @param properties optional properties to add to the annotation. + */ +function error(message, properties = {}) { + command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +exports.error = error; +/** + * Adds a warning issue + * @param message warning issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ +function warning(message, properties = {}) { + command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +exports.warning = warning; +/** + * Adds a notice issue + * @param message notice issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ +function notice(message, properties = {}) { + command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +exports.notice = notice; +/** + * 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) { + const filePath = process.env['GITHUB_STATE'] || ''; + if (filePath) { + return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value)); + } + command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(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; +function getIDToken(aud) { + return __awaiter(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); +} +exports.getIDToken = getIDToken; +/** + * Summary exports + */ +var summary_1 = __nccwpck_require__(513); +Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); +/** + * @deprecated use core.summary + */ +var summary_2 = __nccwpck_require__(513); +Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); +/** + * Path exports + */ +var path_utils_1 = __nccwpck_require__(3084); +Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); +Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); +Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); +//# sourceMappingURL=core.js.map + +/***/ }), + +/***/ 8541: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +// For internal use, subject to change. +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.prepareKeyValueMessage = exports.issueFileCommand = void 0; +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +const fs = __importStar(__nccwpck_require__(7147)); +const os = __importStar(__nccwpck_require__(2037)); +const uuid_1 = __nccwpck_require__(2033); +const utils_1 = __nccwpck_require__(2994); +function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); + } + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + encoding: 'utf8' + }); +} +exports.issueFileCommand = issueFileCommand; +function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${uuid_1.v4()}`; + const convertedValue = utils_1.toCommandValue(value); + // These should realistically never happen, but just in case someone finds a + // way to exploit uuid generation let's not allow keys or values that contain + // the delimiter. + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); + } + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; +} +exports.prepareKeyValueMessage = prepareKeyValueMessage; +//# sourceMappingURL=file-command.js.map + +/***/ }), + +/***/ 2422: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +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.OidcClient = void 0; +const http_client_1 = __nccwpck_require__(4284); +const auth_1 = __nccwpck_require__(5479); +const core_1 = __nccwpck_require__(7733); +class OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry + }; + return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions); + } + static getRequestToken() { + const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN']; + if (!token) { + throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable'); + } + return token; + } + static getIDTokenUrl() { + const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL']; + if (!runtimeUrl) { + throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable'); + } + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const httpclient = OidcClient.createHttpClient(); + const res = yield httpclient + .getJson(id_token_url) + .catch(error => { + throw new Error(`Failed to get ID Token. \n + Error Code : ${error.statusCode}\n + Error Message: ${error.result.message}`); + }); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error('Response json body do not have ID Token field'); + } + return id_token; + }); + } + static getIDToken(audience) { + return __awaiter(this, void 0, void 0, function* () { + try { + // New ID Token is requested from action service + let id_token_url = OidcClient.getIDTokenUrl(); + if (audience) { + const encodedAudience = encodeURIComponent(audience); + id_token_url = `${id_token_url}&audience=${encodedAudience}`; + } + core_1.debug(`ID token url is ${id_token_url}`); + const id_token = yield OidcClient.getCall(id_token_url); + core_1.setSecret(id_token); + return id_token; + } + catch (error) { + throw new Error(`Error message: ${error.message}`); + } + }); + } +} +exports.OidcClient = OidcClient; +//# sourceMappingURL=oidc-utils.js.map + +/***/ }), + +/***/ 3084: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +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.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; +const path = __importStar(__nccwpck_require__(1017)); +/** + * toPosixPath converts the given path to the posix form. On Windows, \\ will be + * replaced with /. + * + * @param pth. Path to transform. + * @return string Posix path. + */ +function toPosixPath(pth) { + return pth.replace(/[\\]/g, '/'); +} +exports.toPosixPath = toPosixPath; +/** + * toWin32Path converts the given path to the win32 form. On Linux, / will be + * replaced with \\. + * + * @param pth. Path to transform. + * @return string Win32 path. + */ +function toWin32Path(pth) { + return pth.replace(/[/]/g, '\\'); +} +exports.toWin32Path = toWin32Path; +/** + * toPlatformPath converts the given path to a platform-specific path. It does + * this by replacing instances of / and \ with the platform-specific path + * separator. + * + * @param pth The path to platformize. + * @return string The platform-specific path. + */ +function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path.sep); +} +exports.toPlatformPath = toPlatformPath; +//# sourceMappingURL=path-utils.js.map + +/***/ }), + +/***/ 513: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +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.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; +const os_1 = __nccwpck_require__(2037); +const fs_1 = __nccwpck_require__(7147); +const { access, appendFile, writeFile } = fs_1.promises; +exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; +exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; +class Summary { + constructor() { + this._buffer = ''; + } + /** + * Finds the summary file path from the environment, rejects if env var is not found or file does not exist + * Also checks r/w permissions. + * + * @returns step summary file path + */ + filePath() { + return __awaiter(this, void 0, void 0, function* () { + if (this._filePath) { + return this._filePath; + } + const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; + if (!pathFromEnv) { + throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); + } + try { + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } + catch (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); + } + /** + * Wraps content in an HTML tag, adding any HTML attributes + * + * @param {string} tag HTML tag to wrap + * @param {string | null} content content within the tag + * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add + * + * @returns {string} content wrapped in HTML element + */ + wrap(tag, content, attrs = {}) { + const htmlAttrs = Object.entries(attrs) + .map(([key, value]) => ` ${key}="${value}"`) + .join(''); + if (!content) { + return `<${tag}${htmlAttrs}>`; + } + return `<${tag}${htmlAttrs}>${content}`; + } + /** + * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. + * + * @param {SummaryWriteOptions} [options] (optional) options for write operation + * + * @returns {Promise} summary instance + */ + write(options) { + return __awaiter(this, void 0, void 0, function* () { + const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); + const filePath = yield this.filePath(); + const writeFunc = overwrite ? writeFile : appendFile; + yield writeFunc(filePath, this._buffer, { encoding: 'utf8' }); + return this.emptyBuffer(); + }); + } + /** + * Clears the summary buffer and wipes the summary file + * + * @returns {Summary} summary instance + */ + clear() { + return __awaiter(this, void 0, void 0, function* () { + return this.emptyBuffer().write({ overwrite: true }); + }); + } + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; + } + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; + } + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ''; + return this; + } + /** + * Adds raw text to the summary buffer + * + * @param {string} text content to add + * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) + * + * @returns {Summary} summary instance + */ + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; + } + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); + } + /** + * Adds an HTML codeblock to the summary buffer + * + * @param {string} code content to render within fenced code block + * @param {string} lang (optional) language to syntax highlight code + * + * @returns {Summary} summary instance + */ + addCodeBlock(code, lang) { + const attrs = Object.assign({}, (lang && { lang })); + const element = this.wrap('pre', this.wrap('code', code), attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML list to the summary buffer + * + * @param {string[]} items list of items to render + * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) + * + * @returns {Summary} summary instance + */ + addList(items, ordered = false) { + const tag = ordered ? 'ol' : 'ul'; + const listItems = items.map(item => this.wrap('li', item)).join(''); + const element = this.wrap(tag, listItems); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML table to the summary buffer + * + * @param {SummaryTableCell[]} rows table rows + * + * @returns {Summary} summary instance + */ + addTable(rows) { + const tableBody = rows + .map(row => { + const cells = row + .map(cell => { + if (typeof cell === 'string') { + return this.wrap('td', cell); + } + const { header, data, colspan, rowspan } = cell; + const tag = header ? 'th' : 'td'; + const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan })); + return this.wrap(tag, data, attrs); + }) + .join(''); + return this.wrap('tr', cells); + }) + .join(''); + const element = this.wrap('table', tableBody); + return this.addRaw(element).addEOL(); + } + /** + * Adds a collapsable HTML details element to the summary buffer + * + * @param {string} label text for the closed state + * @param {string} content collapsable content + * + * @returns {Summary} summary instance + */ + addDetails(label, content) { + const element = this.wrap('details', this.wrap('summary', label) + content); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML image tag to the summary buffer + * + * @param {string} src path to the image you to embed + * @param {string} alt text description of the image + * @param {SummaryImageOptions} options (optional) addition image attributes + * + * @returns {Summary} summary instance + */ + addImage(src, alt, options) { + const { width, height } = options || {}; + const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height })); + const element = this.wrap('img', null, Object.assign({ src, alt }, attrs)); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML section heading element + * + * @param {string} text heading text + * @param {number | string} [level=1] (optional) the heading level, default: 1 + * + * @returns {Summary} summary instance + */ + addHeading(text, level) { + const tag = `h${level}`; + const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag) + ? tag + : 'h1'; + const element = this.wrap(allowedTag, text); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML thematic break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addSeparator() { + const element = this.wrap('hr', null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML line break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addBreak() { + const element = this.wrap('br', null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML blockquote to the summary buffer + * + * @param {string} text quote text + * @param {string} cite (optional) citation url + * + * @returns {Summary} summary instance + */ + addQuote(text, cite) { + const attrs = Object.assign({}, (cite && { cite })); + const element = this.wrap('blockquote', text, attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML anchor tag to the summary buffer + * + * @param {string} text link text/content + * @param {string} href hyperlink + * + * @returns {Summary} summary instance + */ + addLink(text, href) { + const element = this.wrap('a', text, { href }); + return this.addRaw(element).addEOL(); + } +} +const _summary = new Summary(); +/** + * @deprecated use `core.summary` + */ +exports.markdownSummary = _summary; +exports.summary = _summary; +//# sourceMappingURL=summary.js.map + +/***/ }), + +/***/ 2994: +/***/ ((__unused_webpack_module, exports) => { + + +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toCommandProperties = exports.toCommandValue = void 0; +/** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ +function toCommandValue(input) { + if (input === null || input === undefined) { + return ''; + } + else if (typeof input === 'string' || input instanceof String) { + return input; + } + return JSON.stringify(input); +} +exports.toCommandValue = toCommandValue; +/** + * + * @param annotationProperties + * @returns The command properties to send with the actual annotation command + * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 + */ +function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; + } + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn + }; +} +exports.toCommandProperties = toCommandProperties; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 1757: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +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.getExecOutput = exports.exec = void 0; +const string_decoder_1 = __nccwpck_require__(1576); +const tr = __importStar(__nccwpck_require__(4626)); +/** + * 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; +/** + * Exec a command and get the output. + * Output will be streamed to the live console. + * Returns promise with the exit code and collected stdout and stderr + * + * @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, stdout, and stderr + */ +function getExecOutput(commandLine, args, options) { + var _a, _b; + return __awaiter(this, void 0, void 0, function* () { + let stdout = ''; + let stderr = ''; + //Using string decoder covers the case where a mult-byte character is split + const stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); + const stderrDecoder = new string_decoder_1.StringDecoder('utf8'); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; + const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; + const stdErrListener = (data) => { + stderr += stderrDecoder.write(data); + if (originalStdErrListener) { + originalStdErrListener(data); + } + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); + } + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + //flush any remaining characters + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); +} +exports.getExecOutput = getExecOutput; +//# sourceMappingURL=exec.js.map + +/***/ }), + +/***/ 4626: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +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.argStringToArray = exports.ToolRunner = void 0; +const os = __importStar(__nccwpck_require__(2037)); +const events = __importStar(__nccwpck_require__(2361)); +const child = __importStar(__nccwpck_require__(2081)); +const path = __importStar(__nccwpck_require__(1017)); +const io = __importStar(__nccwpck_require__(8629)); +const ioUtil = __importStar(__nccwpck_require__(2548)); +const timers_1 = __nccwpck_require__(9512); +/* 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); + } + return s; + } + catch (err) { + // streaming lines to console is best effort. Don't fail a build. + this._debug(`error processing line. Failed with error ${err}`); + return ''; + } + } + _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) => __awaiter(this, void 0, void 0, function* () { + 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); + }); + if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { + return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + } + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + let 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); + } + stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + let 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); + } + errbuffer = 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 = timers_1.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 + +/***/ }), + +/***/ 5479: +/***/ (function(__unused_webpack_module, exports) { + + +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.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; +class BasicCredentialHandler { + constructor(username, password) { + this.username = username; + this.password = password; + } + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } +} +exports.BasicCredentialHandler = BasicCredentialHandler; +class BearerCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Bearer ${this.token}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } +} +exports.BearerCredentialHandler = BearerCredentialHandler; +class PersonalAccessTokenCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } +} +exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; +//# sourceMappingURL=auth.js.map + +/***/ }), + +/***/ 4284: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +/* eslint-disable @typescript-eslint/no-explicit-any */ +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.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; +const http = __importStar(__nccwpck_require__(3685)); +const https = __importStar(__nccwpck_require__(5687)); +const pm = __importStar(__nccwpck_require__(2923)); +const tunnel = __importStar(__nccwpck_require__(4249)); +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) { + const proxyUrl = pm.getProxyUrl(new URL(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 HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = 'HttpClientError'; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); + } +} +exports.HttpClientError = HttpClientError; +class HttpClientResponse { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + const chunks = []; + this.message.on('data', (chunk) => { + chunks.push(chunk); + }); + this.message.on('end', () => { + resolve(Buffer.concat(chunks)); + }); + })); + }); + } +} +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + const parsedUrl = new URL(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; + } + } + } + options(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + }); + } + get(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + }); + } + del(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + }); + } + post(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + }); + } + patch(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + }); + } + put(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + }); + } + head(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + }); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + 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 + */ + getJson(requestUrl, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + const res = yield this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + postJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const 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); + const res = yield this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + putJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const 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); + const res = yield this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + patchJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const 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); + const res = yield 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 + */ + request(verb, requestUrl, data, headers) { + return __awaiter(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error('Client has already been disposed.'); + } + const parsedUrl = new URL(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) + ? this._maxRetries + 1 + : 1; + let numTries = 0; + let response; + do { + response = yield this.requestRaw(info, data); + // Check if it's an authentication challenge + if (response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + 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 (response.message.statusCode && + HttpRedirectCodes.includes(response.message.statusCode) && + this._allowRedirects && + redirectsRemaining > 0) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + const parsedRedirectUrl = new URL(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. + yield response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const 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 = yield this.requestRaw(info, data); + redirectsRemaining--; + } + if (!response.message.statusCode || + !HttpResponseRetryCodes.includes(response.message.statusCode)) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } + } while (numTries < maxTries); + 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 __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } + else if (!res) { + // If `err` is not passed, then `res` must be passed. + reject(new Error('Unknown error')); + } + else { + resolve(res); + } + } + this.requestRawWithCallback(info, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + if (typeof data === 'string') { + if (!info.options.headers) { + info.options.headers = {}; + } + info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info.httpModule.request(info.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(undefined, res); + }); + let socket; + 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}`)); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err); + }); + 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) { + const parsedUrl = new URL(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) { + for (const handler of this.handlers) { + handler.prepareRequest(info.options); + } + } + return info; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const 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; + } + // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. + if (proxyUrl && proxyUrl.hostname) { + const agentOptions = { + maxSockets, + keepAlive: this._keepAlive, + proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + })), { 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 }; + 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) { + return __awaiter(this, void 0, void 0, function* () { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode === HttpCodes.NotFound) { + resolve(response); + } + // get the result from the body + function dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; + } + let obj; + let contents; + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, 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})`; + } + const err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); + } + else { + resolve(response); + } + })); + }); + } +} +exports.HttpClient = HttpClient; +const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 2923: +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.checkBypass = exports.getProxyUrl = void 0; +function getProxyUrl(reqUrl) { + const usingSsl = reqUrl.protocol === 'https:'; + if (checkBypass(reqUrl)) { + return undefined; + } + const proxyVar = (() => { + if (usingSsl) { + return process.env['https_proxy'] || process.env['HTTPS_PROXY']; + } + else { + return process.env['http_proxy'] || process.env['HTTP_PROXY']; + } + })(); + if (proxyVar) { + try { + return new URL(proxyVar); + } + catch (_a) { + if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) + return new URL(`http://${proxyVar}`); + } + } + else { + return undefined; + } +} +exports.getProxyUrl = getProxyUrl; +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } + const 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 + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === 'number') { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + // Compare request host against noproxy + for (const upperNoProxyItem of noProxy + .split(',') + .map(x => x.trim().toUpperCase()) + .filter(x => x)) { + if (upperNoProxyItem === '*' || + upperReqHosts.some(x => x === upperNoProxyItem || + x.endsWith(`.${upperNoProxyItem}`) || + (upperNoProxyItem.startsWith('.') && + x.endsWith(`${upperNoProxyItem}`)))) { + return true; + } + } + return false; +} +exports.checkBypass = checkBypass; +function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return (hostLower === 'localhost' || + hostLower.startsWith('127.') || + hostLower.startsWith('[::1]') || + hostLower.startsWith('[0:0:0:0:0:0:0:1]')); +} +//# sourceMappingURL=proxy.js.map + +/***/ }), + +/***/ 2548: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +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()); + }); +}; +var _a; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; +const fs = __importStar(__nccwpck_require__(7147)); +const path = __importStar(__nccwpck_require__(1017)); +_a = fs.promises +// export const {open} = 'fs' +, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +// export const {open} = 'fs' +exports.IS_WINDOWS = process.platform === 'win32'; +// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 +exports.UV_FS_O_EXLOCK = 0x10000000; +exports.READONLY = fs.constants.O_RDONLY; +function exists(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield exports.stat(fsPath); + } + catch (err) { + if (err.code === 'ENOENT') { + return false; + } + throw err; + } + return true; + }); +} +exports.exists = exists; +function isDirectory(fsPath, useStat = false) { + return __awaiter(this, void 0, void 0, function* () { + const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); + return stats.isDirectory(); + }); +} +exports.isDirectory = isDirectory; +/** + * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: + * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). + */ +function isRooted(p) { + p = normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); + } + if (exports.IS_WINDOWS) { + return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello + ); // e.g. C: or C:\hello + } + return p.startsWith('/'); +} +exports.isRooted = isRooted; +/** + * Best effort attempt to determine whether a file exists and is executable. + * @param filePath file path to check + * @param extensions additional file extensions to try + * @return if file exists and is executable, returns the file path. otherwise empty string. + */ +function tryGetExecutablePath(filePath, extensions) { + return __awaiter(this, void 0, void 0, function* () { + let stats = undefined; + try { + // test file exists + stats = yield exports.stat(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + // on Windows, test for valid extension + const upperExt = path.extname(filePath).toUpperCase(); + if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { + return filePath; + } + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + // try each extension + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = undefined; + try { + stats = yield exports.stat(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + // preserve the case of the actual file (since an extension was appended) + try { + const directory = path.dirname(filePath); + const upperName = path.basename(filePath).toUpperCase(); + for (const actualName of yield exports.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path.join(directory, actualName); + break; + } + } + } + catch (err) { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); + } + return filePath; + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + } + return ''; + }); +} +exports.tryGetExecutablePath = tryGetExecutablePath; +function normalizeSeparators(p) { + p = p || ''; + if (exports.IS_WINDOWS) { + // convert slashes on Windows + p = p.replace(/\//g, '\\'); + // remove redundant slashes + return p.replace(/\\\\+/g, '\\'); + } + // remove redundant slashes + return p.replace(/\/\/+/g, '/'); +} +// on Mac/Linux, test the execute bit +// R W X R W X R W X +// 256 128 64 32 16 8 4 2 1 +function isUnixExecutable(stats) { + return ((stats.mode & 1) > 0 || + ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || + ((stats.mode & 64) > 0 && stats.uid === process.getuid())); +} +// Get the path of cmd.exe in windows +function getCmdPath() { + var _a; + return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; +} +exports.getCmdPath = getCmdPath; +//# sourceMappingURL=io-util.js.map + +/***/ }), + +/***/ 8629: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +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.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; +const assert_1 = __nccwpck_require__(9491); +const path = __importStar(__nccwpck_require__(1017)); +const ioUtil = __importStar(__nccwpck_require__(2548)); +/** + * Copies a file or folder. + * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js + * + * @param source source path + * @param dest destination path + * @param options optional. See CopyOptions. + */ +function cp(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + const { force, recursive, copySourceDirectory } = readCopyOptions(options); + const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; + // Dest is an existing file, but not forcing + if (destStat && destStat.isFile() && !force) { + return; + } + // If dest is an existing directory, should copy inside. + const newDest = destStat && destStat.isDirectory() && copySourceDirectory + ? path.join(dest, path.basename(source)) + : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); + } + const sourceStat = yield ioUtil.stat(source); + if (sourceStat.isDirectory()) { + if (!recursive) { + throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); + } + else { + yield cpDirRecursive(source, newDest, 0, force); + } + } + else { + if (path.relative(source, newDest) === '') { + // a file cannot be copied to itself + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); + } + }); +} +exports.cp = cp; +/** + * Moves a path. + * + * @param source source path + * @param dest destination path + * @param options optional. See MoveOptions. + */ +function mv(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + if (yield ioUtil.exists(dest)) { + let destExists = true; + if (yield ioUtil.isDirectory(dest)) { + // If dest is directory copy src into dest + dest = path.join(dest, path.basename(source)); + destExists = yield ioUtil.exists(dest); + } + if (destExists) { + if (options.force == null || options.force) { + yield rmRF(dest); + } + else { + throw new Error('Destination already exists'); + } + } + } + yield mkdirP(path.dirname(dest)); + yield ioUtil.rename(source, dest); + }); +} +exports.mv = mv; +/** + * Remove a path recursively with force + * + * @param inputPath path to remove + */ +function rmRF(inputPath) { + return __awaiter(this, void 0, void 0, function* () { + if (ioUtil.IS_WINDOWS) { + // Check for invalid characters + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + if (/[*"<>|]/.test(inputPath)) { + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + } + } + try { + // note if path does not exist, error is silent + yield ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } + catch (err) { + throw new Error(`File was unable to be removed ${err}`); + } + }); +} +exports.rmRF = rmRF; +/** + * Make a directory. Creates the full path with folders in between + * Will throw if it fails + * + * @param fsPath path to create + * @returns Promise + */ +function mkdirP(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + assert_1.ok(fsPath, 'a path argument must be provided'); + yield ioUtil.mkdir(fsPath, { recursive: true }); + }); +} +exports.mkdirP = mkdirP; +/** + * Returns path of a tool had the tool actually been invoked. Resolves via paths. + * If you check and the tool does not exist, it will throw. + * + * @param tool name of the tool + * @param check whether to check if tool exists + * @returns Promise path to tool + */ +function which(tool, check) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // recursive when check=true + if (check) { + const result = yield which(tool, false); + if (!result) { + if (ioUtil.IS_WINDOWS) { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); + } + else { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + } + } + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ''; + }); +} +exports.which = which; +/** + * Returns a list of all occurrences of the given tool on the system path. + * + * @returns Promise the paths of the tool + */ +function findInPath(tool) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // build the list of extensions to try + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { + for (const extension of process.env['PATHEXT'].split(path.delimiter)) { + if (extension) { + extensions.push(extension); + } + } + } + // if it's rooted, return it if exists. otherwise return empty. + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; + } + return []; + } + // if any path separators, return empty + if (tool.includes(path.sep)) { + return []; + } + // build the list of directories + // + // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, + // it feels like we should not do this. Checking the current directory seems like more of a use + // case of a shell, and the which() function exposed by the toolkit should strive for consistency + // across platforms. + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path.delimiter)) { + if (p) { + directories.push(p); + } + } + } + // find all matches + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); +} +exports.findInPath = findInPath; +function readCopyOptions(options) { + const force = options.force == null ? true : options.force; + const recursive = Boolean(options.recursive); + const copySourceDirectory = options.copySourceDirectory == null + ? true + : Boolean(options.copySourceDirectory); + return { force, recursive, copySourceDirectory }; +} +function cpDirRecursive(sourceDir, destDir, currentDepth, force) { + return __awaiter(this, void 0, void 0, function* () { + // Ensure there is not a run away recursive copy + if (currentDepth >= 255) + return; + currentDepth++; + yield mkdirP(destDir); + const files = yield ioUtil.readdir(sourceDir); + for (const fileName of files) { + const srcFile = `${sourceDir}/${fileName}`; + const destFile = `${destDir}/${fileName}`; + const srcFileStat = yield ioUtil.lstat(srcFile); + if (srcFileStat.isDirectory()) { + // Recurse + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } + else { + yield copyFile(srcFile, destFile, force); + } + } + // Change the mode for the newly created directory + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); +} +// Buffered file copy +function copyFile(srcFile, destFile, force) { + return __awaiter(this, void 0, void 0, function* () { + if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { + // unlink/re-link it + try { + yield ioUtil.lstat(destFile); + yield ioUtil.unlink(destFile); + } + catch (e) { + // Try to override file permission + if (e.code === 'EPERM') { + yield ioUtil.chmod(destFile, '0666'); + yield ioUtil.unlink(destFile); + } + // other errors = it doesn't exist, no work to do + } + // Copy over symlink + const symlinkFull = yield ioUtil.readlink(srcFile); + yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); + } + else if (!(yield ioUtil.exists(destFile)) || force) { + yield ioUtil.copyFile(srcFile, destFile); + } + }); +} +//# sourceMappingURL=io.js.map + +/***/ }), + +/***/ 2842: +/***/ (function(module, exports, __nccwpck_require__) { + + +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._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0; +const semver = __importStar(__nccwpck_require__(1729)); +const core_1 = __nccwpck_require__(7733); +// needs to be require for core node modules to be mocked +/* eslint @typescript-eslint/no-require-imports: 0 */ +const os = __nccwpck_require__(2037); +const cp = __nccwpck_require__(2081); +const fs = __nccwpck_require__(7147); +function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter(this, void 0, void 0, function* () { + const platFilter = os.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + core_1.debug(`check ${version} satisfies ${versionSpec}`); + if (semver.satisfies(version, versionSpec) && + (!stable || candidate.stable === stable)) { + file = candidate.files.find(item => { + core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`); + let chk = item.arch === archFilter && item.platform === platFilter; + if (chk && item.platform_version) { + const osVersion = module.exports._getOsVersion(); + if (osVersion === item.platform_version) { + chk = true; + } + else { + chk = semver.satisfies(osVersion, item.platform_version); + } + } + return chk; + }); + if (file) { + core_1.debug(`matched ${candidate.version}`); + match = candidate; + break; + } + } + } + if (match && file) { + // clone since we're mutating the file list to be only the file that matches + result = Object.assign({}, match); + result.files = [file]; + } + return result; + }); +} +exports._findMatch = _findMatch; +function _getOsVersion() { + // TODO: add windows and other linux, arm variants + // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python) + const plat = os.platform(); + let version = ''; + if (plat === 'darwin') { + version = cp.execSync('sw_vers -productVersion').toString(); + } + else if (plat === 'linux') { + // lsb_release process not in some containers, readfile + // Run cat /etc/lsb-release + // DISTRIB_ID=Ubuntu + // DISTRIB_RELEASE=18.04 + // DISTRIB_CODENAME=bionic + // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS" + const lsbContents = module.exports._readLinuxVersionFile(); + if (lsbContents) { + const lines = lsbContents.split('\n'); + for (const line of lines) { + const parts = line.split('='); + if (parts.length === 2 && + (parts[0].trim() === 'VERSION_ID' || + parts[0].trim() === 'DISTRIB_RELEASE')) { + version = parts[1] + .trim() + .replace(/^"/, '') + .replace(/"$/, ''); + break; + } + } + } + } + return version; +} +exports._getOsVersion = _getOsVersion; +function _readLinuxVersionFile() { + const lsbReleaseFile = '/etc/lsb-release'; + const osReleaseFile = '/etc/os-release'; + let contents = ''; + if (fs.existsSync(lsbReleaseFile)) { + contents = fs.readFileSync(lsbReleaseFile).toString(); + } + else if (fs.existsSync(osReleaseFile)) { + contents = fs.readFileSync(osReleaseFile).toString(); + } + return contents; +} +exports._readLinuxVersionFile = _readLinuxVersionFile; +//# sourceMappingURL=manifest.js.map + +/***/ }), + +/***/ 4601: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +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.RetryHelper = void 0; +const core = __importStar(__nccwpck_require__(7733)); +/** + * Internal class for retries + */ +class RetryHelper { + constructor(maxAttempts, minSeconds, maxSeconds) { + if (maxAttempts < 1) { + throw new Error('max attempts should be greater than or equal to 1'); + } + this.maxAttempts = maxAttempts; + this.minSeconds = Math.floor(minSeconds); + this.maxSeconds = Math.floor(maxSeconds); + if (this.minSeconds > this.maxSeconds) { + throw new Error('min seconds should be less than or equal to max seconds'); + } + } + execute(action, isRetryable) { + return __awaiter(this, void 0, void 0, function* () { + let attempt = 1; + while (attempt < this.maxAttempts) { + // Try + try { + return yield action(); + } + catch (err) { + if (isRetryable && !isRetryable(err)) { + throw err; + } + core.info(err.message); + } + // Sleep + const seconds = this.getSleepAmount(); + core.info(`Waiting ${seconds} seconds before trying again`); + yield this.sleep(seconds); + attempt++; + } + // Last attempt + return yield action(); + }); + } + getSleepAmount() { + return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + + this.minSeconds); + } + sleep(seconds) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise(resolve => setTimeout(resolve, seconds * 1000)); + }); + } +} +exports.RetryHelper = RetryHelper; +//# sourceMappingURL=retry-helper.js.map + +/***/ }), + +/***/ 514: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + + +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()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.evaluateVersions = exports.isExplicitVersion = exports.findFromManifest = exports.getManifestFromRepo = exports.findAllVersions = exports.find = exports.cacheFile = exports.cacheDir = exports.extractZip = exports.extractXar = exports.extractTar = exports.extract7z = exports.downloadTool = exports.HTTPError = void 0; +const core = __importStar(__nccwpck_require__(7733)); +const io = __importStar(__nccwpck_require__(8629)); +const fs = __importStar(__nccwpck_require__(7147)); +const mm = __importStar(__nccwpck_require__(2842)); +const os = __importStar(__nccwpck_require__(2037)); +const path = __importStar(__nccwpck_require__(1017)); +const httpm = __importStar(__nccwpck_require__(4284)); +const semver = __importStar(__nccwpck_require__(1729)); +const stream = __importStar(__nccwpck_require__(2781)); +const util = __importStar(__nccwpck_require__(3837)); +const assert_1 = __nccwpck_require__(9491); +const v4_1 = __importDefault(__nccwpck_require__(4748)); +const exec_1 = __nccwpck_require__(1757); +const retry_helper_1 = __nccwpck_require__(4601); +class HTTPError extends Error { + constructor(httpStatusCode) { + super(`Unexpected HTTP response: ${httpStatusCode}`); + this.httpStatusCode = httpStatusCode; + Object.setPrototypeOf(this, new.target.prototype); + } +} +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 + * @param headers other headers + * @returns path to downloaded tool + */ +function downloadTool(url, dest, auth, headers) { + 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, headers); + }), (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; + }); + }); +} +exports.downloadTool = downloadTool; +function downloadToolAttempt(url, dest, auth, headers) { + 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 + }); + if (auth) { + core.debug('set auth'); + if (headers === undefined) { + headers = {}; + } + 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}`); + } + } + } + }); +} +/** + * 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; + }); +} +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('--overwrite'); + } + args.push('-C', destArg, '-f', fileArg); + yield exec_1.exec(`tar`, args); + return dest; + }); +} +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; + }); +} +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; + }); +} +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 pwshPath = yield io.which('pwsh', false); + //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory + //and the -Force flag for Expand-Archive as a fallback + if (pwshPath) { + //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive + const pwshCommand = [ + `$ErrorActionPreference = 'Stop' ;`, + `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`, + `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`, + `catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force } else { throw $_ } } ;` + ].join(' '); + const args = [ + '-NoLogo', + '-NoProfile', + '-NonInteractive', + '-ExecutionPolicy', + 'Unrestricted', + '-Command', + pwshCommand + ]; + core.debug(`Using pwsh at path: ${pwshPath}`); + yield exec_1.exec(`"${pwshPath}"`, args); + } + else { + const powershellCommand = [ + `$ErrorActionPreference = 'Stop' ;`, + `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`, + `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`, + `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }` + ].join(' '); + const args = [ + '-NoLogo', + '-Sta', + '-NoProfile', + '-NonInteractive', + '-ExecutionPolicy', + 'Unrestricted', + '-Command', + powershellCommand + ]; + const powershellPath = yield io.which('powershell', true); + core.debug(`Using powershell at path: ${powershellPath}`); + yield exec_1.exec(`"${powershellPath}"`, args); + } + }); +} +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'); + } + args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run + yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest }); + }); +} +/** + * 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; + }); +} +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 (!versionSpec) { + throw new Error('versionSpec parameter is required'); + } + 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; + } + // 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'); + } + } + return toolPath; +} +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; +} +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'); +} +/** + * Check if version string is explicit + * + * @param versionSpec version string to check + */ +function isExplicitVersion(versionSpec) { + const c = semver.clean(versionSpec) || ''; + core.debug(`isExplicit: ${c}`); + const valid = semver.valid(c) != null; + core.debug(`explicit? ${valid}`); + return valid; +} +exports.isExplicitVersion = isExplicitVersion; +/** + * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec` + * + * @param versions array of versions to evaluate + * @param versionSpec semantic version spec to satisfy + */ +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; + } + } + if (version) { + core.debug(`matched: ${version}`); + } + else { + core.debug('match not found'); + } + return version; +} +exports.evaluateVersions = evaluateVersions; +/** + * 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 + +/***/ }), + +/***/ 1729: +/***/ ((module, exports) => { + +exports = module.exports = SemVer + +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) + } +} else { + debug = function () {} +} + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0' + +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16 + +var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +// The actual regexps go on exports.re +var re = exports.re = [] +var safeRe = exports.safeRe = [] +var src = exports.src = [] +var t = exports.tokens = {} +var R = 0 + +function tok (n) { + t[n] = R++ +} + +var LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +var safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +function makeSafeRe (value) { + for (var i = 0; i < safeRegexReplacements.length; i++) { + var token = safeRegexReplacements[i][0] + var max = safeRegexReplacements[i][1] + value = value + .split(token + '*').join(token + '{0,' + max + '}') + .split(token + '+').join(token + '{1,' + max + '}') + } + return value +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +tok('NUMERICIDENTIFIER') +src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' +tok('NUMERICIDENTIFIERLOOSE') +src[t.NUMERICIDENTIFIERLOOSE] = '\\d+' + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +tok('NONNUMERICIDENTIFIER') +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' + +// ## Main Version +// Three dot-separated numeric identifiers. + +tok('MAINVERSION') +src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')' + +tok('MAINVERSIONLOOSE') +src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +tok('PRERELEASEIDENTIFIER') +src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' + +tok('PRERELEASEIDENTIFIERLOOSE') +src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +tok('PRERELEASE') +src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' + +tok('PRERELEASELOOSE') +src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +tok('BUILDIDENTIFIER') +src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +tok('BUILD') +src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +tok('FULL') +tok('FULLPLAIN') +src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + + src[t.PRERELEASE] + '?' + + src[t.BUILD] + '?' + +src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +tok('LOOSEPLAIN') +src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + + src[t.PRERELEASELOOSE] + '?' + + src[t.BUILD] + '?' + +tok('LOOSE') +src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' + +tok('GTLT') +src[t.GTLT] = '((?:<|>)?=?)' + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +tok('XRANGEIDENTIFIERLOOSE') +src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +tok('XRANGEIDENTIFIER') +src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' + +tok('XRANGEPLAIN') +src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:' + src[t.PRERELEASE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' + +tok('XRANGEPLAINLOOSE') +src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[t.PRERELEASELOOSE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' + +tok('XRANGE') +src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' +tok('XRANGELOOSE') +src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' + +// 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') +safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g') + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +tok('LONETILDE') +src[t.LONETILDE] = '(?:~>?)' + +tok('TILDETRIM') +src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' +re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') +safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g') +var tildeTrimReplace = '$1~' + +tok('TILDE') +src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' +tok('TILDELOOSE') +src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +tok('LONECARET') +src[t.LONECARET] = '(?:\\^)' + +tok('CARETTRIM') +src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' +re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') +safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g') +var caretTrimReplace = '$1^' + +tok('CARET') +src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' +tok('CARETLOOSE') +src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' + +// 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] + ')$|^$' + +// 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] + ')' + +// this one has to use the /g flag +re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') +safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(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*$' + +tok('HYPHENRANGELOOSE') +src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s*$' + +// Star ranges basically just allow anything at all. +tok('STAR') +src[t.STAR] = '(<|>)?=?\\s*\\*' + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) + + // Replace all greedy whitespace to prevent regex dos issues. These regex are + // used internally via the safeRe object since all inputs in this library get + // normalized first to trim and collapse all extra whitespace. The original + // regexes are exported for userland consumption and lower level usage. A + // future breaking change could export the safer regex only with a note that + // all input should have extra whitespace removed. + safeRe[i] = new RegExp(makeSafeRe(src[i])) + } +} + +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + if (version.length > MAX_LENGTH) { + return null + } + + var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL] + if (!r.test(version)) { + return null + } + + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} + +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null +} + +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} + +exports.SemVer = SemVer + +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) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } + + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + + var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]) + + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() +} + +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version +} + +SemVer.prototype.toString = function () { + return this.version +} + +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return this.compareMain(other) || this.comparePre(other) +} + +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) +} + +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.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 + } + + 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) + } + + 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) +} + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break + + default: + throw new Error('invalid increment argument: ' + release) + } + this.format() + this.raw = this.version + return this +} + +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined + } + + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null + } +} + +exports.diff = diff +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1) + var v2 = parse(version2) + 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 + } +} + +exports.compareIdentifiers = compareIdentifiers + +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} + +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major +} + +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor +} + +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch +} + +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) +} + +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) +} + +exports.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) +} + +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) +} + +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(a, b, loose) + }) +} + +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(b, a, loose) + }) +} + +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 +} + +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 +} + +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 +} + +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} + +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} + +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} + +exports.cmp = cmp +function cmp (a, op, b, loose) { + 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 + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError('Invalid operator: ' + op) + } +} + +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) +} + +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var m = comp.match(r) + + 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) + } +} + +Comparator.prototype.toString = function () { + return this.value +} + +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) +} + +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + var rangeTmp + + 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) + } + + 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 === '>')) + + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +} + +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + return new Range(range.value, options) + } + + if (!(this instanceof Range)) { + return new Range(range, options) + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range + .trim() + .split(/\s+/) + .join(' ') + + // First, split based on boolean or || + this.set = this.raw.split('||').map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }) + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + this.raw) + } + + this.format() +} + +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range +} + +Range.prototype.toString = function () { + return this.range +} + +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[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(safeRe[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, safeRe[t.COMPARATORTRIM]) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace) + + // normalize spaces + range = range.split(/\s+/).join(' ') + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[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) + + return set +} + +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + 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() + + while (result && remainingComparators.length) { + result = remainingComparators.every(function (otherComparator) { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// 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(' ') + }) +} + +// 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 +} + +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(' ') +} + +function replaceTilde (comp, options) { + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') +} + +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[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' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } + } + + debug('caret return', ret) + return ret + }) +} + +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 ? safeRe[t.XRANGELOOSE] : safeRe[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 + + 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 + } + } + + 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(safeRe[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 + } + } + 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) +} + +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 +} + +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 + } + 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 min +} + +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] + + 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 + } + + return null +} + +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 + } +} + +// 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) +} + +// 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) + + var gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + var high = null + var low = null + + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} + +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 + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + var match = null + if (!options.rtl) { + match = version.match(safeRe[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 = safeRe[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 + } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + safeRe[t.COERCERTL].lastIndex = -1 + } + + if (match === null) { + return null + } + + return parse(match[2] + + '.' + (match[3] || '0') + + '.' + (match[4] || '0'), options) +} + + +/***/ }), + +/***/ 4249: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = __nccwpck_require__(709); + + +/***/ }), + +/***/ 709: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +var net = __nccwpck_require__(1808); +var tls = __nccwpck_require__(4404); +var http = __nccwpck_require__(3685); +var https = __nccwpck_require__(5687); +var events = __nccwpck_require__(2361); +var assert = __nccwpck_require__(9491); +var util = __nccwpck_require__(3837); + + +exports.httpOverHttp = httpOverHttp; +exports.httpsOverHttp = httpsOverHttp; +exports.httpOverHttps = httpOverHttps; +exports.httpsOverHttps = httpsOverHttps; + + +function httpOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + return agent; +} + +function httpsOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; +} + +function httpOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + return agent; +} + +function httpsOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; +} + + +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 = []; + + 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); + +TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { + var self = this; + var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); + + if (self.sockets.length >= this.maxSockets) { + // We are over limit so we'll add it to the queue. + self.requests.push(options); + return; + } + + // 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); + + function onFree() { + self.emit('free', socket, options); + } + + function onCloseOrRemove(err) { + self.removeSocket(socket); + socket.removeListener('free', onFree); + socket.removeListener('close', onCloseOrRemove); + socket.removeListener('agentRemove', onCloseOrRemove); + } + }); +}; + +TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { + var self = this; + var placeholder = {}; + self.sockets.push(placeholder); + + 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'); + } + + 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(); + + function onResponse(res) { + // Very hacky. This is necessary to avoid http-parser leaks. + res.upgrade = true; + } + + function onUpgrade(res, socket, head) { + // Hacky. + process.nextTick(function() { + onConnect(res, socket, head); + }); + } + + function onConnect(res, socket, head) { + connectReq.removeAllListeners(); + socket.removeAllListeners(); + + 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); + } + + function onError(cause) { + connectReq.removeAllListeners(); + + 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); + } +}; + +TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket) + if (pos === -1) { + return; + } + this.sockets.splice(pos, 1); + + 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); + }); + } +}; + +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 +} + +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; +} + + +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 + + +/***/ }), + +/***/ 9256: +/***/ ((module) => { + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +var byteToHex = []; +for (var i = 0; i < 256; ++i) { + byteToHex[i] = (i + 0x100).toString(16).substr(1); +} + +function bytesToUuid(buf, offset) { + var i = offset || 0; + var bth = byteToHex; + // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 + return ([ + bth[buf[i++]], bth[buf[i++]], + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], + bth[buf[i++]], bth[buf[i++]], + bth[buf[i++]], bth[buf[i++]] + ]).join(''); +} + +module.exports = bytesToUuid; + + +/***/ }), + +/***/ 4144: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Unique ID creation requires a high quality random # generator. In node.js +// this is pretty straight-forward - we use the crypto API. + +var crypto = __nccwpck_require__(6113); + +module.exports = function nodeRNG() { + return crypto.randomBytes(16); +}; + + +/***/ }), + +/***/ 4748: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var rng = __nccwpck_require__(4144); +var bytesToUuid = __nccwpck_require__(9256); + +function v4(options, buf, offset) { + var i = buf && offset || 0; + + if (typeof(options) == 'string') { + buf = options === 'binary' ? new Array(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || rng)(); + + // 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; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ++ii) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || bytesToUuid(rnds); +} + +module.exports = v4; + + +/***/ }), + +/***/ 2033: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "v1", ({ + enumerable: true, + get: function () { + return _v.default; + } +})); +Object.defineProperty(exports, "v3", ({ + enumerable: true, + get: function () { + return _v2.default; + } +})); +Object.defineProperty(exports, "v4", ({ + enumerable: true, + get: function () { + return _v3.default; + } +})); +Object.defineProperty(exports, "v5", ({ + enumerable: true, + get: function () { + return _v4.default; + } +})); +Object.defineProperty(exports, "NIL", ({ + enumerable: true, + get: function () { + return _nil.default; + } +})); +Object.defineProperty(exports, "version", ({ + enumerable: true, + get: function () { + return _version.default; + } +})); +Object.defineProperty(exports, "validate", ({ + enumerable: true, + get: function () { + return _validate.default; + } +})); +Object.defineProperty(exports, "stringify", ({ + enumerable: true, + get: function () { + return _stringify.default; + } +})); +Object.defineProperty(exports, "parse", ({ + enumerable: true, + get: function () { + return _parse.default; + } +})); + +var _v = _interopRequireDefault(__nccwpck_require__(9370)); + +var _v2 = _interopRequireDefault(__nccwpck_require__(8638)); + +var _v3 = _interopRequireDefault(__nccwpck_require__(3519)); + +var _v4 = _interopRequireDefault(__nccwpck_require__(8239)); + +var _nil = _interopRequireDefault(__nccwpck_require__(680)); + +var _version = _interopRequireDefault(__nccwpck_require__(3609)); + +var _validate = _interopRequireDefault(__nccwpck_require__(6009)); + +var _stringify = _interopRequireDefault(__nccwpck_require__(9729)); + +var _parse = _interopRequireDefault(__nccwpck_require__(8951)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/***/ }), + +/***/ 7276: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return _crypto.default.createHash('md5').update(bytes).digest(); +} + +var _default = md5; +exports["default"] = _default; + +/***/ }), + +/***/ 680: +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = '00000000-0000-0000-0000-000000000000'; +exports["default"] = _default; + +/***/ }), + +/***/ 8951: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__nccwpck_require__(6009)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function parse(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + + let v; + const arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +var _default = parse; +exports["default"] = _default; + +/***/ }), + +/***/ 646: +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; +exports["default"] = _default; + +/***/ }), + +/***/ 7548: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = rng; + +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate + +let poolPtr = rnds8Pool.length; + +function rng() { + if (poolPtr > rnds8Pool.length - 16) { + _crypto.default.randomFillSync(rnds8Pool); + + poolPtr = 0; + } + + return rnds8Pool.slice(poolPtr, poolPtr += 16); +} + +/***/ }), + +/***/ 3557: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return _crypto.default.createHash('sha1').update(bytes).digest(); +} + +var _default = sha1; +exports["default"] = _default; + +/***/ }), + +/***/ 9729: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__nccwpck_require__(6009)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!(0, _validate.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +var _default = stringify; +exports["default"] = _default; + +/***/ }), + +/***/ 9370: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _rng = _interopRequireDefault(__nccwpck_require__(7548)); + +var _stringify = _interopRequireDefault(__nccwpck_require__(9729)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html +let _nodeId; + +let _clockseq; // Previous uuid creation time + + +let _lastMSecs = 0; +let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + let i = buf && offset || 0; + const b = buf || new Array(16); + options = options || {}; + let node = options.node || _nodeId; + let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || _rng.default)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || (0, _stringify.default)(b); +} + +var _default = v1; +exports["default"] = _default; + +/***/ }), + +/***/ 8638: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__nccwpck_require__(6694)); + +var _md = _interopRequireDefault(__nccwpck_require__(7276)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v3 = (0, _v.default)('v3', 0x30, _md.default); +var _default = v3; +exports["default"] = _default; + +/***/ }), + +/***/ 6694: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = _default; +exports.URL = exports.DNS = void 0; + +var _stringify = _interopRequireDefault(__nccwpck_require__(9729)); + +var _parse = _interopRequireDefault(__nccwpck_require__(8951)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + const bytes = []; + + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.DNS = DNS; +const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = URL; + +function _default(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = (0, _parse.default)(namespace); + } + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return (0, _stringify.default)(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} + +/***/ }), + +/***/ 3519: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _rng = _interopRequireDefault(__nccwpck_require__(7548)); + +var _stringify = _interopRequireDefault(__nccwpck_require__(9729)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function v4(options, buf, offset) { + options = options || {}; + + const rnds = options.random || (options.rng || _rng.default)(); // 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; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return (0, _stringify.default)(rnds); +} + +var _default = v4; +exports["default"] = _default; + +/***/ }), + +/***/ 8239: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__nccwpck_require__(6694)); + +var _sha = _interopRequireDefault(__nccwpck_require__(3557)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v5 = (0, _v.default)('v5', 0x50, _sha.default); +var _default = v5; +exports["default"] = _default; + +/***/ }), + +/***/ 6009: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _regex = _interopRequireDefault(__nccwpck_require__(646)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function validate(uuid) { + return typeof uuid === 'string' && _regex.default.test(uuid); +} + +var _default = validate; +exports["default"] = _default; + +/***/ }), + +/***/ 3609: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__nccwpck_require__(6009)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function version(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + + return parseInt(uuid.substr(14, 1), 16); +} + +var _default = version; +exports["default"] = _default; + +/***/ }), + +/***/ 9491: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert"); + +/***/ }), + +/***/ 2081: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("child_process"); + +/***/ }), + +/***/ 6113: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto"); + +/***/ }), + +/***/ 2361: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("events"); + +/***/ }), + +/***/ 7147: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs"); + +/***/ }), + +/***/ 3685: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http"); + +/***/ }), + +/***/ 5687: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("https"); + +/***/ }), + +/***/ 1808: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("net"); + +/***/ }), + +/***/ 7718: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process"); + +/***/ }), + +/***/ 7561: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs"); + +/***/ }), + +/***/ 5425: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:module"); + +/***/ }), + +/***/ 612: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os"); + +/***/ }), + +/***/ 9411: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path"); + +/***/ }), + +/***/ 7742: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:process"); + +/***/ }), + +/***/ 1041: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:url"); + +/***/ }), + +/***/ 2037: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os"); + +/***/ }), + +/***/ 1017: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path"); + +/***/ }), + +/***/ 2781: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream"); + +/***/ }), + +/***/ 1576: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("string_decoder"); + +/***/ }), + +/***/ 9512: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("timers"); + +/***/ }), + +/***/ 4404: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls"); + +/***/ }), + +/***/ 3837: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util"); + +/***/ }), + +/***/ 5348: +/***/ ((__webpack_module__, __unused_webpack___webpack_exports__, __nccwpck_require__) => { + +var _actions_core__WEBPACK_IMPORTED_MODULE_0___namespace_cache; +var _actions_exec__WEBPACK_IMPORTED_MODULE_1___namespace_cache; +var _actions_tool_cache__WEBPACK_IMPORTED_MODULE_3___namespace_cache; +var node_fs__WEBPACK_IMPORTED_MODULE_5___namespace_cache; +var node_os__WEBPACK_IMPORTED_MODULE_7___namespace_cache; +var node_child_process__WEBPACK_IMPORTED_MODULE_4___namespace_cache; +__nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { +/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(7733); +/* harmony import */ var _actions_exec__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(1757); +/* harmony import */ var _actions_http_client__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(4284); +/* harmony import */ var _actions_tool_cache__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(514); +/* harmony import */ var node_child_process__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(7718); +/* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(7561); +/* harmony import */ var node_module__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(5425); +/* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(612); +/* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(9411); +/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(7742); +/* harmony import */ var node_url__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(1041); +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + + + + + + + + + + + + + +const require = (0,node_module__WEBPACK_IMPORTED_MODULE_6__.createRequire)(import.meta.url); + +// Setup properties for JS interop in Dart. + +globalThis.self = globalThis; +globalThis.core = /*#__PURE__*/ (_actions_core__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (_actions_core__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __nccwpck_require__.t(_actions_core__WEBPACK_IMPORTED_MODULE_0__, 2))); +globalThis.exec = /*#__PURE__*/ (_actions_exec__WEBPACK_IMPORTED_MODULE_1___namespace_cache || (_actions_exec__WEBPACK_IMPORTED_MODULE_1___namespace_cache = __nccwpck_require__.t(_actions_exec__WEBPACK_IMPORTED_MODULE_1__, 2))); +globalThis.HttpClient = _actions_http_client__WEBPACK_IMPORTED_MODULE_2__.HttpClient; +globalThis.toolCache = /*#__PURE__*/ (_actions_tool_cache__WEBPACK_IMPORTED_MODULE_3___namespace_cache || (_actions_tool_cache__WEBPACK_IMPORTED_MODULE_3___namespace_cache = __nccwpck_require__.t(_actions_tool_cache__WEBPACK_IMPORTED_MODULE_3__, 2))); +globalThis.fs = /*#__PURE__*/ (node_fs__WEBPACK_IMPORTED_MODULE_5___namespace_cache || (node_fs__WEBPACK_IMPORTED_MODULE_5___namespace_cache = __nccwpck_require__.t(node_fs__WEBPACK_IMPORTED_MODULE_5__, 2))); +globalThis.os = /*#__PURE__*/ (node_os__WEBPACK_IMPORTED_MODULE_7___namespace_cache || (node_os__WEBPACK_IMPORTED_MODULE_7___namespace_cache = __nccwpck_require__.t(node_os__WEBPACK_IMPORTED_MODULE_7__, 2))); +globalThis.process = node_process__WEBPACK_IMPORTED_MODULE_9__; +globalThis.location = { href: `file://${node_process__WEBPACK_IMPORTED_MODULE_9__.cwd()}/` }; +globalThis.__filename = (0,node_url__WEBPACK_IMPORTED_MODULE_10__.fileURLToPath)(import.meta.url); +globalThis.__dirname = (0,node_path__WEBPACK_IMPORTED_MODULE_8__.dirname)(globalThis.__filename); +globalThis.require = require; +globalThis.childProcess = /*#__PURE__*/ (node_child_process__WEBPACK_IMPORTED_MODULE_4___namespace_cache || (node_child_process__WEBPACK_IMPORTED_MODULE_4___namespace_cache = __nccwpck_require__.t(node_child_process__WEBPACK_IMPORTED_MODULE_4__, 2))); + +globalThis.dartMainRunner = async function (main, args) { + const dir = node_process__WEBPACK_IMPORTED_MODULE_9__.argv[2]; + await main(dir); +} + +async function scriptMain() { + // We have to load `main.js` here so that the `dartMainRunner` hook is + // registered before the IIFE in `dart_main.js` runs. + require('../dist/main.cjs'); +} + +if (require.main === require.module) { + await scriptMain(); +} + +__webpack_async_result__(); +} catch(e) { __webpack_async_result__(e); } }, 1); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __nccwpck_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ var threw = true; +/******/ try { +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete __webpack_module_cache__[moduleId]; +/******/ } +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/async module */ +/******/ (() => { +/******/ var webpackQueues = typeof Symbol === "function" ? Symbol("webpack queues") : "__webpack_queues__"; +/******/ var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__"; +/******/ var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__"; +/******/ var resolveQueue = (queue) => { +/******/ if(queue && !queue.d) { +/******/ queue.d = 1; +/******/ queue.forEach((fn) => (fn.r--)); +/******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn())); +/******/ } +/******/ } +/******/ var wrapDeps = (deps) => (deps.map((dep) => { +/******/ if(dep !== null && typeof dep === "object") { +/******/ if(dep[webpackQueues]) return dep; +/******/ if(dep.then) { +/******/ var queue = []; +/******/ queue.d = 0; +/******/ dep.then((r) => { +/******/ obj[webpackExports] = r; +/******/ resolveQueue(queue); +/******/ }, (e) => { +/******/ obj[webpackError] = e; +/******/ resolveQueue(queue); +/******/ }); +/******/ var obj = {}; +/******/ obj[webpackQueues] = (fn) => (fn(queue)); +/******/ return obj; +/******/ } +/******/ } +/******/ var ret = {}; +/******/ ret[webpackQueues] = x => {}; +/******/ ret[webpackExports] = dep; +/******/ return ret; +/******/ })); +/******/ __nccwpck_require__.a = (module, body, hasAwait) => { +/******/ var queue; +/******/ hasAwait && ((queue = []).d = 1); +/******/ var depQueues = new Set(); +/******/ var exports = module.exports; +/******/ var currentDeps; +/******/ var outerResolve; +/******/ var reject; +/******/ var promise = new Promise((resolve, rej) => { +/******/ reject = rej; +/******/ outerResolve = resolve; +/******/ }); +/******/ promise[webpackExports] = exports; +/******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {})); +/******/ module.exports = promise; +/******/ body((deps) => { +/******/ currentDeps = wrapDeps(deps); +/******/ var fn; +/******/ var getResult = () => (currentDeps.map((d) => { +/******/ if(d[webpackError]) throw d[webpackError]; +/******/ return d[webpackExports]; +/******/ })) +/******/ var promise = new Promise((resolve) => { +/******/ fn = () => (resolve(getResult)); +/******/ fn.r = 0; +/******/ var fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn)))); +/******/ currentDeps.map((dep) => (dep[webpackQueues](fnQueue))); +/******/ }); +/******/ return fn.r ? promise : getResult(); +/******/ }, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))); +/******/ queue && (queue.d = 0); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/create fake namespace object */ +/******/ (() => { +/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); +/******/ var leafPrototypes; +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 16: return value when it's Promise-like +/******/ // mode & 8|1: behave like require +/******/ __nccwpck_require__.t = function(value, mode) { +/******/ if(mode & 1) value = this(value); +/******/ if(mode & 8) return value; +/******/ if(typeof value === 'object' && value) { +/******/ if((mode & 4) && value.__esModule) return value; +/******/ if((mode & 16) && typeof value.then === 'function') return value; +/******/ } +/******/ var ns = Object.create(null); +/******/ __nccwpck_require__.r(ns); +/******/ var def = {}; +/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; +/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { +/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); +/******/ } +/******/ def['default'] = () => (value); +/******/ __nccwpck_require__.d(ns, def); +/******/ return ns; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __nccwpck_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __nccwpck_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/compat */ +/******/ +/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/"; +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module used 'module' so it can't be inlined +/******/ var __webpack_exports__ = __nccwpck_require__(5348); +/******/ __webpack_exports__ = await __webpack_exports__; +/******/ diff --git a/.github/composite_actions/log_cw_metric/dist/main.cjs b/.github/composite_actions/log_cw_metric/dist/main.cjs new file mode 100644 index 0000000000..71156c7bbc --- /dev/null +++ b/.github/composite_actions/log_cw_metric/dist/main.cjs @@ -0,0 +1,15113 @@ +// Generated by dart2js (NullSafetyMode.sound, csp, deferred-serialization, intern-composite-values), the Dart to JavaScript compiler version: 3.2.0-90.0.dev. +// The code supports the following hooks: +// dartPrint(message): +// if this function is defined it is called instead of the Dart [print] +// method. +// +// dartMainRunner(main, args): +// if this function is defined, the Dart [main] method will not be invoked +// directly. Instead, a closure that will invoke [main], and its arguments +// [args] is passed to [dartMainRunner]. +// +// dartDeferredLibraryLoader(uri, successCallback, errorCallback, loadId, loadPriority): +// if this function is defined, it will be called when a deferred library +// is loaded. It should load and eval the javascript of `uri`, and call +// successCallback. If it fails to do so, it should call errorCallback with +// an error. The loadId argument is the deferred import that resulted in +// this uri being loaded. The loadPriority argument is the priority the +// library should be loaded with as specified in the code via the +// load-priority annotation (0: normal, 1: high). +// +// dartCallInstrumentation(id, qualifiedName): +// if this function is defined, it will be called at each entry of a +// method or constructor. Used only when compiling programs with +// --experiment-call-instrumentation. +(function dartProgram() { + function copyProperties(from, to) { + var keys = Object.keys(from); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + to[key] = from[key]; + } + } + function mixinPropertiesHard(from, to) { + var keys = Object.keys(from); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!to.hasOwnProperty(key)) + to[key] = from[key]; + } + } + function mixinPropertiesEasy(from, to) { + Object.assign(to, from); + } + var supportsDirectProtoAccess = function() { + var cls = function() { + }; + cls.prototype = {p: {}}; + var object = new cls(); + if (!(Object.getPrototypeOf(object) && Object.getPrototypeOf(object).p === cls.prototype.p)) + return false; + try { + if (typeof navigator != "undefined" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome/") >= 0) + return true; + if (typeof version == "function" && version.length == 0) { + var v = version(); + if (/^\d+\.\d+\.\d+\.\d+$/.test(v)) + return true; + } + } catch (_) { + } + return false; + }(); + function inherit(cls, sup) { + cls.prototype.constructor = cls; + cls.prototype["$is" + cls.name] = cls; + if (sup != null) { + if (supportsDirectProtoAccess) { + Object.setPrototypeOf(cls.prototype, sup.prototype); + return; + } + var clsPrototype = Object.create(sup.prototype); + copyProperties(cls.prototype, clsPrototype); + cls.prototype = clsPrototype; + } + } + function inheritMany(sup, classes) { + for (var i = 0; i < classes.length; i++) + inherit(classes[i], sup); + } + function mixinEasy(cls, mixin) { + mixinPropertiesEasy(mixin.prototype, cls.prototype); + cls.prototype.constructor = cls; + } + function mixinHard(cls, mixin) { + mixinPropertiesHard(mixin.prototype, cls.prototype); + cls.prototype.constructor = cls; + } + function lazyOld(holder, name, getterName, initializer) { + var uninitializedSentinel = holder; + holder[name] = uninitializedSentinel; + holder[getterName] = function() { + holder[getterName] = function() { + A.throwCyclicInit(name); + }; + var result; + var sentinelInProgress = initializer; + try { + if (holder[name] === uninitializedSentinel) { + result = holder[name] = sentinelInProgress; + result = holder[name] = initializer(); + } else + result = holder[name]; + } finally { + if (result === sentinelInProgress) + holder[name] = null; + holder[getterName] = function() { + return this[name]; + }; + } + return result; + }; + } + function lazy(holder, name, getterName, initializer) { + var uninitializedSentinel = holder; + holder[name] = uninitializedSentinel; + holder[getterName] = function() { + if (holder[name] === uninitializedSentinel) + holder[name] = initializer(); + holder[getterName] = function() { + return this[name]; + }; + return holder[name]; + }; + } + function lazyFinal(holder, name, getterName, initializer) { + var uninitializedSentinel = holder; + holder[name] = uninitializedSentinel; + holder[getterName] = function() { + if (holder[name] === uninitializedSentinel) { + var value = initializer(); + if (holder[name] !== uninitializedSentinel) + A.throwLateFieldADI(name); + holder[name] = value; + } + var finalValue = holder[name]; + holder[getterName] = function() { + return finalValue; + }; + return finalValue; + }; + } + function makeConstList(list) { + list.immutable$list = Array; + list.fixed$length = Array; + return list; + } + function convertToFastObject(properties) { + function t() { + } + t.prototype = properties; + new t(); + return properties; + } + function convertAllToFastObject(arrayOfObjects) { + for (var i = 0; i < arrayOfObjects.length; ++i) + convertToFastObject(arrayOfObjects[i]); + } + var functionCounter = 0; + function instanceTearOffGetter(isIntercepted, parameters) { + var cache = null; + return isIntercepted ? function(receiver) { + if (cache === null) + cache = A.closureFromTearOff(parameters); + return new cache(receiver, this); + } : function() { + if (cache === null) + cache = A.closureFromTearOff(parameters); + return new cache(this, null); + }; + } + function staticTearOffGetter(parameters) { + var cache = null; + return function() { + if (cache === null) + cache = A.closureFromTearOff(parameters).prototype; + return cache; + }; + } + var typesOffset = 0; + function tearOffParameters(container, isStatic, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, needsDirectAccess) { + if (typeof funType == "number") + funType += typesOffset; + return {co: container, iS: isStatic, iI: isIntercepted, rC: requiredParameterCount, dV: optionalParameterDefaultValues, cs: callNames, fs: funsOrNames, fT: funType, aI: applyIndex || 0, nDA: needsDirectAccess}; + } + function installStaticTearOff(holder, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex) { + var parameters = tearOffParameters(holder, true, false, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, false); + var getterFunction = staticTearOffGetter(parameters); + holder[getterName] = getterFunction; + } + function installInstanceTearOff(prototype, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, needsDirectAccess) { + isIntercepted = !!isIntercepted; + var parameters = tearOffParameters(prototype, false, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, !!needsDirectAccess); + var getterFunction = instanceTearOffGetter(isIntercepted, parameters); + prototype[getterName] = getterFunction; + } + function setOrUpdateInterceptorsByTag(newTags) { + var tags = init.interceptorsByTag; + if (!tags) { + init.interceptorsByTag = newTags; + return; + } + copyProperties(newTags, tags); + } + function setOrUpdateLeafTags(newTags) { + var tags = init.leafTags; + if (!tags) { + init.leafTags = newTags; + return; + } + copyProperties(newTags, tags); + } + function updateTypes(newTypes) { + var types = init.types; + var length = types.length; + types.push.apply(types, newTypes); + return length; + } + function updateHolder(holder, newHolder) { + copyProperties(newHolder, holder); + return holder; + } + var hunkHelpers = function() { + var mkInstance = function(isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) { + return function(container, getterName, name, funType) { + return installInstanceTearOff(container, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex, false); + }; + }, + mkStatic = function(requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) { + return function(container, getterName, name, funType) { + return installStaticTearOff(container, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex); + }; + }; + return {inherit: inherit, inheritMany: inheritMany, mixin: mixinEasy, mixinHard: mixinHard, installStaticTearOff: installStaticTearOff, installInstanceTearOff: installInstanceTearOff, _instance_0u: mkInstance(0, 0, null, ["call$0"], 0), _instance_1u: mkInstance(0, 1, null, ["call$1"], 0), _instance_2u: mkInstance(0, 2, null, ["call$2"], 0), _instance_0i: mkInstance(1, 0, null, ["call$0"], 0), _instance_1i: mkInstance(1, 1, null, ["call$1"], 0), _instance_2i: mkInstance(1, 2, null, ["call$2"], 0), _static_0: mkStatic(0, null, ["call$0"], 0), _static_1: mkStatic(1, null, ["call$1"], 0), _static_2: mkStatic(2, null, ["call$2"], 0), makeConstList: makeConstList, lazy: lazy, lazyFinal: lazyFinal, lazyOld: lazyOld, updateHolder: updateHolder, convertToFastObject: convertToFastObject, updateTypes: updateTypes, setOrUpdateInterceptorsByTag: setOrUpdateInterceptorsByTag, setOrUpdateLeafTags: setOrUpdateLeafTags}; + }(); + function initializeDeferredHunk(hunk) { + typesOffset = init.types.length; + hunk(hunkHelpers, init, holders, $); + } + var A = {JS_CONST: function JS_CONST() { + }, + CastIterable_CastIterable(source, $S, $T) { + if ($S._eval$1("EfficientLengthIterable<0>")._is(source)) + return new A._EfficientLengthCastIterable(source, $S._eval$1("@<0>")._bind$1($T)._eval$1("_EfficientLengthCastIterable<1,2>")); + return new A.CastIterable(source, $S._eval$1("@<0>")._bind$1($T)._eval$1("CastIterable<1,2>")); + }, + hexDigitValue(char) { + var letter, + digit = char ^ 48; + if (digit <= 9) + return digit; + letter = char | 32; + if (97 <= letter && letter <= 102) + return letter - 87; + return -1; + }, + SystemHash_combine(hash, value) { + hash = hash + value & 536870911; + hash = hash + ((hash & 524287) << 10) & 536870911; + return hash ^ hash >>> 6; + }, + SystemHash_finish(hash) { + hash = hash + ((hash & 67108863) << 3) & 536870911; + hash ^= hash >>> 11; + return hash + ((hash & 16383) << 15) & 536870911; + }, + checkNotNullable(value, $name, $T) { + return value; + }, + isToStringVisiting(object) { + var t1, i; + for (t1 = $.toStringVisiting.length, i = 0; i < t1; ++i) + if (object === $.toStringVisiting[i]) + return true; + return false; + }, + SubListIterable$(_iterable, _start, _endOrLength, $E) { + A.RangeError_checkNotNegative(_start, "start"); + if (_endOrLength != null) { + A.RangeError_checkNotNegative(_endOrLength, "end"); + if (_start > _endOrLength) + A.throwExpression(A.RangeError$range(_start, 0, _endOrLength, "start", null)); + } + return new A.SubListIterable(_iterable, _start, _endOrLength, $E._eval$1("SubListIterable<0>")); + }, + MappedIterable_MappedIterable(iterable, $function, $S, $T) { + if (type$.EfficientLengthIterable_dynamic._is(iterable)) + return new A.EfficientLengthMappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("EfficientLengthMappedIterable<1,2>")); + return new A.MappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("MappedIterable<1,2>")); + }, + TakeIterable_TakeIterable(iterable, takeCount, $E) { + var _s9_ = "takeCount"; + A.ArgumentError_checkNotNull(takeCount, _s9_, type$.int); + A.RangeError_checkNotNegative(takeCount, _s9_); + if (type$.EfficientLengthIterable_dynamic._is(iterable)) + return new A.EfficientLengthTakeIterable(iterable, takeCount, $E._eval$1("EfficientLengthTakeIterable<0>")); + return new A.TakeIterable(iterable, takeCount, $E._eval$1("TakeIterable<0>")); + }, + SkipIterable_SkipIterable(iterable, count, $E) { + var _s5_ = "count"; + if (type$.EfficientLengthIterable_dynamic._is(iterable)) { + A.ArgumentError_checkNotNull(count, _s5_, type$.int); + A.RangeError_checkNotNegative(count, _s5_); + return new A.EfficientLengthSkipIterable(iterable, count, $E._eval$1("EfficientLengthSkipIterable<0>")); + } + A.ArgumentError_checkNotNull(count, _s5_, type$.int); + A.RangeError_checkNotNegative(count, _s5_); + return new A.SkipIterable(iterable, count, $E._eval$1("SkipIterable<0>")); + }, + IterableElementError_noElement() { + return new A.StateError("No element"); + }, + IterableElementError_tooFew() { + return new A.StateError("Too few elements"); + }, + _CastIterableBase: function _CastIterableBase() { + }, + CastIterator: function CastIterator(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + CastIterable: function CastIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + _EfficientLengthCastIterable: function _EfficientLengthCastIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + _CastListBase: function _CastListBase() { + }, + CastList: function CastList(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + CastMap: function CastMap(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + CastMap_forEach_closure: function CastMap_forEach_closure(t0, t1) { + this.$this = t0; + this.f = t1; + }, + LateError: function LateError(t0) { + this._message = t0; + }, + CodeUnits: function CodeUnits(t0) { + this.__internal$_string = t0; + }, + SentinelValue: function SentinelValue() { + }, + EfficientLengthIterable: function EfficientLengthIterable() { + }, + ListIterable: function ListIterable() { + }, + SubListIterable: function SubListIterable(t0, t1, t2, t3) { + var _ = this; + _.__internal$_iterable = t0; + _.__internal$_start = t1; + _._endOrLength = t2; + _.$ti = t3; + }, + ListIterator: function ListIterator(t0, t1, t2) { + var _ = this; + _.__internal$_iterable = t0; + _.__internal$_length = t1; + _.__internal$_index = 0; + _.__internal$_current = null; + _.$ti = t2; + }, + MappedIterable: function MappedIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + EfficientLengthMappedIterable: function EfficientLengthMappedIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + MappedIterator: function MappedIterator(t0, t1, t2) { + var _ = this; + _.__internal$_current = null; + _._iterator = t0; + _._f = t1; + _.$ti = t2; + }, + MappedListIterable: function MappedListIterable(t0, t1, t2) { + this._source = t0; + this._f = t1; + this.$ti = t2; + }, + WhereIterable: function WhereIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + WhereIterator: function WhereIterator(t0, t1, t2) { + this._iterator = t0; + this._f = t1; + this.$ti = t2; + }, + ExpandIterable: function ExpandIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + ExpandIterator: function ExpandIterator(t0, t1, t2, t3) { + var _ = this; + _._iterator = t0; + _._f = t1; + _._currentExpansion = t2; + _.__internal$_current = null; + _.$ti = t3; + }, + TakeIterable: function TakeIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._takeCount = t1; + this.$ti = t2; + }, + EfficientLengthTakeIterable: function EfficientLengthTakeIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._takeCount = t1; + this.$ti = t2; + }, + TakeIterator: function TakeIterator(t0, t1, t2) { + this._iterator = t0; + this._remaining = t1; + this.$ti = t2; + }, + SkipIterable: function SkipIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._skipCount = t1; + this.$ti = t2; + }, + EfficientLengthSkipIterable: function EfficientLengthSkipIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._skipCount = t1; + this.$ti = t2; + }, + SkipIterator: function SkipIterator(t0, t1, t2) { + this._iterator = t0; + this._skipCount = t1; + this.$ti = t2; + }, + SkipWhileIterable: function SkipWhileIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + SkipWhileIterator: function SkipWhileIterator(t0, t1, t2) { + var _ = this; + _._iterator = t0; + _._f = t1; + _._hasSkipped = false; + _.$ti = t2; + }, + EmptyIterable: function EmptyIterable(t0) { + this.$ti = t0; + }, + EmptyIterator: function EmptyIterator(t0) { + this.$ti = t0; + }, + WhereTypeIterable: function WhereTypeIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + WhereTypeIterator: function WhereTypeIterator(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + FixedLengthListMixin: function FixedLengthListMixin() { + }, + UnmodifiableListMixin: function UnmodifiableListMixin() { + }, + UnmodifiableListBase: function UnmodifiableListBase() { + }, + Symbol: function Symbol(t0) { + this._name = t0; + }, + __CastListBase__CastIterableBase_ListMixin: function __CastListBase__CastIterableBase_ListMixin() { + }, + unminifyOrTag(rawClassName) { + var preserved = init.mangledGlobalNames[rawClassName]; + if (preserved != null) + return preserved; + return rawClassName; + }, + isJsIndexable(object, record) { + var result; + if (record != null) { + result = record.x; + if (result != null) + return result; + } + return type$.JavaScriptIndexingBehavior_dynamic._is(object); + }, + S(value) { + var result; + if (typeof value == "string") + return value; + if (typeof value == "number") { + if (value !== 0) + return "" + value; + } else if (true === value) + return "true"; + else if (false === value) + return "false"; + else if (value == null) + return "null"; + result = J.toString$0$(value); + return result; + }, + Primitives_objectHashCode(object) { + var hash, + property = $.Primitives__identityHashCodeProperty; + if (property == null) + property = $.Primitives__identityHashCodeProperty = Symbol("identityHashCode"); + hash = object[property]; + if (hash == null) { + hash = Math.random() * 0x3fffffff | 0; + object[property] = hash; + } + return hash; + }, + Primitives_parseInt(source, radix) { + var decimalMatch, maxCharCode, digitsPart, t1, i, _null = null, + match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source); + if (match == null) + return _null; + if (3 >= match.length) + return A.ioore(match, 3); + decimalMatch = match[3]; + if (radix == null) { + if (decimalMatch != null) + return parseInt(source, 10); + if (match[2] != null) + return parseInt(source, 16); + return _null; + } + if (radix < 2 || radix > 36) + throw A.wrapException(A.RangeError$range(radix, 2, 36, "radix", _null)); + if (radix === 10 && decimalMatch != null) + return parseInt(source, 10); + if (radix < 10 || decimalMatch == null) { + maxCharCode = radix <= 10 ? 47 + radix : 86 + radix; + digitsPart = match[1]; + for (t1 = digitsPart.length, i = 0; i < t1; ++i) + if ((digitsPart.charCodeAt(i) | 32) > maxCharCode) + return _null; + } + return parseInt(source, radix); + }, + Primitives_objectTypeName(object) { + return A.Primitives__objectTypeNameNewRti(object); + }, + Primitives__objectTypeNameNewRti(object) { + var interceptor, dispatchName, $constructor, constructorName; + if (object instanceof A.Object) + return A._rtiToString(A.instanceType(object), null); + interceptor = J.getInterceptor$(object); + if (interceptor === B.Interceptor_methods || interceptor === B.JavaScriptObject_methods || type$.UnknownJavaScriptObject._is(object)) { + dispatchName = B.C_JS_CONST(object); + if (dispatchName !== "Object" && dispatchName !== "") + return dispatchName; + $constructor = object.constructor; + if (typeof $constructor == "function") { + constructorName = $constructor.name; + if (typeof constructorName == "string" && constructorName !== "Object" && constructorName !== "") + return constructorName; + } + } + return A._rtiToString(A.instanceType(object), null); + }, + Primitives_safeToString(object) { + if (typeof object == "number" || A._isBool(object)) + return J.toString$0$(object); + if (typeof object == "string") + return JSON.stringify(object); + if (object instanceof A.Closure) + return object.toString$0(0); + return "Instance of '" + A.Primitives_objectTypeName(object) + "'"; + }, + Primitives_currentUri() { + if (!!self.location) + return self.location.href; + return null; + }, + Primitives__fromCharCodeApply(array) { + var result, i, i0, chunkEnd, + end = array.length; + if (end <= 500) + return String.fromCharCode.apply(null, array); + for (result = "", i = 0; i < end; i = i0) { + i0 = i + 500; + chunkEnd = i0 < end ? i0 : end; + result += String.fromCharCode.apply(null, array.slice(i, chunkEnd)); + } + return result; + }, + Primitives_stringFromCodePoints(codePoints) { + var t1, _i, i, + a = A._setArrayType([], type$.JSArray_int); + for (t1 = codePoints.length, _i = 0; _i < codePoints.length; codePoints.length === t1 || (0, A.throwConcurrentModificationError)(codePoints), ++_i) { + i = codePoints[_i]; + if (!A._isInt(i)) + throw A.wrapException(A.argumentErrorValue(i)); + if (i <= 65535) + B.JSArray_methods.add$1(a, i); + else if (i <= 1114111) { + B.JSArray_methods.add$1(a, 55296 + (B.JSInt_methods._shrOtherPositive$1(i - 65536, 10) & 1023)); + B.JSArray_methods.add$1(a, 56320 + (i & 1023)); + } else + throw A.wrapException(A.argumentErrorValue(i)); + } + return A.Primitives__fromCharCodeApply(a); + }, + Primitives_stringFromCharCodes(charCodes) { + var t1, _i, i; + for (t1 = charCodes.length, _i = 0; _i < t1; ++_i) { + i = charCodes[_i]; + if (!A._isInt(i)) + throw A.wrapException(A.argumentErrorValue(i)); + if (i < 0) + throw A.wrapException(A.argumentErrorValue(i)); + if (i > 65535) + return A.Primitives_stringFromCodePoints(charCodes); + } + return A.Primitives__fromCharCodeApply(charCodes); + }, + Primitives_stringFromNativeUint8List(charCodes, start, end) { + var i, result, i0, chunkEnd; + if (end <= 500 && start === 0 && end === charCodes.length) + return String.fromCharCode.apply(null, charCodes); + for (i = start, result = ""; i < end; i = i0) { + i0 = i + 500; + chunkEnd = i0 < end ? i0 : end; + result += String.fromCharCode.apply(null, charCodes.subarray(i, chunkEnd)); + } + return result; + }, + Primitives_stringFromCharCode(charCode) { + var bits; + if (0 <= charCode) { + if (charCode <= 65535) + return String.fromCharCode(charCode); + if (charCode <= 1114111) { + bits = charCode - 65536; + return String.fromCharCode((B.JSInt_methods._shrOtherPositive$1(bits, 10) | 55296) >>> 0, bits & 1023 | 56320); + } + } + throw A.wrapException(A.RangeError$range(charCode, 0, 1114111, null, null)); + }, + iae(argument) { + throw A.wrapException(A.argumentErrorValue(argument)); + }, + ioore(receiver, index) { + if (receiver == null) + J.get$length$asx(receiver); + throw A.wrapException(A.diagnoseIndexError(receiver, index)); + }, + diagnoseIndexError(indexable, index) { + var $length, _s5_ = "index"; + if (!A._isInt(index)) + return new A.ArgumentError(true, index, _s5_, null); + $length = J.get$length$asx(indexable); + if (index < 0 || index >= $length) + return A.IndexError$withLength(index, $length, indexable, _s5_); + return A.RangeError$value(index, _s5_); + }, + diagnoseRangeError(start, end, $length) { + if (start > $length) + return A.RangeError$range(start, 0, $length, "start", null); + if (end != null) + if (end < start || end > $length) + return A.RangeError$range(end, start, $length, "end", null); + return new A.ArgumentError(true, end, "end", null); + }, + argumentErrorValue(object) { + return new A.ArgumentError(true, object, null, null); + }, + wrapException(ex) { + return A.initializeExceptionWrapper(new Error(), ex); + }, + initializeExceptionWrapper(wrapper, ex) { + var t1; + if (ex == null) + ex = new A.TypeError(); + wrapper.dartException = ex; + t1 = A.toStringWrapper; + if ("defineProperty" in Object) { + Object.defineProperty(wrapper, "message", {get: t1}); + wrapper.name = ""; + } else + wrapper.toString = t1; + return wrapper; + }, + toStringWrapper() { + return J.toString$0$(this.dartException); + }, + throwExpression(ex) { + throw A.wrapException(ex); + }, + throwExpressionWithWrapper(ex, wrapper) { + throw A.initializeExceptionWrapper(wrapper, ex); + }, + throwConcurrentModificationError(collection) { + throw A.wrapException(A.ConcurrentModificationError$(collection)); + }, + TypeErrorDecoder_extractPattern(message) { + var match, $arguments, argumentsExpr, expr, method, receiver; + message = A.quoteStringForRegExp(message.replace(String({}), "$receiver$")); + match = message.match(/\\\$[a-zA-Z]+\\\$/g); + if (match == null) + match = A._setArrayType([], type$.JSArray_String); + $arguments = match.indexOf("\\$arguments\\$"); + argumentsExpr = match.indexOf("\\$argumentsExpr\\$"); + expr = match.indexOf("\\$expr\\$"); + method = match.indexOf("\\$method\\$"); + receiver = match.indexOf("\\$receiver\\$"); + return new A.TypeErrorDecoder(message.replace(new RegExp("\\\\\\$arguments\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$argumentsExpr\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$expr\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$method\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$receiver\\\\\\$", "g"), "((?:x|[^x])*)"), $arguments, argumentsExpr, expr, method, receiver); + }, + TypeErrorDecoder_provokeCallErrorOn(expression) { + return function($expr$) { + var $argumentsExpr$ = "$arguments$"; + try { + $expr$.$method$($argumentsExpr$); + } catch (e) { + return e.message; + } + }(expression); + }, + TypeErrorDecoder_provokePropertyErrorOn(expression) { + return function($expr$) { + try { + $expr$.$method$; + } catch (e) { + return e.message; + } + }(expression); + }, + JsNoSuchMethodError$(_message, match) { + var t1 = match == null, + t2 = t1 ? null : match.method; + return new A.JsNoSuchMethodError(_message, t2, t1 ? null : match.receiver); + }, + unwrapException(ex) { + var t1; + if (ex == null) + return new A.NullThrownFromJavaScriptException(ex); + if (ex instanceof A.ExceptionAndStackTrace) { + t1 = ex.dartException; + return A.saveStackTrace(ex, t1 == null ? type$.Object._as(t1) : t1); + } + if (typeof ex !== "object") + return ex; + if ("dartException" in ex) + return A.saveStackTrace(ex, ex.dartException); + return A._unwrapNonDartException(ex); + }, + saveStackTrace(ex, error) { + if (type$.Error._is(error)) + if (error.$thrownJsError == null) + error.$thrownJsError = ex; + return error; + }, + _unwrapNonDartException(ex) { + var message, number, ieErrorCode, t1, nsme, notClosure, nullCall, nullLiteralCall, undefCall, undefLiteralCall, nullProperty, undefProperty, undefLiteralProperty, match, _null = null; + if (!("message" in ex)) + return ex; + message = ex.message; + if ("number" in ex && typeof ex.number == "number") { + number = ex.number; + ieErrorCode = number & 65535; + if ((B.JSInt_methods._shrOtherPositive$1(number, 16) & 8191) === 10) + switch (ieErrorCode) { + case 438: + return A.saveStackTrace(ex, A.JsNoSuchMethodError$(A.S(message) + " (Error " + ieErrorCode + ")", _null)); + case 445: + case 5007: + t1 = A.S(message); + return A.saveStackTrace(ex, new A.NullError(t1 + " (Error " + ieErrorCode + ")", _null)); + } + } + if (ex instanceof TypeError) { + nsme = $.$get$TypeErrorDecoder_noSuchMethodPattern(); + notClosure = $.$get$TypeErrorDecoder_notClosurePattern(); + nullCall = $.$get$TypeErrorDecoder_nullCallPattern(); + nullLiteralCall = $.$get$TypeErrorDecoder_nullLiteralCallPattern(); + undefCall = $.$get$TypeErrorDecoder_undefinedCallPattern(); + undefLiteralCall = $.$get$TypeErrorDecoder_undefinedLiteralCallPattern(); + nullProperty = $.$get$TypeErrorDecoder_nullPropertyPattern(); + $.$get$TypeErrorDecoder_nullLiteralPropertyPattern(); + undefProperty = $.$get$TypeErrorDecoder_undefinedPropertyPattern(); + undefLiteralProperty = $.$get$TypeErrorDecoder_undefinedLiteralPropertyPattern(); + match = nsme.matchTypeError$1(message); + if (match != null) + return A.saveStackTrace(ex, A.JsNoSuchMethodError$(A._asString(message), match)); + else { + match = notClosure.matchTypeError$1(message); + if (match != null) { + match.method = "call"; + return A.saveStackTrace(ex, A.JsNoSuchMethodError$(A._asString(message), match)); + } else { + match = nullCall.matchTypeError$1(message); + if (match == null) { + match = nullLiteralCall.matchTypeError$1(message); + if (match == null) { + match = undefCall.matchTypeError$1(message); + if (match == null) { + match = undefLiteralCall.matchTypeError$1(message); + if (match == null) { + match = nullProperty.matchTypeError$1(message); + if (match == null) { + match = nullLiteralCall.matchTypeError$1(message); + if (match == null) { + match = undefProperty.matchTypeError$1(message); + if (match == null) { + match = undefLiteralProperty.matchTypeError$1(message); + t1 = match != null; + } else + t1 = true; + } else + t1 = true; + } else + t1 = true; + } else + t1 = true; + } else + t1 = true; + } else + t1 = true; + } else + t1 = true; + if (t1) { + A._asString(message); + return A.saveStackTrace(ex, new A.NullError(message, match == null ? _null : match.method)); + } + } + } + return A.saveStackTrace(ex, new A.UnknownJsTypeError(typeof message == "string" ? message : "")); + } + if (ex instanceof RangeError) { + if (typeof message == "string" && message.indexOf("call stack") !== -1) + return new A.StackOverflowError(); + message = function(ex) { + try { + return String(ex); + } catch (e) { + } + return null; + }(ex); + return A.saveStackTrace(ex, new A.ArgumentError(false, _null, _null, typeof message == "string" ? message.replace(/^RangeError:\s*/, "") : message)); + } + if (typeof InternalError == "function" && ex instanceof InternalError) + if (typeof message == "string" && message === "too much recursion") + return new A.StackOverflowError(); + return ex; + }, + getTraceFromException(exception) { + var trace; + if (exception instanceof A.ExceptionAndStackTrace) + return exception.stackTrace; + if (exception == null) + return new A._StackTrace(exception); + trace = exception.$cachedTrace; + if (trace != null) + return trace; + trace = new A._StackTrace(exception); + if (typeof exception === "object") + exception.$cachedTrace = trace; + return trace; + }, + objectHashCode(object) { + if (object == null) + return J.get$hashCode$(object); + if (typeof object == "object") + return A.Primitives_objectHashCode(object); + return J.get$hashCode$(object); + }, + fillLiteralMap(keyValuePairs, result) { + var index, index0, index1, + $length = keyValuePairs.length; + for (index = 0; index < $length; index = index1) { + index0 = index + 1; + index1 = index0 + 1; + result.$indexSet(0, keyValuePairs[index], keyValuePairs[index0]); + } + return result; + }, + _invokeClosure(closure, numberOfArguments, arg1, arg2, arg3, arg4) { + type$.Function._as(closure); + switch (A._asInt(numberOfArguments)) { + case 0: + return closure.call$0(); + case 1: + return closure.call$1(arg1); + case 2: + return closure.call$2(arg1, arg2); + case 3: + return closure.call$3(arg1, arg2, arg3); + case 4: + return closure.call$4(arg1, arg2, arg3, arg4); + } + throw A.wrapException(new A._Exception("Unsupported number of arguments for wrapped closure")); + }, + convertDartClosureToJS(closure, arity) { + var $function = closure.$identity; + if (!!$function) + return $function; + $function = A.convertDartClosureToJSUncached(closure, arity); + closure.$identity = $function; + return $function; + }, + convertDartClosureToJSUncached(closure, arity) { + var entry; + switch (arity) { + case 0: + entry = closure.call$0; + break; + case 1: + entry = closure.call$1; + break; + case 2: + entry = closure.call$2; + break; + case 3: + entry = closure.call$3; + break; + case 4: + entry = closure.call$4; + break; + default: + entry = null; + } + if (entry != null) + return entry.bind(closure); + return function(closure, arity, invoke) { + return function(a1, a2, a3, a4) { + return invoke(closure, arity, a1, a2, a3, a4); + }; + }(closure, arity, A._invokeClosure); + }, + Closure_fromTearOff(parameters) { + var $prototype, $constructor, t2, trampoline, applyTrampoline, i, stub, stub0, stubName, stubCallName, + container = parameters.co, + isStatic = parameters.iS, + isIntercepted = parameters.iI, + needsDirectAccess = parameters.nDA, + applyTrampolineIndex = parameters.aI, + funsOrNames = parameters.fs, + callNames = parameters.cs, + $name = funsOrNames[0], + callName = callNames[0], + $function = container[$name], + t1 = parameters.fT; + t1.toString; + $prototype = isStatic ? Object.create(new A.StaticClosure().constructor.prototype) : Object.create(new A.BoundClosure(null, null).constructor.prototype); + $prototype.$initialize = $prototype.constructor; + if (isStatic) + $constructor = function static_tear_off() { + this.$initialize(); + }; + else + $constructor = function tear_off(a, b) { + this.$initialize(a, b); + }; + $prototype.constructor = $constructor; + $constructor.prototype = $prototype; + $prototype.$_name = $name; + $prototype.$_target = $function; + t2 = !isStatic; + if (t2) + trampoline = A.Closure_forwardCallTo($name, $function, isIntercepted, needsDirectAccess); + else { + $prototype.$static_name = $name; + trampoline = $function; + } + $prototype.$signature = A.Closure__computeSignatureFunctionNewRti(t1, isStatic, isIntercepted); + $prototype[callName] = trampoline; + for (applyTrampoline = trampoline, i = 1; i < funsOrNames.length; ++i) { + stub = funsOrNames[i]; + if (typeof stub == "string") { + stub0 = container[stub]; + stubName = stub; + stub = stub0; + } else + stubName = ""; + stubCallName = callNames[i]; + if (stubCallName != null) { + if (t2) + stub = A.Closure_forwardCallTo(stubName, stub, isIntercepted, needsDirectAccess); + $prototype[stubCallName] = stub; + } + if (i === applyTrampolineIndex) + applyTrampoline = stub; + } + $prototype["call*"] = applyTrampoline; + $prototype.$requiredArgCount = parameters.rC; + $prototype.$defaultValues = parameters.dV; + return $constructor; + }, + Closure__computeSignatureFunctionNewRti(functionType, isStatic, isIntercepted) { + if (typeof functionType == "number") + return functionType; + if (typeof functionType == "string") { + if (isStatic) + throw A.wrapException("Cannot compute signature for static tearoff."); + return function(recipe, evalOnReceiver) { + return function() { + return evalOnReceiver(this, recipe); + }; + }(functionType, A.BoundClosure_evalRecipe); + } + throw A.wrapException("Error in functionType of tearoff"); + }, + Closure_cspForwardCall(arity, needsDirectAccess, stubName, $function) { + var getReceiver = A.BoundClosure_receiverOf; + switch (needsDirectAccess ? -1 : arity) { + case 0: + return function(entry, receiverOf) { + return function() { + return receiverOf(this)[entry](); + }; + }(stubName, getReceiver); + case 1: + return function(entry, receiverOf) { + return function(a) { + return receiverOf(this)[entry](a); + }; + }(stubName, getReceiver); + case 2: + return function(entry, receiverOf) { + return function(a, b) { + return receiverOf(this)[entry](a, b); + }; + }(stubName, getReceiver); + case 3: + return function(entry, receiverOf) { + return function(a, b, c) { + return receiverOf(this)[entry](a, b, c); + }; + }(stubName, getReceiver); + case 4: + return function(entry, receiverOf) { + return function(a, b, c, d) { + return receiverOf(this)[entry](a, b, c, d); + }; + }(stubName, getReceiver); + case 5: + return function(entry, receiverOf) { + return function(a, b, c, d, e) { + return receiverOf(this)[entry](a, b, c, d, e); + }; + }(stubName, getReceiver); + default: + return function(f, receiverOf) { + return function() { + return f.apply(receiverOf(this), arguments); + }; + }($function, getReceiver); + } + }, + Closure_forwardCallTo(stubName, $function, isIntercepted, needsDirectAccess) { + var arity, t1; + if (isIntercepted) + return A.Closure_forwardInterceptedCallTo(stubName, $function, needsDirectAccess); + arity = $function.length; + t1 = A.Closure_cspForwardCall(arity, needsDirectAccess, stubName, $function); + return t1; + }, + Closure_cspForwardInterceptedCall(arity, needsDirectAccess, stubName, $function) { + var getReceiver = A.BoundClosure_receiverOf, + getInterceptor = A.BoundClosure_interceptorOf; + switch (needsDirectAccess ? -1 : arity) { + case 0: + throw A.wrapException(new A.RuntimeError("Intercepted function with no arguments.")); + case 1: + return function(entry, interceptorOf, receiverOf) { + return function() { + return interceptorOf(this)[entry](receiverOf(this)); + }; + }(stubName, getInterceptor, getReceiver); + case 2: + return function(entry, interceptorOf, receiverOf) { + return function(a) { + return interceptorOf(this)[entry](receiverOf(this), a); + }; + }(stubName, getInterceptor, getReceiver); + case 3: + return function(entry, interceptorOf, receiverOf) { + return function(a, b) { + return interceptorOf(this)[entry](receiverOf(this), a, b); + }; + }(stubName, getInterceptor, getReceiver); + case 4: + return function(entry, interceptorOf, receiverOf) { + return function(a, b, c) { + return interceptorOf(this)[entry](receiverOf(this), a, b, c); + }; + }(stubName, getInterceptor, getReceiver); + case 5: + return function(entry, interceptorOf, receiverOf) { + return function(a, b, c, d) { + return interceptorOf(this)[entry](receiverOf(this), a, b, c, d); + }; + }(stubName, getInterceptor, getReceiver); + case 6: + return function(entry, interceptorOf, receiverOf) { + return function(a, b, c, d, e) { + return interceptorOf(this)[entry](receiverOf(this), a, b, c, d, e); + }; + }(stubName, getInterceptor, getReceiver); + default: + return function(f, interceptorOf, receiverOf) { + return function() { + var a = [receiverOf(this)]; + Array.prototype.push.apply(a, arguments); + return f.apply(interceptorOf(this), a); + }; + }($function, getInterceptor, getReceiver); + } + }, + Closure_forwardInterceptedCallTo(stubName, $function, needsDirectAccess) { + var arity, t1; + if ($.BoundClosure__interceptorFieldNameCache == null) + $.BoundClosure__interceptorFieldNameCache = A.BoundClosure__computeFieldNamed("interceptor"); + if ($.BoundClosure__receiverFieldNameCache == null) + $.BoundClosure__receiverFieldNameCache = A.BoundClosure__computeFieldNamed("receiver"); + arity = $function.length; + t1 = A.Closure_cspForwardInterceptedCall(arity, needsDirectAccess, stubName, $function); + return t1; + }, + closureFromTearOff(parameters) { + return A.Closure_fromTearOff(parameters); + }, + BoundClosure_evalRecipe(closure, recipe) { + return A._Universe_evalInEnvironment(init.typeUniverse, A.instanceType(closure._receiver), recipe); + }, + BoundClosure_receiverOf(closure) { + return closure._receiver; + }, + BoundClosure_interceptorOf(closure) { + return closure._interceptor; + }, + BoundClosure__computeFieldNamed(fieldName) { + var t1, i, $name, + template = new A.BoundClosure("receiver", "interceptor"), + names = J.JSArray_markFixedList(Object.getOwnPropertyNames(template), type$.nullable_Object); + for (t1 = names.length, i = 0; i < t1; ++i) { + $name = names[i]; + if (template[$name] === fieldName) + return $name; + } + throw A.wrapException(A.ArgumentError$("Field name " + fieldName + " not found.", null)); + }, + boolConversionCheck(value) { + if (value == null) + A.assertThrow("boolean expression must not be null"); + return value; + }, + assertThrow(message) { + throw A.wrapException(new A._AssertionError(message)); + }, + throwCyclicInit(staticName) { + throw A.wrapException(new A._CyclicInitializationError(staticName)); + }, + getIsolateAffinityTag($name) { + return init.getIsolateTag($name); + }, + convertMainArgumentList(args) { + var i, + result = A._setArrayType([], type$.JSArray_String); + if (args == null) + return result; + if (Array.isArray(args)) { + for (i = 0; i < args.length; ++i) + result.push(String(args[i])); + return result; + } + result.push(String(args)); + return result; + }, + defineProperty(obj, property, value) { + Object.defineProperty(obj, property, {value: value, enumerable: false, writable: true, configurable: true}); + }, + lookupAndCacheInterceptor(obj) { + var interceptor, interceptorClass, altTag, mark, t1, + tag = A._asString($.getTagFunction.call$1(obj)), + record = $.dispatchRecordsForInstanceTags[tag]; + if (record != null) { + Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + return record.i; + } + interceptor = $.interceptorsForUncacheableTags[tag]; + if (interceptor != null) + return interceptor; + interceptorClass = init.interceptorsByTag[tag]; + if (interceptorClass == null) { + altTag = A._asStringQ($.alternateTagFunction.call$2(obj, tag)); + if (altTag != null) { + record = $.dispatchRecordsForInstanceTags[altTag]; + if (record != null) { + Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + return record.i; + } + interceptor = $.interceptorsForUncacheableTags[altTag]; + if (interceptor != null) + return interceptor; + interceptorClass = init.interceptorsByTag[altTag]; + tag = altTag; + } + } + if (interceptorClass == null) + return null; + interceptor = interceptorClass.prototype; + mark = tag[0]; + if (mark === "!") { + record = A.makeLeafDispatchRecord(interceptor); + $.dispatchRecordsForInstanceTags[tag] = record; + Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + return record.i; + } + if (mark === "~") { + $.interceptorsForUncacheableTags[tag] = interceptor; + return interceptor; + } + if (mark === "-") { + t1 = A.makeLeafDispatchRecord(interceptor); + Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); + return t1.i; + } + if (mark === "+") + return A.patchInteriorProto(obj, interceptor); + if (mark === "*") + throw A.wrapException(A.UnimplementedError$(tag)); + if (init.leafTags[tag] === true) { + t1 = A.makeLeafDispatchRecord(interceptor); + Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); + return t1.i; + } else + return A.patchInteriorProto(obj, interceptor); + }, + patchInteriorProto(obj, interceptor) { + var proto = Object.getPrototypeOf(obj); + Object.defineProperty(proto, init.dispatchPropertyName, {value: J.makeDispatchRecord(interceptor, proto, null, null), enumerable: false, writable: true, configurable: true}); + return interceptor; + }, + makeLeafDispatchRecord(interceptor) { + return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior); + }, + makeDefaultDispatchRecord(tag, interceptorClass, proto) { + var interceptor = interceptorClass.prototype; + if (init.leafTags[tag] === true) + return A.makeLeafDispatchRecord(interceptor); + else + return J.makeDispatchRecord(interceptor, proto, null, null); + }, + initNativeDispatch() { + if (true === $.initNativeDispatchFlag) + return; + $.initNativeDispatchFlag = true; + A.initNativeDispatchContinue(); + }, + initNativeDispatchContinue() { + var map, tags, fun, i, tag, proto, record, interceptorClass; + $.dispatchRecordsForInstanceTags = Object.create(null); + $.interceptorsForUncacheableTags = Object.create(null); + A.initHooks(); + map = init.interceptorsByTag; + tags = Object.getOwnPropertyNames(map); + if (typeof window != "undefined") { + window; + fun = function() { + }; + for (i = 0; i < tags.length; ++i) { + tag = tags[i]; + proto = $.prototypeForTagFunction.call$1(tag); + if (proto != null) { + record = A.makeDefaultDispatchRecord(tag, map[tag], proto); + if (record != null) { + Object.defineProperty(proto, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + fun.prototype = proto; + } + } + } + } + for (i = 0; i < tags.length; ++i) { + tag = tags[i]; + if (/^[A-Za-z_]/.test(tag)) { + interceptorClass = map[tag]; + map["!" + tag] = interceptorClass; + map["~" + tag] = interceptorClass; + map["-" + tag] = interceptorClass; + map["+" + tag] = interceptorClass; + map["*" + tag] = interceptorClass; + } + } + }, + initHooks() { + var transformers, i, transformer, getTag, getUnknownTag, prototypeForTag, + hooks = B.C_JS_CONST0(); + hooks = A.applyHooksTransformer(B.C_JS_CONST1, A.applyHooksTransformer(B.C_JS_CONST2, A.applyHooksTransformer(B.C_JS_CONST3, A.applyHooksTransformer(B.C_JS_CONST3, A.applyHooksTransformer(B.C_JS_CONST4, A.applyHooksTransformer(B.C_JS_CONST5, A.applyHooksTransformer(B.C_JS_CONST6(B.C_JS_CONST), hooks))))))); + if (typeof dartNativeDispatchHooksTransformer != "undefined") { + transformers = dartNativeDispatchHooksTransformer; + if (typeof transformers == "function") + transformers = [transformers]; + if (Array.isArray(transformers)) + for (i = 0; i < transformers.length; ++i) { + transformer = transformers[i]; + if (typeof transformer == "function") + hooks = transformer(hooks) || hooks; + } + } + getTag = hooks.getTag; + getUnknownTag = hooks.getUnknownTag; + prototypeForTag = hooks.prototypeForTag; + $.getTagFunction = new A.initHooks_closure(getTag); + $.alternateTagFunction = new A.initHooks_closure0(getUnknownTag); + $.prototypeForTagFunction = new A.initHooks_closure1(prototypeForTag); + }, + applyHooksTransformer(transformer, hooks) { + return transformer(hooks) || hooks; + }, + createRecordTypePredicate(shape, fieldRtis) { + var $length = fieldRtis.length, + $function = init.rttc["" + $length + ";" + shape]; + if ($function == null) + return null; + if ($length === 0) + return $function; + if ($length === $function.length) + return $function.apply(null, fieldRtis); + return $function(fieldRtis); + }, + JSSyntaxRegExp_makeNative(source, multiLine, caseSensitive, unicode, dotAll, global) { + var m = multiLine ? "m" : "", + i = caseSensitive ? "" : "i", + u = unicode ? "u" : "", + s = dotAll ? "s" : "", + g = global ? "g" : "", + regexp = function(source, modifiers) { + try { + return new RegExp(source, modifiers); + } catch (e) { + return e; + } + }(source, m + i + u + s + g); + if (regexp instanceof RegExp) + return regexp; + throw A.wrapException(A.FormatException$("Illegal RegExp pattern (" + String(regexp) + ")", source, null)); + }, + stringContainsUnchecked(receiver, other, startIndex) { + var t1; + if (typeof other == "string") + return receiver.indexOf(other, startIndex) >= 0; + else if (other instanceof A.JSSyntaxRegExp) { + t1 = B.JSString_methods.substring$1(receiver, startIndex); + return other._nativeRegExp.test(t1); + } else { + t1 = J.allMatches$1$s(other, B.JSString_methods.substring$1(receiver, startIndex)); + return !t1.get$isEmpty(t1); + } + }, + escapeReplacement(replacement) { + if (replacement.indexOf("$", 0) >= 0) + return replacement.replace(/\$/g, "$$$$"); + return replacement; + }, + stringReplaceFirstRE(receiver, regexp, replacement, startIndex) { + var match = regexp._execGlobal$2(receiver, startIndex); + if (match == null) + return receiver; + return A.stringReplaceRangeUnchecked(receiver, match._match.index, match.get$end(), replacement); + }, + quoteStringForRegExp(string) { + if (/[[\]{}()*+?.\\^$|]/.test(string)) + return string.replace(/[[\]{}()*+?.\\^$|]/g, "\\$&"); + return string; + }, + stringReplaceAllUnchecked(receiver, pattern, replacement) { + var nativeRegexp; + if (typeof pattern == "string") + return A.stringReplaceAllUncheckedString(receiver, pattern, replacement); + if (pattern instanceof A.JSSyntaxRegExp) { + nativeRegexp = pattern.get$_nativeGlobalVersion(); + nativeRegexp.lastIndex = 0; + return receiver.replace(nativeRegexp, A.escapeReplacement(replacement)); + } + return A.stringReplaceAllGeneral(receiver, pattern, replacement); + }, + stringReplaceAllGeneral(receiver, pattern, replacement) { + var t1, startIndex, t2, match; + for (t1 = J.allMatches$1$s(pattern, receiver), t1 = t1.get$iterator(t1), startIndex = 0, t2 = ""; t1.moveNext$0();) { + match = t1.get$current(); + t2 = t2 + receiver.substring(startIndex, match.get$start()) + replacement; + startIndex = match.get$end(); + } + t1 = t2 + receiver.substring(startIndex); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + stringReplaceAllUncheckedString(receiver, pattern, replacement) { + var $length, t1, i; + if (pattern === "") { + if (receiver === "") + return replacement; + $length = receiver.length; + t1 = "" + replacement; + for (i = 0; i < $length; ++i) + t1 = t1 + receiver[i] + replacement; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + if (receiver.indexOf(pattern, 0) < 0) + return receiver; + if (receiver.length < 500 || replacement.indexOf("$", 0) >= 0) + return receiver.split(pattern).join(replacement); + return receiver.replace(new RegExp(A.quoteStringForRegExp(pattern), "g"), A.escapeReplacement(replacement)); + }, + _stringIdentity(string) { + return string; + }, + stringReplaceAllFuncUnchecked(receiver, pattern, onMatch, onNonMatch) { + var t1, t2, startIndex, t3, match, t4, t5; + for (t1 = pattern.allMatches$1(0, receiver), t1 = new A._AllMatchesIterator(t1._re, t1._string, t1._start), t2 = type$.RegExpMatch, startIndex = 0, t3 = ""; t1.moveNext$0();) { + match = t1.__js_helper$_current; + if (match == null) + match = t2._as(match); + t4 = match._match; + t5 = t4.index; + t3 = t3 + A.S(A._stringIdentity(B.JSString_methods.substring$2(receiver, startIndex, t5))) + A.S(onMatch.call$1(match)); + startIndex = t5 + t4[0].length; + } + t1 = t3 + A.S(A._stringIdentity(B.JSString_methods.substring$1(receiver, startIndex))); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + stringReplaceFirstUnchecked(receiver, pattern, replacement, startIndex) { + var index, t1, matches, match; + if (typeof pattern == "string") { + index = receiver.indexOf(pattern, startIndex); + if (index < 0) + return receiver; + return A.stringReplaceRangeUnchecked(receiver, index, index + pattern.length, replacement); + } + if (pattern instanceof A.JSSyntaxRegExp) + return startIndex === 0 ? receiver.replace(pattern._nativeRegExp, A.escapeReplacement(replacement)) : A.stringReplaceFirstRE(receiver, pattern, replacement, startIndex); + t1 = J.allMatches$2$s(pattern, receiver, startIndex); + matches = t1.get$iterator(t1); + if (!matches.moveNext$0()) + return receiver; + match = matches.get$current(); + return B.JSString_methods.replaceRange$3(receiver, match.get$start(), match.get$end(), replacement); + }, + stringReplaceRangeUnchecked(receiver, start, end, replacement) { + return receiver.substring(0, start) + replacement + receiver.substring(end); + }, + Instantiation: function Instantiation() { + }, + Instantiation1: function Instantiation1(t0, t1) { + this._genericClosure = t0; + this.$ti = t1; + }, + TypeErrorDecoder: function TypeErrorDecoder(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._pattern = t0; + _._arguments = t1; + _._argumentsExpr = t2; + _._expr = t3; + _._method = t4; + _._receiver = t5; + }, + NullError: function NullError(t0, t1) { + this.__js_helper$_message = t0; + this._method = t1; + }, + JsNoSuchMethodError: function JsNoSuchMethodError(t0, t1, t2) { + this.__js_helper$_message = t0; + this._method = t1; + this._receiver = t2; + }, + UnknownJsTypeError: function UnknownJsTypeError(t0) { + this.__js_helper$_message = t0; + }, + NullThrownFromJavaScriptException: function NullThrownFromJavaScriptException(t0) { + this._irritant = t0; + }, + ExceptionAndStackTrace: function ExceptionAndStackTrace(t0, t1) { + this.dartException = t0; + this.stackTrace = t1; + }, + _StackTrace: function _StackTrace(t0) { + this._exception = t0; + this._trace = null; + }, + Closure: function Closure() { + }, + Closure0Args: function Closure0Args() { + }, + Closure2Args: function Closure2Args() { + }, + TearOffClosure: function TearOffClosure() { + }, + StaticClosure: function StaticClosure() { + }, + BoundClosure: function BoundClosure(t0, t1) { + this._receiver = t0; + this._interceptor = t1; + }, + _CyclicInitializationError: function _CyclicInitializationError(t0) { + this.variableName = t0; + }, + RuntimeError: function RuntimeError(t0) { + this.message = t0; + }, + _AssertionError: function _AssertionError(t0) { + this.message = t0; + }, + JsLinkedHashMap: function JsLinkedHashMap(t0) { + var _ = this; + _.__js_helper$_length = 0; + _._last = _._first = _.__js_helper$_rest = _._nums = _._strings = null; + _._modifications = 0; + _.$ti = t0; + }, + LinkedHashMapCell: function LinkedHashMapCell(t0, t1) { + this.hashMapCellKey = t0; + this.hashMapCellValue = t1; + this._next = null; + }, + LinkedHashMapKeyIterable: function LinkedHashMapKeyIterable(t0, t1) { + this._map = t0; + this.$ti = t1; + }, + LinkedHashMapKeyIterator: function LinkedHashMapKeyIterator(t0, t1, t2) { + var _ = this; + _._map = t0; + _._modifications = t1; + _.__js_helper$_current = _._cell = null; + _.$ti = t2; + }, + initHooks_closure: function initHooks_closure(t0) { + this.getTag = t0; + }, + initHooks_closure0: function initHooks_closure0(t0) { + this.getUnknownTag = t0; + }, + initHooks_closure1: function initHooks_closure1(t0) { + this.prototypeForTag = t0; + }, + JSSyntaxRegExp: function JSSyntaxRegExp(t0, t1) { + var _ = this; + _.pattern = t0; + _._nativeRegExp = t1; + _._nativeAnchoredRegExp = _._nativeGlobalRegExp = null; + }, + _MatchImplementation: function _MatchImplementation(t0) { + this._match = t0; + }, + _AllMatchesIterable: function _AllMatchesIterable(t0, t1, t2) { + this._re = t0; + this._string = t1; + this._start = t2; + }, + _AllMatchesIterator: function _AllMatchesIterator(t0, t1, t2) { + var _ = this; + _._regExp = t0; + _._string = t1; + _._nextIndex = t2; + _.__js_helper$_current = null; + }, + StringMatch: function StringMatch(t0, t1) { + this.start = t0; + this.pattern = t1; + }, + _StringAllMatchesIterable: function _StringAllMatchesIterable(t0, t1, t2) { + this._input = t0; + this._pattern = t1; + this.__js_helper$_index = t2; + }, + _StringAllMatchesIterator: function _StringAllMatchesIterator(t0, t1, t2) { + var _ = this; + _._input = t0; + _._pattern = t1; + _.__js_helper$_index = t2; + _.__js_helper$_current = null; + }, + throwLateFieldADI(fieldName) { + A.throwExpressionWithWrapper(new A.LateError("Field '" + fieldName + "' has been assigned during initialization."), new Error()); + }, + _Cell$named(_name) { + var t1 = new A._Cell(_name); + return t1._value = t1; + }, + _Cell: function _Cell(t0) { + this.__late_helper$_name = t0; + this._value = null; + }, + _ensureNativeList(list) { + return list; + }, + _checkValidIndex(index, list, $length) { + if (index >>> 0 !== index || index >= $length) + throw A.wrapException(A.diagnoseIndexError(list, index)); + }, + _checkValidRange(start, end, $length) { + var t1; + if (!(start >>> 0 !== start)) + if (end == null) + t1 = start > $length; + else + t1 = end >>> 0 !== end || start > end || end > $length; + else + t1 = true; + if (t1) + throw A.wrapException(A.diagnoseRangeError(start, end, $length)); + if (end == null) + return $length; + return end; + }, + NativeByteBuffer: function NativeByteBuffer() { + }, + NativeTypedData: function NativeTypedData() { + }, + NativeByteData: function NativeByteData() { + }, + NativeTypedArray: function NativeTypedArray() { + }, + NativeTypedArrayOfDouble: function NativeTypedArrayOfDouble() { + }, + NativeTypedArrayOfInt: function NativeTypedArrayOfInt() { + }, + NativeFloat32List: function NativeFloat32List() { + }, + NativeFloat64List: function NativeFloat64List() { + }, + NativeInt16List: function NativeInt16List() { + }, + NativeInt32List: function NativeInt32List() { + }, + NativeInt8List: function NativeInt8List() { + }, + NativeUint16List: function NativeUint16List() { + }, + NativeUint32List: function NativeUint32List() { + }, + NativeUint8ClampedList: function NativeUint8ClampedList() { + }, + NativeUint8List: function NativeUint8List() { + }, + _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin: function _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin() { + }, + _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin: function _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin() { + }, + _NativeTypedArrayOfInt_NativeTypedArray_ListMixin: function _NativeTypedArrayOfInt_NativeTypedArray_ListMixin() { + }, + _NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin: function _NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin() { + }, + Rti__getQuestionFromStar(universe, rti) { + var question = rti._precomputed1; + return question == null ? rti._precomputed1 = A._Universe__lookupQuestionRti(universe, rti._primary, true) : question; + }, + Rti__getFutureFromFutureOr(universe, rti) { + var future = rti._precomputed1; + return future == null ? rti._precomputed1 = A._Universe__lookupInterfaceRti(universe, "Future", [rti._primary]) : future; + }, + Rti__isUnionOfFunctionType(rti) { + var kind = rti._kind; + if (kind === 6 || kind === 7 || kind === 8) + return A.Rti__isUnionOfFunctionType(rti._primary); + return kind === 12 || kind === 13; + }, + Rti__getCanonicalRecipe(rti) { + return rti._canonicalRecipe; + }, + findType(recipe) { + return A._Universe_eval(init.typeUniverse, recipe, false); + }, + instantiatedGenericFunctionType(genericFunctionRti, instantiationRti) { + var t1, cache, key, probe, rti; + if (genericFunctionRti == null) + return null; + t1 = instantiationRti._rest; + cache = genericFunctionRti._bindCache; + if (cache == null) + cache = genericFunctionRti._bindCache = new Map(); + key = instantiationRti._canonicalRecipe; + probe = cache.get(key); + if (probe != null) + return probe; + rti = A._substitute(init.typeUniverse, genericFunctionRti._primary, t1, 0); + cache.set(key, rti); + return rti; + }, + _substitute(universe, rti, typeArguments, depth) { + var baseType, substitutedBaseType, interfaceTypeArguments, substitutedInterfaceTypeArguments, base, substitutedBase, $arguments, substitutedArguments, returnType, substitutedReturnType, functionParameters, substitutedFunctionParameters, bounds, substitutedBounds, index, argument, + kind = rti._kind; + switch (kind) { + case 5: + case 1: + case 2: + case 3: + case 4: + return rti; + case 6: + baseType = rti._primary; + substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth); + if (substitutedBaseType === baseType) + return rti; + return A._Universe__lookupStarRti(universe, substitutedBaseType, true); + case 7: + baseType = rti._primary; + substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth); + if (substitutedBaseType === baseType) + return rti; + return A._Universe__lookupQuestionRti(universe, substitutedBaseType, true); + case 8: + baseType = rti._primary; + substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth); + if (substitutedBaseType === baseType) + return rti; + return A._Universe__lookupFutureOrRti(universe, substitutedBaseType, true); + case 9: + interfaceTypeArguments = rti._rest; + substitutedInterfaceTypeArguments = A._substituteArray(universe, interfaceTypeArguments, typeArguments, depth); + if (substitutedInterfaceTypeArguments === interfaceTypeArguments) + return rti; + return A._Universe__lookupInterfaceRti(universe, rti._primary, substitutedInterfaceTypeArguments); + case 10: + base = rti._primary; + substitutedBase = A._substitute(universe, base, typeArguments, depth); + $arguments = rti._rest; + substitutedArguments = A._substituteArray(universe, $arguments, typeArguments, depth); + if (substitutedBase === base && substitutedArguments === $arguments) + return rti; + return A._Universe__lookupBindingRti(universe, substitutedBase, substitutedArguments); + case 12: + returnType = rti._primary; + substitutedReturnType = A._substitute(universe, returnType, typeArguments, depth); + functionParameters = rti._rest; + substitutedFunctionParameters = A._substituteFunctionParameters(universe, functionParameters, typeArguments, depth); + if (substitutedReturnType === returnType && substitutedFunctionParameters === functionParameters) + return rti; + return A._Universe__lookupFunctionRti(universe, substitutedReturnType, substitutedFunctionParameters); + case 13: + bounds = rti._rest; + depth += bounds.length; + substitutedBounds = A._substituteArray(universe, bounds, typeArguments, depth); + base = rti._primary; + substitutedBase = A._substitute(universe, base, typeArguments, depth); + if (substitutedBounds === bounds && substitutedBase === base) + return rti; + return A._Universe__lookupGenericFunctionRti(universe, substitutedBase, substitutedBounds, true); + case 14: + index = rti._primary; + if (index < depth) + return rti; + argument = typeArguments[index - depth]; + if (argument == null) + return rti; + return argument; + default: + throw A.wrapException(A.AssertionError$("Attempted to substitute unexpected RTI kind " + kind)); + } + }, + _substituteArray(universe, rtiArray, typeArguments, depth) { + var changed, i, rti, substitutedRti, + $length = rtiArray.length, + result = A._Utils_newArrayOrEmpty($length); + for (changed = false, i = 0; i < $length; ++i) { + rti = rtiArray[i]; + substitutedRti = A._substitute(universe, rti, typeArguments, depth); + if (substitutedRti !== rti) + changed = true; + result[i] = substitutedRti; + } + return changed ? result : rtiArray; + }, + _substituteNamed(universe, namedArray, typeArguments, depth) { + var changed, i, t1, t2, rti, substitutedRti, + $length = namedArray.length, + result = A._Utils_newArrayOrEmpty($length); + for (changed = false, i = 0; i < $length; i += 3) { + t1 = namedArray[i]; + t2 = namedArray[i + 1]; + rti = namedArray[i + 2]; + substitutedRti = A._substitute(universe, rti, typeArguments, depth); + if (substitutedRti !== rti) + changed = true; + result.splice(i, 3, t1, t2, substitutedRti); + } + return changed ? result : namedArray; + }, + _substituteFunctionParameters(universe, functionParameters, typeArguments, depth) { + var result, + requiredPositional = functionParameters._requiredPositional, + substitutedRequiredPositional = A._substituteArray(universe, requiredPositional, typeArguments, depth), + optionalPositional = functionParameters._optionalPositional, + substitutedOptionalPositional = A._substituteArray(universe, optionalPositional, typeArguments, depth), + named = functionParameters._named, + substitutedNamed = A._substituteNamed(universe, named, typeArguments, depth); + if (substitutedRequiredPositional === requiredPositional && substitutedOptionalPositional === optionalPositional && substitutedNamed === named) + return functionParameters; + result = new A._FunctionParameters(); + result._requiredPositional = substitutedRequiredPositional; + result._optionalPositional = substitutedOptionalPositional; + result._named = substitutedNamed; + return result; + }, + _setArrayType(target, rti) { + target[init.arrayRti] = rti; + return target; + }, + closureFunctionType(closure) { + var t1, + signature = closure.$signature; + if (signature != null) { + if (typeof signature == "number") + return A.getTypeFromTypesTable(signature); + t1 = closure.$signature(); + return t1; + } + return null; + }, + instanceOrFunctionType(object, testRti) { + var rti; + if (A.Rti__isUnionOfFunctionType(testRti)) + if (object instanceof A.Closure) { + rti = A.closureFunctionType(object); + if (rti != null) + return rti; + } + return A.instanceType(object); + }, + instanceType(object) { + if (object instanceof A.Object) + return A._instanceType(object); + if (Array.isArray(object)) + return A._arrayInstanceType(object); + return A._instanceTypeFromConstructor(J.getInterceptor$(object)); + }, + _arrayInstanceType(object) { + var rti = object[init.arrayRti], + defaultRti = type$.JSArray_dynamic; + if (rti == null) + return defaultRti; + if (rti.constructor !== defaultRti.constructor) + return defaultRti; + return rti; + }, + _instanceType(object) { + var rti = object.$ti; + return rti != null ? rti : A._instanceTypeFromConstructor(object); + }, + _instanceTypeFromConstructor(instance) { + var $constructor = instance.constructor, + probe = $constructor.$ccache; + if (probe != null) + return probe; + return A._instanceTypeFromConstructorMiss(instance, $constructor); + }, + _instanceTypeFromConstructorMiss(instance, $constructor) { + var effectiveConstructor = instance instanceof A.Closure ? Object.getPrototypeOf(Object.getPrototypeOf(instance)).constructor : $constructor, + rti = A._Universe_findErasedType(init.typeUniverse, effectiveConstructor.name); + $constructor.$ccache = rti; + return rti; + }, + getTypeFromTypesTable(index) { + var rti, + table = init.types, + type = table[index]; + if (typeof type == "string") { + rti = A._Universe_eval(init.typeUniverse, type, false); + table[index] = rti; + return rti; + } + return type; + }, + getRuntimeTypeOfDartObject(object) { + return A.createRuntimeType(A._instanceType(object)); + }, + getRuntimeTypeOfClosure(closure) { + var rti = A.closureFunctionType(closure); + return A.createRuntimeType(rti == null ? A.instanceType(closure) : rti); + }, + _structuralTypeOf(object) { + var functionRti = object instanceof A.Closure ? A.closureFunctionType(object) : null; + if (functionRti != null) + return functionRti; + if (type$.TrustedGetRuntimeType._is(object)) + return J.get$runtimeType$(object)._rti; + if (Array.isArray(object)) + return A._arrayInstanceType(object); + return A.instanceType(object); + }, + createRuntimeType(rti) { + var t1 = rti._cachedRuntimeType; + return t1 == null ? rti._cachedRuntimeType = A._createRuntimeType(rti) : t1; + }, + _createRuntimeType(rti) { + var starErasedRti, t1, + s = rti._canonicalRecipe, + starErasedRecipe = s.replace(/\*/g, ""); + if (starErasedRecipe === s) + return rti._cachedRuntimeType = new A._Type(rti); + starErasedRti = A._Universe_eval(init.typeUniverse, starErasedRecipe, true); + t1 = starErasedRti._cachedRuntimeType; + return t1 == null ? starErasedRti._cachedRuntimeType = A._createRuntimeType(starErasedRti) : t1; + }, + typeLiteral(recipe) { + return A.createRuntimeType(A._Universe_eval(init.typeUniverse, recipe, false)); + }, + _installSpecializedIsTest(object) { + var t1, unstarred, isFn, $name, predicate, testRti = this; + if (testRti === type$.Object) + return A._finishIsFn(testRti, object, A._isObject); + if (!A.isStrongTopType(testRti)) + if (!(testRti === type$.legacy_Object)) + t1 = false; + else + t1 = true; + else + t1 = true; + if (t1) + return A._finishIsFn(testRti, object, A._isTop); + t1 = testRti._kind; + if (t1 === 7) + return A._finishIsFn(testRti, object, A._generalNullableIsTestImplementation); + if (t1 === 1) + return A._finishIsFn(testRti, object, A._isNever); + unstarred = t1 === 6 ? testRti._primary : testRti; + t1 = unstarred._kind; + if (t1 === 8) + return A._finishIsFn(testRti, object, A._isFutureOr); + if (unstarred === type$.int) + isFn = A._isInt; + else if (unstarred === type$.double || unstarred === type$.num) + isFn = A._isNum; + else if (unstarred === type$.String) + isFn = A._isString; + else + isFn = unstarred === type$.bool ? A._isBool : null; + if (isFn != null) + return A._finishIsFn(testRti, object, isFn); + if (t1 === 9) { + $name = unstarred._primary; + if (unstarred._rest.every(A.isTopType)) { + testRti._specializedTestResource = "$is" + $name; + if ($name === "List") + return A._finishIsFn(testRti, object, A._isListTestViaProperty); + return A._finishIsFn(testRti, object, A._isTestViaProperty); + } + } else if (t1 === 11) { + predicate = A.createRecordTypePredicate(unstarred._primary, unstarred._rest); + return A._finishIsFn(testRti, object, predicate == null ? A._isNever : predicate); + } + return A._finishIsFn(testRti, object, A._generalIsTestImplementation); + }, + _finishIsFn(testRti, object, isFn) { + testRti._is = isFn; + return testRti._is(object); + }, + _installSpecializedAsCheck(object) { + var t1, testRti = this, + asFn = A._generalAsCheckImplementation; + if (!A.isStrongTopType(testRti)) + if (!(testRti === type$.legacy_Object)) + t1 = false; + else + t1 = true; + else + t1 = true; + if (t1) + asFn = A._asTop; + else if (testRti === type$.Object) + asFn = A._asObject; + else { + t1 = A.isNullable(testRti); + if (t1) + asFn = A._generalNullableAsCheckImplementation; + } + testRti._as = asFn; + return testRti._as(object); + }, + _nullIs(testRti) { + var t1, + kind = testRti._kind; + if (!A.isStrongTopType(testRti)) + if (!(testRti === type$.legacy_Object)) + if (!(testRti === type$.legacy_Never)) + if (kind !== 7) + if (!(kind === 6 && A._nullIs(testRti._primary))) + t1 = kind === 8 && A._nullIs(testRti._primary) || testRti === type$.Null || testRti === type$.JSNull; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + return t1; + }, + _generalIsTestImplementation(object) { + var testRti = this; + if (object == null) + return A._nullIs(testRti); + return A._isSubtype(init.typeUniverse, A.instanceOrFunctionType(object, testRti), null, testRti, null); + }, + _generalNullableIsTestImplementation(object) { + if (object == null) + return true; + return this._primary._is(object); + }, + _isTestViaProperty(object) { + var tag, testRti = this; + if (object == null) + return A._nullIs(testRti); + tag = testRti._specializedTestResource; + if (object instanceof A.Object) + return !!object[tag]; + return !!J.getInterceptor$(object)[tag]; + }, + _isListTestViaProperty(object) { + var tag, testRti = this; + if (object == null) + return A._nullIs(testRti); + if (typeof object != "object") + return false; + if (Array.isArray(object)) + return true; + tag = testRti._specializedTestResource; + if (object instanceof A.Object) + return !!object[tag]; + return !!J.getInterceptor$(object)[tag]; + }, + _generalAsCheckImplementation(object) { + var t1, testRti = this; + if (object == null) { + t1 = A.isNullable(testRti); + if (t1) + return object; + } else if (testRti._is(object)) + return object; + A._failedAsCheck(object, testRti); + }, + _generalNullableAsCheckImplementation(object) { + var testRti = this; + if (object == null) + return object; + else if (testRti._is(object)) + return object; + A._failedAsCheck(object, testRti); + }, + _failedAsCheck(object, testRti) { + throw A.wrapException(A._TypeError$fromMessage(A._Error_compose(object, A._rtiToString(testRti, null)))); + }, + checkTypeBound(type, bound, variable, methodName) { + var _null = null; + if (A._isSubtype(init.typeUniverse, type, _null, bound, _null)) + return type; + throw A.wrapException(A._TypeError$fromMessage("The type argument '" + A._rtiToString(type, _null) + "' is not a subtype of the type variable bound '" + A._rtiToString(bound, _null) + "' of type variable '" + variable + "' in '" + methodName + "'.")); + }, + _Error_compose(object, checkedTypeDescription) { + return A.Error_safeToString(object) + ": type '" + A._rtiToString(A._structuralTypeOf(object), null) + "' is not a subtype of type '" + checkedTypeDescription + "'"; + }, + _TypeError$fromMessage(message) { + return new A._TypeError("TypeError: " + message); + }, + _TypeError__TypeError$forType(object, type) { + return new A._TypeError("TypeError: " + A._Error_compose(object, type)); + }, + _isFutureOr(object) { + var testRti = this, + unstarred = testRti._kind === 6 ? testRti._primary : testRti; + return unstarred._primary._is(object) || A.Rti__getFutureFromFutureOr(init.typeUniverse, unstarred)._is(object); + }, + _isObject(object) { + return object != null; + }, + _asObject(object) { + if (object != null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "Object")); + }, + _isTop(object) { + return true; + }, + _asTop(object) { + return object; + }, + _isNever(object) { + return false; + }, + _isBool(object) { + return true === object || false === object; + }, + _asBool(object) { + if (true === object) + return true; + if (false === object) + return false; + throw A.wrapException(A._TypeError__TypeError$forType(object, "bool")); + }, + _asBoolS(object) { + if (true === object) + return true; + if (false === object) + return false; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "bool")); + }, + _asBoolQ(object) { + if (true === object) + return true; + if (false === object) + return false; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "bool?")); + }, + _asDouble(object) { + if (typeof object == "number") + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "double")); + }, + _asDoubleS(object) { + if (typeof object == "number") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "double")); + }, + _asDoubleQ(object) { + if (typeof object == "number") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "double?")); + }, + _isInt(object) { + return typeof object == "number" && Math.floor(object) === object; + }, + _asInt(object) { + if (typeof object == "number" && Math.floor(object) === object) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "int")); + }, + _asIntS(object) { + if (typeof object == "number" && Math.floor(object) === object) + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "int")); + }, + _asIntQ(object) { + if (typeof object == "number" && Math.floor(object) === object) + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "int?")); + }, + _isNum(object) { + return typeof object == "number"; + }, + _asNum(object) { + if (typeof object == "number") + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "num")); + }, + _asNumS(object) { + if (typeof object == "number") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "num")); + }, + _asNumQ(object) { + if (typeof object == "number") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "num?")); + }, + _isString(object) { + return typeof object == "string"; + }, + _asString(object) { + if (typeof object == "string") + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "String")); + }, + _asStringS(object) { + if (typeof object == "string") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "String")); + }, + _asStringQ(object) { + if (typeof object == "string") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "String?")); + }, + _rtiArrayToString(array, genericContext) { + var s, sep, i; + for (s = "", sep = "", i = 0; i < array.length; ++i, sep = ", ") + s += sep + A._rtiToString(array[i], genericContext); + return s; + }, + _recordRtiToString(recordType, genericContext) { + var fieldCount, names, namesIndex, s, comma, i, + partialShape = recordType._primary, + fields = recordType._rest; + if ("" === partialShape) + return "(" + A._rtiArrayToString(fields, genericContext) + ")"; + fieldCount = fields.length; + names = partialShape.split(","); + namesIndex = names.length - fieldCount; + for (s = "(", comma = "", i = 0; i < fieldCount; ++i, comma = ", ") { + s += comma; + if (namesIndex === 0) + s += "{"; + s += A._rtiToString(fields[i], genericContext); + if (namesIndex >= 0) + s += " " + names[namesIndex]; + ++namesIndex; + } + return s + "})"; + }, + _functionRtiToString(functionType, genericContext, bounds) { + var boundsLength, outerContextLength, offset, i, t1, t2, typeParametersText, typeSep, t3, t4, boundRti, kind, parameters, requiredPositional, requiredPositionalLength, optionalPositional, optionalPositionalLength, named, namedLength, returnTypeText, argumentsText, sep, _s2_ = ", "; + if (bounds != null) { + boundsLength = bounds.length; + if (genericContext == null) { + genericContext = A._setArrayType([], type$.JSArray_String); + outerContextLength = null; + } else + outerContextLength = genericContext.length; + offset = genericContext.length; + for (i = boundsLength; i > 0; --i) + B.JSArray_methods.add$1(genericContext, "T" + (offset + i)); + for (t1 = type$.nullable_Object, t2 = type$.legacy_Object, typeParametersText = "<", typeSep = "", i = 0; i < boundsLength; ++i, typeSep = _s2_) { + t3 = genericContext.length; + t4 = t3 - 1 - i; + if (!(t4 >= 0)) + return A.ioore(genericContext, t4); + typeParametersText = B.JSString_methods.$add(typeParametersText + typeSep, genericContext[t4]); + boundRti = bounds[i]; + kind = boundRti._kind; + if (!(kind === 2 || kind === 3 || kind === 4 || kind === 5 || boundRti === t1)) + if (!(boundRti === t2)) + t3 = false; + else + t3 = true; + else + t3 = true; + if (!t3) + typeParametersText += " extends " + A._rtiToString(boundRti, genericContext); + } + typeParametersText += ">"; + } else { + typeParametersText = ""; + outerContextLength = null; + } + t1 = functionType._primary; + parameters = functionType._rest; + requiredPositional = parameters._requiredPositional; + requiredPositionalLength = requiredPositional.length; + optionalPositional = parameters._optionalPositional; + optionalPositionalLength = optionalPositional.length; + named = parameters._named; + namedLength = named.length; + returnTypeText = A._rtiToString(t1, genericContext); + for (argumentsText = "", sep = "", i = 0; i < requiredPositionalLength; ++i, sep = _s2_) + argumentsText += sep + A._rtiToString(requiredPositional[i], genericContext); + if (optionalPositionalLength > 0) { + argumentsText += sep + "["; + for (sep = "", i = 0; i < optionalPositionalLength; ++i, sep = _s2_) + argumentsText += sep + A._rtiToString(optionalPositional[i], genericContext); + argumentsText += "]"; + } + if (namedLength > 0) { + argumentsText += sep + "{"; + for (sep = "", i = 0; i < namedLength; i += 3, sep = _s2_) { + argumentsText += sep; + if (named[i + 1]) + argumentsText += "required "; + argumentsText += A._rtiToString(named[i + 2], genericContext) + " " + named[i]; + } + argumentsText += "}"; + } + if (outerContextLength != null) { + genericContext.toString; + genericContext.length = outerContextLength; + } + return typeParametersText + "(" + argumentsText + ") => " + returnTypeText; + }, + _rtiToString(rti, genericContext) { + var s, questionArgument, argumentKind, $name, $arguments, t1, t2, + kind = rti._kind; + if (kind === 5) + return "erased"; + if (kind === 2) + return "dynamic"; + if (kind === 3) + return "void"; + if (kind === 1) + return "Never"; + if (kind === 4) + return "any"; + if (kind === 6) { + s = A._rtiToString(rti._primary, genericContext); + return s; + } + if (kind === 7) { + questionArgument = rti._primary; + s = A._rtiToString(questionArgument, genericContext); + argumentKind = questionArgument._kind; + return (argumentKind === 12 || argumentKind === 13 ? "(" + s + ")" : s) + "?"; + } + if (kind === 8) + return "FutureOr<" + A._rtiToString(rti._primary, genericContext) + ">"; + if (kind === 9) { + $name = A._unminifyOrTag(rti._primary); + $arguments = rti._rest; + return $arguments.length > 0 ? $name + ("<" + A._rtiArrayToString($arguments, genericContext) + ">") : $name; + } + if (kind === 11) + return A._recordRtiToString(rti, genericContext); + if (kind === 12) + return A._functionRtiToString(rti, genericContext, null); + if (kind === 13) + return A._functionRtiToString(rti._primary, genericContext, rti._rest); + if (kind === 14) { + t1 = rti._primary; + t2 = genericContext.length; + t1 = t2 - 1 - t1; + if (!(t1 >= 0 && t1 < t2)) + return A.ioore(genericContext, t1); + return genericContext[t1]; + } + return "?"; + }, + _unminifyOrTag(rawClassName) { + var preserved = init.mangledGlobalNames[rawClassName]; + if (preserved != null) + return preserved; + return rawClassName; + }, + _Universe_findRule(universe, targetType) { + var rule = universe.tR[targetType]; + for (; typeof rule == "string";) + rule = universe.tR[rule]; + return rule; + }, + _Universe_findErasedType(universe, cls) { + var $length, erased, $arguments, i, $interface, + t1 = universe.eT, + probe = t1[cls]; + if (probe == null) + return A._Universe_eval(universe, cls, false); + else if (typeof probe == "number") { + $length = probe; + erased = A._Universe__lookupTerminalRti(universe, 5, "#"); + $arguments = A._Utils_newArrayOrEmpty($length); + for (i = 0; i < $length; ++i) + $arguments[i] = erased; + $interface = A._Universe__lookupInterfaceRti(universe, cls, $arguments); + t1[cls] = $interface; + return $interface; + } else + return probe; + }, + _Universe_addRules(universe, rules) { + return A._Utils_objectAssign(universe.tR, rules); + }, + _Universe_addErasedTypes(universe, types) { + return A._Utils_objectAssign(universe.eT, types); + }, + _Universe_eval(universe, recipe, normalize) { + var rti, + t1 = universe.eC, + probe = t1.get(recipe); + if (probe != null) + return probe; + rti = A._Parser_parse(A._Parser_create(universe, null, recipe, normalize)); + t1.set(recipe, rti); + return rti; + }, + _Universe_evalInEnvironment(universe, environment, recipe) { + var probe, rti, + cache = environment._evalCache; + if (cache == null) + cache = environment._evalCache = new Map(); + probe = cache.get(recipe); + if (probe != null) + return probe; + rti = A._Parser_parse(A._Parser_create(universe, environment, recipe, true)); + cache.set(recipe, rti); + return rti; + }, + _Universe_bind(universe, environment, argumentsRti) { + var argumentsRecipe, probe, rti, + cache = environment._bindCache; + if (cache == null) + cache = environment._bindCache = new Map(); + argumentsRecipe = argumentsRti._canonicalRecipe; + probe = cache.get(argumentsRecipe); + if (probe != null) + return probe; + rti = A._Universe__lookupBindingRti(universe, environment, argumentsRti._kind === 10 ? argumentsRti._rest : [argumentsRti]); + cache.set(argumentsRecipe, rti); + return rti; + }, + _Universe__installTypeTests(universe, rti) { + rti._as = A._installSpecializedAsCheck; + rti._is = A._installSpecializedIsTest; + return rti; + }, + _Universe__lookupTerminalRti(universe, kind, key) { + var rti, t1, + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = kind; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__lookupStarRti(universe, baseType, normalize) { + var t1, + key = baseType._canonicalRecipe + "*", + probe = universe.eC.get(key); + if (probe != null) + return probe; + t1 = A._Universe__createStarRti(universe, baseType, key, normalize); + universe.eC.set(key, t1); + return t1; + }, + _Universe__createStarRti(universe, baseType, key, normalize) { + var baseKind, t1, rti; + if (normalize) { + baseKind = baseType._kind; + if (!A.isStrongTopType(baseType)) + t1 = baseType === type$.Null || baseType === type$.JSNull || baseKind === 7 || baseKind === 6; + else + t1 = true; + if (t1) + return baseType; + } + rti = new A.Rti(null, null); + rti._kind = 6; + rti._primary = baseType; + rti._canonicalRecipe = key; + return A._Universe__installTypeTests(universe, rti); + }, + _Universe__lookupQuestionRti(universe, baseType, normalize) { + var t1, + key = baseType._canonicalRecipe + "?", + probe = universe.eC.get(key); + if (probe != null) + return probe; + t1 = A._Universe__createQuestionRti(universe, baseType, key, normalize); + universe.eC.set(key, t1); + return t1; + }, + _Universe__createQuestionRti(universe, baseType, key, normalize) { + var baseKind, t1, starArgument, rti; + if (normalize) { + baseKind = baseType._kind; + if (!A.isStrongTopType(baseType)) + if (!(baseType === type$.Null || baseType === type$.JSNull)) + if (baseKind !== 7) + t1 = baseKind === 8 && A.isNullable(baseType._primary); + else + t1 = true; + else + t1 = true; + else + t1 = true; + if (t1) + return baseType; + else if (baseKind === 1 || baseType === type$.legacy_Never) + return type$.Null; + else if (baseKind === 6) { + starArgument = baseType._primary; + if (starArgument._kind === 8 && A.isNullable(starArgument._primary)) + return starArgument; + else + return A.Rti__getQuestionFromStar(universe, baseType); + } + } + rti = new A.Rti(null, null); + rti._kind = 7; + rti._primary = baseType; + rti._canonicalRecipe = key; + return A._Universe__installTypeTests(universe, rti); + }, + _Universe__lookupFutureOrRti(universe, baseType, normalize) { + var t1, + key = baseType._canonicalRecipe + "/", + probe = universe.eC.get(key); + if (probe != null) + return probe; + t1 = A._Universe__createFutureOrRti(universe, baseType, key, normalize); + universe.eC.set(key, t1); + return t1; + }, + _Universe__createFutureOrRti(universe, baseType, key, normalize) { + var t1, t2, rti; + if (normalize) { + t1 = baseType._kind; + if (!A.isStrongTopType(baseType)) + if (!(baseType === type$.legacy_Object)) + t2 = false; + else + t2 = true; + else + t2 = true; + if (t2 || baseType === type$.Object) + return baseType; + else if (t1 === 1) + return A._Universe__lookupInterfaceRti(universe, "Future", [baseType]); + else if (baseType === type$.Null || baseType === type$.JSNull) + return type$.nullable_Future_Null; + } + rti = new A.Rti(null, null); + rti._kind = 8; + rti._primary = baseType; + rti._canonicalRecipe = key; + return A._Universe__installTypeTests(universe, rti); + }, + _Universe__lookupGenericFunctionParameterRti(universe, index) { + var rti, t1, + key = "" + index + "^", + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 14; + rti._primary = index; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__canonicalRecipeJoin($arguments) { + var s, sep, i, + $length = $arguments.length; + for (s = "", sep = "", i = 0; i < $length; ++i, sep = ",") + s += sep + $arguments[i]._canonicalRecipe; + return s; + }, + _Universe__canonicalRecipeJoinNamed($arguments) { + var s, sep, i, t1, nameSep, + $length = $arguments.length; + for (s = "", sep = "", i = 0; i < $length; i += 3, sep = ",") { + t1 = $arguments[i]; + nameSep = $arguments[i + 1] ? "!" : ":"; + s += sep + t1 + nameSep + $arguments[i + 2]._canonicalRecipe; + } + return s; + }, + _Universe__lookupInterfaceRti(universe, $name, $arguments) { + var probe, rti, t1, + s = $name; + if ($arguments.length > 0) + s += "<" + A._Universe__canonicalRecipeJoin($arguments) + ">"; + probe = universe.eC.get(s); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 9; + rti._primary = $name; + rti._rest = $arguments; + if ($arguments.length > 0) + rti._precomputed1 = $arguments[0]; + rti._canonicalRecipe = s; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(s, t1); + return t1; + }, + _Universe__lookupBindingRti(universe, base, $arguments) { + var newBase, newArguments, key, probe, rti, t1; + if (base._kind === 10) { + newBase = base._primary; + newArguments = base._rest.concat($arguments); + } else { + newArguments = $arguments; + newBase = base; + } + key = newBase._canonicalRecipe + (";<" + A._Universe__canonicalRecipeJoin(newArguments) + ">"); + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 10; + rti._primary = newBase; + rti._rest = newArguments; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__lookupRecordRti(universe, partialShapeTag, fields) { + var rti, t1, + key = "+" + (partialShapeTag + "(" + A._Universe__canonicalRecipeJoin(fields) + ")"), + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 11; + rti._primary = partialShapeTag; + rti._rest = fields; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__lookupFunctionRti(universe, returnType, parameters) { + var sep, key, probe, rti, t1, + s = returnType._canonicalRecipe, + requiredPositional = parameters._requiredPositional, + requiredPositionalLength = requiredPositional.length, + optionalPositional = parameters._optionalPositional, + optionalPositionalLength = optionalPositional.length, + named = parameters._named, + namedLength = named.length, + recipe = "(" + A._Universe__canonicalRecipeJoin(requiredPositional); + if (optionalPositionalLength > 0) { + sep = requiredPositionalLength > 0 ? "," : ""; + recipe += sep + "[" + A._Universe__canonicalRecipeJoin(optionalPositional) + "]"; + } + if (namedLength > 0) { + sep = requiredPositionalLength > 0 ? "," : ""; + recipe += sep + "{" + A._Universe__canonicalRecipeJoinNamed(named) + "}"; + } + key = s + (recipe + ")"); + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 12; + rti._primary = returnType; + rti._rest = parameters; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__lookupGenericFunctionRti(universe, baseFunctionType, bounds, normalize) { + var t1, + key = baseFunctionType._canonicalRecipe + ("<" + A._Universe__canonicalRecipeJoin(bounds) + ">"), + probe = universe.eC.get(key); + if (probe != null) + return probe; + t1 = A._Universe__createGenericFunctionRti(universe, baseFunctionType, bounds, key, normalize); + universe.eC.set(key, t1); + return t1; + }, + _Universe__createGenericFunctionRti(universe, baseFunctionType, bounds, key, normalize) { + var $length, typeArguments, count, i, bound, substitutedBase, substitutedBounds, rti; + if (normalize) { + $length = bounds.length; + typeArguments = A._Utils_newArrayOrEmpty($length); + for (count = 0, i = 0; i < $length; ++i) { + bound = bounds[i]; + if (bound._kind === 1) { + typeArguments[i] = bound; + ++count; + } + } + if (count > 0) { + substitutedBase = A._substitute(universe, baseFunctionType, typeArguments, 0); + substitutedBounds = A._substituteArray(universe, bounds, typeArguments, 0); + return A._Universe__lookupGenericFunctionRti(universe, substitutedBase, substitutedBounds, bounds !== substitutedBounds); + } + } + rti = new A.Rti(null, null); + rti._kind = 13; + rti._primary = baseFunctionType; + rti._rest = bounds; + rti._canonicalRecipe = key; + return A._Universe__installTypeTests(universe, rti); + }, + _Parser_create(universe, environment, recipe, normalize) { + return {u: universe, e: environment, r: recipe, s: [], p: 0, n: normalize}; + }, + _Parser_parse(parser) { + var t2, i, ch, t3, array, end, item, + source = parser.r, + t1 = parser.s; + for (t2 = source.length, i = 0; i < t2;) { + ch = source.charCodeAt(i); + if (ch >= 48 && ch <= 57) + i = A._Parser_handleDigit(i + 1, ch, source, t1); + else if ((((ch | 32) >>> 0) - 97 & 65535) < 26 || ch === 95 || ch === 36 || ch === 124) + i = A._Parser_handleIdentifier(parser, i, source, t1, false); + else if (ch === 46) + i = A._Parser_handleIdentifier(parser, i, source, t1, true); + else { + ++i; + switch (ch) { + case 44: + break; + case 58: + t1.push(false); + break; + case 33: + t1.push(true); + break; + case 59: + t1.push(A._Parser_toType(parser.u, parser.e, t1.pop())); + break; + case 94: + t1.push(A._Universe__lookupGenericFunctionParameterRti(parser.u, t1.pop())); + break; + case 35: + t1.push(A._Universe__lookupTerminalRti(parser.u, 5, "#")); + break; + case 64: + t1.push(A._Universe__lookupTerminalRti(parser.u, 2, "@")); + break; + case 126: + t1.push(A._Universe__lookupTerminalRti(parser.u, 3, "~")); + break; + case 60: + t1.push(parser.p); + parser.p = t1.length; + break; + case 62: + A._Parser_handleTypeArguments(parser, t1); + break; + case 38: + A._Parser_handleExtendedOperations(parser, t1); + break; + case 42: + t3 = parser.u; + t1.push(A._Universe__lookupStarRti(t3, A._Parser_toType(t3, parser.e, t1.pop()), parser.n)); + break; + case 63: + t3 = parser.u; + t1.push(A._Universe__lookupQuestionRti(t3, A._Parser_toType(t3, parser.e, t1.pop()), parser.n)); + break; + case 47: + t3 = parser.u; + t1.push(A._Universe__lookupFutureOrRti(t3, A._Parser_toType(t3, parser.e, t1.pop()), parser.n)); + break; + case 40: + t1.push(-3); + t1.push(parser.p); + parser.p = t1.length; + break; + case 41: + A._Parser_handleArguments(parser, t1); + break; + case 91: + t1.push(parser.p); + parser.p = t1.length; + break; + case 93: + array = t1.splice(parser.p); + A._Parser_toTypes(parser.u, parser.e, array); + parser.p = t1.pop(); + t1.push(array); + t1.push(-1); + break; + case 123: + t1.push(parser.p); + parser.p = t1.length; + break; + case 125: + array = t1.splice(parser.p); + A._Parser_toTypesNamed(parser.u, parser.e, array); + parser.p = t1.pop(); + t1.push(array); + t1.push(-2); + break; + case 43: + end = source.indexOf("(", i); + t1.push(source.substring(i, end)); + t1.push(-4); + t1.push(parser.p); + parser.p = t1.length; + i = end + 1; + break; + default: + throw "Bad character " + ch; + } + } + } + item = t1.pop(); + return A._Parser_toType(parser.u, parser.e, item); + }, + _Parser_handleDigit(i, digit, source, stack) { + var t1, ch, + value = digit - 48; + for (t1 = source.length; i < t1; ++i) { + ch = source.charCodeAt(i); + if (!(ch >= 48 && ch <= 57)) + break; + value = value * 10 + (ch - 48); + } + stack.push(value); + return i; + }, + _Parser_handleIdentifier(parser, start, source, stack, hasPeriod) { + var t1, ch, t2, string, environment, recipe, + i = start + 1; + for (t1 = source.length; i < t1; ++i) { + ch = source.charCodeAt(i); + if (ch === 46) { + if (hasPeriod) + break; + hasPeriod = true; + } else { + if (!((((ch | 32) >>> 0) - 97 & 65535) < 26 || ch === 95 || ch === 36 || ch === 124)) + t2 = ch >= 48 && ch <= 57; + else + t2 = true; + if (!t2) + break; + } + } + string = source.substring(start, i); + if (hasPeriod) { + t1 = parser.u; + environment = parser.e; + if (environment._kind === 10) + environment = environment._primary; + recipe = A._Universe_findRule(t1, environment._primary)[string]; + if (recipe == null) + A.throwExpression('No "' + string + '" in "' + A.Rti__getCanonicalRecipe(environment) + '"'); + stack.push(A._Universe_evalInEnvironment(t1, environment, recipe)); + } else + stack.push(string); + return i; + }, + _Parser_handleTypeArguments(parser, stack) { + var base, + t1 = parser.u, + $arguments = A._Parser_collectArray(parser, stack), + head = stack.pop(); + if (typeof head == "string") + stack.push(A._Universe__lookupInterfaceRti(t1, head, $arguments)); + else { + base = A._Parser_toType(t1, parser.e, head); + switch (base._kind) { + case 12: + stack.push(A._Universe__lookupGenericFunctionRti(t1, base, $arguments, parser.n)); + break; + default: + stack.push(A._Universe__lookupBindingRti(t1, base, $arguments)); + break; + } + } + }, + _Parser_handleArguments(parser, stack) { + var optionalPositional, named, requiredPositional, returnType, parameters, _null = null, + t1 = parser.u, + head = stack.pop(); + if (typeof head == "number") + switch (head) { + case -1: + optionalPositional = stack.pop(); + named = _null; + break; + case -2: + named = stack.pop(); + optionalPositional = _null; + break; + default: + stack.push(head); + named = _null; + optionalPositional = named; + break; + } + else { + stack.push(head); + named = _null; + optionalPositional = named; + } + requiredPositional = A._Parser_collectArray(parser, stack); + head = stack.pop(); + switch (head) { + case -3: + head = stack.pop(); + if (optionalPositional == null) + optionalPositional = t1.sEA; + if (named == null) + named = t1.sEA; + returnType = A._Parser_toType(t1, parser.e, head); + parameters = new A._FunctionParameters(); + parameters._requiredPositional = requiredPositional; + parameters._optionalPositional = optionalPositional; + parameters._named = named; + stack.push(A._Universe__lookupFunctionRti(t1, returnType, parameters)); + return; + case -4: + stack.push(A._Universe__lookupRecordRti(t1, stack.pop(), requiredPositional)); + return; + default: + throw A.wrapException(A.AssertionError$("Unexpected state under `()`: " + A.S(head))); + } + }, + _Parser_handleExtendedOperations(parser, stack) { + var $top = stack.pop(); + if (0 === $top) { + stack.push(A._Universe__lookupTerminalRti(parser.u, 1, "0&")); + return; + } + if (1 === $top) { + stack.push(A._Universe__lookupTerminalRti(parser.u, 4, "1&")); + return; + } + throw A.wrapException(A.AssertionError$("Unexpected extended operation " + A.S($top))); + }, + _Parser_collectArray(parser, stack) { + var array = stack.splice(parser.p); + A._Parser_toTypes(parser.u, parser.e, array); + parser.p = stack.pop(); + return array; + }, + _Parser_toType(universe, environment, item) { + if (typeof item == "string") + return A._Universe__lookupInterfaceRti(universe, item, universe.sEA); + else if (typeof item == "number") { + environment.toString; + return A._Parser_indexToType(universe, environment, item); + } else + return item; + }, + _Parser_toTypes(universe, environment, items) { + var i, + $length = items.length; + for (i = 0; i < $length; ++i) + items[i] = A._Parser_toType(universe, environment, items[i]); + }, + _Parser_toTypesNamed(universe, environment, items) { + var i, + $length = items.length; + for (i = 2; i < $length; i += 3) + items[i] = A._Parser_toType(universe, environment, items[i]); + }, + _Parser_indexToType(universe, environment, index) { + var typeArguments, len, + kind = environment._kind; + if (kind === 10) { + if (index === 0) + return environment._primary; + typeArguments = environment._rest; + len = typeArguments.length; + if (index <= len) + return typeArguments[index - 1]; + index -= len; + environment = environment._primary; + kind = environment._kind; + } else if (index === 0) + return environment; + if (kind !== 9) + throw A.wrapException(A.AssertionError$("Indexed base must be an interface type")); + typeArguments = environment._rest; + if (index <= typeArguments.length) + return typeArguments[index - 1]; + throw A.wrapException(A.AssertionError$("Bad index " + index + " for " + environment.toString$0(0))); + }, + _isSubtype(universe, s, sEnv, t, tEnv) { + var t1, sKind, leftTypeVariable, tKind, t2, sBounds, tBounds, sLength, i, sBound, tBound; + if (s === t) + return true; + if (!A.isStrongTopType(t)) + if (!(t === type$.legacy_Object)) + t1 = false; + else + t1 = true; + else + t1 = true; + if (t1) + return true; + sKind = s._kind; + if (sKind === 4) + return true; + if (A.isStrongTopType(s)) + return false; + if (s._kind !== 1) + t1 = false; + else + t1 = true; + if (t1) + return true; + leftTypeVariable = sKind === 14; + if (leftTypeVariable) + if (A._isSubtype(universe, sEnv[s._primary], sEnv, t, tEnv)) + return true; + tKind = t._kind; + t1 = s === type$.Null || s === type$.JSNull; + if (t1) { + if (tKind === 8) + return A._isSubtype(universe, s, sEnv, t._primary, tEnv); + return t === type$.Null || t === type$.JSNull || tKind === 7 || tKind === 6; + } + if (t === type$.Object) { + if (sKind === 8) + return A._isSubtype(universe, s._primary, sEnv, t, tEnv); + if (sKind === 6) + return A._isSubtype(universe, s._primary, sEnv, t, tEnv); + return sKind !== 7; + } + if (sKind === 6) + return A._isSubtype(universe, s._primary, sEnv, t, tEnv); + if (tKind === 6) { + t1 = A.Rti__getQuestionFromStar(universe, t); + return A._isSubtype(universe, s, sEnv, t1, tEnv); + } + if (sKind === 8) { + if (!A._isSubtype(universe, s._primary, sEnv, t, tEnv)) + return false; + return A._isSubtype(universe, A.Rti__getFutureFromFutureOr(universe, s), sEnv, t, tEnv); + } + if (sKind === 7) { + t1 = A._isSubtype(universe, type$.Null, sEnv, t, tEnv); + return t1 && A._isSubtype(universe, s._primary, sEnv, t, tEnv); + } + if (tKind === 8) { + if (A._isSubtype(universe, s, sEnv, t._primary, tEnv)) + return true; + return A._isSubtype(universe, s, sEnv, A.Rti__getFutureFromFutureOr(universe, t), tEnv); + } + if (tKind === 7) { + t1 = A._isSubtype(universe, s, sEnv, type$.Null, tEnv); + return t1 || A._isSubtype(universe, s, sEnv, t._primary, tEnv); + } + if (leftTypeVariable) + return false; + t1 = sKind !== 12; + if ((!t1 || sKind === 13) && t === type$.Function) + return true; + t2 = sKind === 11; + if (t2 && t === type$.Record) + return true; + if (tKind === 13) { + if (s === type$.JavaScriptFunction) + return true; + if (sKind !== 13) + return false; + sBounds = s._rest; + tBounds = t._rest; + sLength = sBounds.length; + if (sLength !== tBounds.length) + return false; + sEnv = sEnv == null ? sBounds : sBounds.concat(sEnv); + tEnv = tEnv == null ? tBounds : tBounds.concat(tEnv); + for (i = 0; i < sLength; ++i) { + sBound = sBounds[i]; + tBound = tBounds[i]; + if (!A._isSubtype(universe, sBound, sEnv, tBound, tEnv) || !A._isSubtype(universe, tBound, tEnv, sBound, sEnv)) + return false; + } + return A._isFunctionSubtype(universe, s._primary, sEnv, t._primary, tEnv); + } + if (tKind === 12) { + if (s === type$.JavaScriptFunction) + return true; + if (t1) + return false; + return A._isFunctionSubtype(universe, s, sEnv, t, tEnv); + } + if (sKind === 9) { + if (tKind !== 9) + return false; + return A._isInterfaceSubtype(universe, s, sEnv, t, tEnv); + } + if (t2 && tKind === 11) + return A._isRecordSubtype(universe, s, sEnv, t, tEnv); + return false; + }, + _isFunctionSubtype(universe, s, sEnv, t, tEnv) { + var sParameters, tParameters, sRequiredPositional, tRequiredPositional, sRequiredPositionalLength, tRequiredPositionalLength, requiredPositionalDelta, sOptionalPositional, tOptionalPositional, sOptionalPositionalLength, tOptionalPositionalLength, i, t1, sNamed, tNamed, sNamedLength, tNamedLength, sIndex, tIndex, tName, sName, sIsRequired; + if (!A._isSubtype(universe, s._primary, sEnv, t._primary, tEnv)) + return false; + sParameters = s._rest; + tParameters = t._rest; + sRequiredPositional = sParameters._requiredPositional; + tRequiredPositional = tParameters._requiredPositional; + sRequiredPositionalLength = sRequiredPositional.length; + tRequiredPositionalLength = tRequiredPositional.length; + if (sRequiredPositionalLength > tRequiredPositionalLength) + return false; + requiredPositionalDelta = tRequiredPositionalLength - sRequiredPositionalLength; + sOptionalPositional = sParameters._optionalPositional; + tOptionalPositional = tParameters._optionalPositional; + sOptionalPositionalLength = sOptionalPositional.length; + tOptionalPositionalLength = tOptionalPositional.length; + if (sRequiredPositionalLength + sOptionalPositionalLength < tRequiredPositionalLength + tOptionalPositionalLength) + return false; + for (i = 0; i < sRequiredPositionalLength; ++i) { + t1 = sRequiredPositional[i]; + if (!A._isSubtype(universe, tRequiredPositional[i], tEnv, t1, sEnv)) + return false; + } + for (i = 0; i < requiredPositionalDelta; ++i) { + t1 = sOptionalPositional[i]; + if (!A._isSubtype(universe, tRequiredPositional[sRequiredPositionalLength + i], tEnv, t1, sEnv)) + return false; + } + for (i = 0; i < tOptionalPositionalLength; ++i) { + t1 = sOptionalPositional[requiredPositionalDelta + i]; + if (!A._isSubtype(universe, tOptionalPositional[i], tEnv, t1, sEnv)) + return false; + } + sNamed = sParameters._named; + tNamed = tParameters._named; + sNamedLength = sNamed.length; + tNamedLength = tNamed.length; + for (sIndex = 0, tIndex = 0; tIndex < tNamedLength; tIndex += 3) { + tName = tNamed[tIndex]; + for (; true;) { + if (sIndex >= sNamedLength) + return false; + sName = sNamed[sIndex]; + sIndex += 3; + if (tName < sName) + return false; + sIsRequired = sNamed[sIndex - 2]; + if (sName < tName) { + if (sIsRequired) + return false; + continue; + } + t1 = tNamed[tIndex + 1]; + if (sIsRequired && !t1) + return false; + t1 = sNamed[sIndex - 1]; + if (!A._isSubtype(universe, tNamed[tIndex + 2], tEnv, t1, sEnv)) + return false; + break; + } + } + for (; sIndex < sNamedLength;) { + if (sNamed[sIndex + 1]) + return false; + sIndex += 3; + } + return true; + }, + _isInterfaceSubtype(universe, s, sEnv, t, tEnv) { + var rule, recipes, $length, supertypeArgs, i, t1, t2, + sName = s._primary, + tName = t._primary; + for (; sName !== tName;) { + rule = universe.tR[sName]; + if (rule == null) + return false; + if (typeof rule == "string") { + sName = rule; + continue; + } + recipes = rule[tName]; + if (recipes == null) + return false; + $length = recipes.length; + supertypeArgs = $length > 0 ? new Array($length) : init.typeUniverse.sEA; + for (i = 0; i < $length; ++i) + supertypeArgs[i] = A._Universe_evalInEnvironment(universe, s, recipes[i]); + return A._areArgumentsSubtypes(universe, supertypeArgs, null, sEnv, t._rest, tEnv); + } + t1 = s._rest; + t2 = t._rest; + return A._areArgumentsSubtypes(universe, t1, null, sEnv, t2, tEnv); + }, + _areArgumentsSubtypes(universe, sArgs, sVariances, sEnv, tArgs, tEnv) { + var i, t1, t2, + $length = sArgs.length; + for (i = 0; i < $length; ++i) { + t1 = sArgs[i]; + t2 = tArgs[i]; + if (!A._isSubtype(universe, t1, sEnv, t2, tEnv)) + return false; + } + return true; + }, + _isRecordSubtype(universe, s, sEnv, t, tEnv) { + var i, + sFields = s._rest, + tFields = t._rest, + sCount = sFields.length; + if (sCount !== tFields.length) + return false; + if (s._primary !== t._primary) + return false; + for (i = 0; i < sCount; ++i) + if (!A._isSubtype(universe, sFields[i], sEnv, tFields[i], tEnv)) + return false; + return true; + }, + isNullable(t) { + var t1, + kind = t._kind; + if (!(t === type$.Null || t === type$.JSNull)) + if (!A.isStrongTopType(t)) + if (kind !== 7) + if (!(kind === 6 && A.isNullable(t._primary))) + t1 = kind === 8 && A.isNullable(t._primary); + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + return t1; + }, + isTopType(t) { + var t1; + if (!A.isStrongTopType(t)) + if (!(t === type$.legacy_Object)) + t1 = false; + else + t1 = true; + else + t1 = true; + return t1; + }, + isStrongTopType(t) { + var kind = t._kind; + return kind === 2 || kind === 3 || kind === 4 || kind === 5 || t === type$.nullable_Object; + }, + _Utils_objectAssign(o, other) { + var i, key, + keys = Object.keys(other), + $length = keys.length; + for (i = 0; i < $length; ++i) { + key = keys[i]; + o[key] = other[key]; + } + }, + _Utils_newArrayOrEmpty($length) { + return $length > 0 ? new Array($length) : init.typeUniverse.sEA; + }, + Rti: function Rti(t0, t1) { + var _ = this; + _._as = t0; + _._is = t1; + _._cachedRuntimeType = _._specializedTestResource = _._precomputed1 = null; + _._kind = 0; + _._canonicalRecipe = _._bindCache = _._evalCache = _._rest = _._primary = null; + }, + _FunctionParameters: function _FunctionParameters() { + this._named = this._optionalPositional = this._requiredPositional = null; + }, + _Type: function _Type(t0) { + this._rti = t0; + }, + _Error: function _Error() { + }, + _TypeError: function _TypeError(t0) { + this.__rti$_message = t0; + }, + _AsyncRun__initializeScheduleImmediate() { + var div, span, t1 = {}; + if (self.scheduleImmediate != null) + return A.async__AsyncRun__scheduleImmediateJsOverride$closure(); + if (self.MutationObserver != null && self.document != null) { + div = self.document.createElement("div"); + span = self.document.createElement("span"); + t1.storedCallback = null; + new self.MutationObserver(A.convertDartClosureToJS(new A._AsyncRun__initializeScheduleImmediate_internalCallback(t1), 1)).observe(div, {childList: true}); + return new A._AsyncRun__initializeScheduleImmediate_closure(t1, div, span); + } else if (self.setImmediate != null) + return A.async__AsyncRun__scheduleImmediateWithSetImmediate$closure(); + return A.async__AsyncRun__scheduleImmediateWithTimer$closure(); + }, + _AsyncRun__scheduleImmediateJsOverride(callback) { + self.scheduleImmediate(A.convertDartClosureToJS(new A._AsyncRun__scheduleImmediateJsOverride_internalCallback(type$.void_Function._as(callback)), 0)); + }, + _AsyncRun__scheduleImmediateWithSetImmediate(callback) { + self.setImmediate(A.convertDartClosureToJS(new A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(type$.void_Function._as(callback)), 0)); + }, + _AsyncRun__scheduleImmediateWithTimer(callback) { + A.Timer__createTimer(B.C_Duration, type$.void_Function._as(callback)); + }, + Timer__createTimer(duration, callback) { + return A._TimerImpl$(0, callback); + }, + _TimerImpl$(milliseconds, callback) { + var t1 = new A._TimerImpl(); + t1._TimerImpl$2(milliseconds, callback); + return t1; + }, + _TimerImpl$periodic(milliseconds, callback) { + var t1 = new A._TimerImpl(); + t1._TimerImpl$periodic$2(milliseconds, callback); + return t1; + }, + _makeAsyncAwaitCompleter($T) { + return new A._AsyncAwaitCompleter(new A._Future($.Zone__current, $T._eval$1("_Future<0>")), $T._eval$1("_AsyncAwaitCompleter<0>")); + }, + _asyncStartSync(bodyFunction, completer) { + bodyFunction.call$2(0, null); + completer.isSync = true; + return completer._future; + }, + _asyncAwait(object, bodyFunction) { + A._awaitOnObject(object, bodyFunction); + }, + _asyncReturn(object, completer) { + var value, t2, + t1 = completer.$ti; + t1._eval$1("1/?")._as(object); + value = object == null ? t1._precomputed1._as(object) : object; + if (!completer.isSync) + completer._future._asyncComplete$1(value); + else { + t2 = completer._future; + if (t1._eval$1("Future<1>")._is(value)) + t2._chainFuture$1(value); + else + t2._completeWithValue$1(value); + } + }, + _asyncRethrow(object, completer) { + var t1 = A.unwrapException(object), + st = A.getTraceFromException(object), + t2 = completer.isSync, + t3 = completer._future; + if (t2) + t3._completeError$2(t1, st); + else + t3._asyncCompleteError$2(t1, st); + }, + _awaitOnObject(object, bodyFunction) { + var t1, future, + thenCallback = new A._awaitOnObject_closure(bodyFunction), + errorCallback = new A._awaitOnObject_closure0(bodyFunction); + if (object instanceof A._Future) + object._thenAwait$1$2(thenCallback, errorCallback, type$.dynamic); + else { + t1 = type$.dynamic; + if (object instanceof A._Future) + object.then$1$2$onError(thenCallback, errorCallback, t1); + else { + future = new A._Future($.Zone__current, type$._Future_dynamic); + future._state = 8; + future._resultOrListeners = object; + future._thenAwait$1$2(thenCallback, errorCallback, t1); + } + } + }, + _wrapJsFunctionForAsync($function) { + var $protected = function(fn, ERROR) { + return function(errorCode, result) { + while (true) + try { + fn(errorCode, result); + break; + } catch (error) { + result = error; + errorCode = ERROR; + } + }; + }($function, 1); + return $.Zone__current.registerBinaryCallback$3$1(new A._wrapJsFunctionForAsync_closure($protected), type$.void, type$.int, type$.dynamic); + }, + AsyncError$(error, stackTrace) { + var t1 = A.checkNotNullable(error, "error", type$.Object); + return new A.AsyncError(t1, stackTrace == null ? A.AsyncError_defaultStackTrace(error) : stackTrace); + }, + AsyncError_defaultStackTrace(error) { + var stackTrace; + if (type$.Error._is(error)) { + stackTrace = error.get$stackTrace(); + if (stackTrace != null) + return stackTrace; + } + return B._StringStackTrace_3uE; + }, + Future___value_tearOff(value, $T) { + var t1, t2; + $T._eval$1("0/?")._as(value); + t1 = value == null ? $T._as(value) : value; + t2 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")); + t2._asyncComplete$1(t1); + return t2; + }, + Future_wait(futures, $T) { + var error, stackTrace, handleError, future, pos, e, st, t2, t3, t4, t5, exception, replacement, _box_0 = {}, cleanUp = null, + eagerError = false, + t1 = $T._eval$1("_Future>"), + _future = new A._Future($.Zone__current, t1); + _box_0.values = null; + _box_0.remaining = 0; + error = A._Cell$named("error"); + stackTrace = A._Cell$named("stackTrace"); + handleError = new A.Future_wait_handleError(_box_0, cleanUp, eagerError, _future, error, stackTrace); + try { + for (t2 = futures.$ti, t3 = new A.ListIterator(futures, futures.get$length(futures), t2._eval$1("ListIterator")), t4 = type$.Null, t2 = t2._eval$1("ListIterable.E"); t3.moveNext$0();) { + t5 = t3.__internal$_current; + future = t5 == null ? t2._as(t5) : t5; + pos = _box_0.remaining; + future.then$1$2$onError(new A.Future_wait_closure(_box_0, pos, _future, cleanUp, eagerError, error, stackTrace, $T), handleError, t4); + ++_box_0.remaining; + } + t2 = _box_0.remaining; + if (t2 === 0) { + t2 = _future; + t2._completeWithValue$1(A._setArrayType([], $T._eval$1("JSArray<0>"))); + return t2; + } + _box_0.values = A.List_List$filled(t2, null, false, $T._eval$1("0?")); + } catch (exception) { + e = A.unwrapException(exception); + st = A.getTraceFromException(exception); + if (_box_0.remaining === 0 || A.boolConversionCheck(eagerError)) { + error = e; + stackTrace = st; + A.checkNotNullable(error, "error", type$.Object); + t2 = $.Zone__current; + if (t2 !== B.C__RootZone) { + replacement = t2.errorCallback$2(error, stackTrace); + if (replacement != null) { + error = replacement.error; + stackTrace = replacement.stackTrace; + } + } + if (stackTrace == null) + stackTrace = A.AsyncError_defaultStackTrace(error); + t1 = new A._Future($.Zone__current, t1); + t1._asyncCompleteError$2(error, stackTrace); + return t1; + } else { + error._value = e; + stackTrace._value = st; + } + } + return _future; + }, + _Future__chainCoreFutureSync(source, target) { + var t1, t2, listeners; + for (t1 = type$._Future_dynamic; t2 = source._state, (t2 & 4) !== 0;) + source = t1._as(source._resultOrListeners); + if ((t2 & 24) !== 0) { + listeners = target._removeListeners$0(); + target._cloneResult$1(source); + A._Future__propagateToListeners(target, listeners); + } else { + listeners = type$.nullable__FutureListener_dynamic_dynamic._as(target._resultOrListeners); + target._setChained$1(source); + source._prependListeners$1(listeners); + } + }, + _Future__chainCoreFutureAsync(source, target) { + var t2, t3, listeners, _box_0 = {}, + t1 = _box_0.source = source; + for (t2 = type$._Future_dynamic; t3 = t1._state, (t3 & 4) !== 0; t1 = source) { + source = t2._as(t1._resultOrListeners); + _box_0.source = source; + } + if ((t3 & 24) === 0) { + listeners = type$.nullable__FutureListener_dynamic_dynamic._as(target._resultOrListeners); + target._setChained$1(t1); + _box_0.source._prependListeners$1(listeners); + return; + } + if ((t3 & 16) === 0 && target._resultOrListeners == null) { + target._cloneResult$1(t1); + return; + } + target._state ^= 2; + target._zone.scheduleMicrotask$1(new A._Future__chainCoreFutureAsync_closure(_box_0, target)); + }, + _Future__propagateToListeners(source, listeners) { + var t2, t3, t4, _box_0, t5, t6, hasError, asyncError, nextListener, nextListener0, sourceResult, t7, zone, oldZone, result, current, _box_1 = {}, + t1 = _box_1.source = source; + for (t2 = type$.AsyncError, t3 = type$.nullable__FutureListener_dynamic_dynamic, t4 = type$.Future_dynamic; true;) { + _box_0 = {}; + t5 = t1._state; + t6 = (t5 & 16) === 0; + hasError = !t6; + if (listeners == null) { + if (hasError && (t5 & 1) === 0) { + asyncError = t2._as(t1._resultOrListeners); + t1._zone.handleUncaughtError$2(asyncError.error, asyncError.stackTrace); + } + return; + } + _box_0.listener = listeners; + nextListener = listeners._nextListener; + for (t1 = listeners; nextListener != null; t1 = nextListener, nextListener = nextListener0) { + t1._nextListener = null; + A._Future__propagateToListeners(_box_1.source, t1); + _box_0.listener = nextListener; + nextListener0 = nextListener._nextListener; + } + t5 = _box_1.source; + sourceResult = t5._resultOrListeners; + _box_0.listenerHasError = hasError; + _box_0.listenerValueOrError = sourceResult; + if (t6) { + t7 = t1.state; + t7 = (t7 & 1) !== 0 || (t7 & 15) === 8; + } else + t7 = true; + if (t7) { + zone = t1.result._zone; + if (hasError) { + t1 = t5._zone; + t1 = !(t1 === zone || t1.get$errorZone() === zone.get$errorZone()); + } else + t1 = false; + if (t1) { + t1 = _box_1.source; + asyncError = t2._as(t1._resultOrListeners); + t1._zone.handleUncaughtError$2(asyncError.error, asyncError.stackTrace); + return; + } + oldZone = $.Zone__current; + if (oldZone !== zone) + $.Zone__current = zone; + else + oldZone = null; + t1 = _box_0.listener.state; + if ((t1 & 15) === 8) + new A._Future__propagateToListeners_handleWhenCompleteCallback(_box_0, _box_1, hasError).call$0(); + else if (t6) { + if ((t1 & 1) !== 0) + new A._Future__propagateToListeners_handleValueCallback(_box_0, sourceResult).call$0(); + } else if ((t1 & 2) !== 0) + new A._Future__propagateToListeners_handleError(_box_1, _box_0).call$0(); + if (oldZone != null) + $.Zone__current = oldZone; + t1 = _box_0.listenerValueOrError; + if (t1 instanceof A._Future) { + t5 = _box_0.listener.$ti; + t5 = t5._eval$1("Future<2>")._is(t1) || !t5._rest[1]._is(t1); + } else + t5 = false; + if (t5) { + t4._as(t1); + result = _box_0.listener.result; + if ((t1._state & 24) !== 0) { + current = t3._as(result._resultOrListeners); + result._resultOrListeners = null; + listeners = result._reverseListeners$1(current); + result._state = t1._state & 30 | result._state & 1; + result._resultOrListeners = t1._resultOrListeners; + _box_1.source = t1; + continue; + } else + A._Future__chainCoreFutureSync(t1, result); + return; + } + } + result = _box_0.listener.result; + current = t3._as(result._resultOrListeners); + result._resultOrListeners = null; + listeners = result._reverseListeners$1(current); + t1 = _box_0.listenerHasError; + t5 = _box_0.listenerValueOrError; + if (!t1) { + result.$ti._precomputed1._as(t5); + result._state = 8; + result._resultOrListeners = t5; + } else { + t2._as(t5); + result._state = result._state & 1 | 16; + result._resultOrListeners = t5; + } + _box_1.source = result; + t1 = result; + } + }, + _registerErrorHandler(errorHandler, zone) { + if (type$.dynamic_Function_Object_StackTrace._is(errorHandler)) + return zone.registerBinaryCallback$3$1(errorHandler, type$.dynamic, type$.Object, type$.StackTrace); + if (type$.dynamic_Function_Object._is(errorHandler)) + return zone.registerUnaryCallback$2$1(errorHandler, type$.dynamic, type$.Object); + throw A.wrapException(A.ArgumentError$value(errorHandler, "onError", string$.Error_)); + }, + _microtaskLoop() { + var entry, next; + for (entry = $._nextCallback; entry != null; entry = $._nextCallback) { + $._lastPriorityCallback = null; + next = entry.next; + $._nextCallback = next; + if (next == null) + $._lastCallback = null; + entry.callback.call$0(); + } + }, + _startMicrotaskLoop() { + $._isInCallbackLoop = true; + try { + A._microtaskLoop(); + } finally { + $._lastPriorityCallback = null; + $._isInCallbackLoop = false; + if ($._nextCallback != null) + $.$get$_AsyncRun__scheduleImmediateClosure().call$1(A.async___startMicrotaskLoop$closure()); + } + }, + _scheduleAsyncCallback(callback) { + var newEntry = new A._AsyncCallbackEntry(callback), + lastCallback = $._lastCallback; + if (lastCallback == null) { + $._nextCallback = $._lastCallback = newEntry; + if (!$._isInCallbackLoop) + $.$get$_AsyncRun__scheduleImmediateClosure().call$1(A.async___startMicrotaskLoop$closure()); + } else + $._lastCallback = lastCallback.next = newEntry; + }, + _schedulePriorityAsyncCallback(callback) { + var entry, lastPriorityCallback, next, + t1 = $._nextCallback; + if (t1 == null) { + A._scheduleAsyncCallback(callback); + $._lastPriorityCallback = $._lastCallback; + return; + } + entry = new A._AsyncCallbackEntry(callback); + lastPriorityCallback = $._lastPriorityCallback; + if (lastPriorityCallback == null) { + entry.next = t1; + $._nextCallback = $._lastPriorityCallback = entry; + } else { + next = lastPriorityCallback.next; + entry.next = next; + $._lastPriorityCallback = lastPriorityCallback.next = entry; + if (next == null) + $._lastCallback = entry; + } + }, + scheduleMicrotask(callback) { + var t1, _null = null, + currentZone = $.Zone__current; + if (B.C__RootZone === currentZone) { + A._rootScheduleMicrotask(_null, _null, B.C__RootZone, callback); + return; + } + if (B.C__RootZone === currentZone.get$_scheduleMicrotask().zone) + t1 = B.C__RootZone.get$errorZone() === currentZone.get$errorZone(); + else + t1 = false; + if (t1) { + A._rootScheduleMicrotask(_null, _null, currentZone, currentZone.registerCallback$1$1(callback, type$.void)); + return; + } + t1 = $.Zone__current; + t1.scheduleMicrotask$1(t1.bindCallbackGuarded$1(callback)); + }, + StreamIterator_StreamIterator(stream, $T) { + A.checkNotNullable(stream, "stream", type$.Object); + return new A._StreamIterator($T._eval$1("_StreamIterator<0>")); + }, + _rootHandleUncaughtError($self, $parent, zone, error, stackTrace) { + A._rootHandleError(type$.Object._as(error), type$.StackTrace._as(stackTrace)); + }, + _rootHandleError(error, stackTrace) { + A._schedulePriorityAsyncCallback(new A._rootHandleError_closure(error, stackTrace)); + }, + _rootRun($self, $parent, zone, f, $R) { + var old, t1; + type$.nullable_Zone._as($self); + type$.nullable_ZoneDelegate._as($parent); + type$.Zone._as(zone); + $R._eval$1("0()")._as(f); + t1 = $.Zone__current; + if (t1 === zone) + return f.call$0(); + $.Zone__current = zone; + old = t1; + try { + t1 = f.call$0(); + return t1; + } finally { + $.Zone__current = old; + } + }, + _rootRunUnary($self, $parent, zone, f, arg, $R, $T) { + var old, t1; + type$.nullable_Zone._as($self); + type$.nullable_ZoneDelegate._as($parent); + type$.Zone._as(zone); + $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); + $T._as(arg); + t1 = $.Zone__current; + if (t1 === zone) + return f.call$1(arg); + $.Zone__current = zone; + old = t1; + try { + t1 = f.call$1(arg); + return t1; + } finally { + $.Zone__current = old; + } + }, + _rootRunBinary($self, $parent, zone, f, arg1, arg2, $R, T1, T2) { + var old, t1; + type$.nullable_Zone._as($self); + type$.nullable_ZoneDelegate._as($parent); + type$.Zone._as(zone); + $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(f); + T1._as(arg1); + T2._as(arg2); + t1 = $.Zone__current; + if (t1 === zone) + return f.call$2(arg1, arg2); + $.Zone__current = zone; + old = t1; + try { + t1 = f.call$2(arg1, arg2); + return t1; + } finally { + $.Zone__current = old; + } + }, + _rootRegisterCallback($self, $parent, zone, f, $R) { + return $R._eval$1("0()")._as(f); + }, + _rootRegisterUnaryCallback($self, $parent, zone, f, $R, $T) { + return $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); + }, + _rootRegisterBinaryCallback($self, $parent, zone, f, $R, T1, T2) { + return $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(f); + }, + _rootErrorCallback($self, $parent, zone, error, stackTrace) { + type$.Object._as(error); + type$.nullable_StackTrace._as(stackTrace); + return null; + }, + _rootScheduleMicrotask($self, $parent, zone, f) { + var t1, t2; + type$.void_Function._as(f); + if (B.C__RootZone !== zone) { + t1 = B.C__RootZone.get$errorZone(); + t2 = zone.get$errorZone(); + f = t1 !== t2 ? zone.bindCallbackGuarded$1(f) : zone.bindCallback$1$1(f, type$.void); + } + A._scheduleAsyncCallback(f); + }, + _rootCreateTimer($self, $parent, zone, duration, callback) { + type$.Duration._as(duration); + type$.void_Function._as(callback); + return A.Timer__createTimer(duration, B.C__RootZone !== zone ? zone.bindCallback$1$1(callback, type$.void) : callback); + }, + _rootCreatePeriodicTimer($self, $parent, zone, duration, callback) { + type$.Duration._as(duration); + type$.void_Function_Timer._as(callback); + if (B.C__RootZone !== zone) + callback = zone.bindUnaryCallback$2$1(callback, type$.void, type$.Timer); + return A._TimerImpl$periodic(0, callback); + }, + _rootPrint($self, $parent, zone, line) { + A.printString(A._asString(line)); + }, + _printToZone(line) { + $.Zone__current.print$1(line); + }, + _rootFork($self, $parent, zone, specification, zoneValues) { + var valueMap, t1, registerCallback, registerUnaryCallback, registerBinaryCallback, errorCallback, handleUncaughtError; + type$.nullable_ZoneSpecification._as(specification); + type$.nullable_Map_of_nullable_Object_and_nullable_Object._as(zoneValues); + $.printToZone = A.async___printToZone$closure(); + if (specification == null) + specification = B._ZoneSpecification_ALf; + if (zoneValues == null) + valueMap = zone.get$_async$_map(); + else { + t1 = type$.nullable_Object; + valueMap = A.HashMap_HashMap$from(zoneValues, t1, t1); + } + t1 = new A._CustomZone(zone.get$_async$_run(), zone.get$_runUnary(), zone.get$_runBinary(), zone.get$_async$_registerCallback(), zone.get$_async$_registerUnaryCallback(), zone.get$_async$_registerBinaryCallback(), zone.get$_async$_errorCallback(), zone.get$_scheduleMicrotask(), zone.get$_createTimer(), zone.get$_createPeriodicTimer(), zone.get$_print(), zone.get$_fork(), zone.get$_async$_handleUncaughtError(), zone, valueMap); + registerCallback = specification.registerCallback; + if (registerCallback != null) + t1.set$_async$_registerCallback(new A._ZoneFunction(t1, registerCallback, type$._ZoneFunction_of_A_Function_Function_A_extends_nullable_Object_4_Zone_and_ZoneDelegate_and_Zone_and_A_Function)); + registerUnaryCallback = specification.registerUnaryCallback; + if (registerUnaryCallback != null) + t1.set$_async$_registerUnaryCallback(new A._ZoneFunction(t1, registerUnaryCallback, type$._ZoneFunction_of_A_Function_B_Function_A_extends_nullable_Object_and_B_extends_nullable_Object_4_Zone_and_ZoneDelegate_and_Zone_and_A_Function_B)); + registerBinaryCallback = specification.registerBinaryCallback; + if (registerBinaryCallback != null) + t1.set$_async$_registerBinaryCallback(new A._ZoneFunction(t1, registerBinaryCallback, type$._ZoneFunction_of_A_Function_2_B_and_C_Function_A_extends_nullable_Object_and_B_extends_nullable_Object_and_C_extends_nullable_Object_4_Zone_and_ZoneDelegate_and_Zone_and_A_Function_2_B_and_C)); + errorCallback = specification.errorCallback; + if (errorCallback != null) + t1.set$_async$_errorCallback(new A._ZoneFunction(t1, errorCallback, type$._ZoneFunction_of_nullable_AsyncError_Function_5_Zone_and_ZoneDelegate_and_Zone_and_Object_and_nullable_StackTrace)); + handleUncaughtError = specification.handleUncaughtError; + if (handleUncaughtError != null) + t1.set$_async$_handleUncaughtError(new A._ZoneFunction(t1, handleUncaughtError, type$._ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace)); + return t1; + }, + runZoned(body, zoneSpecification, zoneValues, $R) { + A.checkNotNullable(body, "body", $R._eval$1("0()")); + return A._runZoned(body, zoneValues, zoneSpecification, $R); + }, + _runZoned(body, zoneValues, specification, $R) { + return $.Zone__current.fork$2$specification$zoneValues(specification, zoneValues).run$1$1(body, $R); + }, + _AsyncRun__initializeScheduleImmediate_internalCallback: function _AsyncRun__initializeScheduleImmediate_internalCallback(t0) { + this._box_0 = t0; + }, + _AsyncRun__initializeScheduleImmediate_closure: function _AsyncRun__initializeScheduleImmediate_closure(t0, t1, t2) { + this._box_0 = t0; + this.div = t1; + this.span = t2; + }, + _AsyncRun__scheduleImmediateJsOverride_internalCallback: function _AsyncRun__scheduleImmediateJsOverride_internalCallback(t0) { + this.callback = t0; + }, + _AsyncRun__scheduleImmediateWithSetImmediate_internalCallback: function _AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(t0) { + this.callback = t0; + }, + _TimerImpl: function _TimerImpl() { + this._tick = 0; + }, + _TimerImpl_internalCallback: function _TimerImpl_internalCallback(t0, t1) { + this.$this = t0; + this.callback = t1; + }, + _TimerImpl$periodic_closure: function _TimerImpl$periodic_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.milliseconds = t1; + _.start = t2; + _.callback = t3; + }, + _AsyncAwaitCompleter: function _AsyncAwaitCompleter(t0, t1) { + this._future = t0; + this.isSync = false; + this.$ti = t1; + }, + _awaitOnObject_closure: function _awaitOnObject_closure(t0) { + this.bodyFunction = t0; + }, + _awaitOnObject_closure0: function _awaitOnObject_closure0(t0) { + this.bodyFunction = t0; + }, + _wrapJsFunctionForAsync_closure: function _wrapJsFunctionForAsync_closure(t0) { + this.$protected = t0; + }, + AsyncError: function AsyncError(t0, t1) { + this.error = t0; + this.stackTrace = t1; + }, + Future_wait_handleError: function Future_wait_handleError(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._box_0 = t0; + _.cleanUp = t1; + _.eagerError = t2; + _._future = t3; + _.error = t4; + _.stackTrace = t5; + }, + Future_wait_closure: function Future_wait_closure(t0, t1, t2, t3, t4, t5, t6, t7) { + var _ = this; + _._box_0 = t0; + _.pos = t1; + _._future = t2; + _.cleanUp = t3; + _.eagerError = t4; + _.error = t5; + _.stackTrace = t6; + _.T = t7; + }, + _FutureListener: function _FutureListener(t0, t1, t2, t3, t4) { + var _ = this; + _._nextListener = null; + _.result = t0; + _.state = t1; + _.callback = t2; + _.errorCallback = t3; + _.$ti = t4; + }, + _Future: function _Future(t0, t1) { + var _ = this; + _._state = 0; + _._zone = t0; + _._resultOrListeners = null; + _.$ti = t1; + }, + _Future__addListener_closure: function _Future__addListener_closure(t0, t1) { + this.$this = t0; + this.listener = t1; + }, + _Future__prependListeners_closure: function _Future__prependListeners_closure(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + _Future__chainForeignFuture_closure: function _Future__chainForeignFuture_closure(t0) { + this.$this = t0; + }, + _Future__chainForeignFuture_closure0: function _Future__chainForeignFuture_closure0(t0) { + this.$this = t0; + }, + _Future__chainForeignFuture_closure1: function _Future__chainForeignFuture_closure1(t0, t1, t2) { + this.$this = t0; + this.e = t1; + this.s = t2; + }, + _Future__chainCoreFutureAsync_closure: function _Future__chainCoreFutureAsync_closure(t0, t1) { + this._box_0 = t0; + this.target = t1; + }, + _Future__asyncCompleteWithValue_closure: function _Future__asyncCompleteWithValue_closure(t0, t1) { + this.$this = t0; + this.value = t1; + }, + _Future__asyncCompleteError_closure: function _Future__asyncCompleteError_closure(t0, t1, t2) { + this.$this = t0; + this.error = t1; + this.stackTrace = t2; + }, + _Future__propagateToListeners_handleWhenCompleteCallback: function _Future__propagateToListeners_handleWhenCompleteCallback(t0, t1, t2) { + this._box_0 = t0; + this._box_1 = t1; + this.hasError = t2; + }, + _Future__propagateToListeners_handleWhenCompleteCallback_closure: function _Future__propagateToListeners_handleWhenCompleteCallback_closure(t0) { + this.originalSource = t0; + }, + _Future__propagateToListeners_handleValueCallback: function _Future__propagateToListeners_handleValueCallback(t0, t1) { + this._box_0 = t0; + this.sourceResult = t1; + }, + _Future__propagateToListeners_handleError: function _Future__propagateToListeners_handleError(t0, t1) { + this._box_1 = t0; + this._box_0 = t1; + }, + _AsyncCallbackEntry: function _AsyncCallbackEntry(t0) { + this.callback = t0; + this.next = null; + }, + _StreamIterator: function _StreamIterator(t0) { + this.$ti = t0; + }, + _ZoneFunction: function _ZoneFunction(t0, t1, t2) { + this.zone = t0; + this.$function = t1; + this.$ti = t2; + }, + _ZoneSpecification: function _ZoneSpecification(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) { + var _ = this; + _.handleUncaughtError = t0; + _.run = t1; + _.runUnary = t2; + _.runBinary = t3; + _.registerCallback = t4; + _.registerUnaryCallback = t5; + _.registerBinaryCallback = t6; + _.errorCallback = t7; + _.scheduleMicrotask = t8; + _.createTimer = t9; + _.createPeriodicTimer = t10; + _.print = t11; + _.fork = t12; + }, + _ZoneDelegate: function _ZoneDelegate(t0) { + this._delegationTarget = t0; + }, + _Zone: function _Zone() { + }, + _CustomZone: function _CustomZone(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) { + var _ = this; + _._async$_run = t0; + _._runUnary = t1; + _._runBinary = t2; + _._async$_registerCallback = t3; + _._async$_registerUnaryCallback = t4; + _._async$_registerBinaryCallback = t5; + _._async$_errorCallback = t6; + _._scheduleMicrotask = t7; + _._createTimer = t8; + _._createPeriodicTimer = t9; + _._print = t10; + _._fork = t11; + _._async$_handleUncaughtError = t12; + _._delegateCache = null; + _.parent = t13; + _._async$_map = t14; + }, + _CustomZone_bindCallback_closure: function _CustomZone_bindCallback_closure(t0, t1, t2) { + this.$this = t0; + this.registered = t1; + this.R = t2; + }, + _CustomZone_bindUnaryCallback_closure: function _CustomZone_bindUnaryCallback_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.registered = t1; + _.T = t2; + _.R = t3; + }, + _CustomZone_bindCallbackGuarded_closure: function _CustomZone_bindCallbackGuarded_closure(t0, t1) { + this.$this = t0; + this.registered = t1; + }, + _rootHandleError_closure: function _rootHandleError_closure(t0, t1) { + this.error = t0; + this.stackTrace = t1; + }, + _RootZone: function _RootZone() { + }, + _RootZone_bindCallback_closure: function _RootZone_bindCallback_closure(t0, t1, t2) { + this.$this = t0; + this.f = t1; + this.R = t2; + }, + _RootZone_bindUnaryCallback_closure: function _RootZone_bindUnaryCallback_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.f = t1; + _.T = t2; + _.R = t3; + }, + _RootZone_bindCallbackGuarded_closure: function _RootZone_bindCallbackGuarded_closure(t0, t1) { + this.$this = t0; + this.f = t1; + }, + HashMap_HashMap($K, $V) { + return new A._HashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("_HashMap<1,2>")); + }, + _HashMap__getTableEntry(table, key) { + var entry = table[key]; + return entry === table ? null : entry; + }, + _HashMap__setTableEntry(table, key, value) { + if (value == null) + table[key] = table; + else + table[key] = value; + }, + _HashMap__newHashTable() { + var table = Object.create(null); + A._HashMap__setTableEntry(table, "", table); + delete table[""]; + return table; + }, + LinkedHashMap_LinkedHashMap$_literal(keyValuePairs, $K, $V) { + return $K._eval$1("@<0>")._bind$1($V)._eval$1("LinkedHashMap<1,2>")._as(A.fillLiteralMap(keyValuePairs, new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>")))); + }, + LinkedHashMap_LinkedHashMap$_empty($K, $V) { + return new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>")); + }, + HashMap_HashMap$from(other, $K, $V) { + var result = A.HashMap_HashMap($K, $V); + other.forEach$1(0, new A.HashMap_HashMap$from_closure(result, $K, $V)); + return result; + }, + MapBase_mapToString(m) { + var result, t1 = {}; + if (A.isToStringVisiting(m)) + return "{...}"; + result = new A.StringBuffer(""); + try { + B.JSArray_methods.add$1($.toStringVisiting, m); + result._contents += "{"; + t1.first = true; + m.forEach$1(0, new A.MapBase_mapToString_closure(t1, result)); + result._contents += "}"; + } finally { + if (0 >= $.toStringVisiting.length) + return A.ioore($.toStringVisiting, -1); + $.toStringVisiting.pop(); + } + t1 = result._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _HashMap: function _HashMap(t0) { + var _ = this; + _._collection$_length = 0; + _._keys = _._collection$_rest = _._collection$_nums = _._collection$_strings = null; + _.$ti = t0; + }, + _HashMapKeyIterable: function _HashMapKeyIterable(t0, t1) { + this._collection$_map = t0; + this.$ti = t1; + }, + _HashMapKeyIterator: function _HashMapKeyIterator(t0, t1, t2) { + var _ = this; + _._collection$_map = t0; + _._keys = t1; + _._offset = 0; + _._collection$_current = null; + _.$ti = t2; + }, + HashMap_HashMap$from_closure: function HashMap_HashMap$from_closure(t0, t1, t2) { + this.result = t0; + this.K = t1; + this.V = t2; + }, + ListBase: function ListBase() { + }, + MapBase: function MapBase() { + }, + MapBase_entries_closure: function MapBase_entries_closure(t0) { + this.$this = t0; + }, + MapBase_mapToString_closure: function MapBase_mapToString_closure(t0, t1) { + this._box_0 = t0; + this.result = t1; + }, + _parseJson(source, reviver) { + var e, exception, t1, parsed = null; + try { + parsed = JSON.parse(source); + } catch (exception) { + e = A.unwrapException(exception); + t1 = A.FormatException$(String(e), null, null); + throw A.wrapException(t1); + } + t1 = A._convertJsonToDartLazy(parsed); + return t1; + }, + _convertJsonToDartLazy(object) { + var i; + if (object == null) + return null; + if (typeof object != "object") + return object; + if (Object.getPrototypeOf(object) !== Array.prototype) + return new A._JsonMap(object, Object.create(null)); + for (i = 0; i < object.length; ++i) + object[i] = A._convertJsonToDartLazy(object[i]); + return object; + }, + Utf8Decoder__convertIntercepted(allowMalformed, codeUnits, start, end) { + var casted, result; + if (codeUnits instanceof Uint8Array) { + casted = codeUnits; + end = casted.length; + if (end - start < 15) + return null; + result = A.Utf8Decoder__convertInterceptedUint8List(allowMalformed, casted, start, end); + if (result != null && allowMalformed) + if (result.indexOf("\ufffd") >= 0) + return null; + return result; + } + return null; + }, + Utf8Decoder__convertInterceptedUint8List(allowMalformed, codeUnits, start, end) { + var decoder = allowMalformed ? $.$get$Utf8Decoder__decoderNonfatal() : $.$get$Utf8Decoder__decoder(); + if (decoder == null) + return null; + if (0 === start && end === codeUnits.length) + return A.Utf8Decoder__useTextDecoder(decoder, codeUnits); + return A.Utf8Decoder__useTextDecoder(decoder, codeUnits.subarray(start, A.RangeError_checkValidRange(start, end, codeUnits.length))); + }, + Utf8Decoder__useTextDecoder(decoder, codeUnits) { + var t1, exception; + try { + t1 = decoder.decode(codeUnits); + return t1; + } catch (exception) { + } + return null; + }, + Base64Codec__checkPadding(source, sourceIndex, sourceEnd, firstPadding, paddingCount, $length) { + if (B.JSInt_methods.$mod($length, 4) !== 0) + throw A.wrapException(A.FormatException$("Invalid base64 padding, padded length must be multiple of four, is " + $length, source, sourceEnd)); + if (firstPadding + paddingCount !== $length) + throw A.wrapException(A.FormatException$("Invalid base64 padding, '=' not at the end", source, sourceIndex)); + if (paddingCount > 2) + throw A.wrapException(A.FormatException$("Invalid base64 padding, more than two '=' characters", source, sourceIndex)); + }, + _Utf8Decoder_errorDescription(state) { + switch (state) { + case 65: + return "Missing extension byte"; + case 67: + return "Unexpected extension byte"; + case 69: + return "Invalid UTF-8 byte"; + case 71: + return "Overlong encoding"; + case 73: + return "Out of unicode range"; + case 75: + return "Encoded surrogate"; + case 77: + return "Unfinished UTF-8 octet sequence"; + default: + return ""; + } + }, + _Utf8Decoder__makeUint8List(codeUnits, start, end) { + var t1, i, b, + $length = end - start, + bytes = new Uint8Array($length); + for (t1 = J.getInterceptor$asx(codeUnits), i = 0; i < $length; ++i) { + b = t1.$index(codeUnits, start + i); + if ((b & 4294967040) >>> 0 !== 0) + b = 255; + if (!(i < $length)) + return A.ioore(bytes, i); + bytes[i] = b; + } + return bytes; + }, + _JsonMap: function _JsonMap(t0, t1) { + this._original = t0; + this._processed = t1; + this._data = null; + }, + _JsonMapKeyIterable: function _JsonMapKeyIterable(t0) { + this._parent = t0; + }, + Utf8Decoder__decoder_closure: function Utf8Decoder__decoder_closure() { + }, + Utf8Decoder__decoderNonfatal_closure: function Utf8Decoder__decoderNonfatal_closure() { + }, + AsciiCodec: function AsciiCodec() { + }, + _UnicodeSubsetEncoder: function _UnicodeSubsetEncoder() { + }, + AsciiEncoder: function AsciiEncoder(t0) { + this._subsetMask = t0; + }, + Base64Codec: function Base64Codec() { + }, + Base64Encoder: function Base64Encoder() { + }, + Codec: function Codec() { + }, + _FusedCodec: function _FusedCodec(t0, t1, t2) { + this._convert$_first = t0; + this._second = t1; + this.$ti = t2; + }, + Converter: function Converter() { + }, + Encoding: function Encoding() { + }, + JsonCodec: function JsonCodec() { + }, + JsonDecoder: function JsonDecoder(t0) { + this._reviver = t0; + }, + Utf8Codec: function Utf8Codec() { + }, + Utf8Encoder: function Utf8Encoder() { + }, + _Utf8Encoder: function _Utf8Encoder(t0) { + this._bufferIndex = 0; + this._buffer = t0; + }, + Utf8Decoder: function Utf8Decoder(t0) { + this._allowMalformed = t0; + }, + _Utf8Decoder: function _Utf8Decoder(t0) { + this.allowMalformed = t0; + this._convert$_state = 16; + this._charOrIndex = 0; + }, + Expando__checkType(object) { + if (A._isBool(object) || typeof object == "number" || typeof object == "string" || false) + A.Expando__badExpandoKey(object); + }, + Expando__badExpandoKey(object) { + throw A.wrapException(A.ArgumentError$value(object, "object", "Expandos are not allowed on strings, numbers, bools, records or null")); + }, + int_parse(source, radix) { + var value = A.Primitives_parseInt(source, radix); + if (value != null) + return value; + throw A.wrapException(A.FormatException$(source, null, null)); + }, + Error__throw(error, stackTrace) { + error = A.wrapException(error); + if (error == null) + error = type$.Object._as(error); + error.stack = stackTrace.toString$0(0); + throw error; + throw A.wrapException("unreachable"); + }, + List_List$filled($length, fill, growable, $E) { + var i, + result = growable ? J.JSArray_JSArray$growable($length, $E) : J.JSArray_JSArray$fixed($length, $E); + if ($length !== 0 && fill != null) + for (i = 0; i < result.length; ++i) + result[i] = fill; + return result; + }, + List_List$from(elements, growable, $E) { + var t1, + list = A._setArrayType([], $E._eval$1("JSArray<0>")); + for (t1 = J.get$iterator$ax(elements); t1.moveNext$0();) + B.JSArray_methods.add$1(list, $E._as(t1.get$current())); + if (growable) + return list; + return J.JSArray_markFixedList(list, $E); + }, + List_List$of(elements, growable, $E) { + var t1; + if (growable) + return A.List_List$_of(elements, $E); + t1 = J.JSArray_markFixedList(A.List_List$_of(elements, $E), $E); + return t1; + }, + List_List$_of(elements, $E) { + var t1, + list = A._setArrayType([], $E._eval$1("JSArray<0>")); + for (t1 = elements.get$iterator(elements); t1.moveNext$0();) + B.JSArray_methods.add$1(list, t1.get$current()); + return list; + }, + List_List$unmodifiable(elements, $E) { + var result = A.List_List$from(elements, false, $E); + result.fixed$length = Array; + result.immutable$list = Array; + return result; + }, + String_String$fromCharCodes(charCodes, start, end) { + var array, len; + if (Array.isArray(charCodes)) { + array = charCodes; + len = array.length; + end = A.RangeError_checkValidRange(start, end, len); + return A.Primitives_stringFromCharCodes(start > 0 || end < len ? array.slice(start, end) : array); + } + if (type$.NativeUint8List._is(charCodes)) + return A.Primitives_stringFromNativeUint8List(charCodes, start, A.RangeError_checkValidRange(start, end, charCodes.length)); + return A.String__stringFromIterable(charCodes, start, end); + }, + String_String$fromCharCode(charCode) { + return A.Primitives_stringFromCharCode(charCode); + }, + String__stringFromIterable(charCodes, start, end) { + var t1, it, i, list, _null = null; + if (start < 0) + throw A.wrapException(A.RangeError$range(start, 0, J.get$length$asx(charCodes), _null, _null)); + t1 = end == null; + if (!t1 && end < start) + throw A.wrapException(A.RangeError$range(end, start, J.get$length$asx(charCodes), _null, _null)); + it = J.get$iterator$ax(charCodes); + for (i = 0; i < start; ++i) + if (!it.moveNext$0()) + throw A.wrapException(A.RangeError$range(start, 0, i, _null, _null)); + list = []; + if (t1) + for (; it.moveNext$0();) + list.push(it.get$current()); + else + for (i = start; i < end; ++i) { + if (!it.moveNext$0()) + throw A.wrapException(A.RangeError$range(end, start, i, _null, _null)); + list.push(it.get$current()); + } + return A.Primitives_stringFromCharCodes(list); + }, + RegExp_RegExp(source, multiLine) { + return new A.JSSyntaxRegExp(source, A.JSSyntaxRegExp_makeNative(source, multiLine, true, false, false, false)); + }, + StringBuffer__writeAll(string, objects, separator) { + var iterator = J.get$iterator$ax(objects); + if (!iterator.moveNext$0()) + return string; + if (separator.length === 0) { + do + string += A.S(iterator.get$current()); + while (iterator.moveNext$0()); + } else { + string += A.S(iterator.get$current()); + for (; iterator.moveNext$0();) + string = string + separator + A.S(iterator.get$current()); + } + return string; + }, + Uri_base() { + var cachedUri, uri, + current = A.Primitives_currentUri(); + if (current == null) + throw A.wrapException(A.UnsupportedError$("'Uri.base' is not supported")); + cachedUri = $.Uri__cachedBaseUri; + if (cachedUri != null && current === $.Uri__cachedBaseString) + return cachedUri; + uri = A.Uri_parse(current); + $.Uri__cachedBaseUri = uri; + $.Uri__cachedBaseString = current; + return uri; + }, + _Uri__uriEncode(canonicalTable, text, encoding, spaceToPlus) { + var t1, bytes, i, t2, byte, t3, + _s16_ = "0123456789ABCDEF"; + if (encoding === B.C_Utf8Codec) { + t1 = $.$get$_Uri__needsNoEncoding(); + t1 = t1._nativeRegExp.test(text); + } else + t1 = false; + if (t1) + return text; + bytes = B.C_Utf8Encoder.convert$1(text); + for (t1 = bytes.length, i = 0, t2 = ""; i < t1; ++i) { + byte = bytes[i]; + if (byte < 128) { + t3 = byte >>> 4; + if (!(t3 < 8)) + return A.ioore(canonicalTable, t3); + t3 = (canonicalTable[t3] & 1 << (byte & 15)) !== 0; + } else + t3 = false; + if (t3) + t2 += A.Primitives_stringFromCharCode(byte); + else + t2 = spaceToPlus && byte === 32 ? t2 + "+" : t2 + "%" + _s16_[byte >>> 4 & 15] + _s16_[byte & 15]; + } + return t2.charCodeAt(0) == 0 ? t2 : t2; + }, + StackTrace_current() { + var stackTrace, exception; + if ($.$get$_hasErrorStackProperty()) + return A.getTraceFromException(new Error()); + try { + throw A.wrapException(""); + } catch (exception) { + stackTrace = A.getTraceFromException(exception); + return stackTrace; + } + }, + Error_safeToString(object) { + if (typeof object == "number" || A._isBool(object) || object == null) + return J.toString$0$(object); + if (typeof object == "string") + return JSON.stringify(object); + return A.Primitives_safeToString(object); + }, + Error_throwWithStackTrace(error, stackTrace) { + A.checkNotNullable(error, "error", type$.Object); + A.checkNotNullable(stackTrace, "stackTrace", type$.StackTrace); + A.Error__throw(error, stackTrace); + }, + AssertionError$(message) { + return new A.AssertionError(message); + }, + ArgumentError$(message, $name) { + return new A.ArgumentError(false, null, $name, message); + }, + ArgumentError$value(value, $name, message) { + return new A.ArgumentError(true, value, $name, message); + }, + ArgumentError_checkNotNull(argument, $name, $T) { + return argument; + }, + RangeError$(message) { + var _null = null; + return new A.RangeError(_null, _null, false, _null, _null, message); + }, + RangeError$value(value, $name) { + return new A.RangeError(null, null, true, value, $name, "Value not in range"); + }, + RangeError$range(invalidValue, minValue, maxValue, $name, message) { + return new A.RangeError(minValue, maxValue, true, invalidValue, $name, "Invalid value"); + }, + RangeError_checkValueInInterval(value, minValue, maxValue, $name) { + if (value < minValue || value > maxValue) + throw A.wrapException(A.RangeError$range(value, minValue, maxValue, $name, null)); + return value; + }, + RangeError_checkValidRange(start, end, $length) { + if (0 > start || start > $length) + throw A.wrapException(A.RangeError$range(start, 0, $length, "start", null)); + if (end != null) { + if (start > end || end > $length) + throw A.wrapException(A.RangeError$range(end, start, $length, "end", null)); + return end; + } + return $length; + }, + RangeError_checkNotNegative(value, $name) { + if (value < 0) + throw A.wrapException(A.RangeError$range(value, 0, null, $name, null)); + return value; + }, + IndexError$withLength(invalidValue, $length, indexable, $name) { + return new A.IndexError($length, true, invalidValue, $name, "Index out of range"); + }, + UnsupportedError$(message) { + return new A.UnsupportedError(message); + }, + UnimplementedError$(message) { + return new A.UnimplementedError(message); + }, + StateError$(message) { + return new A.StateError(message); + }, + ConcurrentModificationError$(modifiedObject) { + return new A.ConcurrentModificationError(modifiedObject); + }, + FormatException$(message, source, offset) { + return new A.FormatException(message, source, offset); + }, + Iterable_iterableToShortString(iterable, leftDelimiter, rightDelimiter) { + var parts, t1; + if (A.isToStringVisiting(iterable)) { + if (leftDelimiter === "(" && rightDelimiter === ")") + return "(...)"; + return leftDelimiter + "..." + rightDelimiter; + } + parts = A._setArrayType([], type$.JSArray_String); + B.JSArray_methods.add$1($.toStringVisiting, iterable); + try { + A._iterablePartsToStrings(iterable, parts); + } finally { + if (0 >= $.toStringVisiting.length) + return A.ioore($.toStringVisiting, -1); + $.toStringVisiting.pop(); + } + t1 = A.StringBuffer__writeAll(leftDelimiter, type$.Iterable_dynamic._as(parts), ", ") + rightDelimiter; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + Iterable_iterableToFullString(iterable, leftDelimiter, rightDelimiter) { + var buffer, t1; + if (A.isToStringVisiting(iterable)) + return leftDelimiter + "..." + rightDelimiter; + buffer = new A.StringBuffer(leftDelimiter); + B.JSArray_methods.add$1($.toStringVisiting, iterable); + try { + t1 = buffer; + t1._contents = A.StringBuffer__writeAll(t1._contents, iterable, ", "); + } finally { + if (0 >= $.toStringVisiting.length) + return A.ioore($.toStringVisiting, -1); + $.toStringVisiting.pop(); + } + buffer._contents += rightDelimiter; + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _iterablePartsToStrings(iterable, parts) { + var next, ultimateString, penultimateString, penultimate, ultimate, ultimate0, elision, + it = iterable.get$iterator(iterable), + $length = 0, count = 0; + while (true) { + if (!($length < 80 || count < 3)) + break; + if (!it.moveNext$0()) + return; + next = A.S(it.get$current()); + B.JSArray_methods.add$1(parts, next); + $length += next.length + 2; + ++count; + } + if (!it.moveNext$0()) { + if (count <= 5) + return; + if (0 >= parts.length) + return A.ioore(parts, -1); + ultimateString = parts.pop(); + if (0 >= parts.length) + return A.ioore(parts, -1); + penultimateString = parts.pop(); + } else { + penultimate = it.get$current(); + ++count; + if (!it.moveNext$0()) { + if (count <= 4) { + B.JSArray_methods.add$1(parts, A.S(penultimate)); + return; + } + ultimateString = A.S(penultimate); + if (0 >= parts.length) + return A.ioore(parts, -1); + penultimateString = parts.pop(); + $length += ultimateString.length + 2; + } else { + ultimate = it.get$current(); + ++count; + for (; it.moveNext$0(); penultimate = ultimate, ultimate = ultimate0) { + ultimate0 = it.get$current(); + ++count; + if (count > 100) { + while (true) { + if (!($length > 75 && count > 3)) + break; + if (0 >= parts.length) + return A.ioore(parts, -1); + $length -= parts.pop().length + 2; + --count; + } + B.JSArray_methods.add$1(parts, "..."); + return; + } + } + penultimateString = A.S(penultimate); + ultimateString = A.S(ultimate); + $length += ultimateString.length + penultimateString.length + 4; + } + } + if (count > parts.length + 2) { + $length += 5; + elision = "..."; + } else + elision = null; + while (true) { + if (!($length > 80 && parts.length > 3)) + break; + if (0 >= parts.length) + return A.ioore(parts, -1); + $length -= parts.pop().length + 2; + if (elision == null) { + $length += 5; + elision = "..."; + } + } + if (elision != null) + B.JSArray_methods.add$1(parts, elision); + B.JSArray_methods.add$1(parts, penultimateString); + B.JSArray_methods.add$1(parts, ultimateString); + }, + Object_hash(object1, object2, object3) { + var t1; + if (B.C_SentinelValue === object3) { + t1 = J.get$hashCode$(object1); + object2 = J.get$hashCode$(object2); + return A.SystemHash_finish(A.SystemHash_combine(A.SystemHash_combine($.$get$_hashSeed(), t1), object2)); + } + t1 = J.get$hashCode$(object1); + object2 = J.get$hashCode$(object2); + object3 = object3.get$hashCode(object3); + object3 = A.SystemHash_finish(A.SystemHash_combine(A.SystemHash_combine(A.SystemHash_combine($.$get$_hashSeed(), t1), object2), object3)); + return object3; + }, + print(object) { + var toZone = $.printToZone; + if (toZone == null) + A.printString(object); + else + toZone.call$1(object); + }, + Uri_Uri$dataFromString($content) { + var t1, _null = null, + buffer = new A.StringBuffer(""), + indices = A._setArrayType([-1], type$.JSArray_int); + A.UriData__writeUri(_null, _null, _null, buffer, indices); + B.JSArray_methods.add$1(indices, buffer._contents.length); + buffer._contents += ","; + A.UriData__uriEncodeBytes(B.List_oFp, B.C_AsciiCodec.encode$1($content), buffer); + t1 = buffer._contents; + return new A.UriData(t1.charCodeAt(0) == 0 ? t1 : t1, indices, _null).get$uri(); + }, + Uri_parse(uri) { + var delta, indices, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, isSimple, scheme, t1, t2, schemeAuth, queryStart0, pathStart0, userInfoStart, userInfo, host, portNumber, port, path, query, _null = null, + end = uri.length; + if (end >= 5) { + if (4 >= end) + return A.ioore(uri, 4); + delta = ((uri.charCodeAt(4) ^ 58) * 3 | uri.charCodeAt(0) ^ 100 | uri.charCodeAt(1) ^ 97 | uri.charCodeAt(2) ^ 116 | uri.charCodeAt(3) ^ 97) >>> 0; + if (delta === 0) + return A.UriData__parse(end < end ? B.JSString_methods.substring$2(uri, 0, end) : uri, 5, _null).get$uri(); + else if (delta === 32) + return A.UriData__parse(B.JSString_methods.substring$2(uri, 5, end), 0, _null).get$uri(); + } + indices = A.List_List$filled(8, 0, false, type$.int); + B.JSArray_methods.$indexSet(indices, 0, 0); + B.JSArray_methods.$indexSet(indices, 1, -1); + B.JSArray_methods.$indexSet(indices, 2, -1); + B.JSArray_methods.$indexSet(indices, 7, -1); + B.JSArray_methods.$indexSet(indices, 3, 0); + B.JSArray_methods.$indexSet(indices, 4, 0); + B.JSArray_methods.$indexSet(indices, 5, end); + B.JSArray_methods.$indexSet(indices, 6, end); + if (A._scan(uri, 0, end, 0, indices) >= 14) + B.JSArray_methods.$indexSet(indices, 7, end); + schemeEnd = indices[1]; + if (schemeEnd >= 0) + if (A._scan(uri, 0, schemeEnd, 20, indices) === 20) + indices[7] = schemeEnd; + hostStart = indices[2] + 1; + portStart = indices[3]; + pathStart = indices[4]; + queryStart = indices[5]; + fragmentStart = indices[6]; + if (fragmentStart < queryStart) + queryStart = fragmentStart; + if (pathStart < hostStart) + pathStart = queryStart; + else if (pathStart <= schemeEnd) + pathStart = schemeEnd + 1; + if (portStart < hostStart) + portStart = pathStart; + isSimple = indices[7] < 0; + if (isSimple) + if (hostStart > schemeEnd + 3) { + scheme = _null; + isSimple = false; + } else { + t1 = portStart > 0; + if (t1 && portStart + 1 === pathStart) { + scheme = _null; + isSimple = false; + } else { + if (!B.JSString_methods.startsWith$2(uri, "\\", pathStart)) + if (hostStart > 0) + t2 = B.JSString_methods.startsWith$2(uri, "\\", hostStart - 1) || B.JSString_methods.startsWith$2(uri, "\\", hostStart - 2); + else + t2 = false; + else + t2 = true; + if (t2) { + scheme = _null; + isSimple = false; + } else { + if (!(queryStart < end && queryStart === pathStart + 2 && B.JSString_methods.startsWith$2(uri, "..", pathStart))) + t2 = queryStart > pathStart + 2 && B.JSString_methods.startsWith$2(uri, "/..", queryStart - 3); + else + t2 = true; + if (t2) { + scheme = _null; + isSimple = false; + } else { + if (schemeEnd === 4) + if (B.JSString_methods.startsWith$2(uri, "file", 0)) { + if (hostStart <= 0) { + if (!B.JSString_methods.startsWith$2(uri, "/", pathStart)) { + schemeAuth = "file:///"; + delta = 3; + } else { + schemeAuth = "file://"; + delta = 2; + } + uri = schemeAuth + B.JSString_methods.substring$2(uri, pathStart, end); + schemeEnd -= 0; + t1 = delta - 0; + queryStart += t1; + fragmentStart += t1; + end = uri.length; + hostStart = 7; + portStart = 7; + pathStart = 7; + } else if (pathStart === queryStart) { + ++fragmentStart; + queryStart0 = queryStart + 1; + uri = B.JSString_methods.replaceRange$3(uri, pathStart, queryStart, "/"); + ++end; + queryStart = queryStart0; + } + scheme = "file"; + } else if (B.JSString_methods.startsWith$2(uri, "http", 0)) { + if (t1 && portStart + 3 === pathStart && B.JSString_methods.startsWith$2(uri, "80", portStart + 1)) { + fragmentStart -= 3; + pathStart0 = pathStart - 3; + queryStart -= 3; + uri = B.JSString_methods.replaceRange$3(uri, portStart, pathStart, ""); + end -= 3; + pathStart = pathStart0; + } + scheme = "http"; + } else + scheme = _null; + else if (schemeEnd === 5 && B.JSString_methods.startsWith$2(uri, "https", 0)) { + if (t1 && portStart + 4 === pathStart && B.JSString_methods.startsWith$2(uri, "443", portStart + 1)) { + fragmentStart -= 4; + pathStart0 = pathStart - 4; + queryStart -= 4; + uri = B.JSString_methods.replaceRange$3(uri, portStart, pathStart, ""); + end -= 3; + pathStart = pathStart0; + } + scheme = "https"; + } else + scheme = _null; + isSimple = true; + } + } + } + } + else + scheme = _null; + if (isSimple) { + if (end < uri.length) { + uri = B.JSString_methods.substring$2(uri, 0, end); + schemeEnd -= 0; + hostStart -= 0; + portStart -= 0; + pathStart -= 0; + queryStart -= 0; + fragmentStart -= 0; + } + return new A._SimpleUri(uri, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, scheme); + } + if (scheme == null) + if (schemeEnd > 0) + scheme = A._Uri__makeScheme(uri, 0, schemeEnd); + else { + if (schemeEnd === 0) + A._Uri__fail(uri, 0, "Invalid empty scheme"); + scheme = ""; + } + if (hostStart > 0) { + userInfoStart = schemeEnd + 3; + userInfo = userInfoStart < hostStart ? A._Uri__makeUserInfo(uri, userInfoStart, hostStart - 1) : ""; + host = A._Uri__makeHost(uri, hostStart, portStart, false); + t1 = portStart + 1; + if (t1 < pathStart) { + portNumber = A.Primitives_parseInt(B.JSString_methods.substring$2(uri, t1, pathStart), _null); + port = A._Uri__makePort(portNumber == null ? A.throwExpression(A.FormatException$("Invalid port", uri, t1)) : portNumber, scheme); + } else + port = _null; + } else { + port = _null; + host = port; + userInfo = ""; + } + path = A._Uri__makePath(uri, pathStart, queryStart, _null, scheme, host != null); + query = queryStart < fragmentStart ? A._Uri__makeQuery(uri, queryStart + 1, fragmentStart, _null) : _null; + return A._Uri$_internal(scheme, userInfo, host, port, path, query, fragmentStart < end ? A._Uri__makeFragment(uri, fragmentStart + 1, end) : _null); + }, + Uri_decodeComponent(encodedComponent) { + A._asString(encodedComponent); + return A._Uri__uriDecode(encodedComponent, 0, encodedComponent.length, B.C_Utf8Codec, false); + }, + Uri__parseIPv4Address(host, start, end) { + var t1, i, partStart, partIndex, char, part, partIndex0, + _s43_ = "IPv4 address should contain exactly 4 parts", + _s37_ = "each part must be in the range 0..255", + error = new A.Uri__parseIPv4Address_error(host), + result = new Uint8Array(4); + for (t1 = host.length, i = start, partStart = i, partIndex = 0; i < end; ++i) { + if (!(i >= 0 && i < t1)) + return A.ioore(host, i); + char = host.charCodeAt(i); + if (char !== 46) { + if ((char ^ 48) > 9) + error.call$2("invalid character", i); + } else { + if (partIndex === 3) + error.call$2(_s43_, i); + part = A.int_parse(B.JSString_methods.substring$2(host, partStart, i), null); + if (part > 255) + error.call$2(_s37_, partStart); + partIndex0 = partIndex + 1; + if (!(partIndex < 4)) + return A.ioore(result, partIndex); + result[partIndex] = part; + partStart = i + 1; + partIndex = partIndex0; + } + } + if (partIndex !== 3) + error.call$2(_s43_, end); + part = A.int_parse(B.JSString_methods.substring$2(host, partStart, end), null); + if (part > 255) + error.call$2(_s37_, partStart); + if (!(partIndex < 4)) + return A.ioore(result, partIndex); + result[partIndex] = part; + return result; + }, + Uri_parseIPv6Address(host, start, end) { + var parts, i, partStart, wildcardSeen, seenDot, char, atEnd, last, bytes, wildCardLength, index, value, j, t2, _null = null, + error = new A.Uri_parseIPv6Address_error(host), + parseHex = new A.Uri_parseIPv6Address_parseHex(error, host), + t1 = host.length; + if (t1 < 2) + error.call$2("address is too short", _null); + parts = A._setArrayType([], type$.JSArray_int); + for (i = start, partStart = i, wildcardSeen = false, seenDot = false; i < end; ++i) { + if (!(i >= 0 && i < t1)) + return A.ioore(host, i); + char = host.charCodeAt(i); + if (char === 58) { + if (i === start) { + ++i; + if (!(i < t1)) + return A.ioore(host, i); + if (host.charCodeAt(i) !== 58) + error.call$2("invalid start colon.", i); + partStart = i; + } + if (i === partStart) { + if (wildcardSeen) + error.call$2("only one wildcard `::` is allowed", i); + B.JSArray_methods.add$1(parts, -1); + wildcardSeen = true; + } else + B.JSArray_methods.add$1(parts, parseHex.call$2(partStart, i)); + partStart = i + 1; + } else if (char === 46) + seenDot = true; + } + if (parts.length === 0) + error.call$2("too few parts", _null); + atEnd = partStart === end; + t1 = B.JSArray_methods.get$last(parts); + if (atEnd && t1 !== -1) + error.call$2("expected a part after last `:`", end); + if (!atEnd) + if (!seenDot) + B.JSArray_methods.add$1(parts, parseHex.call$2(partStart, end)); + else { + last = A.Uri__parseIPv4Address(host, partStart, end); + B.JSArray_methods.add$1(parts, (last[0] << 8 | last[1]) >>> 0); + B.JSArray_methods.add$1(parts, (last[2] << 8 | last[3]) >>> 0); + } + if (wildcardSeen) { + if (parts.length > 7) + error.call$2("an address with a wildcard must have less than 7 parts", _null); + } else if (parts.length !== 8) + error.call$2("an address without a wildcard must contain exactly 8 parts", _null); + bytes = new Uint8Array(16); + for (t1 = parts.length, wildCardLength = 9 - t1, i = 0, index = 0; i < t1; ++i) { + value = parts[i]; + if (value === -1) + for (j = 0; j < wildCardLength; ++j) { + if (!(index >= 0 && index < 16)) + return A.ioore(bytes, index); + bytes[index] = 0; + t2 = index + 1; + if (!(t2 < 16)) + return A.ioore(bytes, t2); + bytes[t2] = 0; + index += 2; + } + else { + t2 = B.JSInt_methods._shrOtherPositive$1(value, 8); + if (!(index >= 0 && index < 16)) + return A.ioore(bytes, index); + bytes[index] = t2; + t2 = index + 1; + if (!(t2 < 16)) + return A.ioore(bytes, t2); + bytes[t2] = value & 255; + index += 2; + } + } + return bytes; + }, + _Uri$_internal(scheme, _userInfo, _host, _port, path, _query, _fragment) { + return new A._Uri(scheme, _userInfo, _host, _port, path, _query, _fragment); + }, + _Uri__Uri(host, path, pathSegments, scheme) { + var userInfo, query, fragment, port, isFile, t1, hasAuthority, t2, _null = null; + scheme = scheme == null ? "" : A._Uri__makeScheme(scheme, 0, scheme.length); + userInfo = A._Uri__makeUserInfo(_null, 0, 0); + host = A._Uri__makeHost(host, 0, host == null ? 0 : host.length, false); + query = A._Uri__makeQuery(_null, 0, 0, _null); + fragment = A._Uri__makeFragment(_null, 0, 0); + port = A._Uri__makePort(_null, scheme); + isFile = scheme === "file"; + if (host == null) + t1 = userInfo.length !== 0 || port != null || isFile; + else + t1 = false; + if (t1) + host = ""; + t1 = host == null; + hasAuthority = !t1; + path = A._Uri__makePath(path, 0, path == null ? 0 : path.length, pathSegments, scheme, hasAuthority); + t2 = scheme.length === 0; + if (t2 && t1 && !B.JSString_methods.startsWith$1(path, "/")) + path = A._Uri__normalizeRelativePath(path, !t2 || hasAuthority); + else + path = A._Uri__removeDotSegments(path); + return A._Uri$_internal(scheme, userInfo, t1 && B.JSString_methods.startsWith$1(path, "//") ? "" : host, port, path, query, fragment); + }, + _Uri__defaultPort(scheme) { + if (scheme === "http") + return 80; + if (scheme === "https") + return 443; + return 0; + }, + _Uri__fail(uri, index, message) { + throw A.wrapException(A.FormatException$(message, uri, index)); + }, + _Uri__Uri$file(path, windows) { + return windows ? A._Uri__makeWindowsFileUrl(path, false) : A._Uri__makeFileUri(path, false); + }, + _Uri__checkNonWindowsPathReservedCharacters(segments, argumentError) { + var t1, _i, segment; + for (t1 = segments.length, _i = 0; _i < t1; ++_i) { + segment = segments[_i]; + if (J.contains$1$asx(segment, "/")) { + t1 = A.UnsupportedError$("Illegal path character " + A.S(segment)); + throw A.wrapException(t1); + } + } + }, + _Uri__checkWindowsPathReservedCharacters(segments, argumentError, firstSegment) { + var t1, t2, t3; + for (t1 = A.SubListIterable$(segments, firstSegment, null, A._arrayInstanceType(segments)._precomputed1), t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(t1), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListIterable.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + if (t3 == null) + t3 = t2._as(t3); + if (B.JSString_methods.contains$1(t3, A.RegExp_RegExp('["*/:<>?\\\\|]', false))) + if (argumentError) + throw A.wrapException(A.ArgumentError$("Illegal character in path", null)); + else + throw A.wrapException(A.UnsupportedError$("Illegal character in path: " + t3)); + } + }, + _Uri__checkWindowsDriveLetter(charCode, argumentError) { + var t1, + _s21_ = "Illegal drive letter "; + if (!(65 <= charCode && charCode <= 90)) + t1 = 97 <= charCode && charCode <= 122; + else + t1 = true; + if (t1) + return; + if (argumentError) + throw A.wrapException(A.ArgumentError$(_s21_ + A.String_String$fromCharCode(charCode), null)); + else + throw A.wrapException(A.UnsupportedError$(_s21_ + A.String_String$fromCharCode(charCode))); + }, + _Uri__makeFileUri(path, slashTerminated) { + var _null = null, + segments = A._setArrayType(path.split("/"), type$.JSArray_String); + if (B.JSString_methods.startsWith$1(path, "/")) + return A._Uri__Uri(_null, _null, segments, "file"); + else + return A._Uri__Uri(_null, _null, segments, _null); + }, + _Uri__makeWindowsFileUrl(path, slashTerminated) { + var t1, pathSegments, pathStart, hostPart, _s1_ = "\\", _null = null, _s4_ = "file"; + if (B.JSString_methods.startsWith$1(path, "\\\\?\\")) + if (B.JSString_methods.startsWith$2(path, "UNC\\", 4)) + path = B.JSString_methods.replaceRange$3(path, 0, 7, _s1_); + else { + path = B.JSString_methods.substring$1(path, 4); + t1 = path.length; + if (t1 >= 3) { + if (1 >= t1) + return A.ioore(path, 1); + if (path.charCodeAt(1) === 58) { + if (2 >= t1) + return A.ioore(path, 2); + t1 = path.charCodeAt(2) !== 92; + } else + t1 = true; + } else + t1 = true; + if (t1) + throw A.wrapException(A.ArgumentError$value(path, "path", "Windows paths with \\\\?\\ prefix must be absolute")); + } + else + path = A.stringReplaceAllUnchecked(path, "/", _s1_); + t1 = path.length; + if (t1 > 1 && path.charCodeAt(1) === 58) { + if (0 >= t1) + return A.ioore(path, 0); + A._Uri__checkWindowsDriveLetter(path.charCodeAt(0), true); + if (t1 !== 2) { + if (2 >= t1) + return A.ioore(path, 2); + t1 = path.charCodeAt(2) !== 92; + } else + t1 = true; + if (t1) + throw A.wrapException(A.ArgumentError$value(path, "path", "Windows paths with drive letter must be absolute")); + pathSegments = A._setArrayType(path.split(_s1_), type$.JSArray_String); + A._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 1); + return A._Uri__Uri(_null, _null, pathSegments, _s4_); + } + if (B.JSString_methods.startsWith$1(path, _s1_)) + if (B.JSString_methods.startsWith$2(path, _s1_, 1)) { + pathStart = B.JSString_methods.indexOf$2(path, _s1_, 2); + t1 = pathStart < 0; + hostPart = t1 ? B.JSString_methods.substring$1(path, 2) : B.JSString_methods.substring$2(path, 2, pathStart); + pathSegments = A._setArrayType((t1 ? "" : B.JSString_methods.substring$1(path, pathStart + 1)).split(_s1_), type$.JSArray_String); + A._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); + return A._Uri__Uri(hostPart, _null, pathSegments, _s4_); + } else { + pathSegments = A._setArrayType(path.split(_s1_), type$.JSArray_String); + A._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); + return A._Uri__Uri(_null, _null, pathSegments, _s4_); + } + else { + pathSegments = A._setArrayType(path.split(_s1_), type$.JSArray_String); + A._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); + return A._Uri__Uri(_null, _null, pathSegments, _null); + } + }, + _Uri__makePort(port, scheme) { + if (port != null && port === A._Uri__defaultPort(scheme)) + return null; + return port; + }, + _Uri__makeHost(host, start, end, strictIPv6) { + var t1, t2, index, zoneIDstart, zoneID, i; + if (host == null) + return null; + if (start === end) + return ""; + t1 = host.length; + if (!(start >= 0 && start < t1)) + return A.ioore(host, start); + if (host.charCodeAt(start) === 91) { + t2 = end - 1; + if (!(t2 >= 0 && t2 < t1)) + return A.ioore(host, t2); + if (host.charCodeAt(t2) !== 93) + A._Uri__fail(host, start, "Missing end `]` to match `[` in host"); + t1 = start + 1; + index = A._Uri__checkZoneID(host, t1, t2); + if (index < t2) { + zoneIDstart = index + 1; + zoneID = A._Uri__normalizeZoneID(host, B.JSString_methods.startsWith$2(host, "25", zoneIDstart) ? index + 3 : zoneIDstart, t2, "%25"); + } else + zoneID = ""; + A.Uri_parseIPv6Address(host, t1, index); + return B.JSString_methods.substring$2(host, start, index).toLowerCase() + zoneID + "]"; + } + for (i = start; i < end; ++i) { + if (!(i < t1)) + return A.ioore(host, i); + if (host.charCodeAt(i) === 58) { + index = B.JSString_methods.indexOf$2(host, "%", start); + index = index >= start && index < end ? index : end; + if (index < end) { + zoneIDstart = index + 1; + zoneID = A._Uri__normalizeZoneID(host, B.JSString_methods.startsWith$2(host, "25", zoneIDstart) ? index + 3 : zoneIDstart, end, "%25"); + } else + zoneID = ""; + A.Uri_parseIPv6Address(host, start, index); + return "[" + B.JSString_methods.substring$2(host, start, index) + zoneID + "]"; + } + } + return A._Uri__normalizeRegName(host, start, end); + }, + _Uri__checkZoneID(host, start, end) { + var index = B.JSString_methods.indexOf$2(host, "%", start); + return index >= start && index < end ? index : end; + }, + _Uri__normalizeZoneID(host, start, end, prefix) { + var t1, index, sectionStart, isNormalized, char, replacement, t2, t3, tail, sourceLength, slice, + buffer = prefix !== "" ? new A.StringBuffer(prefix) : null; + for (t1 = host.length, index = start, sectionStart = index, isNormalized = true; index < end;) { + if (!(index >= 0 && index < t1)) + return A.ioore(host, index); + char = host.charCodeAt(index); + if (char === 37) { + replacement = A._Uri__normalizeEscape(host, index, true); + t2 = replacement == null; + if (t2 && isNormalized) { + index += 3; + continue; + } + if (buffer == null) + buffer = new A.StringBuffer(""); + t3 = buffer._contents += B.JSString_methods.substring$2(host, sectionStart, index); + if (t2) + replacement = B.JSString_methods.substring$2(host, index, index + 3); + else if (replacement === "%") + A._Uri__fail(host, index, "ZoneID should not contain % anymore"); + buffer._contents = t3 + replacement; + index += 3; + sectionStart = index; + isNormalized = true; + } else { + if (char < 127) { + t2 = char >>> 4; + if (!(t2 < 8)) + return A.ioore(B.List_M1A, t2); + t2 = (B.List_M1A[t2] & 1 << (char & 15)) !== 0; + } else + t2 = false; + if (t2) { + if (isNormalized && 65 <= char && 90 >= char) { + if (buffer == null) + buffer = new A.StringBuffer(""); + if (sectionStart < index) { + buffer._contents += B.JSString_methods.substring$2(host, sectionStart, index); + sectionStart = index; + } + isNormalized = false; + } + ++index; + } else { + if ((char & 64512) === 55296 && index + 1 < end) { + t2 = index + 1; + if (!(t2 < t1)) + return A.ioore(host, t2); + tail = host.charCodeAt(t2); + if ((tail & 64512) === 56320) { + char = (char & 1023) << 10 | tail & 1023 | 65536; + sourceLength = 2; + } else + sourceLength = 1; + } else + sourceLength = 1; + slice = B.JSString_methods.substring$2(host, sectionStart, index); + if (buffer == null) { + buffer = new A.StringBuffer(""); + t2 = buffer; + } else + t2 = buffer; + t2._contents += slice; + t2._contents += A._Uri__escapeChar(char); + index += sourceLength; + sectionStart = index; + } + } + } + if (buffer == null) + return B.JSString_methods.substring$2(host, start, end); + if (sectionStart < end) + buffer._contents += B.JSString_methods.substring$2(host, sectionStart, end); + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _Uri__normalizeRegName(host, start, end) { + var t1, index, sectionStart, buffer, isNormalized, char, replacement, t2, slice, t3, sourceLength, tail; + for (t1 = host.length, index = start, sectionStart = index, buffer = null, isNormalized = true; index < end;) { + if (!(index >= 0 && index < t1)) + return A.ioore(host, index); + char = host.charCodeAt(index); + if (char === 37) { + replacement = A._Uri__normalizeEscape(host, index, true); + t2 = replacement == null; + if (t2 && isNormalized) { + index += 3; + continue; + } + if (buffer == null) + buffer = new A.StringBuffer(""); + slice = B.JSString_methods.substring$2(host, sectionStart, index); + t3 = buffer._contents += !isNormalized ? slice.toLowerCase() : slice; + if (t2) { + replacement = B.JSString_methods.substring$2(host, index, index + 3); + sourceLength = 3; + } else if (replacement === "%") { + replacement = "%25"; + sourceLength = 1; + } else + sourceLength = 3; + buffer._contents = t3 + replacement; + index += sourceLength; + sectionStart = index; + isNormalized = true; + } else { + if (char < 127) { + t2 = char >>> 4; + if (!(t2 < 8)) + return A.ioore(B.List_ejq, t2); + t2 = (B.List_ejq[t2] & 1 << (char & 15)) !== 0; + } else + t2 = false; + if (t2) { + if (isNormalized && 65 <= char && 90 >= char) { + if (buffer == null) + buffer = new A.StringBuffer(""); + if (sectionStart < index) { + buffer._contents += B.JSString_methods.substring$2(host, sectionStart, index); + sectionStart = index; + } + isNormalized = false; + } + ++index; + } else { + if (char <= 93) { + t2 = char >>> 4; + if (!(t2 < 8)) + return A.ioore(B.List_YmH, t2); + t2 = (B.List_YmH[t2] & 1 << (char & 15)) !== 0; + } else + t2 = false; + if (t2) + A._Uri__fail(host, index, "Invalid character"); + else { + if ((char & 64512) === 55296 && index + 1 < end) { + t2 = index + 1; + if (!(t2 < t1)) + return A.ioore(host, t2); + tail = host.charCodeAt(t2); + if ((tail & 64512) === 56320) { + char = (char & 1023) << 10 | tail & 1023 | 65536; + sourceLength = 2; + } else + sourceLength = 1; + } else + sourceLength = 1; + slice = B.JSString_methods.substring$2(host, sectionStart, index); + if (!isNormalized) + slice = slice.toLowerCase(); + if (buffer == null) { + buffer = new A.StringBuffer(""); + t2 = buffer; + } else + t2 = buffer; + t2._contents += slice; + t2._contents += A._Uri__escapeChar(char); + index += sourceLength; + sectionStart = index; + } + } + } + } + if (buffer == null) + return B.JSString_methods.substring$2(host, start, end); + if (sectionStart < end) { + slice = B.JSString_methods.substring$2(host, sectionStart, end); + buffer._contents += !isNormalized ? slice.toLowerCase() : slice; + } + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _Uri__makeScheme(scheme, start, end) { + var t1, i, containsUpperCase, codeUnit, t2; + if (start === end) + return ""; + t1 = scheme.length; + if (!(start < t1)) + return A.ioore(scheme, start); + if (!A._Uri__isAlphabeticCharacter(scheme.charCodeAt(start))) + A._Uri__fail(scheme, start, "Scheme not starting with alphabetic character"); + for (i = start, containsUpperCase = false; i < end; ++i) { + if (!(i < t1)) + return A.ioore(scheme, i); + codeUnit = scheme.charCodeAt(i); + if (codeUnit < 128) { + t2 = codeUnit >>> 4; + if (!(t2 < 8)) + return A.ioore(B.List_MMm, t2); + t2 = (B.List_MMm[t2] & 1 << (codeUnit & 15)) !== 0; + } else + t2 = false; + if (!t2) + A._Uri__fail(scheme, i, "Illegal scheme character"); + if (65 <= codeUnit && codeUnit <= 90) + containsUpperCase = true; + } + scheme = B.JSString_methods.substring$2(scheme, start, end); + return A._Uri__canonicalizeScheme(containsUpperCase ? scheme.toLowerCase() : scheme); + }, + _Uri__canonicalizeScheme(scheme) { + if (scheme === "http") + return "http"; + if (scheme === "file") + return "file"; + if (scheme === "https") + return "https"; + if (scheme === "package") + return "package"; + return scheme; + }, + _Uri__makeUserInfo(userInfo, start, end) { + if (userInfo == null) + return ""; + return A._Uri__normalizeOrSubstring(userInfo, start, end, B.List_OL3, false, false); + }, + _Uri__makePath(path, start, end, pathSegments, scheme, hasAuthority) { + var t1, result, + isFile = scheme === "file", + ensureLeadingSlash = isFile || hasAuthority; + if (path == null) { + if (pathSegments == null) + return isFile ? "/" : ""; + t1 = A._arrayInstanceType(pathSegments); + result = new A.MappedListIterable(pathSegments, t1._eval$1("String(1)")._as(new A._Uri__makePath_closure()), t1._eval$1("MappedListIterable<1,String>")).join$1(0, "/"); + } else if (pathSegments != null) + throw A.wrapException(A.ArgumentError$("Both path and pathSegments specified", null)); + else + result = A._Uri__normalizeOrSubstring(path, start, end, B.List_XRg, true, true); + if (result.length === 0) { + if (isFile) + return "/"; + } else if (ensureLeadingSlash && !B.JSString_methods.startsWith$1(result, "/")) + result = "/" + result; + return A._Uri__normalizePath(result, scheme, hasAuthority); + }, + _Uri__normalizePath(path, scheme, hasAuthority) { + var t1 = scheme.length === 0; + if (t1 && !hasAuthority && !B.JSString_methods.startsWith$1(path, "/") && !B.JSString_methods.startsWith$1(path, "\\")) + return A._Uri__normalizeRelativePath(path, !t1 || hasAuthority); + return A._Uri__removeDotSegments(path); + }, + _Uri__makeQuery(query, start, end, queryParameters) { + if (query != null) + return A._Uri__normalizeOrSubstring(query, start, end, B.List_oFp, true, false); + return null; + }, + _Uri__makeFragment(fragment, start, end) { + if (fragment == null) + return null; + return A._Uri__normalizeOrSubstring(fragment, start, end, B.List_oFp, true, false); + }, + _Uri__normalizeEscape(source, index, lowerCase) { + var t3, firstDigit, secondDigit, firstDigitValue, secondDigitValue, value, + t1 = index + 2, + t2 = source.length; + if (t1 >= t2) + return "%"; + t3 = index + 1; + if (!(t3 >= 0 && t3 < t2)) + return A.ioore(source, t3); + firstDigit = source.charCodeAt(t3); + if (!(t1 >= 0)) + return A.ioore(source, t1); + secondDigit = source.charCodeAt(t1); + firstDigitValue = A.hexDigitValue(firstDigit); + secondDigitValue = A.hexDigitValue(secondDigit); + if (firstDigitValue < 0 || secondDigitValue < 0) + return "%"; + value = firstDigitValue * 16 + secondDigitValue; + if (value < 127) { + t1 = B.JSInt_methods._shrOtherPositive$1(value, 4); + if (!(t1 < 8)) + return A.ioore(B.List_M1A, t1); + t1 = (B.List_M1A[t1] & 1 << (value & 15)) !== 0; + } else + t1 = false; + if (t1) + return A.Primitives_stringFromCharCode(lowerCase && 65 <= value && 90 >= value ? (value | 32) >>> 0 : value); + if (firstDigit >= 97 || secondDigit >= 97) + return B.JSString_methods.substring$2(source, index, index + 3).toUpperCase(); + return null; + }, + _Uri__escapeChar(char) { + var codeUnits, t1, flag, encodedBytes, index, byte, t2, t3, + _s16_ = "0123456789ABCDEF"; + if (char < 128) { + codeUnits = new Uint8Array(3); + codeUnits[0] = 37; + t1 = char >>> 4; + if (!(t1 < 16)) + return A.ioore(_s16_, t1); + codeUnits[1] = _s16_.charCodeAt(t1); + codeUnits[2] = _s16_.charCodeAt(char & 15); + } else { + if (char > 2047) + if (char > 65535) { + flag = 240; + encodedBytes = 4; + } else { + flag = 224; + encodedBytes = 3; + } + else { + flag = 192; + encodedBytes = 2; + } + t1 = 3 * encodedBytes; + codeUnits = new Uint8Array(t1); + for (index = 0; --encodedBytes, encodedBytes >= 0; flag = 128) { + byte = B.JSInt_methods._shrReceiverPositive$1(char, 6 * encodedBytes) & 63 | flag; + if (!(index < t1)) + return A.ioore(codeUnits, index); + codeUnits[index] = 37; + t2 = index + 1; + t3 = byte >>> 4; + if (!(t3 < 16)) + return A.ioore(_s16_, t3); + if (!(t2 < t1)) + return A.ioore(codeUnits, t2); + codeUnits[t2] = _s16_.charCodeAt(t3); + t3 = index + 2; + if (!(t3 < t1)) + return A.ioore(codeUnits, t3); + codeUnits[t3] = _s16_.charCodeAt(byte & 15); + index += 3; + } + } + return A.String_String$fromCharCodes(codeUnits, 0, null); + }, + _Uri__normalizeOrSubstring(component, start, end, charTable, escapeDelimiters, replaceBackslash) { + var t1 = A._Uri__normalize(component, start, end, charTable, escapeDelimiters, replaceBackslash); + return t1 == null ? B.JSString_methods.substring$2(component, start, end) : t1; + }, + _Uri__normalize(component, start, end, charTable, escapeDelimiters, replaceBackslash) { + var t1, t2, index, sectionStart, buffer, char, t3, replacement, sourceLength, tail, t4, _null = null; + for (t1 = !escapeDelimiters, t2 = component.length, index = start, sectionStart = index, buffer = _null; index < end;) { + if (!(index >= 0 && index < t2)) + return A.ioore(component, index); + char = component.charCodeAt(index); + if (char < 127) { + t3 = char >>> 4; + if (!(t3 < 8)) + return A.ioore(charTable, t3); + t3 = (charTable[t3] & 1 << (char & 15)) !== 0; + } else + t3 = false; + if (t3) + ++index; + else { + if (char === 37) { + replacement = A._Uri__normalizeEscape(component, index, false); + if (replacement == null) { + index += 3; + continue; + } + if ("%" === replacement) { + replacement = "%25"; + sourceLength = 1; + } else + sourceLength = 3; + } else if (char === 92 && replaceBackslash) { + replacement = "/"; + sourceLength = 1; + } else { + if (t1) + if (char <= 93) { + t3 = char >>> 4; + if (!(t3 < 8)) + return A.ioore(B.List_YmH, t3); + t3 = (B.List_YmH[t3] & 1 << (char & 15)) !== 0; + } else + t3 = false; + else + t3 = false; + if (t3) { + A._Uri__fail(component, index, "Invalid character"); + sourceLength = _null; + replacement = sourceLength; + } else { + if ((char & 64512) === 55296) { + t3 = index + 1; + if (t3 < end) { + if (!(t3 < t2)) + return A.ioore(component, t3); + tail = component.charCodeAt(t3); + if ((tail & 64512) === 56320) { + char = (char & 1023) << 10 | tail & 1023 | 65536; + sourceLength = 2; + } else + sourceLength = 1; + } else + sourceLength = 1; + } else + sourceLength = 1; + replacement = A._Uri__escapeChar(char); + } + } + if (buffer == null) { + buffer = new A.StringBuffer(""); + t3 = buffer; + } else + t3 = buffer; + t4 = t3._contents += B.JSString_methods.substring$2(component, sectionStart, index); + t3._contents = t4 + A.S(replacement); + if (typeof sourceLength !== "number") + return A.iae(sourceLength); + index += sourceLength; + sectionStart = index; + } + } + if (buffer == null) + return _null; + if (sectionStart < end) + buffer._contents += B.JSString_methods.substring$2(component, sectionStart, end); + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _Uri__mayContainDotSegments(path) { + if (B.JSString_methods.startsWith$1(path, ".")) + return true; + return B.JSString_methods.indexOf$1(path, "/.") !== -1; + }, + _Uri__removeDotSegments(path) { + var output, t1, t2, appendSlash, _i, segment, t3; + if (!A._Uri__mayContainDotSegments(path)) + return path; + output = A._setArrayType([], type$.JSArray_String); + for (t1 = path.split("/"), t2 = t1.length, appendSlash = false, _i = 0; _i < t2; ++_i) { + segment = t1[_i]; + if (J.$eq$(segment, "..")) { + t3 = output.length; + if (t3 !== 0) { + if (0 >= t3) + return A.ioore(output, -1); + output.pop(); + if (output.length === 0) + B.JSArray_methods.add$1(output, ""); + } + appendSlash = true; + } else if ("." === segment) + appendSlash = true; + else { + B.JSArray_methods.add$1(output, segment); + appendSlash = false; + } + } + if (appendSlash) + B.JSArray_methods.add$1(output, ""); + return B.JSArray_methods.join$1(output, "/"); + }, + _Uri__normalizeRelativePath(path, allowScheme) { + var output, t1, t2, appendSlash, _i, segment; + if (!A._Uri__mayContainDotSegments(path)) + return !allowScheme ? A._Uri__escapeScheme(path) : path; + output = A._setArrayType([], type$.JSArray_String); + for (t1 = path.split("/"), t2 = t1.length, appendSlash = false, _i = 0; _i < t2; ++_i) { + segment = t1[_i]; + if (".." === segment) + if (output.length !== 0 && B.JSArray_methods.get$last(output) !== "..") { + if (0 >= output.length) + return A.ioore(output, -1); + output.pop(); + appendSlash = true; + } else { + B.JSArray_methods.add$1(output, ".."); + appendSlash = false; + } + else if ("." === segment) + appendSlash = true; + else { + B.JSArray_methods.add$1(output, segment); + appendSlash = false; + } + } + t1 = output.length; + if (t1 !== 0) + if (t1 === 1) { + if (0 >= t1) + return A.ioore(output, 0); + t1 = output[0].length === 0; + } else + t1 = false; + else + t1 = true; + if (t1) + return "./"; + if (appendSlash || B.JSArray_methods.get$last(output) === "..") + B.JSArray_methods.add$1(output, ""); + if (!allowScheme) { + if (0 >= output.length) + return A.ioore(output, 0); + B.JSArray_methods.$indexSet(output, 0, A._Uri__escapeScheme(output[0])); + } + return B.JSArray_methods.join$1(output, "/"); + }, + _Uri__escapeScheme(path) { + var i, char, t2, + t1 = path.length; + if (t1 >= 2 && A._Uri__isAlphabeticCharacter(path.charCodeAt(0))) + for (i = 1; i < t1; ++i) { + char = path.charCodeAt(i); + if (char === 58) + return B.JSString_methods.substring$2(path, 0, i) + "%3A" + B.JSString_methods.substring$1(path, i + 1); + if (char <= 127) { + t2 = char >>> 4; + if (!(t2 < 8)) + return A.ioore(B.List_MMm, t2); + t2 = (B.List_MMm[t2] & 1 << (char & 15)) === 0; + } else + t2 = true; + if (t2) + break; + } + return path; + }, + _Uri__packageNameEnd(uri, path) { + if (uri.isScheme$1("package") && uri._host == null) + return A._skipPackageNameChars(path, 0, path.length); + return -1; + }, + _Uri__toWindowsFilePath(uri) { + var hasDriveLetter, t2, host, + segments = uri.get$pathSegments(), + t1 = segments.length; + if (t1 > 0 && J.get$length$asx(segments[0]) === 2 && J.codeUnitAt$1$s(segments[0], 1) === 58) { + if (0 >= t1) + return A.ioore(segments, 0); + A._Uri__checkWindowsDriveLetter(J.codeUnitAt$1$s(segments[0], 0), false); + A._Uri__checkWindowsPathReservedCharacters(segments, false, 1); + hasDriveLetter = true; + } else { + A._Uri__checkWindowsPathReservedCharacters(segments, false, 0); + hasDriveLetter = false; + } + t2 = uri.get$hasAbsolutePath() && !hasDriveLetter ? "" + "\\" : ""; + if (uri.get$hasAuthority()) { + host = uri.get$host(); + if (host.length !== 0) + t2 = t2 + "\\" + host + "\\"; + } + t2 = A.StringBuffer__writeAll(t2, segments, "\\"); + t1 = hasDriveLetter && t1 === 1 ? t2 + "\\" : t2; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _Uri__hexCharPairToByte(s, pos) { + var t1, byte, i, t2, charCode; + for (t1 = s.length, byte = 0, i = 0; i < 2; ++i) { + t2 = pos + i; + if (!(t2 < t1)) + return A.ioore(s, t2); + charCode = s.charCodeAt(t2); + if (48 <= charCode && charCode <= 57) + byte = byte * 16 + charCode - 48; + else { + charCode |= 32; + if (97 <= charCode && charCode <= 102) + byte = byte * 16 + charCode - 87; + else + throw A.wrapException(A.ArgumentError$("Invalid URL encoding", null)); + } + } + return byte; + }, + _Uri__uriDecode(text, start, end, encoding, plusToSpace) { + var simple, codeUnit, t2, bytes, + t1 = text.length, + i = start; + while (true) { + if (!(i < end)) { + simple = true; + break; + } + if (!(i < t1)) + return A.ioore(text, i); + codeUnit = text.charCodeAt(i); + if (codeUnit <= 127) + if (codeUnit !== 37) + t2 = false; + else + t2 = true; + else + t2 = true; + if (t2) { + simple = false; + break; + } + ++i; + } + if (simple) { + if (B.C_Utf8Codec !== encoding) + t1 = false; + else + t1 = true; + if (t1) + return B.JSString_methods.substring$2(text, start, end); + else + bytes = new A.CodeUnits(B.JSString_methods.substring$2(text, start, end)); + } else { + bytes = A._setArrayType([], type$.JSArray_int); + for (i = start; i < end; ++i) { + if (!(i < t1)) + return A.ioore(text, i); + codeUnit = text.charCodeAt(i); + if (codeUnit > 127) + throw A.wrapException(A.ArgumentError$("Illegal percent encoding in URI", null)); + if (codeUnit === 37) { + if (i + 3 > t1) + throw A.wrapException(A.ArgumentError$("Truncated URI", null)); + B.JSArray_methods.add$1(bytes, A._Uri__hexCharPairToByte(text, i + 1)); + i += 2; + } else + B.JSArray_methods.add$1(bytes, codeUnit); + } + } + type$.List_int._as(bytes); + return B.Utf8Decoder_false.convert$1(bytes); + }, + _Uri__isAlphabeticCharacter(codeUnit) { + var lowerCase = codeUnit | 32; + return 97 <= lowerCase && lowerCase <= 122; + }, + UriData__writeUri(mimeType, charsetName, parameters, buffer, indices) { + var slashIndex, t1; + if (true) + buffer._contents = buffer._contents; + else { + slashIndex = A.UriData__validateMimeType(""); + if (slashIndex < 0) + throw A.wrapException(A.ArgumentError$value("", "mimeType", "Invalid MIME type")); + t1 = buffer._contents += A._Uri__uriEncode(B.List_yzX, B.JSString_methods.substring$2("", 0, slashIndex), B.C_Utf8Codec, false); + buffer._contents = t1 + "/"; + buffer._contents += A._Uri__uriEncode(B.List_yzX, B.JSString_methods.substring$1("", slashIndex + 1), B.C_Utf8Codec, false); + } + }, + UriData__validateMimeType(mimeType) { + var t1, slashIndex, i; + for (t1 = mimeType.length, slashIndex = -1, i = 0; i < t1; ++i) { + if (mimeType.charCodeAt(i) !== 47) + continue; + if (slashIndex < 0) { + slashIndex = i; + continue; + } + return -1; + } + return slashIndex; + }, + UriData__parse(text, start, sourceUri) { + var t1, i, slashIndex, char, equalsIndex, lastSeparator, t2, data, + _s17_ = "Invalid MIME type", + indices = A._setArrayType([start - 1], type$.JSArray_int); + for (t1 = text.length, i = start, slashIndex = -1, char = null; i < t1; ++i) { + char = text.charCodeAt(i); + if (char === 44 || char === 59) + break; + if (char === 47) { + if (slashIndex < 0) { + slashIndex = i; + continue; + } + throw A.wrapException(A.FormatException$(_s17_, text, i)); + } + } + if (slashIndex < 0 && i > start) + throw A.wrapException(A.FormatException$(_s17_, text, i)); + for (; char !== 44;) { + B.JSArray_methods.add$1(indices, i); + ++i; + for (equalsIndex = -1; i < t1; ++i) { + if (!(i >= 0)) + return A.ioore(text, i); + char = text.charCodeAt(i); + if (char === 61) { + if (equalsIndex < 0) + equalsIndex = i; + } else if (char === 59 || char === 44) + break; + } + if (equalsIndex >= 0) + B.JSArray_methods.add$1(indices, equalsIndex); + else { + lastSeparator = B.JSArray_methods.get$last(indices); + if (char !== 44 || i !== lastSeparator + 7 || !B.JSString_methods.startsWith$2(text, "base64", lastSeparator + 1)) + throw A.wrapException(A.FormatException$("Expecting '='", text, i)); + break; + } + } + B.JSArray_methods.add$1(indices, i); + t2 = i + 1; + if ((indices.length & 1) === 1) + text = B.C_Base64Codec.normalize$3(text, t2, t1); + else { + data = A._Uri__normalize(text, t2, t1, B.List_oFp, true, false); + if (data != null) + text = B.JSString_methods.replaceRange$3(text, t2, t1, data); + } + return new A.UriData(text, indices, sourceUri); + }, + UriData__uriEncodeBytes(canonicalTable, bytes, buffer) { + var t1, byteOr, i, byte, t2, + _s16_ = "0123456789ABCDEF"; + for (t1 = bytes.length, byteOr = 0, i = 0; i < t1; ++i) { + byte = bytes[i]; + byteOr |= byte; + if (byte < 128) { + t2 = byte >>> 4; + if (!(t2 < 8)) + return A.ioore(canonicalTable, t2); + t2 = (canonicalTable[t2] & 1 << (byte & 15)) !== 0; + } else + t2 = false; + if (t2) + buffer._contents += A.Primitives_stringFromCharCode(byte); + else { + buffer._contents += A.Primitives_stringFromCharCode(37); + t2 = byte >>> 4; + if (!(t2 < 16)) + return A.ioore(_s16_, t2); + buffer._contents += A.Primitives_stringFromCharCode(_s16_.charCodeAt(t2)); + buffer._contents += A.Primitives_stringFromCharCode(_s16_.charCodeAt(byte & 15)); + } + } + if ((byteOr & 4294967040) !== 0) + for (i = 0; i < t1; ++i) { + byte = bytes[i]; + if (byte > 255) + throw A.wrapException(A.ArgumentError$value(byte, "non-byte value", null)); + } + }, + _createTables() { + var _i, t1, t2, t3, t4, t5, + _s77_ = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", + _s1_ = ".", _s1_0 = ":", _s1_1 = "/", _s1_2 = "\\", _s1_3 = "?", _s1_4 = "#", _s2_ = "/\\", + tables = A._setArrayType(new Array(22), type$.JSArray_Uint8List); + for (_i = 0; _i < 22; ++_i) + tables[_i] = new Uint8Array(96); + t1 = new A._createTables_build(tables); + t2 = new A._createTables_setChars(); + t3 = new A._createTables_setRange(); + t4 = type$.Uint8List; + t5 = t4._as(t1.call$2(0, 225)); + t2.call$3(t5, _s77_, 1); + t2.call$3(t5, _s1_, 14); + t2.call$3(t5, _s1_0, 34); + t2.call$3(t5, _s1_1, 3); + t2.call$3(t5, _s1_2, 227); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(14, 225)); + t2.call$3(t5, _s77_, 1); + t2.call$3(t5, _s1_, 15); + t2.call$3(t5, _s1_0, 34); + t2.call$3(t5, _s2_, 234); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(15, 225)); + t2.call$3(t5, _s77_, 1); + t2.call$3(t5, "%", 225); + t2.call$3(t5, _s1_0, 34); + t2.call$3(t5, _s1_1, 9); + t2.call$3(t5, _s1_2, 233); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(1, 225)); + t2.call$3(t5, _s77_, 1); + t2.call$3(t5, _s1_0, 34); + t2.call$3(t5, _s1_1, 10); + t2.call$3(t5, _s1_2, 234); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(2, 235)); + t2.call$3(t5, _s77_, 139); + t2.call$3(t5, _s1_1, 131); + t2.call$3(t5, _s1_2, 131); + t2.call$3(t5, _s1_, 146); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(3, 235)); + t2.call$3(t5, _s77_, 11); + t2.call$3(t5, _s1_1, 68); + t2.call$3(t5, _s1_2, 68); + t2.call$3(t5, _s1_, 18); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(4, 229)); + t2.call$3(t5, _s77_, 5); + t3.call$3(t5, "AZ", 229); + t2.call$3(t5, _s1_0, 102); + t2.call$3(t5, "@", 68); + t2.call$3(t5, "[", 232); + t2.call$3(t5, _s1_1, 138); + t2.call$3(t5, _s1_2, 138); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(5, 229)); + t2.call$3(t5, _s77_, 5); + t3.call$3(t5, "AZ", 229); + t2.call$3(t5, _s1_0, 102); + t2.call$3(t5, "@", 68); + t2.call$3(t5, _s1_1, 138); + t2.call$3(t5, _s1_2, 138); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(6, 231)); + t3.call$3(t5, "19", 7); + t2.call$3(t5, "@", 68); + t2.call$3(t5, _s1_1, 138); + t2.call$3(t5, _s1_2, 138); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(7, 231)); + t3.call$3(t5, "09", 7); + t2.call$3(t5, "@", 68); + t2.call$3(t5, _s1_1, 138); + t2.call$3(t5, _s1_2, 138); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t2.call$3(t4._as(t1.call$2(8, 8)), "]", 5); + t5 = t4._as(t1.call$2(9, 235)); + t2.call$3(t5, _s77_, 11); + t2.call$3(t5, _s1_, 16); + t2.call$3(t5, _s2_, 234); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(16, 235)); + t2.call$3(t5, _s77_, 11); + t2.call$3(t5, _s1_, 17); + t2.call$3(t5, _s2_, 234); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(17, 235)); + t2.call$3(t5, _s77_, 11); + t2.call$3(t5, _s1_1, 9); + t2.call$3(t5, _s1_2, 233); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(10, 235)); + t2.call$3(t5, _s77_, 11); + t2.call$3(t5, _s1_, 18); + t2.call$3(t5, _s1_1, 10); + t2.call$3(t5, _s1_2, 234); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(18, 235)); + t2.call$3(t5, _s77_, 11); + t2.call$3(t5, _s1_, 19); + t2.call$3(t5, _s2_, 234); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(19, 235)); + t2.call$3(t5, _s77_, 11); + t2.call$3(t5, _s2_, 234); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(11, 235)); + t2.call$3(t5, _s77_, 11); + t2.call$3(t5, _s1_1, 10); + t2.call$3(t5, _s1_2, 234); + t2.call$3(t5, _s1_3, 172); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(12, 236)); + t2.call$3(t5, _s77_, 12); + t2.call$3(t5, _s1_3, 12); + t2.call$3(t5, _s1_4, 205); + t5 = t4._as(t1.call$2(13, 237)); + t2.call$3(t5, _s77_, 13); + t2.call$3(t5, _s1_3, 13); + t3.call$3(t4._as(t1.call$2(20, 245)), "az", 21); + t1 = t4._as(t1.call$2(21, 245)); + t3.call$3(t1, "az", 21); + t3.call$3(t1, "09", 21); + t2.call$3(t1, "+-.", 21); + return tables; + }, + _scan(uri, start, end, state, indices) { + var t1, i, table, char, transition, + tables = $.$get$_scannerTables(); + for (t1 = uri.length, i = start; i < end; ++i) { + if (!(state >= 0 && state < tables.length)) + return A.ioore(tables, state); + table = tables[state]; + if (!(i < t1)) + return A.ioore(uri, i); + char = uri.charCodeAt(i) ^ 96; + transition = table[char > 95 ? 31 : char]; + state = transition & 31; + B.JSArray_methods.$indexSet(indices, transition >>> 5, i); + } + return state; + }, + _SimpleUri__packageNameEnd(uri) { + if (uri._schemeEnd === 7 && B.JSString_methods.startsWith$1(uri._uri, "package") && uri._hostStart <= 0) + return A._skipPackageNameChars(uri._uri, uri._pathStart, uri._queryStart); + return -1; + }, + _skipPackageNameChars(source, start, end) { + var t1, i, dots, char; + for (t1 = source.length, i = start, dots = 0; i < end; ++i) { + if (!(i >= 0 && i < t1)) + return A.ioore(source, i); + char = source.charCodeAt(i); + if (char === 47) + return dots !== 0 ? i : -1; + if (char === 37 || char === 58) + return -1; + dots |= char ^ 46; + } + return -1; + }, + _caseInsensitiveCompareStart(prefix, string, start) { + var t1, t2, result, i, t3, stringChar, delta, lowerChar; + for (t1 = prefix.length, t2 = string.length, result = 0, i = 0; i < t1; ++i) { + t3 = start + i; + if (!(t3 < t2)) + return A.ioore(string, t3); + stringChar = string.charCodeAt(t3); + delta = prefix.charCodeAt(i) ^ stringChar; + if (delta !== 0) { + if (delta === 32) { + lowerChar = stringChar | delta; + if (97 <= lowerChar && lowerChar <= 122) { + result = 32; + continue; + } + } + return -1; + } + } + return result; + }, + Duration: function Duration() { + }, + _Enum: function _Enum() { + }, + Error: function Error() { + }, + AssertionError: function AssertionError(t0) { + this.message = t0; + }, + TypeError: function TypeError() { + }, + ArgumentError: function ArgumentError(t0, t1, t2, t3) { + var _ = this; + _._hasValue = t0; + _.invalidValue = t1; + _.name = t2; + _.message = t3; + }, + RangeError: function RangeError(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.start = t0; + _.end = t1; + _._hasValue = t2; + _.invalidValue = t3; + _.name = t4; + _.message = t5; + }, + IndexError: function IndexError(t0, t1, t2, t3, t4) { + var _ = this; + _.length = t0; + _._hasValue = t1; + _.invalidValue = t2; + _.name = t3; + _.message = t4; + }, + UnsupportedError: function UnsupportedError(t0) { + this.message = t0; + }, + UnimplementedError: function UnimplementedError(t0) { + this.message = t0; + }, + StateError: function StateError(t0) { + this.message = t0; + }, + ConcurrentModificationError: function ConcurrentModificationError(t0) { + this.modifiedObject = t0; + }, + OutOfMemoryError: function OutOfMemoryError() { + }, + StackOverflowError: function StackOverflowError() { + }, + _Exception: function _Exception(t0) { + this.message = t0; + }, + FormatException: function FormatException(t0, t1, t2) { + this.message = t0; + this.source = t1; + this.offset = t2; + }, + Iterable: function Iterable() { + }, + MapEntry: function MapEntry(t0, t1, t2) { + this.key = t0; + this.value = t1; + this.$ti = t2; + }, + Null: function Null() { + }, + Object: function Object() { + }, + _StringStackTrace: function _StringStackTrace(t0) { + this._stackTrace = t0; + }, + StringBuffer: function StringBuffer(t0) { + this._contents = t0; + }, + Uri__parseIPv4Address_error: function Uri__parseIPv4Address_error(t0) { + this.host = t0; + }, + Uri_parseIPv6Address_error: function Uri_parseIPv6Address_error(t0) { + this.host = t0; + }, + Uri_parseIPv6Address_parseHex: function Uri_parseIPv6Address_parseHex(t0, t1) { + this.error = t0; + this.host = t1; + }, + _Uri: function _Uri(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.scheme = t0; + _._userInfo = t1; + _._host = t2; + _._port = t3; + _.path = t4; + _._query = t5; + _._fragment = t6; + _.___Uri_hashCode_FI = _.___Uri_pathSegments_FI = _.___Uri__text_FI = $; + }, + _Uri__makePath_closure: function _Uri__makePath_closure() { + }, + UriData: function UriData(t0, t1, t2) { + this._text = t0; + this._separatorIndices = t1; + this._uriCache = t2; + }, + _createTables_build: function _createTables_build(t0) { + this.tables = t0; + }, + _createTables_setChars: function _createTables_setChars() { + }, + _createTables_setRange: function _createTables_setRange() { + }, + _SimpleUri: function _SimpleUri(t0, t1, t2, t3, t4, t5, t6, t7) { + var _ = this; + _._uri = t0; + _._schemeEnd = t1; + _._hostStart = t2; + _._portStart = t3; + _._pathStart = t4; + _._queryStart = t5; + _._fragmentStart = t6; + _._schemeCache = t7; + _._hashCodeCache = null; + }, + _DataUri: function _DataUri(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.scheme = t0; + _._userInfo = t1; + _._host = t2; + _._port = t3; + _.path = t4; + _._query = t5; + _._fragment = t6; + _.___Uri_hashCode_FI = _.___Uri_pathSegments_FI = _.___Uri__text_FI = $; + }, + Expando: function Expando(t0, t1, t2) { + this._jsWeakMap = t0; + this.name = t1; + this.$ti = t2; + }, + Process_runSync(executable, $arguments) { + throw A.wrapException(A.UnsupportedError$("Process.runSync")); + }, + SystemEncoding: function SystemEncoding() { + }, + wrapMain(mainFn) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void); + var $async$wrapMain = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return A._asyncAwait(A.Chain_capture(new A.wrapMain_closure(mainFn), new A.wrapMain_closure0(), type$.Future_Never), $async$wrapMain); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$wrapMain, $async$completer); + }, + wrapMain_closure: function wrapMain_closure(t0) { + this.mainFn = t0; + }, + wrapMain__closure0: function wrapMain__closure0() { + }, + wrapMain_closure0: function wrapMain_closure0() { + }, + wrapMain__closure: function wrapMain__closure() { + }, + ActionContext: function ActionContext(t0, t1) { + this._successTearDowns = t0; + this._errorTearDowns = t1; + }, + ActionResult: function ActionResult(t0) { + this._core$_name = t0; + }, + get(url, headers) { + return A._withClient(new A.get_closure(url, headers), type$.Response); + }, + _withClient(fn, $T) { + return A._withClient$body(fn, $T, $T); + }, + _withClient$body(fn, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + client; + var $async$_withClient = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + client = A.Client_Client(); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_withClient, $async$completer); + }, + get_closure: function get_closure(t0, t1) { + this.url = t0; + this.headers = t1; + }, + Context_Context(style) { + return new A.Context(style, "."); + }, + _parseUri(uri) { + return uri; + }, + _validateArgList(method, args) { + var numArgs, i, numArgs0, message, t1, t2, t3, t4; + for (numArgs = args.length, i = 1; i < numArgs; ++i) { + if (args[i] == null || args[i - 1] != null) + continue; + for (; numArgs >= 1; numArgs = numArgs0) { + numArgs0 = numArgs - 1; + if (args[numArgs0] != null) + break; + } + message = new A.StringBuffer(""); + t1 = "" + (method + "("); + message._contents = t1; + t2 = A._arrayInstanceType(args); + t3 = t2._eval$1("SubListIterable<1>"); + t4 = new A.SubListIterable(args, 0, numArgs, t3); + t4.SubListIterable$3(args, 0, numArgs, t2._precomputed1); + t3 = t1 + new A.MappedListIterable(t4, t3._eval$1("String(ListIterable.E)")._as(new A._validateArgList_closure()), t3._eval$1("MappedListIterable")).join$1(0, ", "); + message._contents = t3; + message._contents = t3 + ("): part " + (i - 1) + " was null, but part " + i + " was not."); + throw A.wrapException(A.ArgumentError$(message.toString$0(0), null)); + } + }, + Context: function Context(t0, t1) { + this.style = t0; + this._context$_current = t1; + }, + Context_joinAll_closure: function Context_joinAll_closure() { + }, + Context_split_closure: function Context_split_closure() { + }, + _validateArgList_closure: function _validateArgList_closure() { + }, + _PathDirection: function _PathDirection(t0) { + this.name = t0; + }, + _PathRelation: function _PathRelation(t0) { + this.name = t0; + }, + InternalStyle: function InternalStyle() { + }, + ParsedPath_ParsedPath$parse(path, style) { + var t1, parts, separators, t2, start, i, + root = style.getRoot$1(path); + style.isRootRelative$1(path); + if (root != null) + path = B.JSString_methods.substring$1(path, root.length); + t1 = type$.JSArray_String; + parts = A._setArrayType([], t1); + separators = A._setArrayType([], t1); + t1 = path.length; + if (t1 !== 0) { + if (0 >= t1) + return A.ioore(path, 0); + t2 = style.isSeparator$1(path.charCodeAt(0)); + } else + t2 = false; + if (t2) { + if (0 >= t1) + return A.ioore(path, 0); + B.JSArray_methods.add$1(separators, path[0]); + start = 1; + } else { + B.JSArray_methods.add$1(separators, ""); + start = 0; + } + for (i = start; i < t1; ++i) + if (style.isSeparator$1(path.charCodeAt(i))) { + B.JSArray_methods.add$1(parts, B.JSString_methods.substring$2(path, start, i)); + B.JSArray_methods.add$1(separators, path[i]); + start = i + 1; + } + if (start < t1) { + B.JSArray_methods.add$1(parts, B.JSString_methods.substring$1(path, start)); + B.JSArray_methods.add$1(separators, ""); + } + return new A.ParsedPath(style, root, parts, separators); + }, + ParsedPath: function ParsedPath(t0, t1, t2, t3) { + var _ = this; + _.style = t0; + _.root = t1; + _.parts = t2; + _.separators = t3; + }, + PathException$(message) { + return new A.PathException(message); + }, + PathException: function PathException(t0) { + this.message = t0; + }, + Style__getPlatformStyle() { + if (A.Uri_base().get$scheme() !== "file") + return $.$get$Style_url(); + if (!B.JSString_methods.endsWith$1(A.Uri_base().get$path(), "/")) + return $.$get$Style_url(); + if (A._Uri__Uri(null, "a/b", null, null).toFilePath$0() === "a\\b") + return $.$get$Style_windows(); + return $.$get$Style_posix(); + }, + Style: function Style() { + }, + PosixStyle: function PosixStyle(t0, t1, t2) { + this.separatorPattern = t0; + this.needsSeparatorPattern = t1; + this.rootPattern = t2; + }, + UrlStyle: function UrlStyle(t0, t1, t2, t3) { + var _ = this; + _.separatorPattern = t0; + _.needsSeparatorPattern = t1; + _.rootPattern = t2; + _.relativeRootPattern = t3; + }, + WindowsStyle: function WindowsStyle(t0, t1, t2, t3) { + var _ = this; + _.separatorPattern = t0; + _.needsSeparatorPattern = t1; + _.rootPattern = t2; + _.relativeRootPattern = t3; + }, + WindowsStyle_absolutePathToUri_closure: function WindowsStyle_absolutePathToUri_closure() { + }, + mapStackTrace(sourceMap, stackTrace, minified, packageMap, sdkRoot) { + var t1, t2; + if (type$.Chain._is(stackTrace)) { + t1 = stackTrace.get$traces(); + t2 = A._arrayInstanceType(t1); + return new A.Chain(A.List_List$unmodifiable(new A.MappedListIterable(t1, t2._eval$1("Trace(1)")._as(new A.mapStackTrace_closure(sourceMap, false, packageMap, sdkRoot)), t2._eval$1("MappedListIterable<1,Trace>")), type$.Trace)); + } + t1 = A.Trace_Trace$from(stackTrace).get$frames(); + t2 = A._arrayInstanceType(t1); + return A.Trace$(new A.WhereTypeIterable(new A.MappedListIterable(t1, t2._eval$1("Frame?(1)")._as(new A.mapStackTrace_closure0(sourceMap, null, packageMap, false)), t2._eval$1("MappedListIterable<1,Frame?>")), type$.WhereTypeIterable_Frame), null); + }, + _prettifyMember(member) { + var t2, t3, t4, + t1 = A.RegExp_RegExp("/?<$", false); + t1 = A.stringReplaceAllUnchecked(member, t1, ""); + t2 = A.RegExp_RegExp("\\$\\d+(\\$[a-zA-Z_0-9]+)*$", false); + t3 = type$.String_Function_Match; + t4 = type$.nullable_String_Function_Match; + t2 = A.stringReplaceAllFuncUnchecked(A.stringReplaceAllUnchecked(t1, t2, ""), A.RegExp_RegExp("(_+)closure\\d*\\.call$", false), t4._as(t3._as(new A._prettifyMember_closure())), null); + t1 = A.RegExp_RegExp("\\.call$", false); + t1 = A.stringReplaceAllUnchecked(t2, t1, ""); + t2 = A.RegExp_RegExp("^dart\\.", false); + t1 = A.stringReplaceAllUnchecked(t1, t2, ""); + t2 = A.RegExp_RegExp("[a-zA-Z_0-9]+\\$", false); + t1 = A.stringReplaceAllUnchecked(t1, t2, ""); + t2 = A.RegExp_RegExp("^[a-zA-Z_0-9]+.(static|dart).", false); + return A.stringReplaceAllFuncUnchecked(A.stringReplaceAllUnchecked(t1, t2, ""), A.RegExp_RegExp("([a-zA-Z0-9]+)_", false), t4._as(t3._as(new A._prettifyMember_closure0())), null); + }, + mapStackTrace_closure: function mapStackTrace_closure(t0, t1, t2, t3) { + var _ = this; + _.sourceMap = t0; + _.minified = t1; + _.packageMap = t2; + _.sdkRoot = t3; + }, + mapStackTrace_closure0: function mapStackTrace_closure0(t0, t1, t2, t3) { + var _ = this; + _.sourceMap = t0; + _.sdkLib = t1; + _.packageMap = t2; + _.minified = t3; + }, + _prettifyMember_closure: function _prettifyMember_closure() { + }, + _prettifyMember_closure0: function _prettifyMember_closure0() { + }, + parseJson(map, mapUrl, otherMaps) { + var t1, t2, + _s8_ = "sections"; + if (!J.$eq$(map.$index(0, "version"), 3)) + throw A.wrapException(A.ArgumentError$("unexpected source map version: " + A.S(map.$index(0, "version")) + ". Only version 3 is supported.", null)); + if (map.containsKey$1(_s8_)) { + if (map.containsKey$1("mappings") || map.containsKey$1("sources") || map.containsKey$1("names")) + throw A.wrapException(A.FormatException$('map containing "sections" cannot contain "mappings", "sources", or "names".', null, null)); + t1 = type$.List_dynamic._as(map.$index(0, _s8_)); + t2 = type$.JSArray_int; + t2 = new A.MultiSectionMapping(A._setArrayType([], t2), A._setArrayType([], t2), A._setArrayType([], type$.JSArray_Mapping)); + t2.MultiSectionMapping$fromJson$3$mapUrl(t1, otherMaps, mapUrl); + return t2; + } + return A.SingleMapping$fromJson(map.cast$2$0(0, type$.String, type$.dynamic), mapUrl); + }, + SingleMapping$fromJson(map, mapUrl) { + var t8, + t1 = map._source, + t2 = map.$ti._eval$1("4?"), + t3 = A._asStringQ(t2._as(t1.$index(0, "file"))), + t4 = type$.List_dynamic, + t5 = type$.String, + t6 = A.List_List$from(t4._as(t2._as(t1.$index(0, "sources"))), true, t5), + t7 = type$.nullable_List_dynamic._as(t2._as(t1.$index(0, "names"))); + t7 = A.List_List$from(t7 == null ? [] : t7, true, t5); + t4 = A.List_List$filled(J.get$length$asx(t4._as(t2._as(t1.$index(0, "sources")))), null, false, type$.nullable_SourceFile); + t1 = A._asStringQ(t2._as(t1.$index(0, "sourceRoot"))); + t2 = A._setArrayType([], type$.JSArray_TargetLineEntry); + t8 = typeof mapUrl == "string" ? A.Uri_parse(mapUrl) : type$.nullable_Uri._as(mapUrl); + t5 = new A.SingleMapping(t6, t7, t4, t2, t3, t1, t8, A.LinkedHashMap_LinkedHashMap$_empty(t5, type$.dynamic)); + t5.SingleMapping$fromJson$2$mapUrl(map, mapUrl); + return t5; + }, + Mapping: function Mapping() { + }, + MultiSectionMapping: function MultiSectionMapping(t0, t1, t2) { + this._lineStart = t0; + this._columnStart = t1; + this._maps = t2; + }, + SingleMapping: function SingleMapping(t0, t1, t2, t3, t4, t5, t6, t7) { + var _ = this; + _.urls = t0; + _.names = t1; + _.files = t2; + _.lines = t3; + _.targetUrl = t4; + _.sourceRoot = t5; + _._mapUrl = t6; + _.extensions = t7; + }, + SingleMapping$fromJson_closure: function SingleMapping$fromJson_closure(t0) { + this.$this = t0; + }, + SingleMapping__findLine_closure: function SingleMapping__findLine_closure(t0) { + this.line = t0; + }, + SingleMapping__findColumn_closure: function SingleMapping__findColumn_closure(t0) { + this.column = t0; + }, + TargetLineEntry: function TargetLineEntry(t0, t1) { + this.line = t0; + this.entries = t1; + }, + TargetEntry: function TargetEntry(t0, t1, t2, t3, t4) { + var _ = this; + _.column = t0; + _.sourceUrlId = t1; + _.sourceLine = t2; + _.sourceColumn = t3; + _.sourceNameId = t4; + }, + _MappingTokenizer: function _MappingTokenizer(t0, t1) { + this._internal = t0; + this._parser$_length = t1; + this.index = -1; + }, + _TokenKind: function _TokenKind(t0, t1, t2) { + this.isNewLine = t0; + this.isNewSegment = t1; + this.isEof = t2; + }, + SourceMapSpan$(start, end, text, isIdentifier) { + var t1 = new A.SourceMapSpan(isIdentifier, start, end, text); + t1.SourceSpanBase$3(start, end, text); + return t1; + }, + SourceMapSpan: function SourceMapSpan(t0, t1, t2, t3) { + var _ = this; + _.isIdentifier = t0; + _.start = t1; + _.end = t2; + _.text = t3; + }, + decodeVlq(chars) { + var t1, result, $stop, shift, char, digit, result0, _null = null; + for (t1 = chars._parser$_length, result = 0, $stop = false, shift = 0; !$stop;) { + if (++chars.index >= t1) + throw A.wrapException(A.StateError$("incomplete VLQ value")); + char = chars.get$current(); + digit = $.$get$_digits().$index(0, char); + if (digit == null) + throw A.wrapException(A.FormatException$("invalid character in VLQ encoding: " + char, _null, _null)); + $stop = (digit & 32) === 0; + result += B.JSInt_methods._shlPositive$1(digit & 31, shift); + shift += 5; + } + result0 = result >>> 1; + result = (result & 1) === 1 ? -result0 : result0; + if (result < $.$get$minInt32() || result > $.$get$maxInt32()) + throw A.wrapException(A.FormatException$("expected an encoded 32 bit int, but we got: " + result, _null, _null)); + return result; + }, + _digits_closure: function _digits_closure() { + }, + SourceFile: function SourceFile(t0, t1, t2) { + var _ = this; + _.url = t0; + _._lineStarts = t1; + _._decodedChars = t2; + _._cachedLine = null; + }, + SourceLocation$(offset, column, line, sourceUrl) { + var t1 = typeof sourceUrl == "string" ? A.Uri_parse(sourceUrl) : type$.nullable_Uri._as(sourceUrl), + t2 = line == null, + t3 = t2 ? 0 : line, + t4 = column == null, + t5 = t4 ? offset : column; + if (offset < 0) + A.throwExpression(A.RangeError$("Offset may not be negative, was " + offset + ".")); + else if (!t2 && line < 0) + A.throwExpression(A.RangeError$("Line may not be negative, was " + A.S(line) + ".")); + else if (!t4 && column < 0) + A.throwExpression(A.RangeError$("Column may not be negative, was " + A.S(column) + ".")); + return new A.SourceLocation(t1, offset, t3, t5); + }, + SourceLocation: function SourceLocation(t0, t1, t2, t3) { + var _ = this; + _.sourceUrl = t0; + _.offset = t1; + _.line = t2; + _.column = t3; + }, + SourceSpanBase: function SourceSpanBase() { + }, + SourceSpanMixin: function SourceSpanMixin() { + }, + Chain_capture(callback, onError, $T) { + var _null = null, + spec = new A.StackZoneSpecification(new A.Expando(new WeakMap(), "stack chains", type$.Expando__Node), onError, true), + t1 = type$.nullable_Object; + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + t1.$indexSet(0, $.$get$_specKey(), spec); + t1.$indexSet(0, $.$get$StackZoneSpecification_disableKey(), false); + return A.runZoned(new A.Chain_capture_closure(callback, $T), new A._ZoneSpecification(spec.get$_handleUncaughtError(), _null, _null, _null, spec.get$_registerCallback(), spec.get$_registerUnaryCallback(), spec.get$_registerBinaryCallback(), spec.get$_errorCallback(), _null, _null, _null, _null, _null), t1, $T); + }, + Chain_Chain$parse(chain) { + var t1, t2, + _s51_ = string$.______; + if (chain.length === 0) + return new A.Chain(A.List_List$unmodifiable(A._setArrayType([], type$.JSArray_Trace), type$.Trace)); + t1 = $.$get$vmChainGap(); + if (B.JSString_methods.contains$1(chain, t1)) { + t1 = B.JSString_methods.split$1(chain, t1); + t2 = A._arrayInstanceType(t1); + return new A.Chain(A.List_List$unmodifiable(new A.MappedIterable(new A.WhereIterable(t1, t2._eval$1("bool(1)")._as(new A.Chain_Chain$parse_closure()), t2._eval$1("WhereIterable<1>")), t2._eval$1("Trace(1)")._as(A.trace_Trace___parseVM_tearOff$closure()), t2._eval$1("MappedIterable<1,Trace>")), type$.Trace)); + } + if (!B.JSString_methods.contains$1(chain, _s51_)) + return new A.Chain(A.List_List$unmodifiable(A._setArrayType([A.Trace_Trace$parse(chain)], type$.JSArray_Trace), type$.Trace)); + return new A.Chain(A.List_List$unmodifiable(new A.MappedListIterable(A._setArrayType(chain.split(_s51_), type$.JSArray_String), type$.Trace_Function_String._as(A.trace_Trace___parseFriendly_tearOff$closure()), type$.MappedListIterable_String_Trace), type$.Trace)); + }, + Chain: function Chain(t0) { + this.traces = t0; + }, + Chain_capture_closure: function Chain_capture_closure(t0, t1) { + this.callback = t0; + this.T = t1; + }, + Chain_Chain$parse_closure: function Chain_Chain$parse_closure() { + }, + Chain_toTrace_closure: function Chain_toTrace_closure() { + }, + Chain_toString_closure0: function Chain_toString_closure0() { + }, + Chain_toString__closure0: function Chain_toString__closure0() { + }, + Chain_toString_closure: function Chain_toString_closure(t0) { + this.longest = t0; + }, + Chain_toString__closure: function Chain_toString__closure(t0) { + this.longest = t0; + }, + Frame___parseVM_tearOff(frame) { + return A.Frame_Frame$parseVM(A._asString(frame)); + }, + Frame_Frame$parseVM(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$parseVM_closure(frame)); + }, + Frame___parseV8_tearOff(frame) { + return A.Frame_Frame$parseV8(A._asString(frame)); + }, + Frame_Frame$parseV8(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$parseV8_closure(frame)); + }, + Frame_Frame$_parseFirefoxEval(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$_parseFirefoxEval_closure(frame)); + }, + Frame___parseFirefox_tearOff(frame) { + return A.Frame_Frame$parseFirefox(A._asString(frame)); + }, + Frame_Frame$parseFirefox(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$parseFirefox_closure(frame)); + }, + Frame___parseFriendly_tearOff(frame) { + return A.Frame_Frame$parseFriendly(A._asString(frame)); + }, + Frame_Frame$parseFriendly(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$parseFriendly_closure(frame)); + }, + Frame__uriOrPathToUri(uriOrPath) { + if (B.JSString_methods.contains$1(uriOrPath, $.$get$Frame__uriRegExp())) + return A.Uri_parse(uriOrPath); + else if (B.JSString_methods.contains$1(uriOrPath, $.$get$Frame__windowsRegExp())) + return A._Uri__Uri$file(uriOrPath, true); + else if (B.JSString_methods.startsWith$1(uriOrPath, "/")) + return A._Uri__Uri$file(uriOrPath, false); + if (B.JSString_methods.contains$1(uriOrPath, "\\")) + return $.$get$windows().toUri$1(uriOrPath); + return A.Uri_parse(uriOrPath); + }, + Frame__catchFormatException(text, body) { + var t1, exception; + try { + t1 = body.call$0(); + return t1; + } catch (exception) { + if (A.unwrapException(exception) instanceof A.FormatException) + return new A.UnparsedFrame(A._Uri__Uri(null, "unparsed", null, null), text); + else + throw exception; + } + }, + Frame: function Frame(t0, t1, t2, t3) { + var _ = this; + _.uri = t0; + _.line = t1; + _.column = t2; + _.member = t3; + }, + Frame_Frame$parseVM_closure: function Frame_Frame$parseVM_closure(t0) { + this.frame = t0; + }, + Frame_Frame$parseV8_closure: function Frame_Frame$parseV8_closure(t0) { + this.frame = t0; + }, + Frame_Frame$parseV8_closure_parseLocation: function Frame_Frame$parseV8_closure_parseLocation(t0) { + this.frame = t0; + }, + Frame_Frame$_parseFirefoxEval_closure: function Frame_Frame$_parseFirefoxEval_closure(t0) { + this.frame = t0; + }, + Frame_Frame$parseFirefox_closure: function Frame_Frame$parseFirefox_closure(t0) { + this.frame = t0; + }, + Frame_Frame$parseFriendly_closure: function Frame_Frame$parseFriendly_closure(t0) { + this.frame = t0; + }, + LazyChain: function LazyChain(t0) { + this._lazy_chain$_thunk = t0; + this.__LazyChain__chain_FI = $; + }, + LazyTrace: function LazyTrace(t0) { + this._thunk = t0; + this.__LazyTrace__trace_FI = $; + }, + StackZoneSpecification: function StackZoneSpecification(t0, t1, t2) { + var _ = this; + _._chains = t0; + _._onError = t1; + _._currentNode = null; + _._errorZone = t2; + }, + StackZoneSpecification_chainFor_closure: function StackZoneSpecification_chainFor_closure(t0) { + this._box_0 = t0; + }, + StackZoneSpecification_chainFor_closure0: function StackZoneSpecification_chainFor_closure0(t0, t1) { + this.$this = t0; + this.original = t1; + }, + StackZoneSpecification__registerCallback_closure: function StackZoneSpecification__registerCallback_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.f = t1; + _.node = t2; + _.R = t3; + }, + StackZoneSpecification__registerUnaryCallback_closure: function StackZoneSpecification__registerUnaryCallback_closure(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.f = t1; + _.node = t2; + _.T = t3; + _.R = t4; + }, + StackZoneSpecification__registerUnaryCallback__closure: function StackZoneSpecification__registerUnaryCallback__closure(t0, t1, t2) { + this.f = t0; + this.arg = t1; + this.R = t2; + }, + StackZoneSpecification__registerBinaryCallback_closure: function StackZoneSpecification__registerBinaryCallback_closure(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.f = t1; + _.node = t2; + _.T1 = t3; + _.T2 = t4; + _.R = t5; + }, + StackZoneSpecification__registerBinaryCallback__closure: function StackZoneSpecification__registerBinaryCallback__closure(t0, t1, t2, t3) { + var _ = this; + _.f = t0; + _.arg1 = t1; + _.arg2 = t2; + _.R = t3; + }, + StackZoneSpecification__currentTrace_closure: function StackZoneSpecification__currentTrace_closure(t0, t1, t2) { + this.$this = t0; + this.stackTrace = t1; + this.level = t2; + }, + _Node: function _Node(t0, t1) { + this.trace = t0; + this.previous = t1; + }, + Trace_Trace$from(trace) { + if (type$.Trace._is(trace)) + return trace; + if (type$.Chain._is(trace)) + return trace.toTrace$0(); + return new A.LazyTrace(new A.Trace_Trace$from_closure(trace)); + }, + Trace_Trace$parse(trace) { + var error, t1, exception; + try { + if (trace.length === 0) { + t1 = A.Trace$(A._setArrayType([], type$.JSArray_Frame), null); + return t1; + } + if (B.JSString_methods.contains$1(trace, $.$get$_v8Trace())) { + t1 = A.Trace$parseV8(trace); + return t1; + } + if (B.JSString_methods.contains$1(trace, "\tat ")) { + t1 = A.Trace$parseJSCore(trace); + return t1; + } + if (B.JSString_methods.contains$1(trace, $.$get$_firefoxSafariTrace()) || B.JSString_methods.contains$1(trace, $.$get$_firefoxEvalTrace())) { + t1 = A.Trace$parseFirefox(trace); + return t1; + } + if (B.JSString_methods.contains$1(trace, string$.______)) { + t1 = A.Chain_Chain$parse(trace).toTrace$0(); + return t1; + } + if (B.JSString_methods.contains$1(trace, $.$get$_friendlyTrace())) { + t1 = A.Trace$parseFriendly(trace); + return t1; + } + t1 = A.Trace$parseVM(trace); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.FormatException) { + error = t1; + throw A.wrapException(A.FormatException$(error.message + "\nStack trace:\n" + trace, null, null)); + } else + throw exception; + } + }, + Trace___parseVM_tearOff(trace) { + return A.Trace$parseVM(A._asString(trace)); + }, + Trace$parseVM(trace) { + var t1 = A.List_List$unmodifiable(A.Trace__parseVM(trace), type$.Frame); + return new A.Trace(t1); + }, + Trace__parseVM(trace) { + var $frames, + t1 = B.JSString_methods.trim$0(trace), + t2 = $.$get$vmChainGap(), + t3 = type$.WhereIterable_String, + lines = new A.WhereIterable(A._setArrayType(A.stringReplaceAllUnchecked(t1, t2, "").split("\n"), type$.JSArray_String), type$.bool_Function_String._as(new A.Trace__parseVM_closure()), t3); + if (!lines.get$iterator(lines).moveNext$0()) + return A._setArrayType([], type$.JSArray_Frame); + t1 = A.TakeIterable_TakeIterable(lines, lines.get$length(lines) - 1, t3._eval$1("Iterable.E")); + t2 = A._instanceType(t1); + t2 = A.MappedIterable_MappedIterable(t1, t2._eval$1("Frame(Iterable.E)")._as(A.frame_Frame___parseVM_tearOff$closure()), t2._eval$1("Iterable.E"), type$.Frame); + $frames = A.List_List$of(t2, true, A._instanceType(t2)._eval$1("Iterable.E")); + if (!J.endsWith$1$s(lines.get$last(lines), ".da")) + B.JSArray_methods.add$1($frames, A.Frame_Frame$parseVM(lines.get$last(lines))); + return $frames; + }, + Trace$parseV8(trace) { + var t2, t3, + t1 = A.SubListIterable$(A._setArrayType(trace.split("\n"), type$.JSArray_String), 1, null, type$.String); + t1 = t1.super$Iterable$skipWhile(0, t1.$ti._eval$1("bool(ListIterable.E)")._as(new A.Trace$parseV8_closure())); + t2 = type$.Frame; + t3 = t1.$ti; + t2 = A.List_List$unmodifiable(A.MappedIterable_MappedIterable(t1, t3._eval$1("Frame(Iterable.E)")._as(A.frame_Frame___parseV8_tearOff$closure()), t3._eval$1("Iterable.E"), t2), t2); + return new A.Trace(t2); + }, + Trace$parseJSCore(trace) { + var t1 = A.List_List$unmodifiable(new A.MappedIterable(new A.WhereIterable(A._setArrayType(trace.split("\n"), type$.JSArray_String), type$.bool_Function_String._as(new A.Trace$parseJSCore_closure()), type$.WhereIterable_String), type$.Frame_Function_String._as(A.frame_Frame___parseV8_tearOff$closure()), type$.MappedIterable_String_Frame), type$.Frame); + return new A.Trace(t1); + }, + Trace$parseFirefox(trace) { + var t1 = A.List_List$unmodifiable(new A.MappedIterable(new A.WhereIterable(A._setArrayType(B.JSString_methods.trim$0(trace).split("\n"), type$.JSArray_String), type$.bool_Function_String._as(new A.Trace$parseFirefox_closure()), type$.WhereIterable_String), type$.Frame_Function_String._as(A.frame_Frame___parseFirefox_tearOff$closure()), type$.MappedIterable_String_Frame), type$.Frame); + return new A.Trace(t1); + }, + Trace___parseFriendly_tearOff(trace) { + return A.Trace$parseFriendly(A._asString(trace)); + }, + Trace$parseFriendly(trace) { + var t1 = trace.length === 0 ? A._setArrayType([], type$.JSArray_Frame) : new A.MappedIterable(new A.WhereIterable(A._setArrayType(B.JSString_methods.trim$0(trace).split("\n"), type$.JSArray_String), type$.bool_Function_String._as(new A.Trace$parseFriendly_closure()), type$.WhereIterable_String), type$.Frame_Function_String._as(A.frame_Frame___parseFriendly_tearOff$closure()), type$.MappedIterable_String_Frame); + t1 = A.List_List$unmodifiable(t1, type$.Frame); + return new A.Trace(t1); + }, + Trace$($frames, original) { + var t1 = A.List_List$unmodifiable($frames, type$.Frame); + return new A.Trace(t1); + }, + Trace: function Trace(t0) { + this.frames = t0; + }, + Trace_Trace$from_closure: function Trace_Trace$from_closure(t0) { + this.trace = t0; + }, + Trace__parseVM_closure: function Trace__parseVM_closure() { + }, + Trace$parseV8_closure: function Trace$parseV8_closure() { + }, + Trace$parseJSCore_closure: function Trace$parseJSCore_closure() { + }, + Trace$parseFirefox_closure: function Trace$parseFirefox_closure() { + }, + Trace$parseFriendly_closure: function Trace$parseFriendly_closure() { + }, + Trace_toString_closure0: function Trace_toString_closure0() { + }, + Trace_toString_closure: function Trace_toString_closure(t0) { + this.longest = t0; + }, + UnparsedFrame: function UnparsedFrame(t0, t1) { + this.uri = t0; + this.member = t1; + }, + main(args) { + return A.wrapMain(A.log_cw_metric__launch$closure()); + }, + launch() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, value, t1, t2, jobStatus, jobIdentifier, githubToken, repo, runId, isFailed, failingStep, metricName, testType, category, workflowName, framework, flutterDartChannel, dartVersion, flutterVersion, dartCompiler, platform, platformVersion; + var $async$launch = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = self; + t2 = type$.JSObject; + jobStatus = A.Core_getRequiredInput(t2._as(t1.core), "job-status"); + jobIdentifier = A.Core_getRequiredInput(t2._as(t1.core), "job-identifier"); + githubToken = A.Core_getRequiredInput(t2._as(t1.core), "github-token"); + repo = A.Core_getRequiredInput(t2._as(t1.core), "repo"); + runId = A.Core_getRequiredInput(t2._as(t1.core), "run-id"); + isFailed = jobStatus === "failure"; + $async$goto = isFailed ? 3 : 5; + break; + case 3: + // then + $async$goto = 6; + return A._asyncAwait(A.getFailingStep(jobIdentifier, githubToken, repo, runId), $async$launch); + case 6: + // returning from await. + // goto join + $async$goto = 4; + break; + case 5: + // else + $async$result = ""; + case 4: + // join + failingStep = $async$result; + metricName = A.Core_getRequiredInput(t2._as(t1.core), "metric-name"); + testType = A.Core_getRequiredInput(t2._as(t1.core), "test-type"); + category = A.Core_getRequiredInput(t2._as(t1.core), "category"); + workflowName = A.Core_getRequiredInput(t2._as(t1.core), "workflow-name"); + framework = A.Core_getInput(t2._as(t1.core), "framework"); + flutterDartChannel = A.Core_getInput(t2._as(t1.core), "flutter-dart-channel"); + dartVersion = A.Core_getInput(t2._as(t1.core), "dart-version"); + flutterVersion = A.Core_getInput(t2._as(t1.core), "flutter-version"); + dartCompiler = A.Core_getInput(t2._as(t1.core), "dart-compiler"); + platform = A.Core_getInput(t2._as(t1.core), "platform"); + platformVersion = A.Core_getInput(t2._as(t1.core), "platform-version"); + A.print("{\n metricName: " + metricName + ",\n isFailed: " + isFailed + ",\n testType: " + testType + ",\n category: " + category + ",\n workflowName: " + workflowName + ",\n framework: " + framework + ",\n flutterDartChannel: " + flutterDartChannel + ",\n dartVersion: " + dartVersion + ",\n flutterVersion: " + flutterVersion + ",\n dartCompiler: " + dartCompiler + ",\n platform: " + platform + ",\n platformVersion: " + platformVersion + ",\n failingStep: " + failingStep + ",\n }"); + value = isFailed ? "1" : "0"; + if (B.JSString_methods.contains$1(category, "/")) { + t1 = category.split("/"); + if (1 >= t1.length) { + $async$returnValue = A.ioore(t1, 1); + // goto return + $async$goto = 1; + break; + } + category = t1[1]; + } else if (B.JSString_methods.contains$1(category, "_")) { + t1 = category.split("_"); + if (1 >= t1.length) { + $async$returnValue = A.ioore(t1, 1); + // goto return + $async$goto = 1; + break; + } + category = t1[1]; + } + t1 = type$.String; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + t2.$indexSet(0, "testType", testType); + t2.$indexSet(0, "category", category); + t2.$indexSet(0, "workflowName", workflowName); + if (framework.length !== 0) + t2.$indexSet(0, "framework", framework); + if (flutterDartChannel.length !== 0) + t2.$indexSet(0, "flutterDartChannel", flutterDartChannel); + if (dartVersion.length !== 0) + t2.$indexSet(0, "dartVersion", dartVersion); + if (flutterVersion.length !== 0) + t2.$indexSet(0, "flutterVersion", flutterVersion); + if (dartCompiler.length !== 0) + t2.$indexSet(0, "dartCompiler", dartCompiler); + if (platform.length !== 0) + t2.$indexSet(0, "platform", platform); + if (platformVersion.length !== 0) + t2.$indexSet(0, "platformVersion", platformVersion); + if (failingStep.length !== 0) + t2.$indexSet(0, "failingStep", failingStep); + A.Process_runSync("aws", A._setArrayType(["cloudwatch", "put-metric-data", "--metric-name", metricName, "--namespace", "GithubCanaryApps", "--value", value, "--dimension", t2.get$entries().map$1$1(0, new A.launch_closure(), t1).join$1(0, ",")], type$.JSArray_String)); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$launch, $async$completer); + }, + getFailingStep(jobIdentifier, githubToken, repo, runId) { + return A.getFailingStep$body(jobIdentifier, githubToken, repo, runId); + }, + getFailingStep$body(jobIdentifier, githubToken, repo, runId) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, t1, headers; + var $async$getFailingStep = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.String; + headers = A.LinkedHashMap_LinkedHashMap$_literal(["Authorization", "token " + githubToken, "Accept", "application/vnd.github.v3+json"], t1, t1); + $async$goto = 3; + return A._asyncAwait(A.get(A.Uri_parse("https://api.github.com/repos/" + repo + "/actions/runs/" + runId + "/jobs"), headers), $async$getFailingStep); + case 3: + // returning from await. + $async$result.get$statusCode(); + A.print("Error fetching data from GitHub API."); + $async$returnValue = ""; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$getFailingStep, $async$completer); + }, + launch_closure: function launch_closure() { + }, + Client_Client() { + var t1, + client = $.Zone__current.$index(0, B.Symbol__clientToken); + if (client != null) + type$.Client_Function._as(client).call$0(); + t1 = A.createClient(); + return t1; + }, + printString(string) { + if (typeof dartPrint == "function") { + dartPrint(string); + return; + } + if (typeof console == "object" && typeof console.log != "undefined") { + console.log(string); + return; + } + if (typeof print == "function") { + print(string); + return; + } + throw "Unable to print message: " + String(string); + }, + max(a, b, $T) { + A.checkTypeBound($T, type$.num, "T", "max"); + return Math.max($T._as(a), $T._as(b)); + }, + pow(x, exponent) { + return Math.pow(x, exponent); + }, + Core_getInput(_this, $name) { + var inputValue = A._asString(_this.getInput($name)); + return inputValue.length === 0 ? "" : inputValue; + }, + Core_getRequiredInput(_this, $name) { + var inputValue = A._asString(_this.getInput($name)); + return inputValue.length === 0 ? A.throwExpression(A.StateError$('Input "' + $name + '" was required but no value was passed')) : inputValue; + }, + Core_withGroup(_this, $name, action, $R) { + return A.Core_withGroup$body(_this, $name, action, $R, $R); + }, + Core_withGroup$body(_this, $name, action, $R, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], t1; + var $async$Core_withGroup = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + _this.startGroup($name); + $async$handler = 3; + $async$goto = 6; + return A._asyncAwait(action.call$0(), $async$Core_withGroup); + case 6: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + $async$next = [1]; + // goto finally + $async$goto = 4; + break; + $async$next.push(5); + // goto finally + $async$goto = 4; + break; + case 3: + // uncaught + $async$next = [2]; + case 4: + // finally + $async$handler = 2; + _this.endGroup(); + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 5: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$Core_withGroup, $async$completer); + }, + Core_setFailed(_this, error) { + _this.setFailed(error); + type$.Never._as(type$.JSObject._as(self.process).exit(1)); + }, + createClient() { + return A.throwExpression(A.UnsupportedError$("Cannot create a client without dart:html or dart:io.")); + }, + current() { + var exception, t1, path, lastIndex, uri = null; + try { + uri = A.Uri_base(); + } catch (exception) { + if (type$.Exception._is(A.unwrapException(exception))) { + t1 = $._current; + if (t1 != null) + return t1; + throw exception; + } else + throw exception; + } + if (J.$eq$(uri, $._currentUriBase)) { + t1 = $._current; + t1.toString; + return t1; + } + $._currentUriBase = uri; + if ($.$get$Style_platform() === $.$get$Style_url()) + t1 = $._current = uri.resolve$1(".").toString$0(0); + else { + path = uri.toFilePath$0(); + lastIndex = path.length - 1; + t1 = $._current = lastIndex === 0 ? path : B.JSString_methods.substring$2(path, 0, lastIndex); + } + return t1; + }, + isAlphabetic(char) { + var t1; + if (!(char >= 65 && char <= 90)) + t1 = char >= 97 && char <= 122; + else + t1 = true; + return t1; + }, + isDriveLetter(path, index) { + var t3, + t1 = path.length, + t2 = index + 2; + if (t1 < t2) + return false; + if (!(index >= 0 && index < t1)) + return A.ioore(path, index); + if (!A.isAlphabetic(path.charCodeAt(index))) + return false; + t3 = index + 1; + if (!(t3 < t1)) + return A.ioore(path, t3); + if (path.charCodeAt(t3) !== 58) + return false; + if (t1 === t2) + return true; + if (!(t2 >= 0 && t2 < t1)) + return A.ioore(path, t2); + return path.charCodeAt(t2) === 47; + }, + binarySearch(list, matches, $T) { + var max, min, half; + if (list.length === 0) + return -1; + if (A.boolConversionCheck(matches.call$1(B.JSArray_methods.get$first(list)))) + return 0; + if (!A.boolConversionCheck(matches.call$1(B.JSArray_methods.get$last(list)))) + return list.length; + max = list.length - 1; + for (min = 0; min < max;) { + half = min + B.JSInt_methods._tdivFast$1(max - min, 2); + if (!(half >= 0 && half < list.length)) + return A.ioore(list, half); + if (A.boolConversionCheck(matches.call$1(list[half]))) + max = half; + else + min = half + 1; + } + return max; + } + }, + J = { + makeDispatchRecord(interceptor, proto, extension, indexability) { + return {i: interceptor, p: proto, e: extension, x: indexability}; + }, + getNativeInterceptor(object) { + var proto, objectProto, $constructor, interceptor, t1, + record = object[init.dispatchPropertyName]; + if (record == null) + if ($.initNativeDispatchFlag == null) { + A.initNativeDispatch(); + record = object[init.dispatchPropertyName]; + } + if (record != null) { + proto = record.p; + if (false === proto) + return record.i; + if (true === proto) + return object; + objectProto = Object.getPrototypeOf(object); + if (proto === objectProto) + return record.i; + if (record.e === objectProto) + throw A.wrapException(A.UnimplementedError$("Return interceptor for " + A.S(proto(object, record)))); + } + $constructor = object.constructor; + if ($constructor == null) + interceptor = null; + else { + t1 = $._JS_INTEROP_INTERCEPTOR_TAG; + if (t1 == null) + t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js"); + interceptor = $constructor[t1]; + } + if (interceptor != null) + return interceptor; + interceptor = A.lookupAndCacheInterceptor(object); + if (interceptor != null) + return interceptor; + if (typeof object == "function") + return B.JavaScriptFunction_methods; + proto = Object.getPrototypeOf(object); + if (proto == null) + return B.PlainJavaScriptObject_methods; + if (proto === Object.prototype) + return B.PlainJavaScriptObject_methods; + if (typeof $constructor == "function") { + t1 = $._JS_INTEROP_INTERCEPTOR_TAG; + if (t1 == null) + t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js"); + Object.defineProperty($constructor, t1, {value: B.UnknownJavaScriptObject_methods, enumerable: false, writable: true, configurable: true}); + return B.UnknownJavaScriptObject_methods; + } + return B.UnknownJavaScriptObject_methods; + }, + JSArray_JSArray$fixed($length, $E) { + if ($length < 0 || $length > 4294967295) + throw A.wrapException(A.RangeError$range($length, 0, 4294967295, "length", null)); + return J.JSArray_JSArray$markFixed(new Array($length), $E); + }, + JSArray_JSArray$growable($length, $E) { + if ($length < 0) + throw A.wrapException(A.ArgumentError$("Length must be a non-negative integer: " + $length, null)); + return A._setArrayType(new Array($length), $E._eval$1("JSArray<0>")); + }, + JSArray_JSArray$markFixed(allocation, $E) { + return J.JSArray_markFixedList(A._setArrayType(allocation, $E._eval$1("JSArray<0>")), $E); + }, + JSArray_markFixedList(list, $T) { + list.fixed$length = Array; + return list; + }, + JSString__isWhitespace(codeUnit) { + if (codeUnit < 256) + switch (codeUnit) { + case 9: + case 10: + case 11: + case 12: + case 13: + case 32: + case 133: + case 160: + return true; + default: + return false; + } + switch (codeUnit) { + case 5760: + case 8192: + case 8193: + case 8194: + case 8195: + case 8196: + case 8197: + case 8198: + case 8199: + case 8200: + case 8201: + case 8202: + case 8232: + case 8233: + case 8239: + case 8287: + case 12288: + case 65279: + return true; + default: + return false; + } + }, + JSString__skipLeadingWhitespace(string, index) { + var t1, codeUnit; + for (t1 = string.length; index < t1;) { + codeUnit = string.charCodeAt(index); + if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit)) + break; + ++index; + } + return index; + }, + JSString__skipTrailingWhitespace(string, index) { + var t1, index0, codeUnit; + for (t1 = string.length; index > 0; index = index0) { + index0 = index - 1; + if (!(index0 < t1)) + return A.ioore(string, index0); + codeUnit = string.charCodeAt(index0); + if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit)) + break; + } + return index; + }, + getInterceptor$(receiver) { + if (typeof receiver == "number") { + if (Math.floor(receiver) == receiver) + return J.JSInt.prototype; + return J.JSNumNotInt.prototype; + } + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return J.JSNull.prototype; + if (typeof receiver == "boolean") + return J.JSBool.prototype; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); + }, + getInterceptor$asx(receiver) { + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return receiver; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); + }, + getInterceptor$ax(receiver) { + if (receiver == null) + return receiver; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); + }, + getInterceptor$s(receiver) { + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return receiver; + if (!(receiver instanceof A.Object)) + return J.UnknownJavaScriptObject.prototype; + return receiver; + }, + get$hashCode$(receiver) { + return J.getInterceptor$(receiver).get$hashCode(receiver); + }, + get$isEmpty$asx(receiver) { + return J.getInterceptor$asx(receiver).get$isEmpty(receiver); + }, + get$iterator$ax(receiver) { + return J.getInterceptor$ax(receiver).get$iterator(receiver); + }, + get$length$asx(receiver) { + return J.getInterceptor$asx(receiver).get$length(receiver); + }, + get$runtimeType$(receiver) { + return J.getInterceptor$(receiver).get$runtimeType(receiver); + }, + $eq$(receiver, a0) { + if (receiver == null) + return a0 == null; + if (typeof receiver != "object") + return a0 != null && receiver === a0; + return J.getInterceptor$(receiver).$eq(receiver, a0); + }, + $index$asx(receiver, a0) { + if (typeof a0 === "number") + if (Array.isArray(receiver) || typeof receiver == "string" || A.isJsIndexable(receiver, receiver[init.dispatchPropertyName])) + if (a0 >>> 0 === a0 && a0 < receiver.length) + return receiver[a0]; + return J.getInterceptor$asx(receiver).$index(receiver, a0); + }, + $indexSet$ax(receiver, a0, a1) { + return J.getInterceptor$ax(receiver).$indexSet(receiver, a0, a1); + }, + allMatches$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).allMatches$1(receiver, a0); + }, + allMatches$2$s(receiver, a0, a1) { + return J.getInterceptor$s(receiver).allMatches$2(receiver, a0, a1); + }, + cast$1$0$ax(receiver, $T1) { + return J.getInterceptor$ax(receiver).cast$1$0(receiver, $T1); + }, + codeUnitAt$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).codeUnitAt$1(receiver, a0); + }, + contains$1$asx(receiver, a0) { + return J.getInterceptor$asx(receiver).contains$1(receiver, a0); + }, + elementAt$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).elementAt$1(receiver, a0); + }, + endsWith$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).endsWith$1(receiver, a0); + }, + matchAsPrefix$2$s(receiver, a0, a1) { + return J.getInterceptor$s(receiver).matchAsPrefix$2(receiver, a0, a1); + }, + skip$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).skip$1(receiver, a0); + }, + startsWith$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).startsWith$1(receiver, a0); + }, + toList$0$ax(receiver) { + return J.getInterceptor$ax(receiver).toList$0(receiver); + }, + toString$0$(receiver) { + return J.getInterceptor$(receiver).toString$0(receiver); + }, + Interceptor: function Interceptor() { + }, + JSBool: function JSBool() { + }, + JSNull: function JSNull() { + }, + JavaScriptObject: function JavaScriptObject() { + }, + LegacyJavaScriptObject: function LegacyJavaScriptObject() { + }, + PlainJavaScriptObject: function PlainJavaScriptObject() { + }, + UnknownJavaScriptObject: function UnknownJavaScriptObject() { + }, + JavaScriptFunction: function JavaScriptFunction() { + }, + JavaScriptBigInt: function JavaScriptBigInt() { + }, + JavaScriptSymbol: function JavaScriptSymbol() { + }, + JSArray: function JSArray(t0) { + this.$ti = t0; + }, + JSUnmodifiableArray: function JSUnmodifiableArray(t0) { + this.$ti = t0; + }, + ArrayIterator: function ArrayIterator(t0, t1, t2) { + var _ = this; + _._iterable = t0; + _._length = t1; + _._index = 0; + _._current = null; + _.$ti = t2; + }, + JSNumber: function JSNumber() { + }, + JSInt: function JSInt() { + }, + JSNumNotInt: function JSNumNotInt() { + }, + JSString: function JSString() { + } + }, + B = {}; + var holders = [A, J, B]; + var $ = {}; + A.JS_CONST.prototype = {}; + J.Interceptor.prototype = { + $eq(receiver, other) { + return receiver === other; + }, + get$hashCode(receiver) { + return A.Primitives_objectHashCode(receiver); + }, + toString$0(receiver) { + return "Instance of '" + A.Primitives_objectTypeName(receiver) + "'"; + }, + get$runtimeType(receiver) { + return A.createRuntimeType(A._instanceTypeFromConstructor(this)); + } + }; + J.JSBool.prototype = { + toString$0(receiver) { + return String(receiver); + }, + get$hashCode(receiver) { + return receiver ? 519018 : 218159; + }, + get$runtimeType(receiver) { + return A.createRuntimeType(type$.bool); + }, + $isTrustedGetRuntimeType: 1, + $isbool: 1 + }; + J.JSNull.prototype = { + $eq(receiver, other) { + return null == other; + }, + toString$0(receiver) { + return "null"; + }, + get$hashCode(receiver) { + return 0; + }, + $isTrustedGetRuntimeType: 1, + $isNull: 1 + }; + J.JavaScriptObject.prototype = {$isJSObject: 1}; + J.LegacyJavaScriptObject.prototype = { + get$hashCode(receiver) { + return 0; + }, + toString$0(receiver) { + return String(receiver); + } + }; + J.PlainJavaScriptObject.prototype = {}; + J.UnknownJavaScriptObject.prototype = {}; + J.JavaScriptFunction.prototype = { + toString$0(receiver) { + var dartClosure = receiver[$.$get$DART_CLOSURE_PROPERTY_NAME()]; + if (dartClosure == null) + return this.super$LegacyJavaScriptObject$toString(receiver); + return "JavaScript function for " + J.toString$0$(dartClosure); + }, + $isFunction: 1 + }; + J.JavaScriptBigInt.prototype = { + get$hashCode(receiver) { + return 0; + }, + toString$0(receiver) { + return String(receiver); + } + }; + J.JavaScriptSymbol.prototype = { + get$hashCode(receiver) { + return 0; + }, + toString$0(receiver) { + return String(receiver); + } + }; + J.JSArray.prototype = { + cast$1$0(receiver, $R) { + return new A.CastList(receiver, A._arrayInstanceType(receiver)._eval$1("@<1>")._bind$1($R)._eval$1("CastList<1,2>")); + }, + add$1(receiver, value) { + A._arrayInstanceType(receiver)._precomputed1._as(value); + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("add")); + receiver.push(value); + }, + removeAt$1(receiver, index) { + var t1; + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("removeAt")); + t1 = receiver.length; + if (index >= t1) + throw A.wrapException(A.RangeError$value(index, null)); + return receiver.splice(index, 1)[0]; + }, + insert$2(receiver, index, value) { + var t1; + A._arrayInstanceType(receiver)._precomputed1._as(value); + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("insert")); + t1 = receiver.length; + if (index > t1) + throw A.wrapException(A.RangeError$value(index, null)); + receiver.splice(index, 0, value); + }, + insertAll$2(receiver, index, iterable) { + var insertionLength, end; + A._arrayInstanceType(receiver)._eval$1("Iterable<1>")._as(iterable); + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("insertAll")); + A.RangeError_checkValueInInterval(index, 0, receiver.length, "index"); + if (!type$.EfficientLengthIterable_dynamic._is(iterable)) + iterable = J.toList$0$ax(iterable); + insertionLength = J.get$length$asx(iterable); + receiver.length = receiver.length + insertionLength; + end = index + insertionLength; + this.setRange$4(receiver, end, receiver.length, receiver, index); + this.setRange$3(receiver, index, end, iterable); + }, + removeLast$0(receiver) { + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("removeLast")); + if (receiver.length === 0) + throw A.wrapException(A.diagnoseIndexError(receiver, -1)); + return receiver.pop(); + }, + addAll$1(receiver, collection) { + var t1; + A._arrayInstanceType(receiver)._eval$1("Iterable<1>")._as(collection); + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("addAll")); + if (Array.isArray(collection)) { + this._addAllFromArray$1(receiver, collection); + return; + } + for (t1 = J.get$iterator$ax(collection); t1.moveNext$0();) + receiver.push(t1.get$current()); + }, + _addAllFromArray$1(receiver, array) { + var len, i; + type$.JSArray_dynamic._as(array); + len = array.length; + if (len === 0) + return; + if (receiver === array) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + for (i = 0; i < len; ++i) + receiver.push(array[i]); + }, + join$1(receiver, separator) { + var i, + list = A.List_List$filled(receiver.length, "", false, type$.String); + for (i = 0; i < receiver.length; ++i) + this.$indexSet(list, i, A.S(receiver[i])); + return list.join(separator); + }, + join$0($receiver) { + return this.join$1($receiver, ""); + }, + skip$1(receiver, n) { + return A.SubListIterable$(receiver, n, null, A._arrayInstanceType(receiver)._precomputed1); + }, + elementAt$1(receiver, index) { + if (!(index >= 0 && index < receiver.length)) + return A.ioore(receiver, index); + return receiver[index]; + }, + get$first(receiver) { + if (receiver.length > 0) + return receiver[0]; + throw A.wrapException(A.IterableElementError_noElement()); + }, + get$last(receiver) { + var t1 = receiver.length; + if (t1 > 0) + return receiver[t1 - 1]; + throw A.wrapException(A.IterableElementError_noElement()); + }, + setRange$4(receiver, start, end, iterable, skipCount) { + var $length, otherList, otherStart, t1, i; + A._arrayInstanceType(receiver)._eval$1("Iterable<1>")._as(iterable); + if (!!receiver.immutable$list) + A.throwExpression(A.UnsupportedError$("setRange")); + A.RangeError_checkValidRange(start, end, receiver.length); + $length = end - start; + if ($length === 0) + return; + A.RangeError_checkNotNegative(skipCount, "skipCount"); + if (type$.List_dynamic._is(iterable)) { + otherList = iterable; + otherStart = skipCount; + } else { + otherList = J.skip$1$ax(iterable, skipCount).toList$1$growable(0, false); + otherStart = 0; + } + t1 = J.getInterceptor$asx(otherList); + if (otherStart + $length > t1.get$length(otherList)) + throw A.wrapException(A.IterableElementError_tooFew()); + if (otherStart < start) + for (i = $length - 1; i >= 0; --i) + receiver[start + i] = t1.$index(otherList, otherStart + i); + else + for (i = 0; i < $length; ++i) + receiver[start + i] = t1.$index(otherList, otherStart + i); + }, + setRange$3($receiver, start, end, iterable) { + return this.setRange$4($receiver, start, end, iterable, 0); + }, + contains$1(receiver, other) { + var i; + for (i = 0; i < receiver.length; ++i) + if (J.$eq$(receiver[i], other)) + return true; + return false; + }, + get$isEmpty(receiver) { + return receiver.length === 0; + }, + toString$0(receiver) { + return A.Iterable_iterableToFullString(receiver, "[", "]"); + }, + toList$1$growable(receiver, growable) { + var t1 = A._setArrayType(receiver.slice(0), A._arrayInstanceType(receiver)); + return t1; + }, + toList$0($receiver) { + return this.toList$1$growable($receiver, true); + }, + get$iterator(receiver) { + return new J.ArrayIterator(receiver, receiver.length, A._arrayInstanceType(receiver)._eval$1("ArrayIterator<1>")); + }, + get$hashCode(receiver) { + return A.Primitives_objectHashCode(receiver); + }, + get$length(receiver) { + return receiver.length; + }, + $index(receiver, index) { + if (!(index >= 0 && index < receiver.length)) + throw A.wrapException(A.diagnoseIndexError(receiver, index)); + return receiver[index]; + }, + $indexSet(receiver, index, value) { + A._arrayInstanceType(receiver)._precomputed1._as(value); + if (!!receiver.immutable$list) + A.throwExpression(A.UnsupportedError$("indexed set")); + if (!(index >= 0 && index < receiver.length)) + throw A.wrapException(A.diagnoseIndexError(receiver, index)); + receiver[index] = value; + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + J.JSUnmodifiableArray.prototype = {}; + J.ArrayIterator.prototype = { + get$current() { + var t1 = this._current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var t2, _this = this, + t1 = _this._iterable, + $length = t1.length; + if (_this._length !== $length) { + t1 = A.throwConcurrentModificationError(t1); + throw A.wrapException(t1); + } + t2 = _this._index; + if (t2 >= $length) { + _this.set$_current(null); + return false; + } + _this.set$_current(t1[t2]); + ++_this._index; + return true; + }, + set$_current(_current) { + this._current = this.$ti._eval$1("1?")._as(_current); + }, + $isIterator: 1 + }; + J.JSNumber.prototype = { + toString$0(receiver) { + if (receiver === 0 && 1 / receiver < 0) + return "-0.0"; + else + return "" + receiver; + }, + get$hashCode(receiver) { + var absolute, floorLog2, factor, scaled, + intValue = receiver | 0; + if (receiver === intValue) + return intValue & 536870911; + absolute = Math.abs(receiver); + floorLog2 = Math.log(absolute) / 0.6931471805599453 | 0; + factor = Math.pow(2, floorLog2); + scaled = absolute < 1 ? absolute / factor : factor / absolute; + return ((scaled * 9007199254740992 | 0) + (scaled * 3542243181176521 | 0)) * 599197 + floorLog2 * 1259 & 536870911; + }, + $mod(receiver, other) { + var result = receiver % other; + if (result === 0) + return 0; + if (result > 0) + return result; + return result + other; + }, + $tdiv(receiver, other) { + if ((receiver | 0) === receiver) + if (other >= 1 || false) + return receiver / other | 0; + return this._tdivSlow$1(receiver, other); + }, + _tdivFast$1(receiver, other) { + return (receiver | 0) === receiver ? receiver / other | 0 : this._tdivSlow$1(receiver, other); + }, + _tdivSlow$1(receiver, other) { + var quotient = receiver / other; + if (quotient >= -2147483648 && quotient <= 2147483647) + return quotient | 0; + if (quotient > 0) { + if (quotient !== 1 / 0) + return Math.floor(quotient); + } else if (quotient > -1 / 0) + return Math.ceil(quotient); + throw A.wrapException(A.UnsupportedError$("Result of truncating division is " + A.S(quotient) + ": " + A.S(receiver) + " ~/ " + other)); + }, + _shlPositive$1(receiver, other) { + return other > 31 ? 0 : receiver << other >>> 0; + }, + _shrOtherPositive$1(receiver, other) { + var t1; + if (receiver > 0) + t1 = this._shrBothPositive$1(receiver, other); + else { + t1 = other > 31 ? 31 : other; + t1 = receiver >> t1 >>> 0; + } + return t1; + }, + _shrReceiverPositive$1(receiver, other) { + if (0 > other) + throw A.wrapException(A.argumentErrorValue(other)); + return this._shrBothPositive$1(receiver, other); + }, + _shrBothPositive$1(receiver, other) { + return other > 31 ? 0 : receiver >>> other; + }, + get$runtimeType(receiver) { + return A.createRuntimeType(type$.num); + }, + $isdouble: 1, + $isnum: 1 + }; + J.JSInt.prototype = { + get$runtimeType(receiver) { + return A.createRuntimeType(type$.int); + }, + $isTrustedGetRuntimeType: 1, + $isint: 1 + }; + J.JSNumNotInt.prototype = { + get$runtimeType(receiver) { + return A.createRuntimeType(type$.double); + }, + $isTrustedGetRuntimeType: 1 + }; + J.JSString.prototype = { + codeUnitAt$1(receiver, index) { + if (index < 0) + throw A.wrapException(A.diagnoseIndexError(receiver, index)); + if (index >= receiver.length) + A.throwExpression(A.diagnoseIndexError(receiver, index)); + return receiver.charCodeAt(index); + }, + allMatches$2(receiver, string, start) { + var t1 = string.length; + if (start > t1) + throw A.wrapException(A.RangeError$range(start, 0, t1, null, null)); + return new A._StringAllMatchesIterable(string, receiver, start); + }, + allMatches$1($receiver, string) { + return this.allMatches$2($receiver, string, 0); + }, + matchAsPrefix$2(receiver, string, start) { + var t1, t2, i, t3, _null = null; + if (start < 0 || start > string.length) + throw A.wrapException(A.RangeError$range(start, 0, string.length, _null, _null)); + t1 = receiver.length; + t2 = string.length; + if (start + t1 > t2) + return _null; + for (i = 0; i < t1; ++i) { + t3 = start + i; + if (!(t3 >= 0 && t3 < t2)) + return A.ioore(string, t3); + if (string.charCodeAt(t3) !== receiver.charCodeAt(i)) + return _null; + } + return new A.StringMatch(start, receiver); + }, + $add(receiver, other) { + return receiver + other; + }, + endsWith$1(receiver, other) { + var otherLength = other.length, + t1 = receiver.length; + if (otherLength > t1) + return false; + return other === this.substring$1(receiver, t1 - otherLength); + }, + replaceFirst$2(receiver, from, to) { + A.RangeError_checkValueInInterval(0, 0, receiver.length, "startIndex"); + return A.stringReplaceFirstUnchecked(receiver, from, to, 0); + }, + split$1(receiver, pattern) { + if (typeof pattern == "string") + return A._setArrayType(receiver.split(pattern), type$.JSArray_String); + else if (pattern instanceof A.JSSyntaxRegExp && pattern.get$_nativeAnchoredVersion().exec("").length - 2 === 0) + return A._setArrayType(receiver.split(pattern._nativeRegExp), type$.JSArray_String); + else + return this._defaultSplit$1(receiver, pattern); + }, + replaceRange$3(receiver, start, end, replacement) { + var e = A.RangeError_checkValidRange(start, end, receiver.length); + return A.stringReplaceRangeUnchecked(receiver, start, e, replacement); + }, + _defaultSplit$1(receiver, pattern) { + var t1, start, $length, match, matchStart, matchEnd, + result = A._setArrayType([], type$.JSArray_String); + for (t1 = J.allMatches$1$s(pattern, receiver), t1 = t1.get$iterator(t1), start = 0, $length = 1; t1.moveNext$0();) { + match = t1.get$current(); + matchStart = match.get$start(); + matchEnd = match.get$end(); + $length = matchEnd - matchStart; + if ($length === 0 && start === matchStart) + continue; + B.JSArray_methods.add$1(result, this.substring$2(receiver, start, matchStart)); + start = matchEnd; + } + if (start < receiver.length || $length > 0) + B.JSArray_methods.add$1(result, this.substring$1(receiver, start)); + return result; + }, + startsWith$2(receiver, pattern, index) { + var endIndex; + if (index < 0 || index > receiver.length) + throw A.wrapException(A.RangeError$range(index, 0, receiver.length, null, null)); + if (typeof pattern == "string") { + endIndex = index + pattern.length; + if (endIndex > receiver.length) + return false; + return pattern === receiver.substring(index, endIndex); + } + return J.matchAsPrefix$2$s(pattern, receiver, index) != null; + }, + startsWith$1($receiver, pattern) { + return this.startsWith$2($receiver, pattern, 0); + }, + substring$2(receiver, start, end) { + return receiver.substring(start, A.RangeError_checkValidRange(start, end, receiver.length)); + }, + substring$1($receiver, start) { + return this.substring$2($receiver, start, null); + }, + trim$0(receiver) { + var startIndex, t1, endIndex0, + result = receiver.trim(), + endIndex = result.length; + if (endIndex === 0) + return result; + if (0 >= endIndex) + return A.ioore(result, 0); + if (result.charCodeAt(0) === 133) { + startIndex = J.JSString__skipLeadingWhitespace(result, 1); + if (startIndex === endIndex) + return ""; + } else + startIndex = 0; + t1 = endIndex - 1; + if (!(t1 >= 0)) + return A.ioore(result, t1); + endIndex0 = result.charCodeAt(t1) === 133 ? J.JSString__skipTrailingWhitespace(result, t1) : endIndex; + if (startIndex === 0 && endIndex0 === endIndex) + return result; + return result.substring(startIndex, endIndex0); + }, + $mul(receiver, times) { + var s, result; + if (0 >= times) + return ""; + if (times === 1 || receiver.length === 0) + return receiver; + if (times !== times >>> 0) + throw A.wrapException(B.C_OutOfMemoryError); + for (s = receiver, result = ""; true;) { + if ((times & 1) === 1) + result = s + result; + times = times >>> 1; + if (times === 0) + break; + s += s; + } + return result; + }, + padLeft$2(receiver, width, padding) { + var delta = width - receiver.length; + if (delta <= 0) + return receiver; + return this.$mul(padding, delta) + receiver; + }, + padRight$1(receiver, width) { + var delta = width - receiver.length; + if (delta <= 0) + return receiver; + return receiver + this.$mul(" ", delta); + }, + indexOf$2(receiver, pattern, start) { + var match, t1, t2, i; + if (start < 0 || start > receiver.length) + throw A.wrapException(A.RangeError$range(start, 0, receiver.length, null, null)); + if (typeof pattern == "string") + return receiver.indexOf(pattern, start); + if (pattern instanceof A.JSSyntaxRegExp) { + match = pattern._execGlobal$2(receiver, start); + return match == null ? -1 : match._match.index; + } + for (t1 = receiver.length, t2 = J.getInterceptor$s(pattern), i = start; i <= t1; ++i) + if (t2.matchAsPrefix$2(pattern, receiver, i) != null) + return i; + return -1; + }, + indexOf$1($receiver, pattern) { + return this.indexOf$2($receiver, pattern, 0); + }, + lastIndexOf$2(receiver, pattern, start) { + var t1, t2; + if (start == null) + start = receiver.length; + else if (start < 0 || start > receiver.length) + throw A.wrapException(A.RangeError$range(start, 0, receiver.length, null, null)); + t1 = pattern.length; + t2 = receiver.length; + if (start + t1 > t2) + start = t2 - t1; + return receiver.lastIndexOf(pattern, start); + }, + lastIndexOf$1($receiver, pattern) { + return this.lastIndexOf$2($receiver, pattern, null); + }, + contains$1(receiver, other) { + return A.stringContainsUnchecked(receiver, other, 0); + }, + toString$0(receiver) { + return receiver; + }, + get$hashCode(receiver) { + var t1, hash, i; + for (t1 = receiver.length, hash = 0, i = 0; i < t1; ++i) { + hash = hash + receiver.charCodeAt(i) & 536870911; + hash = hash + ((hash & 524287) << 10) & 536870911; + hash ^= hash >> 6; + } + hash = hash + ((hash & 67108863) << 3) & 536870911; + hash ^= hash >> 11; + return hash + ((hash & 16383) << 15) & 536870911; + }, + get$runtimeType(receiver) { + return A.createRuntimeType(type$.String); + }, + get$length(receiver) { + return receiver.length; + }, + $isTrustedGetRuntimeType: 1, + $isPattern: 1, + $isString: 1 + }; + A._CastIterableBase.prototype = { + get$iterator(_) { + var t1 = A._instanceType(this); + return new A.CastIterator(J.get$iterator$ax(this.get$_source()), t1._eval$1("@<1>")._bind$1(t1._rest[1])._eval$1("CastIterator<1,2>")); + }, + get$length(_) { + return J.get$length$asx(this.get$_source()); + }, + get$isEmpty(_) { + return J.get$isEmpty$asx(this.get$_source()); + }, + skip$1(_, count) { + var t1 = A._instanceType(this); + return A.CastIterable_CastIterable(J.skip$1$ax(this.get$_source(), count), t1._precomputed1, t1._rest[1]); + }, + elementAt$1(_, index) { + return A._instanceType(this)._rest[1]._as(J.elementAt$1$ax(this.get$_source(), index)); + }, + contains$1(_, other) { + return J.contains$1$asx(this.get$_source(), other); + }, + toString$0(_) { + return J.toString$0$(this.get$_source()); + } + }; + A.CastIterator.prototype = { + moveNext$0() { + return this._source.moveNext$0(); + }, + get$current() { + return this.$ti._rest[1]._as(this._source.get$current()); + }, + $isIterator: 1 + }; + A.CastIterable.prototype = { + get$_source() { + return this._source; + } + }; + A._EfficientLengthCastIterable.prototype = {$isEfficientLengthIterable: 1}; + A._CastListBase.prototype = { + $index(_, index) { + return this.$ti._rest[1]._as(J.$index$asx(this._source, index)); + }, + $indexSet(_, index, value) { + var t1 = this.$ti; + J.$indexSet$ax(this._source, index, t1._precomputed1._as(t1._rest[1]._as(value))); + }, + $isEfficientLengthIterable: 1, + $isList: 1 + }; + A.CastList.prototype = { + cast$1$0(_, $R) { + return new A.CastList(this._source, this.$ti._eval$1("@<1>")._bind$1($R)._eval$1("CastList<1,2>")); + }, + get$_source() { + return this._source; + } + }; + A.CastMap.prototype = { + cast$2$0(_, RK, RV) { + var t1 = this.$ti; + return new A.CastMap(this._source, t1._eval$1("@<1>")._bind$1(t1._rest[1])._bind$1(RK)._bind$1(RV)._eval$1("CastMap<1,2,3,4>")); + }, + containsKey$1(key) { + return this._source.containsKey$1(key); + }, + $index(_, key) { + return this.$ti._eval$1("4?")._as(this._source.$index(0, key)); + }, + forEach$1(_, f) { + this._source.forEach$1(0, new A.CastMap_forEach_closure(this, this.$ti._eval$1("~(3,4)")._as(f))); + }, + get$keys(_) { + var t1 = this._source, + t2 = this.$ti; + return A.CastIterable_CastIterable(t1.get$keys(t1), t2._precomputed1, t2._rest[2]); + }, + get$length(_) { + var t1 = this._source; + return t1.get$length(t1); + } + }; + A.CastMap_forEach_closure.prototype = { + call$2(key, value) { + var t1 = this.$this.$ti; + t1._precomputed1._as(key); + t1._rest[1]._as(value); + this.f.call$2(t1._rest[2]._as(key), t1._rest[3]._as(value)); + }, + $signature() { + return this.$this.$ti._eval$1("~(1,2)"); + } + }; + A.LateError.prototype = { + toString$0(_) { + return "LateInitializationError: " + this._message; + } + }; + A.CodeUnits.prototype = { + get$length(_) { + return this.__internal$_string.length; + }, + $index(_, i) { + var t1 = this.__internal$_string; + if (!(i >= 0 && i < t1.length)) + return A.ioore(t1, i); + return t1.charCodeAt(i); + } + }; + A.SentinelValue.prototype = {}; + A.EfficientLengthIterable.prototype = {}; + A.ListIterable.prototype = { + get$iterator(_) { + var _this = this; + return new A.ListIterator(_this, _this.get$length(_this), A._instanceType(_this)._eval$1("ListIterator")); + }, + get$isEmpty(_) { + return this.get$length(this) === 0; + }, + contains$1(_, element) { + var i, _this = this, + $length = _this.get$length(_this); + for (i = 0; i < $length; ++i) { + if (J.$eq$(_this.elementAt$1(0, i), element)) + return true; + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return false; + }, + join$1(_, separator) { + var first, t1, i, _this = this, + $length = _this.get$length(_this); + if (separator.length !== 0) { + if ($length === 0) + return ""; + first = A.S(_this.elementAt$1(0, 0)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + for (t1 = first, i = 1; i < $length; ++i) { + t1 = t1 + separator + A.S(_this.elementAt$1(0, i)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return t1.charCodeAt(0) == 0 ? t1 : t1; + } else { + for (i = 0, t1 = ""; i < $length; ++i) { + t1 += A.S(_this.elementAt$1(0, i)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }, + join$0($receiver) { + return this.join$1($receiver, ""); + }, + map$1$1(_, toElement, $T) { + var t1 = A._instanceType(this); + return new A.MappedListIterable(this, t1._bind$1($T)._eval$1("1(ListIterable.E)")._as(toElement), t1._eval$1("@")._bind$1($T)._eval$1("MappedListIterable<1,2>")); + }, + fold$1$2(_, initialValue, combine, $T) { + var $length, value, i, _this = this; + $T._as(initialValue); + A._instanceType(_this)._bind$1($T)._eval$1("1(1,ListIterable.E)")._as(combine); + $length = _this.get$length(_this); + for (value = initialValue, i = 0; i < $length; ++i) { + value = combine.call$2(value, _this.elementAt$1(0, i)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return value; + }, + skip$1(_, count) { + return A.SubListIterable$(this, count, null, A._instanceType(this)._eval$1("ListIterable.E")); + } + }; + A.SubListIterable.prototype = { + SubListIterable$3(_iterable, _start, _endOrLength, $E) { + var endOrLength, + t1 = this.__internal$_start; + A.RangeError_checkNotNegative(t1, "start"); + endOrLength = this._endOrLength; + if (endOrLength != null) { + A.RangeError_checkNotNegative(endOrLength, "end"); + if (t1 > endOrLength) + throw A.wrapException(A.RangeError$range(t1, 0, endOrLength, "start", null)); + } + }, + get$_endIndex() { + var $length = J.get$length$asx(this.__internal$_iterable), + endOrLength = this._endOrLength; + if (endOrLength == null || endOrLength > $length) + return $length; + return endOrLength; + }, + get$_startIndex() { + var $length = J.get$length$asx(this.__internal$_iterable), + t1 = this.__internal$_start; + if (t1 > $length) + return $length; + return t1; + }, + get$length(_) { + var endOrLength, + $length = J.get$length$asx(this.__internal$_iterable), + t1 = this.__internal$_start; + if (t1 >= $length) + return 0; + endOrLength = this._endOrLength; + if (endOrLength == null || endOrLength >= $length) + return $length - t1; + if (typeof endOrLength !== "number") + return endOrLength.$sub(); + return endOrLength - t1; + }, + elementAt$1(_, index) { + var _this = this, + realIndex = _this.get$_startIndex() + index; + if (index < 0 || realIndex >= _this.get$_endIndex()) + throw A.wrapException(A.IndexError$withLength(index, _this.get$length(_this), _this, "index")); + return J.elementAt$1$ax(_this.__internal$_iterable, realIndex); + }, + skip$1(_, count) { + var newStart, endOrLength, _this = this; + A.RangeError_checkNotNegative(count, "count"); + newStart = _this.__internal$_start + count; + endOrLength = _this._endOrLength; + if (endOrLength != null && newStart >= endOrLength) + return new A.EmptyIterable(_this.$ti._eval$1("EmptyIterable<1>")); + return A.SubListIterable$(_this.__internal$_iterable, newStart, endOrLength, _this.$ti._precomputed1); + }, + toList$1$growable(_, growable) { + var $length, result, i, _this = this, + start = _this.__internal$_start, + t1 = _this.__internal$_iterable, + t2 = J.getInterceptor$asx(t1), + end = t2.get$length(t1), + endOrLength = _this._endOrLength; + if (endOrLength != null && endOrLength < end) + end = endOrLength; + $length = end - start; + if ($length <= 0) { + t1 = J.JSArray_JSArray$fixed(0, _this.$ti._precomputed1); + return t1; + } + result = A.List_List$filled($length, t2.elementAt$1(t1, start), false, _this.$ti._precomputed1); + for (i = 1; i < $length; ++i) { + B.JSArray_methods.$indexSet(result, i, t2.elementAt$1(t1, start + i)); + if (t2.get$length(t1) < end) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return result; + } + }; + A.ListIterator.prototype = { + get$current() { + var t1 = this.__internal$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var t3, _this = this, + t1 = _this.__internal$_iterable, + t2 = J.getInterceptor$asx(t1), + $length = t2.get$length(t1); + if (_this.__internal$_length !== $length) + throw A.wrapException(A.ConcurrentModificationError$(t1)); + t3 = _this.__internal$_index; + if (t3 >= $length) { + _this.set$__internal$_current(null); + return false; + } + _this.set$__internal$_current(t2.elementAt$1(t1, t3)); + ++_this.__internal$_index; + return true; + }, + set$__internal$_current(_current) { + this.__internal$_current = this.$ti._eval$1("1?")._as(_current); + }, + $isIterator: 1 + }; + A.MappedIterable.prototype = { + get$iterator(_) { + var t1 = this.__internal$_iterable, + t2 = A._instanceType(this); + return new A.MappedIterator(t1.get$iterator(t1), this._f, t2._eval$1("@<1>")._bind$1(t2._rest[1])._eval$1("MappedIterator<1,2>")); + }, + get$length(_) { + var t1 = this.__internal$_iterable; + return t1.get$length(t1); + }, + get$isEmpty(_) { + var t1 = this.__internal$_iterable; + return t1.get$isEmpty(t1); + }, + elementAt$1(_, index) { + var t1 = this.__internal$_iterable; + return this._f.call$1(t1.elementAt$1(t1, index)); + } + }; + A.EfficientLengthMappedIterable.prototype = {$isEfficientLengthIterable: 1}; + A.MappedIterator.prototype = { + moveNext$0() { + var _this = this, + t1 = _this._iterator; + if (t1.moveNext$0()) { + _this.set$__internal$_current(_this._f.call$1(t1.get$current())); + return true; + } + _this.set$__internal$_current(null); + return false; + }, + get$current() { + var t1 = this.__internal$_current; + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + }, + set$__internal$_current(_current) { + this.__internal$_current = this.$ti._eval$1("2?")._as(_current); + }, + $isIterator: 1 + }; + A.MappedListIterable.prototype = { + get$length(_) { + return J.get$length$asx(this._source); + }, + elementAt$1(_, index) { + return this._f.call$1(J.elementAt$1$ax(this._source, index)); + } + }; + A.WhereIterable.prototype = { + get$iterator(_) { + return new A.WhereIterator(J.get$iterator$ax(this.__internal$_iterable), this._f, this.$ti._eval$1("WhereIterator<1>")); + } + }; + A.WhereIterator.prototype = { + moveNext$0() { + var t1, t2; + for (t1 = this._iterator, t2 = this._f; t1.moveNext$0();) + if (A.boolConversionCheck(t2.call$1(t1.get$current()))) + return true; + return false; + }, + get$current() { + return this._iterator.get$current(); + }, + $isIterator: 1 + }; + A.ExpandIterable.prototype = { + get$iterator(_) { + var t1 = this.$ti; + return new A.ExpandIterator(J.get$iterator$ax(this.__internal$_iterable), this._f, B.C_EmptyIterator, t1._eval$1("@<1>")._bind$1(t1._rest[1])._eval$1("ExpandIterator<1,2>")); + } + }; + A.ExpandIterator.prototype = { + get$current() { + var t1 = this.__internal$_current; + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + }, + moveNext$0() { + var t1, t2, _this = this; + if (_this._currentExpansion == null) + return false; + for (t1 = _this._iterator, t2 = _this._f; !_this._currentExpansion.moveNext$0();) { + _this.set$__internal$_current(null); + if (t1.moveNext$0()) { + _this.set$_currentExpansion(null); + _this.set$_currentExpansion(J.get$iterator$ax(t2.call$1(t1.get$current()))); + } else + return false; + } + _this.set$__internal$_current(_this._currentExpansion.get$current()); + return true; + }, + set$_currentExpansion(_currentExpansion) { + this._currentExpansion = this.$ti._eval$1("Iterator<2>?")._as(_currentExpansion); + }, + set$__internal$_current(_current) { + this.__internal$_current = this.$ti._eval$1("2?")._as(_current); + }, + $isIterator: 1 + }; + A.TakeIterable.prototype = { + get$iterator(_) { + var t1 = this.__internal$_iterable; + return new A.TakeIterator(t1.get$iterator(t1), this._takeCount, A._instanceType(this)._eval$1("TakeIterator<1>")); + } + }; + A.EfficientLengthTakeIterable.prototype = { + get$length(_) { + var t1 = this.__internal$_iterable, + iterableLength = t1.get$length(t1); + t1 = this._takeCount; + if (iterableLength > t1) + return t1; + return iterableLength; + }, + $isEfficientLengthIterable: 1 + }; + A.TakeIterator.prototype = { + moveNext$0() { + if (--this._remaining >= 0) + return this._iterator.moveNext$0(); + this._remaining = -1; + return false; + }, + get$current() { + if (this._remaining < 0) { + this.$ti._precomputed1._as(null); + return null; + } + return this._iterator.get$current(); + }, + $isIterator: 1 + }; + A.SkipIterable.prototype = { + skip$1(_, count) { + A.ArgumentError_checkNotNull(count, "count", type$.int); + A.RangeError_checkNotNegative(count, "count"); + return new A.SkipIterable(this.__internal$_iterable, this._skipCount + count, A._instanceType(this)._eval$1("SkipIterable<1>")); + }, + get$iterator(_) { + var t1 = this.__internal$_iterable; + return new A.SkipIterator(t1.get$iterator(t1), this._skipCount, A._instanceType(this)._eval$1("SkipIterator<1>")); + } + }; + A.EfficientLengthSkipIterable.prototype = { + get$length(_) { + var t1 = this.__internal$_iterable, + $length = t1.get$length(t1) - this._skipCount; + if ($length >= 0) + return $length; + return 0; + }, + skip$1(_, count) { + A.ArgumentError_checkNotNull(count, "count", type$.int); + A.RangeError_checkNotNegative(count, "count"); + return new A.EfficientLengthSkipIterable(this.__internal$_iterable, this._skipCount + count, this.$ti); + }, + $isEfficientLengthIterable: 1 + }; + A.SkipIterator.prototype = { + moveNext$0() { + var t1, i; + for (t1 = this._iterator, i = 0; i < this._skipCount; ++i) + t1.moveNext$0(); + this._skipCount = 0; + return t1.moveNext$0(); + }, + get$current() { + return this._iterator.get$current(); + }, + $isIterator: 1 + }; + A.SkipWhileIterable.prototype = { + get$iterator(_) { + return new A.SkipWhileIterator(J.get$iterator$ax(this.__internal$_iterable), this._f, this.$ti._eval$1("SkipWhileIterator<1>")); + } + }; + A.SkipWhileIterator.prototype = { + moveNext$0() { + var t1, t2, _this = this; + if (!_this._hasSkipped) { + _this._hasSkipped = true; + for (t1 = _this._iterator, t2 = _this._f; t1.moveNext$0();) + if (!A.boolConversionCheck(t2.call$1(t1.get$current()))) + return true; + } + return _this._iterator.moveNext$0(); + }, + get$current() { + return this._iterator.get$current(); + }, + $isIterator: 1 + }; + A.EmptyIterable.prototype = { + get$iterator(_) { + return B.C_EmptyIterator; + }, + get$isEmpty(_) { + return true; + }, + get$length(_) { + return 0; + }, + elementAt$1(_, index) { + throw A.wrapException(A.RangeError$range(index, 0, 0, "index", null)); + }, + contains$1(_, element) { + return false; + }, + skip$1(_, count) { + A.RangeError_checkNotNegative(count, "count"); + return this; + } + }; + A.EmptyIterator.prototype = { + moveNext$0() { + return false; + }, + get$current() { + throw A.wrapException(A.IterableElementError_noElement()); + }, + $isIterator: 1 + }; + A.WhereTypeIterable.prototype = { + get$iterator(_) { + return new A.WhereTypeIterator(J.get$iterator$ax(this._source), this.$ti._eval$1("WhereTypeIterator<1>")); + } + }; + A.WhereTypeIterator.prototype = { + moveNext$0() { + var t1, t2; + for (t1 = this._source, t2 = this.$ti._precomputed1; t1.moveNext$0();) + if (t2._is(t1.get$current())) + return true; + return false; + }, + get$current() { + return this.$ti._precomputed1._as(this._source.get$current()); + }, + $isIterator: 1 + }; + A.FixedLengthListMixin.prototype = {}; + A.UnmodifiableListMixin.prototype = { + $indexSet(_, index, value) { + A._instanceType(this)._eval$1("UnmodifiableListMixin.E")._as(value); + throw A.wrapException(A.UnsupportedError$("Cannot modify an unmodifiable list")); + } + }; + A.UnmodifiableListBase.prototype = {}; + A.Symbol.prototype = { + get$hashCode(_) { + var hash = this._hashCode; + if (hash != null) + return hash; + hash = 664597 * B.JSString_methods.get$hashCode(this._name) & 536870911; + this._hashCode = hash; + return hash; + }, + toString$0(_) { + return 'Symbol("' + this._name + '")'; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.Symbol && this._name === other._name; + } + }; + A.__CastListBase__CastIterableBase_ListMixin.prototype = {}; + A.Instantiation.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.Instantiation1 && this._genericClosure.$eq(0, other._genericClosure) && A.getRuntimeTypeOfClosure(this) === A.getRuntimeTypeOfClosure(other); + }, + get$hashCode(_) { + return A.Object_hash(this._genericClosure, A.getRuntimeTypeOfClosure(this), B.C_SentinelValue); + }, + toString$0(_) { + var t1 = B.JSArray_methods.join$1([A.createRuntimeType(this.$ti._precomputed1)], ", "); + return this._genericClosure.toString$0(0) + " with " + ("<" + t1 + ">"); + } + }; + A.Instantiation1.prototype = { + call$0() { + return this._genericClosure.call$1$0(this.$ti._rest[0]); + }, + call$1(a0) { + return this._genericClosure.call$1$1(a0, this.$ti._rest[0]); + }, + call$2(a0, a1) { + return this._genericClosure.call$1$2(a0, a1, this.$ti._rest[0]); + }, + call$4(a0, a1, a2, a3) { + return this._genericClosure.call$1$4(a0, a1, a2, a3, this.$ti._rest[0]); + }, + $signature() { + return A.instantiatedGenericFunctionType(A.closureFunctionType(this._genericClosure), this.$ti); + } + }; + A.TypeErrorDecoder.prototype = { + matchTypeError$1(message) { + var result, t1, _this = this, + match = new RegExp(_this._pattern).exec(message); + if (match == null) + return null; + result = Object.create(null); + t1 = _this._arguments; + if (t1 !== -1) + result.arguments = match[t1 + 1]; + t1 = _this._argumentsExpr; + if (t1 !== -1) + result.argumentsExpr = match[t1 + 1]; + t1 = _this._expr; + if (t1 !== -1) + result.expr = match[t1 + 1]; + t1 = _this._method; + if (t1 !== -1) + result.method = match[t1 + 1]; + t1 = _this._receiver; + if (t1 !== -1) + result.receiver = match[t1 + 1]; + return result; + } + }; + A.NullError.prototype = { + toString$0(_) { + var t1 = this._method; + if (t1 == null) + return "NoSuchMethodError: " + this.__js_helper$_message; + return "NoSuchMethodError: method not found: '" + t1 + "' on null"; + } + }; + A.JsNoSuchMethodError.prototype = { + toString$0(_) { + var t2, _this = this, + _s38_ = "NoSuchMethodError: method not found: '", + t1 = _this._method; + if (t1 == null) + return "NoSuchMethodError: " + _this.__js_helper$_message; + t2 = _this._receiver; + if (t2 == null) + return _s38_ + t1 + "' (" + _this.__js_helper$_message + ")"; + return _s38_ + t1 + "' on '" + t2 + "' (" + _this.__js_helper$_message + ")"; + } + }; + A.UnknownJsTypeError.prototype = { + toString$0(_) { + var t1 = this.__js_helper$_message; + return t1.length === 0 ? "Error" : "Error: " + t1; + } + }; + A.NullThrownFromJavaScriptException.prototype = { + toString$0(_) { + return "Throw of null ('" + (this._irritant === null ? "null" : "undefined") + "' from JavaScript)"; + }, + $isException: 1 + }; + A.ExceptionAndStackTrace.prototype = {}; + A._StackTrace.prototype = { + toString$0(_) { + var trace, + t1 = this._trace; + if (t1 != null) + return t1; + t1 = this._exception; + trace = t1 !== null && typeof t1 === "object" ? t1.stack : null; + return this._trace = trace == null ? "" : trace; + }, + $isStackTrace: 1 + }; + A.Closure.prototype = { + toString$0(_) { + var $constructor = this.constructor, + $name = $constructor == null ? null : $constructor.name; + return "Closure '" + A.unminifyOrTag($name == null ? "unknown" : $name) + "'"; + }, + $isFunction: 1, + get$$call() { + return this; + }, + "call*": "call$1", + $requiredArgCount: 1, + $defaultValues: null + }; + A.Closure0Args.prototype = {"call*": "call$0", $requiredArgCount: 0}; + A.Closure2Args.prototype = {"call*": "call$2", $requiredArgCount: 2}; + A.TearOffClosure.prototype = {}; + A.StaticClosure.prototype = { + toString$0(_) { + var $name = this.$static_name; + if ($name == null) + return "Closure of unknown static method"; + return "Closure '" + A.unminifyOrTag($name) + "'"; + } + }; + A.BoundClosure.prototype = { + $eq(_, other) { + if (other == null) + return false; + if (this === other) + return true; + if (!(other instanceof A.BoundClosure)) + return false; + return this.$_target === other.$_target && this._receiver === other._receiver; + }, + get$hashCode(_) { + return (A.objectHashCode(this._receiver) ^ A.Primitives_objectHashCode(this.$_target)) >>> 0; + }, + toString$0(_) { + return "Closure '" + this.$_name + "' of " + ("Instance of '" + A.Primitives_objectTypeName(this._receiver) + "'"); + } + }; + A._CyclicInitializationError.prototype = { + toString$0(_) { + return "Reading static variable '" + this.variableName + "' during its initialization"; + } + }; + A.RuntimeError.prototype = { + toString$0(_) { + return "RuntimeError: " + this.message; + } + }; + A._AssertionError.prototype = { + toString$0(_) { + return "Assertion failed: " + A.Error_safeToString(this.message); + } + }; + A.JsLinkedHashMap.prototype = { + get$length(_) { + return this.__js_helper$_length; + }, + get$keys(_) { + return new A.LinkedHashMapKeyIterable(this, this.$ti._eval$1("LinkedHashMapKeyIterable<1>")); + }, + containsKey$1(key) { + var strings = this._strings; + if (strings == null) + return false; + return strings[key] != null; + }, + $index(_, key) { + var strings, cell, t1, nums, _null = null; + if (typeof key == "string") { + strings = this._strings; + if (strings == null) + return _null; + cell = strings[key]; + t1 = cell == null ? _null : cell.hashMapCellValue; + return t1; + } else if (typeof key == "number" && (key & 0x3fffffff) === key) { + nums = this._nums; + if (nums == null) + return _null; + cell = nums[key]; + t1 = cell == null ? _null : cell.hashMapCellValue; + return t1; + } else + return this.internalGet$1(key); + }, + internalGet$1(key) { + var bucket, index, + rest = this.__js_helper$_rest; + if (rest == null) + return null; + bucket = rest[J.get$hashCode$(key) & 1073741823]; + index = this.internalFindBucketIndex$2(bucket, key); + if (index < 0) + return null; + return bucket[index].hashMapCellValue; + }, + $indexSet(_, key, value) { + var strings, nums, rest, hash, bucket, index, _this = this, + t1 = _this.$ti; + t1._precomputed1._as(key); + t1._rest[1]._as(value); + if (typeof key == "string") { + strings = _this._strings; + _this._addHashTableEntry$3(strings == null ? _this._strings = _this._newHashTable$0() : strings, key, value); + } else if (typeof key == "number" && (key & 0x3fffffff) === key) { + nums = _this._nums; + _this._addHashTableEntry$3(nums == null ? _this._nums = _this._newHashTable$0() : nums, key, value); + } else { + rest = _this.__js_helper$_rest; + if (rest == null) + rest = _this.__js_helper$_rest = _this._newHashTable$0(); + hash = J.get$hashCode$(key) & 1073741823; + bucket = rest[hash]; + if (bucket == null) + rest[hash] = [_this._newLinkedCell$2(key, value)]; + else { + index = _this.internalFindBucketIndex$2(bucket, key); + if (index >= 0) + bucket[index].hashMapCellValue = value; + else + bucket.push(_this._newLinkedCell$2(key, value)); + } + } + }, + forEach$1(_, action) { + var cell, modifications, _this = this; + _this.$ti._eval$1("~(1,2)")._as(action); + cell = _this._first; + modifications = _this._modifications; + for (; cell != null;) { + action.call$2(cell.hashMapCellKey, cell.hashMapCellValue); + if (modifications !== _this._modifications) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + cell = cell._next; + } + }, + _addHashTableEntry$3(table, key, value) { + var cell, + t1 = this.$ti; + t1._precomputed1._as(key); + t1._rest[1]._as(value); + cell = table[key]; + if (cell == null) + table[key] = this._newLinkedCell$2(key, value); + else + cell.hashMapCellValue = value; + }, + _newLinkedCell$2(key, value) { + var _this = this, + t1 = _this.$ti, + cell = new A.LinkedHashMapCell(t1._precomputed1._as(key), t1._rest[1]._as(value)); + if (_this._first == null) + _this._first = _this._last = cell; + else + _this._last = _this._last._next = cell; + ++_this.__js_helper$_length; + _this._modifications = _this._modifications + 1 & 1073741823; + return cell; + }, + internalFindBucketIndex$2(bucket, key) { + var $length, i; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; ++i) + if (J.$eq$(bucket[i].hashMapCellKey, key)) + return i; + return -1; + }, + toString$0(_) { + return A.MapBase_mapToString(this); + }, + _newHashTable$0() { + var table = Object.create(null); + table[""] = table; + delete table[""]; + return table; + }, + $isLinkedHashMap: 1 + }; + A.LinkedHashMapCell.prototype = {}; + A.LinkedHashMapKeyIterable.prototype = { + get$length(_) { + return this._map.__js_helper$_length; + }, + get$isEmpty(_) { + return this._map.__js_helper$_length === 0; + }, + get$iterator(_) { + var t1 = this._map, + t2 = new A.LinkedHashMapKeyIterator(t1, t1._modifications, this.$ti._eval$1("LinkedHashMapKeyIterator<1>")); + t2._cell = t1._first; + return t2; + }, + contains$1(_, element) { + return this._map.containsKey$1(element); + } + }; + A.LinkedHashMapKeyIterator.prototype = { + get$current() { + return this.__js_helper$_current; + }, + moveNext$0() { + var cell, _this = this, + t1 = _this._map; + if (_this._modifications !== t1._modifications) + throw A.wrapException(A.ConcurrentModificationError$(t1)); + cell = _this._cell; + if (cell == null) { + _this.set$__js_helper$_current(null); + return false; + } else { + _this.set$__js_helper$_current(cell.hashMapCellKey); + _this._cell = cell._next; + return true; + } + }, + set$__js_helper$_current(_current) { + this.__js_helper$_current = this.$ti._eval$1("1?")._as(_current); + }, + $isIterator: 1 + }; + A.initHooks_closure.prototype = { + call$1(o) { + return this.getTag(o); + }, + $signature: 22 + }; + A.initHooks_closure0.prototype = { + call$2(o, tag) { + return this.getUnknownTag(o, tag); + }, + $signature: 21 + }; + A.initHooks_closure1.prototype = { + call$1(tag) { + return this.prototypeForTag(A._asString(tag)); + }, + $signature: 62 + }; + A.JSSyntaxRegExp.prototype = { + toString$0(_) { + return "RegExp/" + this.pattern + "/" + this._nativeRegExp.flags; + }, + get$_nativeGlobalVersion() { + var _this = this, + t1 = _this._nativeGlobalRegExp; + if (t1 != null) + return t1; + t1 = _this._nativeRegExp; + return _this._nativeGlobalRegExp = A.JSSyntaxRegExp_makeNative(_this.pattern, t1.multiline, !t1.ignoreCase, t1.unicode, t1.dotAll, true); + }, + get$_nativeAnchoredVersion() { + var _this = this, + t1 = _this._nativeAnchoredRegExp; + if (t1 != null) + return t1; + t1 = _this._nativeRegExp; + return _this._nativeAnchoredRegExp = A.JSSyntaxRegExp_makeNative(_this.pattern + "|()", t1.multiline, !t1.ignoreCase, t1.unicode, t1.dotAll, true); + }, + firstMatch$1(string) { + var m = this._nativeRegExp.exec(string); + if (m == null) + return null; + return new A._MatchImplementation(m); + }, + allMatches$2(_, string, start) { + var t1 = string.length; + if (start > t1) + throw A.wrapException(A.RangeError$range(start, 0, t1, null, null)); + return new A._AllMatchesIterable(this, string, start); + }, + allMatches$1($receiver, string) { + return this.allMatches$2($receiver, string, 0); + }, + _execGlobal$2(string, start) { + var match, + regexp = this.get$_nativeGlobalVersion(); + if (regexp == null) + regexp = type$.Object._as(regexp); + regexp.lastIndex = start; + match = regexp.exec(string); + if (match == null) + return null; + return new A._MatchImplementation(match); + }, + _execAnchored$2(string, start) { + var match, + regexp = this.get$_nativeAnchoredVersion(); + if (regexp == null) + regexp = type$.Object._as(regexp); + regexp.lastIndex = start; + match = regexp.exec(string); + if (match == null) + return null; + if (0 >= match.length) + return A.ioore(match, -1); + if (match.pop() != null) + return null; + return new A._MatchImplementation(match); + }, + matchAsPrefix$2(_, string, start) { + if (start < 0 || start > string.length) + throw A.wrapException(A.RangeError$range(start, 0, string.length, null, null)); + return this._execAnchored$2(string, start); + }, + $isPattern: 1, + $isRegExp: 1 + }; + A._MatchImplementation.prototype = { + get$start() { + return this._match.index; + }, + get$end() { + var t1 = this._match; + return t1.index + t1[0].length; + }, + $index(_, index) { + var t1 = this._match; + if (!(index < t1.length)) + return A.ioore(t1, index); + return t1[index]; + }, + $isMatch: 1, + $isRegExpMatch: 1 + }; + A._AllMatchesIterable.prototype = { + get$iterator(_) { + return new A._AllMatchesIterator(this._re, this._string, this._start); + } + }; + A._AllMatchesIterator.prototype = { + get$current() { + var t1 = this.__js_helper$_current; + return t1 == null ? type$.RegExpMatch._as(t1) : t1; + }, + moveNext$0() { + var t1, t2, t3, match, nextIndex, _this = this, + string = _this._string; + if (string == null) + return false; + t1 = _this._nextIndex; + t2 = string.length; + if (t1 <= t2) { + t3 = _this._regExp; + match = t3._execGlobal$2(string, t1); + if (match != null) { + _this.__js_helper$_current = match; + nextIndex = match.get$end(); + if (match._match.index === nextIndex) { + if (t3._nativeRegExp.unicode) { + t1 = _this._nextIndex; + t3 = t1 + 1; + if (t3 < t2) { + if (!(t1 >= 0 && t1 < t2)) + return A.ioore(string, t1); + t1 = string.charCodeAt(t1); + if (t1 >= 55296 && t1 <= 56319) { + if (!(t3 >= 0)) + return A.ioore(string, t3); + t1 = string.charCodeAt(t3); + t1 = t1 >= 56320 && t1 <= 57343; + } else + t1 = false; + } else + t1 = false; + } else + t1 = false; + nextIndex = (t1 ? nextIndex + 1 : nextIndex) + 1; + } + _this._nextIndex = nextIndex; + return true; + } + } + _this._string = _this.__js_helper$_current = null; + return false; + }, + $isIterator: 1 + }; + A.StringMatch.prototype = { + get$end() { + return this.start + this.pattern.length; + }, + $index(_, g) { + if (g !== 0) + A.throwExpression(A.RangeError$value(g, null)); + return this.pattern; + }, + $isMatch: 1, + get$start() { + return this.start; + } + }; + A._StringAllMatchesIterable.prototype = { + get$iterator(_) { + return new A._StringAllMatchesIterator(this._input, this._pattern, this.__js_helper$_index); + } + }; + A._StringAllMatchesIterator.prototype = { + moveNext$0() { + var index, end, _this = this, + t1 = _this.__js_helper$_index, + t2 = _this._pattern, + t3 = t2.length, + t4 = _this._input, + t5 = t4.length; + if (t1 + t3 > t5) { + _this.__js_helper$_current = null; + return false; + } + index = t4.indexOf(t2, t1); + if (index < 0) { + _this.__js_helper$_index = t5 + 1; + _this.__js_helper$_current = null; + return false; + } + end = index + t3; + _this.__js_helper$_current = new A.StringMatch(index, t2); + _this.__js_helper$_index = end === _this.__js_helper$_index ? end + 1 : end; + return true; + }, + get$current() { + var t1 = this.__js_helper$_current; + t1.toString; + return t1; + }, + $isIterator: 1 + }; + A._Cell.prototype = { + _readLocal$0() { + var t1 = this._value; + if (t1 === this) + throw A.wrapException(new A.LateError("Local '" + this.__late_helper$_name + "' has not been initialized.")); + return t1; + } + }; + A.NativeByteBuffer.prototype = { + get$runtimeType(receiver) { + return B.Type_ByteBuffer_RkP; + }, + $isTrustedGetRuntimeType: 1 + }; + A.NativeTypedData.prototype = {}; + A.NativeByteData.prototype = { + get$runtimeType(receiver) { + return B.Type_ByteData_zNC; + }, + $isTrustedGetRuntimeType: 1 + }; + A.NativeTypedArray.prototype = { + get$length(receiver) { + return receiver.length; + }, + $isJavaScriptIndexingBehavior: 1 + }; + A.NativeTypedArrayOfDouble.prototype = { + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + $indexSet(receiver, index, value) { + A._asDouble(value); + A._checkValidIndex(index, receiver, receiver.length); + receiver[index] = value; + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + A.NativeTypedArrayOfInt.prototype = { + $indexSet(receiver, index, value) { + A._asInt(value); + A._checkValidIndex(index, receiver, receiver.length); + receiver[index] = value; + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + A.NativeFloat32List.prototype = { + get$runtimeType(receiver) { + return B.Type_Float32List_LB7; + }, + $isTrustedGetRuntimeType: 1 + }; + A.NativeFloat64List.prototype = { + get$runtimeType(receiver) { + return B.Type_Float64List_LB7; + }, + $isTrustedGetRuntimeType: 1 + }; + A.NativeInt16List.prototype = { + get$runtimeType(receiver) { + return B.Type_Int16List_uXf; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + $isTrustedGetRuntimeType: 1 + }; + A.NativeInt32List.prototype = { + get$runtimeType(receiver) { + return B.Type_Int32List_O50; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + $isTrustedGetRuntimeType: 1 + }; + A.NativeInt8List.prototype = { + get$runtimeType(receiver) { + return B.Type_Int8List_ekJ; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + $isTrustedGetRuntimeType: 1 + }; + A.NativeUint16List.prototype = { + get$runtimeType(receiver) { + return B.Type_Uint16List_2bx; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + $isTrustedGetRuntimeType: 1 + }; + A.NativeUint32List.prototype = { + get$runtimeType(receiver) { + return B.Type_Uint32List_2bx; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + $isTrustedGetRuntimeType: 1, + $isUint32List: 1 + }; + A.NativeUint8ClampedList.prototype = { + get$runtimeType(receiver) { + return B.Type_Uint8ClampedList_Jik; + }, + get$length(receiver) { + return receiver.length; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + $isTrustedGetRuntimeType: 1 + }; + A.NativeUint8List.prototype = { + get$runtimeType(receiver) { + return B.Type_Uint8List_WLA; + }, + get$length(receiver) { + return receiver.length; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + $isTrustedGetRuntimeType: 1, + $isNativeUint8List: 1, + $isUint8List: 1 + }; + A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin.prototype = {}; + A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin.prototype = {}; + A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin.prototype = {}; + A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin.prototype = {}; + A.Rti.prototype = { + _eval$1(recipe) { + return A._Universe_evalInEnvironment(init.typeUniverse, this, recipe); + }, + _bind$1(typeOrTuple) { + return A._Universe_bind(init.typeUniverse, this, typeOrTuple); + } + }; + A._FunctionParameters.prototype = {}; + A._Type.prototype = { + toString$0(_) { + return A._rtiToString(this._rti, null); + } + }; + A._Error.prototype = { + toString$0(_) { + return this.__rti$_message; + } + }; + A._TypeError.prototype = {$isTypeError: 1}; + A._AsyncRun__initializeScheduleImmediate_internalCallback.prototype = { + call$1(_) { + var t1 = this._box_0, + f = t1.storedCallback; + t1.storedCallback = null; + f.call$0(); + }, + $signature: 9 + }; + A._AsyncRun__initializeScheduleImmediate_closure.prototype = { + call$1(callback) { + var t1, t2; + this._box_0.storedCallback = type$.void_Function._as(callback); + t1 = this.div; + t2 = this.span; + t1.firstChild ? t1.removeChild(t2) : t1.appendChild(t2); + }, + $signature: 44 + }; + A._AsyncRun__scheduleImmediateJsOverride_internalCallback.prototype = { + call$0() { + this.callback.call$0(); + }, + $signature: 5 + }; + A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback.prototype = { + call$0() { + this.callback.call$0(); + }, + $signature: 5 + }; + A._TimerImpl.prototype = { + _TimerImpl$2(milliseconds, callback) { + if (self.setTimeout != null) + self.setTimeout(A.convertDartClosureToJS(new A._TimerImpl_internalCallback(this, callback), 0), milliseconds); + else + throw A.wrapException(A.UnsupportedError$("`setTimeout()` not found.")); + }, + _TimerImpl$periodic$2(milliseconds, callback) { + if (self.setTimeout != null) + self.setInterval(A.convertDartClosureToJS(new A._TimerImpl$periodic_closure(this, milliseconds, Date.now(), callback), 0), milliseconds); + else + throw A.wrapException(A.UnsupportedError$("Periodic timer.")); + }, + $isTimer: 1 + }; + A._TimerImpl_internalCallback.prototype = { + call$0() { + this.$this._tick = 1; + this.callback.call$0(); + }, + $signature: 0 + }; + A._TimerImpl$periodic_closure.prototype = { + call$0() { + var duration, _this = this, + t1 = _this.$this, + tick = t1._tick + 1, + t2 = _this.milliseconds; + if (t2 > 0) { + duration = Date.now() - _this.start; + if (duration > (tick + 1) * t2) + tick = B.JSInt_methods.$tdiv(duration, t2); + } + t1._tick = tick; + _this.callback.call$1(t1); + }, + $signature: 5 + }; + A._AsyncAwaitCompleter.prototype = {}; + A._awaitOnObject_closure.prototype = { + call$1(result) { + return this.bodyFunction.call$2(0, result); + }, + $signature: 23 + }; + A._awaitOnObject_closure0.prototype = { + call$2(error, stackTrace) { + this.bodyFunction.call$2(1, new A.ExceptionAndStackTrace(error, type$.StackTrace._as(stackTrace))); + }, + $signature: 26 + }; + A._wrapJsFunctionForAsync_closure.prototype = { + call$2(errorCode, result) { + this.$protected(A._asInt(errorCode), result); + }, + $signature: 30 + }; + A.AsyncError.prototype = { + toString$0(_) { + return A.S(this.error); + }, + $isError: 1, + get$stackTrace() { + return this.stackTrace; + } + }; + A.Future_wait_handleError.prototype = { + call$2(theError, theStackTrace) { + var t1, t2, _this = this; + type$.Object._as(theError); + type$.StackTrace._as(theStackTrace); + t1 = _this._box_0; + t2 = --t1.remaining; + if (t1.values != null) { + t1.values = null; + if (t1.remaining === 0 || _this.eagerError) + _this._future._completeError$2(theError, theStackTrace); + else { + _this.error._value = theError; + _this.stackTrace._value = theStackTrace; + } + } else if (t2 === 0 && !_this.eagerError) + _this._future._completeError$2(_this.error._readLocal$0(), _this.stackTrace._readLocal$0()); + }, + $signature: 35 + }; + A.Future_wait_closure.prototype = { + call$1(value) { + var valueList, t2, _this = this, + t1 = _this.T; + t1._as(value); + t2 = _this._box_0; + --t2.remaining; + valueList = t2.values; + if (valueList != null) { + J.$indexSet$ax(valueList, _this.pos, value); + if (t2.remaining === 0) + _this._future._completeWithValue$1(A.List_List$from(valueList, true, t1)); + } else if (t2.remaining === 0 && !_this.eagerError) + _this._future._completeError$2(_this.error._readLocal$0(), _this.stackTrace._readLocal$0()); + }, + $signature() { + return this.T._eval$1("Null(0)"); + } + }; + A._FutureListener.prototype = { + matchesErrorTest$1(asyncError) { + if ((this.state & 15) !== 6) + return true; + return this.result._zone.runUnary$2$2(type$.bool_Function_Object._as(this.callback), asyncError.error, type$.bool, type$.Object); + }, + handleError$1(asyncError) { + var exception, _this = this, + errorCallback = _this.errorCallback, + result = null, + t1 = type$.dynamic, + t2 = type$.Object, + t3 = asyncError.error, + t4 = _this.result._zone; + if (type$.dynamic_Function_Object_StackTrace._is(errorCallback)) + result = t4.runBinary$3$3(errorCallback, t3, asyncError.stackTrace, t1, t2, type$.StackTrace); + else + result = t4.runUnary$2$2(type$.dynamic_Function_Object._as(errorCallback), t3, t1, t2); + try { + t1 = _this.$ti._eval$1("2/")._as(result); + return t1; + } catch (exception) { + if (type$.TypeError._is(A.unwrapException(exception))) { + if ((_this.state & 1) !== 0) + throw A.wrapException(A.ArgumentError$("The error handler of Future.then must return a value of the returned future's type", "onError")); + throw A.wrapException(A.ArgumentError$("The error handler of Future.catchError must return a value of the future's type", "onError")); + } else + throw exception; + } + } + }; + A._Future.prototype = { + _setChained$1(source) { + this._state = this._state & 1 | 4; + this._resultOrListeners = source; + }, + then$1$2$onError(f, onError, $R) { + var currentZone, result, t2, + t1 = this.$ti; + t1._bind$1($R)._eval$1("1/(2)")._as(f); + currentZone = $.Zone__current; + if (currentZone === B.C__RootZone) { + if (onError != null && !type$.dynamic_Function_Object_StackTrace._is(onError) && !type$.dynamic_Function_Object._is(onError)) + throw A.wrapException(A.ArgumentError$value(onError, "onError", string$.Error_)); + } else { + f = currentZone.registerUnaryCallback$2$1(f, $R._eval$1("0/"), t1._precomputed1); + if (onError != null) + onError = A._registerErrorHandler(onError, currentZone); + } + result = new A._Future($.Zone__current, $R._eval$1("_Future<0>")); + t2 = onError == null ? 1 : 3; + this._addListener$1(new A._FutureListener(result, t2, f, onError, t1._eval$1("@<1>")._bind$1($R)._eval$1("_FutureListener<1,2>"))); + return result; + }, + then$1$1(f, $R) { + return this.then$1$2$onError(f, null, $R); + }, + _thenAwait$1$2(f, onError, $E) { + var result, + t1 = this.$ti; + t1._bind$1($E)._eval$1("1/(2)")._as(f); + result = new A._Future($.Zone__current, $E._eval$1("_Future<0>")); + this._addListener$1(new A._FutureListener(result, 3, f, onError, t1._eval$1("@<1>")._bind$1($E)._eval$1("_FutureListener<1,2>"))); + return result; + }, + _setErrorObject$1(error) { + this._state = this._state & 1 | 16; + this._resultOrListeners = error; + }, + _cloneResult$1(source) { + this._state = source._state & 30 | this._state & 1; + this._resultOrListeners = source._resultOrListeners; + }, + _addListener$1(listener) { + var source, _this = this, + t1 = _this._state; + if (t1 <= 3) { + listener._nextListener = type$.nullable__FutureListener_dynamic_dynamic._as(_this._resultOrListeners); + _this._resultOrListeners = listener; + } else { + if ((t1 & 4) !== 0) { + source = type$._Future_dynamic._as(_this._resultOrListeners); + if ((source._state & 24) === 0) { + source._addListener$1(listener); + return; + } + _this._cloneResult$1(source); + } + _this._zone.scheduleMicrotask$1(new A._Future__addListener_closure(_this, listener)); + } + }, + _prependListeners$1(listeners) { + var t1, existingListeners, next, cursor, next0, source, _this = this, _box_0 = {}; + _box_0.listeners = listeners; + if (listeners == null) + return; + t1 = _this._state; + if (t1 <= 3) { + existingListeners = type$.nullable__FutureListener_dynamic_dynamic._as(_this._resultOrListeners); + _this._resultOrListeners = listeners; + if (existingListeners != null) { + next = listeners._nextListener; + for (cursor = listeners; next != null; cursor = next, next = next0) + next0 = next._nextListener; + cursor._nextListener = existingListeners; + } + } else { + if ((t1 & 4) !== 0) { + source = type$._Future_dynamic._as(_this._resultOrListeners); + if ((source._state & 24) === 0) { + source._prependListeners$1(listeners); + return; + } + _this._cloneResult$1(source); + } + _box_0.listeners = _this._reverseListeners$1(listeners); + _this._zone.scheduleMicrotask$1(new A._Future__prependListeners_closure(_box_0, _this)); + } + }, + _removeListeners$0() { + var current = type$.nullable__FutureListener_dynamic_dynamic._as(this._resultOrListeners); + this._resultOrListeners = null; + return this._reverseListeners$1(current); + }, + _reverseListeners$1(listeners) { + var current, prev, next; + for (current = listeners, prev = null; current != null; prev = current, current = next) { + next = current._nextListener; + current._nextListener = prev; + } + return prev; + }, + _chainForeignFuture$1(source) { + var e, s, exception, _this = this; + _this._state ^= 2; + try { + source.then$1$2$onError(new A._Future__chainForeignFuture_closure(_this), new A._Future__chainForeignFuture_closure0(_this), type$.Null); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A.scheduleMicrotask(new A._Future__chainForeignFuture_closure1(_this, e, s)); + } + }, + _completeWithValue$1(value) { + var listeners, _this = this; + _this.$ti._precomputed1._as(value); + listeners = _this._removeListeners$0(); + _this._state = 8; + _this._resultOrListeners = value; + A._Future__propagateToListeners(_this, listeners); + }, + _completeError$2(error, stackTrace) { + var listeners; + type$.StackTrace._as(stackTrace); + listeners = this._removeListeners$0(); + this._setErrorObject$1(A.AsyncError$(error, stackTrace)); + A._Future__propagateToListeners(this, listeners); + }, + _asyncComplete$1(value) { + var t1 = this.$ti; + t1._eval$1("1/")._as(value); + if (t1._eval$1("Future<1>")._is(value)) { + this._chainFuture$1(value); + return; + } + this._asyncCompleteWithValue$1(value); + }, + _asyncCompleteWithValue$1(value) { + var _this = this; + _this.$ti._precomputed1._as(value); + _this._state ^= 2; + _this._zone.scheduleMicrotask$1(new A._Future__asyncCompleteWithValue_closure(_this, value)); + }, + _chainFuture$1(value) { + var t1 = this.$ti; + t1._eval$1("Future<1>")._as(value); + if (t1._is(value)) { + A._Future__chainCoreFutureAsync(value, this); + return; + } + this._chainForeignFuture$1(value); + }, + _asyncCompleteError$2(error, stackTrace) { + type$.StackTrace._as(stackTrace); + this._state ^= 2; + this._zone.scheduleMicrotask$1(new A._Future__asyncCompleteError_closure(this, error, stackTrace)); + }, + $isFuture: 1 + }; + A._Future__addListener_closure.prototype = { + call$0() { + A._Future__propagateToListeners(this.$this, this.listener); + }, + $signature: 0 + }; + A._Future__prependListeners_closure.prototype = { + call$0() { + A._Future__propagateToListeners(this.$this, this._box_0.listeners); + }, + $signature: 0 + }; + A._Future__chainForeignFuture_closure.prototype = { + call$1(value) { + var error, stackTrace, exception, + t1 = this.$this; + t1._state ^= 2; + try { + t1._completeWithValue$1(t1.$ti._precomputed1._as(value)); + } catch (exception) { + error = A.unwrapException(exception); + stackTrace = A.getTraceFromException(exception); + t1._completeError$2(error, stackTrace); + } + }, + $signature: 9 + }; + A._Future__chainForeignFuture_closure0.prototype = { + call$2(error, stackTrace) { + this.$this._completeError$2(type$.Object._as(error), type$.StackTrace._as(stackTrace)); + }, + $signature: 38 + }; + A._Future__chainForeignFuture_closure1.prototype = { + call$0() { + this.$this._completeError$2(this.e, this.s); + }, + $signature: 0 + }; + A._Future__chainCoreFutureAsync_closure.prototype = { + call$0() { + A._Future__chainCoreFutureSync(this._box_0.source, this.target); + }, + $signature: 0 + }; + A._Future__asyncCompleteWithValue_closure.prototype = { + call$0() { + this.$this._completeWithValue$1(this.value); + }, + $signature: 0 + }; + A._Future__asyncCompleteError_closure.prototype = { + call$0() { + this.$this._completeError$2(this.error, this.stackTrace); + }, + $signature: 0 + }; + A._Future__propagateToListeners_handleWhenCompleteCallback.prototype = { + call$0() { + var e, s, t1, exception, t2, originalSource, _this = this, completeResult = null; + try { + t1 = _this._box_0.listener; + completeResult = t1.result._zone.run$1$1(type$.dynamic_Function._as(t1.callback), type$.dynamic); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + t1 = _this.hasError && type$.AsyncError._as(_this._box_1.source._resultOrListeners).error === e; + t2 = _this._box_0; + if (t1) + t2.listenerValueOrError = type$.AsyncError._as(_this._box_1.source._resultOrListeners); + else + t2.listenerValueOrError = A.AsyncError$(e, s); + t2.listenerHasError = true; + return; + } + if (completeResult instanceof A._Future && (completeResult._state & 24) !== 0) { + if ((completeResult._state & 16) !== 0) { + t1 = _this._box_0; + t1.listenerValueOrError = type$.AsyncError._as(completeResult._resultOrListeners); + t1.listenerHasError = true; + } + return; + } + if (completeResult instanceof A._Future) { + originalSource = _this._box_1.source; + t1 = _this._box_0; + t1.listenerValueOrError = completeResult.then$1$1(new A._Future__propagateToListeners_handleWhenCompleteCallback_closure(originalSource), type$.dynamic); + t1.listenerHasError = false; + } + }, + $signature: 0 + }; + A._Future__propagateToListeners_handleWhenCompleteCallback_closure.prototype = { + call$1(_) { + return this.originalSource; + }, + $signature: 40 + }; + A._Future__propagateToListeners_handleValueCallback.prototype = { + call$0() { + var e, s, t1, t2, t3, t4, t5, exception; + try { + t1 = this._box_0; + t2 = t1.listener; + t3 = t2.$ti; + t4 = t3._precomputed1; + t5 = t4._as(this.sourceResult); + t1.listenerValueOrError = t2.result._zone.runUnary$2$2(t3._eval$1("2/(1)")._as(t2.callback), t5, t3._eval$1("2/"), t4); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + t1 = this._box_0; + t1.listenerValueOrError = A.AsyncError$(e, s); + t1.listenerHasError = true; + } + }, + $signature: 0 + }; + A._Future__propagateToListeners_handleError.prototype = { + call$0() { + var asyncError, e, s, t1, exception, t2, _this = this; + try { + asyncError = type$.AsyncError._as(_this._box_1.source._resultOrListeners); + t1 = _this._box_0; + if (t1.listener.matchesErrorTest$1(asyncError) && t1.listener.errorCallback != null) { + t1.listenerValueOrError = t1.listener.handleError$1(asyncError); + t1.listenerHasError = false; + } + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + t1 = type$.AsyncError._as(_this._box_1.source._resultOrListeners); + t2 = _this._box_0; + if (t1.error === e) + t2.listenerValueOrError = t1; + else + t2.listenerValueOrError = A.AsyncError$(e, s); + t2.listenerHasError = true; + } + }, + $signature: 0 + }; + A._AsyncCallbackEntry.prototype = {}; + A._StreamIterator.prototype = {}; + A._ZoneFunction.prototype = {}; + A._ZoneSpecification.prototype = {$isZoneSpecification: 1}; + A._ZoneDelegate.prototype = { + registerCallback$1$2(zone, f, $R) { + var implementation, implZone; + $R._eval$1("0()")._as(f); + implementation = this._delegationTarget.get$_async$_registerCallback(); + implZone = implementation.zone; + return implementation.$function.call$1$4(implZone, implZone.get$_parentDelegate(), zone, f, $R); + }, + registerUnaryCallback$2$2(zone, f, $R, $T) { + var implementation, implZone; + $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); + implementation = this._delegationTarget.get$_async$_registerUnaryCallback(); + implZone = implementation.zone; + return implementation.$function.call$2$4(implZone, implZone.get$_parentDelegate(), zone, f, $R, $T); + }, + registerBinaryCallback$3$2(zone, f, $R, T1, T2) { + var implementation, implZone; + $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(f); + implementation = this._delegationTarget.get$_async$_registerBinaryCallback(); + implZone = implementation.zone; + return implementation.$function.call$3$4(implZone, implZone.get$_parentDelegate(), zone, f, $R, T1, T2); + }, + errorCallback$3(zone, error, stackTrace) { + var implementation, implZone; + A.checkNotNullable(error, "error", type$.Object); + implementation = this._delegationTarget.get$_async$_errorCallback(); + implZone = implementation.zone; + if (implZone === B.C__RootZone) + return null; + return implementation.$function.call$5(implZone, implZone.get$_parentDelegate(), zone, error, stackTrace); + }, + $isZoneDelegate: 1 + }; + A._Zone.prototype = { + _processUncaughtError$3(zone, error, stackTrace) { + var implZone, handler, parentDelegate, parentZone, currentZone, e, s, implementation, t1, exception; + type$.StackTrace._as(stackTrace); + implementation = this.get$_async$_handleUncaughtError(); + implZone = implementation.zone; + if (implZone === B.C__RootZone) { + A._rootHandleError(error, stackTrace); + return; + } + handler = implementation.$function; + parentDelegate = implZone.get$_parentDelegate(); + t1 = implZone.get$parent(); + t1.toString; + parentZone = t1; + currentZone = $.Zone__current; + try { + $.Zone__current = parentZone; + handler.call$5(implZone, parentDelegate, zone, error, stackTrace); + $.Zone__current = currentZone; + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + $.Zone__current = currentZone; + t1 = error === e ? stackTrace : s; + parentZone._processUncaughtError$3(implZone, e, t1); + } + }, + $isZone: 1 + }; + A._CustomZone.prototype = { + get$_delegate() { + var t1 = this._delegateCache; + return t1 == null ? this._delegateCache = new A._ZoneDelegate(this) : t1; + }, + get$_parentDelegate() { + return this.parent.get$_delegate(); + }, + get$errorZone() { + return this._async$_handleUncaughtError.zone; + }, + runGuarded$1(f) { + var e, s, exception; + type$.void_Function._as(f); + try { + this.run$1$1(f, type$.void); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + this._processUncaughtError$3(this, type$.Object._as(e), type$.StackTrace._as(s)); + } + }, + bindCallback$1$1(f, $R) { + return new A._CustomZone_bindCallback_closure(this, this.registerCallback$1$1($R._eval$1("0()")._as(f), $R), $R); + }, + bindUnaryCallback$2$1(f, $R, $T) { + return new A._CustomZone_bindUnaryCallback_closure(this, this.registerUnaryCallback$2$1($R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f), $R, $T), $T, $R); + }, + bindCallbackGuarded$1(f) { + return new A._CustomZone_bindCallbackGuarded_closure(this, this.registerCallback$1$1(type$.void_Function._as(f), type$.void)); + }, + $index(_, key) { + var value, + t1 = this._async$_map, + result = t1.$index(0, key); + if (result != null || t1.containsKey$1(key)) + return result; + value = this.parent.$index(0, key); + if (value != null) + t1.$indexSet(0, key, value); + return value; + }, + handleUncaughtError$2(error, stackTrace) { + this._processUncaughtError$3(this, error, type$.StackTrace._as(stackTrace)); + }, + fork$2$specification$zoneValues(specification, zoneValues) { + var implementation = this._fork, + t1 = implementation.zone; + return implementation.$function.call$5(t1, t1.get$_parentDelegate(), this, specification, zoneValues); + }, + run$1$1(f, $R) { + var implementation, t1; + $R._eval$1("0()")._as(f); + implementation = this._async$_run; + t1 = implementation.zone; + return implementation.$function.call$1$4(t1, t1.get$_parentDelegate(), this, f, $R); + }, + runUnary$2$2(f, arg, $R, $T) { + var implementation, t1; + $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); + $T._as(arg); + implementation = this._runUnary; + t1 = implementation.zone; + return implementation.$function.call$2$5(t1, t1.get$_parentDelegate(), this, f, arg, $R, $T); + }, + runBinary$3$3(f, arg1, arg2, $R, T1, T2) { + var implementation, t1; + $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(f); + T1._as(arg1); + T2._as(arg2); + implementation = this._runBinary; + t1 = implementation.zone; + return implementation.$function.call$3$6(t1, t1.get$_parentDelegate(), this, f, arg1, arg2, $R, T1, T2); + }, + registerCallback$1$1(callback, $R) { + var implementation, t1; + $R._eval$1("0()")._as(callback); + implementation = this._async$_registerCallback; + t1 = implementation.zone; + return implementation.$function.call$1$4(t1, t1.get$_parentDelegate(), this, callback, $R); + }, + registerUnaryCallback$2$1(callback, $R, $T) { + var implementation, t1; + $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(callback); + implementation = this._async$_registerUnaryCallback; + t1 = implementation.zone; + return implementation.$function.call$2$4(t1, t1.get$_parentDelegate(), this, callback, $R, $T); + }, + registerBinaryCallback$3$1(callback, $R, T1, T2) { + var implementation, t1; + $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(callback); + implementation = this._async$_registerBinaryCallback; + t1 = implementation.zone; + return implementation.$function.call$3$4(t1, t1.get$_parentDelegate(), this, callback, $R, T1, T2); + }, + errorCallback$2(error, stackTrace) { + var implementation, implementationZone; + type$.nullable_StackTrace._as(stackTrace); + A.checkNotNullable(error, "error", type$.Object); + implementation = this._async$_errorCallback; + implementationZone = implementation.zone; + if (implementationZone === B.C__RootZone) + return null; + return implementation.$function.call$5(implementationZone, implementationZone.get$_parentDelegate(), this, error, stackTrace); + }, + scheduleMicrotask$1(f) { + var implementation, t1; + type$.void_Function._as(f); + implementation = this._scheduleMicrotask; + t1 = implementation.zone; + return implementation.$function.call$4(t1, t1.get$_parentDelegate(), this, f); + }, + print$1(line) { + var implementation = this._print, + t1 = implementation.zone; + return implementation.$function.call$4(t1, t1.get$_parentDelegate(), this, line); + }, + set$_async$_registerCallback(_registerCallback) { + this._async$_registerCallback = type$._ZoneFunction_of_A_Function_Function_A_extends_nullable_Object_4_Zone_and_ZoneDelegate_and_Zone_and_A_Function._as(_registerCallback); + }, + set$_async$_registerUnaryCallback(_registerUnaryCallback) { + this._async$_registerUnaryCallback = type$._ZoneFunction_of_A_Function_B_Function_A_extends_nullable_Object_and_B_extends_nullable_Object_4_Zone_and_ZoneDelegate_and_Zone_and_A_Function_B._as(_registerUnaryCallback); + }, + set$_async$_registerBinaryCallback(_registerBinaryCallback) { + this._async$_registerBinaryCallback = type$._ZoneFunction_of_A_Function_2_B_and_C_Function_A_extends_nullable_Object_and_B_extends_nullable_Object_and_C_extends_nullable_Object_4_Zone_and_ZoneDelegate_and_Zone_and_A_Function_2_B_and_C._as(_registerBinaryCallback); + }, + set$_async$_errorCallback(_errorCallback) { + this._async$_errorCallback = type$._ZoneFunction_of_nullable_AsyncError_Function_5_Zone_and_ZoneDelegate_and_Zone_and_Object_and_nullable_StackTrace._as(_errorCallback); + }, + set$_async$_handleUncaughtError(_handleUncaughtError) { + this._async$_handleUncaughtError = type$._ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace._as(_handleUncaughtError); + }, + get$_async$_run() { + return this._async$_run; + }, + get$_runUnary() { + return this._runUnary; + }, + get$_runBinary() { + return this._runBinary; + }, + get$_async$_registerCallback() { + return this._async$_registerCallback; + }, + get$_async$_registerUnaryCallback() { + return this._async$_registerUnaryCallback; + }, + get$_async$_registerBinaryCallback() { + return this._async$_registerBinaryCallback; + }, + get$_async$_errorCallback() { + return this._async$_errorCallback; + }, + get$_scheduleMicrotask() { + return this._scheduleMicrotask; + }, + get$_createTimer() { + return this._createTimer; + }, + get$_createPeriodicTimer() { + return this._createPeriodicTimer; + }, + get$_print() { + return this._print; + }, + get$_fork() { + return this._fork; + }, + get$_async$_handleUncaughtError() { + return this._async$_handleUncaughtError; + }, + get$parent() { + return this.parent; + }, + get$_async$_map() { + return this._async$_map; + } + }; + A._CustomZone_bindCallback_closure.prototype = { + call$0() { + return this.$this.run$1$1(this.registered, this.R); + }, + $signature() { + return this.R._eval$1("0()"); + } + }; + A._CustomZone_bindUnaryCallback_closure.prototype = { + call$1(arg) { + var _this = this, + t1 = _this.T; + return _this.$this.runUnary$2$2(_this.registered, t1._as(arg), _this.R, t1); + }, + $signature() { + return this.R._eval$1("@<0>")._bind$1(this.T)._eval$1("1(2)"); + } + }; + A._CustomZone_bindCallbackGuarded_closure.prototype = { + call$0() { + return this.$this.runGuarded$1(this.registered); + }, + $signature: 0 + }; + A._rootHandleError_closure.prototype = { + call$0() { + A.Error_throwWithStackTrace(this.error, this.stackTrace); + }, + $signature: 0 + }; + A._RootZone.prototype = { + get$_async$_run() { + return B._ZoneFunction__RootZone__rootRun; + }, + get$_runUnary() { + return B._ZoneFunction__RootZone__rootRunUnary; + }, + get$_runBinary() { + return B._ZoneFunction__RootZone__rootRunBinary; + }, + get$_async$_registerCallback() { + return B._ZoneFunction__RootZone__rootRegisterCallback; + }, + get$_async$_registerUnaryCallback() { + return B._ZoneFunction_Eeh; + }, + get$_async$_registerBinaryCallback() { + return B._ZoneFunction_7G2; + }, + get$_async$_errorCallback() { + return B._ZoneFunction__RootZone__rootErrorCallback; + }, + get$_scheduleMicrotask() { + return B._ZoneFunction__RootZone__rootScheduleMicrotask; + }, + get$_createTimer() { + return B._ZoneFunction__RootZone__rootCreateTimer; + }, + get$_createPeriodicTimer() { + return B._ZoneFunction_3bB; + }, + get$_print() { + return B._ZoneFunction__RootZone__rootPrint; + }, + get$_fork() { + return B._ZoneFunction__RootZone__rootFork; + }, + get$_async$_handleUncaughtError() { + return B._ZoneFunction_NMc; + }, + get$parent() { + return null; + }, + get$_async$_map() { + return $.$get$_RootZone__rootMap(); + }, + get$_delegate() { + var t1 = $._RootZone__rootDelegate; + return t1 == null ? $._RootZone__rootDelegate = new A._ZoneDelegate(this) : t1; + }, + get$_parentDelegate() { + var t1 = $._RootZone__rootDelegate; + return t1 == null ? $._RootZone__rootDelegate = new A._ZoneDelegate(this) : t1; + }, + get$errorZone() { + return this; + }, + runGuarded$1(f) { + var e, s, exception; + type$.void_Function._as(f); + try { + if (B.C__RootZone === $.Zone__current) { + f.call$0(); + return; + } + A._rootRun(null, null, this, f, type$.void); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A._rootHandleError(type$.Object._as(e), type$.StackTrace._as(s)); + } + }, + bindCallback$1$1(f, $R) { + return new A._RootZone_bindCallback_closure(this, $R._eval$1("0()")._as(f), $R); + }, + bindUnaryCallback$2$1(f, $R, $T) { + return new A._RootZone_bindUnaryCallback_closure(this, $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f), $T, $R); + }, + bindCallbackGuarded$1(f) { + return new A._RootZone_bindCallbackGuarded_closure(this, type$.void_Function._as(f)); + }, + $index(_, key) { + return null; + }, + handleUncaughtError$2(error, stackTrace) { + A._rootHandleError(error, type$.StackTrace._as(stackTrace)); + }, + fork$2$specification$zoneValues(specification, zoneValues) { + return A._rootFork(null, null, this, specification, zoneValues); + }, + run$1$1(f, $R) { + $R._eval$1("0()")._as(f); + if ($.Zone__current === B.C__RootZone) + return f.call$0(); + return A._rootRun(null, null, this, f, $R); + }, + runUnary$2$2(f, arg, $R, $T) { + $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); + $T._as(arg); + if ($.Zone__current === B.C__RootZone) + return f.call$1(arg); + return A._rootRunUnary(null, null, this, f, arg, $R, $T); + }, + runBinary$3$3(f, arg1, arg2, $R, T1, T2) { + $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(f); + T1._as(arg1); + T2._as(arg2); + if ($.Zone__current === B.C__RootZone) + return f.call$2(arg1, arg2); + return A._rootRunBinary(null, null, this, f, arg1, arg2, $R, T1, T2); + }, + registerCallback$1$1(f, $R) { + return $R._eval$1("0()")._as(f); + }, + registerUnaryCallback$2$1(f, $R, $T) { + return $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); + }, + registerBinaryCallback$3$1(f, $R, T1, T2) { + return $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(f); + }, + errorCallback$2(error, stackTrace) { + type$.nullable_StackTrace._as(stackTrace); + return null; + }, + scheduleMicrotask$1(f) { + A._rootScheduleMicrotask(null, null, this, type$.void_Function._as(f)); + }, + print$1(line) { + A.printString(line); + } + }; + A._RootZone_bindCallback_closure.prototype = { + call$0() { + return this.$this.run$1$1(this.f, this.R); + }, + $signature() { + return this.R._eval$1("0()"); + } + }; + A._RootZone_bindUnaryCallback_closure.prototype = { + call$1(arg) { + var _this = this, + t1 = _this.T; + return _this.$this.runUnary$2$2(_this.f, t1._as(arg), _this.R, t1); + }, + $signature() { + return this.R._eval$1("@<0>")._bind$1(this.T)._eval$1("1(2)"); + } + }; + A._RootZone_bindCallbackGuarded_closure.prototype = { + call$0() { + return this.$this.runGuarded$1(this.f); + }, + $signature: 0 + }; + A._HashMap.prototype = { + get$length(_) { + return this._collection$_length; + }, + get$keys(_) { + return new A._HashMapKeyIterable(this, A._instanceType(this)._eval$1("_HashMapKeyIterable<1>")); + }, + containsKey$1(key) { + var strings, nums; + if (typeof key == "string" && key !== "__proto__") { + strings = this._collection$_strings; + return strings == null ? false : strings[key] != null; + } else if (typeof key == "number" && (key & 1073741823) === key) { + nums = this._collection$_nums; + return nums == null ? false : nums[key] != null; + } else + return this._containsKey$1(key); + }, + _containsKey$1(key) { + var rest = this._collection$_rest; + if (rest == null) + return false; + return this._findBucketIndex$2(this._getBucket$2(rest, key), key) >= 0; + }, + $index(_, key) { + var strings, t1, nums; + if (typeof key == "string" && key !== "__proto__") { + strings = this._collection$_strings; + t1 = strings == null ? null : A._HashMap__getTableEntry(strings, key); + return t1; + } else if (typeof key == "number" && (key & 1073741823) === key) { + nums = this._collection$_nums; + t1 = nums == null ? null : A._HashMap__getTableEntry(nums, key); + return t1; + } else + return this._get$1(key); + }, + _get$1(key) { + var bucket, index, + rest = this._collection$_rest; + if (rest == null) + return null; + bucket = this._getBucket$2(rest, key); + index = this._findBucketIndex$2(bucket, key); + return index < 0 ? null : bucket[index + 1]; + }, + $indexSet(_, key, value) { + var strings, nums, _this = this, + t1 = A._instanceType(_this); + t1._precomputed1._as(key); + t1._rest[1]._as(value); + if (typeof key == "string" && key !== "__proto__") { + strings = _this._collection$_strings; + _this._collection$_addHashTableEntry$3(strings == null ? _this._collection$_strings = A._HashMap__newHashTable() : strings, key, value); + } else if (typeof key == "number" && (key & 1073741823) === key) { + nums = _this._collection$_nums; + _this._collection$_addHashTableEntry$3(nums == null ? _this._collection$_nums = A._HashMap__newHashTable() : nums, key, value); + } else + _this._set$2(key, value); + }, + _set$2(key, value) { + var rest, hash, bucket, index, _this = this, + t1 = A._instanceType(_this); + t1._precomputed1._as(key); + t1._rest[1]._as(value); + rest = _this._collection$_rest; + if (rest == null) + rest = _this._collection$_rest = A._HashMap__newHashTable(); + hash = _this._computeHashCode$1(key); + bucket = rest[hash]; + if (bucket == null) { + A._HashMap__setTableEntry(rest, hash, [key, value]); + ++_this._collection$_length; + _this._keys = null; + } else { + index = _this._findBucketIndex$2(bucket, key); + if (index >= 0) + bucket[index + 1] = value; + else { + bucket.push(key, value); + ++_this._collection$_length; + _this._keys = null; + } + } + }, + forEach$1(_, action) { + var keys, $length, t2, i, key, t3, _this = this, + t1 = A._instanceType(_this); + t1._eval$1("~(1,2)")._as(action); + keys = _this._computeKeys$0(); + for ($length = keys.length, t2 = t1._precomputed1, t1 = t1._rest[1], i = 0; i < $length; ++i) { + key = keys[i]; + t2._as(key); + t3 = _this.$index(0, key); + action.call$2(key, t3 == null ? t1._as(t3) : t3); + if (keys !== _this._keys) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + }, + _computeKeys$0() { + var strings, names, entries, index, i, nums, rest, bucket, $length, i0, _this = this, + result = _this._keys; + if (result != null) + return result; + result = A.List_List$filled(_this._collection$_length, null, false, type$.dynamic); + strings = _this._collection$_strings; + if (strings != null) { + names = Object.getOwnPropertyNames(strings); + entries = names.length; + for (index = 0, i = 0; i < entries; ++i) { + result[index] = names[i]; + ++index; + } + } else + index = 0; + nums = _this._collection$_nums; + if (nums != null) { + names = Object.getOwnPropertyNames(nums); + entries = names.length; + for (i = 0; i < entries; ++i) { + result[index] = +names[i]; + ++index; + } + } + rest = _this._collection$_rest; + if (rest != null) { + names = Object.getOwnPropertyNames(rest); + entries = names.length; + for (i = 0; i < entries; ++i) { + bucket = rest[names[i]]; + $length = bucket.length; + for (i0 = 0; i0 < $length; i0 += 2) { + result[index] = bucket[i0]; + ++index; + } + } + } + return _this._keys = result; + }, + _collection$_addHashTableEntry$3(table, key, value) { + var t1 = A._instanceType(this); + t1._precomputed1._as(key); + t1._rest[1]._as(value); + if (table[key] == null) { + ++this._collection$_length; + this._keys = null; + } + A._HashMap__setTableEntry(table, key, value); + }, + _computeHashCode$1(key) { + return J.get$hashCode$(key) & 1073741823; + }, + _getBucket$2(table, key) { + return table[this._computeHashCode$1(key)]; + }, + _findBucketIndex$2(bucket, key) { + var $length, i; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; i += 2) + if (J.$eq$(bucket[i], key)) + return i; + return -1; + } + }; + A._HashMapKeyIterable.prototype = { + get$length(_) { + return this._collection$_map._collection$_length; + }, + get$isEmpty(_) { + return this._collection$_map._collection$_length === 0; + }, + get$iterator(_) { + var t1 = this._collection$_map; + return new A._HashMapKeyIterator(t1, t1._computeKeys$0(), this.$ti._eval$1("_HashMapKeyIterator<1>")); + }, + contains$1(_, element) { + return this._collection$_map.containsKey$1(element); + } + }; + A._HashMapKeyIterator.prototype = { + get$current() { + var t1 = this._collection$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var _this = this, + keys = _this._keys, + offset = _this._offset, + t1 = _this._collection$_map; + if (keys !== t1._keys) + throw A.wrapException(A.ConcurrentModificationError$(t1)); + else if (offset >= keys.length) { + _this.set$_collection$_current(null); + return false; + } else { + _this.set$_collection$_current(keys[offset]); + _this._offset = offset + 1; + return true; + } + }, + set$_collection$_current(_current) { + this._collection$_current = this.$ti._eval$1("1?")._as(_current); + }, + $isIterator: 1 + }; + A.HashMap_HashMap$from_closure.prototype = { + call$2(k, v) { + this.result.$indexSet(0, this.K._as(k), this.V._as(v)); + }, + $signature: 41 + }; + A.ListBase.prototype = { + get$iterator(receiver) { + return new A.ListIterator(receiver, this.get$length(receiver), A.instanceType(receiver)._eval$1("ListIterator")); + }, + elementAt$1(receiver, index) { + return this.$index(receiver, index); + }, + get$isEmpty(receiver) { + return this.get$length(receiver) === 0; + }, + contains$1(receiver, element) { + var i, + $length = this.get$length(receiver); + for (i = 0; i < $length; ++i) { + if (J.$eq$(this.$index(receiver, i), element)) + return true; + if ($length !== this.get$length(receiver)) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + } + return false; + }, + skip$1(receiver, count) { + return A.SubListIterable$(receiver, count, null, A.instanceType(receiver)._eval$1("ListBase.E")); + }, + toList$1$growable(receiver, growable) { + var t1, first, result, i, _this = this; + if (_this.get$isEmpty(receiver)) { + t1 = J.JSArray_JSArray$growable(0, A.instanceType(receiver)._eval$1("ListBase.E")); + return t1; + } + first = _this.$index(receiver, 0); + result = A.List_List$filled(_this.get$length(receiver), first, true, A.instanceType(receiver)._eval$1("ListBase.E")); + for (i = 1; i < _this.get$length(receiver); ++i) + B.JSArray_methods.$indexSet(result, i, _this.$index(receiver, i)); + return result; + }, + toList$0($receiver) { + return this.toList$1$growable($receiver, true); + }, + cast$1$0(receiver, $R) { + return new A.CastList(receiver, A.instanceType(receiver)._eval$1("@")._bind$1($R)._eval$1("CastList<1,2>")); + }, + fillRange$3(receiver, start, end, fill) { + var i; + A.instanceType(receiver)._eval$1("ListBase.E?")._as(fill); + A.RangeError_checkValidRange(start, end, this.get$length(receiver)); + for (i = start; i < end; ++i) + this.$indexSet(receiver, i, fill); + }, + toString$0(receiver) { + return A.Iterable_iterableToFullString(receiver, "[", "]"); + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + A.MapBase.prototype = { + cast$2$0(_, RK, RV) { + var t1 = A._instanceType(this); + return new A.CastMap(this, t1._eval$1("@")._bind$1(t1._eval$1("MapBase.V"))._bind$1(RK)._bind$1(RV)._eval$1("CastMap<1,2,3,4>")); + }, + forEach$1(_, action) { + var t2, key, t3, _this = this, + t1 = A._instanceType(_this); + t1._eval$1("~(MapBase.K,MapBase.V)")._as(action); + for (t2 = _this.get$keys(_this), t2 = t2.get$iterator(t2), t1 = t1._eval$1("MapBase.V"); t2.moveNext$0();) { + key = t2.get$current(); + t3 = _this.$index(0, key); + action.call$2(key, t3 == null ? t1._as(t3) : t3); + } + }, + get$entries() { + var _this = this; + return _this.get$keys(_this).map$1$1(0, new A.MapBase_entries_closure(_this), A._instanceType(_this)._eval$1("MapEntry")); + }, + containsKey$1(key) { + return this.get$keys(this).contains$1(0, key); + }, + get$length(_) { + var t1 = this.get$keys(this); + return t1.get$length(t1); + }, + toString$0(_) { + return A.MapBase_mapToString(this); + }, + $isMap: 1 + }; + A.MapBase_entries_closure.prototype = { + call$1(key) { + var t1 = this.$this, + t2 = A._instanceType(t1); + t2._eval$1("MapBase.K")._as(key); + t1 = t1.$index(0, key); + if (t1 == null) + t1 = t2._eval$1("MapBase.V")._as(t1); + return new A.MapEntry(key, t1, t2._eval$1("@")._bind$1(t2._eval$1("MapBase.V"))._eval$1("MapEntry<1,2>")); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("MapEntry(MapBase.K)"); + } + }; + A.MapBase_mapToString_closure.prototype = { + call$2(k, v) { + var t2, + t1 = this._box_0; + if (!t1.first) + this.result._contents += ", "; + t1.first = false; + t1 = this.result; + t2 = t1._contents += A.S(k); + t1._contents = t2 + ": "; + t1._contents += A.S(v); + }, + $signature: 43 + }; + A._JsonMap.prototype = { + $index(_, key) { + var result, + t1 = this._processed; + if (t1 == null) + return this._data.$index(0, key); + else if (typeof key != "string") + return null; + else { + result = t1[key]; + return typeof result == "undefined" ? this._process$1(key) : result; + } + }, + get$length(_) { + return this._processed == null ? this._data.__js_helper$_length : this._convert$_computeKeys$0().length; + }, + get$keys(_) { + var t1; + if (this._processed == null) { + t1 = this._data; + return new A.LinkedHashMapKeyIterable(t1, t1.$ti._eval$1("LinkedHashMapKeyIterable<1>")); + } + return new A._JsonMapKeyIterable(this); + }, + containsKey$1(key) { + if (this._processed == null) + return this._data.containsKey$1(key); + return Object.prototype.hasOwnProperty.call(this._original, key); + }, + forEach$1(_, f) { + var keys, i, key, value, _this = this; + type$.void_Function_String_dynamic._as(f); + if (_this._processed == null) + return _this._data.forEach$1(0, f); + keys = _this._convert$_computeKeys$0(); + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + value = _this._processed[key]; + if (typeof value == "undefined") { + value = A._convertJsonToDartLazy(_this._original[key]); + _this._processed[key] = value; + } + f.call$2(key, value); + if (keys !== _this._data) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + }, + _convert$_computeKeys$0() { + var keys = type$.nullable_List_dynamic._as(this._data); + if (keys == null) + keys = this._data = A._setArrayType(Object.keys(this._original), type$.JSArray_String); + return keys; + }, + _process$1(key) { + var result; + if (!Object.prototype.hasOwnProperty.call(this._original, key)) + return null; + result = A._convertJsonToDartLazy(this._original[key]); + return this._processed[key] = result; + } + }; + A._JsonMapKeyIterable.prototype = { + get$length(_) { + var t1 = this._parent; + return t1.get$length(t1); + }, + elementAt$1(_, index) { + var t1 = this._parent; + if (t1._processed == null) + t1 = t1.get$keys(t1).elementAt$1(0, index); + else { + t1 = t1._convert$_computeKeys$0(); + if (!(index >= 0 && index < t1.length)) + return A.ioore(t1, index); + t1 = t1[index]; + } + return t1; + }, + get$iterator(_) { + var t1 = this._parent; + if (t1._processed == null) { + t1 = t1.get$keys(t1); + t1 = t1.get$iterator(t1); + } else { + t1 = t1._convert$_computeKeys$0(); + t1 = new J.ArrayIterator(t1, t1.length, A._arrayInstanceType(t1)._eval$1("ArrayIterator<1>")); + } + return t1; + }, + contains$1(_, key) { + return this._parent.containsKey$1(key); + } + }; + A.Utf8Decoder__decoder_closure.prototype = { + call$0() { + var t1, exception; + try { + t1 = new TextDecoder("utf-8", {fatal: true}); + return t1; + } catch (exception) { + } + return null; + }, + $signature: 10 + }; + A.Utf8Decoder__decoderNonfatal_closure.prototype = { + call$0() { + var t1, exception; + try { + t1 = new TextDecoder("utf-8", {fatal: false}); + return t1; + } catch (exception) { + } + return null; + }, + $signature: 10 + }; + A.AsciiCodec.prototype = { + encode$1(source) { + return B.AsciiEncoder_127.convert$1(source); + } + }; + A._UnicodeSubsetEncoder.prototype = { + convert$1(string) { + var stringLength, $length, result, t1, i, codeUnit; + A._asString(string); + stringLength = string.length; + $length = A.RangeError_checkValidRange(0, null, stringLength) - 0; + result = new Uint8Array($length); + for (t1 = ~this._subsetMask, i = 0; i < $length; ++i) { + if (!(i < stringLength)) + return A.ioore(string, i); + codeUnit = string.charCodeAt(i); + if ((codeUnit & t1) !== 0) + throw A.wrapException(A.ArgumentError$value(string, "string", "Contains invalid characters.")); + if (!(i < $length)) + return A.ioore(result, i); + result[i] = codeUnit; + } + return result; + } + }; + A.AsciiEncoder.prototype = {}; + A.Base64Codec.prototype = { + normalize$3(source, start, end) { + var inverseAlphabet, t2, i, sliceStart, buffer, firstPadding, firstPaddingSourceIndex, paddingCount, i0, char, i1, digit1, t3, digit2, char0, value, endLength, $length, + _s64_ = string$.ABCDEF, + _s31_ = "Invalid base64 encoding length ", + t1 = source.length; + end = A.RangeError_checkValidRange(start, end, t1); + inverseAlphabet = $.$get$_Base64Decoder__inverseAlphabet(); + for (t2 = inverseAlphabet.length, i = start, sliceStart = i, buffer = null, firstPadding = -1, firstPaddingSourceIndex = -1, paddingCount = 0; i < end; i = i0) { + i0 = i + 1; + if (!(i < t1)) + return A.ioore(source, i); + char = source.charCodeAt(i); + if (char === 37) { + i1 = i0 + 2; + if (i1 <= end) { + if (!(i0 < t1)) + return A.ioore(source, i0); + digit1 = A.hexDigitValue(source.charCodeAt(i0)); + t3 = i0 + 1; + if (!(t3 < t1)) + return A.ioore(source, t3); + digit2 = A.hexDigitValue(source.charCodeAt(t3)); + char0 = digit1 * 16 + digit2 - (digit2 & 256); + if (char0 === 37) + char0 = -1; + i0 = i1; + } else + char0 = -1; + } else + char0 = char; + if (0 <= char0 && char0 <= 127) { + if (!(char0 >= 0 && char0 < t2)) + return A.ioore(inverseAlphabet, char0); + value = inverseAlphabet[char0]; + if (value >= 0) { + if (!(value < 64)) + return A.ioore(_s64_, value); + char0 = _s64_.charCodeAt(value); + if (char0 === char) + continue; + char = char0; + } else { + if (value === -1) { + if (firstPadding < 0) { + t3 = buffer == null ? null : buffer._contents.length; + if (t3 == null) + t3 = 0; + firstPadding = t3 + (i - sliceStart); + firstPaddingSourceIndex = i; + } + ++paddingCount; + if (char === 61) + continue; + } + char = char0; + } + if (value !== -2) { + if (buffer == null) { + buffer = new A.StringBuffer(""); + t3 = buffer; + } else + t3 = buffer; + t3._contents += B.JSString_methods.substring$2(source, sliceStart, i); + t3._contents += A.Primitives_stringFromCharCode(char); + sliceStart = i0; + continue; + } + } + throw A.wrapException(A.FormatException$("Invalid base64 data", source, i)); + } + if (buffer != null) { + t1 = buffer._contents += B.JSString_methods.substring$2(source, sliceStart, end); + t2 = t1.length; + if (firstPadding >= 0) + A.Base64Codec__checkPadding(source, firstPaddingSourceIndex, end, firstPadding, paddingCount, t2); + else { + endLength = B.JSInt_methods.$mod(t2 - 1, 4) + 1; + if (endLength === 1) + throw A.wrapException(A.FormatException$(_s31_, source, end)); + for (; endLength < 4;) { + t1 += "="; + buffer._contents = t1; + ++endLength; + } + } + t1 = buffer._contents; + return B.JSString_methods.replaceRange$3(source, start, end, t1.charCodeAt(0) == 0 ? t1 : t1); + } + $length = end - start; + if (firstPadding >= 0) + A.Base64Codec__checkPadding(source, firstPaddingSourceIndex, end, firstPadding, paddingCount, $length); + else { + endLength = B.JSInt_methods.$mod($length, 4); + if (endLength === 1) + throw A.wrapException(A.FormatException$(_s31_, source, end)); + if (endLength > 1) + source = B.JSString_methods.replaceRange$3(source, end, end, endLength === 2 ? "==" : "="); + } + return source; + } + }; + A.Base64Encoder.prototype = {}; + A.Codec.prototype = {}; + A._FusedCodec.prototype = {}; + A.Converter.prototype = {}; + A.Encoding.prototype = {}; + A.JsonCodec.prototype = { + decode$2$reviver(source, reviver) { + var t1 = A._parseJson(source, this.get$decoder()._reviver); + return t1; + }, + get$decoder() { + return B.JsonDecoder_null; + } + }; + A.JsonDecoder.prototype = {}; + A.Utf8Codec.prototype = {}; + A.Utf8Encoder.prototype = { + convert$1(string) { + var stringLength, end, $length, t1, t2, encoder, t3; + A._asString(string); + stringLength = string.length; + end = A.RangeError_checkValidRange(0, null, stringLength); + $length = end - 0; + if ($length === 0) + return new Uint8Array(0); + t1 = $length * 3; + t2 = new Uint8Array(t1); + encoder = new A._Utf8Encoder(t2); + if (encoder._fillBuffer$3(string, 0, end) !== end) { + t3 = end - 1; + if (!(t3 >= 0 && t3 < stringLength)) + return A.ioore(string, t3); + encoder._writeReplacementCharacter$0(); + } + return new Uint8Array(t2.subarray(0, A._checkValidRange(0, encoder._bufferIndex, t1))); + } + }; + A._Utf8Encoder.prototype = { + _writeReplacementCharacter$0() { + var _this = this, + t1 = _this._buffer, + t2 = _this._bufferIndex, + t3 = _this._bufferIndex = t2 + 1, + t4 = t1.length; + if (!(t2 < t4)) + return A.ioore(t1, t2); + t1[t2] = 239; + t2 = _this._bufferIndex = t3 + 1; + if (!(t3 < t4)) + return A.ioore(t1, t3); + t1[t3] = 191; + _this._bufferIndex = t2 + 1; + if (!(t2 < t4)) + return A.ioore(t1, t2); + t1[t2] = 189; + }, + _writeSurrogate$2(leadingSurrogate, nextCodeUnit) { + var rune, t1, t2, t3, t4, _this = this; + if ((nextCodeUnit & 64512) === 56320) { + rune = 65536 + ((leadingSurrogate & 1023) << 10) | nextCodeUnit & 1023; + t1 = _this._buffer; + t2 = _this._bufferIndex; + t3 = _this._bufferIndex = t2 + 1; + t4 = t1.length; + if (!(t2 < t4)) + return A.ioore(t1, t2); + t1[t2] = rune >>> 18 | 240; + t2 = _this._bufferIndex = t3 + 1; + if (!(t3 < t4)) + return A.ioore(t1, t3); + t1[t3] = rune >>> 12 & 63 | 128; + t3 = _this._bufferIndex = t2 + 1; + if (!(t2 < t4)) + return A.ioore(t1, t2); + t1[t2] = rune >>> 6 & 63 | 128; + _this._bufferIndex = t3 + 1; + if (!(t3 < t4)) + return A.ioore(t1, t3); + t1[t3] = rune & 63 | 128; + return true; + } else { + _this._writeReplacementCharacter$0(); + return false; + } + }, + _fillBuffer$3(str, start, end) { + var t1, t2, t3, stringIndex, codeUnit, t4, t5, _this = this; + if (start !== end) { + t1 = end - 1; + if (!(t1 >= 0 && t1 < str.length)) + return A.ioore(str, t1); + t1 = (str.charCodeAt(t1) & 64512) === 55296; + } else + t1 = false; + if (t1) + --end; + for (t1 = _this._buffer, t2 = t1.length, t3 = str.length, stringIndex = start; stringIndex < end; ++stringIndex) { + if (!(stringIndex < t3)) + return A.ioore(str, stringIndex); + codeUnit = str.charCodeAt(stringIndex); + if (codeUnit <= 127) { + t4 = _this._bufferIndex; + if (t4 >= t2) + break; + _this._bufferIndex = t4 + 1; + t1[t4] = codeUnit; + } else { + t4 = codeUnit & 64512; + if (t4 === 55296) { + if (_this._bufferIndex + 4 > t2) + break; + t4 = stringIndex + 1; + if (!(t4 < t3)) + return A.ioore(str, t4); + if (_this._writeSurrogate$2(codeUnit, str.charCodeAt(t4))) + stringIndex = t4; + } else if (t4 === 56320) { + if (_this._bufferIndex + 3 > t2) + break; + _this._writeReplacementCharacter$0(); + } else if (codeUnit <= 2047) { + t4 = _this._bufferIndex; + t5 = t4 + 1; + if (t5 >= t2) + break; + _this._bufferIndex = t5; + if (!(t4 < t2)) + return A.ioore(t1, t4); + t1[t4] = codeUnit >>> 6 | 192; + _this._bufferIndex = t5 + 1; + t1[t5] = codeUnit & 63 | 128; + } else { + t4 = _this._bufferIndex; + if (t4 + 2 >= t2) + break; + t5 = _this._bufferIndex = t4 + 1; + if (!(t4 < t2)) + return A.ioore(t1, t4); + t1[t4] = codeUnit >>> 12 | 224; + t4 = _this._bufferIndex = t5 + 1; + if (!(t5 < t2)) + return A.ioore(t1, t5); + t1[t5] = codeUnit >>> 6 & 63 | 128; + _this._bufferIndex = t4 + 1; + if (!(t4 < t2)) + return A.ioore(t1, t4); + t1[t4] = codeUnit & 63 | 128; + } + } + } + return stringIndex; + } + }; + A.Utf8Decoder.prototype = { + convert$1(codeUnits) { + var t1, result; + type$.List_int._as(codeUnits); + t1 = this._allowMalformed; + result = A.Utf8Decoder__convertIntercepted(t1, codeUnits, 0, null); + if (result != null) + return result; + return new A._Utf8Decoder(t1).convertGeneral$4(codeUnits, 0, null, true); + } + }; + A._Utf8Decoder.prototype = { + convertGeneral$4(codeUnits, start, maybeEnd, single) { + var end, bytes, errorOffset, result, t1, message, _this = this; + type$.List_int._as(codeUnits); + end = A.RangeError_checkValidRange(start, maybeEnd, J.get$length$asx(codeUnits)); + if (start === end) + return ""; + if (type$.Uint8List._is(codeUnits)) { + bytes = codeUnits; + errorOffset = 0; + } else { + bytes = A._Utf8Decoder__makeUint8List(codeUnits, start, end); + end -= start; + errorOffset = start; + start = 0; + } + result = _this._convertRecursive$4(bytes, start, end, true); + t1 = _this._convert$_state; + if ((t1 & 1) !== 0) { + message = A._Utf8Decoder_errorDescription(t1); + _this._convert$_state = 0; + throw A.wrapException(A.FormatException$(message, codeUnits, errorOffset + _this._charOrIndex)); + } + return result; + }, + _convertRecursive$4(bytes, start, end, single) { + var mid, s1, _this = this; + if (end - start > 1000) { + mid = B.JSInt_methods._tdivFast$1(start + end, 2); + s1 = _this._convertRecursive$4(bytes, start, mid, false); + if ((_this._convert$_state & 1) !== 0) + return s1; + return s1 + _this._convertRecursive$4(bytes, mid, end, single); + } + return _this.decodeGeneral$4(bytes, start, end, single); + }, + decodeGeneral$4(bytes, start, end, single) { + var byte, t2, type, t3, i0, markEnd, i1, m, _this = this, + _s256_ = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFFFFFFFFFFFFFGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHIHHHJEEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBKCCCCCCCCCCCCDCLONNNMEEEEEEEEEEE", + _s144_ = " \x000:XECCCCCN:lDb \x000:XECCCCCNvlDb \x000:XECCCCCN:lDb AAAAA\x00\x00\x00\x00\x00AAAAA00000AAAAA:::::AAAAAGG000AAAAA00KKKAAAAAG::::AAAAA:IIIIAAAAA000\x800AAAAA\x00\x00\x00\x00 AAAAA", + _65533 = 65533, + state = _this._convert$_state, + char = _this._charOrIndex, + buffer = new A.StringBuffer(""), + i = start + 1, + t1 = bytes.length; + if (!(start >= 0 && start < t1)) + return A.ioore(bytes, start); + byte = bytes[start]; + $label0$0: + for (t2 = _this.allowMalformed; true;) { + for (; true; i = i0) { + if (!(byte >= 0 && byte < 256)) + return A.ioore(_s256_, byte); + type = _s256_.charCodeAt(byte) & 31; + char = state <= 32 ? byte & 61694 >>> type : (byte & 63 | char << 6) >>> 0; + t3 = state + type; + if (!(t3 >= 0 && t3 < 144)) + return A.ioore(_s144_, t3); + state = _s144_.charCodeAt(t3); + if (state === 0) { + buffer._contents += A.Primitives_stringFromCharCode(char); + if (i === end) + break $label0$0; + break; + } else if ((state & 1) !== 0) { + if (t2) + switch (state) { + case 69: + case 67: + buffer._contents += A.Primitives_stringFromCharCode(_65533); + break; + case 65: + buffer._contents += A.Primitives_stringFromCharCode(_65533); + --i; + break; + default: + t3 = buffer._contents += A.Primitives_stringFromCharCode(_65533); + buffer._contents = t3 + A.Primitives_stringFromCharCode(_65533); + break; + } + else { + _this._convert$_state = state; + _this._charOrIndex = i - 1; + return ""; + } + state = 0; + } + if (i === end) + break $label0$0; + i0 = i + 1; + if (!(i >= 0 && i < t1)) + return A.ioore(bytes, i); + byte = bytes[i]; + } + i0 = i + 1; + if (!(i >= 0 && i < t1)) + return A.ioore(bytes, i); + byte = bytes[i]; + if (byte < 128) { + while (true) { + if (!(i0 < end)) { + markEnd = end; + break; + } + i1 = i0 + 1; + if (!(i0 >= 0 && i0 < t1)) + return A.ioore(bytes, i0); + byte = bytes[i0]; + if (byte >= 128) { + markEnd = i1 - 1; + i0 = i1; + break; + } + i0 = i1; + } + if (markEnd - i < 20) + for (m = i; m < markEnd; ++m) { + if (!(m < t1)) + return A.ioore(bytes, m); + buffer._contents += A.Primitives_stringFromCharCode(bytes[m]); + } + else + buffer._contents += A.String_String$fromCharCodes(bytes, i, markEnd); + if (markEnd === end) + break $label0$0; + i = i0; + } else + i = i0; + } + if (single && state > 32) + if (t2) + buffer._contents += A.Primitives_stringFromCharCode(_65533); + else { + _this._convert$_state = 77; + _this._charOrIndex = end; + return ""; + } + _this._convert$_state = state; + _this._charOrIndex = char; + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }; + A.Duration.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.Duration && true; + }, + get$hashCode(_) { + return B.JSInt_methods.get$hashCode(0); + }, + toString$0(_) { + return "0:00:00." + B.JSString_methods.padLeft$2(B.JSInt_methods.toString$0(0), 6, "0"); + } + }; + A._Enum.prototype = { + toString$0(_) { + return this._enumToString$0(); + } + }; + A.Error.prototype = { + get$stackTrace() { + return A.getTraceFromException(this.$thrownJsError); + } + }; + A.AssertionError.prototype = { + toString$0(_) { + var t1 = this.message; + if (t1 != null) + return "Assertion failed: " + A.Error_safeToString(t1); + return "Assertion failed"; + } + }; + A.TypeError.prototype = {}; + A.ArgumentError.prototype = { + get$_errorName() { + return "Invalid argument" + (!this._hasValue ? "(s)" : ""); + }, + get$_errorExplanation() { + return ""; + }, + toString$0(_) { + var _this = this, + $name = _this.name, + nameString = $name == null ? "" : " (" + $name + ")", + message = _this.message, + messageString = message == null ? "" : ": " + A.S(message), + prefix = _this.get$_errorName() + nameString + messageString; + if (!_this._hasValue) + return prefix; + return prefix + _this.get$_errorExplanation() + ": " + A.Error_safeToString(_this.get$invalidValue()); + }, + get$invalidValue() { + return this.invalidValue; + } + }; + A.RangeError.prototype = { + get$invalidValue() { + return A._asNumQ(this.invalidValue); + }, + get$_errorName() { + return "RangeError"; + }, + get$_errorExplanation() { + var explanation, + start = this.start, + end = this.end; + if (start == null) + explanation = end != null ? ": Not less than or equal to " + A.S(end) : ""; + else if (end == null) + explanation = ": Not greater than or equal to " + A.S(start); + else if (end > start) + explanation = ": Not in inclusive range " + A.S(start) + ".." + A.S(end); + else + explanation = end < start ? ": Valid value range is empty" : ": Only valid value is " + A.S(start); + return explanation; + } + }; + A.IndexError.prototype = { + get$invalidValue() { + return A._asInt(this.invalidValue); + }, + get$_errorName() { + return "RangeError"; + }, + get$_errorExplanation() { + if (A._asInt(this.invalidValue) < 0) + return ": index must not be negative"; + var t1 = this.length; + if (t1 === 0) + return ": no indices are valid"; + return ": index should be less than " + t1; + }, + $isRangeError: 1, + get$length(receiver) { + return this.length; + } + }; + A.UnsupportedError.prototype = { + toString$0(_) { + return "Unsupported operation: " + this.message; + } + }; + A.UnimplementedError.prototype = { + toString$0(_) { + return "UnimplementedError: " + this.message; + } + }; + A.StateError.prototype = { + toString$0(_) { + return "Bad state: " + this.message; + } + }; + A.ConcurrentModificationError.prototype = { + toString$0(_) { + var t1 = this.modifiedObject; + if (t1 == null) + return "Concurrent modification during iteration."; + return "Concurrent modification during iteration: " + A.Error_safeToString(t1) + "."; + } + }; + A.OutOfMemoryError.prototype = { + toString$0(_) { + return "Out of Memory"; + }, + get$stackTrace() { + return null; + }, + $isError: 1 + }; + A.StackOverflowError.prototype = { + toString$0(_) { + return "Stack Overflow"; + }, + get$stackTrace() { + return null; + }, + $isError: 1 + }; + A._Exception.prototype = { + toString$0(_) { + return "Exception: " + this.message; + }, + $isException: 1 + }; + A.FormatException.prototype = { + toString$0(_) { + var t1, lineEnd, lineNum, lineStart, previousCharWasCR, i, char, end, start, prefix, postfix, + message = this.message, + report = "" !== message ? "FormatException: " + message : "FormatException", + offset = this.offset, + source = this.source; + if (typeof source == "string") { + if (offset != null) + t1 = offset < 0 || offset > source.length; + else + t1 = false; + if (t1) + offset = null; + if (offset == null) { + if (source.length > 78) + source = B.JSString_methods.substring$2(source, 0, 75) + "..."; + return report + "\n" + source; + } + for (lineEnd = source.length, lineNum = 1, lineStart = 0, previousCharWasCR = false, i = 0; i < offset; ++i) { + if (!(i < lineEnd)) + return A.ioore(source, i); + char = source.charCodeAt(i); + if (char === 10) { + if (lineStart !== i || !previousCharWasCR) + ++lineNum; + lineStart = i + 1; + previousCharWasCR = false; + } else if (char === 13) { + ++lineNum; + lineStart = i + 1; + previousCharWasCR = true; + } + } + report = lineNum > 1 ? report + (" (at line " + lineNum + ", character " + (offset - lineStart + 1) + ")\n") : report + (" (at character " + (offset + 1) + ")\n"); + for (i = offset; i < lineEnd; ++i) { + if (!(i >= 0)) + return A.ioore(source, i); + char = source.charCodeAt(i); + if (char === 10 || char === 13) { + lineEnd = i; + break; + } + } + if (lineEnd - lineStart > 78) + if (offset - lineStart < 75) { + end = lineStart + 75; + start = lineStart; + prefix = ""; + postfix = "..."; + } else { + if (lineEnd - offset < 75) { + start = lineEnd - 75; + end = lineEnd; + postfix = ""; + } else { + start = offset - 36; + end = offset + 36; + postfix = "..."; + } + prefix = "..."; + } + else { + end = lineEnd; + start = lineStart; + prefix = ""; + postfix = ""; + } + return report + prefix + B.JSString_methods.substring$2(source, start, end) + postfix + "\n" + B.JSString_methods.$mul(" ", offset - start + prefix.length) + "^\n"; + } else + return offset != null ? report + (" (at offset " + A.S(offset) + ")") : report; + }, + $isException: 1 + }; + A.Iterable.prototype = { + cast$1$0(_, $R) { + return A.CastIterable_CastIterable(this, A._instanceType(this)._eval$1("Iterable.E"), $R); + }, + map$1$1(_, toElement, $T) { + var t1 = A._instanceType(this); + return A.MappedIterable_MappedIterable(this, t1._bind$1($T)._eval$1("1(Iterable.E)")._as(toElement), t1._eval$1("Iterable.E"), $T); + }, + contains$1(_, element) { + var t1; + for (t1 = this.get$iterator(this); t1.moveNext$0();) + if (J.$eq$(t1.get$current(), element)) + return true; + return false; + }, + join$1(_, separator) { + var first, t1, + iterator = this.get$iterator(this); + if (!iterator.moveNext$0()) + return ""; + first = J.toString$0$(iterator.get$current()); + if (!iterator.moveNext$0()) + return first; + if (separator.length === 0) { + t1 = first; + do + t1 += J.toString$0$(iterator.get$current()); + while (iterator.moveNext$0()); + } else { + t1 = first; + do + t1 = t1 + separator + J.toString$0$(iterator.get$current()); + while (iterator.moveNext$0()); + } + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + toList$1$growable(_, growable) { + return A.List_List$of(this, growable, A._instanceType(this)._eval$1("Iterable.E")); + }, + toList$0($receiver) { + return this.toList$1$growable($receiver, true); + }, + get$length(_) { + var count, + it = this.get$iterator(this); + for (count = 0; it.moveNext$0();) + ++count; + return count; + }, + get$isEmpty(_) { + return !this.get$iterator(this).moveNext$0(); + }, + skip$1(_, count) { + return A.SkipIterable_SkipIterable(this, count, A._instanceType(this)._eval$1("Iterable.E")); + }, + skipWhile$1(_, test) { + var t1 = A._instanceType(this); + return new A.SkipWhileIterable(this, t1._eval$1("bool(Iterable.E)")._as(test), t1._eval$1("SkipWhileIterable")); + }, + get$first(_) { + var it = this.get$iterator(this); + if (!it.moveNext$0()) + throw A.wrapException(A.IterableElementError_noElement()); + return it.get$current(); + }, + get$last(_) { + var result, + it = this.get$iterator(this); + if (!it.moveNext$0()) + throw A.wrapException(A.IterableElementError_noElement()); + do + result = it.get$current(); + while (it.moveNext$0()); + return result; + }, + elementAt$1(_, index) { + var iterator, skipCount; + A.RangeError_checkNotNegative(index, "index"); + iterator = this.get$iterator(this); + for (skipCount = index; iterator.moveNext$0();) { + if (skipCount === 0) + return iterator.get$current(); + --skipCount; + } + throw A.wrapException(A.IndexError$withLength(index, index - skipCount, this, "index")); + }, + toString$0(_) { + return A.Iterable_iterableToShortString(this, "(", ")"); + } + }; + A.MapEntry.prototype = { + toString$0(_) { + return "MapEntry(" + A.S(this.key) + ": " + A.S(this.value) + ")"; + } + }; + A.Null.prototype = { + get$hashCode(_) { + return A.Object.prototype.get$hashCode.call(this, this); + }, + toString$0(_) { + return "null"; + } + }; + A.Object.prototype = {$isObject: 1, + $eq(_, other) { + return this === other; + }, + get$hashCode(_) { + return A.Primitives_objectHashCode(this); + }, + toString$0(_) { + return "Instance of '" + A.Primitives_objectTypeName(this) + "'"; + }, + get$runtimeType(_) { + return A.getRuntimeTypeOfDartObject(this); + }, + toString() { + return this.toString$0(this); + } + }; + A._StringStackTrace.prototype = { + toString$0(_) { + return this._stackTrace; + }, + $isStackTrace: 1 + }; + A.StringBuffer.prototype = { + get$length(_) { + return this._contents.length; + }, + toString$0(_) { + var t1 = this._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isStringSink: 1 + }; + A.Uri__parseIPv4Address_error.prototype = { + call$2(msg, position) { + throw A.wrapException(A.FormatException$("Illegal IPv4 address, " + msg, this.host, position)); + }, + $signature: 45 + }; + A.Uri_parseIPv6Address_error.prototype = { + call$2(msg, position) { + throw A.wrapException(A.FormatException$("Illegal IPv6 address, " + msg, this.host, position)); + }, + $signature: 47 + }; + A.Uri_parseIPv6Address_parseHex.prototype = { + call$2(start, end) { + var value; + if (end - start > 4) + this.error.call$2("an IPv6 part can only contain a maximum of 4 hex digits", start); + value = A.int_parse(B.JSString_methods.substring$2(this.host, start, end), 16); + if (value < 0 || value > 65535) + this.error.call$2("each part must be in the range of `0x0..0xFFFF`", start); + return value; + }, + $signature: 50 + }; + A._Uri.prototype = { + get$_text() { + var t1, t2, t3, t4, _this = this, + value = _this.___Uri__text_FI; + if (value === $) { + t1 = _this.scheme; + t2 = t1.length !== 0 ? "" + t1 + ":" : ""; + t3 = _this._host; + t4 = t3 == null; + if (!t4 || t1 === "file") { + t1 = t2 + "//"; + t2 = _this._userInfo; + if (t2.length !== 0) + t1 = t1 + t2 + "@"; + if (!t4) + t1 += t3; + t2 = _this._port; + if (t2 != null) + t1 = t1 + ":" + A.S(t2); + } else + t1 = t2; + t1 += _this.path; + t2 = _this._query; + if (t2 != null) + t1 = t1 + "?" + t2; + t2 = _this._fragment; + if (t2 != null) + t1 = t1 + "#" + t2; + value !== $ && A.throwLateFieldADI("_text"); + value = _this.___Uri__text_FI = t1.charCodeAt(0) == 0 ? t1 : t1; + } + return value; + }, + get$pathSegments() { + var pathToSplit, t1, result, _this = this, + value = _this.___Uri_pathSegments_FI; + if (value === $) { + pathToSplit = _this.path; + t1 = pathToSplit.length; + if (t1 !== 0) { + if (0 >= t1) + return A.ioore(pathToSplit, 0); + t1 = pathToSplit.charCodeAt(0) === 47; + } else + t1 = false; + if (t1) + pathToSplit = B.JSString_methods.substring$1(pathToSplit, 1); + result = pathToSplit.length === 0 ? B.List_empty : A.List_List$unmodifiable(new A.MappedListIterable(A._setArrayType(pathToSplit.split("/"), type$.JSArray_String), type$.dynamic_Function_String._as(A.core_Uri_decodeComponent$closure()), type$.MappedListIterable_String_dynamic), type$.String); + _this.___Uri_pathSegments_FI !== $ && A.throwLateFieldADI("pathSegments"); + _this.set$___Uri_pathSegments_FI(result); + value = result; + } + return value; + }, + get$hashCode(_) { + var result, _this = this, + value = _this.___Uri_hashCode_FI; + if (value === $) { + result = B.JSString_methods.get$hashCode(_this.get$_text()); + _this.___Uri_hashCode_FI !== $ && A.throwLateFieldADI("hashCode"); + _this.___Uri_hashCode_FI = result; + value = result; + } + return value; + }, + get$userInfo() { + return this._userInfo; + }, + get$host() { + var host = this._host; + if (host == null) + return ""; + if (B.JSString_methods.startsWith$1(host, "[")) + return B.JSString_methods.substring$2(host, 1, host.length - 1); + return host; + }, + get$port() { + var t1 = this._port; + return t1 == null ? A._Uri__defaultPort(this.scheme) : t1; + }, + get$query() { + var t1 = this._query; + return t1 == null ? "" : t1; + }, + get$fragment() { + var t1 = this._fragment; + return t1 == null ? "" : t1; + }, + isScheme$1(scheme) { + var thisScheme = this.scheme; + if (scheme.length !== thisScheme.length) + return false; + return A._caseInsensitiveCompareStart(scheme, thisScheme, 0) >= 0; + }, + _mergePaths$2(base, reference) { + var backCount, refStart, baseEnd, t1, newEnd, delta, t2, t3; + for (backCount = 0, refStart = 0; B.JSString_methods.startsWith$2(reference, "../", refStart);) { + refStart += 3; + ++backCount; + } + baseEnd = B.JSString_methods.lastIndexOf$1(base, "/"); + t1 = base.length; + while (true) { + if (!(baseEnd > 0 && backCount > 0)) + break; + newEnd = B.JSString_methods.lastIndexOf$2(base, "/", baseEnd - 1); + if (newEnd < 0) + break; + delta = baseEnd - newEnd; + t2 = delta !== 2; + if (!t2 || delta === 3) { + t3 = newEnd + 1; + if (!(t3 < t1)) + return A.ioore(base, t3); + if (base.charCodeAt(t3) === 46) + if (t2) { + t2 = newEnd + 2; + if (!(t2 < t1)) + return A.ioore(base, t2); + t2 = base.charCodeAt(t2) === 46; + } else + t2 = true; + else + t2 = false; + } else + t2 = false; + if (t2) + break; + --backCount; + baseEnd = newEnd; + } + return B.JSString_methods.replaceRange$3(base, baseEnd + 1, null, B.JSString_methods.substring$1(reference, refStart - 3 * backCount)); + }, + resolve$1(reference) { + return this.resolveUri$1(A.Uri_parse(reference)); + }, + resolveUri$1(reference) { + var targetScheme, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, packageNameEnd, packageName, mergedPath, t1, _this = this, _null = null; + if (reference.get$scheme().length !== 0) { + targetScheme = reference.get$scheme(); + if (reference.get$hasAuthority()) { + targetUserInfo = reference.get$userInfo(); + targetHost = reference.get$host(); + targetPort = reference.get$hasPort() ? reference.get$port() : _null; + } else { + targetPort = _null; + targetHost = targetPort; + targetUserInfo = ""; + } + targetPath = A._Uri__removeDotSegments(reference.get$path()); + targetQuery = reference.get$hasQuery() ? reference.get$query() : _null; + } else { + targetScheme = _this.scheme; + if (reference.get$hasAuthority()) { + targetUserInfo = reference.get$userInfo(); + targetHost = reference.get$host(); + targetPort = A._Uri__makePort(reference.get$hasPort() ? reference.get$port() : _null, targetScheme); + targetPath = A._Uri__removeDotSegments(reference.get$path()); + targetQuery = reference.get$hasQuery() ? reference.get$query() : _null; + } else { + targetUserInfo = _this._userInfo; + targetHost = _this._host; + targetPort = _this._port; + targetPath = _this.path; + if (reference.get$path() === "") + targetQuery = reference.get$hasQuery() ? reference.get$query() : _this._query; + else { + packageNameEnd = A._Uri__packageNameEnd(_this, targetPath); + if (packageNameEnd > 0) { + packageName = B.JSString_methods.substring$2(targetPath, 0, packageNameEnd); + targetPath = reference.get$hasAbsolutePath() ? packageName + A._Uri__removeDotSegments(reference.get$path()) : packageName + A._Uri__removeDotSegments(_this._mergePaths$2(B.JSString_methods.substring$1(targetPath, packageName.length), reference.get$path())); + } else if (reference.get$hasAbsolutePath()) + targetPath = A._Uri__removeDotSegments(reference.get$path()); + else if (targetPath.length === 0) + if (targetHost == null) + targetPath = targetScheme.length === 0 ? reference.get$path() : A._Uri__removeDotSegments(reference.get$path()); + else + targetPath = A._Uri__removeDotSegments("/" + reference.get$path()); + else { + mergedPath = _this._mergePaths$2(targetPath, reference.get$path()); + t1 = targetScheme.length === 0; + if (!t1 || targetHost != null || B.JSString_methods.startsWith$1(targetPath, "/")) + targetPath = A._Uri__removeDotSegments(mergedPath); + else + targetPath = A._Uri__normalizeRelativePath(mergedPath, !t1 || targetHost != null); + } + targetQuery = reference.get$hasQuery() ? reference.get$query() : _null; + } + } + } + return A._Uri$_internal(targetScheme, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, reference.get$hasFragment() ? reference.get$fragment() : _null); + }, + get$hasAuthority() { + return this._host != null; + }, + get$hasPort() { + return this._port != null; + }, + get$hasQuery() { + return this._query != null; + }, + get$hasFragment() { + return this._fragment != null; + }, + get$hasAbsolutePath() { + return B.JSString_methods.startsWith$1(this.path, "/"); + }, + toFilePath$0() { + var pathSegments, _this = this, + t1 = _this.scheme; + if (t1 !== "" && t1 !== "file") + throw A.wrapException(A.UnsupportedError$("Cannot extract a file path from a " + t1 + " URI")); + t1 = _this._query; + if ((t1 == null ? "" : t1) !== "") + throw A.wrapException(A.UnsupportedError$(string$.Cannotfq)); + t1 = _this._fragment; + if ((t1 == null ? "" : t1) !== "") + throw A.wrapException(A.UnsupportedError$(string$.Cannotff)); + t1 = $.$get$_Uri__isWindowsCached(); + if (t1) + t1 = A._Uri__toWindowsFilePath(_this); + else { + if (_this._host != null && _this.get$host() !== "") + A.throwExpression(A.UnsupportedError$(string$.Cannotn)); + pathSegments = _this.get$pathSegments(); + A._Uri__checkNonWindowsPathReservedCharacters(pathSegments, false); + t1 = A.StringBuffer__writeAll(B.JSString_methods.startsWith$1(_this.path, "/") ? "" + "/" : "", pathSegments, "/"); + t1 = t1.charCodeAt(0) == 0 ? t1 : t1; + } + return t1; + }, + toString$0(_) { + return this.get$_text(); + }, + $eq(_, other) { + var t1, t2, _this = this; + if (other == null) + return false; + if (_this === other) + return true; + if (type$.Uri._is(other)) + if (_this.scheme === other.get$scheme()) + if (_this._host != null === other.get$hasAuthority()) + if (_this._userInfo === other.get$userInfo()) + if (_this.get$host() === other.get$host()) + if (_this.get$port() === other.get$port()) + if (_this.path === other.get$path()) { + t1 = _this._query; + t2 = t1 == null; + if (!t2 === other.get$hasQuery()) { + if (t2) + t1 = ""; + if (t1 === other.get$query()) { + t1 = _this._fragment; + t2 = t1 == null; + if (!t2 === other.get$hasFragment()) { + if (t2) + t1 = ""; + t1 = t1 === other.get$fragment(); + } else + t1 = false; + } else + t1 = false; + } else + t1 = false; + } else + t1 = false; + else + t1 = false; + else + t1 = false; + else + t1 = false; + else + t1 = false; + else + t1 = false; + else + t1 = false; + return t1; + }, + set$___Uri_pathSegments_FI(___Uri_pathSegments_FI) { + this.___Uri_pathSegments_FI = type$.List_String._as(___Uri_pathSegments_FI); + }, + $isUri: 1, + get$scheme() { + return this.scheme; + }, + get$path() { + return this.path; + } + }; + A._Uri__makePath_closure.prototype = { + call$1(s) { + return A._Uri__uriEncode(B.List_XRg0, A._asString(s), B.C_Utf8Codec, false); + }, + $signature: 11 + }; + A.UriData.prototype = { + get$uri() { + var t2, queryIndex, end, query, _this = this, _null = null, + t1 = _this._uriCache; + if (t1 == null) { + t1 = _this._separatorIndices; + if (0 >= t1.length) + return A.ioore(t1, 0); + t2 = _this._text; + t1 = t1[0] + 1; + queryIndex = B.JSString_methods.indexOf$2(t2, "?", t1); + end = t2.length; + if (queryIndex >= 0) { + query = A._Uri__normalizeOrSubstring(t2, queryIndex + 1, end, B.List_oFp, false, false); + end = queryIndex; + } else + query = _null; + t1 = _this._uriCache = new A._DataUri("data", "", _null, _null, A._Uri__normalizeOrSubstring(t2, t1, end, B.List_XRg, false, false), query, _null); + } + return t1; + }, + toString$0(_) { + var t2, + t1 = this._separatorIndices; + if (0 >= t1.length) + return A.ioore(t1, 0); + t2 = this._text; + return t1[0] === -1 ? "data:" + t2 : t2; + } + }; + A._createTables_build.prototype = { + call$2(state, defaultTransition) { + var t1 = this.tables; + if (!(state < t1.length)) + return A.ioore(t1, state); + t1 = t1[state]; + B.NativeUint8List_methods.fillRange$3(t1, 0, 96, defaultTransition); + return t1; + }, + $signature: 63 + }; + A._createTables_setChars.prototype = { + call$3(target, chars, transition) { + var t1, i, t2; + for (t1 = chars.length, i = 0; i < t1; ++i) { + t2 = chars.charCodeAt(i) ^ 96; + if (!(t2 < 96)) + return A.ioore(target, t2); + target[t2] = transition; + } + }, + $signature: 12 + }; + A._createTables_setRange.prototype = { + call$3(target, range, transition) { + var i, n, + t1 = range.length; + if (0 >= t1) + return A.ioore(range, 0); + i = range.charCodeAt(0); + if (1 >= t1) + return A.ioore(range, 1); + n = range.charCodeAt(1); + for (; i <= n; ++i) { + t1 = (i ^ 96) >>> 0; + if (!(t1 < 96)) + return A.ioore(target, t1); + target[t1] = transition; + } + }, + $signature: 12 + }; + A._SimpleUri.prototype = { + get$hasAuthority() { + return this._hostStart > 0; + }, + get$hasPort() { + return this._hostStart > 0 && this._portStart + 1 < this._pathStart; + }, + get$hasQuery() { + return this._queryStart < this._fragmentStart; + }, + get$hasFragment() { + return this._fragmentStart < this._uri.length; + }, + get$hasAbsolutePath() { + return B.JSString_methods.startsWith$2(this._uri, "/", this._pathStart); + }, + get$scheme() { + var t1 = this._schemeCache; + return t1 == null ? this._schemeCache = this._computeScheme$0() : t1; + }, + _computeScheme$0() { + var t2, _this = this, + t1 = _this._schemeEnd; + if (t1 <= 0) + return ""; + t2 = t1 === 4; + if (t2 && B.JSString_methods.startsWith$1(_this._uri, "http")) + return "http"; + if (t1 === 5 && B.JSString_methods.startsWith$1(_this._uri, "https")) + return "https"; + if (t2 && B.JSString_methods.startsWith$1(_this._uri, "file")) + return "file"; + if (t1 === 7 && B.JSString_methods.startsWith$1(_this._uri, "package")) + return "package"; + return B.JSString_methods.substring$2(_this._uri, 0, t1); + }, + get$userInfo() { + var t1 = this._hostStart, + t2 = this._schemeEnd + 3; + return t1 > t2 ? B.JSString_methods.substring$2(this._uri, t2, t1 - 1) : ""; + }, + get$host() { + var t1 = this._hostStart; + return t1 > 0 ? B.JSString_methods.substring$2(this._uri, t1, this._portStart) : ""; + }, + get$port() { + var t1, _this = this; + if (_this.get$hasPort()) + return A.int_parse(B.JSString_methods.substring$2(_this._uri, _this._portStart + 1, _this._pathStart), null); + t1 = _this._schemeEnd; + if (t1 === 4 && B.JSString_methods.startsWith$1(_this._uri, "http")) + return 80; + if (t1 === 5 && B.JSString_methods.startsWith$1(_this._uri, "https")) + return 443; + return 0; + }, + get$path() { + return B.JSString_methods.substring$2(this._uri, this._pathStart, this._queryStart); + }, + get$query() { + var t1 = this._queryStart, + t2 = this._fragmentStart; + return t1 < t2 ? B.JSString_methods.substring$2(this._uri, t1 + 1, t2) : ""; + }, + get$fragment() { + var t1 = this._fragmentStart, + t2 = this._uri; + return t1 < t2.length ? B.JSString_methods.substring$1(t2, t1 + 1) : ""; + }, + get$pathSegments() { + var parts, t2, i, + start = this._pathStart, + end = this._queryStart, + t1 = this._uri; + if (B.JSString_methods.startsWith$2(t1, "/", start)) + ++start; + if (start === end) + return B.List_empty; + parts = A._setArrayType([], type$.JSArray_String); + for (t2 = t1.length, i = start; i < end; ++i) { + if (!(i >= 0 && i < t2)) + return A.ioore(t1, i); + if (t1.charCodeAt(i) === 47) { + B.JSArray_methods.add$1(parts, B.JSString_methods.substring$2(t1, start, i)); + start = i + 1; + } + } + B.JSArray_methods.add$1(parts, B.JSString_methods.substring$2(t1, start, end)); + return A.List_List$unmodifiable(parts, type$.String); + }, + _isPort$1(port) { + var portDigitStart = this._portStart + 1; + return portDigitStart + port.length === this._pathStart && B.JSString_methods.startsWith$2(this._uri, port, portDigitStart); + }, + removeFragment$0() { + var _this = this, + t1 = _this._fragmentStart, + t2 = _this._uri; + if (t1 >= t2.length) + return _this; + return new A._SimpleUri(B.JSString_methods.substring$2(t2, 0, t1), _this._schemeEnd, _this._hostStart, _this._portStart, _this._pathStart, _this._queryStart, t1, _this._schemeCache); + }, + resolve$1(reference) { + return this.resolveUri$1(A.Uri_parse(reference)); + }, + resolveUri$1(reference) { + if (reference instanceof A._SimpleUri) + return this._simpleMerge$2(this, reference); + return this._toNonSimple$0().resolveUri$1(reference); + }, + _simpleMerge$2(base, ref) { + var t2, t3, t4, isSimple, delta, refStart, basePathStart, packageNameEnd, basePathStart0, baseStart, baseEnd, baseUri, baseStart0, backCount, refStart0, insert, + t1 = ref._schemeEnd; + if (t1 > 0) + return ref; + t2 = ref._hostStart; + if (t2 > 0) { + t3 = base._schemeEnd; + if (t3 <= 0) + return ref; + t4 = t3 === 4; + if (t4 && B.JSString_methods.startsWith$1(base._uri, "file")) + isSimple = ref._pathStart !== ref._queryStart; + else if (t4 && B.JSString_methods.startsWith$1(base._uri, "http")) + isSimple = !ref._isPort$1("80"); + else + isSimple = !(t3 === 5 && B.JSString_methods.startsWith$1(base._uri, "https")) || !ref._isPort$1("443"); + if (isSimple) { + delta = t3 + 1; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, delta) + B.JSString_methods.substring$1(ref._uri, t1 + 1), t3, t2 + delta, ref._portStart + delta, ref._pathStart + delta, ref._queryStart + delta, ref._fragmentStart + delta, base._schemeCache); + } else + return this._toNonSimple$0().resolveUri$1(ref); + } + refStart = ref._pathStart; + t1 = ref._queryStart; + if (refStart === t1) { + t2 = ref._fragmentStart; + if (t1 < t2) { + t3 = base._queryStart; + delta = t3 - t1; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, t3) + B.JSString_methods.substring$1(ref._uri, t1), base._schemeEnd, base._hostStart, base._portStart, base._pathStart, t1 + delta, t2 + delta, base._schemeCache); + } + t1 = ref._uri; + if (t2 < t1.length) { + t3 = base._fragmentStart; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, t3) + B.JSString_methods.substring$1(t1, t2), base._schemeEnd, base._hostStart, base._portStart, base._pathStart, base._queryStart, t2 + (t3 - t2), base._schemeCache); + } + return base.removeFragment$0(); + } + t2 = ref._uri; + if (B.JSString_methods.startsWith$2(t2, "/", refStart)) { + basePathStart = base._pathStart; + packageNameEnd = A._SimpleUri__packageNameEnd(this); + basePathStart0 = packageNameEnd > 0 ? packageNameEnd : basePathStart; + delta = basePathStart0 - refStart; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, basePathStart0) + B.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, basePathStart, t1 + delta, ref._fragmentStart + delta, base._schemeCache); + } + baseStart = base._pathStart; + baseEnd = base._queryStart; + if (baseStart === baseEnd && base._hostStart > 0) { + for (; B.JSString_methods.startsWith$2(t2, "../", refStart);) + refStart += 3; + delta = baseStart - refStart + 1; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, baseStart) + "/" + B.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, baseStart, t1 + delta, ref._fragmentStart + delta, base._schemeCache); + } + baseUri = base._uri; + packageNameEnd = A._SimpleUri__packageNameEnd(this); + if (packageNameEnd >= 0) + baseStart0 = packageNameEnd; + else + for (baseStart0 = baseStart; B.JSString_methods.startsWith$2(baseUri, "../", baseStart0);) + baseStart0 += 3; + backCount = 0; + while (true) { + refStart0 = refStart + 3; + if (!(refStart0 <= t1 && B.JSString_methods.startsWith$2(t2, "../", refStart))) + break; + ++backCount; + refStart = refStart0; + } + for (t3 = baseUri.length, insert = ""; baseEnd > baseStart0;) { + --baseEnd; + if (!(baseEnd >= 0 && baseEnd < t3)) + return A.ioore(baseUri, baseEnd); + if (baseUri.charCodeAt(baseEnd) === 47) { + if (backCount === 0) { + insert = "/"; + break; + } + --backCount; + insert = "/"; + } + } + if (baseEnd === baseStart0 && base._schemeEnd <= 0 && !B.JSString_methods.startsWith$2(baseUri, "/", baseStart)) { + refStart -= backCount * 3; + insert = ""; + } + delta = baseEnd - refStart + insert.length; + return new A._SimpleUri(B.JSString_methods.substring$2(baseUri, 0, baseEnd) + insert + B.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, baseStart, t1 + delta, ref._fragmentStart + delta, base._schemeCache); + }, + toFilePath$0() { + var t2, t3, _this = this, + t1 = _this._schemeEnd; + if (t1 >= 0) { + t2 = !(t1 === 4 && B.JSString_methods.startsWith$1(_this._uri, "file")); + t1 = t2; + } else + t1 = false; + if (t1) + throw A.wrapException(A.UnsupportedError$("Cannot extract a file path from a " + _this.get$scheme() + " URI")); + t1 = _this._queryStart; + t2 = _this._uri; + if (t1 < t2.length) { + if (t1 < _this._fragmentStart) + throw A.wrapException(A.UnsupportedError$(string$.Cannotfq)); + throw A.wrapException(A.UnsupportedError$(string$.Cannotff)); + } + t3 = $.$get$_Uri__isWindowsCached(); + if (t3) + t1 = A._Uri__toWindowsFilePath(_this); + else { + if (_this._hostStart < _this._portStart) + A.throwExpression(A.UnsupportedError$(string$.Cannotn)); + t1 = B.JSString_methods.substring$2(t2, _this._pathStart, t1); + } + return t1; + }, + get$hashCode(_) { + var t1 = this._hashCodeCache; + return t1 == null ? this._hashCodeCache = B.JSString_methods.get$hashCode(this._uri) : t1; + }, + $eq(_, other) { + if (other == null) + return false; + if (this === other) + return true; + return type$.Uri._is(other) && this._uri === other.toString$0(0); + }, + _toNonSimple$0() { + var _this = this, _null = null, + t1 = _this.get$scheme(), + t2 = _this.get$userInfo(), + t3 = _this._hostStart > 0 ? _this.get$host() : _null, + t4 = _this.get$hasPort() ? _this.get$port() : _null, + t5 = _this._uri, + t6 = _this._queryStart, + t7 = B.JSString_methods.substring$2(t5, _this._pathStart, t6), + t8 = _this._fragmentStart; + t6 = t6 < t8 ? _this.get$query() : _null; + return A._Uri$_internal(t1, t2, t3, t4, t7, t6, t8 < t5.length ? _this.get$fragment() : _null); + }, + toString$0(_) { + return this._uri; + }, + $isUri: 1 + }; + A._DataUri.prototype = {}; + A.Expando.prototype = { + $indexSet(_, object, value) { + type$.Object._as(object); + this.$ti._eval$1("1?")._as(value); + this._jsWeakMap.set(object, value); + }, + toString$0(_) { + return "Expando:" + this.name; + } + }; + A.SystemEncoding.prototype = {}; + A.wrapMain_closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Never), + $async$self = this, t1, t2; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return A._asyncAwait($async$self.mainFn.call$0(), $async$call$0); + case 2: + // returning from await. + t1 = self; + t2 = type$.JSObject; + $async$goto = 3; + return A._asyncAwait(A.Core_withGroup(t2._as(t1.core), "Clean up (Success)", new A.wrapMain__closure0(), type$.void), $async$call$0); + case 3: + // returning from await. + type$.Never._as(t2._as(t1.process).exit(0)); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 20 + }; + A.wrapMain__closure0.prototype = { + call$0() { + return $.$get$context0().runTearDowns$1(B.ActionResult_0); + }, + $signature: 6 + }; + A.wrapMain_closure0.prototype = { + call$2(error, chain) { + return this.$call$body$wrapMain_closure(type$.Object._as(error), type$.Chain._as(chain)); + }, + $call$body$wrapMain_closure(error, chain) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + t1, t2, t3, t4, mappedStackChain; + var $async$call$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = self; + t2 = type$.JSObject; + t3 = t2._as(t1.fs); + t4 = A._asString(t1.__dirname); + mappedStackChain = A.mapStackTrace(A.parseJson(type$.Map_dynamic_dynamic._as(B.C_JsonCodec.decode$2$reviver(A._asString(t3.readFileSync($.$get$context().join$16(0, t4, "main.cjs.map", null, null, null, null, null, null, null, null, null, null, null, null, null, null), "utf8")), null)), null, null), chain, false, null, null); + t4 = t2._as(t1.core); + t4.error(J.toString$0$(error)); + t4.error(mappedStackChain.toString$0(0)); + t4.error(chain.toString$0(0)); + $async$goto = 2; + return A._asyncAwait(A.Core_withGroup(t2._as(t1.core), "Clean up (Failure)", new A.wrapMain__closure(), type$.void), $async$call$2); + case 2: + // returning from await. + A.Core_setFailed(t2._as(t1.core), "Action failed with error: " + A.S(error)); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$2, $async$completer); + }, + $signature: 24 + }; + A.wrapMain__closure.prototype = { + call$0() { + return $.$get$context0().runTearDowns$1(B.ActionResult_1); + }, + $signature: 6 + }; + A.ActionContext.prototype = { + runTearDowns$1(result) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, t2; + var $async$runTearDowns$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = result === B.ActionResult_0 ? $async$self._successTearDowns : $async$self._errorTearDowns; + t2 = A._arrayInstanceType(t1); + $async$goto = 2; + return A._asyncAwait(A.Future_wait(new A.MappedListIterable(t1, t2._eval$1("Future<~()>(1)")._as(B.CONSTANT0), t2._eval$1("MappedListIterable<1,Future<~()>>")), type$.void_Function), $async$runTearDowns$1); + case 2: + // returning from await. + type$.JSObject._as(self.core).info("Clean up completed"); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$runTearDowns$1, $async$completer); + } + }; + A.ActionResult.prototype = { + _enumToString$0() { + return "ActionResult." + this._core$_name; + } + }; + A.get_closure.prototype = { + call$1(client) { + return client.$get$2$headers(this.url, this.headers); + }, + $signature: 25 + }; + A.Context.prototype = { + absolute$15(part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15) { + var t1; + A._validateArgList("absolute", A._setArrayType([part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15], type$.JSArray_nullable_String)); + t1 = this.style; + t1 = t1.rootLength$1(part1) > 0 && !t1.isRootRelative$1(part1); + if (t1) + return part1; + t1 = this._context$_current; + return this.join$16(0, t1 == null ? A.current() : t1, part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15); + }, + absolute$1(part1) { + return this.absolute$15(part1, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + }, + join$16(_, part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15, part16) { + var parts = A._setArrayType([part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15, part16], type$.JSArray_nullable_String); + A._validateArgList("join", parts); + return this.joinAll$1(new A.WhereTypeIterable(parts, type$.WhereTypeIterable_String)); + }, + join$2($receiver, part1, part2) { + return this.join$16($receiver, part1, part2, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + }, + joinAll$1(parts) { + var t1, t2, t3, needsSeparator, isAbsoluteAndNotRootRelative, t4, t5, parsed, path, t6; + type$.Iterable_String._as(parts); + for (t1 = parts.$ti, t2 = t1._eval$1("bool(Iterable.E)")._as(new A.Context_joinAll_closure()), t3 = parts.get$iterator(parts), t1 = new A.WhereIterator(t3, t2, t1._eval$1("WhereIterator")), t2 = this.style, needsSeparator = false, isAbsoluteAndNotRootRelative = false, t4 = ""; t1.moveNext$0();) { + t5 = t3.get$current(); + if (t2.isRootRelative$1(t5) && isAbsoluteAndNotRootRelative) { + parsed = A.ParsedPath_ParsedPath$parse(t5, t2); + path = t4.charCodeAt(0) == 0 ? t4 : t4; + t4 = B.JSString_methods.substring$2(path, 0, t2.rootLength$2$withDrive(path, true)); + parsed.root = t4; + if (t2.needsSeparator$1(t4)) + B.JSArray_methods.$indexSet(parsed.separators, 0, t2.get$separator()); + t4 = "" + parsed.toString$0(0); + } else if (t2.rootLength$1(t5) > 0) { + isAbsoluteAndNotRootRelative = !t2.isRootRelative$1(t5); + t4 = "" + t5; + } else { + t6 = t5.length; + if (t6 !== 0) { + if (0 >= t6) + return A.ioore(t5, 0); + t6 = t2.containsSeparator$1(t5[0]); + } else + t6 = false; + if (!t6) + if (needsSeparator) + t4 += t2.get$separator(); + t4 += t5; + } + needsSeparator = t2.needsSeparator$1(t5); + } + return t4.charCodeAt(0) == 0 ? t4 : t4; + }, + split$1(_, path) { + var parsed = A.ParsedPath_ParsedPath$parse(path, this.style), + t1 = parsed.parts, + t2 = A._arrayInstanceType(t1), + t3 = t2._eval$1("WhereIterable<1>"); + parsed.set$parts(A.List_List$of(new A.WhereIterable(t1, t2._eval$1("bool(1)")._as(new A.Context_split_closure()), t3), true, t3._eval$1("Iterable.E"))); + t1 = parsed.root; + if (t1 != null) + B.JSArray_methods.insert$2(parsed.parts, 0, t1); + return parsed.parts; + }, + normalize$1(path) { + var parsed; + if (!this._needsNormalization$1(path)) + return path; + parsed = A.ParsedPath_ParsedPath$parse(path, this.style); + parsed.normalize$0(); + return parsed.toString$0(0); + }, + _needsNormalization$1(path) { + var t2, i, start, previous, t3, previousPrevious, codeUnit, t4, + t1 = this.style, + root = t1.rootLength$1(path); + if (root !== 0) { + if (t1 === $.$get$Style_windows()) + for (t2 = path.length, i = 0; i < root; ++i) { + if (!(i < t2)) + return A.ioore(path, i); + if (path.charCodeAt(i) === 47) + return true; + } + start = root; + previous = 47; + } else { + start = 0; + previous = null; + } + for (t2 = new A.CodeUnits(path).__internal$_string, t3 = t2.length, i = start, previousPrevious = null; i < t3; ++i, previousPrevious = previous, previous = codeUnit) { + if (!(i >= 0)) + return A.ioore(t2, i); + codeUnit = t2.charCodeAt(i); + if (t1.isSeparator$1(codeUnit)) { + if (t1 === $.$get$Style_windows() && codeUnit === 47) + return true; + if (previous != null && t1.isSeparator$1(previous)) + return true; + if (previous === 46) + t4 = previousPrevious == null || previousPrevious === 46 || t1.isSeparator$1(previousPrevious); + else + t4 = false; + if (t4) + return true; + } + } + if (previous == null) + return true; + if (t1.isSeparator$1(previous)) + return true; + if (previous === 46) + t1 = previousPrevious == null || t1.isSeparator$1(previousPrevious) || previousPrevious === 46; + else + t1 = false; + if (t1) + return true; + return false; + }, + relative$2$from(path, from) { + var fromParsed, pathParsed, t2, t3, t4, t5, _this = this, + _s26_ = 'Unable to find a path to "', + t1 = from == null; + if (t1 && _this.style.rootLength$1(path) <= 0) + return _this.normalize$1(path); + if (t1) { + t1 = _this._context$_current; + from = t1 == null ? A.current() : t1; + } else + from = _this.absolute$1(from); + t1 = _this.style; + if (t1.rootLength$1(from) <= 0 && t1.rootLength$1(path) > 0) + return _this.normalize$1(path); + if (t1.rootLength$1(path) <= 0 || t1.isRootRelative$1(path)) + path = _this.absolute$1(path); + if (t1.rootLength$1(path) <= 0 && t1.rootLength$1(from) > 0) + throw A.wrapException(A.PathException$(_s26_ + path + '" from "' + from + '".')); + fromParsed = A.ParsedPath_ParsedPath$parse(from, t1); + fromParsed.normalize$0(); + pathParsed = A.ParsedPath_ParsedPath$parse(path, t1); + pathParsed.normalize$0(); + t2 = fromParsed.parts; + t3 = t2.length; + if (t3 !== 0) { + if (0 >= t3) + return A.ioore(t2, 0); + t2 = J.$eq$(t2[0], "."); + } else + t2 = false; + if (t2) + return pathParsed.toString$0(0); + t2 = fromParsed.root; + t3 = pathParsed.root; + if (t2 != t3) + t2 = t2 == null || t3 == null || !t1.pathsEqual$2(t2, t3); + else + t2 = false; + if (t2) + return pathParsed.toString$0(0); + while (true) { + t2 = fromParsed.parts; + t3 = t2.length; + if (t3 !== 0) { + t4 = pathParsed.parts; + t5 = t4.length; + if (t5 !== 0) { + if (0 >= t3) + return A.ioore(t2, 0); + t2 = t2[0]; + if (0 >= t5) + return A.ioore(t4, 0); + t4 = t1.pathsEqual$2(t2, t4[0]); + t2 = t4; + } else + t2 = false; + } else + t2 = false; + if (!t2) + break; + B.JSArray_methods.removeAt$1(fromParsed.parts, 0); + B.JSArray_methods.removeAt$1(fromParsed.separators, 1); + B.JSArray_methods.removeAt$1(pathParsed.parts, 0); + B.JSArray_methods.removeAt$1(pathParsed.separators, 1); + } + t2 = fromParsed.parts; + t3 = t2.length; + if (t3 !== 0) { + if (0 >= t3) + return A.ioore(t2, 0); + t2 = J.$eq$(t2[0], ".."); + } else + t2 = false; + if (t2) + throw A.wrapException(A.PathException$(_s26_ + path + '" from "' + from + '".')); + t2 = type$.String; + B.JSArray_methods.insertAll$2(pathParsed.parts, 0, A.List_List$filled(fromParsed.parts.length, "..", false, t2)); + B.JSArray_methods.$indexSet(pathParsed.separators, 0, ""); + B.JSArray_methods.insertAll$2(pathParsed.separators, 1, A.List_List$filled(fromParsed.parts.length, t1.get$separator(), false, t2)); + t1 = pathParsed.parts; + t2 = t1.length; + if (t2 === 0) + return "."; + if (t2 > 1 && J.$eq$(B.JSArray_methods.get$last(t1), ".")) { + B.JSArray_methods.removeLast$0(pathParsed.parts); + t1 = pathParsed.separators; + if (0 >= t1.length) + return A.ioore(t1, -1); + t1.pop(); + if (0 >= t1.length) + return A.ioore(t1, -1); + t1.pop(); + B.JSArray_methods.add$1(t1, ""); + } + pathParsed.root = ""; + pathParsed.removeTrailingSeparators$0(); + return pathParsed.toString$0(0); + }, + relative$1(path) { + return this.relative$2$from(path, null); + }, + _isWithinOrEquals$2($parent, child) { + var relative, t1, parentIsAbsolute, childIsAbsolute, childIsRootRelative, parentIsRootRelative, result, exception, _this = this; + $parent = A._asString($parent); + child = A._asString(child); + t1 = _this.style; + parentIsAbsolute = t1.rootLength$1(A._asString($parent)) > 0; + childIsAbsolute = t1.rootLength$1(A._asString(child)) > 0; + if (parentIsAbsolute && !childIsAbsolute) { + child = _this.absolute$1(child); + if (t1.isRootRelative$1($parent)) + $parent = _this.absolute$1($parent); + } else if (childIsAbsolute && !parentIsAbsolute) { + $parent = _this.absolute$1($parent); + if (t1.isRootRelative$1(child)) + child = _this.absolute$1(child); + } else if (childIsAbsolute && parentIsAbsolute) { + childIsRootRelative = t1.isRootRelative$1(child); + parentIsRootRelative = t1.isRootRelative$1($parent); + if (childIsRootRelative && !parentIsRootRelative) + child = _this.absolute$1(child); + else if (parentIsRootRelative && !childIsRootRelative) + $parent = _this.absolute$1($parent); + } + result = _this._isWithinOrEqualsFast$2($parent, child); + if (result !== B._PathRelation_inconclusive) + return result; + relative = null; + try { + relative = _this.relative$2$from(child, $parent); + } catch (exception) { + if (A.unwrapException(exception) instanceof A.PathException) + return B._PathRelation_different; + else + throw exception; + } + if (t1.rootLength$1(A._asString(relative)) > 0) + return B._PathRelation_different; + if (J.$eq$(relative, ".")) + return B._PathRelation_equal; + if (J.$eq$(relative, "..")) + return B._PathRelation_different; + return J.get$length$asx(relative) >= 3 && J.startsWith$1$s(relative, "..") && t1.isSeparator$1(J.codeUnitAt$1$s(relative, 2)) ? B._PathRelation_different : B._PathRelation_within; + }, + _isWithinOrEqualsFast$2($parent, child) { + var t1, parentRootLength, childRootLength, t2, t3, i, childIndex, parentIndex, lastCodeUnit, lastParentSeparator, parentCodeUnit, childCodeUnit, parentIndex0, t4, direction, _this = this; + if ($parent === ".") + $parent = ""; + t1 = _this.style; + parentRootLength = t1.rootLength$1($parent); + childRootLength = t1.rootLength$1(child); + if (parentRootLength !== childRootLength) + return B._PathRelation_different; + for (t2 = $parent.length, t3 = child.length, i = 0; i < parentRootLength; ++i) { + if (!(i < t2)) + return A.ioore($parent, i); + if (!(i < t3)) + return A.ioore(child, i); + if (!t1.codeUnitsEqual$2($parent.charCodeAt(i), child.charCodeAt(i))) + return B._PathRelation_different; + } + childIndex = childRootLength; + parentIndex = parentRootLength; + lastCodeUnit = 47; + lastParentSeparator = null; + while (true) { + if (!(parentIndex < t2 && childIndex < t3)) + break; + c$0: { + if (!(parentIndex >= 0 && parentIndex < t2)) + return A.ioore($parent, parentIndex); + parentCodeUnit = $parent.charCodeAt(parentIndex); + if (!(childIndex >= 0 && childIndex < t3)) + return A.ioore(child, childIndex); + childCodeUnit = child.charCodeAt(childIndex); + if (t1.codeUnitsEqual$2(parentCodeUnit, childCodeUnit)) { + if (t1.isSeparator$1(parentCodeUnit)) + lastParentSeparator = parentIndex; + ++parentIndex; + ++childIndex; + lastCodeUnit = parentCodeUnit; + break c$0; + } + if (t1.isSeparator$1(parentCodeUnit) && t1.isSeparator$1(lastCodeUnit)) { + parentIndex0 = parentIndex + 1; + lastParentSeparator = parentIndex; + parentIndex = parentIndex0; + break c$0; + } else if (t1.isSeparator$1(childCodeUnit) && t1.isSeparator$1(lastCodeUnit)) { + ++childIndex; + break c$0; + } + if (parentCodeUnit === 46 && t1.isSeparator$1(lastCodeUnit)) { + ++parentIndex; + if (parentIndex === t2) + break; + if (!(parentIndex < t2)) + return A.ioore($parent, parentIndex); + parentCodeUnit = $parent.charCodeAt(parentIndex); + if (t1.isSeparator$1(parentCodeUnit)) { + parentIndex0 = parentIndex + 1; + lastParentSeparator = parentIndex; + parentIndex = parentIndex0; + break c$0; + } + if (parentCodeUnit === 46) { + ++parentIndex; + if (parentIndex !== t2) { + if (!(parentIndex < t2)) + return A.ioore($parent, parentIndex); + t4 = t1.isSeparator$1($parent.charCodeAt(parentIndex)); + } else + t4 = true; + if (t4) + return B._PathRelation_inconclusive; + } + } + if (childCodeUnit === 46 && t1.isSeparator$1(lastCodeUnit)) { + ++childIndex; + if (childIndex === t3) + break; + if (!(childIndex < t3)) + return A.ioore(child, childIndex); + childCodeUnit = child.charCodeAt(childIndex); + if (t1.isSeparator$1(childCodeUnit)) { + ++childIndex; + break c$0; + } + if (childCodeUnit === 46) { + ++childIndex; + if (childIndex !== t3) { + if (!(childIndex < t3)) + return A.ioore(child, childIndex); + t2 = t1.isSeparator$1(child.charCodeAt(childIndex)); + t1 = t2; + } else + t1 = true; + if (t1) + return B._PathRelation_inconclusive; + } + } + if (_this._pathDirection$2(child, childIndex) !== B._PathDirection_988) + return B._PathRelation_inconclusive; + if (_this._pathDirection$2($parent, parentIndex) !== B._PathDirection_988) + return B._PathRelation_inconclusive; + return B._PathRelation_different; + } + } + if (childIndex === t3) { + if (parentIndex !== t2) { + if (!(parentIndex >= 0 && parentIndex < t2)) + return A.ioore($parent, parentIndex); + t1 = t1.isSeparator$1($parent.charCodeAt(parentIndex)); + } else + t1 = true; + if (t1) + lastParentSeparator = parentIndex; + else if (lastParentSeparator == null) + lastParentSeparator = Math.max(0, parentRootLength - 1); + direction = _this._pathDirection$2($parent, lastParentSeparator); + if (direction === B._PathDirection_8Gl) + return B._PathRelation_equal; + return direction === B._PathDirection_ZGD ? B._PathRelation_inconclusive : B._PathRelation_different; + } + direction = _this._pathDirection$2(child, childIndex); + if (direction === B._PathDirection_8Gl) + return B._PathRelation_equal; + if (direction === B._PathDirection_ZGD) + return B._PathRelation_inconclusive; + if (!(childIndex >= 0 && childIndex < t3)) + return A.ioore(child, childIndex); + return t1.isSeparator$1(child.charCodeAt(childIndex)) || t1.isSeparator$1(lastCodeUnit) ? B._PathRelation_within : B._PathRelation_different; + }, + _pathDirection$2(path, index) { + var t1, t2, i, depth, reachedRoot, t3, i0, t4; + for (t1 = path.length, t2 = this.style, i = index, depth = 0, reachedRoot = false; i < t1;) { + while (true) { + if (i < t1) { + if (!(i >= 0)) + return A.ioore(path, i); + t3 = t2.isSeparator$1(path.charCodeAt(i)); + } else + t3 = false; + if (!t3) + break; + ++i; + } + if (i === t1) + break; + i0 = i; + while (true) { + if (i0 < t1) { + if (!(i0 >= 0)) + return A.ioore(path, i0); + t3 = !t2.isSeparator$1(path.charCodeAt(i0)); + } else + t3 = false; + if (!t3) + break; + ++i0; + } + t3 = i0 - i; + if (t3 === 1) { + if (!(i >= 0 && i < t1)) + return A.ioore(path, i); + t4 = path.charCodeAt(i) === 46; + } else + t4 = false; + if (!t4) { + if (t3 === 2) { + if (!(i >= 0 && i < t1)) + return A.ioore(path, i); + if (path.charCodeAt(i) === 46) { + t3 = i + 1; + if (!(t3 < t1)) + return A.ioore(path, t3); + t3 = path.charCodeAt(t3) === 46; + } else + t3 = false; + } else + t3 = false; + if (t3) { + --depth; + if (depth < 0) + break; + if (depth === 0) + reachedRoot = true; + } else + ++depth; + } + if (i0 === t1) + break; + i = i0 + 1; + } + if (depth < 0) + return B._PathDirection_ZGD; + if (depth === 0) + return B._PathDirection_8Gl; + if (reachedRoot) + return B._PathDirection_FIw; + return B._PathDirection_988; + }, + toUri$1(path) { + var t2, + t1 = this.style; + if (t1.rootLength$1(path) <= 0) + return t1.relativePathToUri$1(path); + else { + t2 = this._context$_current; + return t1.absolutePathToUri$1(this.join$2(0, t2 == null ? A.current() : t2, path)); + } + }, + prettyUri$1(uri) { + var path, rel, _this = this, + typedUri = A._parseUri(uri); + if (typedUri.get$scheme() === "file" && _this.style === $.$get$Style_url()) + return typedUri.toString$0(0); + else if (typedUri.get$scheme() !== "file" && typedUri.get$scheme() !== "" && _this.style !== $.$get$Style_url()) + return typedUri.toString$0(0); + path = _this.normalize$1(_this.style.pathFromUri$1(A._parseUri(typedUri))); + rel = _this.relative$1(path); + return _this.split$1(0, rel).length > _this.split$1(0, path).length ? path : rel; + } + }; + A.Context_joinAll_closure.prototype = { + call$1(part) { + return A._asString(part) !== ""; + }, + $signature: 1 + }; + A.Context_split_closure.prototype = { + call$1(part) { + return A._asString(part).length !== 0; + }, + $signature: 1 + }; + A._validateArgList_closure.prototype = { + call$1(arg) { + A._asStringQ(arg); + return arg == null ? "null" : '"' + arg + '"'; + }, + $signature: 27 + }; + A._PathDirection.prototype = { + toString$0(_) { + return this.name; + } + }; + A._PathRelation.prototype = { + toString$0(_) { + return this.name; + } + }; + A.InternalStyle.prototype = { + getRoot$1(path) { + var t1, + $length = this.rootLength$1(path); + if ($length > 0) + return B.JSString_methods.substring$2(path, 0, $length); + if (this.isRootRelative$1(path)) { + if (0 >= path.length) + return A.ioore(path, 0); + t1 = path[0]; + } else + t1 = null; + return t1; + }, + relativePathToUri$1(path) { + var segments, t2, _null = null, + t1 = path.length; + if (t1 === 0) + return A._Uri__Uri(_null, _null, _null, _null); + segments = A.Context_Context(this).split$1(0, path); + t2 = t1 - 1; + if (!(t2 >= 0)) + return A.ioore(path, t2); + if (this.isSeparator$1(path.charCodeAt(t2))) + B.JSArray_methods.add$1(segments, ""); + return A._Uri__Uri(_null, _null, segments, _null); + }, + codeUnitsEqual$2(codeUnit1, codeUnit2) { + return codeUnit1 === codeUnit2; + }, + pathsEqual$2(path1, path2) { + return path1 === path2; + } + }; + A.ParsedPath.prototype = { + get$hasTrailingSeparator() { + var t1 = this.parts; + if (t1.length !== 0) + t1 = J.$eq$(B.JSArray_methods.get$last(t1), "") || !J.$eq$(B.JSArray_methods.get$last(this.separators), ""); + else + t1 = false; + return t1; + }, + removeTrailingSeparators$0() { + var t1, t2, _this = this; + while (true) { + t1 = _this.parts; + if (!(t1.length !== 0 && J.$eq$(B.JSArray_methods.get$last(t1), ""))) + break; + B.JSArray_methods.removeLast$0(_this.parts); + t1 = _this.separators; + if (0 >= t1.length) + return A.ioore(t1, -1); + t1.pop(); + } + t1 = _this.separators; + t2 = t1.length; + if (t2 !== 0) + B.JSArray_methods.$indexSet(t1, t2 - 1, ""); + }, + normalize$0() { + var t1, t2, leadingDoubles, _i, part, t3, _this = this, + newParts = A._setArrayType([], type$.JSArray_String); + for (t1 = _this.parts, t2 = t1.length, leadingDoubles = 0, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + part = t1[_i]; + t3 = J.getInterceptor$(part); + if (!(t3.$eq(part, ".") || t3.$eq(part, ""))) + if (t3.$eq(part, "..")) { + t3 = newParts.length; + if (t3 !== 0) { + if (0 >= t3) + return A.ioore(newParts, -1); + newParts.pop(); + } else + ++leadingDoubles; + } else + B.JSArray_methods.add$1(newParts, part); + } + if (_this.root == null) + B.JSArray_methods.insertAll$2(newParts, 0, A.List_List$filled(leadingDoubles, "..", false, type$.String)); + if (newParts.length === 0 && _this.root == null) + B.JSArray_methods.add$1(newParts, "."); + _this.set$parts(newParts); + t1 = _this.style; + _this.set$separators(A.List_List$filled(newParts.length + 1, t1.get$separator(), true, type$.String)); + t2 = _this.root; + if (t2 == null || newParts.length === 0 || !t1.needsSeparator$1(t2)) + B.JSArray_methods.$indexSet(_this.separators, 0, ""); + t2 = _this.root; + if (t2 != null && t1 === $.$get$Style_windows()) { + t2.toString; + _this.root = A.stringReplaceAllUnchecked(t2, "/", "\\"); + } + _this.removeTrailingSeparators$0(); + }, + toString$0(_) { + var i, t2, t3, _this = this, + t1 = _this.root; + t1 = t1 != null ? "" + t1 : ""; + for (i = 0; i < _this.parts.length; ++i, t1 = t3) { + t2 = _this.separators; + if (!(i < t2.length)) + return A.ioore(t2, i); + t2 = A.S(t2[i]); + t3 = _this.parts; + if (!(i < t3.length)) + return A.ioore(t3, i); + t3 = t1 + t2 + A.S(t3[i]); + } + t1 += A.S(B.JSArray_methods.get$last(_this.separators)); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + set$parts(parts) { + this.parts = type$.List_String._as(parts); + }, + set$separators(separators) { + this.separators = type$.List_String._as(separators); + } + }; + A.PathException.prototype = { + toString$0(_) { + return "PathException: " + this.message; + }, + $isException: 1 + }; + A.Style.prototype = { + toString$0(_) { + return this.get$name(); + } + }; + A.PosixStyle.prototype = { + containsSeparator$1(path) { + return B.JSString_methods.contains$1(path, "/"); + }, + isSeparator$1(codeUnit) { + return codeUnit === 47; + }, + needsSeparator$1(path) { + var t2, + t1 = path.length; + if (t1 !== 0) { + t2 = t1 - 1; + if (!(t2 >= 0)) + return A.ioore(path, t2); + t2 = path.charCodeAt(t2) !== 47; + t1 = t2; + } else + t1 = false; + return t1; + }, + rootLength$2$withDrive(path, withDrive) { + var t1 = path.length; + if (t1 !== 0) { + if (0 >= t1) + return A.ioore(path, 0); + t1 = path.charCodeAt(0) === 47; + } else + t1 = false; + if (t1) + return 1; + return 0; + }, + rootLength$1(path) { + return this.rootLength$2$withDrive(path, false); + }, + isRootRelative$1(path) { + return false; + }, + pathFromUri$1(uri) { + var t1; + if (uri.get$scheme() === "" || uri.get$scheme() === "file") { + t1 = uri.get$path(); + return A._Uri__uriDecode(t1, 0, t1.length, B.C_Utf8Codec, false); + } + throw A.wrapException(A.ArgumentError$("Uri " + uri.toString$0(0) + " must have scheme 'file:'.", null)); + }, + absolutePathToUri$1(path) { + var parsed = A.ParsedPath_ParsedPath$parse(path, this), + t1 = parsed.parts; + if (t1.length === 0) + B.JSArray_methods.addAll$1(t1, A._setArrayType(["", ""], type$.JSArray_String)); + else if (parsed.get$hasTrailingSeparator()) + B.JSArray_methods.add$1(parsed.parts, ""); + return A._Uri__Uri(null, null, parsed.parts, "file"); + }, + get$name() { + return "posix"; + }, + get$separator() { + return "/"; + } + }; + A.UrlStyle.prototype = { + containsSeparator$1(path) { + return B.JSString_methods.contains$1(path, "/"); + }, + isSeparator$1(codeUnit) { + return codeUnit === 47; + }, + needsSeparator$1(path) { + var t2, + t1 = path.length; + if (t1 === 0) + return false; + t2 = t1 - 1; + if (!(t2 >= 0)) + return A.ioore(path, t2); + if (path.charCodeAt(t2) !== 47) + return true; + return B.JSString_methods.endsWith$1(path, "://") && this.rootLength$1(path) === t1; + }, + rootLength$2$withDrive(path, withDrive) { + var i, codeUnit, index, t2, + t1 = path.length; + if (t1 === 0) + return 0; + if (0 >= t1) + return A.ioore(path, 0); + if (path.charCodeAt(0) === 47) + return 1; + for (i = 0; i < t1; ++i) { + codeUnit = path.charCodeAt(i); + if (codeUnit === 47) + return 0; + if (codeUnit === 58) { + if (i === 0) + return 0; + index = B.JSString_methods.indexOf$2(path, "/", B.JSString_methods.startsWith$2(path, "//", i + 1) ? i + 3 : i); + if (index <= 0) + return t1; + if (!withDrive || t1 < index + 3) + return index; + if (!B.JSString_methods.startsWith$1(path, "file://")) + return index; + if (!A.isDriveLetter(path, index + 1)) + return index; + t2 = index + 3; + return t1 === t2 ? t2 : index + 4; + } + } + return 0; + }, + rootLength$1(path) { + return this.rootLength$2$withDrive(path, false); + }, + isRootRelative$1(path) { + var t1 = path.length; + if (t1 !== 0) { + if (0 >= t1) + return A.ioore(path, 0); + t1 = path.charCodeAt(0) === 47; + } else + t1 = false; + return t1; + }, + pathFromUri$1(uri) { + return uri.toString$0(0); + }, + relativePathToUri$1(path) { + return A.Uri_parse(path); + }, + absolutePathToUri$1(path) { + return A.Uri_parse(path); + }, + get$name() { + return "url"; + }, + get$separator() { + return "/"; + } + }; + A.WindowsStyle.prototype = { + containsSeparator$1(path) { + return B.JSString_methods.contains$1(path, "/"); + }, + isSeparator$1(codeUnit) { + return codeUnit === 47 || codeUnit === 92; + }, + needsSeparator$1(path) { + var t2, + t1 = path.length; + if (t1 === 0) + return false; + t2 = t1 - 1; + if (!(t2 >= 0)) + return A.ioore(path, t2); + t2 = path.charCodeAt(t2); + return !(t2 === 47 || t2 === 92); + }, + rootLength$2$withDrive(path, withDrive) { + var t2, index, + t1 = path.length; + if (t1 === 0) + return 0; + if (0 >= t1) + return A.ioore(path, 0); + if (path.charCodeAt(0) === 47) + return 1; + if (path.charCodeAt(0) === 92) { + if (t1 >= 2) { + if (1 >= t1) + return A.ioore(path, 1); + t2 = path.charCodeAt(1) !== 92; + } else + t2 = true; + if (t2) + return 1; + index = B.JSString_methods.indexOf$2(path, "\\", 2); + if (index > 0) { + index = B.JSString_methods.indexOf$2(path, "\\", index + 1); + if (index > 0) + return index; + } + return t1; + } + if (t1 < 3) + return 0; + if (!A.isAlphabetic(path.charCodeAt(0))) + return 0; + if (path.charCodeAt(1) !== 58) + return 0; + t1 = path.charCodeAt(2); + if (!(t1 === 47 || t1 === 92)) + return 0; + return 3; + }, + rootLength$1(path) { + return this.rootLength$2$withDrive(path, false); + }, + isRootRelative$1(path) { + return this.rootLength$1(path) === 1; + }, + pathFromUri$1(uri) { + var path, t1; + if (uri.get$scheme() !== "" && uri.get$scheme() !== "file") + throw A.wrapException(A.ArgumentError$("Uri " + uri.toString$0(0) + " must have scheme 'file:'.", null)); + path = uri.get$path(); + if (uri.get$host() === "") { + if (path.length >= 3 && B.JSString_methods.startsWith$1(path, "/") && A.isDriveLetter(path, 1)) + path = B.JSString_methods.replaceFirst$2(path, "/", ""); + } else + path = "\\\\" + uri.get$host() + path; + t1 = A.stringReplaceAllUnchecked(path, "/", "\\"); + return A._Uri__uriDecode(t1, 0, t1.length, B.C_Utf8Codec, false); + }, + absolutePathToUri$1(path) { + var rootParts, t2, + parsed = A.ParsedPath_ParsedPath$parse(path, this), + t1 = parsed.root; + t1.toString; + if (B.JSString_methods.startsWith$1(t1, "\\\\")) { + rootParts = new A.WhereIterable(A._setArrayType(t1.split("\\"), type$.JSArray_String), type$.bool_Function_String._as(new A.WindowsStyle_absolutePathToUri_closure()), type$.WhereIterable_String); + B.JSArray_methods.insert$2(parsed.parts, 0, rootParts.get$last(rootParts)); + if (parsed.get$hasTrailingSeparator()) + B.JSArray_methods.add$1(parsed.parts, ""); + return A._Uri__Uri(rootParts.get$first(rootParts), null, parsed.parts, "file"); + } else { + if (parsed.parts.length === 0 || parsed.get$hasTrailingSeparator()) + B.JSArray_methods.add$1(parsed.parts, ""); + t1 = parsed.parts; + t2 = parsed.root; + t2.toString; + t2 = A.stringReplaceAllUnchecked(t2, "/", ""); + B.JSArray_methods.insert$2(t1, 0, A.stringReplaceAllUnchecked(t2, "\\", "")); + return A._Uri__Uri(null, null, parsed.parts, "file"); + } + }, + codeUnitsEqual$2(codeUnit1, codeUnit2) { + var upperCase1; + if (codeUnit1 === codeUnit2) + return true; + if (codeUnit1 === 47) + return codeUnit2 === 92; + if (codeUnit1 === 92) + return codeUnit2 === 47; + if ((codeUnit1 ^ codeUnit2) !== 32) + return false; + upperCase1 = codeUnit1 | 32; + return upperCase1 >= 97 && upperCase1 <= 122; + }, + pathsEqual$2(path1, path2) { + var t1, t2, i; + if (path1 === path2) + return true; + t1 = path1.length; + t2 = path2.length; + if (t1 !== t2) + return false; + for (i = 0; i < t1; ++i) { + if (!(i < t2)) + return A.ioore(path2, i); + if (!this.codeUnitsEqual$2(path1.charCodeAt(i), path2.charCodeAt(i))) + return false; + } + return true; + }, + get$name() { + return "windows"; + }, + get$separator() { + return "\\"; + } + }; + A.WindowsStyle_absolutePathToUri_closure.prototype = { + call$1(part) { + return A._asString(part) !== ""; + }, + $signature: 1 + }; + A.mapStackTrace_closure.prototype = { + call$1(trace) { + var _this = this; + return A.Trace_Trace$from(A.mapStackTrace(_this.sourceMap, type$.Trace._as(trace), _this.minified, _this.packageMap, _this.sdkRoot)); + }, + $signature: 28 + }; + A.mapStackTrace_closure0.prototype = { + call$1(frame) { + var line, column, span, sourceUrl, t1, t2, t3, t4; + type$.Frame._as(frame); + line = frame.get$line(); + if (line == null) + return null; + column = frame.get$column(); + if (column == null) + column = 0; + span = this.sourceMap.spanFor$3$uri(line - 1, column - 1, frame.get$uri().toString$0(0)); + if (span == null) + return null; + sourceUrl = span.get$sourceUrl().toString$0(0); + t1 = this.sdkLib; + if (t1 != null && $.$get$url()._isWithinOrEquals$2(t1, sourceUrl) === B._PathRelation_within) + sourceUrl = "dart:" + $.$get$url().relative$2$from(sourceUrl, t1); + t1 = A.Uri_parse(sourceUrl); + t2 = span.get$start().get$line(); + t3 = span.get$start().get$column(); + t4 = frame.get$member(); + t4.toString; + t4 = A._prettifyMember(t4); + return new A.Frame(t1, t2 + 1, t3 + 1, t4); + }, + $signature: 29 + }; + A._prettifyMember_closure.prototype = { + call$1(match) { + return B.JSString_methods.$mul(".", match.$index(0, 1).length); + }, + $signature: 13 + }; + A._prettifyMember_closure0.prototype = { + call$1(match) { + var t1 = match.$index(0, 1); + t1.toString; + return t1 + "."; + }, + $signature: 13 + }; + A.Mapping.prototype = {}; + A.MultiSectionMapping.prototype = { + MultiSectionMapping$fromJson$3$mapUrl(sections, otherMaps, mapUrl) { + var t1, t2, t3, t4, t5, t6, t7, offset, line, column, url, map, _null = null; + for (t1 = J.cast$1$0$ax(sections, type$.Map_dynamic_dynamic), t2 = A._instanceType(t1), t1 = new A.ListIterator(t1, t1.get$length(t1), t2._eval$1("ListIterator")), t3 = this._maps, t4 = this._lineStart, t5 = this._columnStart, t6 = type$.nullable_Map_dynamic_dynamic, t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t7 = t1.__internal$_current; + if (t7 == null) + t7 = t2._as(t7); + offset = t6._as(t7.$index(0, "offset")); + if (offset == null) + throw A.wrapException(A.FormatException$("section missing offset", _null, _null)); + line = A._asIntQ(offset.$index(0, "line")); + if (line == null) + throw A.wrapException(A.FormatException$("offset missing line", _null, _null)); + column = A._asIntQ(offset.$index(0, "column")); + if (column == null) + throw A.wrapException(A.FormatException$("offset missing column", _null, _null)); + B.JSArray_methods.add$1(t4, line); + B.JSArray_methods.add$1(t5, column); + url = A._asStringQ(t7.$index(0, "url")); + map = t6._as(t7.$index(0, "map")); + t7 = url != null; + if (t7 && map != null) + throw A.wrapException(A.FormatException$("section can't use both url and map entries", _null, _null)); + else if (t7) { + t7 = A.FormatException$("section contains refers to " + url + ', but no map was given for it. Make sure a map is passed in "otherMaps"', _null, _null); + throw A.wrapException(t7); + } else if (map != null) + B.JSArray_methods.add$1(t3, A.parseJson(map, mapUrl, otherMaps)); + else + throw A.wrapException(A.FormatException$("section missing url or map", _null, _null)); + } + if (t4.length === 0) + throw A.wrapException(A.FormatException$("expected at least one section", _null, _null)); + }, + _indexFor$2(line, column) { + var t1, t2, t3, t4, i, t5; + for (t1 = this._lineStart, t2 = t1.length, t3 = this._columnStart, t4 = t3.length, i = 0; i < t2; ++i) { + t5 = t1[i]; + if (line < t5) + return i - 1; + if (line === t5) { + if (!(i < t4)) + return A.ioore(t3, i); + t5 = column < t3[i]; + } else + t5 = false; + if (t5) + return i - 1; + } + return t2 - 1; + }, + spanFor$4$files$uri(line, column, files, uri) { + var t2, t3, _this = this, + index = _this._indexFor$2(line, column), + t1 = _this._maps; + if (!(index >= 0 && index < t1.length)) + return A.ioore(t1, index); + t1 = t1[index]; + t2 = _this._lineStart; + if (!(index < t2.length)) + return A.ioore(t2, index); + t2 = t2[index]; + t3 = _this._columnStart; + if (!(index < t3.length)) + return A.ioore(t3, index); + return t1.spanFor$3$files(line - t2, column - t3[index], files); + }, + spanFor$3$uri(line, column, uri) { + return this.spanFor$4$files$uri(line, column, null, uri); + }, + spanFor$3$files(line, column, files) { + return this.spanFor$4$files$uri(line, column, files, null); + }, + toString$0(_) { + var t2, t3, t4, i, t5, t6, _this = this, + t1 = A.getRuntimeTypeOfDartObject(_this).toString$0(0) + " : ["; + for (t2 = _this._lineStart, t3 = _this._columnStart, t4 = _this._maps, i = 0; i < t2.length; ++i, t1 = t6) { + t5 = t2[i]; + if (!(i < t3.length)) + return A.ioore(t3, i); + t6 = t3[i]; + if (!(i < t4.length)) + return A.ioore(t4, i); + t6 = t1 + "(" + t5 + "," + t6 + ":" + t4[i].toString$0(0) + ")"; + } + t1 += "]"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }; + A.SingleMapping.prototype = { + SingleMapping$fromJson$2$mapUrl(map, mapUrl) { + var t7, source, t8, t9, t10, tokenizer, entries, line, column, srcUrlId, srcLine, srcColumn, srcNameId, _this = this, + _s14_ = "sourcesContent", + _null = null, + t1 = map._source, + t2 = map.$ti._eval$1("4?"), + sourcesContent = t2._as(t1.$index(0, _s14_)) == null ? B.List_empty0 : A.List_List$from(type$.List_dynamic._as(t2._as(t1.$index(0, _s14_))), true, type$.nullable_String), + t3 = type$.nullable_Uri, + t4 = _this.files, + t5 = _this.urls, + t6 = type$.JSArray_int, + i = 0; + while (true) { + t7 = t5.length; + if (!(i < t7 && i < sourcesContent.length)) + break; + c$0: { + if (!(i < sourcesContent.length)) + return A.ioore(sourcesContent, i); + source = sourcesContent[i]; + if (source == null) + break c$0; + if (!(i < t7)) + return A.ioore(t5, i); + t7 = t5[i]; + t8 = new A.CodeUnits(source); + t9 = A._setArrayType([0], t6); + t10 = typeof t7 == "string" ? A.Uri_parse(t7) : t3._as(t7); + t9 = new A.SourceFile(t10, t9, new Uint32Array(A._ensureNativeList(t8.toList$0(t8)))); + t9.SourceFile$decoded$2$url(t8, t7); + B.JSArray_methods.$indexSet(t4, i, t9); + } + ++i; + } + t1 = A._asString(t2._as(t1.$index(0, "mappings"))); + t2 = t1.length; + tokenizer = new A._MappingTokenizer(t1, t2); + t1 = type$.JSArray_TargetEntry; + entries = A._setArrayType([], t1); + t3 = _this.names; + t4 = t2 - 1; + t2 = t2 > 0; + t6 = _this.lines; + line = 0; + column = 0; + srcUrlId = 0; + srcLine = 0; + srcColumn = 0; + srcNameId = 0; + while (true) { + if (!(tokenizer.index < t4 && t2)) + break; + c$1: { + if (tokenizer.get$nextKind().isNewLine) { + if (entries.length !== 0) { + B.JSArray_methods.add$1(t6, new A.TargetLineEntry(line, entries)); + entries = A._setArrayType([], t1); + } + ++line; + ++tokenizer.index; + column = 0; + break c$1; + } + if (tokenizer.get$nextKind().isNewSegment) + throw A.wrapException(_this._segmentError$2(0, line)); + column += A.decodeVlq(tokenizer); + t7 = tokenizer.get$nextKind(); + if (!(!t7.isNewLine && !t7.isNewSegment && !t7.isEof)) + B.JSArray_methods.add$1(entries, new A.TargetEntry(column, _null, _null, _null, _null)); + else { + srcUrlId += A.decodeVlq(tokenizer); + if (srcUrlId >= t5.length) + throw A.wrapException(A.StateError$("Invalid source url id. " + A.S(_this.targetUrl) + ", " + line + ", " + srcUrlId)); + t7 = tokenizer.get$nextKind(); + if (!(!t7.isNewLine && !t7.isNewSegment && !t7.isEof)) + throw A.wrapException(_this._segmentError$2(2, line)); + srcLine += A.decodeVlq(tokenizer); + t7 = tokenizer.get$nextKind(); + if (!(!t7.isNewLine && !t7.isNewSegment && !t7.isEof)) + throw A.wrapException(_this._segmentError$2(3, line)); + srcColumn += A.decodeVlq(tokenizer); + t7 = tokenizer.get$nextKind(); + if (!(!t7.isNewLine && !t7.isNewSegment && !t7.isEof)) + B.JSArray_methods.add$1(entries, new A.TargetEntry(column, srcUrlId, srcLine, srcColumn, _null)); + else { + srcNameId += A.decodeVlq(tokenizer); + if (srcNameId >= t3.length) + throw A.wrapException(A.StateError$("Invalid name id: " + A.S(_this.targetUrl) + ", " + line + ", " + srcNameId)); + B.JSArray_methods.add$1(entries, new A.TargetEntry(column, srcUrlId, srcLine, srcColumn, srcNameId)); + } + } + if (tokenizer.get$nextKind().isNewSegment) + ++tokenizer.index; + } + } + if (entries.length !== 0) + B.JSArray_methods.add$1(t6, new A.TargetLineEntry(line, entries)); + map.forEach$1(0, new A.SingleMapping$fromJson_closure(_this)); + }, + _segmentError$2(seen, line) { + return new A.StateError("Invalid entry in sourcemap, expected 1, 4, or 5 values, but got " + seen + ".\ntargeturl: " + A.S(this.targetUrl) + ", line: " + line); + }, + _findLine$1(line) { + var t2, + t1 = this.lines, + index = A.binarySearch(t1, new A.SingleMapping__findLine_closure(line), type$.TargetLineEntry); + if (index <= 0) + t1 = null; + else { + t2 = index - 1; + if (!(t2 < t1.length)) + return A.ioore(t1, t2); + t2 = t1[t2]; + t1 = t2; + } + return t1; + }, + _findColumn$3(line, column, lineEntry) { + var entries, index, t1; + if (lineEntry == null || lineEntry.entries.length === 0) + return null; + if (lineEntry.line !== line) + return B.JSArray_methods.get$last(lineEntry.entries); + entries = lineEntry.entries; + index = A.binarySearch(entries, new A.SingleMapping__findColumn_closure(column), type$.TargetEntry); + if (index <= 0) + t1 = null; + else { + t1 = index - 1; + if (!(t1 < entries.length)) + return A.ioore(entries, t1); + t1 = entries[t1]; + } + return t1; + }, + spanFor$4$files$uri(line, column, files, uri) { + var sourceUrlId, t1, url, sourceNameId, t2, start, t3, _this = this, + entry = _this._findColumn$3(line, column, _this._findLine$1(line)); + if (entry == null) + return null; + sourceUrlId = entry.sourceUrlId; + if (sourceUrlId == null) + return null; + t1 = _this.urls; + if (sourceUrlId >>> 0 !== sourceUrlId || sourceUrlId >= t1.length) + return A.ioore(t1, sourceUrlId); + url = t1[sourceUrlId]; + t1 = _this.sourceRoot; + if (t1 != null) + url = t1 + url; + sourceNameId = entry.sourceNameId; + t1 = _this._mapUrl; + t1 = t1 == null ? null : t1.resolve$1(url); + if (t1 == null) + t1 = url; + t2 = entry.sourceLine; + start = A.SourceLocation$(0, entry.sourceColumn, t2, t1); + if (sourceNameId != null) { + t1 = _this.names; + if (sourceNameId >>> 0 !== sourceNameId || sourceNameId >= t1.length) + return A.ioore(t1, sourceNameId); + t1 = t1[sourceNameId]; + t2 = t1.length; + t2 = A.SourceLocation$(start.offset + t2, start.column + t2, start.line, start.sourceUrl); + t3 = new A.SourceMapSpan(true, start, t2, t1); + t3.SourceSpanBase$3(start, t2, t1); + return t3; + } else + return A.SourceMapSpan$(start, start, "", false); + }, + spanFor$3$uri(line, column, uri) { + return this.spanFor$4$files$uri(line, column, null, uri); + }, + spanFor$3$files(line, column, files) { + return this.spanFor$4$files$uri(line, column, files, null); + }, + toString$0(_) { + var _this = this, + t1 = A.getRuntimeTypeOfDartObject(_this).toString$0(0) + " : [" + "targetUrl: " + A.S(_this.targetUrl) + ", sourceRoot: " + A.S(_this.sourceRoot) + ", urls: " + A.S(_this.urls) + ", names: " + A.S(_this.names) + ", lines: " + A.S(_this.lines) + "]"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }; + A.SingleMapping$fromJson_closure.prototype = { + call$2($name, value) { + A._asString($name); + if (B.JSString_methods.startsWith$1($name, "x_")) + this.$this.extensions.$indexSet(0, $name, value); + }, + $signature: 31 + }; + A.SingleMapping__findLine_closure.prototype = { + call$1(e) { + return type$.TargetLineEntry._as(e).line > this.line; + }, + $signature: 32 + }; + A.SingleMapping__findColumn_closure.prototype = { + call$1(e) { + return type$.TargetEntry._as(e).column > this.column; + }, + $signature: 33 + }; + A.TargetLineEntry.prototype = { + toString$0(_) { + return A.getRuntimeTypeOfDartObject(this).toString$0(0) + ": " + this.line + " " + A.S(this.entries); + } + }; + A.TargetEntry.prototype = { + toString$0(_) { + var _this = this; + return A.getRuntimeTypeOfDartObject(_this).toString$0(0) + ": (" + _this.column + ", " + A.S(_this.sourceUrlId) + ", " + A.S(_this.sourceLine) + ", " + A.S(_this.sourceColumn) + ", " + A.S(_this.sourceNameId) + ")"; + } + }; + A._MappingTokenizer.prototype = { + moveNext$0() { + return ++this.index < this._parser$_length; + }, + get$current() { + var t1 = this.index, + t2 = t1 >= 0 && t1 < this._parser$_length, + t3 = this._internal; + if (t2) { + if (!(t1 >= 0 && t1 < t3.length)) + return A.ioore(t3, t1); + t1 = t3[t1]; + } else + t1 = A.throwExpression(new A.IndexError(t3.length, true, t1, null, "Index out of range")); + return t1; + }, + get$hasTokens() { + var t1 = this._parser$_length; + return this.index < t1 - 1 && t1 > 0; + }, + get$nextKind() { + var t1, t2, next; + if (!this.get$hasTokens()) + return B._TokenKind_false_false_true; + t1 = this._internal; + t2 = this.index + 1; + if (!(t2 >= 0 && t2 < t1.length)) + return A.ioore(t1, t2); + next = t1[t2]; + if (next === ";") + return B._TokenKind_true_false_false; + if (next === ",") + return B._TokenKind_false_true_false; + return B._TokenKind_false_false_false; + }, + toString$0(_) { + var t1, t2, i, exception, _this = this, + buff = new A.StringBuffer(""); + for (t1 = _this._internal, t2 = t1.length, i = 0; i < _this.index; ++i) { + if (!(i < t2)) + return A.ioore(t1, i); + buff._contents += t1[i]; + } + buff._contents += "\x1b[31m"; + try { + buff._contents += _this.get$current(); + } catch (exception) { + if (!type$.RangeError._is(A.unwrapException(exception))) + throw exception; + } + buff._contents += "\x1b[0m"; + for (i = _this.index + 1; i < t2; ++i) { + if (!(i >= 0)) + return A.ioore(t1, i); + buff._contents += t1[i]; + } + buff._contents += " (" + _this.index + ")"; + t1 = buff._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isIterator: 1 + }; + A._TokenKind.prototype = {}; + A.SourceMapSpan.prototype = {}; + A._digits_closure.prototype = { + call$0() { + var i, + map = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.int); + for (i = 0; i < 64; ++i) + map.$indexSet(0, string$.ABCDEF[i], i); + return map; + }, + $signature: 34 + }; + A.SourceFile.prototype = { + get$length(_) { + return this._decodedChars.length; + }, + SourceFile$decoded$2$url(decodedChars, url) { + var t1, t2, t3, i, c, j, t4; + for (t1 = this._decodedChars, t2 = t1.length, t3 = this._lineStarts, i = 0; i < t2; ++i) { + c = t1[i]; + if (c === 13) { + j = i + 1; + if (j < t2) { + if (!(j < t2)) + return A.ioore(t1, j); + t4 = t1[j] !== 10; + } else + t4 = true; + if (t4) + c = 10; + } + if (c === 10) + B.JSArray_methods.add$1(t3, i + 1); + } + } + }; + A.SourceLocation.prototype = { + distance$1(other) { + var t1 = this.sourceUrl; + if (!t1.$eq(0, other.get$sourceUrl())) + throw A.wrapException(A.ArgumentError$('Source URLs "' + t1.toString$0(0) + '" and "' + other.get$sourceUrl().toString$0(0) + "\" don't match.", null)); + return Math.abs(this.offset - other.get$offset()); + }, + $eq(_, other) { + if (other == null) + return false; + return type$.SourceLocation._is(other) && this.sourceUrl.$eq(0, other.get$sourceUrl()) && this.offset === other.get$offset(); + }, + get$hashCode(_) { + var t1 = this.sourceUrl; + t1 = t1.get$hashCode(t1); + return t1 + this.offset; + }, + toString$0(_) { + var _this = this, + t1 = A.getRuntimeTypeOfDartObject(_this).toString$0(0); + return "<" + t1 + ": " + _this.offset + " " + (_this.sourceUrl.toString$0(0) + ":" + (_this.line + 1) + ":" + (_this.column + 1)) + ">"; + }, + get$sourceUrl() { + return this.sourceUrl; + }, + get$offset() { + return this.offset; + }, + get$line() { + return this.line; + }, + get$column() { + return this.column; + } + }; + A.SourceSpanBase.prototype = { + SourceSpanBase$3(start, end, text) { + var t3, + t1 = this.end, + t2 = this.start; + if (!t1.get$sourceUrl().$eq(0, t2.get$sourceUrl())) + throw A.wrapException(A.ArgumentError$('Source URLs "' + t2.get$sourceUrl().toString$0(0) + '" and "' + t1.get$sourceUrl().toString$0(0) + "\" don't match.", null)); + else if (t1.get$offset() < t2.get$offset()) + throw A.wrapException(A.ArgumentError$("End " + t1.toString$0(0) + " must come after start " + t2.toString$0(0) + ".", null)); + else { + t3 = this.text; + if (t3.length !== t2.distance$1(t1)) + throw A.wrapException(A.ArgumentError$('Text "' + t3 + '" must be ' + t2.distance$1(t1) + " characters long.", null)); + } + }, + get$start() { + return this.start; + }, + get$end() { + return this.end; + }, + get$text() { + return this.text; + } + }; + A.SourceSpanMixin.prototype = { + get$sourceUrl() { + return this.get$start().get$sourceUrl(); + }, + get$length(_) { + return this.get$end().get$offset() - this.get$start().get$offset(); + }, + $eq(_, other) { + if (other == null) + return false; + return type$.SourceSpan._is(other) && this.get$start().$eq(0, other.get$start()) && this.get$end().$eq(0, other.get$end()); + }, + get$hashCode(_) { + return A.Object_hash(this.get$start(), this.get$end(), B.C_SentinelValue); + }, + toString$0(_) { + var _this = this; + return "<" + A.getRuntimeTypeOfDartObject(_this).toString$0(0) + ": from " + _this.get$start().toString$0(0) + " to " + _this.get$end().toString$0(0) + ' "' + _this.get$text() + '">'; + }, + $isSourceSpan: 1 + }; + A.Chain.prototype = { + toTrace$0() { + var t1 = this.traces, + t2 = A._arrayInstanceType(t1); + return A.Trace$(new A.ExpandIterable(t1, t2._eval$1("Iterable(1)")._as(new A.Chain_toTrace_closure()), t2._eval$1("ExpandIterable<1,Frame>")), null); + }, + toString$0(_) { + var t1 = this.traces, + t2 = A._arrayInstanceType(t1); + return new A.MappedListIterable(t1, t2._eval$1("String(1)")._as(new A.Chain_toString_closure(new A.MappedListIterable(t1, t2._eval$1("int(1)")._as(new A.Chain_toString_closure0()), t2._eval$1("MappedListIterable<1,int>")).fold$1$2(0, 0, B.CONSTANT, type$.int))), t2._eval$1("MappedListIterable<1,String>")).join$1(0, string$.______); + }, + $isStackTrace: 1, + get$traces() { + return this.traces; + } + }; + A.Chain_capture_closure.prototype = { + call$0() { + var error, stackTrace, t1, exception; + try { + t1 = this.callback.call$0(); + return t1; + } catch (exception) { + error = A.unwrapException(exception); + stackTrace = A.getTraceFromException(exception); + $.Zone__current.handleUncaughtError$2(error, stackTrace); + this.T._as(null); + return null; + } + }, + $signature() { + return this.T._eval$1("0()"); + } + }; + A.Chain_Chain$parse_closure.prototype = { + call$1(line) { + return A._asString(line).length !== 0; + }, + $signature: 1 + }; + A.Chain_toTrace_closure.prototype = { + call$1(trace) { + return type$.Trace._as(trace).get$frames(); + }, + $signature: 36 + }; + A.Chain_toString_closure0.prototype = { + call$1(trace) { + var t1 = type$.Trace._as(trace).get$frames(), + t2 = A._arrayInstanceType(t1); + return new A.MappedListIterable(t1, t2._eval$1("int(1)")._as(new A.Chain_toString__closure0()), t2._eval$1("MappedListIterable<1,int>")).fold$1$2(0, 0, B.CONSTANT, type$.int); + }, + $signature: 37 + }; + A.Chain_toString__closure0.prototype = { + call$1(frame) { + return type$.Frame._as(frame).get$location().length; + }, + $signature: 14 + }; + A.Chain_toString_closure.prototype = { + call$1(trace) { + var t1 = type$.Trace._as(trace).get$frames(), + t2 = A._arrayInstanceType(t1); + return new A.MappedListIterable(t1, t2._eval$1("String(1)")._as(new A.Chain_toString__closure(this.longest)), t2._eval$1("MappedListIterable<1,String>")).join$0(0); + }, + $signature: 39 + }; + A.Chain_toString__closure.prototype = { + call$1(frame) { + type$.Frame._as(frame); + return B.JSString_methods.padRight$1(frame.get$location(), this.longest) + " " + A.S(frame.get$member()) + "\n"; + }, + $signature: 15 + }; + A.Frame.prototype = { + get$library() { + var t1 = this.uri; + if (t1.get$scheme() === "data") + return "data:..."; + return $.$get$context().prettyUri$1(t1); + }, + get$location() { + var t2, _this = this, + t1 = _this.line; + if (t1 == null) + return _this.get$library(); + t2 = _this.column; + if (t2 == null) + return _this.get$library() + " " + A.S(t1); + return _this.get$library() + " " + A.S(t1) + ":" + A.S(t2); + }, + toString$0(_) { + return this.get$location() + " in " + A.S(this.member); + }, + get$uri() { + return this.uri; + }, + get$line() { + return this.line; + }, + get$column() { + return this.column; + }, + get$member() { + return this.member; + } + }; + A.Frame_Frame$parseVM_closure.prototype = { + call$0() { + var match, t2, t3, member, uri, lineAndColumn, line, _null = null, + t1 = this.frame; + if (t1 === "...") + return new A.Frame(A._Uri__Uri(_null, _null, _null, _null), _null, _null, "..."); + match = $.$get$_vmFrame().firstMatch$1(t1); + if (match == null) + return new A.UnparsedFrame(A._Uri__Uri(_null, "unparsed", _null, _null), t1); + t1 = match._match; + if (1 >= t1.length) + return A.ioore(t1, 1); + t2 = t1[1]; + t2.toString; + t3 = $.$get$_asyncBody(); + t2 = A.stringReplaceAllUnchecked(t2, t3, ""); + member = A.stringReplaceAllUnchecked(t2, "", ""); + if (2 >= t1.length) + return A.ioore(t1, 2); + t2 = t1[2]; + t3 = t2; + t3.toString; + if (B.JSString_methods.startsWith$1(t3, "= t1.length) + return A.ioore(t1, 3); + lineAndColumn = t1[3].split(":"); + t1 = lineAndColumn.length; + line = t1 > 1 ? A.int_parse(lineAndColumn[1], _null) : _null; + return new A.Frame(uri, line, t1 > 2 ? A.int_parse(lineAndColumn[2], _null) : _null, member); + }, + $signature: 3 + }; + A.Frame_Frame$parseV8_closure.prototype = { + call$0() { + var t2, t3, t4, _s4_ = "", + t1 = this.frame, + match = $.$get$_v8Frame().firstMatch$1(t1); + if (match == null) + return new A.UnparsedFrame(A._Uri__Uri(null, "unparsed", null, null), t1); + t1 = new A.Frame_Frame$parseV8_closure_parseLocation(t1); + t2 = match._match; + t3 = t2.length; + if (2 >= t3) + return A.ioore(t2, 2); + t4 = t2[2]; + if (t4 != null) { + t3 = t4; + t3.toString; + t2 = t2[1]; + t2.toString; + t2 = A.stringReplaceAllUnchecked(t2, "", _s4_); + t2 = A.stringReplaceAllUnchecked(t2, "Anonymous function", _s4_); + return t1.call$2(t3, A.stringReplaceAllUnchecked(t2, "(anonymous function)", _s4_)); + } else { + if (3 >= t3) + return A.ioore(t2, 3); + t2 = t2[3]; + t2.toString; + return t1.call$2(t2, _s4_); + } + }, + $signature: 3 + }; + A.Frame_Frame$parseV8_closure_parseLocation.prototype = { + call$2($location, member) { + var t2, urlMatch, uri, line, columnMatch, _null = null, + t1 = $.$get$_v8EvalLocation(), + evalMatch = t1.firstMatch$1($location); + for (; evalMatch != null; $location = t2) { + t2 = evalMatch._match; + if (1 >= t2.length) + return A.ioore(t2, 1); + t2 = t2[1]; + t2.toString; + evalMatch = t1.firstMatch$1(t2); + } + if ($location === "native") + return new A.Frame(A.Uri_parse("native"), _null, _null, member); + urlMatch = $.$get$_v8UrlLocation().firstMatch$1($location); + if (urlMatch == null) + return new A.UnparsedFrame(A._Uri__Uri(_null, "unparsed", _null, _null), this.frame); + t1 = urlMatch._match; + if (1 >= t1.length) + return A.ioore(t1, 1); + t2 = t1[1]; + t2.toString; + uri = A.Frame__uriOrPathToUri(t2); + if (2 >= t1.length) + return A.ioore(t1, 2); + t2 = t1[2]; + t2.toString; + line = A.int_parse(t2, _null); + if (3 >= t1.length) + return A.ioore(t1, 3); + columnMatch = t1[3]; + return new A.Frame(uri, line, columnMatch != null ? A.int_parse(columnMatch, _null) : _null, member); + }, + $signature: 64 + }; + A.Frame_Frame$_parseFirefoxEval_closure.prototype = { + call$0() { + var t2, member, uri, line, _null = null, + t1 = this.frame, + match = $.$get$_firefoxEvalLocation().firstMatch$1(t1); + if (match == null) + return new A.UnparsedFrame(A._Uri__Uri(_null, "unparsed", _null, _null), t1); + t1 = match._match; + if (1 >= t1.length) + return A.ioore(t1, 1); + t2 = t1[1]; + t2.toString; + member = A.stringReplaceAllUnchecked(t2, "/<", ""); + if (2 >= t1.length) + return A.ioore(t1, 2); + t2 = t1[2]; + t2.toString; + uri = A.Frame__uriOrPathToUri(t2); + if (3 >= t1.length) + return A.ioore(t1, 3); + t1 = t1[3]; + t1.toString; + line = A.int_parse(t1, _null); + return new A.Frame(uri, line, _null, member.length === 0 || member === "anonymous" ? "" : member); + }, + $signature: 3 + }; + A.Frame_Frame$parseFirefox_closure.prototype = { + call$0() { + var t2, t3, t4, uri, member, line, column, _null = null, + t1 = this.frame, + match = $.$get$_firefoxSafariFrame().firstMatch$1(t1); + if (match == null) + return new A.UnparsedFrame(A._Uri__Uri(_null, "unparsed", _null, _null), t1); + t2 = match._match; + if (3 >= t2.length) + return A.ioore(t2, 3); + t3 = t2[3]; + t4 = t3; + t4.toString; + if (B.JSString_methods.contains$1(t4, " line ")) + return A.Frame_Frame$_parseFirefoxEval(t1); + t1 = t3; + t1.toString; + uri = A.Frame__uriOrPathToUri(t1); + t1 = t2.length; + if (1 >= t1) + return A.ioore(t2, 1); + member = t2[1]; + if (member != null) { + if (2 >= t1) + return A.ioore(t2, 2); + t1 = t2[2]; + t1.toString; + t1 = B.JSString_methods.allMatches$1("/", t1); + member += B.JSArray_methods.join$0(A.List_List$filled(t1.get$length(t1), ".", false, type$.String)); + if (member === "") + member = ""; + member = B.JSString_methods.replaceFirst$2(member, $.$get$_initialDot(), ""); + } else + member = ""; + if (4 >= t2.length) + return A.ioore(t2, 4); + t1 = t2[4]; + if (t1 === "") + line = _null; + else { + t1 = t1; + t1.toString; + line = A.int_parse(t1, _null); + } + if (5 >= t2.length) + return A.ioore(t2, 5); + t1 = t2[5]; + if (t1 == null || t1 === "") + column = _null; + else { + t1 = t1; + t1.toString; + column = A.int_parse(t1, _null); + } + return new A.Frame(uri, line, column, member); + }, + $signature: 3 + }; + A.Frame_Frame$parseFriendly_closure.prototype = { + call$0() { + var t2, uri, line, column, _null = null, + t1 = this.frame, + match = $.$get$_friendlyFrame().firstMatch$1(t1); + if (match == null) + throw A.wrapException(A.FormatException$("Couldn't parse package:stack_trace stack trace line '" + t1 + "'.", _null, _null)); + t1 = match._match; + if (1 >= t1.length) + return A.ioore(t1, 1); + t2 = t1[1]; + if (t2 === "data:...") + uri = A.Uri_Uri$dataFromString(""); + else { + t2 = t2; + t2.toString; + uri = A.Uri_parse(t2); + } + if (uri.get$scheme() === "") { + t2 = $.$get$context(); + uri = t2.toUri$1(t2.absolute$15(t2.style.pathFromUri$1(A._parseUri(uri)), _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null)); + } + if (2 >= t1.length) + return A.ioore(t1, 2); + t2 = t1[2]; + if (t2 == null) + line = _null; + else { + t2 = t2; + t2.toString; + line = A.int_parse(t2, _null); + } + if (3 >= t1.length) + return A.ioore(t1, 3); + t2 = t1[3]; + if (t2 == null) + column = _null; + else { + t2 = t2; + t2.toString; + column = A.int_parse(t2, _null); + } + if (4 >= t1.length) + return A.ioore(t1, 4); + return new A.Frame(uri, line, column, t1[4]); + }, + $signature: 3 + }; + A.LazyChain.prototype = { + get$_chain() { + var result, _this = this, + value = _this.__LazyChain__chain_FI; + if (value === $) { + result = _this._lazy_chain$_thunk.call$0(); + _this.__LazyChain__chain_FI !== $ && A.throwLateFieldADI("_chain"); + _this.__LazyChain__chain_FI = result; + value = result; + } + return value; + }, + get$traces() { + return this.get$_chain().get$traces(); + }, + toTrace$0() { + return new A.LazyTrace(this.get$_chain().get$toTrace()); + }, + toString$0(_) { + return this.get$_chain().toString$0(0); + }, + $isStackTrace: 1, + $isChain: 1 + }; + A.LazyTrace.prototype = { + get$_lazy_trace$_trace() { + var result, _this = this, + value = _this.__LazyTrace__trace_FI; + if (value === $) { + result = _this._thunk.call$0(); + _this.__LazyTrace__trace_FI !== $ && A.throwLateFieldADI("_trace"); + _this.__LazyTrace__trace_FI = result; + value = result; + } + return value; + }, + get$frames() { + return this.get$_lazy_trace$_trace().get$frames(); + }, + toString$0(_) { + return this.get$_lazy_trace$_trace().toString$0(0); + }, + $isStackTrace: 1, + $isTrace: 1 + }; + A.StackZoneSpecification.prototype = { + chainFor$1(trace) { + var previous, t2, t1 = {}; + t1.trace = trace; + if (type$.Chain._is(trace)) + return trace; + A.Expando__checkType(trace); + previous = this._chains._jsWeakMap.get(trace); + if (previous == null) + previous = this._currentNode; + if (previous == null) { + t2 = type$.Trace; + if (t2._is(trace)) + return new A.Chain(A.List_List$unmodifiable(A._setArrayType([trace], type$.JSArray_Trace), t2)); + return new A.LazyChain(new A.StackZoneSpecification_chainFor_closure(t1)); + } else + return new A._Node(A.Trace_Trace$from(!type$.Trace._is(trace) ? t1.trace = new A.LazyTrace(new A.StackZoneSpecification_chainFor_closure0(this, trace)) : trace), previous).toChain$0(); + }, + _registerCallback$1$4($self, $parent, zone, f, $R) { + var t1, t2; + $R._eval$1("0()")._as(f); + if (J.$eq$($.Zone__current.$index(0, $.$get$StackZoneSpecification_disableKey()), true)) + return $parent.registerCallback$1$2(zone, f, $R); + t1 = this._currentTrace$1(2); + t2 = this._currentNode; + return $parent.registerCallback$1$2(zone, new A.StackZoneSpecification__registerCallback_closure(this, f, new A._Node(A.Trace_Trace$from(t1), t2), $R), $R); + }, + _registerCallback$4($self, $parent, zone, f) { + return this._registerCallback$1$4($self, $parent, zone, f, type$.dynamic); + }, + _registerUnaryCallback$2$4($self, $parent, zone, f, $R, $T) { + var t1, t2; + $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); + if (J.$eq$($.Zone__current.$index(0, $.$get$StackZoneSpecification_disableKey()), true)) + return $parent.registerUnaryCallback$2$2(zone, f, $R, $T); + t1 = this._currentTrace$1(2); + t2 = this._currentNode; + return $parent.registerUnaryCallback$2$2(zone, new A.StackZoneSpecification__registerUnaryCallback_closure(this, f, new A._Node(A.Trace_Trace$from(t1), t2), $T, $R), $R, $T); + }, + _registerUnaryCallback$4($self, $parent, zone, f) { + return this._registerUnaryCallback$2$4($self, $parent, zone, f, type$.dynamic, type$.dynamic); + }, + _registerBinaryCallback$3$4($self, $parent, zone, f, $R, T1, T2) { + var t1, t2; + $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(f); + if (J.$eq$($.Zone__current.$index(0, $.$get$StackZoneSpecification_disableKey()), true)) + return $parent.registerBinaryCallback$3$2(zone, f, $R, T1, T2); + t1 = this._currentTrace$1(2); + t2 = this._currentNode; + return $parent.registerBinaryCallback$3$2(zone, new A.StackZoneSpecification__registerBinaryCallback_closure(this, f, new A._Node(A.Trace_Trace$from(t1), t2), T1, T2, $R), $R, T1, T2); + }, + _registerBinaryCallback$4($self, $parent, zone, f) { + return this._registerBinaryCallback$3$4($self, $parent, zone, f, type$.dynamic, type$.dynamic, type$.dynamic); + }, + _handleUncaughtError$5($self, $parent, zone, error, stackTrace) { + var stackChain, newError, newStackTrace, t2, t3, exception, + t1 = type$.Object; + t1._as(error); + t2 = type$.StackTrace; + t2._as(stackTrace); + if (J.$eq$($.Zone__current.$index(0, $.$get$StackZoneSpecification_disableKey()), true)) { + $parent._delegationTarget._processUncaughtError$3(zone, error, stackTrace); + return; + } + stackChain = this.chainFor$1(stackTrace); + t3 = this._onError; + if (t3 == null) { + $parent._delegationTarget._processUncaughtError$3(zone, error, t2._as(stackChain)); + return; + } + try { + $self.get$parent().runBinary$3$3(t3, error, stackChain, type$.void, t1, type$.Chain); + } catch (exception) { + newError = A.unwrapException(exception); + newStackTrace = A.getTraceFromException(exception); + t3 = $parent._delegationTarget; + if (newError === error) + t3._processUncaughtError$3(zone, error, t2._as(stackChain)); + else + t3._processUncaughtError$3(zone, t1._as(newError), t2._as(newStackTrace)); + } + }, + _errorCallback$5($self, $parent, zone, error, stackTrace) { + var t1, t2, t3, asyncError, _this = this; + type$.Object._as(error); + type$.nullable_StackTrace._as(stackTrace); + if (J.$eq$($.Zone__current.$index(0, $.$get$StackZoneSpecification_disableKey()), true)) + return $parent.errorCallback$3(zone, error, stackTrace); + if (stackTrace == null) { + t1 = _this._currentTrace$1(3); + t2 = _this._currentNode; + stackTrace = new A._Node(A.Trace_Trace$from(t1), t2).toChain$0(); + } else { + t1 = _this._chains; + A.Expando__checkType(stackTrace); + if (t1._jsWeakMap.get(stackTrace) == null) { + t2 = _this._currentTrace$1(3); + t3 = _this._currentNode; + t1.$indexSet(0, stackTrace, new A._Node(A.Trace_Trace$from(t2), t3)); + } + } + asyncError = $parent.errorCallback$3(zone, error, stackTrace); + return asyncError == null ? A.AsyncError$(error, stackTrace) : asyncError; + }, + _run$1$2(f, node, $T) { + var previousNode, stackTrace, t1, exception, t2, _this = this; + $T._eval$1("0()")._as(f); + previousNode = _this._currentNode; + _this._currentNode = node; + try { + t1 = f.call$0(); + return t1; + } catch (exception) { + stackTrace = A.getTraceFromException(exception); + t1 = _this._chains; + t2 = type$.Object._as(stackTrace); + A.Expando__checkType(t2); + if (t1._jsWeakMap.get(t2) == null) + t1.$indexSet(0, stackTrace, node); + throw exception; + } finally { + _this.set$_currentNode(previousNode); + } + }, + _currentTrace$1(level) { + return new A.LazyTrace(new A.StackZoneSpecification__currentTrace_closure(this, A.StackTrace_current(), level)); + }, + _trimVMChain$1(trace) { + var text = trace.toString$0(0), + index = B.JSString_methods.indexOf$1(text, $.$get$vmChainGap()); + return index === -1 ? text : B.JSString_methods.substring$2(text, 0, index); + }, + set$_currentNode(_currentNode) { + this._currentNode = type$.nullable__Node._as(_currentNode); + } + }; + A.StackZoneSpecification_chainFor_closure.prototype = { + call$0() { + return A.Chain_Chain$parse(this._box_0.trace.toString$0(0)); + }, + $signature: 48 + }; + A.StackZoneSpecification_chainFor_closure0.prototype = { + call$0() { + return A.Trace_Trace$parse(this.$this._trimVMChain$1(this.original)); + }, + $signature: 2 + }; + A.StackZoneSpecification__registerCallback_closure.prototype = { + call$0() { + var _this = this; + return _this.$this._run$1$2(_this.f, _this.node, _this.R); + }, + $signature() { + return this.R._eval$1("0()"); + } + }; + A.StackZoneSpecification__registerUnaryCallback_closure.prototype = { + call$1(arg) { + var _this = this, + t1 = _this.R; + return _this.$this._run$1$2(new A.StackZoneSpecification__registerUnaryCallback__closure(_this.f, _this.T._as(arg), t1), _this.node, t1); + }, + $signature() { + return this.R._eval$1("@<0>")._bind$1(this.T)._eval$1("1(2)"); + } + }; + A.StackZoneSpecification__registerUnaryCallback__closure.prototype = { + call$0() { + return this.f.call$1(this.arg); + }, + $signature() { + return this.R._eval$1("0()"); + } + }; + A.StackZoneSpecification__registerBinaryCallback_closure.prototype = { + call$2(arg1, arg2) { + var _this = this, + t1 = _this.R; + return _this.$this._run$1$2(new A.StackZoneSpecification__registerBinaryCallback__closure(_this.f, _this.T1._as(arg1), _this.T2._as(arg2), t1), _this.node, t1); + }, + $signature() { + return this.R._eval$1("@<0>")._bind$1(this.T1)._bind$1(this.T2)._eval$1("1(2,3)"); + } + }; + A.StackZoneSpecification__registerBinaryCallback__closure.prototype = { + call$0() { + return this.f.call$2(this.arg1, this.arg2); + }, + $signature() { + return this.R._eval$1("0()"); + } + }; + A.StackZoneSpecification__currentTrace_closure.prototype = { + call$0() { + var text = this.$this._trimVMChain$1(this.stackTrace), + t1 = A.Trace_Trace$parse(text).frames; + return A.Trace$(A.SubListIterable$(t1, this.level + 2, null, A._arrayInstanceType(t1)._precomputed1), text); + }, + $signature: 2 + }; + A._Node.prototype = { + toChain$0() { + var node, + nodes = A._setArrayType([], type$.JSArray_Trace); + for (node = this; node != null;) { + B.JSArray_methods.add$1(nodes, node.trace); + node = node.previous; + } + return new A.Chain(A.List_List$unmodifiable(nodes, type$.Trace)); + } + }; + A.Trace.prototype = { + toString$0(_) { + var t1 = this.frames, + t2 = A._arrayInstanceType(t1); + return new A.MappedListIterable(t1, t2._eval$1("String(1)")._as(new A.Trace_toString_closure(new A.MappedListIterable(t1, t2._eval$1("int(1)")._as(new A.Trace_toString_closure0()), t2._eval$1("MappedListIterable<1,int>")).fold$1$2(0, 0, B.CONSTANT, type$.int))), t2._eval$1("MappedListIterable<1,String>")).join$0(0); + }, + $isStackTrace: 1, + get$frames() { + return this.frames; + } + }; + A.Trace_Trace$from_closure.prototype = { + call$0() { + return A.Trace_Trace$parse(this.trace.toString$0(0)); + }, + $signature: 2 + }; + A.Trace__parseVM_closure.prototype = { + call$1(line) { + return A._asString(line).length !== 0; + }, + $signature: 1 + }; + A.Trace$parseV8_closure.prototype = { + call$1(line) { + return !B.JSString_methods.startsWith$1(A._asString(line), $.$get$_v8TraceLine()); + }, + $signature: 1 + }; + A.Trace$parseJSCore_closure.prototype = { + call$1(line) { + return A._asString(line) !== "\tat "; + }, + $signature: 1 + }; + A.Trace$parseFirefox_closure.prototype = { + call$1(line) { + A._asString(line); + return line.length !== 0 && line !== "[native code]"; + }, + $signature: 1 + }; + A.Trace$parseFriendly_closure.prototype = { + call$1(line) { + return !B.JSString_methods.startsWith$1(A._asString(line), "====="); + }, + $signature: 1 + }; + A.Trace_toString_closure0.prototype = { + call$1(frame) { + return type$.Frame._as(frame).get$location().length; + }, + $signature: 14 + }; + A.Trace_toString_closure.prototype = { + call$1(frame) { + type$.Frame._as(frame); + if (frame instanceof A.UnparsedFrame) + return frame.toString$0(0) + "\n"; + return B.JSString_methods.padRight$1(frame.get$location(), this.longest) + " " + A.S(frame.get$member()) + "\n"; + }, + $signature: 15 + }; + A.UnparsedFrame.prototype = { + toString$0(_) { + return this.member; + }, + $isFrame: 1, + get$uri() { + return this.uri; + }, + get$line() { + return null; + }, + get$column() { + return null; + }, + get$location() { + return "unparsed"; + }, + get$member() { + return this.member; + } + }; + A.launch_closure.prototype = { + call$1(e) { + type$.MapEntry_String_String._as(e); + return A.S(e.key) + "=" + A.S(e.value); + }, + $signature: 49 + }; + (function aliases() { + var _ = J.LegacyJavaScriptObject.prototype; + _.super$LegacyJavaScriptObject$toString = _.toString$0; + _ = A.Iterable.prototype; + _.super$Iterable$skipWhile = _.skipWhile$1; + })(); + (function installTearOffs() { + var _static_1 = hunkHelpers._static_1, + _static = hunkHelpers.installStaticTearOff, + _static_0 = hunkHelpers._static_0, + _instance_0_u = hunkHelpers._instance_0u, + _instance = hunkHelpers.installInstanceTearOff; + _static_1(A, "async__AsyncRun__scheduleImmediateJsOverride$closure", "_AsyncRun__scheduleImmediateJsOverride", 7); + _static_1(A, "async__AsyncRun__scheduleImmediateWithSetImmediate$closure", "_AsyncRun__scheduleImmediateWithSetImmediate", 7); + _static_1(A, "async__AsyncRun__scheduleImmediateWithTimer$closure", "_AsyncRun__scheduleImmediateWithTimer", 7); + _static(A, "async_Future___value_tearOff$closure", 0, null, ["call$1$1", "call$0", "call$1$0", "call$1"], ["Future___value_tearOff", function() { + return A.Future___value_tearOff(null, type$.dynamic); + }, function($T) { + return A.Future___value_tearOff(null, $T); + }, function(value) { + return A.Future___value_tearOff(value, type$.dynamic); + }], 51, 0); + _static_0(A, "async___startMicrotaskLoop$closure", "_startMicrotaskLoop", 0); + _static(A, "async___rootHandleUncaughtError$closure", 5, null, ["call$5"], ["_rootHandleUncaughtError"], 52, 0); + _static(A, "async___rootRun$closure", 4, null, ["call$1$4", "call$4"], ["_rootRun", function($self, $parent, zone, f) { + return A._rootRun($self, $parent, zone, f, type$.dynamic); + }], 53, 0); + _static(A, "async___rootRunUnary$closure", 5, null, ["call$2$5", "call$5"], ["_rootRunUnary", function($self, $parent, zone, f, arg) { + return A._rootRunUnary($self, $parent, zone, f, arg, type$.dynamic, type$.dynamic); + }], 54, 0); + _static(A, "async___rootRunBinary$closure", 6, null, ["call$3$6"], ["_rootRunBinary"], 55, 0); + _static(A, "async___rootRegisterCallback$closure", 4, null, ["call$1$4", "call$4"], ["_rootRegisterCallback", function($self, $parent, zone, f) { + return A._rootRegisterCallback($self, $parent, zone, f, type$.dynamic); + }], 16, 0); + _static(A, "async___rootRegisterUnaryCallback$closure", 4, null, ["call$2$4", "call$4"], ["_rootRegisterUnaryCallback", function($self, $parent, zone, f) { + return A._rootRegisterUnaryCallback($self, $parent, zone, f, type$.dynamic, type$.dynamic); + }], 17, 0); + _static(A, "async___rootRegisterBinaryCallback$closure", 4, null, ["call$3$4", "call$4"], ["_rootRegisterBinaryCallback", function($self, $parent, zone, f) { + return A._rootRegisterBinaryCallback($self, $parent, zone, f, type$.dynamic, type$.dynamic, type$.dynamic); + }], 18, 0); + _static(A, "async___rootErrorCallback$closure", 5, null, ["call$5"], ["_rootErrorCallback"], 19, 0); + _static(A, "async___rootScheduleMicrotask$closure", 4, null, ["call$4"], ["_rootScheduleMicrotask"], 56, 0); + _static(A, "async___rootCreateTimer$closure", 5, null, ["call$5"], ["_rootCreateTimer"], 57, 0); + _static(A, "async___rootCreatePeriodicTimer$closure", 5, null, ["call$5"], ["_rootCreatePeriodicTimer"], 58, 0); + _static(A, "async___rootPrint$closure", 4, null, ["call$4"], ["_rootPrint"], 59, 0); + _static_1(A, "async___printToZone$closure", "_printToZone", 60); + _static(A, "async___rootFork$closure", 5, null, ["call$5"], ["_rootFork"], 61, 0); + _static_1(A, "core_Uri_decodeComponent$closure", "Uri_decodeComponent", 11); + _instance_0_u(A.Chain.prototype, "get$toTrace", "toTrace$0", 2); + _static_1(A, "frame_Frame___parseVM_tearOff$closure", "Frame___parseVM_tearOff", 4); + _static_1(A, "frame_Frame___parseV8_tearOff$closure", "Frame___parseV8_tearOff", 4); + _static_1(A, "frame_Frame___parseFirefox_tearOff$closure", "Frame___parseFirefox_tearOff", 4); + _static_1(A, "frame_Frame___parseFriendly_tearOff$closure", "Frame___parseFriendly_tearOff", 4); + _instance_0_u(A.LazyChain.prototype, "get$toTrace", "toTrace$0", 2); + var _; + _instance(_ = A.StackZoneSpecification.prototype, "get$_registerCallback", 0, 4, null, ["call$1$4", "call$4"], ["_registerCallback$1$4", "_registerCallback$4"], 16, 0, 0); + _instance(_, "get$_registerUnaryCallback", 0, 4, null, ["call$2$4", "call$4"], ["_registerUnaryCallback$2$4", "_registerUnaryCallback$4"], 17, 0, 0); + _instance(_, "get$_registerBinaryCallback", 0, 4, null, ["call$3$4", "call$4"], ["_registerBinaryCallback$3$4", "_registerBinaryCallback$4"], 18, 0, 0); + _instance(_, "get$_handleUncaughtError", 0, 5, null, ["call$5"], ["_handleUncaughtError$5"], 46, 0, 0); + _instance(_, "get$_errorCallback", 0, 5, null, ["call$5"], ["_errorCallback$5"], 19, 0, 0); + _static_1(A, "trace_Trace___parseVM_tearOff$closure", "Trace___parseVM_tearOff", 8); + _static_1(A, "trace_Trace___parseFriendly_tearOff$closure", "Trace___parseFriendly_tearOff", 8); + _static_0(A, "log_cw_metric__launch$closure", "launch", 6); + _static(A, "math__max$closure", 2, null, ["call$1$2", "call$2"], ["max", function(a, b) { + return A.max(a, b, type$.num); + }], 42, 0); + })(); + (function inheritance() { + var _mixin = hunkHelpers.mixin, + _inherit = hunkHelpers.inherit, + _inheritMany = hunkHelpers.inheritMany; + _inherit(A.Object, null); + _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, J.ArrayIterator, A.Iterable, A.CastIterator, A.MapBase, A.Closure, A.Error, A.ListBase, A.SentinelValue, A.ListIterator, A.MappedIterator, A.WhereIterator, A.ExpandIterator, A.TakeIterator, A.SkipIterator, A.SkipWhileIterator, A.EmptyIterator, A.WhereTypeIterator, A.FixedLengthListMixin, A.UnmodifiableListMixin, A.Symbol, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.JSSyntaxRegExp, A._MatchImplementation, A._AllMatchesIterator, A.StringMatch, A._StringAllMatchesIterator, A._Cell, A.Rti, A._FunctionParameters, A._Type, A._TimerImpl, A._AsyncAwaitCompleter, A.AsyncError, A._FutureListener, A._Future, A._AsyncCallbackEntry, A._StreamIterator, A._ZoneFunction, A._ZoneSpecification, A._ZoneDelegate, A._Zone, A._HashMapKeyIterator, A.Codec, A.Converter, A._Utf8Encoder, A._Utf8Decoder, A.Duration, A._Enum, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.MapEntry, A.Null, A._StringStackTrace, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.Expando, A.ActionContext, A.Context, A._PathDirection, A._PathRelation, A.Style, A.ParsedPath, A.PathException, A.Mapping, A.TargetLineEntry, A.TargetEntry, A._MappingTokenizer, A._TokenKind, A.SourceSpanMixin, A.SourceFile, A.SourceLocation, A.Chain, A.Frame, A.LazyChain, A.LazyTrace, A.StackZoneSpecification, A._Node, A.Trace, A.UnparsedFrame]); + _inheritMany(J.Interceptor, [J.JSBool, J.JSNull, J.JavaScriptObject, J.JavaScriptBigInt, J.JavaScriptSymbol, J.JSNumber, J.JSString]); + _inheritMany(J.JavaScriptObject, [J.LegacyJavaScriptObject, J.JSArray, A.NativeByteBuffer, A.NativeTypedData]); + _inheritMany(J.LegacyJavaScriptObject, [J.PlainJavaScriptObject, J.UnknownJavaScriptObject, J.JavaScriptFunction]); + _inherit(J.JSUnmodifiableArray, J.JSArray); + _inheritMany(J.JSNumber, [J.JSInt, J.JSNumNotInt]); + _inheritMany(A.Iterable, [A._CastIterableBase, A.EfficientLengthIterable, A.MappedIterable, A.WhereIterable, A.ExpandIterable, A.TakeIterable, A.SkipIterable, A.SkipWhileIterable, A.WhereTypeIterable, A._AllMatchesIterable, A._StringAllMatchesIterable]); + _inheritMany(A._CastIterableBase, [A.CastIterable, A.__CastListBase__CastIterableBase_ListMixin]); + _inherit(A._EfficientLengthCastIterable, A.CastIterable); + _inherit(A._CastListBase, A.__CastListBase__CastIterableBase_ListMixin); + _inherit(A.CastList, A._CastListBase); + _inheritMany(A.MapBase, [A.CastMap, A.JsLinkedHashMap, A._HashMap, A._JsonMap]); + _inheritMany(A.Closure, [A.Closure2Args, A.Instantiation, A.Closure0Args, A.TearOffClosure, A.initHooks_closure, A.initHooks_closure1, A._AsyncRun__initializeScheduleImmediate_internalCallback, A._AsyncRun__initializeScheduleImmediate_closure, A._awaitOnObject_closure, A.Future_wait_closure, A._Future__chainForeignFuture_closure, A._Future__propagateToListeners_handleWhenCompleteCallback_closure, A._CustomZone_bindUnaryCallback_closure, A._RootZone_bindUnaryCallback_closure, A.MapBase_entries_closure, A._Uri__makePath_closure, A._createTables_setChars, A._createTables_setRange, A.get_closure, A.Context_joinAll_closure, A.Context_split_closure, A._validateArgList_closure, A.WindowsStyle_absolutePathToUri_closure, A.mapStackTrace_closure, A.mapStackTrace_closure0, A._prettifyMember_closure, A._prettifyMember_closure0, A.SingleMapping__findLine_closure, A.SingleMapping__findColumn_closure, A.Chain_Chain$parse_closure, A.Chain_toTrace_closure, A.Chain_toString_closure0, A.Chain_toString__closure0, A.Chain_toString_closure, A.Chain_toString__closure, A.StackZoneSpecification__registerUnaryCallback_closure, A.Trace__parseVM_closure, A.Trace$parseV8_closure, A.Trace$parseJSCore_closure, A.Trace$parseFirefox_closure, A.Trace$parseFriendly_closure, A.Trace_toString_closure0, A.Trace_toString_closure, A.launch_closure]); + _inheritMany(A.Closure2Args, [A.CastMap_forEach_closure, A.initHooks_closure0, A._awaitOnObject_closure0, A._wrapJsFunctionForAsync_closure, A.Future_wait_handleError, A._Future__chainForeignFuture_closure0, A.HashMap_HashMap$from_closure, A.MapBase_mapToString_closure, A.Uri__parseIPv4Address_error, A.Uri_parseIPv6Address_error, A.Uri_parseIPv6Address_parseHex, A._createTables_build, A.wrapMain_closure0, A.SingleMapping$fromJson_closure, A.Frame_Frame$parseV8_closure_parseLocation, A.StackZoneSpecification__registerBinaryCallback_closure]); + _inheritMany(A.Error, [A.LateError, A.TypeError, A.JsNoSuchMethodError, A.UnknownJsTypeError, A._CyclicInitializationError, A.RuntimeError, A.AssertionError, A._Error, A.ArgumentError, A.UnsupportedError, A.UnimplementedError, A.StateError, A.ConcurrentModificationError]); + _inherit(A.UnmodifiableListBase, A.ListBase); + _inherit(A.CodeUnits, A.UnmodifiableListBase); + _inheritMany(A.EfficientLengthIterable, [A.ListIterable, A.EmptyIterable, A.LinkedHashMapKeyIterable, A._HashMapKeyIterable]); + _inheritMany(A.ListIterable, [A.SubListIterable, A.MappedListIterable, A._JsonMapKeyIterable]); + _inherit(A.EfficientLengthMappedIterable, A.MappedIterable); + _inherit(A.EfficientLengthTakeIterable, A.TakeIterable); + _inherit(A.EfficientLengthSkipIterable, A.SkipIterable); + _inherit(A.Instantiation1, A.Instantiation); + _inherit(A.NullError, A.TypeError); + _inheritMany(A.TearOffClosure, [A.StaticClosure, A.BoundClosure]); + _inherit(A._AssertionError, A.AssertionError); + _inheritMany(A.NativeTypedData, [A.NativeByteData, A.NativeTypedArray]); + _inheritMany(A.NativeTypedArray, [A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin]); + _inherit(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin, A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin); + _inherit(A.NativeTypedArrayOfDouble, A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin); + _inherit(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin); + _inherit(A.NativeTypedArrayOfInt, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin); + _inheritMany(A.NativeTypedArrayOfDouble, [A.NativeFloat32List, A.NativeFloat64List]); + _inheritMany(A.NativeTypedArrayOfInt, [A.NativeInt16List, A.NativeInt32List, A.NativeInt8List, A.NativeUint16List, A.NativeUint32List, A.NativeUint8ClampedList, A.NativeUint8List]); + _inherit(A._TypeError, A._Error); + _inheritMany(A.Closure0Args, [A._AsyncRun__scheduleImmediateJsOverride_internalCallback, A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback, A._TimerImpl_internalCallback, A._TimerImpl$periodic_closure, A._Future__addListener_closure, A._Future__prependListeners_closure, A._Future__chainForeignFuture_closure1, A._Future__chainCoreFutureAsync_closure, A._Future__asyncCompleteWithValue_closure, A._Future__asyncCompleteError_closure, A._Future__propagateToListeners_handleWhenCompleteCallback, A._Future__propagateToListeners_handleValueCallback, A._Future__propagateToListeners_handleError, A._CustomZone_bindCallback_closure, A._CustomZone_bindCallbackGuarded_closure, A._rootHandleError_closure, A._RootZone_bindCallback_closure, A._RootZone_bindCallbackGuarded_closure, A.Utf8Decoder__decoder_closure, A.Utf8Decoder__decoderNonfatal_closure, A.wrapMain_closure, A.wrapMain__closure0, A.wrapMain__closure, A._digits_closure, A.Chain_capture_closure, A.Frame_Frame$parseVM_closure, A.Frame_Frame$parseV8_closure, A.Frame_Frame$_parseFirefoxEval_closure, A.Frame_Frame$parseFirefox_closure, A.Frame_Frame$parseFriendly_closure, A.StackZoneSpecification_chainFor_closure, A.StackZoneSpecification_chainFor_closure0, A.StackZoneSpecification__registerCallback_closure, A.StackZoneSpecification__registerUnaryCallback__closure, A.StackZoneSpecification__registerBinaryCallback__closure, A.StackZoneSpecification__currentTrace_closure, A.Trace_Trace$from_closure]); + _inheritMany(A._Zone, [A._CustomZone, A._RootZone]); + _inheritMany(A.Codec, [A.Encoding, A.Base64Codec, A._FusedCodec, A.JsonCodec]); + _inheritMany(A.Encoding, [A.AsciiCodec, A.Utf8Codec, A.SystemEncoding]); + _inheritMany(A.Converter, [A._UnicodeSubsetEncoder, A.Base64Encoder, A.JsonDecoder, A.Utf8Encoder, A.Utf8Decoder]); + _inherit(A.AsciiEncoder, A._UnicodeSubsetEncoder); + _inheritMany(A.ArgumentError, [A.RangeError, A.IndexError]); + _inherit(A._DataUri, A._Uri); + _inherit(A.ActionResult, A._Enum); + _inherit(A.InternalStyle, A.Style); + _inheritMany(A.InternalStyle, [A.PosixStyle, A.UrlStyle, A.WindowsStyle]); + _inheritMany(A.Mapping, [A.MultiSectionMapping, A.SingleMapping]); + _inherit(A.SourceSpanBase, A.SourceSpanMixin); + _inherit(A.SourceMapSpan, A.SourceSpanBase); + _mixin(A.UnmodifiableListBase, A.UnmodifiableListMixin); + _mixin(A.__CastListBase__CastIterableBase_ListMixin, A.ListBase); + _mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin, A.ListBase); + _mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin, A.FixedLengthListMixin); + _mixin(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin, A.ListBase); + _mixin(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin, A.FixedLengthListMixin); + })(); + var init = { + typeUniverse: {eC: new Map(), tR: {}, eT: {}, tPV: {}, sEA: []}, + mangledGlobalNames: {int: "int", double: "double", num: "num", String: "String", bool: "bool", Null: "Null", List: "List"}, + mangledNames: {}, + types: ["~()", "bool(String)", "Trace()", "Frame()", "Frame(String)", "Null()", "Future<~>()", "~(~())", "Trace(String)", "Null(@)", "@()", "String(String)", "~(Uint8List,String,int)", "String(Match)", "int(Frame)", "String(Frame)", "0^()(Zone,ZoneDelegate,Zone,0^())", "0^(1^)(Zone,ZoneDelegate,Zone,0^(1^))", "0^(1^,2^)(Zone,ZoneDelegate,Zone,0^(1^,2^))", "AsyncError?(Zone,ZoneDelegate,Zone,Object,StackTrace?)", "Future<0&>()", "@(@,String)", "@(@)", "~(@)", "Future<~>(Object,Chain)", "Future(Client)", "Null(@,StackTrace)", "String(String?)", "Trace(Trace)", "Frame?(Frame)", "~(int,@)", "~(String,@)", "bool(TargetLineEntry)", "bool(TargetEntry)", "Map()", "~(Object,StackTrace)", "List(Trace)", "int(Trace)", "Null(Object,StackTrace)", "String(Trace)", "_Future<@>(@)", "~(@,@)", "0^(0^,0^)", "~(Object?,Object?)", "Null(~())", "~(String,int)", "~(Zone,ZoneDelegate,Zone,Object,StackTrace)", "~(String,int?)", "Chain()", "String(MapEntry)", "int(int,int)", "Future<0^>([0^/?])", "~(Zone?,ZoneDelegate?,Zone,Object,StackTrace)", "0^(Zone?,ZoneDelegate?,Zone,0^())", "0^(Zone?,ZoneDelegate?,Zone,0^(1^),1^)", "0^(Zone?,ZoneDelegate?,Zone,0^(1^,2^),1^,2^)", "~(Zone?,ZoneDelegate?,Zone,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~(Timer))", "~(Zone,ZoneDelegate,Zone,String)", "~(String)", "Zone(Zone?,ZoneDelegate?,Zone,ZoneSpecification?,Map?)", "@(String)", "Uint8List(@,@)", "Frame(String,String)"], + interceptorsByTag: null, + leafTags: null, + arrayRti: Symbol("$ti") + }; + A._Universe_addRules(init.typeUniverse, JSON.parse('{"PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptFunction":"LegacyJavaScriptObject","JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"Null":[],"TrustedGetRuntimeType":[]},"JavaScriptObject":{"JSObject":[]},"LegacyJavaScriptObject":{"JSObject":[]},"JSArray":{"List":["1"],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"]},"ArrayIterator":{"Iterator":["1"]},"JSNumber":{"double":[],"num":[]},"JSInt":{"double":[],"int":[],"num":[],"TrustedGetRuntimeType":[]},"JSNumNotInt":{"double":[],"num":[],"TrustedGetRuntimeType":[]},"JSString":{"String":[],"Pattern":[],"TrustedGetRuntimeType":[]},"_CastIterableBase":{"Iterable":["2"]},"CastIterator":{"Iterator":["2"]},"CastIterable":{"_CastIterableBase":["1","2"],"Iterable":["2"],"Iterable.E":"2"},"_EfficientLengthCastIterable":{"CastIterable":["1","2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"_CastListBase":{"ListBase":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"]},"CastList":{"_CastListBase":["1","2"],"ListBase":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListBase.E":"2","Iterable.E":"2"},"CastMap":{"MapBase":["3","4"],"Map":["3","4"],"MapBase.K":"3","MapBase.V":"4"},"LateError":{"Error":[]},"CodeUnits":{"ListBase":["int"],"UnmodifiableListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"ListBase.E":"int","UnmodifiableListMixin.E":"int"},"EfficientLengthIterable":{"Iterable":["1"]},"ListIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"SubListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1","ListIterable.E":"1"},"ListIterator":{"Iterator":["1"]},"MappedIterable":{"Iterable":["2"],"Iterable.E":"2"},"EfficientLengthMappedIterable":{"MappedIterable":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"MappedIterator":{"Iterator":["2"]},"MappedListIterable":{"ListIterable":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2","ListIterable.E":"2"},"WhereIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereIterator":{"Iterator":["1"]},"ExpandIterable":{"Iterable":["2"],"Iterable.E":"2"},"ExpandIterator":{"Iterator":["2"]},"TakeIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthTakeIterable":{"TakeIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"TakeIterator":{"Iterator":["1"]},"SkipIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthSkipIterable":{"SkipIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"SkipIterator":{"Iterator":["1"]},"SkipWhileIterable":{"Iterable":["1"],"Iterable.E":"1"},"SkipWhileIterator":{"Iterator":["1"]},"EmptyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"EmptyIterator":{"Iterator":["1"]},"WhereTypeIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereTypeIterator":{"Iterator":["1"]},"UnmodifiableListBase":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"Instantiation":{"Closure":[],"Function":[]},"Instantiation1":{"Closure":[],"Function":[]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"NullThrownFromJavaScriptException":{"Exception":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Closure":[],"Function":[]},"Closure2Args":{"Closure":[],"Function":[]},"TearOffClosure":{"Closure":[],"Function":[]},"StaticClosure":{"Closure":[],"Function":[]},"BoundClosure":{"Closure":[],"Function":[]},"_CyclicInitializationError":{"Error":[]},"RuntimeError":{"Error":[]},"_AssertionError":{"Error":[]},"JsLinkedHashMap":{"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"LinkedHashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"LinkedHashMapKeyIterator":{"Iterator":["1"]},"JSSyntaxRegExp":{"RegExp":[],"Pattern":[]},"_MatchImplementation":{"RegExpMatch":[],"Match":[]},"_AllMatchesIterable":{"Iterable":["RegExpMatch"],"Iterable.E":"RegExpMatch"},"_AllMatchesIterator":{"Iterator":["RegExpMatch"]},"StringMatch":{"Match":[]},"_StringAllMatchesIterable":{"Iterable":["Match"],"Iterable.E":"Match"},"_StringAllMatchesIterator":{"Iterator":["Match"]},"NativeByteBuffer":{"JSObject":[],"TrustedGetRuntimeType":[]},"NativeTypedData":{"JSObject":[]},"NativeByteData":{"JSObject":[],"TrustedGetRuntimeType":[]},"NativeTypedArray":{"JavaScriptIndexingBehavior":["1"],"JSObject":[]},"NativeTypedArrayOfDouble":{"ListBase":["double"],"JavaScriptIndexingBehavior":["double"],"List":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"Iterable":["double"],"FixedLengthListMixin":["double"]},"NativeTypedArrayOfInt":{"ListBase":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"]},"NativeFloat32List":{"ListBase":["double"],"JavaScriptIndexingBehavior":["double"],"List":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double"},"NativeFloat64List":{"ListBase":["double"],"JavaScriptIndexingBehavior":["double"],"List":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double"},"NativeInt16List":{"ListBase":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeInt32List":{"ListBase":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeInt8List":{"ListBase":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint16List":{"ListBase":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint32List":{"ListBase":["int"],"Uint32List":[],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint8ClampedList":{"ListBase":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint8List":{"ListBase":["int"],"Uint8List":[],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"AsyncError":{"Error":[]},"_Future":{"Future":["1"]},"_TimerImpl":{"Timer":[]},"_ZoneSpecification":{"ZoneSpecification":[]},"_ZoneDelegate":{"ZoneDelegate":[]},"_Zone":{"Zone":[]},"_CustomZone":{"_Zone":[],"Zone":[]},"_RootZone":{"_Zone":[],"Zone":[]},"_HashMap":{"MapBase":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_HashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_HashMapKeyIterator":{"Iterator":["1"]},"ListBase":{"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"MapBase":{"Map":["1","2"]},"_JsonMap":{"MapBase":["String","@"],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"_JsonMapKeyIterable":{"ListIterable":["String"],"EfficientLengthIterable":["String"],"Iterable":["String"],"Iterable.E":"String","ListIterable.E":"String"},"AsciiCodec":{"Codec":["String","List"]},"_UnicodeSubsetEncoder":{"Converter":["String","List"]},"AsciiEncoder":{"Converter":["String","List"]},"Base64Codec":{"Codec":["List","String"]},"Base64Encoder":{"Converter":["List","String"]},"_FusedCodec":{"Codec":["1","3"]},"Encoding":{"Codec":["String","List"]},"JsonCodec":{"Codec":["Object?","String"]},"JsonDecoder":{"Converter":["String","Object?"]},"Utf8Codec":{"Codec":["String","List"]},"Utf8Encoder":{"Converter":["String","List"]},"Utf8Decoder":{"Converter":["List","String"]},"double":{"num":[]},"int":{"num":[]},"List":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"RegExpMatch":{"Match":[]},"String":{"Pattern":[]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"RangeError":[],"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"_Exception":{"Exception":[]},"FormatException":{"Exception":[]},"_StringStackTrace":{"StackTrace":[]},"StringBuffer":{"StringSink":[]},"_Uri":{"Uri":[]},"_SimpleUri":{"Uri":[]},"_DataUri":{"Uri":[]},"SystemEncoding":{"Codec":["String","List"]},"PathException":{"Exception":[]},"PosixStyle":{"InternalStyle":[]},"UrlStyle":{"InternalStyle":[]},"WindowsStyle":{"InternalStyle":[]},"MultiSectionMapping":{"Mapping":[]},"SingleMapping":{"Mapping":[]},"_MappingTokenizer":{"Iterator":["String"]},"SourceMapSpan":{"SourceSpan":[]},"SourceSpanBase":{"SourceSpan":[]},"SourceSpanMixin":{"SourceSpan":[]},"Chain":{"StackTrace":[]},"LazyChain":{"Chain":[],"StackTrace":[]},"LazyTrace":{"Trace":[],"StackTrace":[]},"Trace":{"StackTrace":[]},"UnparsedFrame":{"Frame":[]},"Int8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8ClampedList":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Float32List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]},"Float64List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]}}')); + A._Universe_addErasedTypes(init.typeUniverse, JSON.parse('{"UnmodifiableListBase":1,"__CastListBase__CastIterableBase_ListMixin":2,"NativeTypedArray":1}')); + var string$ = { + ______: "===== asynchronous gap ===========================\n", + ABCDEF: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", + Cannotff: "Cannot extract a file path from a URI with a fragment component", + Cannotfq: "Cannot extract a file path from a URI with a query component", + Cannotn: "Cannot extract a non-Windows file path from a file URI with an authority", + Error_: "Error handler must accept one Object or one Object and a StackTrace as arguments, and return a value of the returned future's type" + }; + var type$ = (function rtii() { + var findType = A.findType; + return { + AsyncError: findType("AsyncError"), + Chain: findType("Chain"), + Client_Function: findType("Client()"), + Duration: findType("Duration"), + EfficientLengthIterable_dynamic: findType("EfficientLengthIterable<@>"), + Error: findType("Error"), + Exception: findType("Exception"), + Expando__Node: findType("Expando<_Node>"), + Frame: findType("Frame"), + Frame_Function_String: findType("Frame(String)"), + Function: findType("Function"), + Future_Never: findType("Future<0&>"), + Future_dynamic: findType("Future<@>"), + Iterable_String: findType("Iterable"), + Iterable_dynamic: findType("Iterable<@>"), + JSArray_Frame: findType("JSArray"), + JSArray_Mapping: findType("JSArray"), + JSArray_String: findType("JSArray"), + JSArray_TargetEntry: findType("JSArray"), + JSArray_TargetLineEntry: findType("JSArray"), + JSArray_Trace: findType("JSArray"), + JSArray_Uint8List: findType("JSArray"), + JSArray_dynamic: findType("JSArray<@>"), + JSArray_int: findType("JSArray"), + JSArray_nullable_String: findType("JSArray"), + JSNull: findType("JSNull"), + JSObject: findType("JSObject"), + JavaScriptFunction: findType("JavaScriptFunction"), + JavaScriptIndexingBehavior_dynamic: findType("JavaScriptIndexingBehavior<@>"), + List_String: findType("List"), + List_dynamic: findType("List<@>"), + List_int: findType("List"), + MapEntry_String_String: findType("MapEntry"), + Map_dynamic_dynamic: findType("Map<@,@>"), + MappedIterable_String_Frame: findType("MappedIterable"), + MappedListIterable_String_Trace: findType("MappedListIterable"), + MappedListIterable_String_dynamic: findType("MappedListIterable"), + NativeUint8List: findType("NativeUint8List"), + Never: findType("0&"), + Null: findType("Null"), + Object: findType("Object"), + RangeError: findType("RangeError"), + Record: findType("Record"), + RegExpMatch: findType("RegExpMatch"), + Response: findType("Response0"), + SourceLocation: findType("SourceLocation"), + SourceSpan: findType("SourceSpan"), + StackTrace: findType("StackTrace"), + String: findType("String"), + String_Function_Match: findType("String(Match)"), + TargetEntry: findType("TargetEntry"), + TargetLineEntry: findType("TargetLineEntry"), + Timer: findType("Timer"), + Trace: findType("Trace"), + Trace_Function_String: findType("Trace(String)"), + TrustedGetRuntimeType: findType("TrustedGetRuntimeType"), + TypeError: findType("TypeError"), + Uint8List: findType("Uint8List"), + UnknownJavaScriptObject: findType("UnknownJavaScriptObject"), + Uri: findType("Uri"), + WhereIterable_String: findType("WhereIterable"), + WhereTypeIterable_Frame: findType("WhereTypeIterable"), + WhereTypeIterable_String: findType("WhereTypeIterable"), + Zone: findType("Zone"), + _Future_dynamic: findType("_Future<@>"), + _ZoneFunction_of_A_Function_2_B_and_C_Function_A_extends_nullable_Object_and_B_extends_nullable_Object_and_C_extends_nullable_Object_4_Zone_and_ZoneDelegate_and_Zone_and_A_Function_2_B_and_C: findType("_ZoneFunction<0^(1^,2^)(Zone,ZoneDelegate,Zone,0^(1^,2^))>"), + _ZoneFunction_of_A_Function_B_Function_A_extends_nullable_Object_and_B_extends_nullable_Object_4_Zone_and_ZoneDelegate_and_Zone_and_A_Function_B: findType("_ZoneFunction<0^(1^)(Zone,ZoneDelegate,Zone,0^(1^))>"), + _ZoneFunction_of_A_Function_Function_A_extends_nullable_Object_4_Zone_and_ZoneDelegate_and_Zone_and_A_Function: findType("_ZoneFunction<0^()(Zone,ZoneDelegate,Zone,0^())>"), + _ZoneFunction_of_nullable_AsyncError_Function_5_Zone_and_ZoneDelegate_and_Zone_and_Object_and_nullable_StackTrace: findType("_ZoneFunction"), + _ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace: findType("_ZoneFunction<~(Zone,ZoneDelegate,Zone,Object,StackTrace)>"), + bool: findType("bool"), + bool_Function_Object: findType("bool(Object)"), + bool_Function_String: findType("bool(String)"), + double: findType("double"), + dynamic: findType("@"), + dynamic_Function: findType("@()"), + dynamic_Function_Object: findType("@(Object)"), + dynamic_Function_Object_StackTrace: findType("@(Object,StackTrace)"), + dynamic_Function_String: findType("@(String)"), + int: findType("int"), + legacy_Never: findType("0&*"), + legacy_Object: findType("Object*"), + nullable_Future_Null: findType("Future?"), + nullable_List_dynamic: findType("List<@>?"), + nullable_Map_dynamic_dynamic: findType("Map<@,@>?"), + nullable_Map_of_nullable_Object_and_nullable_Object: findType("Map?"), + nullable_Object: findType("Object?"), + nullable_SourceFile: findType("SourceFile?"), + nullable_StackTrace: findType("StackTrace?"), + nullable_String: findType("String?"), + nullable_String_Function_Match: findType("String(Match)?"), + nullable_Uri: findType("Uri?"), + nullable_Zone: findType("Zone?"), + nullable_ZoneDelegate: findType("ZoneDelegate?"), + nullable_ZoneSpecification: findType("ZoneSpecification?"), + nullable__FutureListener_dynamic_dynamic: findType("_FutureListener<@,@>?"), + nullable__Node: findType("_Node?"), + num: findType("num"), + void: findType("~"), + void_Function: findType("~()"), + void_Function_String_dynamic: findType("~(String,@)"), + void_Function_Timer: findType("~(Timer)") + }; + })(); + (function constants() { + var makeConstList = hunkHelpers.makeConstList; + B.Interceptor_methods = J.Interceptor.prototype; + B.JSArray_methods = J.JSArray.prototype; + B.JSInt_methods = J.JSInt.prototype; + B.JSString_methods = J.JSString.prototype; + B.JavaScriptFunction_methods = J.JavaScriptFunction.prototype; + B.JavaScriptObject_methods = J.JavaScriptObject.prototype; + B.NativeUint8List_methods = A.NativeUint8List.prototype; + B.PlainJavaScriptObject_methods = J.PlainJavaScriptObject.prototype; + B.UnknownJavaScriptObject_methods = J.UnknownJavaScriptObject.prototype; + B.ActionResult_0 = new A.ActionResult("success"); + B.ActionResult_1 = new A.ActionResult("failure"); + B.AsciiEncoder_127 = new A.AsciiEncoder(127); + B.CONSTANT0 = new A.Instantiation1(A.async_Future___value_tearOff$closure(), A.findType("Instantiation1<~()>")); + B.CONSTANT = new A.Instantiation1(A.math__max$closure(), A.findType("Instantiation1")); + B.C_AsciiCodec = new A.AsciiCodec(); + B.C_Base64Encoder = new A.Base64Encoder(); + B.C_Base64Codec = new A.Base64Codec(); + B.C_Duration = new A.Duration(); + B.C_EmptyIterator = new A.EmptyIterator(A.findType("EmptyIterator<0&>")); + B.C_JS_CONST = function getTagFallback(o) { + var s = Object.prototype.toString.call(o); + return s.substring(8, s.length - 1); +}; + B.C_JS_CONST0 = function() { + var toStringFunction = Object.prototype.toString; + function getTag(o) { + var s = toStringFunction.call(o); + return s.substring(8, s.length - 1); + } + function getUnknownTag(object, tag) { + if (/^HTML[A-Z].*Element$/.test(tag)) { + var name = toStringFunction.call(object); + if (name == "[object Object]") return null; + return "HTMLElement"; + } + } + function getUnknownTagGenericBrowser(object, tag) { + if (self.HTMLElement && object instanceof HTMLElement) return "HTMLElement"; + return getUnknownTag(object, tag); + } + function prototypeForTag(tag) { + if (typeof window == "undefined") return null; + if (typeof window[tag] == "undefined") return null; + var constructor = window[tag]; + if (typeof constructor != "function") return null; + return constructor.prototype; + } + function discriminator(tag) { return null; } + var isBrowser = typeof navigator == "object"; + return { + getTag: getTag, + getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag, + prototypeForTag: prototypeForTag, + discriminator: discriminator }; +}; + B.C_JS_CONST6 = function(getTagFallback) { + return function(hooks) { + if (typeof navigator != "object") return hooks; + var ua = navigator.userAgent; + if (ua.indexOf("DumpRenderTree") >= 0) return hooks; + if (ua.indexOf("Chrome") >= 0) { + function confirm(p) { + return typeof window == "object" && window[p] && window[p].name == p; + } + if (confirm("Window") && confirm("HTMLElement")) return hooks; + } + hooks.getTag = getTagFallback; + }; +}; + B.C_JS_CONST1 = function(hooks) { + if (typeof dartExperimentalFixupGetTag != "function") return hooks; + hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag); +}; + B.C_JS_CONST2 = function(hooks) { + var getTag = hooks.getTag; + var prototypeForTag = hooks.prototypeForTag; + function getTagFixed(o) { + var tag = getTag(o); + if (tag == "Document") { + if (!!o.xmlVersion) return "!Document"; + return "!HTMLDocument"; + } + return tag; + } + function prototypeForTagFixed(tag) { + if (tag == "Document") return null; + return prototypeForTag(tag); + } + hooks.getTag = getTagFixed; + hooks.prototypeForTag = prototypeForTagFixed; +}; + B.C_JS_CONST5 = function(hooks) { + var userAgent = typeof navigator == "object" ? navigator.userAgent : ""; + if (userAgent.indexOf("Firefox") == -1) return hooks; + var getTag = hooks.getTag; + var quickMap = { + "BeforeUnloadEvent": "Event", + "DataTransfer": "Clipboard", + "GeoGeolocation": "Geolocation", + "Location": "!Location", + "WorkerMessageEvent": "MessageEvent", + "XMLDocument": "!Document"}; + function getTagFirefox(o) { + var tag = getTag(o); + return quickMap[tag] || tag; + } + hooks.getTag = getTagFirefox; +}; + B.C_JS_CONST4 = function(hooks) { + var userAgent = typeof navigator == "object" ? navigator.userAgent : ""; + if (userAgent.indexOf("Trident/") == -1) return hooks; + var getTag = hooks.getTag; + var quickMap = { + "BeforeUnloadEvent": "Event", + "DataTransfer": "Clipboard", + "HTMLDDElement": "HTMLElement", + "HTMLDTElement": "HTMLElement", + "HTMLPhraseElement": "HTMLElement", + "Position": "Geoposition" + }; + function getTagIE(o) { + var tag = getTag(o); + var newTag = quickMap[tag]; + if (newTag) return newTag; + if (tag == "Object") { + if (window.DataView && (o instanceof window.DataView)) return "DataView"; + } + return tag; + } + function prototypeForTagIE(tag) { + var constructor = window[tag]; + if (constructor == null) return null; + return constructor.prototype; + } + hooks.getTag = getTagIE; + hooks.prototypeForTag = prototypeForTagIE; +}; + B.C_JS_CONST3 = function(hooks) { return hooks; } +; + B.C_JsonCodec = new A.JsonCodec(); + B.C_OutOfMemoryError = new A.OutOfMemoryError(); + B.C_SentinelValue = new A.SentinelValue(); + B.C_SystemEncoding = new A.SystemEncoding(); + B.C_Utf8Codec = new A.Utf8Codec(); + B.C_Utf8Encoder = new A.Utf8Encoder(); + B.C__RootZone = new A._RootZone(); + B.JsonDecoder_null = new A.JsonDecoder(null); + B.List_M1A = A._setArrayType(makeConstList([0, 0, 24576, 1023, 65534, 34815, 65534, 18431]), type$.JSArray_int); + B.List_MMm = A._setArrayType(makeConstList([0, 0, 26624, 1023, 65534, 2047, 65534, 2047]), type$.JSArray_int); + B.List_OL3 = A._setArrayType(makeConstList([0, 0, 32722, 12287, 65534, 34815, 65534, 18431]), type$.JSArray_int); + B.List_XRg0 = A._setArrayType(makeConstList([0, 0, 32722, 12287, 65535, 34815, 65534, 18431]), type$.JSArray_int); + B.List_XRg = A._setArrayType(makeConstList([0, 0, 65490, 12287, 65535, 34815, 65534, 18431]), type$.JSArray_int); + B.List_YmH = A._setArrayType(makeConstList([0, 0, 32776, 33792, 1, 10240, 0, 0]), type$.JSArray_int); + B.List_ejq = A._setArrayType(makeConstList([0, 0, 32754, 11263, 65534, 34815, 65534, 18431]), type$.JSArray_int); + B.List_empty = A._setArrayType(makeConstList([]), type$.JSArray_String); + B.List_empty0 = A._setArrayType(makeConstList([]), type$.JSArray_nullable_String); + B.List_oFp = A._setArrayType(makeConstList([0, 0, 65490, 45055, 65535, 34815, 65534, 18431]), type$.JSArray_int); + B.List_yzX = A._setArrayType(makeConstList([0, 0, 27858, 1023, 65534, 51199, 65535, 32767]), type$.JSArray_int); + B.Symbol__clientToken = new A.Symbol("_clientToken"); + B.Type_ByteBuffer_RkP = A.typeLiteral("ByteBuffer"); + B.Type_ByteData_zNC = A.typeLiteral("ByteData"); + B.Type_Float32List_LB7 = A.typeLiteral("Float32List"); + B.Type_Float64List_LB7 = A.typeLiteral("Float64List"); + B.Type_Int16List_uXf = A.typeLiteral("Int16List"); + B.Type_Int32List_O50 = A.typeLiteral("Int32List"); + B.Type_Int8List_ekJ = A.typeLiteral("Int8List"); + B.Type_Object_xQ6 = A.typeLiteral("Object"); + B.Type_Uint16List_2bx = A.typeLiteral("Uint16List"); + B.Type_Uint32List_2bx = A.typeLiteral("Uint32List"); + B.Type_Uint8ClampedList_Jik = A.typeLiteral("Uint8ClampedList"); + B.Type_Uint8List_WLA = A.typeLiteral("Uint8List"); + B.Utf8Decoder_false = new A.Utf8Decoder(false); + B._PathDirection_8Gl = new A._PathDirection("at root"); + B._PathDirection_988 = new A._PathDirection("below root"); + B._PathDirection_FIw = new A._PathDirection("reaches root"); + B._PathDirection_ZGD = new A._PathDirection("above root"); + B._PathRelation_different = new A._PathRelation("different"); + B._PathRelation_equal = new A._PathRelation("equal"); + B._PathRelation_inconclusive = new A._PathRelation("inconclusive"); + B._PathRelation_within = new A._PathRelation("within"); + B._StringStackTrace_3uE = new A._StringStackTrace(""); + B._TokenKind_false_false_false = new A._TokenKind(false, false, false); + B._TokenKind_false_false_true = new A._TokenKind(false, false, true); + B._TokenKind_false_true_false = new A._TokenKind(false, true, false); + B._TokenKind_true_false_false = new A._TokenKind(true, false, false); + B._ZoneFunction_3bB = new A._ZoneFunction(B.C__RootZone, A.async___rootCreatePeriodicTimer$closure(), A.findType("_ZoneFunction")); + B._ZoneFunction_7G2 = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterBinaryCallback$closure(), type$._ZoneFunction_of_A_Function_2_B_and_C_Function_A_extends_nullable_Object_and_B_extends_nullable_Object_and_C_extends_nullable_Object_4_Zone_and_ZoneDelegate_and_Zone_and_A_Function_2_B_and_C); + B._ZoneFunction_Eeh = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterUnaryCallback$closure(), type$._ZoneFunction_of_A_Function_B_Function_A_extends_nullable_Object_and_B_extends_nullable_Object_4_Zone_and_ZoneDelegate_and_Zone_and_A_Function_B); + B._ZoneFunction_NMc = new A._ZoneFunction(B.C__RootZone, A.async___rootHandleUncaughtError$closure(), type$._ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace); + B._ZoneFunction__RootZone__rootCreateTimer = new A._ZoneFunction(B.C__RootZone, A.async___rootCreateTimer$closure(), A.findType("_ZoneFunction")); + B._ZoneFunction__RootZone__rootErrorCallback = new A._ZoneFunction(B.C__RootZone, A.async___rootErrorCallback$closure(), type$._ZoneFunction_of_nullable_AsyncError_Function_5_Zone_and_ZoneDelegate_and_Zone_and_Object_and_nullable_StackTrace); + B._ZoneFunction__RootZone__rootFork = new A._ZoneFunction(B.C__RootZone, A.async___rootFork$closure(), A.findType("_ZoneFunction?)>")); + B._ZoneFunction__RootZone__rootPrint = new A._ZoneFunction(B.C__RootZone, A.async___rootPrint$closure(), A.findType("_ZoneFunction<~(Zone,ZoneDelegate,Zone,String)>")); + B._ZoneFunction__RootZone__rootRegisterCallback = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterCallback$closure(), type$._ZoneFunction_of_A_Function_Function_A_extends_nullable_Object_4_Zone_and_ZoneDelegate_and_Zone_and_A_Function); + B._ZoneFunction__RootZone__rootRun = new A._ZoneFunction(B.C__RootZone, A.async___rootRun$closure(), A.findType("_ZoneFunction<0^(Zone,ZoneDelegate,Zone,0^())>")); + B._ZoneFunction__RootZone__rootRunBinary = new A._ZoneFunction(B.C__RootZone, A.async___rootRunBinary$closure(), A.findType("_ZoneFunction<0^(Zone,ZoneDelegate,Zone,0^(1^,2^),1^,2^)>")); + B._ZoneFunction__RootZone__rootRunUnary = new A._ZoneFunction(B.C__RootZone, A.async___rootRunUnary$closure(), A.findType("_ZoneFunction<0^(Zone,ZoneDelegate,Zone,0^(1^),1^)>")); + B._ZoneFunction__RootZone__rootScheduleMicrotask = new A._ZoneFunction(B.C__RootZone, A.async___rootScheduleMicrotask$closure(), A.findType("_ZoneFunction<~(Zone,ZoneDelegate,Zone,~())>")); + B._ZoneSpecification_ALf = new A._ZoneSpecification(null, null, null, null, null, null, null, null, null, null, null, null, null); + })(); + (function staticFields() { + $._JS_INTEROP_INTERCEPTOR_TAG = null; + $.toStringVisiting = A._setArrayType([], A.findType("JSArray")); + $.printToZone = null; + $.Primitives__identityHashCodeProperty = null; + $.BoundClosure__receiverFieldNameCache = null; + $.BoundClosure__interceptorFieldNameCache = null; + $.getTagFunction = null; + $.alternateTagFunction = null; + $.prototypeForTagFunction = null; + $.dispatchRecordsForInstanceTags = null; + $.interceptorsForUncacheableTags = null; + $.initNativeDispatchFlag = null; + $._nextCallback = null; + $._lastCallback = null; + $._lastPriorityCallback = null; + $._isInCallbackLoop = false; + $.Zone__current = B.C__RootZone; + $._RootZone__rootDelegate = null; + $.Uri__cachedBaseString = ""; + $.Uri__cachedBaseUri = null; + $._currentUriBase = null; + $._current = null; + })(); + (function lazyInitializers() { + var _lazyFinal = hunkHelpers.lazyFinal, + _lazy = hunkHelpers.lazy; + _lazyFinal($, "DART_CLOSURE_PROPERTY_NAME", "$get$DART_CLOSURE_PROPERTY_NAME", () => A.getIsolateAffinityTag("_$dart_dartClosure")); + _lazyFinal($, "TypeErrorDecoder_noSuchMethodPattern", "$get$TypeErrorDecoder_noSuchMethodPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn({ + toString: function() { + return "$receiver$"; + } + }))); + _lazyFinal($, "TypeErrorDecoder_notClosurePattern", "$get$TypeErrorDecoder_notClosurePattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn({$method$: null, + toString: function() { + return "$receiver$"; + } + }))); + _lazyFinal($, "TypeErrorDecoder_nullCallPattern", "$get$TypeErrorDecoder_nullCallPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn(null))); + _lazyFinal($, "TypeErrorDecoder_nullLiteralCallPattern", "$get$TypeErrorDecoder_nullLiteralCallPattern", () => A.TypeErrorDecoder_extractPattern(function() { + var $argumentsExpr$ = "$arguments$"; + try { + null.$method$($argumentsExpr$); + } catch (e) { + return e.message; + } + }())); + _lazyFinal($, "TypeErrorDecoder_undefinedCallPattern", "$get$TypeErrorDecoder_undefinedCallPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn(void 0))); + _lazyFinal($, "TypeErrorDecoder_undefinedLiteralCallPattern", "$get$TypeErrorDecoder_undefinedLiteralCallPattern", () => A.TypeErrorDecoder_extractPattern(function() { + var $argumentsExpr$ = "$arguments$"; + try { + (void 0).$method$($argumentsExpr$); + } catch (e) { + return e.message; + } + }())); + _lazyFinal($, "TypeErrorDecoder_nullPropertyPattern", "$get$TypeErrorDecoder_nullPropertyPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokePropertyErrorOn(null))); + _lazyFinal($, "TypeErrorDecoder_nullLiteralPropertyPattern", "$get$TypeErrorDecoder_nullLiteralPropertyPattern", () => A.TypeErrorDecoder_extractPattern(function() { + try { + null.$method$; + } catch (e) { + return e.message; + } + }())); + _lazyFinal($, "TypeErrorDecoder_undefinedPropertyPattern", "$get$TypeErrorDecoder_undefinedPropertyPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokePropertyErrorOn(void 0))); + _lazyFinal($, "TypeErrorDecoder_undefinedLiteralPropertyPattern", "$get$TypeErrorDecoder_undefinedLiteralPropertyPattern", () => A.TypeErrorDecoder_extractPattern(function() { + try { + (void 0).$method$; + } catch (e) { + return e.message; + } + }())); + _lazyFinal($, "_AsyncRun__scheduleImmediateClosure", "$get$_AsyncRun__scheduleImmediateClosure", () => A._AsyncRun__initializeScheduleImmediate()); + _lazyFinal($, "_RootZone__rootMap", "$get$_RootZone__rootMap", () => { + var t1 = type$.dynamic; + return A.HashMap_HashMap(t1, t1); + }); + _lazyFinal($, "Utf8Decoder__decoder", "$get$Utf8Decoder__decoder", () => new A.Utf8Decoder__decoder_closure().call$0()); + _lazyFinal($, "Utf8Decoder__decoderNonfatal", "$get$Utf8Decoder__decoderNonfatal", () => new A.Utf8Decoder__decoderNonfatal_closure().call$0()); + _lazyFinal($, "_Base64Decoder__inverseAlphabet", "$get$_Base64Decoder__inverseAlphabet", () => new Int8Array(A._ensureNativeList(A._setArrayType([-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -2, -2, -2, -2, -2, 62, -2, 62, -2, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -2, -2, -2, -1, -2, -2, -2, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -2, -2, -2, -2, 63, -2, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -2, -2, -2, -2, -2], type$.JSArray_int)))); + _lazyFinal($, "_Uri__isWindowsCached", "$get$_Uri__isWindowsCached", () => typeof process != "undefined" && Object.prototype.toString.call(process) == "[object process]" && process.platform == "win32"); + _lazyFinal($, "_Uri__needsNoEncoding", "$get$_Uri__needsNoEncoding", () => A.RegExp_RegExp("^[\\-\\.0-9A-Z_a-z~]*$", false)); + _lazy($, "_hasErrorStackProperty", "$get$_hasErrorStackProperty", () => new Error().stack != void 0); + _lazyFinal($, "_hashSeed", "$get$_hashSeed", () => A.objectHashCode(B.Type_Object_xQ6)); + _lazyFinal($, "_scannerTables", "$get$_scannerTables", () => A._createTables()); + _lazyFinal($, "context", "$get$context0", () => { + var t1 = A.findType("JSArray<~()>"); + return new A.ActionContext(A._setArrayType([], t1), A._setArrayType([], t1)); + }); + _lazyFinal($, "windows", "$get$windows", () => A.Context_Context($.$get$Style_windows())); + _lazyFinal($, "url", "$get$url", () => A.Context_Context($.$get$Style_url())); + _lazyFinal($, "context0", "$get$context", () => new A.Context($.$get$Style_platform(), null)); + _lazyFinal($, "Style_posix", "$get$Style_posix", () => new A.PosixStyle(A.RegExp_RegExp("/", false), A.RegExp_RegExp("[^/]$", false), A.RegExp_RegExp("^/", false))); + _lazyFinal($, "Style_windows", "$get$Style_windows", () => new A.WindowsStyle(A.RegExp_RegExp("[/\\\\]", false), A.RegExp_RegExp("[^/\\\\]$", false), A.RegExp_RegExp("^(\\\\\\\\[^\\\\]+\\\\[^\\\\/]+|[a-zA-Z]:[/\\\\])", false), A.RegExp_RegExp("^[/\\\\](?![/\\\\])", false))); + _lazyFinal($, "Style_url", "$get$Style_url", () => new A.UrlStyle(A.RegExp_RegExp("/", false), A.RegExp_RegExp("(^[a-zA-Z][-+.a-zA-Z\\d]*://|[^/])$", false), A.RegExp_RegExp("[a-zA-Z][-+.a-zA-Z\\d]*://[^/]*", false), A.RegExp_RegExp("^/", false))); + _lazyFinal($, "Style_platform", "$get$Style_platform", () => A.Style__getPlatformStyle()); + _lazyFinal($, "_digits", "$get$_digits", () => new A._digits_closure().call$0()); + _lazyFinal($, "maxInt32", "$get$maxInt32", () => A._asInt(A.pow(2, 31)) - 1); + _lazyFinal($, "minInt32", "$get$minInt32", () => -A._asInt(A.pow(2, 31))); + _lazyFinal($, "_specKey", "$get$_specKey", () => new A.Object()); + _lazyFinal($, "_vmFrame", "$get$_vmFrame", () => A.RegExp_RegExp("^#\\d+\\s+(\\S.*) \\((.+?)((?::\\d+){0,2})\\)$", false)); + _lazyFinal($, "_v8Frame", "$get$_v8Frame", () => A.RegExp_RegExp("^\\s*at (?:(\\S.*?)(?: \\[as [^\\]]+\\])? \\((.*)\\)|(.*))$", false)); + _lazyFinal($, "_v8UrlLocation", "$get$_v8UrlLocation", () => A.RegExp_RegExp("^(.*?):(\\d+)(?::(\\d+))?$|native$", false)); + _lazyFinal($, "_v8EvalLocation", "$get$_v8EvalLocation", () => A.RegExp_RegExp("^eval at (?:\\S.*?) \\((.*)\\)(?:, .*?:\\d+:\\d+)?$", false)); + _lazyFinal($, "_firefoxEvalLocation", "$get$_firefoxEvalLocation", () => A.RegExp_RegExp("(\\S+)@(\\S+) line (\\d+) >.* (Function|eval):\\d+:\\d+", false)); + _lazyFinal($, "_firefoxSafariFrame", "$get$_firefoxSafariFrame", () => A.RegExp_RegExp("^(?:([^@(/]*)(?:\\(.*\\))?((?:/[^/]*)*)(?:\\(.*\\))?@)?(.*?):(\\d*)(?::(\\d*))?$", false)); + _lazyFinal($, "_friendlyFrame", "$get$_friendlyFrame", () => A.RegExp_RegExp("^(\\S+)(?: (\\d+)(?::(\\d+))?)?\\s+([^\\d].*)$", false)); + _lazyFinal($, "_asyncBody", "$get$_asyncBody", () => A.RegExp_RegExp("<(|[^>]+)_async_body>", false)); + _lazyFinal($, "_initialDot", "$get$_initialDot", () => A.RegExp_RegExp("^\\.", false)); + _lazyFinal($, "Frame__uriRegExp", "$get$Frame__uriRegExp", () => A.RegExp_RegExp("^[a-zA-Z][-+.a-zA-Z\\d]*://", false)); + _lazyFinal($, "Frame__windowsRegExp", "$get$Frame__windowsRegExp", () => A.RegExp_RegExp("^([a-zA-Z]:[\\\\/]|\\\\\\\\)", false)); + _lazyFinal($, "StackZoneSpecification_disableKey", "$get$StackZoneSpecification_disableKey", () => new A.Object()); + _lazyFinal($, "_v8Trace", "$get$_v8Trace", () => A.RegExp_RegExp("\\n ?at ", false)); + _lazyFinal($, "_v8TraceLine", "$get$_v8TraceLine", () => A.RegExp_RegExp(" ?at ", false)); + _lazyFinal($, "_firefoxEvalTrace", "$get$_firefoxEvalTrace", () => A.RegExp_RegExp("@\\S+ line \\d+ >.* (Function|eval):\\d+:\\d+", false)); + _lazyFinal($, "_firefoxSafariTrace", "$get$_firefoxSafariTrace", () => A.RegExp_RegExp("^(([.0-9A-Za-z_$/<]|\\(.*\\))*@)?[^\\s]*:\\d*$", true)); + _lazyFinal($, "_friendlyTrace", "$get$_friendlyTrace", () => A.RegExp_RegExp("^[^\\s<][^\\s]*( \\d+(:\\d+)?)?[ \\t]+[^\\s]+$", true)); + _lazyFinal($, "vmChainGap", "$get$vmChainGap", () => A.RegExp_RegExp("^\\n?$", true)); + })(); + (function nativeSupport() { + !function() { + var intern = function(s) { + var o = {}; + o[s] = 1; + return Object.keys(hunkHelpers.convertToFastObject(o))[0]; + }; + init.getIsolateTag = function(name) { + return intern("___dart_" + name + init.isolateTag); + }; + var tableProperty = "___dart_isolate_tags_"; + var usedProperties = Object[tableProperty] || (Object[tableProperty] = Object.create(null)); + var rootProperty = "_ZxYxX"; + for (var i = 0;; i++) { + var property = intern(rootProperty + "_" + i + "_"); + if (!(property in usedProperties)) { + usedProperties[property] = 1; + init.isolateTag = property; + break; + } + } + init.dispatchPropertyName = init.getIsolateTag("dispatch_record"); + }(); + hunkHelpers.setOrUpdateInterceptorsByTag({ArrayBuffer: A.NativeByteBuffer, ArrayBufferView: A.NativeTypedData, DataView: A.NativeByteData, Float32Array: A.NativeFloat32List, Float64Array: A.NativeFloat64List, Int16Array: A.NativeInt16List, Int32Array: A.NativeInt32List, Int8Array: A.NativeInt8List, Uint16Array: A.NativeUint16List, Uint32Array: A.NativeUint32List, Uint8ClampedArray: A.NativeUint8ClampedList, CanvasPixelArray: A.NativeUint8ClampedList, Uint8Array: A.NativeUint8List}); + hunkHelpers.setOrUpdateLeafTags({ArrayBuffer: true, ArrayBufferView: false, DataView: true, Float32Array: true, Float64Array: true, Int16Array: true, Int32Array: true, Int8Array: true, Uint16Array: true, Uint32Array: true, Uint8ClampedArray: true, CanvasPixelArray: true, Uint8Array: false}); + A.NativeTypedArray.$nativeSuperclassTag = "ArrayBufferView"; + A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin.$nativeSuperclassTag = "ArrayBufferView"; + A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin.$nativeSuperclassTag = "ArrayBufferView"; + A.NativeTypedArrayOfDouble.$nativeSuperclassTag = "ArrayBufferView"; + A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin.$nativeSuperclassTag = "ArrayBufferView"; + A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin.$nativeSuperclassTag = "ArrayBufferView"; + A.NativeTypedArrayOfInt.$nativeSuperclassTag = "ArrayBufferView"; + })(); + Function.prototype.call$0 = function() { + return this(); + }; + Function.prototype.call$1 = function(a) { + return this(a); + }; + Function.prototype.call$2 = function(a, b) { + return this(a, b); + }; + Function.prototype.call$1$1 = function(a) { + return this(a); + }; + Function.prototype.call$3$1 = function(a) { + return this(a); + }; + Function.prototype.call$3 = function(a, b, c) { + return this(a, b, c); + }; + Function.prototype.call$4 = function(a, b, c, d) { + return this(a, b, c, d); + }; + Function.prototype.call$3$3 = function(a, b, c) { + return this(a, b, c); + }; + Function.prototype.call$2$2 = function(a, b) { + return this(a, b); + }; + Function.prototype.call$2$1 = function(a) { + return this(a); + }; + Function.prototype.call$5 = function(a, b, c, d, e) { + return this(a, b, c, d, e); + }; + Function.prototype.call$3$4 = function(a, b, c, d) { + return this(a, b, c, d); + }; + Function.prototype.call$2$4 = function(a, b, c, d) { + return this(a, b, c, d); + }; + Function.prototype.call$1$4 = function(a, b, c, d) { + return this(a, b, c, d); + }; + Function.prototype.call$3$6 = function(a, b, c, d, e, f) { + return this(a, b, c, d, e, f); + }; + Function.prototype.call$2$5 = function(a, b, c, d, e) { + return this(a, b, c, d, e); + }; + Function.prototype.call$2$0 = function() { + return this(); + }; + Function.prototype.call$1$0 = function() { + return this(); + }; + convertAllToFastObject(holders); + convertToFastObject($); + (function(callback) { + if (typeof document === "undefined") { + callback(null); + return; + } + if (typeof document.currentScript != "undefined") { + callback(document.currentScript); + return; + } + var scripts = document.scripts; + function onLoad(event) { + for (var i = 0; i < scripts.length; ++i) + scripts[i].removeEventListener("load", onLoad, false); + callback(event.target); + } + for (var i = 0; i < scripts.length; ++i) + scripts[i].addEventListener("load", onLoad, false); + })(function(currentScript) { + init.currentScript = currentScript; + var callMain = function(args) { + return A.main(A.convertMainArgumentList(args)); + }; + if (typeof dartMainRunner === "function") + dartMainRunner(callMain, []); + else + callMain([]); + }); +})(); + +//# sourceMappingURL=main.cjs.map diff --git a/.github/composite_actions/log_metric/action.yaml b/.github/composite_actions/log_metric/action.yaml deleted file mode 100644 index 4043545c78..0000000000 --- a/.github/composite_actions/log_metric/action.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: Log Metric -description: Log data point to a metric with the provided value. If the metric is not there, it will create one -# To avoid 'Credentials could not be loaded' calling workflows must include: -# permissions: -# id-token: write -# contents: read -inputs: - aws-region: - required: true - description: The AWS region - role-to-assume: - required: true - description: The role to assume in the STS session - metric-name: - description: Name of the metric to track in Cloudwatch. - required: true - value: - # Why we publish value 0 on success: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html#publishingZero - description: Value of the metric to track in Cloudwatch. - required: true - dimensions: - description: Dimensions of metric to track in Cloudwatch, in format dimensionName1=value,dimensionName2=value,... - required: false -runs: - using: "composite" - steps: - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@04b98b3f9e85f563fb061be8751a0352327246b0 # 3.0.1 - with: - unset-current-credentials: true - role-to-assume: ${{ inputs.role-to-assume }} - aws-region: ${{ inputs.aws-region }} - role-duration-seconds: 900 - - - name: Run Dart script - # Run a Dart script to put metric data. - run: dart ./tool/send_metric_data.dart ${{ inputs.metric-name }} ${{ inputs.value }} ${{ inputs.dimensions }} - shell: bash diff --git a/.github/composite_actions/log_metric_wrapper/action.yaml b/.github/composite_actions/log_metric_wrapper/action.yaml new file mode 100644 index 0000000000..936937180a --- /dev/null +++ b/.github/composite_actions/log_metric_wrapper/action.yaml @@ -0,0 +1,113 @@ +name: Log CW Metric Wrapper +description: Test to log a CW metric +inputs: + role-to-assume: + description: AWS role to assume for CW pushing + required: true + aws-region: + description: AWS region + required: true + + # For getting failing step + job-status: + description: Used to determine if we track success or failure. + required: true + job-identifier: + description: For differentiating jobs of a run. + required: true + github-token: + required: true + description: Github token for requesting failing steps. + repo: + required: true + description: Github repo + run-id: + required: true + description: Github Action Run Id + + # Global Metric Dimensions + metricName: + description: Name of the metric to track in Cloudwatch. + required: true + testType: + description: canary, integration, unit testType. + required: true + category: + description: analytics, api, authenticator, etc. + required: true + workflowName: + description: The Github Action workflow.yaml file name. ie "AmplifyCanaries". + required: true + + # FlutterDart Workflows Metric Dimensions + framework: + description: flutter, dart. + required: false + flutterDartChannel: + description: beta, stable. + required: false + dartVersion: + description: 3, 2.19, 2.18, etc. + required: false + flutterVersion: + description: 3.10.6, 3.10.5, etc. + required: false + dartCompiler: + description: dart2js, ddc, dart, dart2wasm. + required: false + + # Platform Workflows Metric Dimensions + platform: + description: android, ios, web, linux, windows. + required: false + platformVersion: + description: ios-14.5, ios-16, android-25-x86, etc. + required: false +runs: + using: "composite" + steps: + #- name: Exit if not scheduled + # shell: bash + # run: | + # if [ "${{ github.event_name }}" != "schedule" ]; then + # echo "This was not triggered by a schedule, skipping." + # echo "SKIP=true" >> $GITHUB_ENV + # fi + + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 3.6.0 + with: + persist-credentials: false + submodules: true + + - name: Install dependencies + uses: ./.github/composite_actions/install_dependencies + + - name: Configure AWS credentials + #if: env.SKIP != 'true' + uses: aws-actions/configure-aws-credentials@04b98b3f9e85f563fb061be8751a0352327246b0 # 3.0.1 + with: + unset-current-credentials: true + role-to-assume: ${{ inputs.role-to-assume }} + aws-region: ${{ inputs.aws-region }} + role-duration-seconds: 900 + + - name: Log the CW Metrics + #if: env.SKIP != 'true' + uses: ./.github/composite_actions/log_cw_metric + with: + job-status: ${{ inputs.job-status }} + job-identifier: ${{ inputs.job-identifier }} + github-token: ${{ inputs.github-token }} + repo: $${{ github.repository }} + run-id: ${{ github.run_id }} + metricName: github_metric_1.0 + testType: ${{ inputs.testType }} + category: ${{ inputs.category }} + workflowName: ${{ inputs.workflowName }} + framework: ${{ inputs.framework }} + flutterDartChannel: ${{ inputs.flutterDartChannel }} + dartVersion: ${{ inputs.dartVersion }} + flutterVersion: ${{ inputs.flutterVersion }} + dartCompiler: ${{ inputs.dartCompiler }} + platform: ${{ inputs.platform }} + platformVersion: ${{ inputs.platformVersion }} diff --git a/.github/workflows/AAA_test_log_call.yaml b/.github/workflows/AAA_test_log_call.yaml new file mode 100644 index 0000000000..8557e061d0 --- /dev/null +++ b/.github/workflows/AAA_test_log_call.yaml @@ -0,0 +1,51 @@ +name: Amplify Canaries +on: + push: + branches: + - "*" # TEMP ENSURE PR TRIGGER +jobs: + testLogMetric: + runs-on: macos-latest + steps: + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 3.6.0 + with: + persist-credentials: false + submodules: true + + - name: Test Wrapper Call + if: always() + uses: ./.github/composite_actions/log_metric_wrapper + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: ${{ secrets.AWS_REGION }} + + job-status: ${{ job.status }} + job-identifier: build (${{ matrix.channel }}, ${{ matrix.flutter-version}}) + github-token: ${{ secrets.GITHUB_TOKEN }} + + testType: canary + category: all + workflowName: amplify_canaries/build + framework: flutter + flutterDartChannel: beta + flutterVersion: stable + + - name: Test Direct Call of Failing Run + if: always() + uses: ./.github/composite_actions/log_cw_metric + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: ${{ secrets.AWS_REGION }} + + job-status: failure + job-identifier: build (stable, 3.10.1) + github-token: ${{ secrets.GITHUB_TOKEN }} + repo: "fjnoyp/amplify-flutter" + run-id: 6058512442 + + testType: canary + category: all + workflowName: amplify_canaries/build + framework: flutter + flutterDartChannel: beta + flutterVersion: stable diff --git a/.github/workflows/amplify_canaries.yaml b/.github/workflows/amplify_canaries.yaml index 6fadbaf584..1a0887afe8 100644 --- a/.github/workflows/amplify_canaries.yaml +++ b/.github/workflows/amplify_canaries.yaml @@ -55,24 +55,23 @@ jobs: - name: Build Canary (Android) run: build-support/build_canary.sh apk - - name: Log failing builds - if: ${{ failure() }} + - name: Log success/failure + if: always() uses: ./.github/composite_actions/log_metric with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} - metric-name: BuildCanaryTestFailure - value: 1 - dimensions: channel=${{ matrix.channel }} - - name: Log succeeding builds - if: ${{ success() }} - uses: ./.github/composite_actions/log_metric - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - aws-region: ${{ secrets.AWS_REGION }} - metric-name: BuildCanaryTestFailure - value: 0 - dimensions: channel=${{ matrix.channel }} + + job-status: ${{ job.status }} + job-identifier: build (${{ matrix.channel }}, ${{ matrix.flutter-version}}) + github-token: ${{ secrets.GITHUB_TOKEN }} + + testType: canary + category: all + workflowName: amplify_canaries/build + framework: flutter + flutterDartChannel: ${{ matrix.channel }} + flutterVersion: ${{ matrix.flutter-version }} e2e-android: runs-on: @@ -130,24 +129,25 @@ jobs: # Perform a build to reduce startup time of `flutter test` and prevent timeout script: cd canaries && flutter build apk --debug && flutter test -d emulator-5554 integration_test/main_test.dart - - name: Log failing android runs - if: ${{ failure() }} + - name: Log success/failure + if: always() uses: ./.github/composite_actions/log_metric with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} - metric-name: E2ECanaryTestFailure - value: 1 - dimensions: channel=${{ matrix.channel }},platform=android - - name: Log succeeding android runs - if: ${{ success() }} - uses: ./.github/composite_actions/log_metric - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - aws-region: ${{ secrets.AWS_REGION }} - metric-name: E2ECanaryTestFailure - value: 0 - dimensions: channel=${{ matrix.channel }},platform=android + + job-status: ${{ job.status }} + job-identifier: e2e-android (${{ matrix.channel }}, ${{ matrix.flutter-version}}) + github-token: ${{ secrets.GITHUB_TOKEN }} + + testType: canary + category: all + workflowName: amplify_canaries/e2e-android + framework: flutter + flutterDartChannel: ${{ matrix.channel }} + flutterVersion: ${{ matrix.flutter-version }} + platform: android + platformVersion: ${{ matrix.ios-version }} e2e-ios: runs-on: macos-latest-xl @@ -208,21 +208,22 @@ jobs: flutter build ios --simulator --target=integration_test/main_test.dart flutter test -d test integration_test/main_test.dart --verbose - - name: Log failing ios runs - if: ${{ failure() }} - uses: ./.github/composite_actions/log_metric - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - aws-region: ${{ secrets.AWS_REGION }} - metric-name: E2ECanaryTestFailure - value: 1 - dimensions: channel=${{ matrix.channel }},platform=ios - - name: Log succeeding ios runs - if: ${{ success() }} + - name: Log success/failure + if: always() uses: ./.github/composite_actions/log_metric with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} - metric-name: E2ECanaryTestFailure - value: 0 - dimensions: channel=${{ matrix.channel }},platform=ios + + job-status: ${{ job.status }} + job-identifier: e2e-ios (${{ matrix.channel }}, ${{ matrix.flutter-version}}) + github-token: ${{ secrets.GITHUB_TOKEN }} + + testType: canary + category: all + workflowName: amplify_canaries/e2e-ios + framework: flutter + flutterDartChannel: ${{ matrix.channel }} + flutterVersion: ${{ matrix.flutter-version }} + platform: ios + platformVersion: ${{ matrix.ios-version }} diff --git a/actions/bin/log_cw_metric.dart b/actions/bin/log_cw_metric.dart new file mode 100644 index 0000000000..0fd19295fe --- /dev/null +++ b/actions/bin/log_cw_metric.dart @@ -0,0 +1,165 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import 'dart:convert'; +import 'dart:io'; + +import 'package:actions/actions.dart'; +import 'package:http/http.dart' as http; + +Future main(List args) => wrapMain(launch); + +Future launch() async { + // Inputs for Failing Step + final jobStatus = core.getRequiredInput('job-status'); + final jobIdentifier = core.getRequiredInput('job-identifier'); + final githubToken = core.getRequiredInput('github-token'); + final repo = core.getRequiredInput('repo'); + final runId = core.getRequiredInput('run-id'); + + final isFailed = jobStatus == 'failure'; + String? failingStep = isFailed + ? await getFailingStep(jobIdentifier, githubToken, repo, runId) + : ''; + + // Inputs for Metric + final metricName = core.getRequiredInput('metric-name'); + final testType = core.getRequiredInput('test-type'); + var category = core.getRequiredInput('category'); + final workflowName = core.getRequiredInput('workflow-name'); + final framework = core.getInput('framework'); + final flutterDartChannel = core.getInput('flutter-dart-channel'); + final dartVersion = core.getInput('dart-version'); + final flutterVersion = core.getInput('flutter-version'); + final dartCompiler = core.getInput('dart-compiler'); + final platform = core.getInput('platform'); + final platformVersion = core.getInput('platform-version'); + + print('''{ + metricName: $metricName, + isFailed: $isFailed, + testType: $testType, + category: $category, + workflowName: $workflowName, + framework: $framework, + flutterDartChannel: $flutterDartChannel, + dartVersion: $dartVersion, + flutterVersion: $flutterVersion, + dartCompiler: $dartCompiler, + platform: $platform, + platformVersion: $platformVersion, + failingStep: $failingStep, + }'''); + + final value = isFailed ? '1' : '0'; + + if (category.contains('/')) { + // For working directory "packages/analytics/amplify_analytics_pinpoint" + category = category.split('/')[1]; + } else if (category.contains('_')) { + // For integration test scope "amplify_analytics_pinpoint_example" + category = category.split('_')[1]; + } + + final dimensions = { + 'testType': testType, + 'category': category, + 'workflowName': workflowName, + if (framework.isNotEmpty) 'framework': framework, + if (flutterDartChannel.isNotEmpty) 'flutterDartChannel': flutterDartChannel, + if (dartVersion.isNotEmpty) 'dartVersion': dartVersion, + if (flutterVersion.isNotEmpty) 'flutterVersion': flutterVersion, + if (dartCompiler.isNotEmpty) 'dartCompiler': dartCompiler, + if (platform.isNotEmpty) 'platform': platform, + if (platformVersion.isNotEmpty) 'platformVersion': platformVersion, + if (failingStep.isNotEmpty) 'failingStep': failingStep, + }; + + final dimensionString = + dimensions.entries.map((e) => '${e.key}=${e.value}').join(','); + + final cloudArgs = [ + 'cloudwatch', + 'put-metric-data', + '--metric-name', + metricName, + '--namespace', + 'GithubCanaryApps', + '--value', + value, + '--dimension', + dimensionString, + ]; + + Process.runSync('aws', cloudArgs); +} + +Future getFailingStep( + String jobIdentifier, + String githubToken, + String repo, + String runId, +) async { + final headers = { + 'Authorization': 'token $githubToken', + 'Accept': 'application/vnd.github.v3+json' + }; + + final response = await http.get( + Uri.parse('https://api.github.com/repos/$repo/actions/runs/$runId/jobs'), + headers: headers, + ); + + if (response.statusCode != 200) { + print('Error fetching data from GitHub API.'); + return ''; + } + + final jobsListJson = json.decode(response.body) as Map; + final jobsList = GithubJobsList.fromJson(jobsListJson); + + try { + final job = jobsList.jobs.firstWhere( + (element) => element.name == jobIdentifier, + ); + + final failingStep = job.steps.firstWhere( + (element) => element.conclusion == 'failure', + ); + + return failingStep.name; + } on Exception catch (e) { + // Return empty string if no job found or + print('Exception in retrieving failing step: $e'); + return ''; + } +} + +class GithubJobsList { + GithubJobsList.fromJson(Map json) + : jobs = (json['jobs'] as List>) + .map(GithubJob.fromJson) + .toList(); + + final List jobs; +} + +class GithubJob { + GithubJob.fromJson(Map json) + : name = json['name'] as String, + steps = (json['steps'] as List>) + .map(GithubStep.fromJson) + .toList(); + + final String name; + final List steps; +} + +class GithubStep { + GithubStep.fromJson(Map json) + : name = json['name'] as String, + conclusion = json['conclusion'] as String; + + final String name; + final String conclusion; +} diff --git a/actions/bin/log_cw_metric.yaml b/actions/bin/log_cw_metric.yaml new file mode 100644 index 0000000000..a7fa41ea7c --- /dev/null +++ b/actions/bin/log_cw_metric.yaml @@ -0,0 +1,61 @@ +name: Log CW Metric +description: Test to log a CW metric +inputs: + # For getting failing step + job-status: + description: Used to determine if we track success or failure. + required: true + job-identifier: + description: For differentiating jobs of a run. + required: true + github-token: + required: true + description: Github token for requesting failing steps. + repo: + required: true + description: Github repo + run-id: + required: true + description: Github Action Run Id + + # Global Metric Dimensions + metricName: + description: Name of the metric to track in Cloudwatch. + required: true + testType: + description: canary, integration, unit testType. + required: true + category: + description: analytics, api, authenticator, etc. + required: true + workflowName: + description: The Github Action workflow.yaml file name. ie "AmplifyCanaries". + required: true + + # FlutterDart Workflows Metric Dimensions + framework: + description: flutter, dart. + required: false + flutterDartChannel: + description: beta, stable. + required: false + dartVersion: + description: 3, 2.19, 2.18, etc. + required: false + flutterVersion: + description: 3.10.6, 3.10.5, etc. + required: false + dartCompiler: + description: dart2js, ddc, dart, dart2wasm. + required: false + + # Platform Workflows Metric Dimensions + platform: + description: android, ios, web, linux, windows. + required: false + platformVersion: + description: ios-14.5, ios-16, android-25-x86, etc. + required: false +runs: + using: "node16" + main: "dist/index.mjs" diff --git a/actions/pubspec.yaml b/actions/pubspec.yaml index 6e8efdf08f..c20e30b549 100644 --- a/actions/pubspec.yaml +++ b/actions/pubspec.yaml @@ -9,6 +9,7 @@ environment: dependencies: aws_common: any collection: ^1.18.0 + http: ^1.1.0 js: ^0.6.7 json_annotation: ">=4.8.1 <4.9.0" path: ^1.8.3