From ed3ab602f89fca1fc9a9853047c8563cdf5461db Mon Sep 17 00:00:00 2001 From: Roberto Tyley Date: Thu, 22 Feb 2024 15:41:59 +0000 Subject: [PATCH] Is version.sbt still being included... --- dist/cleanup/index.js | 47836 ++++++++++++++++++++-------------------- dist/setup/index.js | 47836 ++++++++++++++++++++-------------------- src/cache.ts | 6 +- 3 files changed, 48390 insertions(+), 47288 deletions(-) diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index 971673a56..c32fb158c 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -319,7 +319,8 @@ function createHttpClient() { return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions()); } function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths; + // don't pass changes upstream + const components = paths.slice(); // Add compression method to cache version to restore // compressed cache as per compression method if (compressionMethod) { @@ -608,26 +609,21 @@ function resolvePaths(patterns) { implicitDescendants: false }); try { - for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a;) { + for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { _c = _g.value; _e = false; - try { - const file = _c; - const relativeFile = path - .relative(workspace, file) - .replace(new RegExp(`\\${path.sep}`, 'g'), '/'); - core.debug(`Matched: ${relativeFile}`); - // Paths are made relative so the tar entries are all relative to the root of the workspace. - if (relativeFile === '') { - // path.relative returns empty string if workspace and file are equal - paths.push('.'); - } - else { - paths.push(`${relativeFile}`); - } + const file = _c; + const relativeFile = path + .relative(workspace, file) + .replace(new RegExp(`\\${path.sep}`, 'g'), '/'); + core.debug(`Matched: ${relativeFile}`); + // Paths are made relative so the tar entries are all relative to the root of the workspace. + if (relativeFile === '') { + // path.relative returns empty string if workspace and file are equal + paths.push('.'); } - finally { - _e = true; + else { + paths.push(`${relativeFile}`); } } } @@ -711,7 +707,10 @@ function assertDefined(name, value) { exports.assertDefined = assertDefined; function isGhes() { const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com'); - return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM'; + const hostname = ghUrl.hostname.trimEnd().toUpperCase(); + const isGitHubHost = hostname === 'GITHUB.COM'; + const isGheHost = hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST'); + return !isGitHubHost && !isGheHost; } exports.isGhes = isGhes; //# sourceMappingURL=cacheUtils.js.map @@ -729,7 +728,7 @@ var CacheFilename; (function (CacheFilename) { CacheFilename["Gzip"] = "cache.tgz"; CacheFilename["Zstd"] = "cache.tzst"; -})(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {})); +})(CacheFilename || (exports.CacheFilename = CacheFilename = {})); var CompressionMethod; (function (CompressionMethod) { CompressionMethod["Gzip"] = "gzip"; @@ -737,12 +736,12 @@ var CompressionMethod; // This enum is for earlier version of zstd that does not have --long support CompressionMethod["ZstdWithoutLong"] = "zstd-without-long"; CompressionMethod["Zstd"] = "zstd"; -})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {})); +})(CompressionMethod || (exports.CompressionMethod = CompressionMethod = {})); var ArchiveToolType; (function (ArchiveToolType) { ArchiveToolType["GNU"] = "gnu"; ArchiveToolType["BSD"] = "bsd"; -})(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {})); +})(ArchiveToolType || (exports.ArchiveToolType = ArchiveToolType = {})); // The default number of retry attempts. exports.DefaultRetryAttempts = 2; // The default delay in milliseconds between retry attempts. @@ -12134,6 +12133,18 @@ class AzureKeyCredential { } // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Tests an object to determine whether it implements KeyCredential. + * + * @param credential - The assumed KeyCredential to be tested. + */ +function isKeyCredential(credential) { + return coreUtil.isObjectWithProperties(credential, ["key"]) && typeof credential.key === "string"; +} + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** * A static name/key-based credential that supports updating * the underlying name and key values. @@ -12194,6 +12205,7 @@ function isNamedKeyCredential(credential) { } // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** * A static-signature-based credential that supports updating * the underlying signature value. @@ -12263,6 +12275,7 @@ function isTokenCredential(credential) { exports.AzureKeyCredential = AzureKeyCredential; exports.AzureNamedKeyCredential = AzureNamedKeyCredential; exports.AzureSASCredential = AzureSASCredential; +exports.isKeyCredential = isKeyCredential; exports.isNamedKeyCredential = isNamedKeyCredential; exports.isSASCredential = isSASCredential; exports.isTokenCredential = isTokenCredential; @@ -18924,10 +18937,10 @@ exports["default"] = _default; Object.defineProperty(exports, "__esModule", ({ value: true })); var logger$1 = __nccwpck_require__(3233); -var abortController = __nccwpck_require__(2557); var coreUtil = __nccwpck_require__(1333); // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** * The `@azure/logger` configuration for this package. * @internal @@ -18946,6 +18959,7 @@ const POLL_INTERVAL_IN_MS = 2000; const terminalStates = ["succeeded", "canceled", "failed"]; // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** * Deserializes the state */ @@ -19109,6 +19123,7 @@ async function pollOperation(inputs) { } // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. function getOperationLocationPollingUrl(inputs) { const { azureAsyncOperation, operationLocation } = inputs; return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; @@ -19250,7 +19265,7 @@ function parseRetryAfter({ rawResponse }) { return undefined; } function getErrorFromResponse(response) { - const error = response.flatResponse.error; + const error = accessBodyProperty(response, "error"); if (!error) { logger.warning(`The long-running operation failed but there is no error property in the response's body`); return; @@ -19346,12 +19361,14 @@ function getOperationStatus({ rawResponse }, state) { throw new Error(`Internal error: Unexpected operation mode: ${mode}`); } } -function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== undefined) { - state.config.resourceLocation = resourceLocation; - } +function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_b = rawResponse.body) === null || _b === void 0 ? void 0 : _b[prop]; +} +function getResourceLocation(res, state) { + const loc = accessBodyProperty(res, "resourceLocation"); + if (loc && typeof loc === "string") { + state.config.resourceLocation = loc; } return state.config.resourceLocation; } @@ -19386,6 +19403,7 @@ async function pollHttpOperation(inputs) { } // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. const createStateProxy$1 = () => ({ /** * The state at this point is created to be of type OperationState. @@ -19437,7 +19455,7 @@ function buildCreatePoller(inputs) { setErrorAsResult: !resolveOnUnsuccessful, }); let resultPromise; - const abortController$1 = new abortController.AbortController(); + const abortController = new AbortController(); const handlers = new Map(); const handleProgressEvents = async () => handlers.forEach((h) => h(state)); const cancelErrMsg = "Operation was canceled"; @@ -19448,7 +19466,7 @@ function buildCreatePoller(inputs) { isDone: () => ["succeeded", "failed", "canceled"].includes(state.status), isStopped: () => resultPromise === undefined, stopPolling: () => { - abortController$1.abort(); + abortController.abort(); }, toString: () => JSON.stringify({ state, @@ -19460,16 +19478,29 @@ function buildCreatePoller(inputs) { }, pollUntilDone: (pollOptions) => (resultPromise !== null && resultPromise !== void 0 ? resultPromise : (resultPromise = (async () => { const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal - ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) - : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); + // In the future we can use AbortSignal.any() instead + function abortListener() { + abortController.abort(); + } + const abortSignal = abortController.signal; + if (inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.aborted) { + abortController.abort(); + } + else if (!abortSignal.aborted) { + inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.addEventListener("abort", abortListener, { once: true }); + } + try { + if (!poller.isDone()) { await poller.poll({ abortSignal }); + while (!poller.isDone()) { + await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); + await poller.poll({ abortSignal }); + } } } + finally { + inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.removeEventListener("abort", abortListener); + } if (resolveOnUnsuccessful) { return poller.getResult(); } @@ -19539,6 +19570,7 @@ function buildCreatePoller(inputs) { } // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** * Creates a poller that can be used to poll a long-running operation. * @param lro - Description of the long-running operation @@ -19580,6 +19612,7 @@ async function createHttpPoller(lro, options) { } // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. const createStateProxy = () => ({ initState: (config) => ({ config, isStarted: true }), setCanceled: (state) => (state.isCancelled = true), @@ -20058,6 +20091,7 @@ class Poller { } // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** * The LRO Engine, a class that performs polling. */ @@ -20436,7 +20470,9 @@ exports.setSpanContext = setSpanContext; "use strict"; -var abortController = __nccwpck_require__(2557); +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var abortController = __nccwpck_require__(4200); var crypto = __nccwpck_require__(6113); // Copyright (c) Microsoft Corporation. @@ -20508,7 +20544,7 @@ function delay(timeInMs, options) { */ async function cancelablePromiseRace(abortablePromiseBuilders, options) { var _a, _b; - const aborter = new abortController.AbortController(); + const aborter = new AbortController(); function abortHandler() { aborter.abort(); } @@ -20793,6 +20829,47 @@ exports.uint8ArrayToString = uint8ArrayToString; //# sourceMappingURL=index.js.map +/***/ }), + +/***/ 4200: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * This error is thrown when an asynchronous operation has been aborted. + * Check for this error by testing the `name` that the name property of the + * error matches `"AbortError"`. + * + * @example + * ```ts + * const controller = new AbortController(); + * controller.abort(); + * try { + * doAsyncWork(controller.signal) + * } catch (e) { + * if (e.name === 'AbortError') { + * // handle abort error here. + * } + * } + * ``` + */ +class AbortError extends Error { + constructor(message) { + super(message); + this.name = "AbortError"; + } +} + +exports.AbortError = AbortError; +//# sourceMappingURL=index.js.map + + /***/ }), /***/ 3233: @@ -51104,7 +51181,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau var Stream = _interopDefault(__nccwpck_require__(2781)); var http = _interopDefault(__nccwpck_require__(3685)); var Url = _interopDefault(__nccwpck_require__(7310)); -var whatwgUrl = _interopDefault(__nccwpck_require__(629)); +var whatwgUrl = _interopDefault(__nccwpck_require__(8665)); var https = _interopDefault(__nccwpck_require__(5687)); var zlib = _interopDefault(__nccwpck_require__(9796)); @@ -52886,29422 +52963,29892 @@ exports.AbortError = AbortError; /***/ }), -/***/ 2299: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 2043: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +;(function (sax) { // wrapper for non-node envs + sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } + sax.SAXParser = SAXParser + sax.SAXStream = SAXStream + sax.createStream = createStream + // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. + // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), + // since that's the earliest that a buffer overrun could occur. This way, checks are + // as rare as required, but as often as necessary to ensure never crossing this bound. + // Furthermore, buffers are only tested at most once per write(), so passing a very + // large string into write() might have undesirable effects, but this is manageable by + // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme + // edge case, result in creating at most one complete copy of the string passed in. + // Set to Infinity to have unlimited buffers. + sax.MAX_BUFFER_LENGTH = 64 * 1024 -var punycode = __nccwpck_require__(5477); -var mappingTable = __nccwpck_require__(1907); + var buffers = [ + 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', + 'procInstName', 'procInstBody', 'entity', 'attribName', + 'attribValue', 'cdata', 'script' + ] -var PROCESSING_OPTIONS = { - TRANSITIONAL: 0, - NONTRANSITIONAL: 1 -}; + sax.EVENTS = [ + 'text', + 'processinginstruction', + 'sgmldeclaration', + 'doctype', + 'comment', + 'opentagstart', + 'attribute', + 'opentag', + 'closetag', + 'opencdata', + 'cdata', + 'closecdata', + 'error', + 'end', + 'ready', + 'script', + 'opennamespace', + 'closenamespace' + ] -function normalize(str) { // fix bug in v8 - return str.split('\u0000').map(function (s) { return s.normalize('NFC'); }).join('\u0000'); -} + function SAXParser (strict, opt) { + if (!(this instanceof SAXParser)) { + return new SAXParser(strict, opt) + } -function findStatus(val) { - var start = 0; - var end = mappingTable.length - 1; + var parser = this + clearBuffers(parser) + parser.q = parser.c = '' + parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH + parser.opt = opt || {} + parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags + parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' + parser.tags = [] + parser.closed = parser.closedRoot = parser.sawRoot = false + parser.tag = parser.error = null + parser.strict = !!strict + parser.noscript = !!(strict || parser.opt.noscript) + parser.state = S.BEGIN + parser.strictEntities = parser.opt.strictEntities + parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) + parser.attribList = [] - while (start <= end) { - var mid = Math.floor((start + end) / 2); + // namespaces form a prototype chain. + // it always points at the current tag, + // which protos to its parent tag. + if (parser.opt.xmlns) { + parser.ns = Object.create(rootNS) + } - var target = mappingTable[mid]; - if (target[0][0] <= val && target[0][1] >= val) { - return target; - } else if (target[0][0] > val) { - end = mid - 1; - } else { - start = mid + 1; + // mostly just for error reporting + parser.trackPosition = parser.opt.position !== false + if (parser.trackPosition) { + parser.position = parser.line = parser.column = 0 } + emit(parser, 'onready') } - return null; -} + if (!Object.create) { + Object.create = function (o) { + function F () {} + F.prototype = o + var newf = new F() + return newf + } + } -var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + if (!Object.keys) { + Object.keys = function (o) { + var a = [] + for (var i in o) if (o.hasOwnProperty(i)) a.push(i) + return a + } + } -function countSymbols(string) { - return string - // replace every surrogate pair with a BMP symbol - .replace(regexAstralSymbols, '_') - // then get the length - .length; -} + function checkBufferLength (parser) { + var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) + var maxActual = 0 + for (var i = 0, l = buffers.length; i < l; i++) { + var len = parser[buffers[i]].length + if (len > maxAllowed) { + // Text/cdata nodes can get big, and since they're buffered, + // we can get here under normal conditions. + // Avoid issues by emitting the text node now, + // so at least it won't get any bigger. + switch (buffers[i]) { + case 'textNode': + closeText(parser) + break -function mapChars(domain_name, useSTD3, processing_option) { - var hasError = false; - var processed = ""; + case 'cdata': + emitNode(parser, 'oncdata', parser.cdata) + parser.cdata = '' + break - var len = countSymbols(domain_name); - for (var i = 0; i < len; ++i) { - var codePoint = domain_name.codePointAt(i); - var status = findStatus(codePoint); + case 'script': + emitNode(parser, 'onscript', parser.script) + parser.script = '' + break - switch (status[1]) { - case "disallowed": - hasError = true; - processed += String.fromCodePoint(codePoint); - break; - case "ignored": - break; - case "mapped": - processed += String.fromCodePoint.apply(String, status[2]); - break; - case "deviation": - if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) { - processed += String.fromCodePoint.apply(String, status[2]); - } else { - processed += String.fromCodePoint(codePoint); - } - break; - case "valid": - processed += String.fromCodePoint(codePoint); - break; - case "disallowed_STD3_mapped": - if (useSTD3) { - hasError = true; - processed += String.fromCodePoint(codePoint); - } else { - processed += String.fromCodePoint.apply(String, status[2]); - } - break; - case "disallowed_STD3_valid": - if (useSTD3) { - hasError = true; + default: + error(parser, 'Max buffer length exceeded: ' + buffers[i]) } + } + maxActual = Math.max(maxActual, len) + } + // schedule the next check for the earliest possible buffer overrun. + var m = sax.MAX_BUFFER_LENGTH - maxActual + parser.bufferCheckPosition = m + parser.position + } - processed += String.fromCodePoint(codePoint); - break; + function clearBuffers (parser) { + for (var i = 0, l = buffers.length; i < l; i++) { + parser[buffers[i]] = '' } } - return { - string: processed, - error: hasError - }; -} + function flushBuffers (parser) { + closeText(parser) + if (parser.cdata !== '') { + emitNode(parser, 'oncdata', parser.cdata) + parser.cdata = '' + } + if (parser.script !== '') { + emitNode(parser, 'onscript', parser.script) + parser.script = '' + } + } -var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/; + SAXParser.prototype = { + end: function () { end(this) }, + write: write, + resume: function () { this.error = null; return this }, + close: function () { return this.write(null) }, + flush: function () { flushBuffers(this) } + } -function validateLabel(label, processing_option) { - if (label.substr(0, 4) === "xn--") { - label = punycode.toUnicode(label); - processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; + var Stream + try { + Stream = (__nccwpck_require__(2781).Stream) + } catch (ex) { + Stream = function () {} } + if (!Stream) Stream = function () {} - var error = false; + var streamWraps = sax.EVENTS.filter(function (ev) { + return ev !== 'error' && ev !== 'end' + }) - if (normalize(label) !== label || - (label[3] === "-" && label[4] === "-") || - label[0] === "-" || label[label.length - 1] === "-" || - label.indexOf(".") !== -1 || - label.search(combiningMarksRegex) === 0) { - error = true; + function createStream (strict, opt) { + return new SAXStream(strict, opt) } - var len = countSymbols(label); - for (var i = 0; i < len; ++i) { - var status = findStatus(label.codePointAt(i)); - if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid") || - (processing === PROCESSING_OPTIONS.NONTRANSITIONAL && - status[1] !== "valid" && status[1] !== "deviation")) { - error = true; - break; + function SAXStream (strict, opt) { + if (!(this instanceof SAXStream)) { + return new SAXStream(strict, opt) } - } - return { - label: label, - error: error - }; -} + Stream.apply(this) -function processing(domain_name, useSTD3, processing_option) { - var result = mapChars(domain_name, useSTD3, processing_option); - result.string = normalize(result.string); + this._parser = new SAXParser(strict, opt) + this.writable = true + this.readable = true - var labels = result.string.split("."); - for (var i = 0; i < labels.length; ++i) { - try { - var validation = validateLabel(labels[i]); - labels[i] = validation.label; - result.error = result.error || validation.error; - } catch(e) { - result.error = true; + var me = this + + this._parser.onend = function () { + me.emit('end') } - } - return { - string: labels.join("."), - error: result.error - }; -} + this._parser.onerror = function (er) { + me.emit('error', er) -module.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) { - var result = processing(domain_name, useSTD3, processing_option); - var labels = result.string.split("."); - labels = labels.map(function(l) { - try { - return punycode.toASCII(l); - } catch(e) { - result.error = true; - return l; + // if didn't throw, then means error was handled. + // go ahead and clear error, so we can write again. + me._parser.error = null } - }); - if (verifyDnsLength) { - var total = labels.slice(0, labels.length - 1).join(".").length; - if (total.length > 253 || total.length === 0) { - result.error = true; - } + this._decoder = null - for (var i=0; i < labels.length; ++i) { - if (labels.length > 63 || labels.length === 0) { - result.error = true; - break; - } - } + streamWraps.forEach(function (ev) { + Object.defineProperty(me, 'on' + ev, { + get: function () { + return me._parser['on' + ev] + }, + set: function (h) { + if (!h) { + me.removeAllListeners(ev) + me._parser['on' + ev] = h + return h + } + me.on(ev, h) + }, + enumerable: true, + configurable: false + }) + }) } - if (result.error) return null; - return labels.join("."); -}; + SAXStream.prototype = Object.create(Stream.prototype, { + constructor: { + value: SAXStream + } + }) -module.exports.toUnicode = function(domain_name, useSTD3) { - var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL); + SAXStream.prototype.write = function (data) { + if (typeof Buffer === 'function' && + typeof Buffer.isBuffer === 'function' && + Buffer.isBuffer(data)) { + if (!this._decoder) { + var SD = (__nccwpck_require__(1576).StringDecoder) + this._decoder = new SD('utf8') + } + data = this._decoder.write(data) + } - return { - domain: result.string, - error: result.error - }; -}; + this._parser.write(data.toString()) + this.emit('data', data) + return true + } -module.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; + SAXStream.prototype.end = function (chunk) { + if (chunk && chunk.length) { + this.write(chunk) + } + this._parser.end() + return true + } + SAXStream.prototype.on = function (ev, handler) { + var me = this + if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { + me._parser['on' + ev] = function () { + var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments) + args.splice(0, 0, ev) + me.emit.apply(me, args) + } + } -/***/ }), + return Stream.prototype.on.call(me, ev, handler) + } -/***/ 5871: -/***/ ((module) => { + // this really needs to be replaced with character classes. + // XML allows all manner of ridiculous numbers and digits. + var CDATA = '[CDATA[' + var DOCTYPE = 'DOCTYPE' + var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' + var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' + var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } -"use strict"; + // http://www.w3.org/TR/REC-xml/#NT-NameStartChar + // This implementation works on strings, a single character at a time + // as such, it cannot ever support astral-plane characters (10000-EFFFF) + // without a significant breaking change to either this parser, or the + // JavaScript language. Implementation of an emoji-capable xml parser + // is left as an exercise for the reader. + var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ + var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ -var conversions = {}; -module.exports = conversions; + var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ + var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ -function sign(x) { - return x < 0 ? -1 : 1; -} + function isWhitespace (c) { + return c === ' ' || c === '\n' || c === '\r' || c === '\t' + } -function evenRound(x) { - // Round x to the nearest integer, choosing the even integer if it lies halfway between two. - if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor) - return Math.floor(x); - } else { - return Math.round(x); - } -} + function isQuote (c) { + return c === '"' || c === '\'' + } -function createNumberConversion(bitLength, typeOpts) { - if (!typeOpts.unsigned) { - --bitLength; - } - const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength); - const upperBound = Math.pow(2, bitLength) - 1; + function isAttribEnd (c) { + return c === '>' || isWhitespace(c) + } - const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength); - const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1); + function isMatch (regex, c) { + return regex.test(c) + } - return function(V, opts) { - if (!opts) opts = {}; + function notMatch (regex, c) { + return !isMatch(regex, c) + } - let x = +V; - - if (opts.enforceRange) { - if (!Number.isFinite(x)) { - throw new TypeError("Argument is not a finite number"); - } - - x = sign(x) * Math.floor(Math.abs(x)); - if (x < lowerBound || x > upperBound) { - throw new TypeError("Argument is not in byte range"); - } - - return x; - } + var S = 0 + sax.STATE = { + BEGIN: S++, // leading byte order mark or whitespace + BEGIN_WHITESPACE: S++, // leading whitespace + TEXT: S++, // general stuff + TEXT_ENTITY: S++, // & and such. + OPEN_WAKA: S++, // < + SGML_DECL: S++, // + SCRIPT: S++, //