@griddo/cx 10.7.7 → 10.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../node_modules/dotenv/lib/main.js", "../../../node_modules/universalify/index.js", "../../../node_modules/graceful-fs/polyfills.js", "../../../node_modules/graceful-fs/legacy-streams.js", "../../../node_modules/graceful-fs/clone.js", "../../../node_modules/graceful-fs/graceful-fs.js", "../../../node_modules/fs-extra/lib/fs/index.js", "../../../node_modules/at-least-node/index.js", "../../../node_modules/fs-extra/lib/mkdirs/make-dir.js", "../../../node_modules/fs-extra/lib/mkdirs/index.js", "../../../node_modules/fs-extra/lib/util/utimes.js", "../../../node_modules/fs-extra/lib/util/stat.js", "../../../node_modules/fs-extra/lib/copy-sync/copy-sync.js", "../../../node_modules/fs-extra/lib/copy-sync/index.js", "../../../node_modules/fs-extra/lib/path-exists/index.js", "../../../node_modules/fs-extra/lib/copy/copy.js", "../../../node_modules/fs-extra/lib/copy/index.js", "../../../node_modules/fs-extra/lib/remove/rimraf.js", "../../../node_modules/fs-extra/lib/remove/index.js", "../../../node_modules/fs-extra/lib/empty/index.js", "../../../node_modules/fs-extra/lib/ensure/file.js", "../../../node_modules/fs-extra/lib/ensure/link.js", "../../../node_modules/fs-extra/lib/ensure/symlink-paths.js", "../../../node_modules/fs-extra/lib/ensure/symlink-type.js", "../../../node_modules/fs-extra/lib/ensure/symlink.js", "../../../node_modules/fs-extra/lib/ensure/index.js", "../../../node_modules/jsonfile/utils.js", "../../../node_modules/jsonfile/index.js", "../../../node_modules/fs-extra/lib/json/jsonfile.js", "../../../node_modules/fs-extra/lib/output/index.js", "../../../node_modules/fs-extra/lib/json/output-json.js", "../../../node_modules/fs-extra/lib/json/output-json-sync.js", "../../../node_modules/fs-extra/lib/json/index.js", "../../../node_modules/fs-extra/lib/move-sync/move-sync.js", "../../../node_modules/fs-extra/lib/move-sync/index.js", "../../../node_modules/fs-extra/lib/move/move.js", "../../../node_modules/fs-extra/lib/move/index.js", "../../../node_modules/fs-extra/lib/index.js", "../node_modules/escape-string-regexp/index.js", "../node_modules/color-name/index.js", "../node_modules/color-convert/conversions.js", "../node_modules/color-convert/route.js", "../node_modules/color-convert/index.js", "../node_modules/ansi-styles/index.js", "../node_modules/has-flag/index.js", "../node_modules/supports-color/index.js", "../node_modules/chalk/templates.js", "../node_modules/chalk/index.js", "../../../node_modules/yocto-queue/index.js", "../../../node_modules/p-limit/index.js", "../../../node_modules/p-locate/index.js", "../../../node_modules/locate-path/index.js", "../../../node_modules/path-exists/index.js", "../../../node_modules/find-up/index.js", "../node_modules/pkg-dir/index.js", "../../../node_modules/kleur/index.js", "../../../node_modules/react/cjs/react.production.min.js", "../../../node_modules/react/cjs/react.development.js", "../../../node_modules/react/index.js", "../../../node_modules/xmlcreate/lib/validate.js", "../../../node_modules/xmlcreate/lib/options.js", "../../../node_modules/xmlcreate/lib/escape.js", "../../../node_modules/xmlcreate/lib/nodes/XmlAttributeText.js", "../../../node_modules/xmlcreate/lib/nodes/XmlCharRef.js", "../../../node_modules/xmlcreate/lib/nodes/XmlEntityRef.js", "../../../node_modules/xmlcreate/lib/nodes/XmlAttribute.js", "../../../node_modules/xmlcreate/lib/nodes/XmlDtdAttlist.js", "../../../node_modules/xmlcreate/lib/nodes/XmlDtdElement.js", "../../../node_modules/xmlcreate/lib/nodes/XmlDtdEntity.js", "../../../node_modules/xmlcreate/lib/nodes/XmlDtdNotation.js", "../../../node_modules/xmlcreate/lib/nodes/XmlDtdParamEntityRef.js", "../../../node_modules/xmlcreate/lib/nodes/XmlProcInst.js", "../../../node_modules/xmlcreate/lib/nodes/XmlDtd.js", "../../../node_modules/xmlcreate/lib/nodes/XmlCdata.js", "../../../node_modules/xmlcreate/lib/nodes/XmlCharData.js", "../../../node_modules/xmlcreate/lib/nodes/XmlElement.js", "../../../node_modules/xmlcreate/lib/error.js", "../../../node_modules/xmlcreate/lib/nodes/XmlComment.js", "../../../node_modules/xmlcreate/lib/nodes/XmlDecl.js", "../../../node_modules/xmlcreate/lib/nodes/XmlDocument.js", "../../../node_modules/xmlcreate/lib/main.js", "../../../node_modules/js2xmlparser/lib/utils.js", "../../../node_modules/js2xmlparser/lib/options.js", "../../../node_modules/js2xmlparser/lib/main.js", "../../../node_modules/axios/lib/helpers/bind.js", "../../../node_modules/axios/lib/utils.js", "../../../node_modules/axios/lib/helpers/buildURL.js", "../../../node_modules/axios/lib/core/InterceptorManager.js", "../../../node_modules/axios/lib/helpers/normalizeHeaderName.js", "../../../node_modules/axios/lib/core/enhanceError.js", "../../../node_modules/axios/lib/core/createError.js", "../../../node_modules/axios/lib/core/settle.js", "../../../node_modules/axios/lib/helpers/cookies.js", "../../../node_modules/axios/lib/helpers/isAbsoluteURL.js", "../../../node_modules/axios/lib/helpers/combineURLs.js", "../../../node_modules/axios/lib/core/buildFullPath.js", "../../../node_modules/axios/lib/helpers/parseHeaders.js", "../../../node_modules/axios/lib/helpers/isURLSameOrigin.js", "../../../node_modules/axios/lib/adapters/xhr.js", "../../../node_modules/debug/node_modules/ms/index.js", "../../../node_modules/debug/src/common.js", "../../../node_modules/debug/src/browser.js", "../../../node_modules/has-flag/index.js", "../../../node_modules/supports-color/index.js", "../../../node_modules/debug/src/node.js", "../../../node_modules/debug/src/index.js", "../../../node_modules/follow-redirects/debug.js", "../../../node_modules/follow-redirects/index.js", "../../../node_modules/axios/package.json", "../../../node_modules/axios/lib/adapters/http.js", "../../../node_modules/axios/lib/defaults.js", "../../../node_modules/axios/lib/core/transformData.js", "../../../node_modules/axios/lib/cancel/isCancel.js", "../../../node_modules/axios/lib/core/dispatchRequest.js", "../../../node_modules/axios/lib/core/mergeConfig.js", "../../../node_modules/axios/lib/helpers/validator.js", "../../../node_modules/axios/lib/core/Axios.js", "../../../node_modules/axios/lib/cancel/Cancel.js", "../../../node_modules/axios/lib/cancel/CancelToken.js", "../../../node_modules/axios/lib/helpers/spread.js", "../../../node_modules/axios/lib/helpers/isAxiosError.js", "../../../node_modules/axios/lib/axios.js", "../../../node_modules/axios/index.js", "../exporter/utils/instance.ts", "../cx.config.js", "../exporter/scripts/start-render.ts", "../exporter/adapters/gatsby/index.ts", "../exporter/adapters/gatsby/utils.ts", "../exporter/utils/core-utils.ts", "../exporter/utils/folders.ts", "../exporter/utils/loggin.ts", "../exporter/constants/envs.ts", "../exporter/constants/endpoints.ts", "../exporter/constants/index.ts", "../exporter/utils/sites.ts", "../exporter/utils/store.ts", "../exporter/services/auth.ts", "../exporter/utils/api.ts", "../exporter/utils/cache.ts", "../exporter/services/register.ts", "../exporter/registers/api.ts", "../exporter/registers/gatsby.ts", "../exporter/services/sites.ts", "../exporter/services/robots.ts", "../exporter/artifacts/cx.ts", "../exporter/artifacts/gatsby.ts", "../exporter/artifacts/index.ts", "../exporter/utils/alerts.ts", "../exporter/services/store.ts", "../exporter/services/distributors.ts", "../exporter/services/navigation.ts", "../exporter/services/settings.ts", "../exporter/utils/pages.ts", "../exporter/utils/images.ts", "../exporter/utils/create-build-data.ts", "../exporter/utils/render.ts", "../exporter/errors/index.ts", "../exporter/errors/errors-data.ts", "../exporter/services/domains.ts", "../exporter/utils/domains.ts"],
4
- "sourcesContent": ["/* @flow */\n/*::\n\ntype DotenvParseOptions = {\n debug?: boolean\n}\n\n// keys and values from src\ntype DotenvParseOutput = { [string]: string }\n\ntype DotenvConfigOptions = {\n path?: string, // path to .env file\n encoding?: string, // encoding of .env file\n debug?: string // turn on logging for debugging purposes\n}\n\ntype DotenvConfigOutput = {\n parsed?: DotenvParseOutput,\n error?: Error\n}\n\n*/\n\nconst fs = require('fs')\nconst path = require('path')\n\nfunction log (message /*: string */) {\n console.log(`[dotenv][DEBUG] ${message}`)\n}\n\nconst NEWLINE = '\\n'\nconst RE_INI_KEY_VAL = /^\\s*([\\w.-]+)\\s*=\\s*(.*)?\\s*$/\nconst RE_NEWLINES = /\\\\n/g\nconst NEWLINES_MATCH = /\\n|\\r|\\r\\n/\n\n// Parses src into an Object\nfunction parse (src /*: string | Buffer */, options /*: ?DotenvParseOptions */) /*: DotenvParseOutput */ {\n const debug = Boolean(options && options.debug)\n const obj = {}\n\n // convert Buffers before splitting into lines and processing\n src.toString().split(NEWLINES_MATCH).forEach(function (line, idx) {\n // matching \"KEY' and 'VAL' in 'KEY=VAL'\n const keyValueArr = line.match(RE_INI_KEY_VAL)\n // matched?\n if (keyValueArr != null) {\n const key = keyValueArr[1]\n // default undefined or missing values to empty string\n let val = (keyValueArr[2] || '')\n const end = val.length - 1\n const isDoubleQuoted = val[0] === '\"' && val[end] === '\"'\n const isSingleQuoted = val[0] === \"'\" && val[end] === \"'\"\n\n // if single or double quoted, remove quotes\n if (isSingleQuoted || isDoubleQuoted) {\n val = val.substring(1, end)\n\n // if double quoted, expand newlines\n if (isDoubleQuoted) {\n val = val.replace(RE_NEWLINES, NEWLINE)\n }\n } else {\n // remove surrounding whitespace\n val = val.trim()\n }\n\n obj[key] = val\n } else if (debug) {\n log(`did not match key and value when parsing line ${idx + 1}: ${line}`)\n }\n })\n\n return obj\n}\n\n// Populates process.env from .env file\nfunction config (options /*: ?DotenvConfigOptions */) /*: DotenvConfigOutput */ {\n let dotenvPath = path.resolve(process.cwd(), '.env')\n let encoding /*: string */ = 'utf8'\n let debug = false\n\n if (options) {\n if (options.path != null) {\n dotenvPath = options.path\n }\n if (options.encoding != null) {\n encoding = options.encoding\n }\n if (options.debug != null) {\n debug = true\n }\n }\n\n try {\n // specifying an encoding returns a string instead of a buffer\n const parsed = parse(fs.readFileSync(dotenvPath, { encoding }), { debug })\n\n Object.keys(parsed).forEach(function (key) {\n if (!Object.prototype.hasOwnProperty.call(process.env, key)) {\n process.env[key] = parsed[key]\n } else if (debug) {\n log(`\"${key}\" is already defined in \\`process.env\\` and will not be overwritten`)\n }\n })\n\n return { parsed }\n } catch (e) {\n return { error: e }\n }\n}\n\nmodule.exports.config = config\nmodule.exports.parse = parse\n", "'use strict'\n\nexports.fromCallback = function (fn) {\n return Object.defineProperty(function (...args) {\n if (typeof args[args.length - 1] === 'function') fn.apply(this, args)\n else {\n return new Promise((resolve, reject) => {\n fn.call(\n this,\n ...args,\n (err, res) => (err != null) ? reject(err) : resolve(res)\n )\n })\n }\n }, 'name', { value: fn.name })\n}\n\nexports.fromPromise = function (fn) {\n return Object.defineProperty(function (...args) {\n const cb = args[args.length - 1]\n if (typeof cb !== 'function') return fn.apply(this, args)\n else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb)\n }, 'name', { value: fn.name })\n}\n", "var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (fs.chmod && !fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (fs.chown && !fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = typeof fs.rename !== 'function' ? fs.rename\n : (function (fs$rename) {\n function rename (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)\n return rename\n })(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = typeof fs.read !== 'function' ? fs.read\n : (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync\n : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\") && fs.futimes) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else if (fs.futimes) {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n", "var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n", "'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n", "var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n resetQueue()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n resetQueue()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb, startTime) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb, startTime) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb, startTime) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return go$copyFile(src, dest, flags, cb)\n\n function go$copyFile (src, dest, flags, cb, startTime) {\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n var noReaddirOptionVersions = /^v[0-5]\\./\n function readdir (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n var go$readdir = noReaddirOptionVersions.test(process.version)\n ? function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n : function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, options, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n\n return go$readdir(path, options, cb)\n\n function fs$readdirCallback (path, options, cb, startTime) {\n return function (err, files) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([\n go$readdir,\n [path, options, cb],\n err,\n startTime || Date.now(),\n Date.now()\n ])\n else {\n if (files && files.sort)\n files.sort()\n\n if (typeof cb === 'function')\n cb.call(this, err, files)\n }\n }\n }\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb, startTime) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n retry()\n}\n\n// keep track of the timeout between retry() calls\nvar retryTimer\n\n// reset the startTime and lastTime to now\n// this resets the start of the 60 second overall timeout as well as the\n// delay between attempts so that we'll retry these jobs sooner\nfunction resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}\n\nfunction retry () {\n // clear the timer and remove it to help prevent unintended concurrency\n clearTimeout(retryTimer)\n retryTimer = undefined\n\n if (fs[gracefulQueue].length === 0)\n return\n\n var elem = fs[gracefulQueue].shift()\n var fn = elem[0]\n var args = elem[1]\n // these items may be unset if they were added by an older graceful-fs\n var err = elem[2]\n var startTime = elem[3]\n var lastTime = elem[4]\n\n // if we don't have a startTime we have no way of knowing if we've waited\n // long enough, so go ahead and retry this item now\n if (startTime === undefined) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args)\n } else if (Date.now() - startTime >= 60000) {\n // it's been more than 60 seconds total, bail now\n debug('TIMEOUT', fn.name, args)\n var cb = args.pop()\n if (typeof cb === 'function')\n cb.call(null, err)\n } else {\n // the amount of time between the last attempt and right now\n var sinceAttempt = Date.now() - lastTime\n // the amount of time between when we first tried, and when we last tried\n // rounded up to at least 1\n var sinceStart = Math.max(lastTime - startTime, 1)\n // backoff. wait longer than the total time we've been retrying, but only\n // up to a maximum of 100ms\n var desiredDelay = Math.min(sinceStart * 1.2, 100)\n // it's been long enough since the last retry, do it again\n if (sinceAttempt >= desiredDelay) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args.concat([startTime]))\n } else {\n // if we can't do this job yet, push it to the end of the queue\n // and let the next iteration check again\n fs[gracefulQueue].push(elem)\n }\n }\n\n // schedule our next run if one isn't already scheduled\n if (retryTimer === undefined) {\n retryTimer = setTimeout(retry, 0)\n }\n}\n", "'use strict'\n// This is adapted from https://github.com/normalize/mz\n// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\n\nconst api = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'close',\n 'copyFile',\n 'fchmod',\n 'fchown',\n 'fdatasync',\n 'fstat',\n 'fsync',\n 'ftruncate',\n 'futimes',\n 'lchmod',\n 'lchown',\n 'link',\n 'lstat',\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir',\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'rename',\n 'rm',\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile'\n].filter(key => {\n // Some commands are not available on some systems. Ex:\n // fs.opendir was added in Node.js v12.12.0\n // fs.rm was added in Node.js v14.14.0\n // fs.lchown is not available on at least some Linux\n return typeof fs[key] === 'function'\n})\n\n// Export all keys:\nObject.keys(fs).forEach(key => {\n if (key === 'promises') {\n // fs.promises is a getter property that triggers ExperimentalWarning\n // Don't re-export it here, the getter is defined in \"lib/index.js\"\n return\n }\n exports[key] = fs[key]\n})\n\n// Universalify async methods:\napi.forEach(method => {\n exports[method] = u(fs[method])\n})\n\n// We differ from mz/fs in that we still ship the old, broken, fs.exists()\n// since we are a drop-in replacement for the native module\nexports.exists = function (filename, callback) {\n if (typeof callback === 'function') {\n return fs.exists(filename, callback)\n }\n return new Promise(resolve => {\n return fs.exists(filename, resolve)\n })\n}\n\n// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args\n\nexports.read = function (fd, buffer, offset, length, position, callback) {\n if (typeof callback === 'function') {\n return fs.read(fd, buffer, offset, length, position, callback)\n }\n return new Promise((resolve, reject) => {\n fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {\n if (err) return reject(err)\n resolve({ bytesRead, buffer })\n })\n })\n}\n\n// Function signature can be\n// fs.write(fd, buffer[, offset[, length[, position]]], callback)\n// OR\n// fs.write(fd, string[, position[, encoding]], callback)\n// We need to handle both cases, so we use ...args\nexports.write = function (fd, buffer, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.write(fd, buffer, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffer })\n })\n })\n}\n\n// fs.writev only available in Node v12.9.0+\nif (typeof fs.writev === 'function') {\n // Function signature is\n // s.writev(fd, buffers[, position], callback)\n // We need to handle the optional arg, so we use ...args\n exports.writev = function (fd, buffers, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.writev(fd, buffers, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffers })\n })\n })\n }\n}\n\n// fs.realpath.native only available in Node v9.2+\nif (typeof fs.realpath.native === 'function') {\n exports.realpath.native = u(fs.realpath.native)\n}\n", "module.exports = r => {\n const n = process.versions.node.split('.').map(x => parseInt(x, 10))\n r = r.split('.').map(x => parseInt(x, 10))\n return n[0] > r[0] || (n[0] === r[0] && (n[1] > r[1] || (n[1] === r[1] && n[2] >= r[2])))\n}\n", "// Adapted from https://github.com/sindresorhus/make-dir\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)\n// 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:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// 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.\n'use strict'\nconst fs = require('../fs')\nconst path = require('path')\nconst atLeastNode = require('at-least-node')\n\nconst useNativeRecursiveOption = atLeastNode('10.12.0')\n\n// https://github.com/nodejs/node/issues/8987\n// https://github.com/libuv/libuv/pull/1088\nconst checkPath = pth => {\n if (process.platform === 'win32') {\n const pathHasInvalidWinCharacters = /[<>:\"|?*]/.test(pth.replace(path.parse(pth).root, ''))\n\n if (pathHasInvalidWinCharacters) {\n const error = new Error(`Path contains invalid characters: ${pth}`)\n error.code = 'EINVAL'\n throw error\n }\n }\n}\n\nconst processOptions = options => {\n const defaults = { mode: 0o777 }\n if (typeof options === 'number') options = { mode: options }\n return { ...defaults, ...options }\n}\n\nconst permissionError = pth => {\n // This replicates the exception of `fs.mkdir` with native the\n // `recusive` option when run on an invalid drive under Windows.\n const error = new Error(`operation not permitted, mkdir '${pth}'`)\n error.code = 'EPERM'\n error.errno = -4048\n error.path = pth\n error.syscall = 'mkdir'\n return error\n}\n\nmodule.exports.makeDir = async (input, options) => {\n checkPath(input)\n options = processOptions(options)\n\n if (useNativeRecursiveOption) {\n const pth = path.resolve(input)\n\n return fs.mkdir(pth, {\n mode: options.mode,\n recursive: true\n })\n }\n\n const make = async pth => {\n try {\n await fs.mkdir(pth, options.mode)\n } catch (error) {\n if (error.code === 'EPERM') {\n throw error\n }\n\n if (error.code === 'ENOENT') {\n if (path.dirname(pth) === pth) {\n throw permissionError(pth)\n }\n\n if (error.message.includes('null bytes')) {\n throw error\n }\n\n await make(path.dirname(pth))\n return make(pth)\n }\n\n try {\n const stats = await fs.stat(pth)\n if (!stats.isDirectory()) {\n // This error is never exposed to the user\n // it is caught below, and the original error is thrown\n throw new Error('The path is not a directory')\n }\n } catch {\n throw error\n }\n }\n }\n\n return make(path.resolve(input))\n}\n\nmodule.exports.makeDirSync = (input, options) => {\n checkPath(input)\n options = processOptions(options)\n\n if (useNativeRecursiveOption) {\n const pth = path.resolve(input)\n\n return fs.mkdirSync(pth, {\n mode: options.mode,\n recursive: true\n })\n }\n\n const make = pth => {\n try {\n fs.mkdirSync(pth, options.mode)\n } catch (error) {\n if (error.code === 'EPERM') {\n throw error\n }\n\n if (error.code === 'ENOENT') {\n if (path.dirname(pth) === pth) {\n throw permissionError(pth)\n }\n\n if (error.message.includes('null bytes')) {\n throw error\n }\n\n make(path.dirname(pth))\n return make(pth)\n }\n\n try {\n if (!fs.statSync(pth).isDirectory()) {\n // This error is never exposed to the user\n // it is caught below, and the original error is thrown\n throw new Error('The path is not a directory')\n }\n } catch {\n throw error\n }\n }\n }\n\n return make(path.resolve(input))\n}\n", "'use strict'\nconst u = require('universalify').fromPromise\nconst { makeDir: _makeDir, makeDirSync } = require('./make-dir')\nconst makeDir = u(_makeDir)\n\nmodule.exports = {\n mkdirs: makeDir,\n mkdirsSync: makeDirSync,\n // alias\n mkdirp: makeDir,\n mkdirpSync: makeDirSync,\n ensureDir: makeDir,\n ensureDirSync: makeDirSync\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\n\nfunction utimesMillis (path, atime, mtime, callback) {\n // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)\n fs.open(path, 'r+', (err, fd) => {\n if (err) return callback(err)\n fs.futimes(fd, atime, mtime, futimesErr => {\n fs.close(fd, closeErr => {\n if (callback) callback(futimesErr || closeErr)\n })\n })\n })\n}\n\nfunction utimesMillisSync (path, atime, mtime) {\n const fd = fs.openSync(path, 'r+')\n fs.futimesSync(fd, atime, mtime)\n return fs.closeSync(fd)\n}\n\nmodule.exports = {\n utimesMillis,\n utimesMillisSync\n}\n", "'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst util = require('util')\nconst atLeastNode = require('at-least-node')\n\nconst nodeSupportsBigInt = atLeastNode('10.5.0')\nconst stat = (file) => nodeSupportsBigInt ? fs.stat(file, { bigint: true }) : fs.stat(file)\nconst statSync = (file) => nodeSupportsBigInt ? fs.statSync(file, { bigint: true }) : fs.statSync(file)\n\nfunction getStats (src, dest) {\n return Promise.all([\n stat(src),\n stat(dest).catch(err => {\n if (err.code === 'ENOENT') return null\n throw err\n })\n ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))\n}\n\nfunction getStatsSync (src, dest) {\n let destStat\n const srcStat = statSync(src)\n try {\n destStat = statSync(dest)\n } catch (err) {\n if (err.code === 'ENOENT') return { srcStat, destStat: null }\n throw err\n }\n return { srcStat, destStat }\n}\n\nfunction checkPaths (src, dest, funcName, cb) {\n util.callbackify(getStats)(src, dest, (err, stats) => {\n if (err) return cb(err)\n const { srcStat, destStat } = stats\n if (destStat && areIdentical(srcStat, destStat)) {\n return cb(new Error('Source and destination must not be the same.'))\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return cb(null, { srcStat, destStat })\n })\n}\n\nfunction checkPathsSync (src, dest, funcName) {\n const { srcStat, destStat } = getStatsSync(src, dest)\n if (destStat && areIdentical(srcStat, destStat)) {\n throw new Error('Source and destination must not be the same.')\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return { srcStat, destStat }\n}\n\n// recursively check if dest parent is a subdirectory of src.\n// It works for all file types including symlinks since it\n// checks the src and dest inodes. It starts from the deepest\n// parent and stops once it reaches the src parent or the root path.\nfunction checkParentPaths (src, srcStat, dest, funcName, cb) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()\n const callback = (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (areIdentical(srcStat, destStat)) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n }\n if (nodeSupportsBigInt) fs.stat(destParent, { bigint: true }, callback)\n else fs.stat(destParent, callback)\n}\n\nfunction checkParentPathsSync (src, srcStat, dest, funcName) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return\n let destStat\n try {\n destStat = statSync(destParent)\n } catch (err) {\n if (err.code === 'ENOENT') return\n throw err\n }\n if (areIdentical(srcStat, destStat)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return checkParentPathsSync(src, srcStat, destParent, funcName)\n}\n\nfunction areIdentical (srcStat, destStat) {\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n if (nodeSupportsBigInt || destStat.ino < Number.MAX_SAFE_INTEGER) {\n // definitive answer\n return true\n }\n // Use additional heuristics if we can't use 'bigint'.\n // Different 'ino' could be represented the same if they are >= Number.MAX_SAFE_INTEGER\n // See issue 657\n if (destStat.size === srcStat.size &&\n destStat.mode === srcStat.mode &&\n destStat.nlink === srcStat.nlink &&\n destStat.atimeMs === srcStat.atimeMs &&\n destStat.mtimeMs === srcStat.mtimeMs &&\n destStat.ctimeMs === srcStat.ctimeMs &&\n destStat.birthtimeMs === srcStat.birthtimeMs) {\n // heuristic answer\n return true\n }\n }\n return false\n}\n\n// return true if dest is a subdir of src, otherwise false.\n// It only checks the path strings.\nfunction isSrcSubdir (src, dest) {\n const srcArr = path.resolve(src).split(path.sep).filter(i => i)\n const destArr = path.resolve(dest).split(path.sep).filter(i => i)\n return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true)\n}\n\nfunction errMsg (src, dest, funcName) {\n return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`\n}\n\nmodule.exports = {\n checkPaths,\n checkPathsSync,\n checkParentPaths,\n checkParentPathsSync,\n isSrcSubdir\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirsSync = require('../mkdirs').mkdirsSync\nconst utimesMillisSync = require('../util/utimes').utimesMillisSync\nconst stat = require('../util/stat')\n\nfunction copySync (src, dest, opts) {\n if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n opts = opts || {}\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)\n }\n\n const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy')\n stat.checkParentPathsSync(src, srcStat, dest, 'copy')\n return handleFilterAndCopy(destStat, src, dest, opts)\n}\n\nfunction handleFilterAndCopy (destStat, src, dest, opts) {\n if (opts.filter && !opts.filter(src, dest)) return\n const destParent = path.dirname(dest)\n if (!fs.existsSync(destParent)) mkdirsSync(destParent)\n return startCopy(destStat, src, dest, opts)\n}\n\nfunction startCopy (destStat, src, dest, opts) {\n if (opts.filter && !opts.filter(src, dest)) return\n return getStats(destStat, src, dest, opts)\n}\n\nfunction getStats (destStat, src, dest, opts) {\n const statSync = opts.dereference ? fs.statSync : fs.lstatSync\n const srcStat = statSync(src)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts) {\n if (!destStat) return copyFile(srcStat, src, dest, opts)\n return mayCopyFile(srcStat, src, dest, opts)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts) {\n if (opts.overwrite) {\n fs.unlinkSync(dest)\n return copyFile(srcStat, src, dest, opts)\n } else if (opts.errorOnExist) {\n throw new Error(`'${dest}' already exists`)\n }\n}\n\nfunction copyFile (srcStat, src, dest, opts) {\n fs.copyFileSync(src, dest)\n if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)\n return setDestMode(dest, srcStat.mode)\n}\n\nfunction handleTimestamps (srcMode, src, dest) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)\n return setDestTimestamps(src, dest)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode) {\n return setDestMode(dest, srcMode | 0o200)\n}\n\nfunction setDestMode (dest, srcMode) {\n return fs.chmodSync(dest, srcMode)\n}\n\nfunction setDestTimestamps (src, dest) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n const updatedSrcStat = fs.statSync(src)\n return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)\n if (destStat && !destStat.isDirectory()) {\n throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)\n }\n return copyDir(src, dest, opts)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts) {\n fs.mkdirSync(dest)\n copyDir(src, dest, opts)\n return setDestMode(dest, srcMode)\n}\n\nfunction copyDir (src, dest, opts) {\n fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts))\n}\n\nfunction copyDirItem (item, src, dest, opts) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy')\n return startCopy(destStat, srcItem, destItem, opts)\n}\n\nfunction onLink (destStat, src, dest, opts) {\n let resolvedSrc = fs.readlinkSync(src)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlinkSync(resolvedSrc, dest)\n } else {\n let resolvedDest\n try {\n resolvedDest = fs.readlinkSync(dest)\n } catch (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)\n throw err\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)\n }\n\n // prevent copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)\n }\n return copyLink(resolvedSrc, dest)\n }\n}\n\nfunction copyLink (resolvedSrc, dest) {\n fs.unlinkSync(dest)\n return fs.symlinkSync(resolvedSrc, dest)\n}\n\nmodule.exports = copySync\n", "'use strict'\n\nmodule.exports = {\n copySync: require('./copy-sync')\n}\n", "'use strict'\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\n\nfunction pathExists (path) {\n return fs.access(path).then(() => true).catch(() => false)\n}\n\nmodule.exports = {\n pathExists: u(pathExists),\n pathExistsSync: fs.existsSync\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirs = require('../mkdirs').mkdirs\nconst pathExists = require('../path-exists').pathExists\nconst utimesMillis = require('../util/utimes').utimesMillis\nconst stat = require('../util/stat')\n\nfunction copy (src, dest, opts, cb) {\n if (typeof opts === 'function' && !cb) {\n cb = opts\n opts = {}\n } else if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n cb = cb || function () {}\n opts = opts || {}\n\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)\n }\n\n stat.checkPaths(src, dest, 'copy', (err, stats) => {\n if (err) return cb(err)\n const { srcStat, destStat } = stats\n stat.checkParentPaths(src, srcStat, dest, 'copy', err => {\n if (err) return cb(err)\n if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb)\n return checkParentDir(destStat, src, dest, opts, cb)\n })\n })\n}\n\nfunction checkParentDir (destStat, src, dest, opts, cb) {\n const destParent = path.dirname(dest)\n pathExists(destParent, (err, dirExists) => {\n if (err) return cb(err)\n if (dirExists) return startCopy(destStat, src, dest, opts, cb)\n mkdirs(destParent, err => {\n if (err) return cb(err)\n return startCopy(destStat, src, dest, opts, cb)\n })\n })\n}\n\nfunction handleFilter (onInclude, destStat, src, dest, opts, cb) {\n Promise.resolve(opts.filter(src, dest)).then(include => {\n if (include) return onInclude(destStat, src, dest, opts, cb)\n return cb()\n }, error => cb(error))\n}\n\nfunction startCopy (destStat, src, dest, opts, cb) {\n if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb)\n return getStats(destStat, src, dest, opts, cb)\n}\n\nfunction getStats (destStat, src, dest, opts, cb) {\n const stat = opts.dereference ? fs.stat : fs.lstat\n stat(src, (err, srcStat) => {\n if (err) return cb(err)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb)\n })\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts, cb) {\n if (!destStat) return copyFile(srcStat, src, dest, opts, cb)\n return mayCopyFile(srcStat, src, dest, opts, cb)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts, cb) {\n if (opts.overwrite) {\n fs.unlink(dest, err => {\n if (err) return cb(err)\n return copyFile(srcStat, src, dest, opts, cb)\n })\n } else if (opts.errorOnExist) {\n return cb(new Error(`'${dest}' already exists`))\n } else return cb()\n}\n\nfunction copyFile (srcStat, src, dest, opts, cb) {\n fs.copyFile(src, dest, err => {\n if (err) return cb(err)\n if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb)\n return setDestMode(dest, srcStat.mode, cb)\n })\n}\n\nfunction handleTimestampsAndMode (srcMode, src, dest, cb) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) {\n return makeFileWritable(dest, srcMode, err => {\n if (err) return cb(err)\n return setDestTimestampsAndMode(srcMode, src, dest, cb)\n })\n }\n return setDestTimestampsAndMode(srcMode, src, dest, cb)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode, cb) {\n return setDestMode(dest, srcMode | 0o200, cb)\n}\n\nfunction setDestTimestampsAndMode (srcMode, src, dest, cb) {\n setDestTimestamps(src, dest, err => {\n if (err) return cb(err)\n return setDestMode(dest, srcMode, cb)\n })\n}\n\nfunction setDestMode (dest, srcMode, cb) {\n return fs.chmod(dest, srcMode, cb)\n}\n\nfunction setDestTimestamps (src, dest, cb) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n fs.stat(src, (err, updatedSrcStat) => {\n if (err) return cb(err)\n return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb)\n })\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts, cb) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb)\n if (destStat && !destStat.isDirectory()) {\n return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`))\n }\n return copyDir(src, dest, opts, cb)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts, cb) {\n fs.mkdir(dest, err => {\n if (err) return cb(err)\n copyDir(src, dest, opts, err => {\n if (err) return cb(err)\n return setDestMode(dest, srcMode, cb)\n })\n })\n}\n\nfunction copyDir (src, dest, opts, cb) {\n fs.readdir(src, (err, items) => {\n if (err) return cb(err)\n return copyDirItems(items, src, dest, opts, cb)\n })\n}\n\nfunction copyDirItems (items, src, dest, opts, cb) {\n const item = items.pop()\n if (!item) return cb()\n return copyDirItem(items, item, src, dest, opts, cb)\n}\n\nfunction copyDirItem (items, item, src, dest, opts, cb) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n stat.checkPaths(srcItem, destItem, 'copy', (err, stats) => {\n if (err) return cb(err)\n const { destStat } = stats\n startCopy(destStat, srcItem, destItem, opts, err => {\n if (err) return cb(err)\n return copyDirItems(items, src, dest, opts, cb)\n })\n })\n}\n\nfunction onLink (destStat, src, dest, opts, cb) {\n fs.readlink(src, (err, resolvedSrc) => {\n if (err) return cb(err)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlink(resolvedSrc, dest, cb)\n } else {\n fs.readlink(dest, (err, resolvedDest) => {\n if (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb)\n return cb(err)\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`))\n }\n\n // do not copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`))\n }\n return copyLink(resolvedSrc, dest, cb)\n })\n }\n })\n}\n\nfunction copyLink (resolvedSrc, dest, cb) {\n fs.unlink(dest, err => {\n if (err) return cb(err)\n return fs.symlink(resolvedSrc, dest, cb)\n })\n}\n\nmodule.exports = copy\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nmodule.exports = {\n copy: u(require('./copy'))\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst assert = require('assert')\n\nconst isWindows = (process.platform === 'win32')\n\nfunction defaults (options) {\n const methods = [\n 'unlink',\n 'chmod',\n 'stat',\n 'lstat',\n 'rmdir',\n 'readdir'\n ]\n methods.forEach(m => {\n options[m] = options[m] || fs[m]\n m = m + 'Sync'\n options[m] = options[m] || fs[m]\n })\n\n options.maxBusyTries = options.maxBusyTries || 3\n}\n\nfunction rimraf (p, options, cb) {\n let busyTries = 0\n\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n assert(p, 'rimraf: missing path')\n assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')\n assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required')\n assert(options, 'rimraf: invalid options argument provided')\n assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')\n\n defaults(options)\n\n rimraf_(p, options, function CB (er) {\n if (er) {\n if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') &&\n busyTries < options.maxBusyTries) {\n busyTries++\n const time = busyTries * 100\n // try again, with the same exact callback as this one.\n return setTimeout(() => rimraf_(p, options, CB), time)\n }\n\n // already gone\n if (er.code === 'ENOENT') er = null\n }\n\n cb(er)\n })\n}\n\n// Two possible strategies.\n// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR\n// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR\n//\n// Both result in an extra syscall when you guess wrong. However, there\n// are likely far more normal files in the world than directories. This\n// is based on the assumption that a the average number of files per\n// directory is >= 1.\n//\n// If anyone ever complains about this, then I guess the strategy could\n// be made configurable somehow. But until then, YAGNI.\nfunction rimraf_ (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // sunos lets the root user unlink directories, which is... weird.\n // so we have to lstat here and make sure it's not a dir.\n options.lstat(p, (er, st) => {\n if (er && er.code === 'ENOENT') {\n return cb(null)\n }\n\n // Windows can EPERM on stat. Life is suffering.\n if (er && er.code === 'EPERM' && isWindows) {\n return fixWinEPERM(p, options, er, cb)\n }\n\n if (st && st.isDirectory()) {\n return rmdir(p, options, er, cb)\n }\n\n options.unlink(p, er => {\n if (er) {\n if (er.code === 'ENOENT') {\n return cb(null)\n }\n if (er.code === 'EPERM') {\n return (isWindows)\n ? fixWinEPERM(p, options, er, cb)\n : rmdir(p, options, er, cb)\n }\n if (er.code === 'EISDIR') {\n return rmdir(p, options, er, cb)\n }\n }\n return cb(er)\n })\n })\n}\n\nfunction fixWinEPERM (p, options, er, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.chmod(p, 0o666, er2 => {\n if (er2) {\n cb(er2.code === 'ENOENT' ? null : er)\n } else {\n options.stat(p, (er3, stats) => {\n if (er3) {\n cb(er3.code === 'ENOENT' ? null : er)\n } else if (stats.isDirectory()) {\n rmdir(p, options, er, cb)\n } else {\n options.unlink(p, cb)\n }\n })\n }\n })\n}\n\nfunction fixWinEPERMSync (p, options, er) {\n let stats\n\n assert(p)\n assert(options)\n\n try {\n options.chmodSync(p, 0o666)\n } catch (er2) {\n if (er2.code === 'ENOENT') {\n return\n } else {\n throw er\n }\n }\n\n try {\n stats = options.statSync(p)\n } catch (er3) {\n if (er3.code === 'ENOENT') {\n return\n } else {\n throw er\n }\n }\n\n if (stats.isDirectory()) {\n rmdirSync(p, options, er)\n } else {\n options.unlinkSync(p)\n }\n}\n\nfunction rmdir (p, options, originalEr, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)\n // if we guessed wrong, and it's not a directory, then\n // raise the original error.\n options.rmdir(p, er => {\n if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) {\n rmkids(p, options, cb)\n } else if (er && er.code === 'ENOTDIR') {\n cb(originalEr)\n } else {\n cb(er)\n }\n })\n}\n\nfunction rmkids (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.readdir(p, (er, files) => {\n if (er) return cb(er)\n\n let n = files.length\n let errState\n\n if (n === 0) return options.rmdir(p, cb)\n\n files.forEach(f => {\n rimraf(path.join(p, f), options, er => {\n if (errState) {\n return\n }\n if (er) return cb(errState = er)\n if (--n === 0) {\n options.rmdir(p, cb)\n }\n })\n })\n })\n}\n\n// this looks simpler, and is strictly *faster*, but will\n// tie up the JavaScript thread and fail on excessively\n// deep directory trees.\nfunction rimrafSync (p, options) {\n let st\n\n options = options || {}\n defaults(options)\n\n assert(p, 'rimraf: missing path')\n assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')\n assert(options, 'rimraf: missing options')\n assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')\n\n try {\n st = options.lstatSync(p)\n } catch (er) {\n if (er.code === 'ENOENT') {\n return\n }\n\n // Windows can EPERM on stat. Life is suffering.\n if (er.code === 'EPERM' && isWindows) {\n fixWinEPERMSync(p, options, er)\n }\n }\n\n try {\n // sunos lets the root user unlink directories, which is... weird.\n if (st && st.isDirectory()) {\n rmdirSync(p, options, null)\n } else {\n options.unlinkSync(p)\n }\n } catch (er) {\n if (er.code === 'ENOENT') {\n return\n } else if (er.code === 'EPERM') {\n return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)\n } else if (er.code !== 'EISDIR') {\n throw er\n }\n rmdirSync(p, options, er)\n }\n}\n\nfunction rmdirSync (p, options, originalEr) {\n assert(p)\n assert(options)\n\n try {\n options.rmdirSync(p)\n } catch (er) {\n if (er.code === 'ENOTDIR') {\n throw originalEr\n } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') {\n rmkidsSync(p, options)\n } else if (er.code !== 'ENOENT') {\n throw er\n }\n }\n}\n\nfunction rmkidsSync (p, options) {\n assert(p)\n assert(options)\n options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))\n\n if (isWindows) {\n // We only end up here once we got ENOTEMPTY at least once, and\n // at this point, we are guaranteed to have removed all the kids.\n // So, we know that it won't be ENOENT or ENOTDIR or anything else.\n // try really hard to delete stuff on windows, because it has a\n // PROFOUNDLY annoying habit of not closing handles promptly when\n // files are deleted, resulting in spurious ENOTEMPTY errors.\n const startTime = Date.now()\n do {\n try {\n const ret = options.rmdirSync(p, options)\n return ret\n } catch {}\n } while (Date.now() - startTime < 500) // give up after 500ms\n } else {\n const ret = options.rmdirSync(p, options)\n return ret\n }\n}\n\nmodule.exports = rimraf\nrimraf.sync = rimrafSync\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst rimraf = require('./rimraf')\n\nmodule.exports = {\n remove: u(rimraf),\n removeSync: rimraf.sync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst remove = require('../remove')\n\nconst emptyDir = u(function emptyDir (dir, callback) {\n callback = callback || function () {}\n fs.readdir(dir, (err, items) => {\n if (err) return mkdir.mkdirs(dir, callback)\n\n items = items.map(item => path.join(dir, item))\n\n deleteItem()\n\n function deleteItem () {\n const item = items.pop()\n if (!item) return callback()\n remove.remove(item, err => {\n if (err) return callback(err)\n deleteItem()\n })\n }\n })\n})\n\nfunction emptyDirSync (dir) {\n let items\n try {\n items = fs.readdirSync(dir)\n } catch {\n return mkdir.mkdirsSync(dir)\n }\n\n items.forEach(item => {\n item = path.join(dir, item)\n remove.removeSync(item)\n })\n}\n\nmodule.exports = {\n emptyDirSync,\n emptydirSync: emptyDirSync,\n emptyDir,\n emptydir: emptyDir\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst mkdir = require('../mkdirs')\n\nfunction createFile (file, callback) {\n function makeFile () {\n fs.writeFile(file, '', err => {\n if (err) return callback(err)\n callback()\n })\n }\n\n fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err\n if (!err && stats.isFile()) return callback()\n const dir = path.dirname(file)\n fs.stat(dir, (err, stats) => {\n if (err) {\n // if the directory doesn't exist, make it\n if (err.code === 'ENOENT') {\n return mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n makeFile()\n })\n }\n return callback(err)\n }\n\n if (stats.isDirectory()) makeFile()\n else {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdir(dir, err => {\n if (err) return callback(err)\n })\n }\n })\n })\n}\n\nfunction createFileSync (file) {\n let stats\n try {\n stats = fs.statSync(file)\n } catch {}\n if (stats && stats.isFile()) return\n\n const dir = path.dirname(file)\n try {\n if (!fs.statSync(dir).isDirectory()) {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdirSync(dir)\n }\n } catch (err) {\n // If the stat call above failed because the directory doesn't exist, create it\n if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)\n else throw err\n }\n\n fs.writeFileSync(file, '')\n}\n\nmodule.exports = {\n createFile: u(createFile),\n createFileSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nfunction createLink (srcpath, dstpath, callback) {\n function makeLink (srcpath, dstpath) {\n fs.link(srcpath, dstpath, err => {\n if (err) return callback(err)\n callback(null)\n })\n }\n\n pathExists(dstpath, (err, destinationExists) => {\n if (err) return callback(err)\n if (destinationExists) return callback(null)\n fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n return callback(err)\n }\n\n const dir = path.dirname(dstpath)\n pathExists(dir, (err, dirExists) => {\n if (err) return callback(err)\n if (dirExists) return makeLink(srcpath, dstpath)\n mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n makeLink(srcpath, dstpath)\n })\n })\n })\n })\n}\n\nfunction createLinkSync (srcpath, dstpath) {\n const destinationExists = fs.existsSync(dstpath)\n if (destinationExists) return undefined\n\n try {\n fs.lstatSync(srcpath)\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n throw err\n }\n\n const dir = path.dirname(dstpath)\n const dirExists = fs.existsSync(dir)\n if (dirExists) return fs.linkSync(srcpath, dstpath)\n mkdir.mkdirsSync(dir)\n\n return fs.linkSync(srcpath, dstpath)\n}\n\nmodule.exports = {\n createLink: u(createLink),\n createLinkSync\n}\n", "'use strict'\n\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst pathExists = require('../path-exists').pathExists\n\n/**\n * Function that returns two types of paths, one relative to symlink, and one\n * relative to the current working directory. Checks if path is absolute or\n * relative. If the path is relative, this function checks if the path is\n * relative to symlink or relative to current working directory. This is an\n * initiative to find a smarter `srcpath` to supply when building symlinks.\n * This allows you to determine which path to use out of one of three possible\n * types of source paths. The first is an absolute path. This is detected by\n * `path.isAbsolute()`. When an absolute path is provided, it is checked to\n * see if it exists. If it does it's used, if not an error is returned\n * (callback)/ thrown (sync). The other two options for `srcpath` are a\n * relative url. By default Node's `fs.symlink` works by creating a symlink\n * using `dstpath` and expects the `srcpath` to be relative to the newly\n * created symlink. If you provide a `srcpath` that does not exist on the file\n * system it results in a broken symlink. To minimize this, the function\n * checks to see if the 'relative to symlink' source file exists, and if it\n * does it will use it. If it does not, it checks if there's a file that\n * exists that is relative to the current working directory, if does its used.\n * This preserves the expectations of the original fs.symlink spec and adds\n * the ability to pass in `relative to current working direcotry` paths.\n */\n\nfunction symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n toCwd: relativeToDst,\n toDst: srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}\n\nfunction symlinkPathsSync (srcpath, dstpath) {\n let exists\n if (path.isAbsolute(srcpath)) {\n exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('absolute srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: srcpath\n }\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n exists = fs.existsSync(relativeToDst)\n if (exists) {\n return {\n toCwd: relativeToDst,\n toDst: srcpath\n }\n } else {\n exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('relative srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n }\n }\n }\n}\n\nmodule.exports = {\n symlinkPaths,\n symlinkPathsSync\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\n\nfunction symlinkType (srcpath, type, callback) {\n callback = (typeof type === 'function') ? type : callback\n type = (typeof type === 'function') ? false : type\n if (type) return callback(null, type)\n fs.lstat(srcpath, (err, stats) => {\n if (err) return callback(null, 'file')\n type = (stats && stats.isDirectory()) ? 'dir' : 'file'\n callback(null, type)\n })\n}\n\nfunction symlinkTypeSync (srcpath, type) {\n let stats\n\n if (type) return type\n try {\n stats = fs.lstatSync(srcpath)\n } catch {\n return 'file'\n }\n return (stats && stats.isDirectory()) ? 'dir' : 'file'\n}\n\nmodule.exports = {\n symlinkType,\n symlinkTypeSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst _mkdirs = require('../mkdirs')\nconst mkdirs = _mkdirs.mkdirs\nconst mkdirsSync = _mkdirs.mkdirsSync\n\nconst _symlinkPaths = require('./symlink-paths')\nconst symlinkPaths = _symlinkPaths.symlinkPaths\nconst symlinkPathsSync = _symlinkPaths.symlinkPathsSync\n\nconst _symlinkType = require('./symlink-type')\nconst symlinkType = _symlinkType.symlinkType\nconst symlinkTypeSync = _symlinkType.symlinkTypeSync\n\nconst pathExists = require('../path-exists').pathExists\n\nfunction createSymlink (srcpath, dstpath, type, callback) {\n callback = (typeof type === 'function') ? type : callback\n type = (typeof type === 'function') ? false : type\n\n pathExists(dstpath, (err, destinationExists) => {\n if (err) return callback(err)\n if (destinationExists) return callback(null)\n symlinkPaths(srcpath, dstpath, (err, relative) => {\n if (err) return callback(err)\n srcpath = relative.toDst\n symlinkType(relative.toCwd, type, (err, type) => {\n if (err) return callback(err)\n const dir = path.dirname(dstpath)\n pathExists(dir, (err, dirExists) => {\n if (err) return callback(err)\n if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)\n mkdirs(dir, err => {\n if (err) return callback(err)\n fs.symlink(srcpath, dstpath, type, callback)\n })\n })\n })\n })\n })\n}\n\nfunction createSymlinkSync (srcpath, dstpath, type) {\n const destinationExists = fs.existsSync(dstpath)\n if (destinationExists) return undefined\n\n const relative = symlinkPathsSync(srcpath, dstpath)\n srcpath = relative.toDst\n type = symlinkTypeSync(relative.toCwd, type)\n const dir = path.dirname(dstpath)\n const exists = fs.existsSync(dir)\n if (exists) return fs.symlinkSync(srcpath, dstpath, type)\n mkdirsSync(dir)\n return fs.symlinkSync(srcpath, dstpath, type)\n}\n\nmodule.exports = {\n createSymlink: u(createSymlink),\n createSymlinkSync\n}\n", "'use strict'\n\nconst file = require('./file')\nconst link = require('./link')\nconst symlink = require('./symlink')\n\nmodule.exports = {\n // file\n createFile: file.createFile,\n createFileSync: file.createFileSync,\n ensureFile: file.createFile,\n ensureFileSync: file.createFileSync,\n // link\n createLink: link.createLink,\n createLinkSync: link.createLinkSync,\n ensureLink: link.createLink,\n ensureLinkSync: link.createLinkSync,\n // symlink\n createSymlink: symlink.createSymlink,\n createSymlinkSync: symlink.createSymlinkSync,\n ensureSymlink: symlink.createSymlink,\n ensureSymlinkSync: symlink.createSymlinkSync\n}\n", "function stringify (obj, { EOL = '\\n', finalEOL = true, replacer = null, spaces } = {}) {\n const EOF = finalEOL ? EOL : ''\n const str = JSON.stringify(obj, replacer, spaces)\n\n return str.replace(/\\n/g, EOL) + EOF\n}\n\nfunction stripBom (content) {\n // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified\n if (Buffer.isBuffer(content)) content = content.toString('utf8')\n return content.replace(/^\\uFEFF/, '')\n}\n\nmodule.exports = { stringify, stripBom }\n", "let _fs\ntry {\n _fs = require('graceful-fs')\n} catch (_) {\n _fs = require('fs')\n}\nconst universalify = require('universalify')\nconst { stringify, stripBom } = require('./utils')\n\nasync function _readFile (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n let data = await universalify.fromCallback(fs.readFile)(file, options)\n\n data = stripBom(data)\n\n let obj\n try {\n obj = JSON.parse(data, options ? options.reviver : null)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n\n return obj\n}\n\nconst readFile = universalify.fromPromise(_readFile)\n\nfunction readFileSync (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n try {\n let content = fs.readFileSync(file, options)\n content = stripBom(content)\n return JSON.parse(content, options.reviver)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n}\n\nasync function _writeFile (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n\n await universalify.fromCallback(fs.writeFile)(file, str, options)\n}\n\nconst writeFile = universalify.fromPromise(_writeFile)\n\nfunction writeFileSync (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n // not sure if fs.writeFileSync returns anything, but just in case\n return fs.writeFileSync(file, str, options)\n}\n\nconst jsonfile = {\n readFile,\n readFileSync,\n writeFile,\n writeFileSync\n}\n\nmodule.exports = jsonfile\n", "'use strict'\n\nconst jsonFile = require('jsonfile')\n\nmodule.exports = {\n // jsonfile exports\n readJson: jsonFile.readFile,\n readJsonSync: jsonFile.readFileSync,\n writeJson: jsonFile.writeFile,\n writeJsonSync: jsonFile.writeFileSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nfunction outputFile (file, data, encoding, callback) {\n if (typeof encoding === 'function') {\n callback = encoding\n encoding = 'utf8'\n }\n\n const dir = path.dirname(file)\n pathExists(dir, (err, itDoes) => {\n if (err) return callback(err)\n if (itDoes) return fs.writeFile(file, data, encoding, callback)\n\n mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n\n fs.writeFile(file, data, encoding, callback)\n })\n })\n}\n\nfunction outputFileSync (file, ...args) {\n const dir = path.dirname(file)\n if (fs.existsSync(dir)) {\n return fs.writeFileSync(file, ...args)\n }\n mkdir.mkdirsSync(dir)\n fs.writeFileSync(file, ...args)\n}\n\nmodule.exports = {\n outputFile: u(outputFile),\n outputFileSync\n}\n", "'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFile } = require('../output')\n\nasync function outputJson (file, data, options = {}) {\n const str = stringify(data, options)\n\n await outputFile(file, str, options)\n}\n\nmodule.exports = outputJson\n", "'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFileSync } = require('../output')\n\nfunction outputJsonSync (file, data, options) {\n const str = stringify(data, options)\n\n outputFileSync(file, str, options)\n}\n\nmodule.exports = outputJsonSync\n", "'use strict'\n\nconst u = require('universalify').fromPromise\nconst jsonFile = require('./jsonfile')\n\njsonFile.outputJson = u(require('./output-json'))\njsonFile.outputJsonSync = require('./output-json-sync')\n// aliases\njsonFile.outputJSON = jsonFile.outputJson\njsonFile.outputJSONSync = jsonFile.outputJsonSync\njsonFile.writeJSON = jsonFile.writeJson\njsonFile.writeJSONSync = jsonFile.writeJsonSync\njsonFile.readJSON = jsonFile.readJson\njsonFile.readJSONSync = jsonFile.readJsonSync\n\nmodule.exports = jsonFile\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copySync = require('../copy-sync').copySync\nconst removeSync = require('../remove').removeSync\nconst mkdirpSync = require('../mkdirs').mkdirpSync\nconst stat = require('../util/stat')\n\nfunction moveSync (src, dest, opts) {\n opts = opts || {}\n const overwrite = opts.overwrite || opts.clobber || false\n\n const { srcStat } = stat.checkPathsSync(src, dest, 'move')\n stat.checkParentPathsSync(src, srcStat, dest, 'move')\n mkdirpSync(path.dirname(dest))\n return doRename(src, dest, overwrite)\n}\n\nfunction doRename (src, dest, overwrite) {\n if (overwrite) {\n removeSync(dest)\n return rename(src, dest, overwrite)\n }\n if (fs.existsSync(dest)) throw new Error('dest already exists.')\n return rename(src, dest, overwrite)\n}\n\nfunction rename (src, dest, overwrite) {\n try {\n fs.renameSync(src, dest)\n } catch (err) {\n if (err.code !== 'EXDEV') throw err\n return moveAcrossDevice(src, dest, overwrite)\n }\n}\n\nfunction moveAcrossDevice (src, dest, overwrite) {\n const opts = {\n overwrite,\n errorOnExist: true\n }\n copySync(src, dest, opts)\n return removeSync(src)\n}\n\nmodule.exports = moveSync\n", "'use strict'\n\nmodule.exports = {\n moveSync: require('./move-sync')\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copy = require('../copy').copy\nconst remove = require('../remove').remove\nconst mkdirp = require('../mkdirs').mkdirp\nconst pathExists = require('../path-exists').pathExists\nconst stat = require('../util/stat')\n\nfunction move (src, dest, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts\n opts = {}\n }\n\n const overwrite = opts.overwrite || opts.clobber || false\n\n stat.checkPaths(src, dest, 'move', (err, stats) => {\n if (err) return cb(err)\n const { srcStat } = stats\n stat.checkParentPaths(src, srcStat, dest, 'move', err => {\n if (err) return cb(err)\n mkdirp(path.dirname(dest), err => {\n if (err) return cb(err)\n return doRename(src, dest, overwrite, cb)\n })\n })\n })\n}\n\nfunction doRename (src, dest, overwrite, cb) {\n if (overwrite) {\n return remove(dest, err => {\n if (err) return cb(err)\n return rename(src, dest, overwrite, cb)\n })\n }\n pathExists(dest, (err, destExists) => {\n if (err) return cb(err)\n if (destExists) return cb(new Error('dest already exists.'))\n return rename(src, dest, overwrite, cb)\n })\n}\n\nfunction rename (src, dest, overwrite, cb) {\n fs.rename(src, dest, err => {\n if (!err) return cb()\n if (err.code !== 'EXDEV') return cb(err)\n return moveAcrossDevice(src, dest, overwrite, cb)\n })\n}\n\nfunction moveAcrossDevice (src, dest, overwrite, cb) {\n const opts = {\n overwrite,\n errorOnExist: true\n }\n copy(src, dest, opts, err => {\n if (err) return cb(err)\n return remove(src, cb)\n })\n}\n\nmodule.exports = move\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nmodule.exports = {\n move: u(require('./move'))\n}\n", "'use strict'\n\nmodule.exports = {\n // Export promiseified graceful-fs:\n ...require('./fs'),\n // Export extra methods:\n ...require('./copy-sync'),\n ...require('./copy'),\n ...require('./empty'),\n ...require('./ensure'),\n ...require('./json'),\n ...require('./mkdirs'),\n ...require('./move-sync'),\n ...require('./move'),\n ...require('./output'),\n ...require('./path-exists'),\n ...require('./remove')\n}\n\n// Export fs.promises as a getter property so that we don't trigger\n// ExperimentalWarning before fs.promises is actually accessed.\nconst fs = require('fs')\nif (Object.getOwnPropertyDescriptor(fs, 'promises')) {\n Object.defineProperty(module.exports, 'promises', {\n get () { return fs.promises }\n })\n}\n", "'use strict';\n\nvar matchOperatorsRe = /[|\\\\{}()[\\]^$+*?.]/g;\n\nmodule.exports = function (str) {\n\tif (typeof str !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\treturn str.replace(matchOperatorsRe, '\\\\$&');\n};\n", "'use strict'\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n", "/* MIT license */\nvar cssKeywords = require('color-name');\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nvar reverseKeywords = {};\nfor (var key in cssKeywords) {\n\tif (cssKeywords.hasOwnProperty(key)) {\n\t\treverseKeywords[cssKeywords[key]] = key;\n\t}\n}\n\nvar convert = module.exports = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\tlch: {channels: 3, labels: 'lch'},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']}\n};\n\n// hide .channels and .labels properties\nfor (var model in convert) {\n\tif (convert.hasOwnProperty(model)) {\n\t\tif (!('channels' in convert[model])) {\n\t\t\tthrow new Error('missing channels property: ' + model);\n\t\t}\n\n\t\tif (!('labels' in convert[model])) {\n\t\t\tthrow new Error('missing channel labels property: ' + model);\n\t\t}\n\n\t\tif (convert[model].labels.length !== convert[model].channels) {\n\t\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t\t}\n\n\t\tvar channels = convert[model].channels;\n\t\tvar labels = convert[model].labels;\n\t\tdelete convert[model].channels;\n\t\tdelete convert[model].labels;\n\t\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\t\tObject.defineProperty(convert[model], 'labels', {value: labels});\n\t}\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar min = Math.min(r, g, b);\n\tvar max = Math.max(r, g, b);\n\tvar delta = max - min;\n\tvar h;\n\tvar s;\n\tvar l;\n\n\tif (max === min) {\n\t\th = 0;\n\t} else if (r === max) {\n\t\th = (g - b) / delta;\n\t} else if (g === max) {\n\t\th = 2 + (b - r) / delta;\n\t} else if (b === max) {\n\t\th = 4 + (r - g) / delta;\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tl = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tvar rdif;\n\tvar gdif;\n\tvar bdif;\n\tvar h;\n\tvar s;\n\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar v = Math.max(r, g, b);\n\tvar diff = v - Math.min(r, g, b);\n\tvar diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = s = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tif (r === v) {\n\t\t\th = bdif - gdif;\n\t\t} else if (g === v) {\n\t\t\th = (1 / 3) + rdif - bdif;\n\t\t} else if (b === v) {\n\t\t\th = (2 / 3) + gdif - rdif;\n\t\t}\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tvar r = rgb[0];\n\tvar g = rgb[1];\n\tvar b = rgb[2];\n\tvar h = convert.rgb.hsl(rgb)[0];\n\tvar w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar c;\n\tvar m;\n\tvar y;\n\tvar k;\n\n\tk = Math.min(1 - r, 1 - g, 1 - b);\n\tc = (1 - r - k) / (1 - k) || 0;\n\tm = (1 - g - k) / (1 - k) || 0;\n\ty = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\n/**\n * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n * */\nfunction comparativeDistance(x, y) {\n\treturn (\n\t\tMath.pow(x[0] - y[0], 2) +\n\t\tMath.pow(x[1] - y[1], 2) +\n\t\tMath.pow(x[2] - y[2], 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tvar reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tvar currentClosestDistance = Infinity;\n\tvar currentClosestKeyword;\n\n\tfor (var keyword in cssKeywords) {\n\t\tif (cssKeywords.hasOwnProperty(keyword)) {\n\t\t\tvar value = cssKeywords[keyword];\n\n\t\t\t// Compute comparative distance\n\t\t\tvar distance = comparativeDistance(rgb, value);\n\n\t\t\t// Check if its less, if so set as closest\n\t\t\tif (distance < currentClosestDistance) {\n\t\t\t\tcurrentClosestDistance = distance;\n\t\t\t\tcurrentClosestKeyword = keyword;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn cssKeywords[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\n\t// assume sRGB\n\tr = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\n\n\tvar x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n\tvar y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n\tvar z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tvar xyz = convert.rgb.xyz(rgb);\n\tvar x = xyz[0];\n\tvar y = xyz[1];\n\tvar z = xyz[2];\n\tvar l;\n\tvar a;\n\tvar b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tvar h = hsl[0] / 360;\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar t1;\n\tvar t2;\n\tvar t3;\n\tvar rgb;\n\tvar val;\n\n\tif (s === 0) {\n\t\tval = l * 255;\n\t\treturn [val, val, val];\n\t}\n\n\tif (l < 0.5) {\n\t\tt2 = l * (1 + s);\n\t} else {\n\t\tt2 = l + s - l * s;\n\t}\n\n\tt1 = 2 * l - t2;\n\n\trgb = [0, 0, 0];\n\tfor (var i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tval = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tval = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tval = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tval = t1;\n\t\t}\n\n\t\trgb[i] = val * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tvar h = hsl[0];\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar smin = s;\n\tvar lmin = Math.max(l, 0.01);\n\tvar sv;\n\tvar v;\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tv = (l + s) / 2;\n\tsv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tvar h = hsv[0] / 60;\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\tvar hi = Math.floor(h) % 6;\n\n\tvar f = h - Math.floor(h);\n\tvar p = 255 * v * (1 - s);\n\tvar q = 255 * v * (1 - (s * f));\n\tvar t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0:\n\t\t\treturn [v, t, p];\n\t\tcase 1:\n\t\t\treturn [q, v, p];\n\t\tcase 2:\n\t\t\treturn [p, v, t];\n\t\tcase 3:\n\t\t\treturn [p, q, v];\n\t\tcase 4:\n\t\t\treturn [t, p, v];\n\t\tcase 5:\n\t\t\treturn [v, p, q];\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tvar h = hsv[0];\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\tvar vmin = Math.max(v, 0.01);\n\tvar lmin;\n\tvar sl;\n\tvar l;\n\n\tl = (2 - s) * v;\n\tlmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tvar h = hwb[0] / 360;\n\tvar wh = hwb[1] / 100;\n\tvar bl = hwb[2] / 100;\n\tvar ratio = wh + bl;\n\tvar i;\n\tvar v;\n\tvar f;\n\tvar n;\n\n\t// wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\ti = Math.floor(6 * h);\n\tv = 1 - bl;\n\tf = 6 * h - i;\n\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tn = wh + f * (v - wh); // linear interpolation\n\n\tvar r;\n\tvar g;\n\tvar b;\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: r = v; g = n; b = wh; break;\n\t\tcase 1: r = n; g = v; b = wh; break;\n\t\tcase 2: r = wh; g = v; b = n; break;\n\t\tcase 3: r = wh; g = n; b = v; break;\n\t\tcase 4: r = n; g = wh; b = v; break;\n\t\tcase 5: r = v; g = wh; b = n; break;\n\t}\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tvar c = cmyk[0] / 100;\n\tvar m = cmyk[1] / 100;\n\tvar y = cmyk[2] / 100;\n\tvar k = cmyk[3] / 100;\n\tvar r;\n\tvar g;\n\tvar b;\n\n\tr = 1 - Math.min(1, c * (1 - k) + k);\n\tg = 1 - Math.min(1, m * (1 - k) + k);\n\tb = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tvar x = xyz[0] / 100;\n\tvar y = xyz[1] / 100;\n\tvar z = xyz[2] / 100;\n\tvar r;\n\tvar g;\n\tvar b;\n\n\tr = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n\tg = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n\tb = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n\t// assume sRGB\n\tr = r > 0.0031308\n\t\t? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)\n\t\t: r * 12.92;\n\n\tg = g > 0.0031308\n\t\t? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)\n\t\t: g * 12.92;\n\n\tb = b > 0.0031308\n\t\t? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)\n\t\t: b * 12.92;\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tvar x = xyz[0];\n\tvar y = xyz[1];\n\tvar z = xyz[2];\n\tvar l;\n\tvar a;\n\tvar b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.lab.xyz = function (lab) {\n\tvar l = lab[0];\n\tvar a = lab[1];\n\tvar b = lab[2];\n\tvar x;\n\tvar y;\n\tvar z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tvar y2 = Math.pow(y, 3);\n\tvar x2 = Math.pow(x, 3);\n\tvar z2 = Math.pow(z, 3);\n\ty = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\n\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tvar l = lab[0];\n\tvar a = lab[1];\n\tvar b = lab[2];\n\tvar hr;\n\tvar h;\n\tvar c;\n\n\thr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tc = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tvar l = lch[0];\n\tvar c = lch[1];\n\tvar h = lch[2];\n\tvar a;\n\tvar b;\n\tvar hr;\n\n\thr = h / 360 * 2 * Math.PI;\n\ta = c * Math.cos(hr);\n\tb = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args) {\n\tvar r = args[0];\n\tvar g = args[1];\n\tvar b = args[2];\n\tvar value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tvar ansi = 30\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tvar r = args[0];\n\tvar g = args[1];\n\tvar b = args[2];\n\n\t// we use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\tif (r === g && g === b) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tvar ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\tvar color = args % 10;\n\n\t// handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tvar mult = (~~(args > 50) + 1) * 0.5;\n\tvar r = ((color & 1) * mult) * 255;\n\tvar g = (((color >> 1) & 1) * mult) * 255;\n\tvar b = (((color >> 2) & 1) * mult) * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\t// handle greyscale\n\tif (args >= 232) {\n\t\tvar c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tvar rem;\n\tvar r = Math.floor(args / 36) / 5 * 255;\n\tvar g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tvar b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\tvar integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\n\tvar string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tvar match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tvar colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = colorString.split('').map(function (char) {\n\t\t\treturn char + char;\n\t\t}).join('');\n\t}\n\n\tvar integer = parseInt(colorString, 16);\n\tvar r = (integer >> 16) & 0xFF;\n\tvar g = (integer >> 8) & 0xFF;\n\tvar b = integer & 0xFF;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar max = Math.max(Math.max(r, g), b);\n\tvar min = Math.min(Math.min(r, g), b);\n\tvar chroma = (max - min);\n\tvar grayscale;\n\tvar hue;\n\n\tif (chroma < 1) {\n\t\tgrayscale = min / (1 - chroma);\n\t} else {\n\t\tgrayscale = 0;\n\t}\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else\n\tif (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else\n\tif (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma + 4;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar c = 1;\n\tvar f = 0;\n\n\tif (l < 0.5) {\n\t\tc = 2.0 * s * l;\n\t} else {\n\t\tc = 2.0 * s * (1.0 - l);\n\t}\n\n\tif (c < 1.0) {\n\t\tf = (l - 0.5 * c) / (1.0 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\n\tvar c = s * v;\n\tvar f = 0;\n\n\tif (c < 1.0) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tvar h = hcg[0] / 360;\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tif (c === 0.0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tvar pure = [0, 0, 0];\n\tvar hi = (h % 1) * 6;\n\tvar v = hi % 1;\n\tvar w = 1 - v;\n\tvar mg = 0;\n\n\tswitch (Math.floor(hi)) {\n\t\tcase 0:\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\tcase 1:\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\tcase 2:\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\tcase 3:\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\tcase 4:\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\tdefault:\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t}\n\n\tmg = (1.0 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tvar v = c + g * (1.0 - c);\n\tvar f = 0;\n\n\tif (v > 0.0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tvar l = g * (1.0 - c) + 0.5 * c;\n\tvar s = 0;\n\n\tif (l > 0.0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else\n\tif (l >= 0.5 && l < 1.0) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\tvar v = c + g * (1.0 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tvar w = hwb[1] / 100;\n\tvar b = hwb[2] / 100;\n\tvar v = 1 - b;\n\tvar c = v - w;\n\tvar g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = convert.gray.hsv = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\tvar val = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tvar integer = (val << 16) + (val << 8) + val;\n\n\tvar string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tvar val = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [val / 255 * 100];\n};\n", "var conversions = require('./conversions');\n\n/*\n\tthis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tvar graph = buildGraph();\n\tvar queue = [fromModel]; // unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length) {\n\t\tvar current = queue.pop();\n\t\tvar adjacents = Object.keys(conversions[current]);\n\n\t\tfor (var len = adjacents.length, i = 0; i < len; i++) {\n\t\t\tvar adjacent = adjacents[i];\n\t\t\tvar node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tvar path = [graph[toModel].parent, toModel];\n\tvar fn = conversions[graph[toModel].parent][toModel];\n\n\tvar cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nmodule.exports = function (fromModel) {\n\tvar graph = deriveBFS(fromModel);\n\tvar conversion = {};\n\n\tvar models = Object.keys(graph);\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tvar toModel = models[i];\n\t\tvar node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// no possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n};\n\n", "var conversions = require('./conversions');\nvar route = require('./route');\n\nvar convert = {};\n\nvar models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tvar wrappedFn = function (args) {\n\t\tif (args === undefined || args === null) {\n\t\t\treturn args;\n\t\t}\n\n\t\tif (arguments.length > 1) {\n\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tvar wrappedFn = function (args) {\n\t\tif (args === undefined || args === null) {\n\t\t\treturn args;\n\t\t}\n\n\t\tif (arguments.length > 1) {\n\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t}\n\n\t\tvar result = fn(args);\n\n\t\t// we're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (var len = result.length, i = 0; i < len; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nmodels.forEach(function (fromModel) {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tvar routes = route(fromModel);\n\tvar routeModels = Object.keys(routes);\n\n\trouteModels.forEach(function (toModel) {\n\t\tvar fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t});\n});\n\nmodule.exports = convert;\n", "'use strict';\nconst colorConvert = require('color-convert');\n\nconst wrapAnsi16 = (fn, offset) => function () {\n\tconst code = fn.apply(colorConvert, arguments);\n\treturn `\\u001B[${code + offset}m`;\n};\n\nconst wrapAnsi256 = (fn, offset) => function () {\n\tconst code = fn.apply(colorConvert, arguments);\n\treturn `\\u001B[${38 + offset};5;${code}m`;\n};\n\nconst wrapAnsi16m = (fn, offset) => function () {\n\tconst rgb = fn.apply(colorConvert, arguments);\n\treturn `\\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;\n};\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\tconst styles = {\n\t\tmodifier: {\n\t\t\treset: [0, 0],\n\t\t\t// 21 isn't widely supported and 22 does the same thing\n\t\t\tbold: [1, 22],\n\t\t\tdim: [2, 22],\n\t\t\titalic: [3, 23],\n\t\t\tunderline: [4, 24],\n\t\t\tinverse: [7, 27],\n\t\t\thidden: [8, 28],\n\t\t\tstrikethrough: [9, 29]\n\t\t},\n\t\tcolor: {\n\t\t\tblack: [30, 39],\n\t\t\tred: [31, 39],\n\t\t\tgreen: [32, 39],\n\t\t\tyellow: [33, 39],\n\t\t\tblue: [34, 39],\n\t\t\tmagenta: [35, 39],\n\t\t\tcyan: [36, 39],\n\t\t\twhite: [37, 39],\n\t\t\tgray: [90, 39],\n\n\t\t\t// Bright color\n\t\t\tredBright: [91, 39],\n\t\t\tgreenBright: [92, 39],\n\t\t\tyellowBright: [93, 39],\n\t\t\tblueBright: [94, 39],\n\t\t\tmagentaBright: [95, 39],\n\t\t\tcyanBright: [96, 39],\n\t\t\twhiteBright: [97, 39]\n\t\t},\n\t\tbgColor: {\n\t\t\tbgBlack: [40, 49],\n\t\t\tbgRed: [41, 49],\n\t\t\tbgGreen: [42, 49],\n\t\t\tbgYellow: [43, 49],\n\t\t\tbgBlue: [44, 49],\n\t\t\tbgMagenta: [45, 49],\n\t\t\tbgCyan: [46, 49],\n\t\t\tbgWhite: [47, 49],\n\n\t\t\t// Bright color\n\t\t\tbgBlackBright: [100, 49],\n\t\t\tbgRedBright: [101, 49],\n\t\t\tbgGreenBright: [102, 49],\n\t\t\tbgYellowBright: [103, 49],\n\t\t\tbgBlueBright: [104, 49],\n\t\t\tbgMagentaBright: [105, 49],\n\t\t\tbgCyanBright: [106, 49],\n\t\t\tbgWhiteBright: [107, 49]\n\t\t}\n\t};\n\n\t// Fix humans\n\tstyles.color.grey = styles.color.gray;\n\n\tfor (const groupName of Object.keys(styles)) {\n\t\tconst group = styles[groupName];\n\n\t\tfor (const styleName of Object.keys(group)) {\n\t\t\tconst style = group[styleName];\n\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false\n\t\t});\n\n\t\tObject.defineProperty(styles, 'codes', {\n\t\t\tvalue: codes,\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tconst ansi2ansi = n => n;\n\tconst rgb2rgb = (r, g, b) => [r, g, b];\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = {\n\t\tansi: wrapAnsi16(ansi2ansi, 0)\n\t};\n\tstyles.color.ansi256 = {\n\t\tansi256: wrapAnsi256(ansi2ansi, 0)\n\t};\n\tstyles.color.ansi16m = {\n\t\trgb: wrapAnsi16m(rgb2rgb, 0)\n\t};\n\n\tstyles.bgColor.ansi = {\n\t\tansi: wrapAnsi16(ansi2ansi, 10)\n\t};\n\tstyles.bgColor.ansi256 = {\n\t\tansi256: wrapAnsi256(ansi2ansi, 10)\n\t};\n\tstyles.bgColor.ansi16m = {\n\t\trgb: wrapAnsi16m(rgb2rgb, 10)\n\t};\n\n\tfor (let key of Object.keys(colorConvert)) {\n\t\tif (typeof colorConvert[key] !== 'object') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst suite = colorConvert[key];\n\n\t\tif (key === 'ansi16') {\n\t\t\tkey = 'ansi';\n\t\t}\n\n\t\tif ('ansi16' in suite) {\n\t\t\tstyles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);\n\t\t\tstyles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);\n\t\t}\n\n\t\tif ('ansi256' in suite) {\n\t\t\tstyles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);\n\t\t\tstyles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);\n\t\t}\n\n\t\tif ('rgb' in suite) {\n\t\t\tstyles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);\n\t\t\tstyles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);\n\t\t}\n\t}\n\n\treturn styles;\n}\n\n// Make the export immutable\nObject.defineProperty(module, 'exports', {\n\tenumerable: true,\n\tget: assembleStyles\n});\n", "'use strict';\nmodule.exports = (flag, argv) => {\n\targv = argv || process.argv;\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst pos = argv.indexOf(prefix + flag);\n\tconst terminatorPos = argv.indexOf('--');\n\treturn pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);\n};\n", "'use strict';\nconst os = require('os');\nconst hasFlag = require('has-flag');\n\nconst env = process.env;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false')) {\n\tforceColor = false;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = true;\n}\nif ('FORCE_COLOR' in env) {\n\tforceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(stream) {\n\tif (forceColor === false) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (stream && !stream.isTTY && forceColor !== true) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor ? 1 : 0;\n\n\tif (process.platform === 'win32') {\n\t\t// Node.js 7.5.0 is the first version of Node.js to include a patch to\n\t\t// libuv that enables 256 color output on Windows. Anything earlier and it\n\t\t// won't work. However, here we target Node.js 8 at minimum as it is an LTS\n\t\t// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows\n\t\t// release that supports 256 colors. Windows 10 build 14931 is the first release\n\t\t// that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(process.versions.node.split('.')[0]) >= 8 &&\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: getSupportLevel(process.stdout),\n\tstderr: getSupportLevel(process.stderr)\n};\n", "'use strict';\nconst TEMPLATE_REGEX = /(?:\\\\(u[a-f\\d]{4}|x[a-f\\d]{2}|.))|(?:\\{(~)?(\\w+(?:\\([^)]*\\))?(?:\\.\\w+(?:\\([^)]*\\))?)*)(?:[ \\t]|(?=\\r?\\n)))|(\\})|((?:.|[\\r\\n\\f])+?)/gi;\nconst STYLE_REGEX = /(?:^|\\.)(\\w+)(?:\\(([^)]*)\\))?/g;\nconst STRING_REGEX = /^(['\"])((?:\\\\.|(?!\\1)[^\\\\])*)\\1$/;\nconst ESCAPE_REGEX = /\\\\(u[a-f\\d]{4}|x[a-f\\d]{2}|.)|([^\\\\])/gi;\n\nconst ESCAPES = new Map([\n\t['n', '\\n'],\n\t['r', '\\r'],\n\t['t', '\\t'],\n\t['b', '\\b'],\n\t['f', '\\f'],\n\t['v', '\\v'],\n\t['0', '\\0'],\n\t['\\\\', '\\\\'],\n\t['e', '\\u001B'],\n\t['a', '\\u0007']\n]);\n\nfunction unescape(c) {\n\tif ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) {\n\t\treturn String.fromCharCode(parseInt(c.slice(1), 16));\n\t}\n\n\treturn ESCAPES.get(c) || c;\n}\n\nfunction parseArguments(name, args) {\n\tconst results = [];\n\tconst chunks = args.trim().split(/\\s*,\\s*/g);\n\tlet matches;\n\n\tfor (const chunk of chunks) {\n\t\tif (!isNaN(chunk)) {\n\t\t\tresults.push(Number(chunk));\n\t\t} else if ((matches = chunk.match(STRING_REGEX))) {\n\t\t\tresults.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));\n\t\t} else {\n\t\t\tthrow new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);\n\t\t}\n\t}\n\n\treturn results;\n}\n\nfunction parseStyle(style) {\n\tSTYLE_REGEX.lastIndex = 0;\n\n\tconst results = [];\n\tlet matches;\n\n\twhile ((matches = STYLE_REGEX.exec(style)) !== null) {\n\t\tconst name = matches[1];\n\n\t\tif (matches[2]) {\n\t\t\tconst args = parseArguments(name, matches[2]);\n\t\t\tresults.push([name].concat(args));\n\t\t} else {\n\t\t\tresults.push([name]);\n\t\t}\n\t}\n\n\treturn results;\n}\n\nfunction buildStyle(chalk, styles) {\n\tconst enabled = {};\n\n\tfor (const layer of styles) {\n\t\tfor (const style of layer.styles) {\n\t\t\tenabled[style[0]] = layer.inverse ? null : style.slice(1);\n\t\t}\n\t}\n\n\tlet current = chalk;\n\tfor (const styleName of Object.keys(enabled)) {\n\t\tif (Array.isArray(enabled[styleName])) {\n\t\t\tif (!(styleName in current)) {\n\t\t\t\tthrow new Error(`Unknown Chalk style: ${styleName}`);\n\t\t\t}\n\n\t\t\tif (enabled[styleName].length > 0) {\n\t\t\t\tcurrent = current[styleName].apply(current, enabled[styleName]);\n\t\t\t} else {\n\t\t\t\tcurrent = current[styleName];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn current;\n}\n\nmodule.exports = (chalk, tmp) => {\n\tconst styles = [];\n\tconst chunks = [];\n\tlet chunk = [];\n\n\t// eslint-disable-next-line max-params\n\ttmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {\n\t\tif (escapeChar) {\n\t\t\tchunk.push(unescape(escapeChar));\n\t\t} else if (style) {\n\t\t\tconst str = chunk.join('');\n\t\t\tchunk = [];\n\t\t\tchunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));\n\t\t\tstyles.push({inverse, styles: parseStyle(style)});\n\t\t} else if (close) {\n\t\t\tif (styles.length === 0) {\n\t\t\t\tthrow new Error('Found extraneous } in Chalk template literal');\n\t\t\t}\n\n\t\t\tchunks.push(buildStyle(chalk, styles)(chunk.join('')));\n\t\t\tchunk = [];\n\t\t\tstyles.pop();\n\t\t} else {\n\t\t\tchunk.push(chr);\n\t\t}\n\t});\n\n\tchunks.push(chunk.join(''));\n\n\tif (styles.length > 0) {\n\t\tconst errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\\`}\\`)`;\n\t\tthrow new Error(errMsg);\n\t}\n\n\treturn chunks.join('');\n};\n", "'use strict';\nconst escapeStringRegexp = require('escape-string-regexp');\nconst ansiStyles = require('ansi-styles');\nconst stdoutColor = require('supports-color').stdout;\n\nconst template = require('./templates.js');\n\nconst isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');\n\n// `supportsColor.level` \u2192 `ansiStyles.color[name]` mapping\nconst levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];\n\n// `color-convert` models to exclude from the Chalk API due to conflicts and such\nconst skipModels = new Set(['gray']);\n\nconst styles = Object.create(null);\n\nfunction applyOptions(obj, options) {\n\toptions = options || {};\n\n\t// Detect level if not set manually\n\tconst scLevel = stdoutColor ? stdoutColor.level : 0;\n\tobj.level = options.level === undefined ? scLevel : options.level;\n\tobj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;\n}\n\nfunction Chalk(options) {\n\t// We check for this.template here since calling `chalk.constructor()`\n\t// by itself will have a `this` of a previously constructed chalk object\n\tif (!this || !(this instanceof Chalk) || this.template) {\n\t\tconst chalk = {};\n\t\tapplyOptions(chalk, options);\n\n\t\tchalk.template = function () {\n\t\t\tconst args = [].slice.call(arguments);\n\t\t\treturn chalkTag.apply(null, [chalk.template].concat(args));\n\t\t};\n\n\t\tObject.setPrototypeOf(chalk, Chalk.prototype);\n\t\tObject.setPrototypeOf(chalk.template, chalk);\n\n\t\tchalk.template.constructor = Chalk;\n\n\t\treturn chalk.template;\n\t}\n\n\tapplyOptions(this, options);\n}\n\n// Use bright blue on Windows as the normal blue color is illegible\nif (isSimpleWindowsTerm) {\n\tansiStyles.blue.open = '\\u001B[94m';\n}\n\nfor (const key of Object.keys(ansiStyles)) {\n\tansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');\n\n\tstyles[key] = {\n\t\tget() {\n\t\t\tconst codes = ansiStyles[key];\n\t\t\treturn build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);\n\t\t}\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\treturn build.call(this, this._styles || [], true, 'visible');\n\t}\n};\n\nansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');\nfor (const model of Object.keys(ansiStyles.color.ansi)) {\n\tif (skipModels.has(model)) {\n\t\tcontinue;\n\t}\n\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst level = this.level;\n\t\t\treturn function () {\n\t\t\t\tconst open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);\n\t\t\t\tconst codes = {\n\t\t\t\t\topen,\n\t\t\t\t\tclose: ansiStyles.color.close,\n\t\t\t\t\tcloseRe: ansiStyles.color.closeRe\n\t\t\t\t};\n\t\t\t\treturn build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);\n\t\t\t};\n\t\t}\n\t};\n}\n\nansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');\nfor (const model of Object.keys(ansiStyles.bgColor.ansi)) {\n\tif (skipModels.has(model)) {\n\t\tcontinue;\n\t}\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst level = this.level;\n\t\t\treturn function () {\n\t\t\t\tconst open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);\n\t\t\t\tconst codes = {\n\t\t\t\t\topen,\n\t\t\t\t\tclose: ansiStyles.bgColor.close,\n\t\t\t\t\tcloseRe: ansiStyles.bgColor.closeRe\n\t\t\t\t};\n\t\t\t\treturn build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);\n\t\t\t};\n\t\t}\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, styles);\n\nfunction build(_styles, _empty, key) {\n\tconst builder = function () {\n\t\treturn applyStyle.apply(builder, arguments);\n\t};\n\n\tbuilder._styles = _styles;\n\tbuilder._empty = _empty;\n\n\tconst self = this;\n\n\tObject.defineProperty(builder, 'level', {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn self.level;\n\t\t},\n\t\tset(level) {\n\t\t\tself.level = level;\n\t\t}\n\t});\n\n\tObject.defineProperty(builder, 'enabled', {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn self.enabled;\n\t\t},\n\t\tset(enabled) {\n\t\t\tself.enabled = enabled;\n\t\t}\n\t});\n\n\t// See below for fix regarding invisible grey/dim combination on Windows\n\tbuilder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';\n\n\t// `__proto__` is used because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tbuilder.__proto__ = proto; // eslint-disable-line no-proto\n\n\treturn builder;\n}\n\nfunction applyStyle() {\n\t// Support varags, but simply cast to string in case there's only one arg\n\tconst args = arguments;\n\tconst argsLen = args.length;\n\tlet str = String(arguments[0]);\n\n\tif (argsLen === 0) {\n\t\treturn '';\n\t}\n\n\tif (argsLen > 1) {\n\t\t// Don't slice `arguments`, it prevents V8 optimizations\n\t\tfor (let a = 1; a < argsLen; a++) {\n\t\t\tstr += ' ' + args[a];\n\t\t}\n\t}\n\n\tif (!this.enabled || this.level <= 0 || !str) {\n\t\treturn this._empty ? '' : str;\n\t}\n\n\t// Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,\n\t// see https://github.com/chalk/chalk/issues/58\n\t// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.\n\tconst originalDim = ansiStyles.dim.open;\n\tif (isSimpleWindowsTerm && this.hasGrey) {\n\t\tansiStyles.dim.open = '';\n\t}\n\n\tfor (const code of this._styles.slice().reverse()) {\n\t\t// Replace any instances already present with a re-opening code\n\t\t// otherwise only the part of the string until said closing code\n\t\t// will be colored, and the rest will simply be 'plain'.\n\t\tstr = code.open + str.replace(code.closeRe, code.open) + code.close;\n\n\t\t// Close the styling before a linebreak and reopen\n\t\t// after next line to fix a bleed issue on macOS\n\t\t// https://github.com/chalk/chalk/pull/92\n\t\tstr = str.replace(/\\r?\\n/g, `${code.close}$&${code.open}`);\n\t}\n\n\t// Reset the original `dim` if we changed it to work around the Windows dimmed gray issue\n\tansiStyles.dim.open = originalDim;\n\n\treturn str;\n}\n\nfunction chalkTag(chalk, strings) {\n\tif (!Array.isArray(strings)) {\n\t\t// If chalk() was called by itself or with a string,\n\t\t// return the string itself as a string.\n\t\treturn [].slice.call(arguments, 1).join(' ');\n\t}\n\n\tconst args = [].slice.call(arguments, 2);\n\tconst parts = [strings.raw[0]];\n\n\tfor (let i = 1; i < strings.length; i++) {\n\t\tparts.push(String(args[i - 1]).replace(/[{}\\\\]/g, '\\\\$&'));\n\t\tparts.push(String(strings.raw[i]));\n\t}\n\n\treturn template(chalk, parts.join(''));\n}\n\nObject.defineProperties(Chalk.prototype, styles);\n\nmodule.exports = Chalk(); // eslint-disable-line new-cap\nmodule.exports.supportsColor = stdoutColor;\nmodule.exports.default = module.exports; // For TypeScript\n", "class Node {\n\t/// value;\n\t/// next;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\n\t\t// TODO: Remove this when targeting Node.js 12.\n\t\tthis.next = undefined;\n\t}\n}\n\nclass Queue {\n\t// TODO: Use private class fields when targeting Node.js 12.\n\t// #_head;\n\t// #_tail;\n\t// #_size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this._head) {\n\t\t\tthis._tail.next = node;\n\t\t\tthis._tail = node;\n\t\t} else {\n\t\t\tthis._head = node;\n\t\t\tthis._tail = node;\n\t\t}\n\n\t\tthis._size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this._head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._head = this._head.next;\n\t\tthis._size--;\n\t\treturn current.value;\n\t}\n\n\tclear() {\n\t\tthis._head = undefined;\n\t\tthis._tail = undefined;\n\t\tthis._size = 0;\n\t}\n\n\tget size() {\n\t\treturn this._size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this._head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n}\n\nmodule.exports = Queue;\n", "'use strict';\nconst Queue = require('yocto-queue');\n\nconst pLimit = concurrency => {\n\tif (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst next = () => {\n\t\tactiveCount--;\n\n\t\tif (queue.size > 0) {\n\t\t\tqueue.dequeue()();\n\t\t}\n\t};\n\n\tconst run = async (fn, resolve, ...args) => {\n\t\tactiveCount++;\n\n\t\tconst result = (async () => fn(...args))();\n\n\t\tresolve(result);\n\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\tnext();\n\t};\n\n\tconst enqueue = (fn, resolve, ...args) => {\n\t\tqueue.enqueue(run.bind(null, fn, resolve, ...args));\n\n\t\t(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// when the run function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve();\n\n\t\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\t\tqueue.dequeue()();\n\t\t\t}\n\t\t})();\n\t};\n\n\tconst generator = (fn, ...args) => new Promise(resolve => {\n\t\tenqueue(fn, resolve, ...args);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue: () => {\n\t\t\t\tqueue.clear();\n\t\t\t}\n\t\t}\n\t});\n\n\treturn generator;\n};\n\nmodule.exports = pLimit;\n", "'use strict';\nconst pLimit = require('p-limit');\n\nclass EndError extends Error {\n\tconstructor(value) {\n\t\tsuper();\n\t\tthis.value = value;\n\t}\n}\n\n// The input can also be a promise, so we await it\nconst testElement = async (element, tester) => tester(await element);\n\n// The input can also be a promise, so we `Promise.all()` them both\nconst finder = async element => {\n\tconst values = await Promise.all(element);\n\tif (values[1] === true) {\n\t\tthrow new EndError(values[0]);\n\t}\n\n\treturn false;\n};\n\nconst pLocate = async (iterable, tester, options) => {\n\toptions = {\n\t\tconcurrency: Infinity,\n\t\tpreserveOrder: true,\n\t\t...options\n\t};\n\n\tconst limit = pLimit(options.concurrency);\n\n\t// Start all the promises concurrently with optional limit\n\tconst items = [...iterable].map(element => [element, limit(testElement, element, tester)]);\n\n\t// Check the promises either serially or concurrently\n\tconst checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);\n\n\ttry {\n\t\tawait Promise.all(items.map(element => checkLimit(finder, element)));\n\t} catch (error) {\n\t\tif (error instanceof EndError) {\n\t\t\treturn error.value;\n\t\t}\n\n\t\tthrow error;\n\t}\n};\n\nmodule.exports = pLocate;\n", "'use strict';\nconst path = require('path');\nconst fs = require('fs');\nconst {promisify} = require('util');\nconst pLocate = require('p-locate');\n\nconst fsStat = promisify(fs.stat);\nconst fsLStat = promisify(fs.lstat);\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile'\n};\n\nfunction checkType({type}) {\n\tif (type in typeMappings) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => type === undefined || stat[typeMappings[type]]();\n\nmodule.exports = async (paths, options) => {\n\toptions = {\n\t\tcwd: process.cwd(),\n\t\ttype: 'file',\n\t\tallowSymlinks: true,\n\t\t...options\n\t};\n\n\tcheckType(options);\n\n\tconst statFn = options.allowSymlinks ? fsStat : fsLStat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFn(path.resolve(options.cwd, path_));\n\t\t\treturn matchType(options.type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, options);\n};\n\nmodule.exports.sync = (paths, options) => {\n\toptions = {\n\t\tcwd: process.cwd(),\n\t\tallowSymlinks: true,\n\t\ttype: 'file',\n\t\t...options\n\t};\n\n\tcheckType(options);\n\n\tconst statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFn(path.resolve(options.cwd, path_));\n\n\t\t\tif (matchType(options.type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n};\n", "'use strict';\nconst fs = require('fs');\nconst {promisify} = require('util');\n\nconst pAccess = promisify(fs.access);\n\nmodule.exports = async path => {\n\ttry {\n\t\tawait pAccess(path);\n\t\treturn true;\n\t} catch (_) {\n\t\treturn false;\n\t}\n};\n\nmodule.exports.sync = path => {\n\ttry {\n\t\tfs.accessSync(path);\n\t\treturn true;\n\t} catch (_) {\n\t\treturn false;\n\t}\n};\n", "'use strict';\nconst path = require('path');\nconst locatePath = require('locate-path');\nconst pathExists = require('path-exists');\n\nconst stop = Symbol('findUp.stop');\n\nmodule.exports = async (name, options = {}) => {\n\tlet directory = path.resolve(options.cwd || '');\n\tconst {root} = path.parse(directory);\n\tconst paths = [].concat(name);\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === stop) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\treturn path.resolve(directory, foundPath);\n\t\t}\n\n\t\tif (directory === root) {\n\t\t\treturn;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n};\n\nmodule.exports.sync = (name, options = {}) => {\n\tlet directory = path.resolve(options.cwd || '');\n\tconst {root} = path.parse(directory);\n\tconst paths = [].concat(name);\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath.sync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath.sync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === stop) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\treturn path.resolve(directory, foundPath);\n\t\t}\n\n\t\tif (directory === root) {\n\t\t\treturn;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n};\n\nmodule.exports.exists = pathExists;\n\nmodule.exports.sync.exists = pathExists.sync;\n\nmodule.exports.stop = stop;\n", "'use strict';\nconst path = require('path');\nconst findUp = require('find-up');\n\nconst pkgDir = async cwd => {\n\tconst filePath = await findUp('package.json', {cwd});\n\treturn filePath && path.dirname(filePath);\n};\n\nmodule.exports = pkgDir;\n\nmodule.exports.sync = cwd => {\n\tconst filePath = findUp.sync('package.json', {cwd});\n\treturn filePath && path.dirname(filePath);\n};\n", "'use strict';\n\nconst { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = process.env;\n\nconst $ = {\n\tenabled: !NODE_DISABLE_COLORS && TERM !== 'dumb' && FORCE_COLOR !== '0',\n\n\t// modifiers\n\treset: init(0, 0),\n\tbold: init(1, 22),\n\tdim: init(2, 22),\n\titalic: init(3, 23),\n\tunderline: init(4, 24),\n\tinverse: init(7, 27),\n\thidden: init(8, 28),\n\tstrikethrough: init(9, 29),\n\n\t// colors\n\tblack: init(30, 39),\n\tred: init(31, 39),\n\tgreen: init(32, 39),\n\tyellow: init(33, 39),\n\tblue: init(34, 39),\n\tmagenta: init(35, 39),\n\tcyan: init(36, 39),\n\twhite: init(37, 39),\n\tgray: init(90, 39),\n\tgrey: init(90, 39),\n\n\t// background colors\n\tbgBlack: init(40, 49),\n\tbgRed: init(41, 49),\n\tbgGreen: init(42, 49),\n\tbgYellow: init(43, 49),\n\tbgBlue: init(44, 49),\n\tbgMagenta: init(45, 49),\n\tbgCyan: init(46, 49),\n\tbgWhite: init(47, 49)\n};\n\nfunction run(arr, str) {\n\tlet i=0, tmp, beg='', end='';\n\tfor (; i < arr.length; i++) {\n\t\ttmp = arr[i];\n\t\tbeg += tmp.open;\n\t\tend += tmp.close;\n\t\tif (str.includes(tmp.close)) {\n\t\t\tstr = str.replace(tmp.rgx, tmp.close + tmp.open);\n\t\t}\n\t}\n\treturn beg + str + end;\n}\n\nfunction chain(has, keys) {\n\tlet ctx = { has, keys };\n\n\tctx.reset = $.reset.bind(ctx);\n\tctx.bold = $.bold.bind(ctx);\n\tctx.dim = $.dim.bind(ctx);\n\tctx.italic = $.italic.bind(ctx);\n\tctx.underline = $.underline.bind(ctx);\n\tctx.inverse = $.inverse.bind(ctx);\n\tctx.hidden = $.hidden.bind(ctx);\n\tctx.strikethrough = $.strikethrough.bind(ctx);\n\n\tctx.black = $.black.bind(ctx);\n\tctx.red = $.red.bind(ctx);\n\tctx.green = $.green.bind(ctx);\n\tctx.yellow = $.yellow.bind(ctx);\n\tctx.blue = $.blue.bind(ctx);\n\tctx.magenta = $.magenta.bind(ctx);\n\tctx.cyan = $.cyan.bind(ctx);\n\tctx.white = $.white.bind(ctx);\n\tctx.gray = $.gray.bind(ctx);\n\tctx.grey = $.grey.bind(ctx);\n\n\tctx.bgBlack = $.bgBlack.bind(ctx);\n\tctx.bgRed = $.bgRed.bind(ctx);\n\tctx.bgGreen = $.bgGreen.bind(ctx);\n\tctx.bgYellow = $.bgYellow.bind(ctx);\n\tctx.bgBlue = $.bgBlue.bind(ctx);\n\tctx.bgMagenta = $.bgMagenta.bind(ctx);\n\tctx.bgCyan = $.bgCyan.bind(ctx);\n\tctx.bgWhite = $.bgWhite.bind(ctx);\n\n\treturn ctx;\n}\n\nfunction init(open, close) {\n\tlet blk = {\n\t\topen: `\\x1b[${open}m`,\n\t\tclose: `\\x1b[${close}m`,\n\t\trgx: new RegExp(`\\\\x1b\\\\[${close}m`, 'g')\n\t};\n\treturn function (txt) {\n\t\tif (this !== void 0 && this.has !== void 0) {\n\t\t\tthis.has.includes(open) || (this.has.push(open),this.keys.push(blk));\n\t\t\treturn txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+'';\n\t\t}\n\t\treturn txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';\n\t};\n}\n\nmodule.exports = $;\n", "/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return{$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}\nfunction N(a,b){return{$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\\/+/g;function Q(a,b){return\"object\"===typeof a&&null!==a&&null!=a.key?escape(\"\"+a.key):b.toString(36)}\nfunction R(a,b,e,d,c){var k=typeof a;if(\"undefined\"===k||\"boolean\"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case \"string\":case \"number\":h=!0;break;case \"object\":switch(a.$$typeof){case l:case n:h=!0}}if(h)return h=a,c=c(h),a=\"\"===d?\".\"+Q(h,0):d,I(c)?(e=\"\",null!=a&&(e=a.replace(P,\"$&/\")+\"/\"),R(c,b,e,\"\",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?\"\":(\"\"+c.key).replace(P,\"$&/\")+\"/\")+a)),b.push(c)),1;h=0;d=\"\"===d?\".\":d+\":\";if(I(a))for(var g=0;g<a.length;g++){k=\na[g];var f=d+Q(k,g);h+=R(k,b,e,f,c)}else if(f=A(a),\"function\"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if(\"object\"===k)throw b=String(a),Error(\"Objects are not valid as a React child (found: \"+(\"[object Object]\"===b?\"object with keys {\"+Object.keys(a).join(\", \")+\"}\":b)+\"). If you meant to render a collection of children, use an array instead.\");return h}\nfunction S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,\"\",\"\",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}\nvar U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};exports.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;S(a,function(){b++});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error(\"React.Children.only expected to receive a single React element child.\");return a}};exports.Component=E;exports.Fragment=p;\nexports.Profiler=r;exports.PureComponent=G;exports.StrictMode=q;exports.Suspense=w;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;\nexports.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+a+\".\");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=\"\"+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);\nfor(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g}return{$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};exports.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};\nexports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=O;exports.lazy=function(a){return{$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:x,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=V.transition;V.transition={};try{a()}finally{V.transition=b}};exports.unstable_act=function(){throw Error(\"act(...) is not supported in production builds of React.\");};\nexports.useCallback=function(a,b){return U.current.useCallback(a,b)};exports.useContext=function(a){return U.current.useContext(a)};exports.useDebugValue=function(){};exports.useDeferredValue=function(a){return U.current.useDeferredValue(a)};exports.useEffect=function(a,b){return U.current.useEffect(a,b)};exports.useId=function(){return U.current.useId()};exports.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};\nexports.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};exports.useMemo=function(a,b){return U.current.useMemo(a,b)};exports.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};exports.useRef=function(a){return U.current.useRef(a)};exports.useState=function(a){return U.current.useState(a)};exports.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};\nexports.useTransition=function(){return U.current.useTransition()};exports.version=\"18.2.0\";\n", "/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var ReactVersion = '18.2.0';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\n/**\n * Keeps track of the current dispatcher.\n */\nvar ReactCurrentDispatcher = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\n/**\n * Keeps track of the current batch's configuration such as how long an update\n * should suspend for if it needs to.\n */\nvar ReactCurrentBatchConfig = {\n transition: null\n};\n\nvar ReactCurrentActQueue = {\n current: null,\n // Used to reproduce behavior of `batchedUpdates` in legacy mode.\n isBatchingLegacy: false,\n didScheduleLegacyUpdate: false\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\nvar ReactDebugCurrentFrame = {};\nvar currentExtraStackFrame = null;\nfunction setExtraStackFrame(stack) {\n {\n currentExtraStackFrame = stack;\n }\n}\n\n{\n ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {\n {\n currentExtraStackFrame = stack;\n }\n }; // Stack implementation injected by the current renderer.\n\n\n ReactDebugCurrentFrame.getCurrentStack = null;\n\n ReactDebugCurrentFrame.getStackAddendum = function () {\n var stack = ''; // Add an extra top frame while an element is being validated\n\n if (currentExtraStackFrame) {\n stack += currentExtraStackFrame;\n } // Delegate to the injected renderer-specific implementation\n\n\n var impl = ReactDebugCurrentFrame.getCurrentStack;\n\n if (impl) {\n stack += impl() || '';\n }\n\n return stack;\n };\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar ReactSharedInternals = {\n ReactCurrentDispatcher: ReactCurrentDispatcher,\n ReactCurrentBatchConfig: ReactCurrentBatchConfig,\n ReactCurrentOwner: ReactCurrentOwner\n};\n\n{\n ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;\n ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;\n}\n\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\n\nfunction warn(format) {\n {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }\n}\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = {};\n\nfunction warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';\n var warningKey = componentName + \".\" + callerName;\n\n if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\n return;\n }\n\n error(\"Can't call %s on a component that is not yet mounted. \" + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);\n\n didWarnStateUpdateForUnmountedComponent[warningKey] = true;\n }\n}\n/**\n * This is the abstract API for an update queue.\n */\n\n\nvar ReactNoopUpdateQueue = {\n /**\n * Checks whether or not this composite component is mounted.\n * @param {ReactClass} publicInstance The instance we want to test.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function (publicInstance) {\n return false;\n },\n\n /**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueForceUpdate: function (publicInstance, callback, callerName) {\n warnNoop(publicInstance, 'forceUpdate');\n },\n\n /**\n * Replaces all of the state. Always use this or `setState` to mutate state.\n * You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} completeState Next state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\n warnNoop(publicInstance, 'replaceState');\n },\n\n /**\n * Sets a subset of the state. This only exists because _pendingState is\n * internal. This provides a merging strategy that is not available to deep\n * properties which is confusing. TODO: Expose pendingState or don't use it\n * during the merge.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} partialState Next partial state to be merged with state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} Name of the calling function in the public API.\n * @internal\n */\n enqueueSetState: function (publicInstance, partialState, callback, callerName) {\n warnNoop(publicInstance, 'setState');\n }\n};\n\nvar assign = Object.assign;\n\nvar emptyObject = {};\n\n{\n Object.freeze(emptyObject);\n}\n/**\n * Base class helpers for the updating state of a component.\n */\n\n\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\n // renderer.\n\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nComponent.prototype.isReactComponent = {};\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together. You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n * produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\n\nComponent.prototype.setState = function (partialState, callback) {\n if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {\n throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');\n }\n\n this.updater.enqueueSetState(this, partialState, callback, 'setState');\n};\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\n\n\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\n};\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\n\n\n{\n var deprecatedAPIs = {\n isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n };\n\n var defineDeprecationWarning = function (methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\n\n return undefined;\n }\n });\n };\n\n for (var fnName in deprecatedAPIs) {\n if (deprecatedAPIs.hasOwnProperty(fnName)) {\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n }\n }\n}\n\nfunction ComponentDummy() {}\n\nComponentDummy.prototype = Component.prototype;\n/**\n * Convenience component with default shallow equality check for sCU.\n */\n\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\npureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.\n\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = true;\n\n// an immutable object with a single mutable value\nfunction createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n var warnAboutAccessingKey = function () {\n {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n var warnAboutAccessingRef = function () {\n {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * Create and return a new ReactElement of the given type.\n * See https://reactjs.org/docs/react-api.html#createelement\n */\n\nfunction createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}\n/**\n * Clone and return a new ReactElement using element as the starting point.\n * See https://reactjs.org/docs/react-api.html#cloneelement\n */\n\nfunction cloneElement(element, config, children) {\n if (element === null || element === undefined) {\n throw new Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n\n var propName; // Original props are copied\n\n var props = assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nvar SEPARATOR = '.';\nvar SUBSEPARATOR = ':';\n/**\n * Escape and wrap key so it is safe to use as a reactid\n *\n * @param {string} key to be escaped.\n * @return {string} the escaped key.\n */\n\nfunction escape(key) {\n var escapeRegex = /[=:]/g;\n var escaperLookup = {\n '=': '=0',\n ':': '=2'\n };\n var escapedString = key.replace(escapeRegex, function (match) {\n return escaperLookup[match];\n });\n return '$' + escapedString;\n}\n/**\n * TODO: Test that a single child and an array with one item have the same key\n * pattern.\n */\n\n\nvar didWarnAboutMaps = false;\nvar userProvidedKeyEscapeRegex = /\\/+/g;\n\nfunction escapeUserProvidedKey(text) {\n return text.replace(userProvidedKeyEscapeRegex, '$&/');\n}\n/**\n * Generate a key string that identifies a element within a set.\n *\n * @param {*} element A element that could contain a manual key.\n * @param {number} index Index that is used if a manual key is not provided.\n * @return {string}\n */\n\n\nfunction getElementKey(element, index) {\n // Do some typechecking here since we call this blindly. We want to ensure\n // that we don't block potential future ES APIs.\n if (typeof element === 'object' && element !== null && element.key != null) {\n // Explicit key\n {\n checkKeyStringCoercion(element.key);\n }\n\n return escape('' + element.key);\n } // Implicit key determined by the index in the set\n\n\n return index.toString(36);\n}\n\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n\n if (type === 'undefined' || type === 'boolean') {\n // All of the above are perceived as null.\n children = null;\n }\n\n var invokeCallback = false;\n\n if (children === null) {\n invokeCallback = true;\n } else {\n switch (type) {\n case 'string':\n case 'number':\n invokeCallback = true;\n break;\n\n case 'object':\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = true;\n }\n\n }\n }\n\n if (invokeCallback) {\n var _child = children;\n var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array\n // so that it's consistent if the number of children grows:\n\n var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;\n\n if (isArray(mappedChild)) {\n var escapedChildKey = '';\n\n if (childKey != null) {\n escapedChildKey = escapeUserProvidedKey(childKey) + '/';\n }\n\n mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {\n return c;\n });\n } else if (mappedChild != null) {\n if (isValidElement(mappedChild)) {\n {\n // The `if` statement here prevents auto-disabling of the safe\n // coercion ESLint rule, so we must manually disable it below.\n // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {\n checkKeyStringCoercion(mappedChild.key);\n }\n }\n\n mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as\n // traverseAllChildren used to do for objects as children\n escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number\n // eslint-disable-next-line react-internal/safe-string-coercion\n escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);\n }\n\n array.push(mappedChild);\n }\n\n return 1;\n }\n\n var child;\n var nextName;\n var subtreeCount = 0; // Count of children found in the current subtree.\n\n var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n nextName = nextNamePrefix + getElementKey(child, i);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n var iterableChildren = children;\n\n {\n // Warn about using Maps as children\n if (iteratorFn === iterableChildren.entries) {\n if (!didWarnAboutMaps) {\n warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n }\n }\n\n var iterator = iteratorFn.call(iterableChildren);\n var step;\n var ii = 0;\n\n while (!(step = iterator.next()).done) {\n child = step.value;\n nextName = nextNamePrefix + getElementKey(child, ii++);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else if (type === 'object') {\n // eslint-disable-next-line react-internal/safe-string-coercion\n var childrenString = String(children);\n throw new Error(\"Objects are not valid as a React child (found: \" + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + \"). \" + 'If you meant to render a collection of children, use an array ' + 'instead.');\n }\n }\n\n return subtreeCount;\n}\n\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenmap\n *\n * The provided mapFunction(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\nfunction mapChildren(children, func, context) {\n if (children == null) {\n return children;\n }\n\n var result = [];\n var count = 0;\n mapIntoArray(children, result, '', '', function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrencount\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\n\n\nfunction countChildren(children) {\n var n = 0;\n mapChildren(children, function () {\n n++; // Don't return anything\n });\n return n;\n}\n\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenforeach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n mapChildren(children, function () {\n forEachFunc.apply(this, arguments); // Don't return anything.\n }, forEachContext);\n}\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrentoarray\n */\n\n\nfunction toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenonly\n *\n * The current implementation of this function assumes that a single child gets\n * passed without a wrapper, but the purpose of this helper function is to\n * abstract away the particular structure of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactElement} The first and only `ReactElement` contained in the\n * structure.\n */\n\n\nfunction onlyChild(children) {\n if (!isValidElement(children)) {\n throw new Error('React.Children.only expected to receive a single React element child.');\n }\n\n return children;\n}\n\nfunction createContext(defaultValue) {\n // TODO: Second argument used to be an optional `calculateChangedBits`\n // function. Warn to reserve for future use?\n var context = {\n $$typeof: REACT_CONTEXT_TYPE,\n // As a workaround to support multiple concurrent renderers, we categorize\n // some renderers as primary and others as secondary. We only expect\n // there to be two concurrent renderers at most: React Native (primary) and\n // Fabric (secondary); React DOM (primary) and React ART (secondary).\n // Secondary renderers store their context values on separate fields.\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n // Used to track how many concurrent renderers this context currently\n // supports within in a single renderer. Such as parallel server rendering.\n _threadCount: 0,\n // These are circular\n Provider: null,\n Consumer: null,\n // Add these to use same hidden class in VM as ServerContext\n _defaultValue: null,\n _globalName: null\n };\n context.Provider = {\n $$typeof: REACT_PROVIDER_TYPE,\n _context: context\n };\n var hasWarnedAboutUsingNestedContextConsumers = false;\n var hasWarnedAboutUsingConsumerProvider = false;\n var hasWarnedAboutDisplayNameOnConsumer = false;\n\n {\n // A separate object, but proxies back to the original context object for\n // backwards compatibility. It has a different $$typeof, so we can properly\n // warn for the incorrect usage of Context as a Consumer.\n var Consumer = {\n $$typeof: REACT_CONTEXT_TYPE,\n _context: context\n }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here\n\n Object.defineProperties(Consumer, {\n Provider: {\n get: function () {\n if (!hasWarnedAboutUsingConsumerProvider) {\n hasWarnedAboutUsingConsumerProvider = true;\n\n error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');\n }\n\n return context.Provider;\n },\n set: function (_Provider) {\n context.Provider = _Provider;\n }\n },\n _currentValue: {\n get: function () {\n return context._currentValue;\n },\n set: function (_currentValue) {\n context._currentValue = _currentValue;\n }\n },\n _currentValue2: {\n get: function () {\n return context._currentValue2;\n },\n set: function (_currentValue2) {\n context._currentValue2 = _currentValue2;\n }\n },\n _threadCount: {\n get: function () {\n return context._threadCount;\n },\n set: function (_threadCount) {\n context._threadCount = _threadCount;\n }\n },\n Consumer: {\n get: function () {\n if (!hasWarnedAboutUsingNestedContextConsumers) {\n hasWarnedAboutUsingNestedContextConsumers = true;\n\n error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n }\n\n return context.Consumer;\n }\n },\n displayName: {\n get: function () {\n return context.displayName;\n },\n set: function (displayName) {\n if (!hasWarnedAboutDisplayNameOnConsumer) {\n warn('Setting `displayName` on Context.Consumer has no effect. ' + \"You should set it directly on the context with Context.displayName = '%s'.\", displayName);\n\n hasWarnedAboutDisplayNameOnConsumer = true;\n }\n }\n }\n }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty\n\n context.Consumer = Consumer;\n }\n\n {\n context._currentRenderer = null;\n context._currentRenderer2 = null;\n }\n\n return context;\n}\n\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\n\nfunction lazyInitializer(payload) {\n if (payload._status === Uninitialized) {\n var ctor = payload._result;\n var thenable = ctor(); // Transition to the next state.\n // This might throw either because it's missing or throws. If so, we treat it\n // as still uninitialized and try again next time. Which is the same as what\n // happens if the ctor or any wrappers processing the ctor throws. This might\n // end up fixing it if the resolution was a concurrency bug.\n\n thenable.then(function (moduleObject) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var resolved = payload;\n resolved._status = Resolved;\n resolved._result = moduleObject;\n }\n }, function (error) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var rejected = payload;\n rejected._status = Rejected;\n rejected._result = error;\n }\n });\n\n if (payload._status === Uninitialized) {\n // In case, we're still uninitialized, then we're waiting for the thenable\n // to resolve. Set it as pending in the meantime.\n var pending = payload;\n pending._status = Pending;\n pending._result = thenable;\n }\n }\n\n if (payload._status === Resolved) {\n var moduleObject = payload._result;\n\n {\n if (moduleObject === undefined) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\\n\\n\" + 'Did you accidentally put curly braces around the import?', moduleObject);\n }\n }\n\n {\n if (!('default' in moduleObject)) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\", moduleObject);\n }\n }\n\n return moduleObject.default;\n } else {\n throw payload._result;\n }\n}\n\nfunction lazy(ctor) {\n var payload = {\n // We use these fields to store the result.\n _status: Uninitialized,\n _result: ctor\n };\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _payload: payload,\n _init: lazyInitializer\n };\n\n {\n // In production, this would just set it on the object.\n var defaultProps;\n var propTypes; // $FlowFixMe\n\n Object.defineProperties(lazyType, {\n defaultProps: {\n configurable: true,\n get: function () {\n return defaultProps;\n },\n set: function (newDefaultProps) {\n error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n defaultProps = newDefaultProps; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'defaultProps', {\n enumerable: true\n });\n }\n },\n propTypes: {\n configurable: true,\n get: function () {\n return propTypes;\n },\n set: function (newPropTypes) {\n error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n propTypes = newPropTypes; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'propTypes', {\n enumerable: true\n });\n }\n }\n });\n }\n\n return lazyType;\n}\n\nfunction forwardRef(render) {\n {\n if (render != null && render.$$typeof === REACT_MEMO_TYPE) {\n error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');\n } else if (typeof render !== 'function') {\n error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);\n } else {\n if (render.length !== 0 && render.length !== 2) {\n error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');\n }\n }\n\n if (render != null) {\n if (render.defaultProps != null || render.propTypes != null) {\n error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');\n }\n }\n }\n\n var elementType = {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: render\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.forwardRef((props, ref) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!render.name && !render.displayName) {\n render.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction memo(type, compare) {\n {\n if (!isValidElementType(type)) {\n error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);\n }\n }\n\n var elementType = {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: compare === undefined ? null : compare\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.memo((props) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!type.name && !type.displayName) {\n type.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nfunction resolveDispatcher() {\n var dispatcher = ReactCurrentDispatcher.current;\n\n {\n if (dispatcher === null) {\n error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\\n' + '2. You might be breaking the Rules of Hooks\\n' + '3. You might have more than one copy of React in the same app\\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');\n }\n } // Will result in a null access error if accessed outside render phase. We\n // intentionally don't throw our own error because this is in a hot path.\n // Also helps ensure this is inlined.\n\n\n return dispatcher;\n}\nfunction useContext(Context) {\n var dispatcher = resolveDispatcher();\n\n {\n // TODO: add a more generic warning for invalid values.\n if (Context._context !== undefined) {\n var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs\n // and nobody should be using this in existing code.\n\n if (realContext.Consumer === Context) {\n error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');\n } else if (realContext.Provider === Context) {\n error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');\n }\n }\n }\n\n return dispatcher.useContext(Context);\n}\nfunction useState(initialState) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useState(initialState);\n}\nfunction useReducer(reducer, initialArg, init) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useReducer(reducer, initialArg, init);\n}\nfunction useRef(initialValue) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useRef(initialValue);\n}\nfunction useEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useEffect(create, deps);\n}\nfunction useInsertionEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useInsertionEffect(create, deps);\n}\nfunction useLayoutEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useLayoutEffect(create, deps);\n}\nfunction useCallback(callback, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useCallback(callback, deps);\n}\nfunction useMemo(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useMemo(create, deps);\n}\nfunction useImperativeHandle(ref, create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useImperativeHandle(ref, create, deps);\n}\nfunction useDebugValue(value, formatterFn) {\n {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDebugValue(value, formatterFn);\n }\n}\nfunction useTransition() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useTransition();\n}\nfunction useDeferredValue(value) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDeferredValue(value);\n}\nfunction useId() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useId();\n}\nfunction useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher$1.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher$1.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n setExtraStackFrame(stack);\n } else {\n setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n if (ReactCurrentOwner.current) {\n var name = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendumForProps(elementProps) {\n if (elementProps !== null && elementProps !== undefined) {\n return getSourceInfoErrorAddendum(elementProps.__source);\n }\n\n return '';\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n {\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\nfunction createElementWithValidation(type, props, children) {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendumForProps(props);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n {\n error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n }\n\n var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], type);\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n}\nvar didWarnAboutDeprecatedCreateFactory = false;\nfunction createFactoryWithValidation(type) {\n var validatedFactory = createElementWithValidation.bind(null, type);\n validatedFactory.type = type;\n\n {\n if (!didWarnAboutDeprecatedCreateFactory) {\n didWarnAboutDeprecatedCreateFactory = true;\n\n warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');\n } // Legacy hook: remove it\n\n\n Object.defineProperty(validatedFactory, 'type', {\n enumerable: false,\n get: function () {\n warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');\n\n Object.defineProperty(this, 'type', {\n value: type\n });\n return type;\n }\n });\n }\n\n return validatedFactory;\n}\nfunction cloneElementWithValidation(element, props, children) {\n var newElement = cloneElement.apply(this, arguments);\n\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], newElement.type);\n }\n\n validatePropTypes(newElement);\n return newElement;\n}\n\nfunction startTransition(scope, options) {\n var prevTransition = ReactCurrentBatchConfig.transition;\n ReactCurrentBatchConfig.transition = {};\n var currentTransition = ReactCurrentBatchConfig.transition;\n\n {\n ReactCurrentBatchConfig.transition._updatedFibers = new Set();\n }\n\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.transition = prevTransition;\n\n {\n if (prevTransition === null && currentTransition._updatedFibers) {\n var updatedFibersCount = currentTransition._updatedFibers.size;\n\n if (updatedFibersCount > 10) {\n warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');\n }\n\n currentTransition._updatedFibers.clear();\n }\n }\n }\n}\n\nvar didWarnAboutMessageChannel = false;\nvar enqueueTaskImpl = null;\nfunction enqueueTask(task) {\n if (enqueueTaskImpl === null) {\n try {\n // read require off the module object to get around the bundlers.\n // we don't want them to detect a require and bundle a Node polyfill.\n var requireString = ('require' + Math.random()).slice(0, 7);\n var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's\n // version of setImmediate, bypassing fake timers if any.\n\n enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;\n } catch (_err) {\n // we're in a browser\n // we can't use regular timers because they may still be faked\n // so we try MessageChannel+postMessage instead\n enqueueTaskImpl = function (callback) {\n {\n if (didWarnAboutMessageChannel === false) {\n didWarnAboutMessageChannel = true;\n\n if (typeof MessageChannel === 'undefined') {\n error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');\n }\n }\n }\n\n var channel = new MessageChannel();\n channel.port1.onmessage = callback;\n channel.port2.postMessage(undefined);\n };\n }\n }\n\n return enqueueTaskImpl(task);\n}\n\nvar actScopeDepth = 0;\nvar didWarnNoAwaitAct = false;\nfunction act(callback) {\n {\n // `act` calls can be nested, so we track the depth. This represents the\n // number of `act` scopes on the stack.\n var prevActScopeDepth = actScopeDepth;\n actScopeDepth++;\n\n if (ReactCurrentActQueue.current === null) {\n // This is the outermost `act` scope. Initialize the queue. The reconciler\n // will detect the queue and use it instead of Scheduler.\n ReactCurrentActQueue.current = [];\n }\n\n var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;\n var result;\n\n try {\n // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only\n // set to `true` while the given callback is executed, not for updates\n // triggered during an async event, because this is how the legacy\n // implementation of `act` behaved.\n ReactCurrentActQueue.isBatchingLegacy = true;\n result = callback(); // Replicate behavior of original `act` implementation in legacy mode,\n // which flushed updates immediately after the scope function exits, even\n // if it's an async function.\n\n if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n ReactCurrentActQueue.didScheduleLegacyUpdate = false;\n flushActQueue(queue);\n }\n }\n } catch (error) {\n popActScope(prevActScopeDepth);\n throw error;\n } finally {\n ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;\n }\n\n if (result !== null && typeof result === 'object' && typeof result.then === 'function') {\n var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait\n // for it to resolve before exiting the current scope.\n\n var wasAwaited = false;\n var thenable = {\n then: function (resolve, reject) {\n wasAwaited = true;\n thenableResult.then(function (returnValue) {\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // We've exited the outermost act scope. Recursively flush the\n // queue until there's no remaining work.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }, function (error) {\n // The callback threw an error.\n popActScope(prevActScopeDepth);\n reject(error);\n });\n }\n };\n\n {\n if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {\n // eslint-disable-next-line no-undef\n Promise.resolve().then(function () {}).then(function () {\n if (!wasAwaited) {\n didWarnNoAwaitAct = true;\n\n error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');\n }\n });\n }\n }\n\n return thenable;\n } else {\n var returnValue = result; // The callback is not an async function. Exit the current scope\n // immediately, without awaiting.\n\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // Exiting the outermost act scope. Flush the queue.\n var _queue = ReactCurrentActQueue.current;\n\n if (_queue !== null) {\n flushActQueue(_queue);\n ReactCurrentActQueue.current = null;\n } // Return a thenable. If the user awaits it, we'll flush again in\n // case additional work was scheduled by a microtask.\n\n\n var _thenable = {\n then: function (resolve, reject) {\n // Confirm we haven't re-entered another `act` scope, in case\n // the user does something weird like await the thenable\n // multiple times.\n if (ReactCurrentActQueue.current === null) {\n // Recursively flush the queue until there's no remaining work.\n ReactCurrentActQueue.current = [];\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }\n };\n return _thenable;\n } else {\n // Since we're inside a nested `act` scope, the returned thenable\n // immediately resolves. The outer scope will flush the queue.\n var _thenable2 = {\n then: function (resolve, reject) {\n resolve(returnValue);\n }\n };\n return _thenable2;\n }\n }\n }\n}\n\nfunction popActScope(prevActScopeDepth) {\n {\n if (prevActScopeDepth !== actScopeDepth - 1) {\n error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');\n }\n\n actScopeDepth = prevActScopeDepth;\n }\n}\n\nfunction recursivelyFlushAsyncActWork(returnValue, resolve, reject) {\n {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n try {\n flushActQueue(queue);\n enqueueTask(function () {\n if (queue.length === 0) {\n // No additional work was scheduled. Finish.\n ReactCurrentActQueue.current = null;\n resolve(returnValue);\n } else {\n // Keep flushing work until there's none left.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n }\n });\n } catch (error) {\n reject(error);\n }\n } else {\n resolve(returnValue);\n }\n }\n}\n\nvar isFlushing = false;\n\nfunction flushActQueue(queue) {\n {\n if (!isFlushing) {\n // Prevent re-entrance.\n isFlushing = true;\n var i = 0;\n\n try {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n\n do {\n callback = callback(true);\n } while (callback !== null);\n }\n\n queue.length = 0;\n } catch (error) {\n // If something throws, leave the remaining callbacks on the queue.\n queue = queue.slice(i + 1);\n throw error;\n } finally {\n isFlushing = false;\n }\n }\n }\n}\n\nvar createElement$1 = createElementWithValidation ;\nvar cloneElement$1 = cloneElementWithValidation ;\nvar createFactory = createFactoryWithValidation ;\nvar Children = {\n map: mapChildren,\n forEach: forEachChildren,\n count: countChildren,\n toArray: toArray,\n only: onlyChild\n};\n\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;\nexports.cloneElement = cloneElement$1;\nexports.createContext = createContext;\nexports.createElement = createElement$1;\nexports.createFactory = createFactory;\nexports.createRef = createRef;\nexports.forwardRef = forwardRef;\nexports.isValidElement = isValidElement;\nexports.lazy = lazy;\nexports.memo = memo;\nexports.startTransition = startTransition;\nexports.unstable_act = act;\nexports.useCallback = useCallback;\nexports.useContext = useContext;\nexports.useDebugValue = useDebugValue;\nexports.useDeferredValue = useDeferredValue;\nexports.useEffect = useEffect;\nexports.useId = useId;\nexports.useImperativeHandle = useImperativeHandle;\nexports.useInsertionEffect = useInsertionEffect;\nexports.useLayoutEffect = useLayoutEffect;\nexports.useMemo = useMemo;\nexports.useReducer = useReducer;\nexports.useRef = useRef;\nexports.useState = useState;\nexports.useSyncExternalStore = useSyncExternalStore;\nexports.useTransition = useTransition;\nexports.version = ReactVersion;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.min.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.isUndefined = exports.fixName = exports.validateName = exports.validateSingleChar = exports.fixChar = exports.validateChar = void 0;\r\n/**\r\n * Returns true if the specified string only contains characters permitted by\r\n * the XML specification.\r\n */\r\nfunction validateChar(str) {\r\n for (var i = 0; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD)) {\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n return false;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n i++;\r\n continue;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}\r\nexports.validateChar = validateChar;\r\n/**\r\n * Returns a version of the specified string that only contains characters\r\n * permitted by the XML specification, with invalid characters replaced\r\n * by the replacement character U+FFFD.\r\n */\r\nfunction fixChar(str) {\r\n var newStr = \"\";\r\n for (var i = 0; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD)) {\r\n newStr += str[i];\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n newStr += \"\\uFFFD\";\r\n return newStr;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n newStr += str[i] + str[i + 1];\r\n i++;\r\n continue;\r\n }\r\n newStr += \"\\uFFFD\";\r\n }\r\n return newStr;\r\n}\r\nexports.fixChar = fixChar;\r\n/**\r\n * Returns true if the specified string only contains a single character, and\r\n * that this character is permitted by the XML specification.\r\n */\r\nfunction validateSingleChar(str) {\r\n if (str.length === 0) {\r\n return false;\r\n }\r\n var firstChar = str.charCodeAt(0);\r\n if (str.length === 1) {\r\n return (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD));\r\n }\r\n if (str.length !== 2) {\r\n return false;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(1);\r\n return ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF));\r\n}\r\nexports.validateSingleChar = validateSingleChar;\r\n/**\r\n * Returns true if the specified string only contains characters permitted by\r\n * the XML specification for names.\r\n */\r\nfunction validateName(str) {\r\n if (str.length === 0) {\r\n return false;\r\n }\r\n var initialFirstChar = str.charCodeAt(0);\r\n var initialFirstCharMatch = (initialFirstChar === 0x3A\r\n || initialFirstChar === 0x5F\r\n || (initialFirstChar >= 0x41 && initialFirstChar <= 0x5A)\r\n || (initialFirstChar >= 0x61 && initialFirstChar <= 0x7A)\r\n || (initialFirstChar >= 0xC0 && initialFirstChar <= 0xD6)\r\n || (initialFirstChar >= 0xD8 && initialFirstChar <= 0xF6)\r\n || (initialFirstChar >= 0XF8 && initialFirstChar <= 0X2FF)\r\n || (initialFirstChar >= 0x370 && initialFirstChar <= 0x37D)\r\n || (initialFirstChar >= 0x37F && initialFirstChar <= 0X1FFF)\r\n || (initialFirstChar >= 0x200C && initialFirstChar <= 0x200D)\r\n || (initialFirstChar >= 0x2070 && initialFirstChar <= 0x218F)\r\n || (initialFirstChar >= 0x2C00 && initialFirstChar <= 0x2FEF)\r\n || (initialFirstChar >= 0x3001 && initialFirstChar <= 0xD7FF)\r\n || (initialFirstChar >= 0xF900 && initialFirstChar <= 0xFDCF)\r\n || (initialFirstChar >= 0xFDF0 && initialFirstChar <= 0xFFFD));\r\n if (str.length === 1) {\r\n return initialFirstCharMatch;\r\n }\r\n // UTF-16 surrogate characters\r\n var initialSecondChar = str.charCodeAt(1);\r\n var initialSecondCharMatch = ((initialFirstChar >= 0xD800 && initialFirstChar <= 0xDB7F)\r\n && (initialSecondChar >= 0xDC00 && initialSecondChar <= 0xDFFF));\r\n if (!initialFirstCharMatch && !initialSecondCharMatch) {\r\n return false;\r\n }\r\n var start = initialSecondCharMatch ? 2 : 1;\r\n for (var i = start; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x3A\r\n || firstChar === 0x5F\r\n || firstChar === 0x2D\r\n || firstChar === 0x2E\r\n || firstChar === 0xB7\r\n || (firstChar >= 0x30 && firstChar <= 0x39)\r\n || (firstChar >= 0x41 && firstChar <= 0x5A)\r\n || (firstChar >= 0x61 && firstChar <= 0x7A)\r\n || (firstChar >= 0xC0 && firstChar <= 0xD6)\r\n || (firstChar >= 0xD8 && firstChar <= 0xF6)\r\n || (firstChar >= 0XF8 && firstChar <= 0X2FF)\r\n || (firstChar >= 0x300 && firstChar <= 0x36F)\r\n || (firstChar >= 0x370 && firstChar <= 0x37D)\r\n || (firstChar >= 0x37F && firstChar <= 0X1FFF)\r\n || (firstChar >= 0x200C && firstChar <= 0x200D)\r\n || (firstChar >= 0x203F && firstChar <= 0x2040)\r\n || (firstChar >= 0x2070 && firstChar <= 0x218F)\r\n || (firstChar >= 0x2C00 && firstChar <= 0x2FEF)\r\n || (firstChar >= 0x3001 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xF900 && firstChar <= 0xFDCF)\r\n || (firstChar >= 0xFDF0 && firstChar <= 0xFFFD)) {\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n return false;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDB7F)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n i++;\r\n continue;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}\r\nexports.validateName = validateName;\r\n/**\r\n * Returns a version of the specified string that only contains characters\r\n * permitted by the XML specification for names, with invalid characters\r\n * replaced by the replacement character U+FFFD.\r\n */\r\nfunction fixName(str) {\r\n var newStr = \"\";\r\n if (str.length === 0) {\r\n return newStr;\r\n }\r\n var initialFirstChar = str.charCodeAt(0);\r\n var initialFirstCharMatch = (initialFirstChar === 0x3A\r\n || initialFirstChar === 0x5F\r\n || (initialFirstChar >= 0x41 && initialFirstChar <= 0x5A)\r\n || (initialFirstChar >= 0x61 && initialFirstChar <= 0x7A)\r\n || (initialFirstChar >= 0xC0 && initialFirstChar <= 0xD6)\r\n || (initialFirstChar >= 0xD8 && initialFirstChar <= 0xF6)\r\n || (initialFirstChar >= 0XF8 && initialFirstChar <= 0X2FF)\r\n || (initialFirstChar >= 0x370 && initialFirstChar <= 0x37D)\r\n || (initialFirstChar >= 0x37F && initialFirstChar <= 0X1FFF)\r\n || (initialFirstChar >= 0x200C && initialFirstChar <= 0x200D)\r\n || (initialFirstChar >= 0x2070 && initialFirstChar <= 0x218F)\r\n || (initialFirstChar >= 0x2C00 && initialFirstChar <= 0x2FEF)\r\n || (initialFirstChar >= 0x3001 && initialFirstChar <= 0xD7FF)\r\n || (initialFirstChar >= 0xF900 && initialFirstChar <= 0xFDCF)\r\n || (initialFirstChar >= 0xFDF0 && initialFirstChar <= 0xFFFD));\r\n if (str.length === 1) {\r\n if (initialFirstCharMatch) {\r\n newStr = str[0];\r\n }\r\n else {\r\n newStr = \"\\uFFFD\";\r\n }\r\n return newStr;\r\n }\r\n // UTF-16 surrogate characters\r\n var initialSecondChar = str.charCodeAt(1);\r\n var initialSecondCharMatch = ((initialFirstChar >= 0xD800 && initialFirstChar <= 0xDB7F)\r\n && (initialSecondChar >= 0xDC00 && initialSecondChar <= 0xDFFF));\r\n if (initialSecondCharMatch) {\r\n newStr = str[0] + str[1];\r\n }\r\n else if (initialFirstCharMatch) {\r\n newStr = str[0];\r\n }\r\n else {\r\n newStr = \"\\uFFFD\";\r\n }\r\n var start = initialSecondCharMatch ? 2 : 1;\r\n for (var i = start; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x3A\r\n || firstChar === 0x5F\r\n || firstChar === 0x2D\r\n || firstChar === 0x2E\r\n || firstChar === 0xB7\r\n || (firstChar >= 0x30 && firstChar <= 0x39)\r\n || (firstChar >= 0x41 && firstChar <= 0x5A)\r\n || (firstChar >= 0x61 && firstChar <= 0x7A)\r\n || (firstChar >= 0xC0 && firstChar <= 0xD6)\r\n || (firstChar >= 0xD8 && firstChar <= 0xF6)\r\n || (firstChar >= 0XF8 && firstChar <= 0X2FF)\r\n || (firstChar >= 0x300 && firstChar <= 0x36F)\r\n || (firstChar >= 0x370 && firstChar <= 0x37D)\r\n || (firstChar >= 0x37F && firstChar <= 0X1FFF)\r\n || (firstChar >= 0x200C && firstChar <= 0x200D)\r\n || (firstChar >= 0x203F && firstChar <= 0x2040)\r\n || (firstChar >= 0x2070 && firstChar <= 0x218F)\r\n || (firstChar >= 0x2C00 && firstChar <= 0x2FEF)\r\n || (firstChar >= 0x3001 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xF900 && firstChar <= 0xFDCF)\r\n || (firstChar >= 0xFDF0 && firstChar <= 0xFFFD)) {\r\n newStr += str[i];\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n newStr += \"\\uFFFD\";\r\n return newStr;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDB7F)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n newStr += str[i] + str[i + 1];\r\n i++;\r\n continue;\r\n }\r\n newStr += \"\\uFFFD\";\r\n }\r\n return newStr;\r\n}\r\nexports.fixName = fixName;\r\n/**\r\n * Returns true if the specified value is undefined.\r\n */\r\nfunction isUndefined(val) {\r\n return Object.prototype.toString.call(val) === \"[object Undefined]\";\r\n}\r\nexports.isUndefined = isUndefined;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StringOptions = void 0;\r\nvar validate_1 = require(\"./validate\");\r\n/**\r\n * Implementation of the IStringOptions interface used to provide default\r\n * values to fields.\r\n */\r\nvar StringOptions = /** @class */ (function () {\r\n function StringOptions(options) {\r\n this.doubleQuotes = false;\r\n this.indent = \" \";\r\n this.newline = \"\\n\";\r\n this.pretty = true;\r\n if (!(0, validate_1.isUndefined)(options.doubleQuotes)) {\r\n this.doubleQuotes = options.doubleQuotes;\r\n }\r\n if (!(0, validate_1.isUndefined)(options.indent)) {\r\n this.indent = options.indent;\r\n }\r\n if (!(0, validate_1.isUndefined)(options.newline)) {\r\n this.newline = options.newline;\r\n }\r\n if (!(0, validate_1.isUndefined)(options.pretty)) {\r\n this.pretty = options.pretty;\r\n }\r\n }\r\n return StringOptions;\r\n}());\r\nexports.StringOptions = StringOptions;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2018 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.escapeDoubleQuotes = exports.escapeSingleQuotes = exports.escapeRightAngleBracketsInCdataTerminator = exports.escapeLeftAngleBrackets = exports.escapeAmpersands = void 0;\r\n/**\r\n * Replaces ampersands (&) with the appropriate XML character reference.\r\n */\r\nfunction escapeAmpersands(str) {\r\n return str.replace(/&/g, \"&amp;\");\r\n}\r\nexports.escapeAmpersands = escapeAmpersands;\r\n/**\r\n * Replaces left angle brackets (&lt;) with the appropriate XML character\r\n * reference.\r\n */\r\nfunction escapeLeftAngleBrackets(str) {\r\n return str.replace(/</g, \"&lt;\");\r\n}\r\nexports.escapeLeftAngleBrackets = escapeLeftAngleBrackets;\r\n/**\r\n * Replaces right angle brackets (&gt;) with the appropriate XML character\r\n * reference when part of the string \"]]>\".\r\n */\r\nfunction escapeRightAngleBracketsInCdataTerminator(str) {\r\n return str.replace(/]]>/g, \"]]&gt;\");\r\n}\r\nexports.escapeRightAngleBracketsInCdataTerminator = escapeRightAngleBracketsInCdataTerminator;\r\n/**\r\n * Replaces single quotes (\") with the appropriate XML character reference.\r\n */\r\nfunction escapeSingleQuotes(str) {\r\n return str.replace(/'/g, \"&apos;\");\r\n}\r\nexports.escapeSingleQuotes = escapeSingleQuotes;\r\n/**\r\n * Replaces double quotes (\") with the appropriate XML character reference.\r\n */\r\nfunction escapeDoubleQuotes(str) {\r\n return str.replace(/\"/g, \"&quot;\");\r\n}\r\nexports.escapeDoubleQuotes = escapeDoubleQuotes;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar escape_1 = require(\"../escape\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents text in an attribute value.\r\n *\r\n * Restricted characters, such as the ampersand (`&`) and the opening angle\r\n * bracket (`<`), are all automatically escaped.\r\n */\r\nvar XmlAttributeText = /** @class */ (function () {\r\n function XmlAttributeText(parent, validation, options) {\r\n this._validation = validation;\r\n if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInCharData)) {\r\n this._replaceInvalidCharsInCharData = (options.replaceInvalidCharsInCharData);\r\n }\r\n else {\r\n this._replaceInvalidCharsInCharData = false;\r\n }\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlAttributeText.prototype, \"charData\", {\r\n /**\r\n * Gets this attribute text.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets this attribute text.\r\n */\r\n set: function (charData) {\r\n if (this._replaceInvalidCharsInCharData) {\r\n charData = (0, validate_1.fixChar)(charData);\r\n }\r\n else if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": attribute text\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain characters not\")\r\n + \" allowed in XML\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this attribute text.\r\n */\r\n XmlAttributeText.prototype.toString = function () {\r\n var str = this._charData;\r\n str = (0, escape_1.escapeAmpersands)(str);\r\n str = (0, escape_1.escapeLeftAngleBrackets)(str);\r\n return str;\r\n };\r\n /**\r\n * Returns the parent of this attribute text.\r\n */\r\n XmlAttributeText.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlAttributeText;\r\n}());\r\nexports.default = XmlAttributeText;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a character reference.\r\n *\r\n * A character reference is structured as follows, where `{dec}` is the\r\n * decimal representation code point corresponding to a particular Unicode\r\n * character:\r\n *\r\n * ```xml\r\n * &#{dec};\r\n * ```\r\n *\r\n * The corresponding hexadecimal version is structured as follows, where\r\n * `{hex}` is the hexadecimal representation code point corresponding to a\r\n * particular Unicode character:\r\n *\r\n * ```xml\r\n * &#x{hex};\r\n * ```\r\n *\r\n * Unicode characters outside of the Basic Multilingual Plane are represented\r\n * using a surrogate pair consisting of two character references.\r\n *\r\n * The `{dec}` and `{hex}` values are defined by the `char` and `hex`\r\n * properties of this node; the former is the character to be represented while\r\n * the latter indicates whether the decimal or hexadecimal representation\r\n * should be used.\r\n */\r\nvar XmlCharRef = /** @class */ (function () {\r\n function XmlCharRef(parent, validation, options) {\r\n this._hex = false;\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.char = options.char;\r\n if (!(0, validate_1.isUndefined)(options.hex)) {\r\n this.hex = options.hex;\r\n }\r\n }\r\n Object.defineProperty(XmlCharRef.prototype, \"char\", {\r\n /**\r\n * Gets the character of this character reference.\r\n */\r\n get: function () {\r\n return this._char;\r\n },\r\n /**\r\n * Sets the character of this character reference.\r\n */\r\n set: function (char) {\r\n if (this._validation && !(0, validate_1.validateSingleChar)(char)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": character reference\"\r\n + (\" \\\"\" + char + \"\\\" should reference a single character,\")\r\n + \" and this character should be allowed in XML\");\r\n }\r\n this._char = char;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(XmlCharRef.prototype, \"hex\", {\r\n /**\r\n * Gets whether the decimal or hexadecimal representation should be used\r\n * for this character reference.\r\n */\r\n get: function () {\r\n return this._hex;\r\n },\r\n /**\r\n * Sets whether the decimal or hexadecimal representation should be used\r\n * for this character reference.\r\n */\r\n set: function (hex) {\r\n this._hex = hex;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this character reference.\r\n */\r\n XmlCharRef.prototype.toString = function () {\r\n var char;\r\n if (this._char.length === 1) {\r\n char = this._char.charCodeAt(0);\r\n }\r\n else {\r\n var first = this._char.charCodeAt(0);\r\n if (first >= 0xD800 && first <= 0xDBFF && this._char.length > 1) {\r\n var second = this._char.charCodeAt(1);\r\n if (second >= 0xDC00 && second <= 0xDFFF) {\r\n char = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\r\n }\r\n else {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": character\"\r\n + (\" reference \\\"\" + this.char + \"\\\" should\")\r\n + \" reference a valid Unicode character\");\r\n }\r\n }\r\n else {\r\n char = first;\r\n }\r\n }\r\n if (this._hex) {\r\n return \"&#x\" + char.toString(16) + \";\";\r\n }\r\n else {\r\n return \"&#\" + char + \";\";\r\n }\r\n };\r\n /**\r\n * Returns the parent of this character reference.\r\n */\r\n XmlCharRef.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlCharRef;\r\n}());\r\nexports.default = XmlCharRef;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents an entity reference.\r\n *\r\n * An entity reference is structured as follows, where `{name}` is the name of\r\n * the entity to be referenced:\r\n *\r\n * ```xml\r\n * &{entity};\r\n * ```\r\n */\r\nvar XmlEntityRef = /** @class */ (function () {\r\n function XmlEntityRef(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.name = options.name;\r\n }\r\n Object.defineProperty(XmlEntityRef.prototype, \"name\", {\r\n /**\r\n * Gets the name of this entity reference.\r\n */\r\n get: function () {\r\n return this._name;\r\n },\r\n /**\r\n * Sets the name of this entity reference.\r\n */\r\n set: function (name) {\r\n if (this._validation && !(0, validate_1.validateName)(name)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": entity reference name\"\r\n + (\" \\\"\" + name + \"\\\" should not contain characters not\")\r\n + \" allowed in XML names\");\r\n }\r\n this._name = name;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this entity reference.\r\n */\r\n XmlEntityRef.prototype.toString = function () {\r\n return \"&\" + this._name + \";\";\r\n };\r\n /**\r\n * Returns the parent of this entity reference.\r\n */\r\n XmlEntityRef.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlEntityRef;\r\n}());\r\nexports.default = XmlEntityRef;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar escape_1 = require(\"../escape\");\r\nvar options_1 = require(\"../options\");\r\nvar validate_1 = require(\"../validate\");\r\nvar XmlAttributeText_1 = __importDefault(require(\"./XmlAttributeText\"));\r\nvar XmlCharRef_1 = __importDefault(require(\"./XmlCharRef\"));\r\nvar XmlEntityRef_1 = __importDefault(require(\"./XmlEntityRef\"));\r\n/**\r\n * Represents an attribute.\r\n *\r\n * An attribute is part of the start tag of an element and is\r\n * structured as follows, where `{name}` is the name of the attribute and\r\n * `{value}` is the value of the attribute:\r\n *\r\n * ```xml\r\n * <element {name}=\"{value}\">\r\n * ```\r\n *\r\n * The `{name}` value is a property of this node, while the `{value}` property\r\n * consists of the children of this node.\r\n *\r\n * Attributes can have an unlimited number of attribute text, character\r\n * references, and entity references.\r\n */\r\nvar XmlAttribute = /** @class */ (function () {\r\n function XmlAttribute(parent, validation, options) {\r\n this._validation = validation;\r\n if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInName)) {\r\n this._replaceInvalidCharsInName = options.replaceInvalidCharsInName;\r\n }\r\n else {\r\n this._replaceInvalidCharsInName = false;\r\n }\r\n this._children = [];\r\n this._parent = parent;\r\n this.name = options.name;\r\n }\r\n Object.defineProperty(XmlAttribute.prototype, \"name\", {\r\n /**\r\n * Gets the name of this attribute.\r\n */\r\n get: function () {\r\n return this._name;\r\n },\r\n /**\r\n * Sets the name of this attribute.\r\n */\r\n set: function (name) {\r\n if (this._replaceInvalidCharsInName) {\r\n name = (0, validate_1.fixName)(name);\r\n if (name.length === 0) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": attribute name\"\r\n + \" should not be empty\");\r\n }\r\n }\r\n else if (this._validation && !(0, validate_1.validateName)(name)) {\r\n if (name.length === 0) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": attribute name\"\r\n + \" should not be empty\");\r\n }\r\n else {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": attribute name\"\r\n + (\" \\\"\" + name + \"\\\" should not contain characters not\")\r\n + \" allowed in XML names\");\r\n }\r\n }\r\n this._name = name;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Adds a character reference to this attribute and returns the new\r\n * character reference.\r\n */\r\n XmlAttribute.prototype.charRef = function (options) {\r\n var charRef = new XmlCharRef_1.default(this, this._validation, options);\r\n this._children.push(charRef);\r\n return charRef;\r\n };\r\n /**\r\n * Adds an entity reference to this attribute and returns the new entity\r\n * reference.\r\n */\r\n XmlAttribute.prototype.entityRef = function (options) {\r\n var charRef = new XmlEntityRef_1.default(this, this._validation, options);\r\n this._children.push(charRef);\r\n return charRef;\r\n };\r\n /**\r\n * Adds attribute text to this attribute and returns the new text.\r\n */\r\n XmlAttribute.prototype.text = function (options) {\r\n var textNode = new XmlAttributeText_1.default(this, this._validation, options);\r\n this._children.push(textNode);\r\n return textNode;\r\n };\r\n /**\r\n * Returns an XML string representation of this attribute.\r\n */\r\n XmlAttribute.prototype.toString = function (options) {\r\n if (options === void 0) { options = {}; }\r\n var optionsObj = new options_1.StringOptions(options);\r\n var quote = optionsObj.doubleQuotes ? \"\\\"\" : \"'\";\r\n var str = this._name + \"=\" + quote;\r\n for (var _i = 0, _a = this._children; _i < _a.length; _i++) {\r\n var child = _a[_i];\r\n if (optionsObj.doubleQuotes) {\r\n str += (0, escape_1.escapeDoubleQuotes)(child.toString());\r\n }\r\n else {\r\n str += (0, escape_1.escapeSingleQuotes)(child.toString());\r\n }\r\n }\r\n str += quote;\r\n return str;\r\n };\r\n /**\r\n * Returns the parent of this attribute.\r\n */\r\n XmlAttribute.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlAttribute;\r\n}());\r\nexports.default = XmlAttribute;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents an attribute-list declaration in a document type definition.\r\n *\r\n * An attribute-list declaration is structured as follows, where `{text}`\r\n * is the text of the declaration:\r\n *\r\n * ```xml\r\n * <!ATTLIST {text}>\r\n * ```\r\n */\r\nvar XmlDtdAttlist = /** @class */ (function () {\r\n function XmlDtdAttlist(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlDtdAttlist.prototype, \"charData\", {\r\n /**\r\n * Gets the text of this entity declaration.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the text of this entity declaration.\r\n */\r\n set: function (charData) {\r\n if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": attribute-list\"\r\n + (\" declaration \\\"\" + charData + \"\\\" should not contain\")\r\n + \" characters not allowed in XML\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this entity declaration.\r\n */\r\n XmlDtdAttlist.prototype.toString = function () {\r\n return \"<!ATTLIST \" + this._charData + \">\";\r\n };\r\n /**\r\n * Returns the parent of this entity declaration.\r\n */\r\n XmlDtdAttlist.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlDtdAttlist;\r\n}());\r\nexports.default = XmlDtdAttlist;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents an element declaration in a document type definition.\r\n *\r\n * An element declaration is structured as follows, where `{text}` is the\r\n * text of the declaration:\r\n *\r\n * ```xml\r\n * <!ELEMENT {text}>\r\n * ```\r\n */\r\nvar XmlDtdElement = /** @class */ (function () {\r\n function XmlDtdElement(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlDtdElement.prototype, \"charData\", {\r\n /**\r\n * Gets the text of this element declaration.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the text of this element declaration.\r\n */\r\n set: function (charData) {\r\n if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": element declaration\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain characters\")\r\n + \" not allowed in XML\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this element declaration.\r\n */\r\n XmlDtdElement.prototype.toString = function () {\r\n return \"<!ELEMENT \" + this._charData + \">\";\r\n };\r\n /**\r\n * Returns the parent of this element declaration.\r\n */\r\n XmlDtdElement.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlDtdElement;\r\n}());\r\nexports.default = XmlDtdElement;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents an entity declaration in a document type definition.\r\n *\r\n * An entity declaration is structured as follows, where `{text}` is the\r\n * text of the declaration:\r\n *\r\n * ```xml\r\n * <!ENTITY {text}>\r\n * ```\r\n */\r\nvar XmlDtdEntity = /** @class */ (function () {\r\n function XmlDtdEntity(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlDtdEntity.prototype, \"charData\", {\r\n /**\r\n * Gets the text of this entity declaration.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the text of this entity declaration.\r\n */\r\n set: function (charData) {\r\n if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": entity declaration\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain characters\")\r\n + \" not allowed in XML\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this entity declaration.\r\n */\r\n XmlDtdEntity.prototype.toString = function () {\r\n return \"<!ENTITY \" + this._charData + \">\";\r\n };\r\n /**\r\n * Returns the parent of this entity declaration.\r\n */\r\n XmlDtdEntity.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlDtdEntity;\r\n}());\r\nexports.default = XmlDtdEntity;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a notation declaration in a document type definition.\r\n *\r\n * A notation declaration is structured as follows, where `{text}` is the\r\n * text of the declaration:\r\n *\r\n * ```xml\r\n * <!NOTATION {text}>\r\n * ```\r\n */\r\nvar XmlDtdNotation = /** @class */ (function () {\r\n function XmlDtdNotation(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlDtdNotation.prototype, \"charData\", {\r\n /**\r\n * Gets the text of this notation declaration.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the text of this notation declaration.\r\n */\r\n set: function (charData) {\r\n if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": notation declaration\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain characters\")\r\n + \" not allowed in XML\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this notation declaration.\r\n */\r\n XmlDtdNotation.prototype.toString = function () {\r\n return \"<!NOTATION \" + this._charData + \">\";\r\n };\r\n /**\r\n * Returns the parent of this notation declaration.\r\n */\r\n XmlDtdNotation.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlDtdNotation;\r\n}());\r\nexports.default = XmlDtdNotation;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a parameter entity reference in a document type definition.\r\n *\r\n * A parameter entity reference is structured as follows, where `{entity}`\r\n * is the name of the entity:\r\n *\r\n * ```xml\r\n * %{entity};\r\n * ```\r\n */\r\nvar XmlDtdParamEntityRef = /** @class */ (function () {\r\n function XmlDtdParamEntityRef(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.name = options.name;\r\n }\r\n Object.defineProperty(XmlDtdParamEntityRef.prototype, \"name\", {\r\n /**\r\n * Gets the name of this parameter entity reference.\r\n */\r\n get: function () {\r\n return this._name;\r\n },\r\n /**\r\n * Sets the name of this parameter entity reference.\r\n */\r\n set: function (name) {\r\n if (this._validation && !(0, validate_1.validateName)(name)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": parameter entity\"\r\n + (\" reference name \\\"\" + name + \"\\\" should not contain\")\r\n + \" characters not allowed in XML names\");\r\n }\r\n this._name = name;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this parameter entity reference.\r\n */\r\n XmlDtdParamEntityRef.prototype.toString = function () {\r\n return \"%\" + this._name + \";\";\r\n };\r\n /**\r\n * Returns the parent of this parameter entity reference.\r\n */\r\n XmlDtdParamEntityRef.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlDtdParamEntityRef;\r\n}());\r\nexports.default = XmlDtdParamEntityRef;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a processing instruction.\r\n *\r\n * A processing instruction is structured as follows, where `{target}` and\r\n * `{content}` are the target and content of the processing instruction\r\n * respectively:\r\n *\r\n * ```xml\r\n * <?{target} {content}?>\r\n * ```\r\n */\r\nvar XmlProcInst = /** @class */ (function () {\r\n function XmlProcInst(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.content = options.content;\r\n this.target = options.target;\r\n }\r\n Object.defineProperty(XmlProcInst.prototype, \"content\", {\r\n /**\r\n * Gets the content of this processing instruction.\r\n */\r\n get: function () {\r\n return this._content;\r\n },\r\n /**\r\n * Sets the content of this processing instruction.\r\n */\r\n set: function (content) {\r\n if (!(0, validate_1.isUndefined)(content)) {\r\n if (this._validation && !(0, validate_1.validateChar)(content)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": processing\"\r\n + (\" instruction content \\\"\" + content + \"\\\" should\")\r\n + \" not contain characters not allowed in XML\");\r\n }\r\n else if (this._validation && content.indexOf(\"?>\") !== -1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": processing\"\r\n + (\" instruction content \\\"\" + content + \"\\\" should\")\r\n + \" not contain the string '?>'\");\r\n }\r\n }\r\n this._content = content;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(XmlProcInst.prototype, \"target\", {\r\n /**\r\n * Gets the target of this processing instruction.\r\n */\r\n get: function () {\r\n return this._target;\r\n },\r\n /**\r\n * Sets the content of this processing instruction.\r\n */\r\n set: function (target) {\r\n if (this._validation && !(0, validate_1.validateName)(target)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": processing\"\r\n + (\" instruction target \\\"\" + target + \"\\\" should\")\r\n + \" not contain characters not allowed in XML\"\r\n + \" names\");\r\n }\r\n if (this._validation && target === \"xml\") {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": processing\"\r\n + (\" instruction target \\\"\" + target + \"\\\" should\")\r\n + \" not be the string 'xml'\");\r\n }\r\n this._target = target;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this processing instruction.\r\n */\r\n XmlProcInst.prototype.toString = function () {\r\n if ((0, validate_1.isUndefined)(this._content)) {\r\n return \"<?\" + this._target + \"?>\";\r\n }\r\n else {\r\n return \"<?\" + this._target + \" \" + this._content + \"?>\";\r\n }\r\n };\r\n /**\r\n * Returns the parent of this processing instruction.\r\n */\r\n XmlProcInst.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlProcInst;\r\n}());\r\nexports.default = XmlProcInst;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.validatePubId = void 0;\r\nvar error_1 = require(\"../error\");\r\nvar options_1 = require(\"../options\");\r\nvar validate_1 = require(\"../validate\");\r\nvar XmlComment_1 = __importDefault(require(\"./XmlComment\"));\r\nvar XmlDtdAttlist_1 = __importDefault(require(\"./XmlDtdAttlist\"));\r\nvar XmlDtdElement_1 = __importDefault(require(\"./XmlDtdElement\"));\r\nvar XmlDtdEntity_1 = __importDefault(require(\"./XmlDtdEntity\"));\r\nvar XmlDtdNotation_1 = __importDefault(require(\"./XmlDtdNotation\"));\r\nvar XmlDtdParamEntityRef_1 = __importDefault(require(\"./XmlDtdParamEntityRef\"));\r\nvar XmlProcInst_1 = __importDefault(require(\"./XmlProcInst\"));\r\n/**\r\n * Represents an XML document type definition (DTD).\r\n *\r\n * A document type definition is structured as follows, where `{name}` is\r\n * the name of the DTD, `{sysId}` is the system identifier of the DTD,\r\n * `{pubId}` is the public identifier of the DTD, and `{intSubset}` is the\r\n * internal subset of the DTD:\r\n *\r\n * ```xml\r\n * <!DOCTYPE {name} SYSTEM \"{sysId}\" PUBLIC \"{pubId}\" [\r\n * {intSubset}\r\n * ]>\r\n * ```\r\n *\r\n * DTDs can have an unlimited number of comments, attribute-list declarations,\r\n * element declarations, entity declarations, notation declarations, parameter\r\n * entity references, and processing instructions.\r\n */\r\nvar XmlDtd = /** @class */ (function () {\r\n function XmlDtd(parent, validation, options) {\r\n this._pubId = undefined;\r\n this._sysId = undefined;\r\n this._validation = validation;\r\n this._children = [];\r\n this._parent = parent;\r\n this.name = options.name;\r\n if (!(0, validate_1.isUndefined)(options.sysId)) {\r\n this.sysId = options.sysId;\r\n }\r\n if (!(0, validate_1.isUndefined)(options.pubId)) {\r\n this.pubId = options.pubId;\r\n }\r\n }\r\n Object.defineProperty(XmlDtd.prototype, \"name\", {\r\n /**\r\n * Gets the name of the DTD.\r\n */\r\n get: function () {\r\n return this._name;\r\n },\r\n /**\r\n * Sets the name of the DTD.\r\n */\r\n set: function (name) {\r\n if (this._validation && !(0, validate_1.validateName)(name)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": DTD name \\\"\" + name + \"\\\"\"\r\n + \" should not contain characters not allowed in\"\r\n + \" XML names\");\r\n }\r\n this._name = name;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(XmlDtd.prototype, \"pubId\", {\r\n /**\r\n * Gets the public identifier of the DTD.\r\n */\r\n get: function () {\r\n return this._pubId;\r\n },\r\n /**\r\n * Sets the public identifier of the DTD.\r\n */\r\n set: function (pubId) {\r\n if (!(0, validate_1.isUndefined)(pubId)) {\r\n if (this._validation && !validatePubId(pubId)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": DTD public\"\r\n + (\" identifier \\\"\" + pubId + \"\\\" should not contain\")\r\n + \" characters not allowed in public\"\r\n + \" identifiers\");\r\n }\r\n if (this._validation && (0, validate_1.isUndefined)(this._sysId)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": DTD public\"\r\n + (\" identifier \\\"\" + pubId + \"\\\" should not be defined\")\r\n + \" if system identifier is undefined\");\r\n }\r\n }\r\n this._pubId = pubId;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(XmlDtd.prototype, \"sysId\", {\r\n /**\r\n * Gets the system identifier of the DTD.\r\n */\r\n get: function () {\r\n return this._sysId;\r\n },\r\n /**\r\n * Sets the system identifier of the DTD.\r\n */\r\n set: function (sysId) {\r\n if (!(0, validate_1.isUndefined)(sysId)) {\r\n if (this._validation && !(0, validate_1.validateChar)(sysId)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": DTD system\"\r\n + (\" identifier \\\"\" + sysId + \"\\\" should not contain\")\r\n + \" characters not allowed in XML\");\r\n }\r\n else if (this._validation\r\n && sysId.indexOf(\"'\") !== -1\r\n && sysId.indexOf(\"\\\"\") !== -1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": DTD system\"\r\n + (\" identifier \\\"\" + sysId + \"\\\" should not contain\")\r\n + \" both single quotes and double quotes\");\r\n }\r\n }\r\n this._sysId = sysId;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Adds an attribute-list declaration to this document type declaration\r\n * and returns the new attribute-list declaration.\r\n */\r\n XmlDtd.prototype.attlist = function (options) {\r\n var attlist = new XmlDtdAttlist_1.default(this, this._validation, options);\r\n this._children.push(attlist);\r\n return attlist;\r\n };\r\n /**\r\n * Adds a comment to this document type declaration and returns the\r\n * new comment.\r\n */\r\n XmlDtd.prototype.comment = function (options) {\r\n var comment = new XmlComment_1.default(this, this._validation, options);\r\n this._children.push(comment);\r\n return comment;\r\n };\r\n /**\r\n * Adds an element declaration to this document type declaration\r\n * and returns the new element declaration.\r\n */\r\n XmlDtd.prototype.element = function (options) {\r\n var element = new XmlDtdElement_1.default(this, this._validation, options);\r\n this._children.push(element);\r\n return element;\r\n };\r\n /**\r\n * Adds an entity declaration to this document type declaration\r\n * and returns the new entity declaration.\r\n */\r\n XmlDtd.prototype.entity = function (options) {\r\n var entity = new XmlDtdEntity_1.default(this, this._validation, options);\r\n this._children.push(entity);\r\n return entity;\r\n };\r\n /**\r\n * Adds a notation declaration to this document type declaration\r\n * and returns the new notation declaration.\r\n */\r\n XmlDtd.prototype.notation = function (options) {\r\n var notation = new XmlDtdNotation_1.default(this, this._validation, options);\r\n this._children.push(notation);\r\n return notation;\r\n };\r\n /**\r\n * Adds a parameter entity reference to this document type declaration\r\n * and returns the new parameter entity reference.\r\n */\r\n XmlDtd.prototype.paramEntityRef = function (options) {\r\n var paramEntity = new XmlDtdParamEntityRef_1.default(this, this._validation, options);\r\n this._children.push(paramEntity);\r\n return paramEntity;\r\n };\r\n /**\r\n * Adds a processing instruction to this document type declaration\r\n * and returns the new processing instruction.\r\n */\r\n XmlDtd.prototype.procInst = function (options) {\r\n var procInst = new XmlProcInst_1.default(this, this._validation, options);\r\n this._children.push(procInst);\r\n return procInst;\r\n };\r\n /**\r\n * Returns an XML string representation of this document type declaration.\r\n */\r\n XmlDtd.prototype.toString = function (options) {\r\n if (options === void 0) { options = {}; }\r\n var optionsObj = new options_1.StringOptions(options);\r\n var str = \"<!DOCTYPE \" + this._name;\r\n if ((0, validate_1.isUndefined)(this._pubId)) {\r\n if (!(0, validate_1.isUndefined)(this._sysId)) {\r\n str += \" \";\r\n str = this.appendId(\"SYSTEM\", this._sysId, str, optionsObj);\r\n }\r\n }\r\n else {\r\n if ((0, validate_1.isUndefined)(this._sysId)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": DTD system\"\r\n + \" identifier is not undefined\");\r\n }\r\n str += \" \";\r\n str = this.appendId(\"PUBLIC\", this._pubId, str, optionsObj);\r\n str = this.appendId(\"\", this._sysId, str, optionsObj);\r\n }\r\n if (this._children.length !== 0) {\r\n str += \" [\";\r\n for (var _i = 0, _a = this._children; _i < _a.length; _i++) {\r\n var node = _a[_i];\r\n if (optionsObj.pretty) {\r\n str += optionsObj.newline + optionsObj.indent;\r\n }\r\n str += node.toString();\r\n }\r\n if (optionsObj.pretty) {\r\n str += optionsObj.newline;\r\n }\r\n str += \"]>\";\r\n }\r\n else {\r\n str += \">\";\r\n }\r\n return str;\r\n };\r\n /**\r\n * Returns the parent of this attribute.\r\n */\r\n XmlDtd.prototype.up = function () {\r\n return this._parent;\r\n };\r\n /**\r\n * Appends the XML string representation of a public or system identifier\r\n * to an existing string.\r\n */\r\n XmlDtd.prototype.appendId = function (type, value, str, options) {\r\n str += type + \" \";\r\n if (options.doubleQuotes) {\r\n if (this._validation && value.indexOf(\"\\\"\") !== -1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": doubleQuotes option\"\r\n + \" inconsistent with DTD system identifier or\"\r\n + \" public identifier\");\r\n }\r\n str += \"\\\"\" + value + \"\\\"\";\r\n }\r\n else {\r\n if (this._validation && value.indexOf(\"'\") !== -1) {\r\n throw new Error((0, error_1.getContext)(this) + \": doubleQuotes option\"\r\n + \" inconsistent with DTD system identifier or\"\r\n + \" public identifier\");\r\n }\r\n str += \"'\" + value + \"'\";\r\n }\r\n return str;\r\n };\r\n return XmlDtd;\r\n}());\r\nexports.default = XmlDtd;\r\n/**\r\n * Returns true if the specified public identifier only contains characters\r\n * permitted by the XML specification.\r\n */\r\nfunction validatePubId(str) {\r\n for (var i = 0; i < str.length; i++) {\r\n var char = str.charCodeAt(i);\r\n if (char === 0xA\r\n || char === 0xD\r\n || char === 0x20\r\n || char === 0x21\r\n || (char >= 0x23 && char <= 0x25)\r\n || (char >= 0x27 && char <= 0x2F)\r\n || (char >= 0x30 && char <= 0x39)\r\n || char === 0x3A\r\n || char === 0x3B\r\n || char === 0x3D\r\n || char === 0x3F\r\n || (char >= 0x40 && char <= 0x5A)\r\n || char === 0x5F\r\n || (char >= 0x61 && char <= 0x7A)) {\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n return false;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}\r\nexports.validatePubId = validatePubId;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a CDATA section.\r\n *\r\n * A CDATA section is structured as follows, where `{data}` is the\r\n * character data of the section:\r\n *\r\n * ```xml\r\n * <![CDATA[{data}]]>\r\n * ```\r\n */\r\nvar XmlCdata = /** @class */ (function () {\r\n function XmlCdata(parent, validation, options) {\r\n this._validation = validation;\r\n if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInCharData)) {\r\n this._replaceInvalidCharsInCharData = (options.replaceInvalidCharsInCharData);\r\n }\r\n else {\r\n this._replaceInvalidCharsInCharData = false;\r\n }\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlCdata.prototype, \"charData\", {\r\n /**\r\n * Gets the character data of this CDATA section.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the character data of this CDATA section.\r\n */\r\n set: function (charData) {\r\n if (this._replaceInvalidCharsInCharData) {\r\n charData = (0, validate_1.fixChar)(charData);\r\n }\r\n else if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": CDATA section\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain characters\")\r\n + \" not allowed in XML\");\r\n }\r\n if (this._replaceInvalidCharsInCharData) {\r\n charData = charData.replace(\"]]>\", \"\\uFFFD\\uFFFD\\uFFFD\");\r\n }\r\n else if (this._validation && charData.indexOf(\"]]>\") !== -1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": CDATA section\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain the string\")\r\n + \" ']]>'\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this CDATA section.\r\n */\r\n XmlCdata.prototype.toString = function () {\r\n return \"<![CDATA[\" + this._charData + \"]]>\";\r\n };\r\n /**\r\n * Returns the parent of this CDATA section.\r\n */\r\n XmlCdata.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlCdata;\r\n}());\r\nexports.default = XmlCdata;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar escape_1 = require(\"../escape\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents character data.\r\n *\r\n * Restricted characters, such as the ampersand (`&`), the opening angle\r\n * bracket (`<`), and the closing angle bracket (`>`) when it appears in the\r\n * string `]]>`, are all automatically escaped.\r\n */\r\nvar XmlCharData = /** @class */ (function () {\r\n function XmlCharData(parent, validation, options) {\r\n this._validation = validation;\r\n if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInCharData)) {\r\n this._replaceInvalidCharsInCharData = (options.replaceInvalidCharsInCharData);\r\n }\r\n else {\r\n this._replaceInvalidCharsInCharData = false;\r\n }\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlCharData.prototype, \"charData\", {\r\n /**\r\n * Gets the text of this character data.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the text of this character data.\r\n */\r\n set: function (charData) {\r\n if (this._replaceInvalidCharsInCharData) {\r\n charData = (0, validate_1.fixChar)(charData);\r\n }\r\n else if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": character data\"\r\n + (\"\\\"\" + charData + \"\\\" should not contain characters not\")\r\n + \" allowed in XML\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this character data.\r\n */\r\n XmlCharData.prototype.toString = function () {\r\n var str = this._charData;\r\n str = (0, escape_1.escapeAmpersands)(str);\r\n str = (0, escape_1.escapeLeftAngleBrackets)(str);\r\n str = (0, escape_1.escapeRightAngleBracketsInCdataTerminator)(str);\r\n return str;\r\n };\r\n /**\r\n * Returns the parent of this character data.\r\n */\r\n XmlCharData.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlCharData;\r\n}());\r\nexports.default = XmlCharData;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar options_1 = require(\"../options\");\r\nvar validate_1 = require(\"../validate\");\r\nvar XmlAttribute_1 = __importDefault(require(\"./XmlAttribute\"));\r\nvar XmlCdata_1 = __importDefault(require(\"./XmlCdata\"));\r\nvar XmlCharData_1 = __importDefault(require(\"./XmlCharData\"));\r\nvar XmlCharRef_1 = __importDefault(require(\"./XmlCharRef\"));\r\nvar XmlComment_1 = __importDefault(require(\"./XmlComment\"));\r\nvar XmlEntityRef_1 = __importDefault(require(\"./XmlEntityRef\"));\r\nvar XmlProcInst_1 = __importDefault(require(\"./XmlProcInst\"));\r\n/**\r\n * Represents an XML element.\r\n *\r\n * A sample element is structured as follows, where `{name}` is the name\r\n * of the element:\r\n *\r\n * ```xml\r\n * <{name} attname=\"attvalue\">\r\n * <subelem/>\r\n * <?pitarget picontent?>\r\n * text\r\n * </{name}></pre>\r\n * ```\r\n *\r\n * XML elements can have an unlimited number of attributes, CDATA sections,\r\n * character references, comments, elements, entity references, processing\r\n * instructions, and character data.\r\n *\r\n * An element with no content will be represented using an empty element tag:\r\n *\r\n * ```xml\r\n * <{name}/>\r\n * ```\r\n */\r\nvar XmlElement = /** @class */ (function () {\r\n function XmlElement(parent, validation, options) {\r\n this._validation = validation;\r\n if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInName)) {\r\n this._replaceInvalidCharsInName = options.replaceInvalidCharsInName;\r\n }\r\n else {\r\n this._replaceInvalidCharsInName = false;\r\n }\r\n if (!(0, validate_1.isUndefined)(options.useSelfClosingTagIfEmpty)) {\r\n this._useSelfClosingTagIfEmpty = options.useSelfClosingTagIfEmpty;\r\n }\r\n else {\r\n this._useSelfClosingTagIfEmpty = true;\r\n }\r\n this._children = [];\r\n this._attributeNames = [];\r\n this._parent = parent;\r\n this.name = options.name;\r\n }\r\n Object.defineProperty(XmlElement.prototype, \"name\", {\r\n /**\r\n * Gets the name of this element.\r\n */\r\n get: function () {\r\n return this._name;\r\n },\r\n /**\r\n * Sets the name of this element.\r\n */\r\n set: function (name) {\r\n if (this._replaceInvalidCharsInName) {\r\n name = (0, validate_1.fixName)(name);\r\n if (name.length === 0) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": element name should\"\r\n + \" not be empty\");\r\n }\r\n }\r\n else if (this._validation && !(0, validate_1.validateName)(name)) {\r\n if (name.length === 0) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": element name should\"\r\n + \" not be empty\");\r\n }\r\n else {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": element name\"\r\n + (\" \\\"\" + name + \"\\\" should not contain characters not\")\r\n + \" allowed in XML names\");\r\n }\r\n }\r\n this._name = name;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Adds an attribute to this element and returns the new attribute.\r\n */\r\n XmlElement.prototype.attribute = function (options) {\r\n if (this._validation\r\n && this._attributeNames.indexOf(options.name) !== -1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": element \\\"\" + this.name + \"\\\"\"\r\n + \" already contains an attribute with the\"\r\n + (\" name \\\"\" + options.name + \"\\\"\"));\r\n }\r\n var attribute = new XmlAttribute_1.default(this, this._validation, options);\r\n this._children.push(attribute);\r\n this._attributeNames.push(options.name);\r\n return attribute;\r\n };\r\n /**\r\n * Adds a CDATA section to this element and returns the new CDATA section.\r\n */\r\n XmlElement.prototype.cdata = function (options) {\r\n var cdata = new XmlCdata_1.default(this, this._validation, options);\r\n this._children.push(cdata);\r\n return cdata;\r\n };\r\n /**\r\n * Adds character data to this element and returns the new character data.\r\n */\r\n XmlElement.prototype.charData = function (options) {\r\n var charDataNode = new XmlCharData_1.default(this, this._validation, options);\r\n this._children.push(charDataNode);\r\n return charDataNode;\r\n };\r\n /**\r\n * Adds a character reference to this element and returns the new\r\n * character reference.\r\n */\r\n XmlElement.prototype.charRef = function (options) {\r\n var charRef = new XmlCharRef_1.default(this, this._validation, options);\r\n this._children.push(charRef);\r\n return charRef;\r\n };\r\n /**\r\n * Adds a comment to this element and returns the new comment.\r\n */\r\n XmlElement.prototype.comment = function (options) {\r\n var comment = new XmlComment_1.default(this, this._validation, options);\r\n this._children.push(comment);\r\n return comment;\r\n };\r\n /**\r\n * Adds an element to this element and returns the new element.\r\n */\r\n XmlElement.prototype.element = function (options) {\r\n var element = new XmlElement(this, this._validation, options);\r\n this._children.push(element);\r\n return element;\r\n };\r\n /**\r\n * Adds an entity reference to this element and returns the new entity\r\n * reference.\r\n */\r\n XmlElement.prototype.entityRef = function (options) {\r\n var entityRef = new XmlEntityRef_1.default(this, this._validation, options);\r\n this._children.push(entityRef);\r\n return entityRef;\r\n };\r\n /**\r\n * Adds a processing instruction to this element and returns the new\r\n * processing instruction.\r\n */\r\n XmlElement.prototype.procInst = function (options) {\r\n var procInst = new XmlProcInst_1.default(this, this._validation, options);\r\n this._children.push(procInst);\r\n return procInst;\r\n };\r\n /**\r\n * Returns an XML string representation of this element using the specified\r\n * options.\r\n */\r\n XmlElement.prototype.toString = function (options) {\r\n if (options === void 0) { options = {}; }\r\n return this.toStringWithIndent(options, \"\");\r\n };\r\n /**\r\n * Returns the parent of this element.\r\n */\r\n XmlElement.prototype.up = function () {\r\n return this._parent;\r\n };\r\n /**\r\n * Returns an XML string representation of this element using the specified\r\n * options and initial indent.\r\n */\r\n XmlElement.prototype.toStringWithIndent = function (options, indent) {\r\n var optionsObj = new options_1.StringOptions(options);\r\n var newIndent = indent + optionsObj.indent;\r\n // Element tag start\r\n var str = \"<\" + this._name;\r\n // Attributes and other nodes\r\n var nodes = [];\r\n for (var _i = 0, _a = this._children; _i < _a.length; _i++) {\r\n var node = _a[_i];\r\n if (node instanceof XmlAttribute_1.default) {\r\n str += \" \" + node.toString(options);\r\n }\r\n else {\r\n nodes.push(node);\r\n }\r\n }\r\n // Child nodes\r\n if (nodes.length > 0) {\r\n var childStr = \"\";\r\n for (var i = 0; i < nodes.length; i++) {\r\n var next = nodes[i];\r\n var nextStr = \"\";\r\n if (next instanceof XmlElement) {\r\n nextStr += next.toStringWithIndent(optionsObj, newIndent);\r\n }\r\n else {\r\n nextStr += next.toString();\r\n }\r\n var prev = i > 0 ? nodes[i - 1] : undefined;\r\n // Skip empty nodes\r\n if (next instanceof XmlCharData_1.default && next.toString() === \"\") {\r\n continue;\r\n }\r\n // Line break before child nodes unless all nodes, or at least\r\n // the most recent two, are of type XmlCharacterReference,\r\n // XmlEntityReference, or XmlCharData\r\n if (optionsObj.pretty) {\r\n if (!this.allSameLineNodes(nodes)) {\r\n if (!(i > 0 && this.onSameLine(next, prev))) {\r\n nextStr = optionsObj.newline + newIndent + nextStr;\r\n }\r\n }\r\n }\r\n childStr += nextStr;\r\n }\r\n // Line break before end tag unless all nodes are of type\r\n // XmlCharacterReference, XmlEntityReference, or XmlCharData\r\n if (optionsObj.pretty) {\r\n if (!this.allSameLineNodes(nodes)) {\r\n childStr += optionsObj.newline + indent;\r\n }\r\n }\r\n if (childStr.length === 0 && this._useSelfClosingTagIfEmpty) {\r\n // Element empty tag end\r\n str += \"/>\";\r\n }\r\n else {\r\n // Element start and end tags\r\n str += \">\" + childStr + \"</\" + this._name + \">\";\r\n }\r\n }\r\n else if (this._useSelfClosingTagIfEmpty) {\r\n // Element empty tag end\r\n str += \"/>\";\r\n }\r\n else {\r\n // Element start and end tags\r\n str += \"></\" + this._name + \">\";\r\n }\r\n return str;\r\n };\r\n /**\r\n * Returns true if the specified nodes are all character references,\r\n * entity references, or character data.\r\n */\r\n XmlElement.prototype.allSameLineNodes = function (nodes) {\r\n for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {\r\n var node = nodes_1[_i];\r\n if (!((node instanceof XmlCharRef_1.default\r\n || node instanceof XmlEntityRef_1.default\r\n || node instanceof XmlCharData_1.default))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n * Returns true if the specified nodes are all character references,\r\n * entity references, or character data.\r\n */\r\n XmlElement.prototype.onSameLine = function (prev, next) {\r\n return (prev instanceof XmlCharRef_1.default\r\n || prev instanceof XmlEntityRef_1.default\r\n || prev instanceof XmlCharData_1.default)\r\n && (!(0, validate_1.isUndefined)(next)\r\n && (next instanceof XmlCharRef_1.default\r\n || next instanceof XmlEntityRef_1.default\r\n || next instanceof XmlCharData_1.default));\r\n };\r\n return XmlElement;\r\n}());\r\nexports.default = XmlElement;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.getContext = void 0;\r\nvar XmlAttribute_1 = __importDefault(require(\"./nodes/XmlAttribute\"));\r\nvar XmlDocument_1 = __importDefault(require(\"./nodes/XmlDocument\"));\r\nvar XmlDtd_1 = __importDefault(require(\"./nodes/XmlDtd\"));\r\nvar XmlElement_1 = __importDefault(require(\"./nodes/XmlElement\"));\r\n/**\r\n * Returns a context string for the specified node, for use in error messages.\r\n */\r\nfunction getContext(obj) {\r\n if (obj instanceof XmlAttribute_1.default) {\r\n return getContext(obj.up()) + (\" > attribute \\\"\" + obj.name + \"\\\"\");\r\n }\r\n else if (obj instanceof XmlDocument_1.default) {\r\n return \"in XML document\";\r\n }\r\n else if (obj instanceof XmlDtd_1.default) {\r\n return getContext(obj.up()) + \" > DTD\";\r\n }\r\n else if (obj instanceof XmlElement_1.default) {\r\n return getContext(obj.up()) + (\" > element \\\"\" + obj.name + \"\\\"\");\r\n }\r\n else {\r\n throw new Error(\"Unrecognized object of type \"\r\n + Object.prototype.toString.call(obj));\r\n }\r\n}\r\nexports.getContext = getContext;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a comment.\r\n *\r\n * A comment is structured as follows, where `{content}` is the text of the\r\n * comment:\r\n *\r\n * ```xml\r\n * <!--{content}-->\r\n * ```\r\n */\r\nvar XmlComment = /** @class */ (function () {\r\n function XmlComment(parent, validation, options) {\r\n this._validation = validation;\r\n if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInCharData)) {\r\n this._replaceInvalidCharsInCharData = (options.replaceInvalidCharsInCharData);\r\n }\r\n else {\r\n this._replaceInvalidCharsInCharData = false;\r\n }\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlComment.prototype, \"charData\", {\r\n /**\r\n * Gets the text of this comment.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the text of this comment.\r\n */\r\n set: function (charData) {\r\n if (this._replaceInvalidCharsInCharData) {\r\n charData = (0, validate_1.fixChar)(charData);\r\n }\r\n else if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": comment content\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain characters\")\r\n + \" not allowed in XML\");\r\n }\r\n if (this._replaceInvalidCharsInCharData) {\r\n charData = charData.replace(\"--\", \"\\uFFFD\\uFFFD\");\r\n }\r\n else if (this._validation && charData.indexOf(\"--\") !== -1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": comment content\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain the string\")\r\n + \" '--'\");\r\n }\r\n if (this._replaceInvalidCharsInCharData) {\r\n if (charData.lastIndexOf(\"-\") === charData.length - 1) {\r\n charData = charData.substr(0, charData.length - 1) + \"\\uFFFD\";\r\n }\r\n }\r\n else if (this._validation\r\n && charData.lastIndexOf(\"-\") === charData.length - 1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": comment content\"\r\n + (\" \\\"\" + charData + \"\\\" should not end with the string\")\r\n + \" '-'\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this comment.\r\n */\r\n XmlComment.prototype.toString = function () {\r\n return \"<!--\" + this._charData + \"-->\";\r\n };\r\n /**\r\n * Returns the parent of this comment.\r\n */\r\n XmlComment.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlComment;\r\n}());\r\nexports.default = XmlComment;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar options_1 = require(\"../options\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a declaration.\r\n *\r\n * A declaration is structured as follows, where `{version}` is the XML\r\n * version, `{encoding}` is the encoding of the document, and `{standalone}`\r\n * is either \"yes\" or \"no\", depending on whether the document may contain\r\n * external markup declarations:\r\n *\r\n * ```xml\r\n * <?xml version=\"{version}\" encoding=\"{encoding}\" standalone=\"{standalone}\"?>\r\n * ```\r\n */\r\nvar XmlDecl = /** @class */ (function () {\r\n function XmlDecl(parent, validation, options) {\r\n this._version = \"1.0\";\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.encoding = options.encoding;\r\n this.standalone = options.standalone;\r\n if (!(0, validate_1.isUndefined)(options.version)) {\r\n this.version = options.version;\r\n }\r\n }\r\n Object.defineProperty(XmlDecl.prototype, \"encoding\", {\r\n /**\r\n * Gets the encoding associated with this declaration.\r\n */\r\n get: function () {\r\n return this._encoding;\r\n },\r\n /**\r\n * Sets the encoding associated with this declaration.\r\n */\r\n set: function (encoding) {\r\n if (this._validation && !(0, validate_1.isUndefined)(encoding)) {\r\n if (!validateEncoding(encoding)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": declaration\"\r\n + (\" encoding attribute \" + encoding + \" should be a\")\r\n + \" valid encoding\");\r\n }\r\n }\r\n this._encoding = encoding;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(XmlDecl.prototype, \"standalone\", {\r\n /**\r\n * Gets the value of the standalone attribute associated with this\r\n * declaration.\r\n */\r\n get: function () {\r\n return this._standalone;\r\n },\r\n /**\r\n * Sets the value of the standalone attribute associated with this\r\n * declaration.\r\n */\r\n set: function (standalone) {\r\n if (this._validation && !(0, validate_1.isUndefined)(standalone)) {\r\n if (standalone !== \"yes\" && standalone !== \"no\") {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": declaration\"\r\n + (\" standalone attribute \" + standalone + \" should\")\r\n + \" be the string 'yes' or the string 'no'\");\r\n }\r\n }\r\n this._standalone = standalone;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(XmlDecl.prototype, \"version\", {\r\n /**\r\n * Gets the XML version associated with this declaration.\r\n */\r\n get: function () {\r\n return this._version;\r\n },\r\n /**\r\n * Sets the XML version associated with this declaration.\r\n */\r\n set: function (version) {\r\n if (this._validation && !validateVersion(version)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": declaration version\"\r\n + (\" attribute \" + version + \" should be a valid XML\")\r\n + \" version\");\r\n }\r\n this._version = version;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this declaration.\r\n */\r\n XmlDecl.prototype.toString = function (options) {\r\n if (options === void 0) { options = {}; }\r\n var optionsObj = new options_1.StringOptions(options);\r\n var quote = optionsObj.doubleQuotes ? '\"' : \"'\";\r\n var str = \"<?xml version=\" + quote + this._version + quote;\r\n if (!(0, validate_1.isUndefined)(this._encoding)) {\r\n str += \" encoding=\" + quote + this._encoding + quote;\r\n }\r\n if (!(0, validate_1.isUndefined)(this._standalone)) {\r\n str += \" standalone=\" + quote + this._standalone + quote;\r\n }\r\n str += \"?>\";\r\n return str;\r\n };\r\n /**\r\n * Returns the parent of this declaration.\r\n */\r\n XmlDecl.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlDecl;\r\n}());\r\nexports.default = XmlDecl;\r\n/**\r\n * Returns true if the specified encoding only contains characters permitted by\r\n * the XML specification.\r\n */\r\nfunction validateEncoding(str) {\r\n if (str.length === 0) {\r\n return false;\r\n }\r\n var initialChar = str.charCodeAt(0);\r\n if (!((initialChar >= 0x41 && initialChar <= 0x5A)\r\n || (initialChar >= 0x61 && initialChar <= 0x7A))) {\r\n return false;\r\n }\r\n for (var i = 1; i < str.length; i++) {\r\n var char = str.charCodeAt(i);\r\n if (char === 0x5F\r\n || char === 0x2D\r\n || char === 0x2E\r\n || (char >= 0x30 && char <= 0x39)\r\n || (char >= 0x41 && char <= 0x5A)\r\n || (char >= 0x61 && char <= 0x7A)) {\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n return false;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}\r\n/**\r\n * Returns true if the specified version only contains characters permitted by\r\n * the XML specification.\r\n */\r\nfunction validateVersion(str) {\r\n for (var i = 0; i <= 9; i++) {\r\n if (str === \"1.\" + i) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar options_1 = require(\"../options\");\r\nvar validate_1 = require(\"../validate\");\r\nvar XmlComment_1 = __importDefault(require(\"./XmlComment\"));\r\nvar XmlDecl_1 = __importDefault(require(\"./XmlDecl\"));\r\nvar XmlDtd_1 = __importDefault(require(\"./XmlDtd\"));\r\nvar XmlElement_1 = __importDefault(require(\"./XmlElement\"));\r\nvar XmlProcInst_1 = __importDefault(require(\"./XmlProcInst\"));\r\n/**\r\n * Represents a document.\r\n *\r\n * A sample document is structured as follows:\r\n *\r\n * ```xml\r\n * <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n * <DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\r\n * \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n * <html>\r\n * <head>\r\n * <title>My page title</title>\r\n * </head>\r\n * <body>\r\n * <h1>Welcome!</h1>\r\n * <p>I hope you enjoy visiting my website.</p>\r\n * <img src=\"picture.png\"/>\r\n * </body>\r\n * </html>\r\n * ```\r\n *\r\n * Each component of the document, such as the declaration, document type\r\n * definition, and root element, are children of this node.\r\n *\r\n * Documents must have exactly one element, which is the document's root\r\n * element.\r\n *\r\n * Documents can have exactly one declaration and one document type definition\r\n * in that order, so long as they precede the element.\r\n *\r\n * Documents can have an unlimited number of comments or processing\r\n * instructions, so long as they follow the declaration, if one exists.\r\n */\r\nvar XmlDocument = /** @class */ (function () {\r\n function XmlDocument(options) {\r\n this._children = [];\r\n this._validation = !(0, validate_1.isUndefined)(options.validation)\r\n ? options.validation\r\n : true;\r\n }\r\n /**\r\n * Adds a comment to this document and returns the new comment.\r\n */\r\n XmlDocument.prototype.comment = function (options) {\r\n var comment = new XmlComment_1.default(this, this._validation, options);\r\n this._children.push(comment);\r\n return comment;\r\n };\r\n /**\r\n * Adds a declaration to this document and returns the new declaration.\r\n */\r\n XmlDocument.prototype.decl = function (options) {\r\n if (options === void 0) { options = {}; }\r\n if (this._validation && this._children.length !== 0) {\r\n throw new Error(\"in XML document: declaration must be the first\"\r\n + \" child\");\r\n }\r\n var declaration = new XmlDecl_1.default(this, this._validation, options);\r\n this._children.push(declaration);\r\n return declaration;\r\n };\r\n /**\r\n * Adds a document type definition to this document and returns the new\r\n * document type definition.\r\n */\r\n XmlDocument.prototype.dtd = function (options) {\r\n var filteredChildren = this._children.filter(function (value) {\r\n return value instanceof XmlElement_1.default;\r\n });\r\n if (this._validation && filteredChildren.length !== 0) {\r\n throw new Error(\"in XML document: DTD must precede the root\"\r\n + \" element\");\r\n }\r\n var dtd = new XmlDtd_1.default(this, this._validation, options);\r\n this._children.push(dtd);\r\n return dtd;\r\n };\r\n /**\r\n * Adds the root element to this document and returns the element.\r\n */\r\n XmlDocument.prototype.element = function (options) {\r\n var filteredChildren = this._children.filter(function (value) {\r\n return value instanceof XmlElement_1.default;\r\n });\r\n if (this._validation && filteredChildren.length !== 0) {\r\n throw new Error(\"in XML document: only one root element is\"\r\n + \" permitted\");\r\n }\r\n var element = new XmlElement_1.default(this, this._validation, options);\r\n this._children.push(element);\r\n return element;\r\n };\r\n /**\r\n * Adds a processing instruction to this document and returns the new\r\n * processing instruction.\r\n */\r\n XmlDocument.prototype.procInst = function (options) {\r\n var procInst = new XmlProcInst_1.default(this, this._validation, options);\r\n this._children.push(procInst);\r\n return procInst;\r\n };\r\n /**\r\n * Returns an XML string representation of this document using the\r\n * specified options.\r\n */\r\n XmlDocument.prototype.toString = function (options) {\r\n if (options === void 0) { options = {}; }\r\n var filteredChildren = this._children.filter(function (value) {\r\n return value instanceof XmlElement_1.default;\r\n });\r\n if (this._validation && filteredChildren.length !== 1) {\r\n throw new Error(\"in XML document: no more than one root element\"\r\n + \" is permitted\");\r\n }\r\n var optionsObj = new options_1.StringOptions(options);\r\n var str = \"\";\r\n for (var _i = 0, _a = this._children; _i < _a.length; _i++) {\r\n var node = _a[_i];\r\n if (node instanceof XmlDecl_1.default\r\n || node instanceof XmlDtd_1.default\r\n || node instanceof XmlElement_1.default) {\r\n str += node.toString(options);\r\n }\r\n else {\r\n str += node.toString();\r\n }\r\n if (optionsObj.pretty) {\r\n str += optionsObj.newline;\r\n }\r\n }\r\n var len = str.length - optionsObj.newline.length;\r\n if (str.substr(len) === optionsObj.newline) {\r\n str = str.substr(0, len);\r\n }\r\n return str;\r\n };\r\n return XmlDocument;\r\n}());\r\nexports.default = XmlDocument;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.document = exports.XmlProcInst = exports.XmlEntityRef = exports.XmlElement = exports.XmlDtdParamEntityRef = exports.XmlDtdNotation = exports.XmlDtdEntity = exports.XmlDtdElement = exports.XmlDtdAttlist = exports.XmlDtd = exports.XmlDocument = exports.XmlDecl = exports.XmlComment = exports.XmlCharRef = exports.XmlCharData = exports.XmlCdata = exports.XmlAttributeText = exports.XmlAttribute = void 0;\r\nvar XmlDocument_1 = __importDefault(require(\"./nodes/XmlDocument\"));\r\nvar XmlAttribute_1 = require(\"./nodes/XmlAttribute\");\r\nObject.defineProperty(exports, \"XmlAttribute\", { enumerable: true, get: function () { return __importDefault(XmlAttribute_1).default; } });\r\nvar XmlAttributeText_1 = require(\"./nodes/XmlAttributeText\");\r\nObject.defineProperty(exports, \"XmlAttributeText\", { enumerable: true, get: function () { return __importDefault(XmlAttributeText_1).default; } });\r\nvar XmlCdata_1 = require(\"./nodes/XmlCdata\");\r\nObject.defineProperty(exports, \"XmlCdata\", { enumerable: true, get: function () { return __importDefault(XmlCdata_1).default; } });\r\nvar XmlCharData_1 = require(\"./nodes/XmlCharData\");\r\nObject.defineProperty(exports, \"XmlCharData\", { enumerable: true, get: function () { return __importDefault(XmlCharData_1).default; } });\r\nvar XmlCharRef_1 = require(\"./nodes/XmlCharRef\");\r\nObject.defineProperty(exports, \"XmlCharRef\", { enumerable: true, get: function () { return __importDefault(XmlCharRef_1).default; } });\r\nvar XmlComment_1 = require(\"./nodes/XmlComment\");\r\nObject.defineProperty(exports, \"XmlComment\", { enumerable: true, get: function () { return __importDefault(XmlComment_1).default; } });\r\nvar XmlDecl_1 = require(\"./nodes/XmlDecl\");\r\nObject.defineProperty(exports, \"XmlDecl\", { enumerable: true, get: function () { return __importDefault(XmlDecl_1).default; } });\r\nvar XmlDocument_2 = require(\"./nodes/XmlDocument\");\r\nObject.defineProperty(exports, \"XmlDocument\", { enumerable: true, get: function () { return __importDefault(XmlDocument_2).default; } });\r\nvar XmlDtd_1 = require(\"./nodes/XmlDtd\");\r\nObject.defineProperty(exports, \"XmlDtd\", { enumerable: true, get: function () { return __importDefault(XmlDtd_1).default; } });\r\nvar XmlDtdAttlist_1 = require(\"./nodes/XmlDtdAttlist\");\r\nObject.defineProperty(exports, \"XmlDtdAttlist\", { enumerable: true, get: function () { return __importDefault(XmlDtdAttlist_1).default; } });\r\nvar XmlDtdElement_1 = require(\"./nodes/XmlDtdElement\");\r\nObject.defineProperty(exports, \"XmlDtdElement\", { enumerable: true, get: function () { return __importDefault(XmlDtdElement_1).default; } });\r\nvar XmlDtdEntity_1 = require(\"./nodes/XmlDtdEntity\");\r\nObject.defineProperty(exports, \"XmlDtdEntity\", { enumerable: true, get: function () { return __importDefault(XmlDtdEntity_1).default; } });\r\nvar XmlDtdNotation_1 = require(\"./nodes/XmlDtdNotation\");\r\nObject.defineProperty(exports, \"XmlDtdNotation\", { enumerable: true, get: function () { return __importDefault(XmlDtdNotation_1).default; } });\r\nvar XmlDtdParamEntityRef_1 = require(\"./nodes/XmlDtdParamEntityRef\");\r\nObject.defineProperty(exports, \"XmlDtdParamEntityRef\", { enumerable: true, get: function () { return __importDefault(XmlDtdParamEntityRef_1).default; } });\r\nvar XmlElement_1 = require(\"./nodes/XmlElement\");\r\nObject.defineProperty(exports, \"XmlElement\", { enumerable: true, get: function () { return __importDefault(XmlElement_1).default; } });\r\nvar XmlEntityRef_1 = require(\"./nodes/XmlEntityRef\");\r\nObject.defineProperty(exports, \"XmlEntityRef\", { enumerable: true, get: function () { return __importDefault(XmlEntityRef_1).default; } });\r\nvar XmlProcInst_1 = require(\"./nodes/XmlProcInst\");\r\nObject.defineProperty(exports, \"XmlProcInst\", { enumerable: true, get: function () { return __importDefault(XmlProcInst_1).default; } });\r\n/**\r\n * Returns a new XML document with the specified options.\r\n */\r\nfunction document(options) {\r\n if (options === void 0) { options = {}; }\r\n return new XmlDocument_1.default(options);\r\n}\r\nexports.document = document;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2020 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.stringify = exports.isMap = exports.isSet = exports.isFunction = exports.isArray = exports.isObject = exports.isNull = exports.isUndefined = void 0;\r\nfunction isUndefined(val) {\r\n return Object.prototype.toString.call(val) === \"[object Undefined]\";\r\n}\r\nexports.isUndefined = isUndefined;\r\nfunction isNull(val) {\r\n return Object.prototype.toString.call(val) === \"[object Null]\";\r\n}\r\nexports.isNull = isNull;\r\nfunction isObject(val) {\r\n return Object.prototype.toString.call(val) === \"[object Object]\";\r\n}\r\nexports.isObject = isObject;\r\nfunction isArray(val) {\r\n return Object.prototype.toString.call(val) === \"[object Array]\";\r\n}\r\nexports.isArray = isArray;\r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\nfunction isFunction(val) {\r\n return Object.prototype.toString.call(val) === \"[object Function]\";\r\n}\r\nexports.isFunction = isFunction;\r\nfunction isSet(val) {\r\n return Object.prototype.toString.call(val) === \"[object Set]\";\r\n}\r\nexports.isSet = isSet;\r\nfunction isMap(val) {\r\n return Object.prototype.toString.call(val) === \"[object Map]\";\r\n}\r\nexports.isMap = isMap;\r\n/**\r\n * Returns a string representation of the specified value, as given by the\r\n * value's toString() method (if it has one) or the global String() function\r\n * (if it does not).\r\n *\r\n * @param value The value to convert to a string.\r\n *\r\n * @returns A string representation of the specified value.\r\n */\r\n// eslint-disable-next-line max-len\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\r\nfunction stringify(value) {\r\n if (!isUndefined(value) && !isNull(value)) {\r\n if (isFunction(value === null || value === void 0 ? void 0 : value.toString)) {\r\n value = value.toString();\r\n }\r\n }\r\n return String(value);\r\n}\r\nexports.stringify = stringify;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2020 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.WrapHandlers = exports.TypeHandlers = exports.FormatOptions = exports.DtdOptions = exports.DeclarationOptions = exports.Options = void 0;\r\nvar utils_1 = require(\"./utils\");\r\n/**\r\n * Implementation of the IOptions interface used to provide default values\r\n * to fields.\r\n */\r\nvar Options = /** @class */ (function () {\r\n function Options(options) {\r\n if (options === void 0) { options = {}; }\r\n this.aliasString = \"=\";\r\n this.attributeString = \"@\";\r\n this.cdataInvalidChars = false;\r\n this.cdataKeys = [];\r\n this.replaceInvalidChars = false;\r\n this.useSelfClosingTagIfEmpty = true;\r\n this.validation = true;\r\n this.valueString = \"#\";\r\n if (!(0, utils_1.isUndefined)(options.validation)) {\r\n this.validation = options.validation;\r\n }\r\n if (!(0, utils_1.isUndefined)(options.aliasString)) {\r\n this.aliasString = options.aliasString;\r\n }\r\n if (!(0, utils_1.isUndefined)(options.attributeString)) {\r\n this.attributeString = options.attributeString;\r\n }\r\n if (!(0, utils_1.isUndefined)(options.cdataInvalidChars)) {\r\n this.cdataInvalidChars = options.cdataInvalidChars;\r\n }\r\n if (!(0, utils_1.isUndefined)(options.cdataKeys)) {\r\n this.cdataKeys = options.cdataKeys;\r\n }\r\n this.declaration = new DeclarationOptions(options.declaration);\r\n this.dtd = new DtdOptions(this.validation, options.dtd);\r\n this.format = new FormatOptions(options.format);\r\n if (!(0, utils_1.isUndefined)(options.replaceInvalidChars)) {\r\n this.replaceInvalidChars = options.replaceInvalidChars;\r\n }\r\n this.typeHandlers = new TypeHandlers(options.typeHandlers);\r\n if (!(0, utils_1.isUndefined)(options.useSelfClosingTagIfEmpty)) {\r\n this.useSelfClosingTagIfEmpty = options.useSelfClosingTagIfEmpty;\r\n }\r\n if (!(0, utils_1.isUndefined)(options.valueString)) {\r\n this.valueString = options.valueString;\r\n }\r\n this.wrapHandlers = new WrapHandlers(options.wrapHandlers);\r\n }\r\n return Options;\r\n}());\r\nexports.Options = Options;\r\n/**\r\n * Implementation of the IDeclarationOptions interface used to provide default\r\n * values to fields.\r\n */\r\nvar DeclarationOptions = /** @class */ (function () {\r\n function DeclarationOptions(declarationOptions) {\r\n if (declarationOptions === void 0) { declarationOptions = {}; }\r\n this.include = true;\r\n if (!(0, utils_1.isUndefined)(declarationOptions.include)) {\r\n this.include = declarationOptions.include;\r\n }\r\n // Validation performed by xmlcreate\r\n this.encoding = declarationOptions.encoding;\r\n this.standalone = declarationOptions.standalone;\r\n this.version = declarationOptions.version;\r\n }\r\n return DeclarationOptions;\r\n}());\r\nexports.DeclarationOptions = DeclarationOptions;\r\n/**\r\n * Implementation of the IDtdOptions interface used to provide default values\r\n * to fields.\r\n */\r\nvar DtdOptions = /** @class */ (function () {\r\n function DtdOptions(validation, dtdOptions) {\r\n if (dtdOptions === void 0) { dtdOptions = {}; }\r\n this.include = false;\r\n if (!(0, utils_1.isUndefined)(dtdOptions.include)) {\r\n this.include = dtdOptions.include;\r\n }\r\n if (validation && (0, utils_1.isUndefined)(dtdOptions.name) && this.include) {\r\n throw new Error(\"options.dtd.name should be defined if\" +\r\n \" options.dtd.include is true\");\r\n }\r\n this.name = dtdOptions.name;\r\n this.sysId = dtdOptions.sysId;\r\n this.pubId = dtdOptions.pubId;\r\n }\r\n return DtdOptions;\r\n}());\r\nexports.DtdOptions = DtdOptions;\r\n/**\r\n * Implementation of the IFormatOptions interface used to provide default values\r\n * to fields.\r\n */\r\nvar FormatOptions = /** @class */ (function () {\r\n function FormatOptions(formatOptions) {\r\n if (formatOptions === void 0) { formatOptions = {}; }\r\n this.doubleQuotes = formatOptions.doubleQuotes;\r\n this.indent = formatOptions.indent;\r\n this.newline = formatOptions.newline;\r\n this.pretty = formatOptions.pretty;\r\n }\r\n return FormatOptions;\r\n}());\r\nexports.FormatOptions = FormatOptions;\r\n/**\r\n * Implementation of the ITypeHandlers interface used to provide default values\r\n * to fields.\r\n */\r\nvar TypeHandlers = /** @class */ (function () {\r\n function TypeHandlers(typeHandlers) {\r\n if (typeHandlers === void 0) { typeHandlers = {}; }\r\n for (var key in typeHandlers) {\r\n if (Object.prototype.hasOwnProperty.call(typeHandlers, key)) {\r\n this[key] = typeHandlers[key];\r\n }\r\n }\r\n }\r\n return TypeHandlers;\r\n}());\r\nexports.TypeHandlers = TypeHandlers;\r\n/**\r\n * Implementation of the IWrapHandlers interface used to provide default values\r\n * to fields.\r\n */\r\nvar WrapHandlers = /** @class */ (function () {\r\n function WrapHandlers(wrapHandlers) {\r\n if (wrapHandlers === void 0) { wrapHandlers = {}; }\r\n for (var key in wrapHandlers) {\r\n if (Object.prototype.hasOwnProperty.call(wrapHandlers, key)) {\r\n this[key] = wrapHandlers[key];\r\n }\r\n }\r\n }\r\n return WrapHandlers;\r\n}());\r\nexports.WrapHandlers = WrapHandlers;\r\n", "\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.parse = exports.parseToExistingElement = exports.Absent = void 0;\r\n/**\r\n * Copyright (C) 2016-2020 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar xmlcreate_1 = require(\"xmlcreate\");\r\nvar options_1 = require(\"./options\");\r\nvar utils_1 = require(\"./utils\");\r\n/**\r\n * Indicates that an object of a particular type should be suppressed from the\r\n * XML output.\r\n *\r\n * See the `typeHandlers` property in {@link IOptions} for more details.\r\n */\r\nvar Absent = /** @class */ (function () {\r\n function Absent() {\r\n }\r\n Object.defineProperty(Absent, \"instance\", {\r\n /**\r\n * Returns the sole instance of Absent.\r\n */\r\n get: function () {\r\n return Absent._instance;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Absent._instance = new Absent();\r\n return Absent;\r\n}());\r\nexports.Absent = Absent;\r\n/**\r\n * Gets the type handler associated with a value.\r\n */\r\nfunction getHandler(value, options) {\r\n var type = Object.prototype.toString.call(value);\r\n var handler;\r\n if (Object.prototype.hasOwnProperty.call(options.typeHandlers, \"*\")) {\r\n handler = options.typeHandlers[\"*\"];\r\n }\r\n if (Object.prototype.hasOwnProperty.call(options.typeHandlers, type)) {\r\n handler = options.typeHandlers[type];\r\n }\r\n return handler;\r\n}\r\n/**\r\n * Parses a string into XML and adds it to the parent element or attribute.\r\n */\r\nfunction parseString(str, parentElement, options) {\r\n var requiresCdata = function (s) {\r\n return ((options.cdataInvalidChars &&\r\n (s.indexOf(\"<\") !== -1 || s.indexOf(\"&\") !== -1)) ||\r\n options.cdataKeys.indexOf(parentElement.name) !== -1 ||\r\n options.cdataKeys.indexOf(\"*\") !== -1);\r\n };\r\n if (parentElement instanceof xmlcreate_1.XmlElement) {\r\n if (requiresCdata(str)) {\r\n var cdataStrs = str.split(\"]]>\");\r\n for (var i = 0; i < cdataStrs.length; i++) {\r\n if (requiresCdata(cdataStrs[i])) {\r\n parentElement.cdata({\r\n charData: cdataStrs[i],\r\n replaceInvalidCharsInCharData: options.replaceInvalidChars,\r\n });\r\n }\r\n else {\r\n parentElement.charData({\r\n charData: cdataStrs[i],\r\n replaceInvalidCharsInCharData: options.replaceInvalidChars,\r\n });\r\n }\r\n if (i < cdataStrs.length - 1) {\r\n parentElement.charData({\r\n charData: \"]]>\",\r\n replaceInvalidCharsInCharData: options.replaceInvalidChars,\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n parentElement.charData({\r\n charData: str,\r\n replaceInvalidCharsInCharData: options.replaceInvalidChars,\r\n });\r\n }\r\n }\r\n else {\r\n parentElement.text({\r\n charData: str,\r\n replaceInvalidCharsInCharData: options.replaceInvalidChars,\r\n });\r\n }\r\n}\r\n/**\r\n * Parses an attribute into XML and adds it to the parent element.\r\n */\r\nfunction parseAttribute(name, value, parentElement, options) {\r\n var attribute = parentElement.attribute({\r\n name: name,\r\n replaceInvalidCharsInName: options.replaceInvalidChars,\r\n });\r\n parseString((0, utils_1.stringify)(value), attribute, options);\r\n}\r\n/**\r\n * Parses an object or Map entry into XML and adds it to the parent element.\r\n */\r\nfunction parseObjectOrMapEntry(key, value, parentElement, options) {\r\n // Alias key\r\n if (key === options.aliasString) {\r\n parentElement.name = (0, utils_1.stringify)(value);\r\n return;\r\n }\r\n // Attributes key\r\n if (key.indexOf(options.attributeString) === 0 && (0, utils_1.isObject)(value)) {\r\n for (var _i = 0, _a = Object.keys(value); _i < _a.length; _i++) {\r\n var subkey = _a[_i];\r\n parseAttribute(subkey, (0, utils_1.stringify)(value[subkey]), parentElement, options);\r\n }\r\n return;\r\n }\r\n // Value key\r\n if (key.indexOf(options.valueString) === 0) {\r\n parseValue(key, (0, utils_1.stringify)(value), parentElement, options);\r\n return;\r\n }\r\n // Standard handling (create new element for entry)\r\n var element = parentElement;\r\n if (!(0, utils_1.isArray)(value) && !(0, utils_1.isSet)(value)) {\r\n // If handler for value returns absent, then do not add element\r\n var handler = getHandler(value, options);\r\n if (!(0, utils_1.isUndefined)(handler)) {\r\n if (handler(value) === Absent.instance) {\r\n return;\r\n }\r\n }\r\n element = parentElement.element({\r\n name: key,\r\n replaceInvalidCharsInName: options.replaceInvalidChars,\r\n useSelfClosingTagIfEmpty: options.useSelfClosingTagIfEmpty,\r\n });\r\n }\r\n parseValue(key, value, element, options);\r\n}\r\n/**\r\n * Parses an Object or Map into XML and adds it to the parent element.\r\n */\r\nfunction parseObjectOrMap(objectOrMap, parentElement, options) {\r\n if ((0, utils_1.isMap)(objectOrMap)) {\r\n objectOrMap.forEach(function (value, key) {\r\n parseObjectOrMapEntry((0, utils_1.stringify)(key), value, parentElement, options);\r\n });\r\n }\r\n else {\r\n for (var _i = 0, _a = Object.keys(objectOrMap); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n parseObjectOrMapEntry(key, objectOrMap[key], parentElement, options);\r\n }\r\n }\r\n}\r\n/**\r\n * Parses an array or Set into XML and adds it to the parent element.\r\n */\r\nfunction parseArrayOrSet(key, arrayOrSet, parentElement, options) {\r\n var arrayNameFunc;\r\n if (Object.prototype.hasOwnProperty.call(options.wrapHandlers, \"*\")) {\r\n arrayNameFunc = options.wrapHandlers[\"*\"];\r\n }\r\n if (Object.prototype.hasOwnProperty.call(options.wrapHandlers, key)) {\r\n arrayNameFunc = options.wrapHandlers[key];\r\n }\r\n var arrayKey = key;\r\n var arrayElement = parentElement;\r\n if (!(0, utils_1.isUndefined)(arrayNameFunc)) {\r\n var arrayNameFuncKey = arrayNameFunc(arrayKey, arrayOrSet);\r\n if (!(0, utils_1.isNull)(arrayNameFuncKey)) {\r\n arrayKey = arrayNameFuncKey;\r\n arrayElement = parentElement.element({\r\n name: key,\r\n replaceInvalidCharsInName: options.replaceInvalidChars,\r\n useSelfClosingTagIfEmpty: options.useSelfClosingTagIfEmpty,\r\n });\r\n }\r\n }\r\n arrayOrSet.forEach(function (item) {\r\n var element = arrayElement;\r\n if (!(0, utils_1.isArray)(item) && !(0, utils_1.isSet)(item)) {\r\n // If handler for value returns absent, then do not add element\r\n var handler = getHandler(item, options);\r\n if (!(0, utils_1.isUndefined)(handler)) {\r\n if (handler(item) === Absent.instance) {\r\n return;\r\n }\r\n }\r\n element = arrayElement.element({\r\n name: arrayKey,\r\n replaceInvalidCharsInName: options.replaceInvalidChars,\r\n useSelfClosingTagIfEmpty: options.useSelfClosingTagIfEmpty,\r\n });\r\n }\r\n parseValue(arrayKey, item, element, options);\r\n });\r\n}\r\n/**\r\n * Parses an arbitrary JavaScript value into XML and adds it to the parent\r\n * element.\r\n */\r\nfunction parseValue(key, value, parentElement, options) {\r\n // If a handler for a particular type is user-defined, use that handler\r\n // instead of the defaults\r\n var handler = getHandler(value, options);\r\n if (!(0, utils_1.isUndefined)(handler)) {\r\n value = handler(value);\r\n }\r\n if ((0, utils_1.isObject)(value) || (0, utils_1.isMap)(value)) {\r\n parseObjectOrMap(value, parentElement, options);\r\n return;\r\n }\r\n if ((0, utils_1.isArray)(value) || (0, utils_1.isSet)(value)) {\r\n parseArrayOrSet(key, value, parentElement, options);\r\n return;\r\n }\r\n parseString((0, utils_1.stringify)(value), parentElement, options);\r\n}\r\n/**\r\n * Converts the specified object to XML and adds the XML representation to the\r\n * specified XmlElement object using the specified options.\r\n *\r\n * This function does not add a root element. In addition, it does not add an\r\n * XML declaration or DTD, and the associated options in {@link IOptions} are\r\n * ignored. If desired, these must be added manually.\r\n */\r\nfunction parseToExistingElement(element, object, options) {\r\n var opts = new options_1.Options(options);\r\n parseValue(element.name, object, element, opts);\r\n}\r\nexports.parseToExistingElement = parseToExistingElement;\r\n/**\r\n * Returns a XML string representation of the specified object using the\r\n * specified options.\r\n *\r\n * `root` is the name of the root XML element. When the object is converted\r\n * to XML, it will be a child of this root element.\r\n */\r\nfunction parse(root, object, options) {\r\n var opts = new options_1.Options(options);\r\n var document = new xmlcreate_1.XmlDocument({\r\n validation: opts.validation,\r\n });\r\n if (opts.declaration.include) {\r\n document.decl(opts.declaration);\r\n }\r\n if (opts.dtd.include) {\r\n document.dtd({\r\n // Validated in options.ts\r\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\r\n name: opts.dtd.name,\r\n pubId: opts.dtd.pubId,\r\n sysId: opts.dtd.sysId,\r\n });\r\n }\r\n var rootElement = document.element({\r\n name: root,\r\n replaceInvalidCharsInName: opts.replaceInvalidChars,\r\n useSelfClosingTagIfEmpty: opts.useSelfClosingTagIfEmpty,\r\n });\r\n parseToExistingElement(rootElement, object, options);\r\n return document.toString(opts.format);\r\n}\r\nexports.parse = parse;\r\n", "'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n", "'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n", "'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n", "'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n", "'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n", "'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n", "'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n", "'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n", "'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n", "'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n", "/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n", "'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n", "/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n", "/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n", "var debug;\n\nmodule.exports = function () {\n if (!debug) {\n try {\n /* eslint global-require: off */\n debug = require(\"debug\")(\"follow-redirects\");\n }\n catch (error) { /* */ }\n if (typeof debug !== \"function\") {\n debug = function () { /* */ };\n }\n }\n debug.apply(null, arguments);\n};\n", "var url = require(\"url\");\nvar URL = url.URL;\nvar http = require(\"http\");\nvar https = require(\"https\");\nvar Writable = require(\"stream\").Writable;\nvar assert = require(\"assert\");\nvar debug = require(\"./debug\");\n\n// Create handlers that pass events from native requests\nvar events = [\"abort\", \"aborted\", \"connect\", \"error\", \"socket\", \"timeout\"];\nvar eventHandlers = Object.create(null);\nevents.forEach(function (event) {\n eventHandlers[event] = function (arg1, arg2, arg3) {\n this._redirectable.emit(event, arg1, arg2, arg3);\n };\n});\n\nvar InvalidUrlError = createErrorType(\n \"ERR_INVALID_URL\",\n \"Invalid URL\",\n TypeError\n);\n// Error types with codes\nvar RedirectionError = createErrorType(\n \"ERR_FR_REDIRECTION_FAILURE\",\n \"Redirected request failed\"\n);\nvar TooManyRedirectsError = createErrorType(\n \"ERR_FR_TOO_MANY_REDIRECTS\",\n \"Maximum number of redirects exceeded\"\n);\nvar MaxBodyLengthExceededError = createErrorType(\n \"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\",\n \"Request body larger than maxBodyLength limit\"\n);\nvar WriteAfterEndError = createErrorType(\n \"ERR_STREAM_WRITE_AFTER_END\",\n \"write after end\"\n);\n\n// An HTTP(S) request that can be redirected\nfunction RedirectableRequest(options, responseCallback) {\n // Initialize the request\n Writable.call(this);\n this._sanitizeOptions(options);\n this._options = options;\n this._ended = false;\n this._ending = false;\n this._redirectCount = 0;\n this._redirects = [];\n this._requestBodyLength = 0;\n this._requestBodyBuffers = [];\n\n // Attach a callback if passed\n if (responseCallback) {\n this.on(\"response\", responseCallback);\n }\n\n // React to responses of native requests\n var self = this;\n this._onNativeResponse = function (response) {\n self._processResponse(response);\n };\n\n // Perform the first request\n this._performRequest();\n}\nRedirectableRequest.prototype = Object.create(Writable.prototype);\n\nRedirectableRequest.prototype.abort = function () {\n abortRequest(this._currentRequest);\n this.emit(\"abort\");\n};\n\n// Writes buffered data to the current native request\nRedirectableRequest.prototype.write = function (data, encoding, callback) {\n // Writing is not allowed if end has been called\n if (this._ending) {\n throw new WriteAfterEndError();\n }\n\n // Validate input and shift parameters if necessary\n if (!isString(data) && !isBuffer(data)) {\n throw new TypeError(\"data should be a string, Buffer or Uint8Array\");\n }\n if (isFunction(encoding)) {\n callback = encoding;\n encoding = null;\n }\n\n // Ignore empty buffers, since writing them doesn't invoke the callback\n // https://github.com/nodejs/node/issues/22066\n if (data.length === 0) {\n if (callback) {\n callback();\n }\n return;\n }\n // Only write when we don't exceed the maximum body length\n if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {\n this._requestBodyLength += data.length;\n this._requestBodyBuffers.push({ data: data, encoding: encoding });\n this._currentRequest.write(data, encoding, callback);\n }\n // Error when we exceed the maximum body length\n else {\n this.emit(\"error\", new MaxBodyLengthExceededError());\n this.abort();\n }\n};\n\n// Ends the current native request\nRedirectableRequest.prototype.end = function (data, encoding, callback) {\n // Shift parameters if necessary\n if (isFunction(data)) {\n callback = data;\n data = encoding = null;\n }\n else if (isFunction(encoding)) {\n callback = encoding;\n encoding = null;\n }\n\n // Write data if needed and end\n if (!data) {\n this._ended = this._ending = true;\n this._currentRequest.end(null, null, callback);\n }\n else {\n var self = this;\n var currentRequest = this._currentRequest;\n this.write(data, encoding, function () {\n self._ended = true;\n currentRequest.end(null, null, callback);\n });\n this._ending = true;\n }\n};\n\n// Sets a header value on the current native request\nRedirectableRequest.prototype.setHeader = function (name, value) {\n this._options.headers[name] = value;\n this._currentRequest.setHeader(name, value);\n};\n\n// Clears a header value on the current native request\nRedirectableRequest.prototype.removeHeader = function (name) {\n delete this._options.headers[name];\n this._currentRequest.removeHeader(name);\n};\n\n// Global timeout for all underlying requests\nRedirectableRequest.prototype.setTimeout = function (msecs, callback) {\n var self = this;\n\n // Destroys the socket on timeout\n function destroyOnTimeout(socket) {\n socket.setTimeout(msecs);\n socket.removeListener(\"timeout\", socket.destroy);\n socket.addListener(\"timeout\", socket.destroy);\n }\n\n // Sets up a timer to trigger a timeout event\n function startTimer(socket) {\n if (self._timeout) {\n clearTimeout(self._timeout);\n }\n self._timeout = setTimeout(function () {\n self.emit(\"timeout\");\n clearTimer();\n }, msecs);\n destroyOnTimeout(socket);\n }\n\n // Stops a timeout from triggering\n function clearTimer() {\n // Clear the timeout\n if (self._timeout) {\n clearTimeout(self._timeout);\n self._timeout = null;\n }\n\n // Clean up all attached listeners\n self.removeListener(\"abort\", clearTimer);\n self.removeListener(\"error\", clearTimer);\n self.removeListener(\"response\", clearTimer);\n if (callback) {\n self.removeListener(\"timeout\", callback);\n }\n if (!self.socket) {\n self._currentRequest.removeListener(\"socket\", startTimer);\n }\n }\n\n // Attach callback if passed\n if (callback) {\n this.on(\"timeout\", callback);\n }\n\n // Start the timer if or when the socket is opened\n if (this.socket) {\n startTimer(this.socket);\n }\n else {\n this._currentRequest.once(\"socket\", startTimer);\n }\n\n // Clean up on events\n this.on(\"socket\", destroyOnTimeout);\n this.on(\"abort\", clearTimer);\n this.on(\"error\", clearTimer);\n this.on(\"response\", clearTimer);\n\n return this;\n};\n\n// Proxy all other public ClientRequest methods\n[\n \"flushHeaders\", \"getHeader\",\n \"setNoDelay\", \"setSocketKeepAlive\",\n].forEach(function (method) {\n RedirectableRequest.prototype[method] = function (a, b) {\n return this._currentRequest[method](a, b);\n };\n});\n\n// Proxy all public ClientRequest properties\n[\"aborted\", \"connection\", \"socket\"].forEach(function (property) {\n Object.defineProperty(RedirectableRequest.prototype, property, {\n get: function () { return this._currentRequest[property]; },\n });\n});\n\nRedirectableRequest.prototype._sanitizeOptions = function (options) {\n // Ensure headers are always present\n if (!options.headers) {\n options.headers = {};\n }\n\n // Since http.request treats host as an alias of hostname,\n // but the url module interprets host as hostname plus port,\n // eliminate the host property to avoid confusion.\n if (options.host) {\n // Use hostname if set, because it has precedence\n if (!options.hostname) {\n options.hostname = options.host;\n }\n delete options.host;\n }\n\n // Complete the URL object when necessary\n if (!options.pathname && options.path) {\n var searchPos = options.path.indexOf(\"?\");\n if (searchPos < 0) {\n options.pathname = options.path;\n }\n else {\n options.pathname = options.path.substring(0, searchPos);\n options.search = options.path.substring(searchPos);\n }\n }\n};\n\n\n// Executes the next native request (initial or redirect)\nRedirectableRequest.prototype._performRequest = function () {\n // Load the native protocol\n var protocol = this._options.protocol;\n var nativeProtocol = this._options.nativeProtocols[protocol];\n if (!nativeProtocol) {\n this.emit(\"error\", new TypeError(\"Unsupported protocol \" + protocol));\n return;\n }\n\n // If specified, use the agent corresponding to the protocol\n // (HTTP and HTTPS use different types of agents)\n if (this._options.agents) {\n var scheme = protocol.slice(0, -1);\n this._options.agent = this._options.agents[scheme];\n }\n\n // Create the native request and set up its event handlers\n var request = this._currentRequest =\n nativeProtocol.request(this._options, this._onNativeResponse);\n request._redirectable = this;\n for (var event of events) {\n request.on(event, eventHandlers[event]);\n }\n\n // RFC7230\u00A75.3.1: When making a request directly to an origin server, [\u2026]\n // a client MUST send only the absolute path [\u2026] as the request-target.\n this._currentUrl = /^\\//.test(this._options.path) ?\n url.format(this._options) :\n // When making a request to a proxy, [\u2026]\n // a client MUST send the target URI in absolute-form [\u2026].\n this._options.path;\n\n // End a redirected request\n // (The first request must be ended explicitly with RedirectableRequest#end)\n if (this._isRedirect) {\n // Write the request entity and end\n var i = 0;\n var self = this;\n var buffers = this._requestBodyBuffers;\n (function writeNext(error) {\n // Only write if this request has not been redirected yet\n /* istanbul ignore else */\n if (request === self._currentRequest) {\n // Report any write errors\n /* istanbul ignore if */\n if (error) {\n self.emit(\"error\", error);\n }\n // Write the next buffer if there are still left\n else if (i < buffers.length) {\n var buffer = buffers[i++];\n /* istanbul ignore else */\n if (!request.finished) {\n request.write(buffer.data, buffer.encoding, writeNext);\n }\n }\n // End the request if `end` has been called on us\n else if (self._ended) {\n request.end();\n }\n }\n }());\n }\n};\n\n// Processes a response from the current native request\nRedirectableRequest.prototype._processResponse = function (response) {\n // Store the redirected response\n var statusCode = response.statusCode;\n if (this._options.trackRedirects) {\n this._redirects.push({\n url: this._currentUrl,\n headers: response.headers,\n statusCode: statusCode,\n });\n }\n\n // RFC7231\u00A76.4: The 3xx (Redirection) class of status code indicates\n // that further action needs to be taken by the user agent in order to\n // fulfill the request. If a Location header field is provided,\n // the user agent MAY automatically redirect its request to the URI\n // referenced by the Location field value,\n // even if the specific status code is not understood.\n\n // If the response is not a redirect; return it as-is\n var location = response.headers.location;\n if (!location || this._options.followRedirects === false ||\n statusCode < 300 || statusCode >= 400) {\n response.responseUrl = this._currentUrl;\n response.redirects = this._redirects;\n this.emit(\"response\", response);\n\n // Clean up\n this._requestBodyBuffers = [];\n return;\n }\n\n // The response is a redirect, so abort the current request\n abortRequest(this._currentRequest);\n // Discard the remainder of the response to avoid waiting for data\n response.destroy();\n\n // RFC7231\u00A76.4: A client SHOULD detect and intervene\n // in cyclical redirections (i.e., \"infinite\" redirection loops).\n if (++this._redirectCount > this._options.maxRedirects) {\n this.emit(\"error\", new TooManyRedirectsError());\n return;\n }\n\n // Store the request headers if applicable\n var requestHeaders;\n var beforeRedirect = this._options.beforeRedirect;\n if (beforeRedirect) {\n requestHeaders = Object.assign({\n // The Host header was set by nativeProtocol.request\n Host: response.req.getHeader(\"host\"),\n }, this._options.headers);\n }\n\n // RFC7231\u00A76.4: Automatic redirection needs to done with\n // care for methods not known to be safe, [\u2026]\n // RFC7231\u00A76.4.2\u20133: For historical reasons, a user agent MAY change\n // the request method from POST to GET for the subsequent request.\n var method = this._options.method;\n if ((statusCode === 301 || statusCode === 302) && this._options.method === \"POST\" ||\n // RFC7231\u00A76.4.4: The 303 (See Other) status code indicates that\n // the server is redirecting the user agent to a different resource [\u2026]\n // A user agent can perform a retrieval request targeting that URI\n // (a GET or HEAD request if using HTTP) [\u2026]\n (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {\n this._options.method = \"GET\";\n // Drop a possible entity and headers related to it\n this._requestBodyBuffers = [];\n removeMatchingHeaders(/^content-/i, this._options.headers);\n }\n\n // Drop the Host header, as the redirect might lead to a different host\n var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);\n\n // If the redirect is relative, carry over the host of the last request\n var currentUrlParts = url.parse(this._currentUrl);\n var currentHost = currentHostHeader || currentUrlParts.host;\n var currentUrl = /^\\w+:/.test(location) ? this._currentUrl :\n url.format(Object.assign(currentUrlParts, { host: currentHost }));\n\n // Determine the URL of the redirection\n var redirectUrl;\n try {\n redirectUrl = url.resolve(currentUrl, location);\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError({ cause: cause }));\n return;\n }\n\n // Create the redirected request\n debug(\"redirecting to\", redirectUrl);\n this._isRedirect = true;\n var redirectUrlParts = url.parse(redirectUrl);\n Object.assign(this._options, redirectUrlParts);\n\n // Drop confidential headers when redirecting to a less secure protocol\n // or to a different domain that is not a superdomain\n if (redirectUrlParts.protocol !== currentUrlParts.protocol &&\n redirectUrlParts.protocol !== \"https:\" ||\n redirectUrlParts.host !== currentHost &&\n !isSubdomain(redirectUrlParts.host, currentHost)) {\n removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);\n }\n\n // Evaluate the beforeRedirect callback\n if (isFunction(beforeRedirect)) {\n var responseDetails = {\n headers: response.headers,\n statusCode: statusCode,\n };\n var requestDetails = {\n url: currentUrl,\n method: method,\n headers: requestHeaders,\n };\n try {\n beforeRedirect(this._options, responseDetails, requestDetails);\n }\n catch (err) {\n this.emit(\"error\", err);\n return;\n }\n this._sanitizeOptions(this._options);\n }\n\n // Perform the redirected request\n try {\n this._performRequest();\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError({ cause: cause }));\n }\n};\n\n// Wraps the key/value object of protocols with redirect functionality\nfunction wrap(protocols) {\n // Default settings\n var exports = {\n maxRedirects: 21,\n maxBodyLength: 10 * 1024 * 1024,\n };\n\n // Wrap each protocol\n var nativeProtocols = {};\n Object.keys(protocols).forEach(function (scheme) {\n var protocol = scheme + \":\";\n var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];\n var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);\n\n // Executes a request, following redirects\n function request(input, options, callback) {\n // Parse parameters\n if (isString(input)) {\n var parsed;\n try {\n parsed = urlToOptions(new URL(input));\n }\n catch (err) {\n /* istanbul ignore next */\n parsed = url.parse(input);\n }\n if (!isString(parsed.protocol)) {\n throw new InvalidUrlError({ input });\n }\n input = parsed;\n }\n else if (URL && (input instanceof URL)) {\n input = urlToOptions(input);\n }\n else {\n callback = options;\n options = input;\n input = { protocol: protocol };\n }\n if (isFunction(options)) {\n callback = options;\n options = null;\n }\n\n // Set defaults\n options = Object.assign({\n maxRedirects: exports.maxRedirects,\n maxBodyLength: exports.maxBodyLength,\n }, input, options);\n options.nativeProtocols = nativeProtocols;\n if (!isString(options.host) && !isString(options.hostname)) {\n options.hostname = \"::1\";\n }\n\n assert.equal(options.protocol, protocol, \"protocol mismatch\");\n debug(\"options\", options);\n return new RedirectableRequest(options, callback);\n }\n\n // Executes a GET request, following redirects\n function get(input, options, callback) {\n var wrappedRequest = wrappedProtocol.request(input, options, callback);\n wrappedRequest.end();\n return wrappedRequest;\n }\n\n // Expose the properties on the wrapped protocol\n Object.defineProperties(wrappedProtocol, {\n request: { value: request, configurable: true, enumerable: true, writable: true },\n get: { value: get, configurable: true, enumerable: true, writable: true },\n });\n });\n return exports;\n}\n\n/* istanbul ignore next */\nfunction noop() { /* empty */ }\n\n// from https://github.com/nodejs/node/blob/master/lib/internal/url.js\nfunction urlToOptions(urlObject) {\n var options = {\n protocol: urlObject.protocol,\n hostname: urlObject.hostname.startsWith(\"[\") ?\n /* istanbul ignore next */\n urlObject.hostname.slice(1, -1) :\n urlObject.hostname,\n hash: urlObject.hash,\n search: urlObject.search,\n pathname: urlObject.pathname,\n path: urlObject.pathname + urlObject.search,\n href: urlObject.href,\n };\n if (urlObject.port !== \"\") {\n options.port = Number(urlObject.port);\n }\n return options;\n}\n\nfunction removeMatchingHeaders(regex, headers) {\n var lastValue;\n for (var header in headers) {\n if (regex.test(header)) {\n lastValue = headers[header];\n delete headers[header];\n }\n }\n return (lastValue === null || typeof lastValue === \"undefined\") ?\n undefined : String(lastValue).trim();\n}\n\nfunction createErrorType(code, message, baseClass) {\n // Create constructor\n function CustomError(properties) {\n Error.captureStackTrace(this, this.constructor);\n Object.assign(this, properties || {});\n this.code = code;\n this.message = this.cause ? message + \": \" + this.cause.message : message;\n }\n\n // Attach constructor and set default properties\n CustomError.prototype = new (baseClass || Error)();\n CustomError.prototype.constructor = CustomError;\n CustomError.prototype.name = \"Error [\" + code + \"]\";\n return CustomError;\n}\n\nfunction abortRequest(request) {\n for (var event of events) {\n request.removeListener(event, eventHandlers[event]);\n }\n request.on(\"error\", noop);\n request.abort();\n}\n\nfunction isSubdomain(subdomain, domain) {\n assert(isString(subdomain) && isString(domain));\n var dot = subdomain.length - domain.length - 1;\n return dot > 0 && subdomain[dot] === \".\" && subdomain.endsWith(domain);\n}\n\nfunction isString(value) {\n return typeof value === \"string\" || value instanceof String;\n}\n\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\nfunction isBuffer(value) {\n return typeof value === \"object\" && (\"length\" in value);\n}\n\n// Exports\nmodule.exports = wrap({ http: http, https: https });\nmodule.exports.wrap = wrap;\n", "{\n \"name\": \"axios\",\n \"version\": \"0.21.4\",\n \"description\": \"Promise based HTTP client for the browser and node.js\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"test\": \"grunt test\",\n \"start\": \"node ./sandbox/server.js\",\n \"build\": \"NODE_ENV=production grunt build\",\n \"preversion\": \"npm test\",\n \"version\": \"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\n \"postversion\": \"git push && git push --tags\",\n \"examples\": \"node ./examples/server.js\",\n \"coveralls\": \"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\n \"fix\": \"eslint --fix lib/**/*.js\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/axios/axios.git\"\n },\n \"keywords\": [\n \"xhr\",\n \"http\",\n \"ajax\",\n \"promise\",\n \"node\"\n ],\n \"author\": \"Matt Zabriskie\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/axios/axios/issues\"\n },\n \"homepage\": \"https://axios-http.com\",\n \"devDependencies\": {\n \"coveralls\": \"^3.0.0\",\n \"es6-promise\": \"^4.2.4\",\n \"grunt\": \"^1.3.0\",\n \"grunt-banner\": \"^0.6.0\",\n \"grunt-cli\": \"^1.2.0\",\n \"grunt-contrib-clean\": \"^1.1.0\",\n \"grunt-contrib-watch\": \"^1.0.0\",\n \"grunt-eslint\": \"^23.0.0\",\n \"grunt-karma\": \"^4.0.0\",\n \"grunt-mocha-test\": \"^0.13.3\",\n \"grunt-ts\": \"^6.0.0-beta.19\",\n \"grunt-webpack\": \"^4.0.2\",\n \"istanbul-instrumenter-loader\": \"^1.0.0\",\n \"jasmine-core\": \"^2.4.1\",\n \"karma\": \"^6.3.2\",\n \"karma-chrome-launcher\": \"^3.1.0\",\n \"karma-firefox-launcher\": \"^2.1.0\",\n \"karma-jasmine\": \"^1.1.1\",\n \"karma-jasmine-ajax\": \"^0.1.13\",\n \"karma-safari-launcher\": \"^1.0.0\",\n \"karma-sauce-launcher\": \"^4.3.6\",\n \"karma-sinon\": \"^1.0.5\",\n \"karma-sourcemap-loader\": \"^0.3.8\",\n \"karma-webpack\": \"^4.0.2\",\n \"load-grunt-tasks\": \"^3.5.2\",\n \"minimist\": \"^1.2.0\",\n \"mocha\": \"^8.2.1\",\n \"sinon\": \"^4.5.0\",\n \"terser-webpack-plugin\": \"^4.2.3\",\n \"typescript\": \"^4.0.5\",\n \"url-search-params\": \"^0.10.0\",\n \"webpack\": \"^4.44.2\",\n \"webpack-dev-server\": \"^3.11.0\"\n },\n \"browser\": {\n \"./lib/adapters/http.js\": \"./lib/adapters/xhr.js\"\n },\n \"jsdelivr\": \"dist/axios.min.js\",\n \"unpkg\": \"dist/axios.min.js\",\n \"typings\": \"./index.d.ts\",\n \"dependencies\": {\n \"follow-redirects\": \"^1.14.0\"\n },\n \"bundlesize\": [\n {\n \"path\": \"./dist/axios.min.js\",\n \"threshold\": \"5kB\"\n }\n ]\n}\n", "'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildFullPath = require('../core/buildFullPath');\nvar buildURL = require('./../helpers/buildURL');\nvar http = require('http');\nvar https = require('https');\nvar httpFollow = require('follow-redirects').http;\nvar httpsFollow = require('follow-redirects').https;\nvar url = require('url');\nvar zlib = require('zlib');\nvar pkg = require('./../../package.json');\nvar createError = require('../core/createError');\nvar enhanceError = require('../core/enhanceError');\n\nvar isHttps = /https:?/;\n\n/**\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} proxy\n * @param {string} location\n */\nfunction setProxy(options, proxy, location) {\n options.hostname = proxy.host;\n options.host = proxy.host;\n options.port = proxy.port;\n options.path = location;\n\n // Basic proxy authorization\n if (proxy.auth) {\n var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n // If a proxy is used, any redirects must also pass through the proxy\n options.beforeRedirect = function beforeRedirect(redirection) {\n redirection.headers.host = redirection.host;\n setProxy(redirection, proxy, redirection.href);\n };\n}\n\n/*eslint consistent-return:0*/\nmodule.exports = function httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {\n var resolve = function resolve(value) {\n resolvePromise(value);\n };\n var reject = function reject(value) {\n rejectPromise(value);\n };\n var data = config.data;\n var headers = config.headers;\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n if ('User-Agent' in headers || 'user-agent' in headers) {\n // User-Agent is specified; handle case where no UA header is desired\n if (!headers['User-Agent'] && !headers['user-agent']) {\n delete headers['User-Agent'];\n delete headers['user-agent'];\n }\n // Otherwise, use specified value\n } else {\n // Only set header if it hasn't been set in config\n headers['User-Agent'] = 'axios/' + pkg.version;\n }\n\n if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(createError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n config\n ));\n }\n\n // Add Content-Length header if data exists\n headers['Content-Length'] = data.length;\n }\n\n // HTTP basic authentication\n var auth = undefined;\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n // Parse url\n var fullPath = buildFullPath(config.baseURL, config.url);\n var parsed = url.parse(fullPath);\n var protocol = parsed.protocol || 'http:';\n\n if (!auth && parsed.auth) {\n var urlAuth = parsed.auth.split(':');\n var urlUsername = urlAuth[0] || '';\n var urlPassword = urlAuth[1] || '';\n auth = urlUsername + ':' + urlPassword;\n }\n\n if (auth) {\n delete headers.Authorization;\n }\n\n var isHttpsRequest = isHttps.test(protocol);\n var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n\n var options = {\n path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, ''),\n method: config.method.toUpperCase(),\n headers: headers,\n agent: agent,\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth: auth\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n }\n\n var proxy = config.proxy;\n if (!proxy && proxy !== false) {\n var proxyEnv = protocol.slice(0, -1) + '_proxy';\n var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];\n if (proxyUrl) {\n var parsedProxyUrl = url.parse(proxyUrl);\n var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;\n var shouldProxy = true;\n\n if (noProxyEnv) {\n var noProxy = noProxyEnv.split(',').map(function trim(s) {\n return s.trim();\n });\n\n shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {\n if (!proxyElement) {\n return false;\n }\n if (proxyElement === '*') {\n return true;\n }\n if (proxyElement[0] === '.' &&\n parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {\n return true;\n }\n\n return parsed.hostname === proxyElement;\n });\n }\n\n if (shouldProxy) {\n proxy = {\n host: parsedProxyUrl.hostname,\n port: parsedProxyUrl.port,\n protocol: parsedProxyUrl.protocol\n };\n\n if (parsedProxyUrl.auth) {\n var proxyUrlAuth = parsedProxyUrl.auth.split(':');\n proxy.auth = {\n username: proxyUrlAuth[0],\n password: proxyUrlAuth[1]\n };\n }\n }\n }\n }\n\n if (proxy) {\n options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');\n setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n var transport;\n var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsProxy ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n transport = isHttpsProxy ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n }\n\n // Create the request\n var req = transport.request(options, function handleResponse(res) {\n if (req.aborted) return;\n\n // uncompress the response body transparently if required\n var stream = res;\n\n // return the last request in case of redirects\n var lastRequest = res.req || req;\n\n\n // if no content, is HEAD request or decompress disabled we should not decompress\n if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {\n switch (res.headers['content-encoding']) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'compress':\n case 'deflate':\n // add the unzipper to the body stream processing pipeline\n stream = stream.pipe(zlib.createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n }\n }\n\n var response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: res.headers,\n config: config,\n request: lastRequest\n };\n\n if (config.responseType === 'stream') {\n response.data = stream;\n settle(resolve, reject, response);\n } else {\n var responseBuffer = [];\n var totalResponseBytes = 0;\n stream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n totalResponseBytes += chunk.length;\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {\n stream.destroy();\n reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n config, null, lastRequest));\n }\n });\n\n stream.on('error', function handleStreamError(err) {\n if (req.aborted) return;\n reject(enhanceError(err, config, null, lastRequest));\n });\n\n stream.on('end', function handleStreamEnd() {\n var responseData = Buffer.concat(responseBuffer);\n if (config.responseType !== 'arraybuffer') {\n responseData = responseData.toString(config.responseEncoding);\n if (!config.responseEncoding || config.responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n\n response.data = responseData;\n settle(resolve, reject, response);\n });\n }\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return;\n reject(enhanceError(err, config, null, req));\n });\n\n // Handle request timeout\n if (config.timeout) {\n // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.\n var timeout = parseInt(config.timeout, 10);\n\n if (isNaN(timeout)) {\n reject(createError(\n 'error trying to parse `config.timeout` to int',\n config,\n 'ERR_PARSE_TIMEOUT',\n req\n ));\n\n return;\n }\n\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devoring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(timeout, function handleRequestTimeout() {\n req.abort();\n reject(createError(\n 'timeout of ' + timeout + 'ms exceeded',\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n req\n ));\n });\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (req.aborted) return;\n\n req.abort();\n reject(cancel);\n });\n }\n\n // Send the request\n if (utils.isStream(data)) {\n data.on('error', function handleStreamError(err) {\n reject(enhanceError(err, config, null, req));\n }).pipe(req);\n } else {\n req.end(data);\n }\n });\n};\n", "'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n", "'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n", "'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n", "'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n", "'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n", "'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n", "'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n", "'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n", "'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n", "'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n", "module.exports = require('./lib/axios');", "import path from \"node:path\";\n\nimport findUp from \"find-up\";\nimport pkgDir from \"pkg-dir\";\n\n// Consts\nconst IS_COMPONENT_LIBRARY = __dirname.includes(\"node_modules\");\nconst PROJECT_ALIASES = getComponentsLibAliases();\n\n/**\n * Returns the instance or monorepo paths.\n *\n * @param customPath The path for the instance components\n */\nfunction resolveComponentsPath(customPath = \"\") {\n\treturn IS_COMPONENT_LIBRARY\n\t\t? path.resolve(pkgDir.sync(__dirname) as string, \"../../../\", customPath)\n\t\t: path.resolve(\n\t\t\t\tpkgDir.sync(__dirname) as string,\n\t\t\t\t\"../griddo-components\",\n\t\t\t\tcustomPath,\n\t\t\t);\n}\n\n/**\n * Return the instance or monorepo components {t|j}sconfig.json file.\n */\nfunction getComponentsJSConfig() {\n\tconst jsConfigPath = findUp.sync(\"jsconfig.json\", {\n\t\tcwd: resolveComponentsPath(),\n\t});\n\tconst tsConfigPath = findUp.sync(\"tsconfig.json\", {\n\t\tcwd: resolveComponentsPath(),\n\t});\n\n\treturn tsConfigPath || jsConfigPath;\n}\n\n/**\n * Get the instance webpack aliases\n */\nfunction getComponentsLibAliases() {\n\t// eslint-disable-next-line @typescript-eslint/no-var-requires\n\tconst xsConfig = require(getComponentsJSConfig() as string);\n\n\treturn Object.keys(xsConfig?.compilerOptions?.paths).reduce(\n\t\t(currentAlias, pathKey) => {\n\t\t\tconst [aliasKey] = pathKey.split(\"/\");\n\t\t\tconst [pathAtJsConfig] =\n\t\t\t\txsConfig &&\n\t\t\t\txsConfig.compilerOptions &&\n\t\t\t\txsConfig.compilerOptions.paths &&\n\t\t\t\txsConfig.compilerOptions.paths[pathKey];\n\n\t\t\tconst [relativePathToDir] = pathAtJsConfig.split(\"/*\");\n\n\t\t\tconst absolutePath = resolveComponentsPath(relativePathToDir);\n\n\t\t\treturn {\n\t\t\t\t...currentAlias,\n\t\t\t\t[aliasKey]: absolutePath,\n\t\t\t};\n\t\t},\n\t\t{\n\t\t\t// Por este motivo se puede hacer `... import from \"@griddo-instance\" en\n\t\t\t// los packages del monorepo.\n\t\t\t\"@griddo-instance\": `${resolveComponentsPath()}/src/index.js`,\n\t\t},\n\t);\n}\n\nexport {\n\tIS_COMPONENT_LIBRARY,\n\tPROJECT_ALIASES,\n\tgetComponentsJSConfig,\n\tgetComponentsLibAliases,\n\tresolveComponentsPath,\n};\n", "import path from \"node:path\";\n\nimport pkgDir from \"pkg-dir\";\n\nimport { resolveComponentsPath } from \"./exporter/utils/instance\";\n\n// Paths\nconst REPO_ROOT_DIR = pkgDir.sync(path.resolve(__dirname, \"../..\"));\nconst CX_ROOT_DIR = pkgDir.sync(__dirname);\nconst SSG_DIR = path.resolve(pkgDir.sync(__dirname));\nconst CX_CACHE_DIR = path.resolve(CX_ROOT_DIR, \"caches\");\nconst COMPONENTS_DIR = resolveComponentsPath();\nconst EXPORTS_DIR = path.join(REPO_ROOT_DIR, \"exports/sites\");\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst { version: griddoVersion } = require(\n\tpath.join(CX_ROOT_DIR, \"package.json\"),\n);\n\nconst config = {\n\tproDomain: \"pro-\",\n\tgriddoVersion,\n\tpaths: (domain) => ({\n\t\t__caches: path.join(CX_CACHE_DIR, domain || \"\"),\n\t\t__components: COMPONENTS_DIR,\n\t\t__cx: CX_ROOT_DIR,\n\t\t__exports: path.join(EXPORTS_DIR, domain || \"\"),\n\t\t__root: REPO_ROOT_DIR,\n\t\t__ssg: SSG_DIR,\n\t\t__exports_dist: domain ? path.join(EXPORTS_DIR, domain, \"dist\") : \"\",\n\t\t__cx_dist: path.join(CX_ROOT_DIR, \"dist\"),\n\t}),\n};\n\nexport default config;\n", "#!/usr/bin/env node\n/* eslint-disable node/shebang */\n\nimport { runGatsbyAdapter } from \"../adapters\";\nimport { measureExecutionTime } from \"../utils/core-utils\";\nimport { getInstanceDomainsOrThrow } from \"../utils/domains\";\nimport { boxLog } from \"../utils/loggin\";\n\nasync function startRender() {\n\ttry {\n\t\tconst domains = await getInstanceDomainsOrThrow();\n\t\tconst exeTime = await measureExecutionTime([\n\t\t\t() => runGatsbyAdapter(domains),\n\t\t]);\n\n\t\tboxLog(`All domains rendered in ${exeTime}s.`, \"\", 1, 0);\n\n\t\tprocess.exit(0);\n\t} catch (error) {\n\t\tconsole.log(error);\n\n\t\tprocess.exit(1);\n\t}\n}\n\nexport { startRender };\n", "import path from \"node:path\";\n\nimport {\n\tgetGatsbyAssetPrefixWithDomain,\n\tlegacy__createDistFromGatsbyPublic,\n\trunGatsbyBuildCommand,\n} from \"./utils\";\nimport { getArtifacts } from \"../../artifacts\";\nimport { envs } from \"../../constants\";\nimport { apiRegister } from \"../../registers\";\nimport { insertAlert } from \"../../utils/alerts\";\nimport {\n\tcreateRenderMetadata,\n\tdoLifeCycle,\n\tgetConfig,\n} from \"../../utils/core-utils\";\nimport { createBuildData } from \"../../utils/create-build-data\";\nimport {\n\tclearEmptyDirs,\n\tcopyArtifacts,\n\tcreateArtifacts,\n\tmoveArtifacts,\n\tremoveArtifacts,\n\tremoveVirtualPagesFromStore,\n\trenameArtifact,\n} from \"../../utils/folders\";\nimport { debugLog, infoLog, printExporterLogo } from \"../../utils/loggin\";\nimport {\n\tcreateSentinelRenderFile,\n\tdeleteSentinelRenderFile,\n\tisValidRenderProcessOrThrow,\n} from \"../../utils/render\";\n\nconst config = getConfig();\n\nasync function renderDomain(domain: string) {\n\tinfoLog(`Initializing render for the domain ${domain}`);\n\n\tcreateSentinelRenderFile();\n\n\tconst cxPaths = config.paths(domain);\n\tconst domainArtifacts = getArtifacts(\"gatsby\", { cxPaths });\n\tconst { __ssg, __exports, __caches, __cx, __components } = cxPaths;\n\n\tconst arts = {\n\t\t...domainArtifacts,\n\t\tall: {\n\t\t\tdisposables: [\n\t\t\t\t...domainArtifacts.cx.disposables,\n\t\t\t\t...domainArtifacts.ssg.disposables,\n\t\t\t],\n\t\t\tinitials: [\n\t\t\t\t...domainArtifacts.cx.initials,\n\t\t\t\t...domainArtifacts.ssg.initials,\n\t\t\t],\n\t\t},\n\t};\n\n\t// This variables are for:\n\t// - Create the dist directory from public in the Relocation LifeCycle.\n\t// - Pass to the gatsby-build command via spawnSync in the SSG LifeCycle.\n\tconst assetPrefix = getGatsbyAssetPrefixWithDomain(domain);\n\tconst needsAssetPrefix = !!assetPrefix && assetPrefix !== \"\";\n\n\t// LifeCycles\n\n\tawait doLifeCycle(\"Clean\", {\n\t\tsteps: [() => removeArtifacts(arts.all.disposables)],\n\t});\n\n\tawait doLifeCycle(\"Prepare\", {\n\t\tsteps: [() => createArtifacts(arts.all.initials)],\n\t});\n\n\tawait doLifeCycle(\"Restore\", {\n\t\tsteps: [\n\t\t\t() => copyArtifacts(__components, __ssg, [\"static\"]),\n\t\t\t() => copyArtifacts(__exports, __cx, arts.cx.archivables),\n\t\t\t() => renameArtifact(path.join(__cx, \"dist\"), path.join(__ssg, \"public\")),\n\t\t\t() => moveArtifacts(__caches, __cx, arts.cx.cacheables),\n\t\t\t() => moveArtifacts(__caches, __ssg, arts.ssg.cacheables),\n\t\t],\n\t});\n\n\tawait doLifeCycle(\"Data\", {\n\t\tsteps: [() => createBuildData(domain)],\n\t});\n\n\tawait doLifeCycle(\"SSG\", {\n\t\tsteps: [() => runGatsbyBuildCommand(assetPrefix)],\n\t});\n\n\tawait doLifeCycle(\"Relocation\", {\n\t\tsteps: [() => legacy__createDistFromGatsbyPublic(domain, needsAssetPrefix)],\n\t});\n\n\tawait doLifeCycle(\"Meta\", {\n\t\tsteps: [() => createRenderMetadata(domain)],\n\t});\n\n\tawait doLifeCycle(\"Archive\", {\n\t\tsteps: [\n\t\t\t() => removeVirtualPagesFromStore(),\n\t\t\t() => clearEmptyDirs(path.join(__cx, \"dist\")),\n\t\t\t() =>\n\t\t\t\tmoveArtifacts(__cx, __exports, arts.cx.archivables, {\n\t\t\t\t\twithBackup: true,\n\t\t\t\t}),\n\t\t\t() => moveArtifacts(__cx, __caches, arts.cx.cacheables),\n\t\t\t() => moveArtifacts(__ssg, __caches, arts.ssg.cacheables),\n\t\t],\n\t});\n\n\tawait doLifeCycle(\"Close\", {\n\t\tsteps: [() => removeArtifacts(arts.all.disposables)],\n\t});\n\n\tawait doLifeCycle(\"HealthCheck\", {\n\t\tsteps: [() => isValidRenderProcessOrThrow()],\n\t});\n\n\tdeleteSentinelRenderFile();\n}\n\nasync function runGatsbyAdapter(domains: Array<string>) {\n\tprintExporterLogo(\"gatsby\");\n\n\tfor (const domain of domains) {\n\t\tawait renderDomain(domain);\n\t}\n\n\tif (envs.GRIDDO_ALERT_FEATURE && apiRegister.haveEntries()) {\n\t\tconst registerContent = apiRegister.get(\"API_RESPONSE_TOO_BIG\");\n\n\t\tdebugLog(\"\\nRender register report\\n\");\n\t\tdebugLog(registerContent);\n\t\tdebugLog();\n\n\t\tinsertAlert({\n\t\t\tdescription: \"API response size is too large (80KB).\",\n\t\t\tarea: \"Griddo\",\n\t\t\tlevel: \"W\",\n\t\t\tfullData: {\n\t\t\t\toutput: registerContent,\n\t\t\t\tdate: new Date().toISOString(),\n\t\t\t},\n\t\t});\n\t}\n}\n\nexport { runGatsbyAdapter };\n", "import { spawnSync } from \"node:child_process\";\nimport path from \"node:path\";\n\nimport dotenv from \"dotenv\";\nimport fsx from \"fs-extra\";\n\nimport { getConfig } from \"../../utils/core-utils\";\nimport { verboseLog } from \"../../utils/loggin\";\n\ndotenv.config();\n\nconst config = getConfig();\n\n/**\n * Return the assetPrefix with the domain concatenated `assetPrefix/domain` only\n * if the domain is \"pro-\" **and** there is a env `GRIDDO_ASSET_PREFIX` with any\n * value different from `null`, `undefined` or `empty string`\n *\n * else...\n * - If assetPrefix or domain is falsy, returns \"\"\n * - If the domain is not \"pro-\", returns \"\"\n */\nfunction getGatsbyAssetPrefixWithDomain(domain: string) {\n\tconst { proDomain } = getConfig();\n\tconst assetPrefix =\n\t\tprocess.env.GRIDDO_ASSET_PREFIX || process.env.ASSET_PREFIX;\n\n\tif (!assetPrefix || !domain) return \"\";\n\tif (!domain.startsWith(proDomain)) return \"\";\n\n\tconst assetPrefixWithDomain = `${assetPrefix}/${domain}`;\n\n\tverboseLog(\n\t\t`Reading env.GRIDDO_ASSET_PREFIX, ${process.env.GRIDDO_ASSET_PREFIX}`,\n\t);\n\tverboseLog(\n\t\t`Setting the asset prefix with the domain concatenated, ${assetPrefixWithDomain}`,\n\t);\n\n\treturn assetPrefixWithDomain;\n}\n\n/**\n * Spawn a new node process `yarn gatsby-build`\n * @note This proccess (`yarn gatsby-build`) can not access to the custom Griddo\n * `process.env` so it needs variables passed to it via the `env` prop.\n */\nfunction runGatsbyBuildCommand(assetPrefixWithDomain: string) {\n\tverboseLog(`read assetPrefixWithDomain, ${assetPrefixWithDomain}`);\n\n\tconst { __ssg } = config.paths();\n\n\tconst command = spawnSync(\n\t\t\"yarn\",\n\t\t[\"gatsby-build\", process.env.GRIDDO_SSG_VERBOSE ? \"--verbose\" : \"\"],\n\t\t{\n\t\t\tcwd: __ssg,\n\t\t\tstdio: [\"ignore\", \"inherit\", \"ignore\"],\n\t\t\tencoding: \"utf8\",\n\t\t\tshell: true,\n\t\t\tenv: Object.assign(process.env, {\n\t\t\t\tGRIDDO_EXPORTER: \"true\",\n\t\t\t\tSPAWN_ASSET_PREFIX_WITH_DOMAIN: assetPrefixWithDomain,\n\t\t\t}),\n\t\t},\n\t);\n\n\tif (command.status !== 0) {\n\t\tthrow new Error(`Error in gatsby build ${JSON.stringify(command)}`);\n\t}\n}\n\n/**\n * Update the Griddo's `/dist` dir with the contents from `public` dir only\n * with files of type: js, json and css.\n */\nasync function legacy__createDistFromGatsbyPublic(\n\tdomain: string,\n\tneedsAssetPrefix: boolean,\n) {\n\tconst { __cx, __ssg } = config.paths(domain);\n\n\tconst cxDistDir = path.join(__cx, \"dist\");\n\tconst cxAssetsDir = path.join(__cx, \"assets\");\n\tconst cxDistDirWithDomain = path.join(__cx, \"dist\", domain);\n\tconst publicDir = path.join(__ssg, \"public\");\n\n\tconst validFilesFromPublic = fsx\n\t\t.readdirSync(publicDir)\n\t\t.filter(\n\t\t\t(file) =>\n\t\t\t\tpath.extname(file) === \".js\" ||\n\t\t\t\tpath.extname(file) === \".json\" ||\n\t\t\t\tpath.extname(file) === \".css\",\n\t\t);\n\n\tconst pageDataSrc = `${publicDir}/page-data`;\n\tconst pageDataDest = `${cxAssetsDir}/page-data`;\n\n\tconst projectStaticSrc = path.join(__ssg, \"static\");\n\tconst projectStaticDest = cxAssetsDir;\n\n\tconst gatsbyStaticSrc = `${cxDistDir}/static`;\n\tconst gatsbyStaticDest = `${cxAssetsDir}/static`;\n\n\ttry {\n\t\tfsx.mkdirSync(cxAssetsDir, { recursive: true });\n\t\tfsx.copySync(publicDir, cxDistDir, { preserveTimestamps: true });\n\n\t\tif (needsAssetPrefix) {\n\t\t\tfsx.copySync(pageDataSrc, pageDataDest, { preserveTimestamps: true });\n\t\t\tif (fsx.existsSync(projectStaticSrc)) {\n\t\t\t\tfsx.copySync(projectStaticSrc, projectStaticDest, {\n\t\t\t\t\toverwrite: false,\n\t\t\t\t\tpreserveTimestamps: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\tfsx.copySync(gatsbyStaticSrc, gatsbyStaticDest, {\n\t\t\t\toverwrite: false,\n\t\t\t\tpreserveTimestamps: true,\n\t\t\t});\n\t\t\tif (fsx.existsSync(projectStaticSrc)) {\n\t\t\t\tfsx.copySync(projectStaticSrc, cxDistDirWithDomain, {\n\t\t\t\t\toverwrite: false,\n\t\t\t\t\tpreserveTimestamps: true,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Copia el resto de archivos...\n\t\t\tvalidFilesFromPublic.map(async (file) => {\n\t\t\t\tconst fileSrc = `${publicDir}/${file}`;\n\t\t\t\tconst fileDest = `${cxAssetsDir}/${file}`;\n\t\t\t\tfsx.copySync(fileSrc, fileDest, { preserveTimestamps: true });\n\t\t\t});\n\t\t}\n\t} catch (err) {\n\t\tconsole.error(err);\n\t}\n}\n\nexport {\n\tgetGatsbyAssetPrefixWithDomain,\n\tlegacy__createDistFromGatsbyPublic,\n\trunGatsbyBuildCommand,\n};\n", "import type { APIResponses } from \"../types/api\";\nimport type { CXConfig, LifeCyclesNames } from \"../types/global\";\nimport type { APIPageObject } from \"../types/pages\";\nimport type { Site } from \"../types/sites\";\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport chalk from \"chalk\";\nimport dotenv from \"dotenv\";\nimport fsx from \"fs-extra\";\nimport pkgDir from \"pkg-dir\";\n\nimport { createDirsSync, removeDirsSync } from \"./folders\";\nimport { boxLog, verboseLog } from \"./loggin\";\nimport { generateBuildReport, generateSitemaps } from \"./sites\";\nimport { envs } from \"../constants\";\nimport { writeRobots } from \"../services/robots\";\n\ndotenv.config();\n\nconst config = getConfig();\n\nconst instanceRootDir = pkgDir.sync()!; // instance root dir\n\n/**\n * Returns the configuration file content.\n *\n * @example\n * const config = getConfig()\n * const { __cx } = config.paths()\n * const { griddoVersion, proDomain } = config\n */\nfunction getConfig(): CXConfig {\n\ttry {\n\t\t// eslint-disable-next-line @typescript-eslint/no-var-requires, node/no-missing-require, node/no-unpublished-require\n\t\tconst configModule = require(\"../../cx.config.js\");\n\t\tconst config = configModule.default;\n\n\t\treturn config;\n\t} catch (error) {\n\t\tconsole.log(\"Error while reading configuration file\");\n\t\tprocess.exit(1);\n\t}\n}\n\n/**\n * Create the initial mandatory directories for a render.\n *\n * @param domain The current domain in render.\n */\nasync function exporterCreateInitialDirectories(domain: string) {\n\tconst { __exports, __caches } = config.paths(domain);\n\n\tcreateDirsSync([__exports]);\n\tverboseLog(\"create `exports/sites/<domain>` directory\");\n\tcreateDirsSync([__caches]);\n\tverboseLog(\"create `caches/<domain>` directory\");\n}\n\n/**\n * Remove trash directories from __cx, maybe from a failed render.\n *\n * @param domain The current domain in render.\n */\nasync function exporterCleanDisposableDirectories(domain: string) {\n\tconst { __cx } = config.paths(domain);\n\n\tremoveDirsSync(__cx, [\"store\", \"apiCache\", \"dist\"]);\n\tverboseLog(\"clean `store`, `apiCache` and `dist` directories from `__cx`\");\n}\n\n/**\n * Returns true for \"true\", \"on\", true and positive numbers.\n * Returns false for \"false\", \"off\", false, 0, negative integers and anything else.\n */\nfunction isTruthy(value: any): boolean {\n\t// Return if Boolean\n\tif (typeof value === \"boolean\") return value;\n\n\t// Return false if null or undefined\n\tif (value === undefined || value === null) return false;\n\n\t// If the String is true or false\n\tif (value.toLowerCase() === \"true\") return true;\n\tif (value.toLowerCase() === \"false\") return false;\n\n\t// \"on\" | \"off\", We love them in Griddo ^^.\n\tif (value.toLowerCase() === \"on\") return true;\n\tif (value.toLowerCase() === \"off\") return false;\n\n\t// Now check if it's a number\n\tconst number = parseInt(value, 10);\n\tif (isNaN(number)) return false;\n\tif (number > 0) return true;\n\n\t// Default to false\n\treturn false;\n}\n\n/**\n * Walk a directory and returns the file pathts.\n *\n * @param dir A directory path.\n */\nfunction walk(dir: string) {\n\tconst results: Array<string> = [];\n\tconst list = fs.readdirSync(dir);\n\tlist.forEach((file) => {\n\t\tconst newLocalFile = `${dir}/${file}`;\n\t\tresults.push(newLocalFile);\n\t});\n\n\treturn results;\n}\n\n/**\n * Walk a directory and returns the JSON file absolute paths with one level of depth.\n * Bypass the `metadata` folder.\n * /abs/.../sotre/<siteId>/jsonfile.json\n * /abs/.../sotre/<siteId>/jsonfile.json\n * /abs/.../sotre/<siteId>/jsonfile.json\n * /abs/.../sotre/<siteId>/jsonfile.json\n */\nfunction walkStore(dir: string): Array<string> {\n\tconst results: Array<string> = [];\n\n\t// Listamos todas las subcarpetas y evitamos entrar en 'metadata'\n\tconst subdirs = fs.readdirSync(dir).filter((file) => {\n\t\tconst fullPath = path.join(dir, file);\n\t\treturn fs.statSync(fullPath).isDirectory() && file !== \"metadata\";\n\t});\n\n\t// Iteramos sobre las subcarpetas\n\tfor (const subdir of subdirs) {\n\t\tconst subdirPath = path.join(dir, subdir);\n\n\t\t// Listamos los archivos en cada subcarpeta y filtramos los .json\n\t\tconst files = fs\n\t\t\t.readdirSync(subdirPath)\n\t\t\t.filter((file) => file.endsWith(\".json\"));\n\n\t\tfor (const file of files) {\n\t\t\tresults.push(path.join(subdirPath, file));\n\t\t}\n\t}\n\n\treturn results;\n}\n\n/**\n * Custom delay using the \"promise hack\",\n *\n * @param ms Amount of miliseconds to be delayed\n */\nfunction delay(ms: number) {\n\treturn new Promise((res) => setTimeout(res, ms));\n}\n\n/**\n * Converts milliseconds to seconds with a fixed number of decimals.\n *\n * @param ms The number in milliseconds.\n * @param fixed The amount of fixed decimals.\n * @returns The converted number in seconds with the fixed number of decimals.\n */\nexport function msToSec(ms: number, decimals = 3) {\n\treturn (ms / 1000).toFixed(decimals);\n}\n\n/**\n * Return a siteID from a response object if exist\n * @param response A response object\n */\nexport function getSafeSiteId(response: APIResponses) {\n\tif (typeof response === \"string\") {\n\t\treturn undefined;\n\t}\n\n\treturn \"site\" in response && response.site ? response?.site : undefined;\n}\n\n/**\n * Remove props from an object\n *\n * @param obj The object\n * @param props An array of props to be removed\n */\nfunction removeProperties(obj: Record<string, unknown>, props: Array<string>) {\n\tfor (const key in obj) {\n\t\tif (props.includes(key)) {\n\t\t\tdelete obj[key];\n\t\t} else if (typeof obj[key] === \"object\") {\n\t\t\tremoveProperties(obj[key] as Record<string, unknown>, props);\n\t\t}\n\t}\n}\n\n/**\n * Return a list of sites with their names and ids.\n *\n * @param sites An array of sites objects\n */\nfunction siteList(sites: Array<Site>) {\n\treturn sites.map(({ name, id }) => `${name} (${id})`).join(\", \");\n}\n\n/**\n * Remove unused files (old) inside the `apiCache` dir\n *\n * @todo remove other file types: sites, socials, etc..\n */\nfunction sanitizeAPICacheDir() {\n\tconst { __cx } = config.paths();\n\tconst dirPath = path.join(__cx, \"apiCache\");\n\tconst allCachedFiles = fs.readdirSync(dirPath);\n\n\t// Object to store the the more rencent file names\n\t// Record<string, string> = { \"234856872634\", \"3268746238747238.json\"};\n\tconst filesByIdMap: Record<string, string> = {};\n\t// ^id ^path\n\n\t// Page files.\n\t// We only need files that describes a page object.\n\tconst pageFilePaths = allCachedFiles.filter((fileName) => {\n\t\tconst filePath = `${dirPath}/${fileName}`;\n\t\tconst fileObject = fsx.readJSONSync(filePath, \"utf-8\") as APIPageObject;\n\t\tconst { id, entity, fullUrl } = fileObject;\n\n\t\t// Is a page file if has id, entity and fullUrl\n\t\treturn !!(id && entity && fullUrl);\n\t});\n\n\t// Fill the filesById object\n\tfor (const fileName of pageFilePaths) {\n\t\tconst filePath = `${dirPath}/${fileName}`;\n\t\tconst fileObject = fsx.readJSONSync(filePath, \"utf-8\") as APIPageObject;\n\t\tconst fileCreationDate = fs.statSync(filePath).mtimeMs;\n\n\t\tconst { id } = fileObject;\n\n\t\t// Is a valid page if doesn't exists in the store object or is newer\n\t\t// that the stored one.\n\t\tconst validPageFile =\n\t\t\t!filesByIdMap[id] ||\n\t\t\tfileCreationDate > fs.statSync(`${dirPath}/${filesByIdMap[id]}`).mtimeMs;\n\n\t\tif (validPageFile) filesByIdMap[id] = fileName;\n\t}\n\n\tlet counter = 0;\n\n\t// Delete files using the store object filesById as reference map.\n\tfor (const fileName of pageFilePaths) {\n\t\tconst filePath = `${dirPath}/${fileName}`;\n\t\tconst fileObject = fsx.readJSONSync(filePath, \"utf-8\") as APIPageObject;\n\n\t\tconst { id } = fileObject;\n\n\t\t// If the filename is not present in the map, remove it!\n\t\tif (fileName !== filesByIdMap[id]) {\n\t\t\tfs.unlinkSync(filePath);\n\t\t\tcounter++;\n\t\t}\n\t}\n\n\tconsole.log(`Sanitize apiCache dir for ${counter} files`);\n}\n\n/**\n * Measures the execution time of a series of sync or async functions.\n * @param functions - Functions to be executed to measure their execution time.\n * @returns A promise that resolves with the total execution time in seconds.\n */\nasync function measureExecutionTime(\n\tfunctions: Array<(...args: Array<unknown>) => unknown | Promise<unknown>>,\n\tdelayInMS = 0,\n): Promise<number> {\n\tconst start = process.hrtime();\n\n\tfor (const func of functions) {\n\t\tawait func();\n\t\tif (delayInMS > 0) {\n\t\t\tawait delay(delayInMS);\n\t\t}\n\t}\n\n\tconst [seconds, miliseconds] = process.hrtime(start);\n\tconst timeInSeconds = seconds + miliseconds / 1e9;\n\n\treturn +timeInSeconds.toFixed(3);\n}\n\nfunction pause(title: string) {\n\tconst isPauseEnabled = !!JSON.parse(\n\t\tprocess.env.GRIDDO_RENDER_BREAKPOINTS_FEATURE || \"false\",\n\t);\n\n\tif (!isPauseEnabled) {\n\t\treturn;\n\t}\n\n\treturn new Promise<void>((resolve) => {\n\t\tconsole.log(\"\\n\");\n\t\tboxLog(`\u231B\uFE0F ${title}`, \"\", 1, 0);\n\t\tprocess.stdin.once(\"data\", () => {\n\t\t\tresolve();\n\t\t});\n\t});\n}\n\n/**\n * Executes a life cycle process, which involves executing an array of\n * functions, printing to the console, and handling errors with optional\n * retries.\n *\n * @async\n * @param name - The name of the life cycle.\n * @param options - The arguments object.\n * @param options.steps - An array of functions to execute.\n * @param options.delay - Delay between steps functions.\n * @param options.bypass - Skip the step functions.\n * @returns - A promise that resolves when the life cycle process is completed.\n */\nasync function doLifeCycle(\n\tname: LifeCyclesNames,\n\toptions: {\n\t\tsteps: Array<(...args: Array<unknown>) => unknown | Promise<any>>;\n\t\tdelay?: number;\n\t\tbypass?: boolean;\n\t},\n) {\n\tconst { steps, bypass, delay } = options;\n\n\tif (bypass) {\n\t\treturn;\n\t}\n\n\tconst attemptsByLifeCycleName: Record<LifeCyclesNames, number> = {\n\t\tArchive: envs.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS,\n\t\tData: envs.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS,\n\t\tMeta: envs.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS,\n\t\tRelocation: envs.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS,\n\t\tClean: envs.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS,\n\t\tRestore: envs.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS,\n\t\tPrepare: envs.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS,\n\t\tClose: envs.GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS,\n\t\tSSG: envs.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS,\n\t\tHealthCheck: 1,\n\t\t__DEBUG__: 1,\n\t};\n\n\tlet trysCount = 0;\n\tconst maxTrysAccepted = attemptsByLifeCycleName[name] || 1;\n\n\twhile (trysCount < maxTrysAccepted) {\n\t\ttry {\n\t\t\tconsole.info(`\\n${chalk.blue(`info`)} start ${name} life-cycle`);\n\t\t\tconst exeTime = await measureExecutionTime(steps, delay);\n\t\t\tconsole.info(`${chalk.green(\"success\")} ${name} - ${exeTime}s`);\n\t\t\t// if no errors, go out!! :)\n\t\t\tawait pause(`${name} LifeCycle`);\n\t\t\tbreak;\n\t\t} catch (error) {\n\t\t\tconst errorString = chalk.bgRed.black(` Error in ${name} LifeCycle `);\n\t\t\tconst attemptsString = chalk.yellow(`Attempt (${trysCount + 1})`);\n\t\t\tconsole.log(`\\n${errorString} ${attemptsString}\\n`);\n\t\t\tconsole.log(error);\n\t\t\tconsole.log();\n\n\t\t\ttrysCount++;\n\t\t}\n\t}\n\tif (trysCount === maxTrysAccepted) {\n\t\tthrow new Error(\n\t\t\t`Exceeded maximum retry attempts (${maxTrysAccepted}) for ${name} LifeCycle`,\n\t\t);\n\t}\n}\n\nfunction isVersionGreaterThan(versionA: string, versionB: string) {\n\tconst [majorA, minorA, patchA] = versionA.split(\".\").map(Number);\n\tconst [majorB, minorB, patchB] = versionB.split(\".\").map(Number);\n\n\tif (majorA !== majorB) {\n\t\treturn majorA > majorB;\n\t}\n\n\tif (minorA !== minorB) {\n\t\treturn minorA > minorB;\n\t}\n\n\treturn patchA > patchB;\n}\n\nfunction isVersionLowerThan(versionA: string, versionB: string) {\n\treturn !isVersionGreaterThan(versionA, versionB);\n}\n\n/**\n * Creates additional files after the render: sitemaps, robots and a report of\n * the finished render.\n *\n * @async\n * @param domain\n */\nasync function createRenderMetadata(domain: string) {\n\tawait generateBuildReport();\n\tawait generateSitemaps();\n\tawait writeRobots(domain);\n}\n\nfunction removeAllSiteDirsFromStore() {\n\tconst { __cx } = config.paths();\n\tconst storeDir = path.join(__cx, \"store\");\n\tconst allDirs = fs.readdirSync(storeDir);\n\n\tconst allSiteDirs = allDirs.filter((dirname) => dirname !== \"metadata\");\n\n\tconst allSiteDirsFullPath = allSiteDirs.map((name) =>\n\t\tpath.join(storeDir, name),\n\t);\n\n\t// Remove all site directories except \"metadata\" directory.\n\tfor (const site of allSiteDirsFullPath) {\n\t\tfs.rmSync(site, { recursive: true, force: true });\n\t}\n}\n\nexport {\n\tcreateRenderMetadata,\n\tdelay,\n\tdoLifeCycle,\n\texporterCleanDisposableDirectories,\n\texporterCreateInitialDirectories,\n\tgetConfig,\n\tinstanceRootDir,\n\tisTruthy,\n\tisVersionGreaterThan,\n\tisVersionLowerThan,\n\tmeasureExecutionTime,\n\tpause,\n\tremoveProperties,\n\tremoveAllSiteDirsFromStore,\n\tsanitizeAPICacheDir,\n\tsiteList,\n\twalk,\n\twalkStore,\n};\n", "import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport fsx, { MakeDirectoryOptions } from \"fs-extra\";\n\nimport { getConfig, walkStore } from \"./core-utils\";\nimport { verboseLog } from \"./loggin\";\n\nconst config = getConfig();\n\n/**\n * Remove an empty directory from the basePath recursively.\n * If the directory has only .xml files it will handle as empty too (empty site)\n *\n * @param baseDir - The base directory.\n */\nconst clearEmptyDirs = (baseDir: string) => {\n\tconst isDir = fsx.statSync(baseDir).isDirectory();\n\tif (!isDir) {\n\t\treturn;\n\t}\n\n\t// archivos o direvtorios dentro de `dir`\n\tlet children = fsx.readdirSync(baseDir);\n\t// let children = childrenRaw.filter((file) => {\n\t// \treturn path.extname(file).toLowerCase() !== \".xml\";\n\t// });\n\tconst dirHasChildren = children.length > 0;\n\n\t// Por cada uno de ellos miramos si tiene hijos, enviamos cada uno de ellos\n\t// a `clearEmptyDirsWithXML`\n\tif (dirHasChildren) {\n\t\tconst childrenCount = children.length;\n\t\tconst xmlCount = children.filter((file) => {\n\t\t\treturn path.extname(file).toLowerCase() === \".xml\";\n\t\t}).length;\n\n\t\t// Todos los hijos son archivos .xml\n\t\t// Podemos borrarlos y dejar el dir vac\u00EDo.\n\t\tif (childrenCount === xmlCount) {\n\t\t\tchildren.forEach(function (xmlFile) {\n\t\t\t\tconst fullPath = path.join(baseDir, xmlFile);\n\t\t\t\tfsx.rmSync(fullPath);\n\t\t\t});\n\t\t\tchildren = fsx.readdirSync(baseDir);\n\t\t}\n\n\t\tchildren.forEach(function (file) {\n\t\t\tconst fullPath = path.join(baseDir, file);\n\t\t\tclearEmptyDirs(fullPath);\n\t\t});\n\n\t\t// re-evaluate files; after deleting subdir we may have parent dir\n\t\t// empty now...\n\t\tchildren = fsx.readdirSync(baseDir);\n\t}\n\n\t// Si no tiene hijos, lo borramos\n\tif (children.length === 0) {\n\t\tfsx.rmdirSync(baseDir);\n\t\treturn;\n\t}\n};\n\n/**\n * Creates multiple directories.\n *\n * @param dirs - An array of directory paths.\n * @param options - Same option as `fs.mkdirSync()`\n */\nfunction createDirsSync(dirs: Array<string>, options?: MakeDirectoryOptions) {\n\tfor (const dir of dirs) {\n\t\tif (!fs.existsSync(dir)) {\n\t\t\tfs.mkdirSync(dir, { recursive: true, ...options });\n\t\t}\n\t}\n}\n\n/**\n * Copy multiple directories with backup option.\n *\n * @param src - Source directory.\n * @param dst - Destination directory.\n * @param dirs - Directories to copy.\n * @param options.withBackup - Create a previous backup before copy.\n */\nfunction copyDirsSync(\n\tsrc: string,\n\tdst: string,\n\tdirs: Array<string>,\n\toptions = {\n\t\twithBackup: false,\n\t},\n) {\n\tconst { withBackup } = options;\n\tfor (const dir of dirs) {\n\t\tconst srcCompose = path.join(src, dir);\n\t\tconst dstCompose = path.join(dst, dir);\n\n\t\t// The dir we want to copy, doesn't exist.\n\t\tif (!fsx.existsSync(srcCompose)) {\n\t\t\tconsole.log(`Source directory does not exist: ${srcCompose}`);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Create the backup\n\t\tif (withBackup) {\n\t\t\tcreateBackup(dstCompose);\n\t\t}\n\n\t\t// Copy directory\n\t\ttry {\n\t\t\t// First clean destination\n\t\t\tif (fsx.existsSync(dstCompose)) {\n\t\t\t\tfs.rmSync(dstCompose, { recursive: true, force: true });\n\t\t\t}\n\t\t\t// Then copy src to dst\n\t\t\tfs.cpSync(srcCompose, dstCompose, {\n\t\t\t\trecursive: true,\n\t\t\t\tpreserveTimestamps: true,\n\t\t\t});\n\t\t\tif (withBackup) {\n\t\t\t\tdeleteBackup(dstCompose);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(\"Copy failed!\");\n\t\t\tif (withBackup) {\n\t\t\t\trestoreBackup(dstCompose);\n\t\t\t\tconsole.log(\"Backup has been restored.\");\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Remove directories from `basePath` directory.\n *\n * @param basePath - Base directory.\n * @param dirs - Directory to remove.\n */\nfunction removeDirsSync(basePath: string, dirs: Array<string>) {\n\tfor (const dir of dirs) {\n\t\tif (!dir) continue;\n\n\t\tconst composePath = path.join(basePath, dir);\n\n\t\tif (fsx.existsSync(composePath)) {\n\t\t\tfs.rmSync(composePath, { recursive: true, force: true });\n\t\t}\n\t}\n}\n\nfunction restoreBackup(src: string, suffix = \"-BACKUP\") {\n\tconst dst = src + suffix;\n\ttry {\n\t\tfs.renameSync(dst, src);\n\t\tconsole.log(`Backup ${dst} has been restored`);\n\t} catch (e) {\n\t\tconsole.log(`Error while delete ${dst} backup`);\n\t}\n}\n\nfunction deleteBackup(src: string, suffix = \"-BACKUP\") {\n\tconst dst = src + suffix;\n\n\tif (!fsx.existsSync(dst)) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tfs.rmSync(dst, { recursive: true, force: true });\n\t\tconsole.log(`Backup ${dst} has been deleted`);\n\t} catch (e) {\n\t\tconsole.log(`Error while delete ${dst} backup`);\n\t}\n}\n\nfunction createBackup(src: string, suffix = \"-BACKUP\") {\n\tconst dst = src + suffix;\n\n\tif (!fsx.existsSync(src)) {\n\t\treturn;\n\t}\n\n\tif (fsx.existsSync(dst)) {\n\t\tconsole.log(`Destination ${dst} already exists`);\n\t\treturn;\n\t}\n\n\ttry {\n\t\tfs.renameSync(src, dst);\n\t\tconsole.log(`Backup of ${src} has been created in ${dst}`);\n\t} catch (e) {\n\t\tconsole.log(`Error while coping ${src} to ${dst} backup`);\n\t}\n}\n\n/**\n * Elimina todas las p\u00E1ginas del store (de todos los sites) cuyo nombre empiece con un gui\u00F3n \"-\".\n * Estas p\u00E1ginas son \"virtuales\" y no tienen ids desde API por lo que mantenerlas en el store es un problema cuando se hacen modificaciones en la p\u00E1gina \"madre\".\n * La soluci\u00F3n por ahora es borrarlas del store y rehacerlas en todos los renders.\n */\nasync function removeVirtualPagesFromStore() {\n\tconst { __cx } = config.paths();\n\tconst storePath = path.join(__cx, \"store\");\n\n\ttry {\n\t\tconst allJsonPageFilesPath = walkStore(storePath);\n\n\t\tfor (const filePath of allJsonPageFilesPath) {\n\t\t\tif (path.basename(filePath).startsWith(\"-\")) {\n\t\t\t\tfs.unlinkSync(filePath);\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tconsole.info(\n\t\t\t\"`store` folder does not exist. Skipping multipage or static list template cleaning.\",\n\t\t);\n\t}\n}\n\n/**\n * Remove every .xml file in the directories in a recursive way\n * @param initialFolder - The initial folder to start the searching...\n */\nfunction clearSitemapsFromDirs(initialFolder: string) {\n\t// Recursively remove .xml files\n\n\tfunction removeXmlFiles(folder: string): void {\n\t\ttry {\n\t\t\t// Read the content of the directory\n\t\t\tconst files = fs.readdirSync(folder);\n\t\t\t// Iterate over each file/folder in the directory\n\t\t\tfor (const file of files) {\n\t\t\t\tconst fullPath = path.join(folder, file);\n\t\t\t\t// Check if the current path is a directory or file\n\t\t\t\tconst stats = fs.statSync(fullPath);\n\t\t\t\tif (stats.isDirectory()) {\n\t\t\t\t\t// Recursively call removeXmlFiles if it's a directory\n\t\t\t\t\tremoveXmlFiles(fullPath);\n\t\t\t\t} else if (stats.isFile() && path.extname(fullPath) === \".xml\") {\n\t\t\t\t\t// Remove the file if it's an .xml file\n\t\t\t\t\tfs.unlinkSync(fullPath);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.error(`Error processing directory: ${folder}`, err);\n\t\t}\n\t}\n\n\t// Start the process from the initial folder\n\tremoveXmlFiles(initialFolder);\n}\n\n/**\n * Removes multiple artifact directories.\n *\n * @param artifacts - An array of artifact directory paths.\n */\nfunction removeArtifacts(artifacts: Array<string>) {\n\tfor (const dir of artifacts) {\n\t\tif (!dir) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (fsx.existsSync(dir)) {\n\t\t\tfs.rmSync(dir, { recursive: true, force: true });\n\t\t\tverboseLog(`removed directory: ${dir}`);\n\t\t}\n\t}\n}\n\n/**\n * Creates multiple directories.\n *\n * @param dirs - An array of directory paths.\n * @param options - Same option as `fs.mkdirSync()`\n */\nfunction createArtifacts(dirs: Array<string>, options?: MakeDirectoryOptions) {\n\tfor (const dir of dirs) {\n\t\tif (!fs.existsSync(dir)) {\n\t\t\tfs.mkdirSync(dir, { recursive: true, ...options });\n\t\t\tverboseLog(`create directory: ${dir}`);\n\t\t}\n\t}\n}\n\n/**\n * Copy multiple directories with backup option.\n *\n * @param src - Source directory.\n * @param dst - Destination directory.\n * @param dirs - Directories to copy.\n * @param options.withBackup - Create a previous backup before copy.\n */\nfunction copyArtifacts(\n\tsrc: string,\n\tdst: string,\n\tdirs: Array<string>,\n\toptions = {\n\t\twithBackup: false,\n\t},\n) {\n\tconst { withBackup } = options;\n\tfor (const dir of dirs) {\n\t\tconst srcCompose = path.join(src, dir);\n\t\tconst dstCompose = path.join(dst, dir);\n\n\t\t// The dir we want to copy, doesn't exist.\n\t\tif (!fsx.existsSync(srcCompose)) {\n\t\t\tconsole.log(\n\t\t\t\t`(Maybe first render) Source directory does not exist: ${srcCompose}`,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Create the backup\n\t\tif (withBackup) {\n\t\t\tcreateBackup(dstCompose);\n\t\t\tverboseLog(`create backup: ${dstCompose}`);\n\t\t}\n\n\t\t// Copy directory\n\t\ttry {\n\t\t\t// First clean destination\n\t\t\tif (fsx.existsSync(dstCompose)) {\n\t\t\t\tfs.rmSync(dstCompose, { recursive: true, force: true });\n\t\t\t\tverboseLog(`clean destination: ${dstCompose}`);\n\t\t\t}\n\n\t\t\t// Then copy src to dst\n\t\t\tfs.cpSync(srcCompose, dstCompose, {\n\t\t\t\trecursive: true,\n\t\t\t\tpreserveTimestamps: true,\n\t\t\t});\n\t\t\tverboseLog(`copy: ${srcCompose} to ${dstCompose}`);\n\n\t\t\tif (withBackup) {\n\t\t\t\tdeleteBackup(dstCompose);\n\t\t\t\tverboseLog(`delete backup: ${dstCompose}`);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(\"copy failed!\");\n\t\t\tif (withBackup) {\n\t\t\t\trestoreBackup(dstCompose);\n\t\t\t\tconsole.log(\"Backup has been restored.\");\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction renameArtifact(src: string, dst: string) {\n\tif (fs.existsSync(src)) {\n\t\tfs.renameSync(src, dst);\n\t\tverboseLog(`rename ${src} to ${dst}`);\n\t}\n}\n\n/**\n * Move artifacts between cx-paths\n *\n * @param src - Source directory.\n * @param dst - Destination directory.\n * @param dirs - Directories to move.\n * @param options - Options.\n */\nfunction moveArtifacts(\n\tsrc: string,\n\tdst: string,\n\tdirs: Array<string>,\n\toptions?: { withBackup?: boolean; override?: boolean },\n) {\n\tconst { override, withBackup } = options || {};\n\n\tfor (const dir of dirs) {\n\t\tconst srcCompose = path.join(src, dir);\n\t\tconst dstCompose = path.join(dst, dir);\n\n\t\tif (!fsx.existsSync(srcCompose)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (withBackup) {\n\t\t\tcreateBackup(dstCompose);\n\t\t}\n\n\t\ttry {\n\t\t\t// Clean destination\n\t\t\tif (override && fsx.existsSync(dstCompose)) {\n\t\t\t\tfs.rmSync(dstCompose, { recursive: true, force: true });\n\t\t\t}\n\n\t\t\tfs.renameSync(srcCompose, dstCompose);\n\t\t\tverboseLog(`moved: ${srcCompose} to ${dstCompose}`);\n\n\t\t\tif (withBackup) {\n\t\t\t\tdeleteBackup(dstCompose);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tif (withBackup) {\n\t\t\t\trestoreBackup(dstCompose);\n\t\t\t\tconsole.log(\"Backup has been restored.\");\n\t\t\t}\n\n\t\t\tthrow new Error(JSON.stringify(e));\n\t\t}\n\t}\n}\n\nexport {\n\tclearEmptyDirs,\n\tclearSitemapsFromDirs,\n\tcopyArtifacts,\n\tcopyDirsSync,\n\tcreateArtifacts,\n\tcreateDirsSync,\n\tmoveArtifacts,\n\tremoveArtifacts,\n\tremoveDirsSync,\n\tremoveVirtualPagesFromStore,\n\trenameArtifact,\n};\n", "import type { Adapters } from \"../adapters\";\n\nimport kleur from \"kleur\";\nimport { version as reactVersion } from \"react\";\n\nimport { getConfig } from \"./core-utils\";\nimport { envs } from \"../constants\";\n\n/**\n * Custom basic logging function controlled by a environment variable.\n *\n * @param str The string to be logged.\n */\nfunction verboseLog(str: string) {\n\tif (envs.GRIDDO_VERBOSE_LOGS) {\n\t\tconsole.log(\n\t\t\tkleur.yellow(\"verbose\"),\n\t\t\tkleur.dim(str.replace(/(\\s)\\s+/g, \"$1\").trim()),\n\t\t);\n\t}\n}\n\n/**\n * Custom log inside a line-box.\n *\n * @param stringValue The string to be logged.\n * @param paddingInline The number of white spaces inside the box at left and right.\n * @param paddingBlock The number of white spaces inside the box at top and bottom.\n */\nfunction boxLog(\n\tstringValue: string,\n\ttitle = \"\",\n\tpaddingInline = 1,\n\tpaddingBlock = 1,\n) {\n\tconst lines = stringValue\n\t\t.split(\"\\n\") // lines\n\t\t.map((line) => line.trim()); // remove extra spaces\n\tconst windowTitle = title ? ` ${title} ` : \"\";\n\tconst windowTitleLength = title ? windowTitle.length : 0;\n\tconst longerContent =\n\t\tMath.max(...lines.map((l) => l.length)) + paddingInline * 2;\n\tconst longerLine = Math.max(longerContent, windowTitleLength);\n\tconst paddingBlockString = `\u2502${\" \".repeat(longerLine)}\u2502\\n`.repeat(\n\t\tpaddingBlock,\n\t);\n\tconst minWidth = longerLine;\n\tconst borderTop = `\u256D${windowTitle}${\"\u2500\".repeat(\n\t\tminWidth - windowTitleLength,\n\t)}\u256E\\n`;\n\tconst borderBottom = `\u2570${\"\u2500\".repeat(minWidth)}\u256F`;\n\tconst content = lines\n\t\t.map((l) => {\n\t\t\tconst mr = \" \".repeat(longerLine - l.length - paddingInline);\n\t\t\treturn `\u2502${\" \".repeat(paddingInline)}${l}${mr}\u2502\\n`;\n\t\t})\n\t\t.join(\"\");\n\n\tconsole.log(\n\t\t`${borderTop}${paddingBlockString}${content}${paddingBlockString}${borderBottom}`,\n\t);\n}\n\n/**\n * Custom basic logging function controlled by a environment variable.\n * Strip double spaces.\n *\n * @param str The string to be logged.\n */\nfunction buildLog(str: string) {\n\tif (envs.GRIDDO_BUILD_LOGS) {\n\t\tconsole.log(str.replace(/(\\s)\\s+/g, \"$1\").trim());\n\t}\n}\n\n/**\n * Console log with a blue color in the info prefix.\n * @param str The string to be logged.\n */\nfunction infoLog(str: string) {\n\tconsole.log(`${kleur.blue(\"info\")} ${str}`);\n}\n\n/**\n * Console log with a green color in the success prefix.\n * @param str The string to be logged.\n */\nfunction successLog(str: string) {\n\tconsole.log(`${kleur.green(\"success\")} ${str}`);\n}\n\n/**\n * Internal log\n * @param values The values to be logged.\n */\nfunction debugLog(...values: Array<unknown>) {\n\tif (!envs.GRIDDO_DEBUG_LOGS) {\n\t\treturn;\n\t}\n\tconsole.log(...values);\n}\n\n/**\n * Return a scale size colors with a number and a measure string (KB by default).\n *\n * @param size The page size in KB.\n * @param measure The measure string to be added in the log.\n */\nfunction pageSizeLog(size: number, measure = \"KB\") {\n\tconst sizeScale = {\n\t\tlow: 50,\n\t\tmid: 80,\n\t\tlarge: 130,\n\t\textraLarge: 210,\n\t};\n\n\t// Ternary pawa!\n\tconst color =\n\t\tsize > sizeScale.large\n\t\t\t? \"red\"\n\t\t\t: size > sizeScale.mid\n\t\t\t\t? \"magenta\"\n\t\t\t\t: size > sizeScale.low\n\t\t\t\t\t? \"blue\"\n\t\t\t\t\t: \"green\";\n\n\treturn kleur[color](kleur.bold(`${size}${measure}`));\n}\n\n/**\n * Print Griddo, adapter and Node version.\n */\nfunction printExporterLogo(adapter: Adapters) {\n\tconst config = getConfig();\n\tconst nodeVersion = process.version;\n\tconst { griddoVersion } = config;\n\tconst logo = `\n\u00B7\u00B7\n\u00B7\u00B7 Griddo ${griddoVersion}\n\u00B7\u00B7\n\u00B7\u00B7 Adapter: ${adapter}\n\u00B7\u00B7 Node: ${nodeVersion}\n\u00B7\u00B7 React: ${reactVersion}\n\u00B7\u00B7\n`;\n\n\tconsole.log(logo);\n}\n\nexport {\n\tboxLog,\n\tbuildLog,\n\tdebugLog,\n\tinfoLog,\n\tpageSizeLog,\n\tprintExporterLogo,\n\tsuccessLog,\n\tverboseLog,\n};\n", "/**\n * Here are all the environment variables that the CX code uses.\n */\n\nimport dotenv from \"dotenv\";\n\nimport { isTruthy } from \"../utils/core-utils\";\n\ndotenv.config();\n\n//\n// Credentials\n//\n/* prettier-ignore */ const GRIDDO_API_URL = process.env.GRIDDO_API_URL || process.env.API_URL;\n/* prettier-ignore */ const GRIDDO_PUBLIC_API_URL = process.env.GRIDDO_PUBLIC_API_URL || process.env.PUBLIC_API_URL;\n/* prettier-ignore */ const GRIDDO_BOT_USER = process.env.botEmail;\n/* prettier-ignore */ const GRIDDO_BOT_PASSWORD = process.env.botPassword;\n\n//\n// Rendering\n//\n/* prettier-ignore */ const GRIDDO_API_CONCURRENCY_COUNT = Number.parseInt( process.env.GRIDDO_API_CONCURRENCY_COUNT || \"10\");\n/* prettier-ignore */ const GRIDDO_RENDER_ALL_SITES = isTruthy(process.env.GRIDDO_RENDER_ALL_SITES || process.env.updateAllSites);\n/* prettier-ignore */ const GRIDDO_RENDER_SITE = Number.parseInt(process.env.GRIDDO_RENDER_SITE || \"\")\n/* prettier-ignore */ const GRIDDO_RENDER_PAGES = (process.env.GRIDDO_RENDER_PAGES || \"\").split(\",\").map((item) => Number.parseInt(item)).filter(Boolean);\n/* prettier-ignore */ const GRIDDO_SKIP_BUILD_CHECKS = isTruthy(process.env.GRIDDO_SKIP_BUILD_CHECKS)\n/* prettier-ignore */ const GRIDDO_DEBUG_LOGS = isTruthy(process.env.GRIDDO_DEBUG_LOGS);\n/* prettier-ignore */ const GRIDDO_BUILD_LOGS = isTruthy(process.env.GRIDDO_BUILD_LOGS);\n/* prettier-ignore */ const GRIDDO_RENDER_BREAKPOINTS_FEATURE = isTruthy(process.env.GRIDDO_RENDER_BREAKPOINTS_FEATURE);\n/* prettier-ignore */ const GRIDDO_SSG_VERBOSE_LOGS = isTruthy(process.env.GRIDDO_SSG_VERBOSE_LOGS)\n/* prettier-ignore */ const GRIDDO_SEARCH_FEATURE = isTruthy(process.env.GRIDGRIDDO_SEARCH_FEATURE_FEATURE);\n/* prettier-ignore */ const GRIDDO_ASSET_PREFIX = process.env.GRIDDO_ASSET_PREFIX || process.env.ASSET_PREFIX;\n/* prettier-ignore */ const GRIDDO_REACT_APP_INSTANCE = process.env.GRIDDO_REACT_APP_INSTANCE || process.env.REACT_APP_INSTANCE;\n/* prettier-ignore */ const GRIDDO_AI_EMBEDDINGS = isTruthy(process.env.GRIDDO_AI_EMBEDDINGS);\n/* prettier-ignore */ const GRIDDO_VERBOSE_LOGS = isTruthy(process.env.GRIDDO_VERBOSE_LOGS);\n/* prettier-ignore */ const GRIDDO_ALERT_FEATURE = isTruthy(process.env.GRIDDO_ALERT_FEATURE);\n/* prettier-ignore */ const GRIDDO_API_MAX_RESPONSE_SIZE = Number.parseInt(process.env.GRIDDO_API_MAX_RESPONSE_SIZE || \"81920\") // 80KB\n/* prettier-ignore */ const GRIDDO_SSG_MAX_PAGE_SIZE = Number.parseInt(process.env.GRIDDO_SSG_MAX_PAGE_SIZE || \"524288\") // 512KB\n\n//\n// LifeCycle\n//\n/* prettier-ignore */ const GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n/* prettier-ignore */ const GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n/* prettier-ignore */ const GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n/* prettier-ignore */ const GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n/* prettier-ignore */ const GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n/* prettier-ignore */ const GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS || \"2\");\n/* prettier-ignore */ const GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n/* prettier-ignore */ const GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS || \"4\");\n/* prettier-ignore */ const GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n\n//\n// Testing\n//\n/* prettier-ignore */ const GRIDDO_FIXTURES_DOMAIN_NAMES = process.env.GRIDDO_CX_FIXTURES_DOMAIN_NAMES;\n/* prettier-ignore */ const GRIDDO_FIXTURES_SITE_NAMES = process.env.GRIDDO_CX_FIXTURES_SITE_NAMES;\n\nexport {\n\tGRIDDO_AI_EMBEDDINGS,\n\tGRIDDO_ALERT_FEATURE,\n\tGRIDDO_API_CONCURRENCY_COUNT,\n\tGRIDDO_API_MAX_RESPONSE_SIZE,\n\tGRIDDO_API_URL,\n\tGRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_ASSET_PREFIX,\n\tGRIDDO_BOT_PASSWORD,\n\tGRIDDO_BOT_USER,\n\tGRIDDO_BUILD_LOGS,\n\tGRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_DEBUG_LOGS,\n\tGRIDDO_FIXTURES_DOMAIN_NAMES,\n\tGRIDDO_FIXTURES_SITE_NAMES,\n\tGRIDDO_META_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_PUBLIC_API_URL,\n\tGRIDDO_REACT_APP_INSTANCE,\n\tGRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_RENDER_ALL_SITES,\n\tGRIDDO_RENDER_BREAKPOINTS_FEATURE,\n\tGRIDDO_RENDER_PAGES,\n\tGRIDDO_RENDER_SITE,\n\tGRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_SEARCH_FEATURE,\n\tGRIDDO_SKIP_BUILD_CHECKS,\n\tGRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_SSG_MAX_PAGE_SIZE,\n\tGRIDDO_SSG_VERBOSE_LOGS,\n\tGRIDDO_VERBOSE_LOGS,\n};\n", "import { GRIDDO_API_URL, GRIDDO_PUBLIC_API_URL } from \"./envs\";\n\nconst WITH_URI = `${GRIDDO_API_URL}/site/`;\n\nconst AI_EMBEDDINGS = `${GRIDDO_API_URL}/ai/embeddings`;\nconst ALERT = `${GRIDDO_PUBLIC_API_URL}/alert`;\nconst DOMAINS = `${GRIDDO_API_URL}/domains`;\nconst GET_ALL = `${GRIDDO_API_URL}/sites/all`;\nconst GET_PAGE = `${GRIDDO_API_URL}/page`;\nconst LOGIN = `${GRIDDO_API_URL}/login_check`;\nconst RESET_RENDER = `${GRIDDO_API_URL}/debug/reset-render`;\nconst ROBOTS = `${GRIDDO_API_URL}/domains/robots`;\nconst SEARCH = `${GRIDDO_API_URL}/search`;\nconst SETTINGS = `${GRIDDO_API_URL}/settings`;\n\nconst BUILD_END = [WITH_URI, \"/build/end\"];\nconst BUILD_START = [WITH_URI, \"/build/start\"];\nconst GET_PAGES = [WITH_URI, \"/pages?pagination=false\"];\nconst GET_REFERENCE_FIELD_DATA = [WITH_URI, \"/distributor\"];\nconst GET_SITEMAP = [WITH_URI, \"/sitemap\"];\nconst INFO = [WITH_URI, \"/all\"];\nconst LANGUAGES = [WITH_URI, \"/languages\"];\nconst SOCIALS = [WITH_URI, \"/socials\"];\n\nexport {\n\tAI_EMBEDDINGS,\n\tALERT,\n\tBUILD_END,\n\tBUILD_START,\n\tDOMAINS,\n\tGET_ALL,\n\tGET_PAGE,\n\tGET_PAGES,\n\tGET_REFERENCE_FIELD_DATA,\n\tGET_SITEMAP,\n\tINFO,\n\tLANGUAGES,\n\tLOGIN,\n\tRESET_RENDER,\n\tROBOTS,\n\tSEARCH,\n\tSETTINGS,\n\tSOCIALS,\n};\n", "import type { LifeCyclesNames } from \"../types/global\";\n\nimport {\n\tAI_EMBEDDINGS,\n\tALERT,\n\tBUILD_END,\n\tBUILD_START,\n\tDOMAINS,\n\tGET_ALL,\n\tGET_PAGE,\n\tGET_PAGES,\n\tGET_REFERENCE_FIELD_DATA,\n\tGET_SITEMAP,\n\tINFO,\n\tLANGUAGES,\n\tLOGIN,\n\tRESET_RENDER,\n\tROBOTS,\n\tSEARCH,\n\tSETTINGS,\n\tSOCIALS,\n} from \"./endpoints\";\nimport {\n\tGRIDDO_AI_EMBEDDINGS,\n\tGRIDDO_ALERT_FEATURE,\n\tGRIDDO_API_CONCURRENCY_COUNT,\n\tGRIDDO_API_MAX_RESPONSE_SIZE,\n\tGRIDDO_API_URL,\n\tGRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_ASSET_PREFIX,\n\tGRIDDO_BOT_PASSWORD,\n\tGRIDDO_BOT_USER,\n\tGRIDDO_BUILD_LOGS,\n\tGRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_DEBUG_LOGS,\n\tGRIDDO_FIXTURES_DOMAIN_NAMES,\n\tGRIDDO_FIXTURES_SITE_NAMES,\n\tGRIDDO_META_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_PUBLIC_API_URL,\n\tGRIDDO_REACT_APP_INSTANCE,\n\tGRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_RENDER_ALL_SITES,\n\tGRIDDO_RENDER_BREAKPOINTS_FEATURE,\n\tGRIDDO_RENDER_PAGES,\n\tGRIDDO_RENDER_SITE,\n\tGRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_SEARCH_FEATURE,\n\tGRIDDO_SKIP_BUILD_CHECKS,\n\tGRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_SSG_MAX_PAGE_SIZE,\n\tGRIDDO_SSG_VERBOSE_LOGS,\n\tGRIDDO_VERBOSE_LOGS,\n} from \"./envs\";\n\nconst endpoints = {\n\tALERT,\n\tAI_EMBEDDINGS,\n\tBUILD_END,\n\tBUILD_START,\n\tDOMAINS,\n\tGET_ALL,\n\tGET_PAGE,\n\tGET_PAGES,\n\tGET_REFERENCE_FIELD_DATA,\n\tGET_SITEMAP,\n\tINFO,\n\tLANGUAGES,\n\tLOGIN,\n\tRESET_RENDER,\n\tROBOTS,\n\tSEARCH,\n\tSETTINGS,\n\tSOCIALS,\n};\n\nconst envs = {\n\tGRIDDO_AI_EMBEDDINGS,\n\tGRIDDO_ALERT_FEATURE,\n\tGRIDDO_API_CONCURRENCY_COUNT,\n\tGRIDDO_API_MAX_RESPONSE_SIZE,\n\tGRIDDO_API_URL,\n\tGRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_ASSET_PREFIX,\n\tGRIDDO_BOT_PASSWORD,\n\tGRIDDO_BOT_USER,\n\tGRIDDO_BUILD_LOGS,\n\tGRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_DEBUG_LOGS,\n\tGRIDDO_FIXTURES_DOMAIN_NAMES,\n\tGRIDDO_FIXTURES_SITE_NAMES,\n\tGRIDDO_META_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_PUBLIC_API_URL,\n\tGRIDDO_REACT_APP_INSTANCE,\n\tGRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_RENDER_ALL_SITES,\n\tGRIDDO_RENDER_BREAKPOINTS_FEATURE,\n\tGRIDDO_RENDER_PAGES,\n\tGRIDDO_RENDER_SITE,\n\tGRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_SEARCH_FEATURE,\n\tGRIDDO_SKIP_BUILD_CHECKS,\n\tGRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_SSG_MAX_PAGE_SIZE,\n\tGRIDDO_SSG_VERBOSE_LOGS,\n\tGRIDDO_VERBOSE_LOGS,\n};\n\nconst lifeCycleNames: Record<LifeCyclesNames, LifeCyclesNames> = {\n\tHealthCheck: \"HealthCheck\",\n\t__DEBUG__: \"__DEBUG__\",\n\tClean: \"Clean\",\n\tClose: \"Close\",\n\tPrepare: \"Prepare\",\n\tRestore: \"Restore\",\n\tData: \"Data\",\n\tSSG: \"SSG\",\n\tRelocation: \"Relocation\",\n\tMeta: \"Meta\",\n\tArchive: \"Archive\",\n} as const;\n\nexport { endpoints, envs, lifeCycleNames };\n", "import type { Site, SiteData } from \"../types/sites\";\n\nimport path from \"node:path\";\n\nimport fs from \"fs-extra\";\nimport { parse } from \"js2xmlparser\";\n\nimport { getConfig } from \"./core-utils\";\nimport { infoLog } from \"./loggin\";\nimport { getBuildMetadata } from \"./store\";\nimport { envs } from \"../constants\";\nimport { AuthService } from \"../services/auth\";\nimport {\n\tendSiteRender,\n\tgetAllSites,\n\tgetSiteInfo,\n\tgetSiteLanguages,\n\tgetSitemap,\n\tgetSiteSocials,\n\tstartSiteRender,\n} from \"../services/sites\";\n\nconst config = getConfig();\n\n/**\n * Check the instance sites and returns site prepared to be published and unpublished.\n */\nasync function checkSites(domain: string) {\n\tconsole.info(`API URL ${envs.GRIDDO_API_URL as string}`);\n\n\t// Login to API\n\tawait AuthService.login();\n\n\t// Get all sites. An array of Site\n\tconst allSites = await getAllSites();\n\n\t// Filter the array of sites to get only the ones to build/render\n\tconst validSites = envs.GRIDDO_RENDER_ALL_SITES\n\t\t? allSites.filter(\n\t\t\t\t(site) =>\n\t\t\t\t\t!envs.GRIDDO_RENDER_SITE || site.id === envs.GRIDDO_RENDER_SITE,\n\t\t\t)\n\t\t: allSites.filter((site) =>\n\t\t\t\tenvs.GRIDDO_RENDER_SITE\n\t\t\t\t\t? site.id === envs.GRIDDO_RENDER_SITE\n\t\t\t\t\t: !!site.shouldBeUpdated,\n\t\t\t);\n\n\t// If there are valid sites...\n\tif (validSites.length) {\n\t\tfor (const site of validSites) {\n\t\t\tconst { items } = await getSiteLanguages(site.id);\n\n\t\t\t// A\u00F1adimos la prop domains con el dominio \"cocinado\" con los idiomas y teniendo en cuenta solo el dominio actual\n\t\t\tsite.domains = items\n\t\t\t\t.filter(\n\t\t\t\t\t(item) =>\n\t\t\t\t\t\titem.domain &&\n\t\t\t\t\t\t(item.domain.slug === domain || item.domain.slug === `/${domain}`),\n\t\t\t\t)\n\t\t\t\t.map((item) => ({ [item.id]: `${item.domain.slug}${item.path}` }));\n\t\t}\n\t}\n\n\t// Sites with domains as empty arrays are sites that are not from the\n\t// current domain.\n\tconst validSitesFromCurrentDomain = validSites.filter(\n\t\t(site) => site.domains.length > 0,\n\t);\n\n\t// Save sites object to publish\n\tconst sitesToPublish = validSitesFromCurrentDomain.filter((site) =>\n\t\tenvs.GRIDDO_RENDER_SITE\n\t\t\t? site.id === envs.GRIDDO_RENDER_SITE\n\t\t\t: !!site.isPublished,\n\t);\n\n\t// Save sites object to unpublish\n\tconst sitesToUnpublish = validSitesFromCurrentDomain.filter(\n\t\t(site) => !site.isPublished && site.shouldBeUpdated,\n\t);\n\n\treturn {\n\t\tsitesToPublish,\n\t\tsitesToUnpublish,\n\t};\n}\n\n/**\n * Unpublish an array of sites sending the information to the API.\n *\n * @param sites An array of sites\n * @see https://griddoio.notion.site/Sites-d7bb0b7cb8d24894a5337e1139fc3d09#2019d3255bda4d219c7e19cf28d0c4fe\n */\nasync function unpublishSites(sites: Array<Site>) {\n\tconst { __cx } = config.paths();\n\n\tfor (const site of sites) {\n\t\t// API\n\t\tconst buildInfo = await startSiteRender(site.id);\n\t\tconst { siteHash } = buildInfo;\n\t\tconst body = {\n\t\t\tsiteHash,\n\t\t\tpublishHashes: [],\n\t\t\tunpublishHashes: [],\n\t\t};\n\n\t\tawait endSiteRender(site.id, body);\n\n\t\t// STORE\n\t\t// Remove site directory from the Store\n\t\tfs.rmSync(path.join(__cx, \"store\", site.id.toString()), {\n\t\t\tforce: true,\n\t\t\trecursive: true,\n\t\t});\n\t}\n}\n\n/**\n * Return a single site generic data.\n *\n * @param siteID The site id.\n * @param cacheKey Boolean that indicates if we want to get cache version.\n *\n * @see SiteData\n */\nasync function getSiteData(siteID: number) {\n\tconst buildData = await startSiteRender(siteID);\n\tconst siteInfo = await getSiteInfo(siteID);\n\tconst siteLangs = await getSiteLanguages(siteID);\n\tconst socials = await getSiteSocials(siteID);\n\tconst siteLangsInfo = siteLangs.items;\n\tconst defaultLang = siteLangsInfo.find((lang) => lang.isDefault);\n\n\tconst { siteHash, unpublishHashes, publishIds } = buildData;\n\tconst { headers, footers } = siteInfo;\n\tconst validPagesIds = envs.GRIDDO_RENDER_PAGES.length\n\t\t? envs.GRIDDO_RENDER_PAGES.filter((item) => publishIds.includes(item))\n\t\t: publishIds;\n\n\tconst siteData: SiteData = {\n\t\tsiteInfo,\n\t\tvalidPagesIds,\n\t\tsiteHash,\n\t\tunpublishHashes,\n\t\tsiteLangs: siteLangsInfo,\n\t\tdefaultLang,\n\t\theaders,\n\t\tfooters,\n\t\tsocials,\n\t};\n\n\treturn siteData;\n}\n\n/**\n * Save a file with the end of build process\n */\nasync function generateBuildReport() {\n\tconst { __cx } = config.paths();\n\n\tconst { buildProcessData } = await getBuildMetadata();\n\n\t// Get the token\n\tconst authControl = await AuthService.login();\n\n\tconst buildSitesInfo = Object.keys(buildProcessData).map((siteID) => ({\n\t\t...buildProcessData[siteID],\n\t\tsiteId: parseInt(siteID),\n\t}));\n\n\tconst report = {\n\t\tauthControl,\n\t\tsites: buildSitesInfo,\n\t};\n\n\tfs.writeFileSync(\n\t\tpath.join(__cx, \"dist\", \"__build-report__.json\"),\n\t\tJSON.stringify(report),\n\t);\n\n\tinfoLog(`Build report saved for ${buildSitesInfo.length} site(s)`);\n}\n\n/**\n * Generate sitemaps and save them into file system.\n *\n * @param sites An array of sites\n */\nasync function generateSitemaps() {\n\tconst { sitesToPublish } = await getBuildMetadata();\n\tconst { __cx } = config.paths();\n\tconst distDir = path.join(__cx, \"dist\");\n\n\tfor (const site of sitesToPublish) {\n\t\tconst { id: siteID, languages } = site;\n\n\t\tfor (const lang of languages) {\n\t\t\tif (AuthService.headers) AuthService.headers[\"lang\"] = lang.id.toString();\n\n\t\t\tconst response = await getSitemap(siteID);\n\n\t\t\tif (!response) continue;\n\n\t\t\tconst {\n\t\t\t\titems: sitemapPagesGroup,\n\t\t\t\turl: { home, domain },\n\t\t\t} = response;\n\n\t\t\tif (!home) continue;\n\n\t\t\tconst langDomain = site.domains.find(\n\t\t\t\t(domain) => Object.keys(domain)[0] == lang.id.toString(),\n\t\t\t);\n\n\t\t\tif (!langDomain) continue;\n\n\t\t\tconst slug = Object.values(langDomain)[0];\n\t\t\tconst sitemaps: Array<string> = [];\n\t\t\tconst sitemapPageGroupKeys = Object.keys(sitemapPagesGroup);\n\t\t\tconst sitemapBasePath = path.join(distDir, slug.replace(domain, \"\"));\n\n\t\t\tfor (const templateId of sitemapPageGroupKeys) {\n\t\t\t\tconst sitemapPages = sitemapPagesGroup[templateId];\n\n\t\t\t\tif (!sitemapPages.length) continue;\n\n\t\t\t\tconst siteMap = parse(\"urlset\", {\n\t\t\t\t\t\"@\": {\n\t\t\t\t\t\txmlns: \"http://www.sitemaps.org/schemas/sitemap/0.9\",\n\t\t\t\t\t\t\"xmlns:xsi\": \"http://www.w3.org/2001/XMLSchema-instance\",\n\t\t\t\t\t\t\"xsi:schemaLocation\":\n\t\t\t\t\t\t\t\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\",\n\t\t\t\t\t},\n\t\t\t\t\turl: sitemapPages,\n\t\t\t\t});\n\n\t\t\t\tconst sitemapName = `/sitemap-${templateId.toLowerCase()}.xml`;\n\t\t\t\tconst exactPath = path.join(sitemapBasePath, sitemapName);\n\n\t\t\t\tsaveFile(exactPath, siteMap);\n\n\t\t\t\tsitemaps.push(\n\t\t\t\t\t`${home.endsWith(\"/\") ? home.slice(0, -1) : home}${sitemapName}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (!sitemaps.length) continue;\n\n\t\t\tconst siteMap = parse(\"sitemapindex\", {\n\t\t\t\t\"@\": { xmlns: \"http://www.sitemaps.org/schemas/sitemap/0.9\" },\n\t\t\t\tsitemap: sitemaps.map((loc) => ({ loc })),\n\t\t\t});\n\n\t\t\tconst exactPath = path.join(sitemapBasePath, \"sitemap.xml\");\n\n\t\t\tsaveFile(exactPath, siteMap);\n\t\t}\n\t}\n}\n\n/**\n * Saves the content to a file specified by its path. If the file exists, it will be overwritten.\n *\n * @param filePath The path of the file to save the content to.\n * @param content The content to save to the file.\n */\nfunction saveFile(filePath: string, content: string) {\n\ttry {\n\t\tconst pathName = path.dirname(filePath);\n\t\tif (!fs.existsSync(pathName)) fs.mkdirSync(pathName, { recursive: true });\n\t\tfs.writeFileSync(filePath, content);\n\t} catch (err) {\n\t\tconsole.error(`Error saving file: ${err}`);\n\t}\n}\n\nexport {\n\tcheckSites,\n\tgenerateBuildReport,\n\tgenerateSitemaps,\n\tgetSiteData,\n\tunpublishSites,\n};\n", "import type { BuildMetaData } from \"../types/api\";\nimport type { RenderInfo } from \"../types/global\";\nimport type { GriddoPageObject } from \"../types/pages\";\nimport type { Site } from \"../types/sites\";\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport fsx from \"fs-extra\";\n\nimport { getConfig, removeProperties, walk, walkStore } from \"./core-utils\";\n\nconst config = getConfig();\n\n/**\n * Read all path pages stored in the `store` Griddo directory and returns the\n * absolute file path.\n *\n * @param domain - The domain to get the pages from.\n */\nfunction getBuildPagesFromCachedStore<PageType extends GriddoPageObject>(\n\tdomain: string,\n) {\n\tconst { __caches } = config.paths(domain);\n\treturn getBuildPagesFromStore<PageType>({\n\t\tbasePath: path.join(__caches, \"store\"),\n\t\twithSizeProp: false,\n\t});\n}\n\n/**\n * Read all pages stored in the `store` Griddo directory and returns one by one\n * with a generator.\n *\n * @param basePath - Base directory to get pages from.\n * @param options.withSizeProp - Add size prop to the page object.\n * @todo throw error if the basePath is not an store folder\n */\nfunction* getBuildPagesFromStore<PageType extends GriddoPageObject>(args?: {\n\tbasePath?: string;\n\twithSizeProp?: boolean;\n}) {\n\tconst { basePath, withSizeProp } = args || {};\n\tconst { __cx } = config.paths();\n\tconst pagesDirPath = basePath || path.join(__cx, \"store\");\n\n\tconst jsonFilePaths = walkStore(pagesDirPath).filter(\n\t\t(file) => path.extname(file) === \".json\",\n\t);\n\n\tfor (const filePath of jsonFilePaths) {\n\t\ttry {\n\t\t\tconst page = fsx.readJsonSync(filePath, {\n\t\t\t\tencoding: \"utf-8\",\n\t\t\t}) as PageType;\n\n\t\t\tif (withSizeProp) {\n\t\t\t\tconst fileStats = fs.statSync(filePath);\n\t\t\t\tpage.size = fileStats.size / 1024;\n\t\t\t}\n\n\t\t\t// SECURITY: Only returns valid page objects\n\t\t\tif (page.path) {\n\t\t\t\tyield page;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error(`Error: The file ${filePath} doesn't exist`, error);\n\t\t}\n\t}\n}\n\n/**\n * Read all pages stored in `store` Griddo directory and return the absolute path.\n */\nfunction getBuildPagesPath() {\n\tconst config = getConfig();\n\tconst { __cx } = config.paths();\n\n\tconst PAGES_DIR = path.join(__cx, \"store\");\n\tconst PAGE_FILES = walk(PAGES_DIR).filter(\n\t\t(file) => path.extname(file) === \".json\",\n\t);\n\n\treturn PAGE_FILES;\n}\n\n/**\n * Get the build metadata from the Store.\n */\nasync function getBuildMetadata(): Promise<BuildMetaData> {\n\tconst { __cx } = config.paths();\n\tconst { sitesToPublish, createdPages, buildProcessData } = fsx.readJSONSync(\n\t\tpath.join(__cx, \"store\", \"metadata\", \"render-info.json\"),\n\t);\n\n\treturn {\n\t\tbuildProcessData,\n\t\tcreatedPages,\n\t\tsitesToPublish,\n\t};\n}\n\n/**\n * Creates an `store` dir to store pages transformed by createStore\n */\nfunction createStoreDir() {\n\tconst { __cx } = config.paths();\n\tconst storeDir = path.join(__cx, \"store\");\n\n\tif (!fs.existsSync(storeDir)) {\n\t\tfs.mkdirSync(storeDir);\n\t\tfs.mkdirSync(path.join(storeDir, \"metadata\"));\n\t}\n\n\tconsole.info(\"Store initialized\");\n}\n\n/**\n * Write render info into a file.\n * @param basePath - Absolute path of the dir from which files will be saved.\n * @param renderInfo - Data that will be saved related to the render process.\n */\nfunction saveRenderInfoInStore(basePath: string, renderInfo: RenderInfo) {\n\tconst { __cx } = config.paths();\n\n\tfs.writeFileSync(\n\t\tpath.join(__cx, \"store\", \"metadata\", \"render-info.json\"),\n\t\tJSON.stringify(renderInfo),\n\t);\n}\n\n/**\n * Return an array of ids only from `.json` files (no dirs) in the `basePath` dir based in the file name and filtered by the pages ids in a concrete site.\n * @param basePath - Absolute path of the dir from which files will be read.\n * @returns A Array<number> of pages ids in `basePath` dir filtered by pages ids in a concrete site.\n */\n// function getPagesInStoreDirBySitePages(\n// \tbasePath: string,\n// \tpages: Array<number>,\n// ): Array<number> {\n// \tconst allPagesInStore = getPageInStoreDir(basePath);\n// \tconst pagesBySite = allPagesInStore.filter((page) => pages.includes(page));\n\n// \treturn pagesBySite;\n// }\n\n/**\n * Return an array of ids only from `.json` files (no dirs) in the `basePath` dir based in the file name.\n * @param basePath - Absolute path of the dir from which files will be read.\n * @returns A Array<number> of pages ids in `basePath` dir.\n */\nfunction getPageInStoreDir(basePath: string): Array<number> {\n\tconst filesInStore = fs.readdirSync(basePath);\n\n\treturn (\n\t\tfilesInStore\n\t\t\t.filter((file) => {\n\t\t\t\tconst fullPathFile = `${basePath}/${file}`;\n\t\t\t\tconst stat = fs.statSync(fullPathFile);\n\t\t\t\t// Si es un directorio, no lo incluimos.\n\t\t\t\tif (stat && stat.isDirectory()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// Si es un archivo pero no tiene la extensi\u00F3n `.json`, no lo incluimos\n\t\t\t\tif (path.extname(file) !== \".json\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// Si es un archivo con el nombre NO pasable a n\u00FAmero (NaN), no lo incluimos.\n\t\t\t\tconst baseFilename = path.basename(file, path.extname(file));\n\t\t\t\tif (isNaN(parseInt(baseFilename))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// no es dir, es json y con nombre pasable a n\u00FAmero, ok :)\n\t\t\t\treturn true;\n\t\t\t})\n\t\t\t// Tenemos solo jsons donde el nombre es un \"n\u00FAmero\": \"21345.json\"\n\t\t\t.map((page) => {\n\t\t\t\tconst filename = path.basename(page, path.extname(page));\n\t\t\t\treturn parseInt(filename);\n\t\t\t})\n\t);\n}\n\n/**\n * Save the pages into the file system.\n * @param pages - An array of Griddo page objects to be saved.\n */\nfunction savePagesInStore(\n\tsiteFolderName: string,\n\tpages: Array<GriddoPageObject>,\n) {\n\tconst { __cx } = config.paths();\n\n\ttry {\n\t\tpages.forEach((page) => {\n\t\t\tremoveProperties(page, [\"editorID\", \"parentEditorID\"]);\n\t\t\tconst filename = `${page.context.page.id}.json`;\n\t\t\tconst filePath = path.join(__cx, \"store\", siteFolderName, filename);\n\t\t\tfsx.writeJSONSync(filePath, page);\n\t\t});\n\t} catch (e) {\n\t\tconsole.log(\"ERROR\", e);\n\t}\n}\n\n/**\n * Remove files from dir.\n * @param filenames - An array of ids representing file page names.\n */\nfunction removePagesFromStore(siteDirName: string, filenames: Array<number>) {\n\tconst { __cx } = config.paths();\n\n\tif (filenames.length === 0) {\n\t\treturn;\n\t}\n\n\tfilenames.forEach((filename) => {\n\t\tconst filePath = path.join(__cx, \"store\", siteDirName, `${filename}.json`);\n\t\ttry {\n\t\t\tfs.unlinkSync(filePath);\n\t\t} catch (error) {\n\t\t\tconsole.log(`Error removing file ${filename}`, (error as Error).message);\n\t\t}\n\t});\n}\n\n/**\n * Returns pages that need to be created or deleted for a site in the store based on the provided arguments.\n * @param sitePages - Properties for page retrieval.\n * @param props.storeDir - Absolute path of the Griddo store.\n * @param props.pages - Exhaustive array of all pages in the site.\n * @param props.validPagesIds - Array of valid pages in the site.\n * @param props.changedPages - Array of pages that have been modified in the site.\n * @returns - An object containing the pages to be created and deleted in the site.\n */\nasync function getPagesToCreateOrDelete(sitePages: {\n\tsitesToPublish: Array<Site>;\n\tvalidPagesIds: Array<number>;\n\tchangedPages: Array<number>;\n\tsiteDirName: string;\n}) {\n\tconst { __cx } = config.paths();\n\tconst storeDir = path.join(__cx, \"store\");\n\n\tconst { changedPages, validPagesIds, siteDirName } = sitePages;\n\n\t// Array<ids> de las p\u00E1ginas que est\u00E1n f\u00EDsicamente en el store en el\n\t// site actual del bucle.\n\tconst siteDirStorePath = path.join(storeDir, siteDirName);\n\tconst pagesInStore = getPageInStoreDir(siteDirStorePath);\n\n\t// Array<ids> que est\u00E1n el `validPagesIds` pero no est\u00E1n por alg\u00FAn\n\t// motivo en el store. Se incluyen porque deben ser creadas.\n\tconst pagesMissingInStore = validPagesIds.filter(\n\t\t(page) => !pagesInStore.includes(page),\n\t);\n\n\t// Array<ids> para enviar al store, que son las que han cambiado y\n\t// las missings.\n\tconst pagesToStore = pagesMissingInStore.concat(changedPages);\n\n\t// Array<ids> de las p\u00E1ginas que han sido eliminadas para quitarlas\n\t// f\u00EDsicamente de la carpeta store.\n\tconst pagesToDeleteFromStore = pagesInStore.filter((page) => {\n\t\t// Las que no est\u00E9n en validPages\n\t\treturn !validPagesIds.includes(page);\n\t});\n\n\t// 1 - Elimina del array final las p\u00E1ginas borradas.\n\t// 2 - Elimina las posibles p\u00E1ginas (ids) duplicadas. (new Set)\n\tconst pagesToWriteToStore = Array.from(new Set(pagesToStore)).filter(\n\t\t(page) => !pagesToDeleteFromStore.includes(page),\n\t);\n\n\t// 1 - Leer el store\n\t// 2 - eliminar las p\u00E1ginas que tengan como site uno despublicado o borrado\n\t// const allPagesInStore = getBuildPagesFromStore();\n\n\t// const pagesFromInvalidSites: Array<number> = [];\n\t// for await (const page of allPagesInStore) {\n\t// \tconst pageSite = page.context.page.site;\n\t// \tconst pageId = page.context.page.id!;\n\t// \t// Si el `site.id` de la p\u00E1gina no es ninguno de los `sitesToPublish`\n\t// \t// a\u00F1adimos la p\u00E1gina a `pagesFromIvalidSites` para borrarla\n\t// \t// posteriormente.\n\t// \tif (!sitesToPublish.map((site) => site.id).includes(pageSite)) {\n\t// \t\tpagesFromInvalidSites.push(pageId);\n\t// \t}\n\t// }\n\n\treturn {\n\t\tpagesInStore,\n\t\tpagesMissingInStore,\n\t\tpagesToDeleteFromStore: [\n\t\t\t...pagesToDeleteFromStore,\n\t\t\t// ...pagesFromInvalidSites,\n\t\t],\n\t\tpagesToWriteToStore,\n\t};\n}\n\nexport {\n\tcreateStoreDir,\n\tgetBuildMetadata,\n\tgetBuildPagesFromCachedStore,\n\tgetBuildPagesFromStore,\n\tgetBuildPagesPath,\n\tgetPageInStoreDir,\n\tgetPagesToCreateOrDelete,\n\tremovePagesFromStore,\n\tsavePagesInStore,\n\tsaveRenderInfoInStore,\n};\n", "import axios from \"axios\";\nimport chalk from \"chalk\";\n\nimport { endpoints, envs } from \"../constants\";\n\n/**\n * Service for authentication in the Griddo Private API\n */\nclass AuthService {\n\tuser: string | undefined;\n\tpassword: string | undefined;\n\tbaseUrl: string | undefined;\n\theaders:\n\t\t| { Authorization: string; \"Cache-Control\": string; lang?: string }\n\t\t| undefined;\n\n\tconstructor() {\n\t\tthis.user = envs.GRIDDO_BOT_USER;\n\t\tthis.password = envs.GRIDDO_BOT_PASSWORD;\n\t\tthis.baseUrl = envs.GRIDDO_API_URL;\n\t}\n\n\tasync login() {\n\t\ttry {\n\t\t\tconst response = await axios({\n\t\t\t\turl: endpoints.LOGIN,\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: {\n\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\tConnection: \"close\",\n\t\t\t\t},\n\t\t\t\tdata: {\n\t\t\t\t\tusername: this.user,\n\t\t\t\t\tpassword: this.password,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tif (response.status === 200) {\n\t\t\t\tconst {\n\t\t\t\t\tdata: { token },\n\t\t\t\t} = response;\n\t\t\t\tthis.headers = {\n\t\t\t\t\tAuthorization: \"bearer \" + token,\n\t\t\t\t\t\"Cache-Control\": \"no-store\",\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn this.headers;\n\t\t} catch (e) {\n\t\t\tconsole.error(\n\t\t\t\tchalk.red(`\n\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E\n\u2502 Access credentials failure \u2502\n\u2502 Check that the login details are correct in your .env file \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\n`),\n\t\t\t);\n\n\t\t\tprocess.exit(1);\n\t\t}\n\t}\n}\n\nconst authService = new AuthService();\n\nexport { authService as AuthService };\n", "import type {\n\tAPIRequest,\n\tAPIResponses,\n\tGetAPI,\n\tPostAPI,\n\tPutAPI,\n\tShowApiErrorOptions,\n} from \"../types/api\";\nimport type { AxiosError, Method } from \"axios\";\n\nimport axios from \"axios\";\nimport chalk from \"chalk\";\nimport dotenv from \"dotenv\";\n\nimport { saveCache, searchCacheData } from \"./cache\";\nimport { delay, getSafeSiteId, msToSec } from \"./core-utils\";\nimport { infoLog } from \"./loggin\";\nimport { envs } from \"../constants\";\nimport { apiRegister } from \"../registers\";\nimport { AuthService } from \"../services/auth\";\n\ndotenv.config();\n\n// Envs\nconst {\n\tenv: { RETRY_WAIT_SECONDS = \"4\", RETRY_ATTEMPTS = \"4\" },\n} = process;\n\n/**\n * Make a GET/PUT/POST request to the Griddo API.\n *\n * @template T Response Type returned.\n * @returns {Promise<T>} A promise that is resolved with the data from the API response.\n *\n * @example\n *\tconst response = await requestAPI<Site>(\n *\t\t{ endpoint: \"...\", cacheKey: \"...\", ... },\n *\t\t\"get\",\n *\t\t\"...\"\n *\t);\n */\nasync function requestAPI<T extends APIResponses>(\n\tprops: APIRequest,\n\tmethod: Method,\n\tappendToLog = \"\",\n): Promise<T> {\n\tconst { endpoint, body, cacheKey = \"\", attempt = 1, headers } = props;\n\tconst cacheOptions = { endpoint, body, headers, cacheKey };\n\n\t// Cache\n\tif (cacheKey) {\n\t\tconst start = new Date();\n\t\tconst cacheData = searchCacheData<T>(cacheOptions);\n\n\t\tif (cacheData) {\n\t\t\tconst siteId = getSafeSiteId(cacheData);\n\t\t\tconst siteIdMsg = siteId ? `site: ${siteId}` : \"\";\n\t\t\tconst duration = msToSec(new Date().getTime() - start.getTime());\n\t\t\tinfoLog(\n\t\t\t\t`${method} (cache) ${siteIdMsg} ${endpoint} - ${duration}s ${appendToLog}`,\n\t\t\t);\n\t\t\treturn cacheData;\n\t\t}\n\t}\n\n\t// Network\n\ttry {\n\t\tconst start = new Date();\n\t\tconst {\n\t\t\tdata,\n\t\t\theaders: responseHeaders,\n\t\t}: { data: T; headers: { \"content-length\": string } } = await axios({\n\t\t\turl: endpoint,\n\t\t\tmethod,\n\t\t\theaders: Object.assign({}, headers, AuthService.headers),\n\t\t\tdata: body,\n\t\t});\n\n\t\tconst siteId = getSafeSiteId(data);\n\t\tconst siteIdMsg = siteId ? `site: ${siteId}` : \"\";\n\t\tconst duration = msToSec(new Date().getTime() - start.getTime());\n\t\tinfoLog(\n\t\t\t`${method} (fetch) ${siteIdMsg} ${endpoint} - ${duration}s ${appendToLog}`,\n\t\t);\n\n\t\tsaveCache(cacheOptions, data);\n\n\t\t// Only save registers in alerts are enabled\n\t\tif (envs.GRIDDO_ALERT_FEATURE) {\n\t\t\tconst responseSize = Number.parseInt(responseHeaders[\"content-length\"]);\n\t\t\tif (responseSize > envs.GRIDDO_API_MAX_RESPONSE_SIZE) {\n\t\t\t\tapiRegister.insert(\"API_RESPONSE_TOO_BIG\", {\n\t\t\t\t\tendpoint,\n\t\t\t\t\tresponseSize,\n\t\t\t\t\tduration,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn data;\n\t} catch (e) {\n\t\tconst error = e as AxiosError;\n\n\t\tif (error.response?.status === 404) {\n\t\t\t// @ts-expect-error page maybe will be 404\n\t\t\treturn null;\n\t\t}\n\n\t\tif (attempt > parseInt(RETRY_ATTEMPTS)) {\n\t\t\tconsole.log(`\nMax attempts ${RETRY_ATTEMPTS} reached\n--------------------------------------\n- ${method.toUpperCase()} ${endpoint}\n- BODY: ${JSON.stringify(body)}\n- HEADERS: ${JSON.stringify(headers)}\n- RESPONSE: ${(error.response?.status, JSON.stringify(error.response?.data))}\n--------------------------------------\n`);\n\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\tif (!error.response) {\n\t\t\tconsole.log(\"Unknown error occurred\");\n\t\t\tconsole.log(JSON.stringify(error, null, 2));\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\tshowApiError(error, { callInfo: { endpoint, body } });\n\n\t\tconsole.warn(`Waiting for retry: ${method}`, endpoint);\n\n\t\tawait delay(parseInt(RETRY_WAIT_SECONDS) * 1000);\n\n\t\treturn requestAPI<T>(\n\t\t\t{\n\t\t\t\tendpoint,\n\t\t\t\tbody,\n\t\t\t\theaders,\n\t\t\t\tcacheKey,\n\t\t\t\tattempt: attempt + 1,\n\t\t\t},\n\t\t\tmethod,\n\t\t\tappendToLog,\n\t\t);\n\t}\n}\n\n/**\n * Make a GET request to the Griddo API.\n *\n * @template T Response Type returned.\n * @returns A promise that is resolved with the data from the API response.\n */\nasync function getApi<T extends APIResponses>(props: GetAPI) {\n\treturn await requestAPI<T>(props, \"get\");\n}\n\n/**\n * Make a PUT request to the Griddo API.\n *\n * @template T Response Type returned.\n * @returns A promise that is resolved with the data from the API response.\n */\nasync function putApi<T extends APIResponses>(props: PutAPI) {\n\treturn await requestAPI<T>(props, \"put\");\n}\n\n/**\n * Make a POST request to the Griddo API.\n *\n * @template T Response Type returned.\n * @returns A promise that is resolved with the data from the API response.\n */\nasync function postApi<T extends APIResponses>(props: PostAPI) {\n\tconst { endpoint, body, headers } = props;\n\tconst distributorBodyParams =\n\t\tendpoint.endsWith(\"/distributor\") &&\n\t\t`# Distributor body: ${JSON.stringify(body)} lang: ${JSON.stringify(\n\t\t\theaders?.lang,\n\t\t)}`;\n\n\treturn await requestAPI<T>(props, \"post\", distributorBodyParams || \"\");\n}\n\n/**\n * Shows an API error through the terminal.\n */\nfunction showApiError(error: AxiosError, options: ShowApiErrorOptions) {\n\tconst { response, message, stack } = error;\n\tconst { callInfo } = options;\n\tconst { status, statusText, data } = response || {};\n\tconst callInfoArray = [];\n\n\tfor (const item of Object.keys(callInfo) as Array<keyof typeof callInfo>) {\n\t\tcallInfoArray.push(\n\t\t\t`${item}: ${\n\t\t\t\ttypeof callInfo[item] === \"object\"\n\t\t\t\t\t? JSON.stringify(callInfo[item])\n\t\t\t\t\t: callInfo[item]\n\t\t\t}`,\n\t\t);\n\t}\n\n\t// Compose the errors output\n\tconst callInfoStr = callInfoArray.join(\"\\n\");\n\tconst apiResponseStr = response\n\t\t? `Code: ${status} - ${statusText}\\nResponse: ${JSON.stringify(data)}`\n\t\t: \"\";\n\tconst errorDetailsStr = `${message}\\n${stack}`;\n\n\t// Print the error\n\tconsole.warn(\n\t\tchalk.bold.red(`\n=============\n\n{ Call info }\n${callInfoStr}\n\n{ API Response }\n${apiResponseStr}\n\n{ Error details }\n${errorDetailsStr}\n\n=============\n`),\n\t);\n}\n\nexport { getApi as get, postApi as post, putApi as put };\n", "import type { Petition } from \"../types/global\";\nimport type { HashSites, SiteHash } from \"../types/sites\";\n\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport fsx from \"fs-extra\";\n\nimport { getConfig } from \"./core-utils\";\n\nconst config = getConfig();\n\n/**\n * Creates an `apiCache` dir to store pages fetched from them API.\n */\nfunction createAPICacheDir() {\n\tconst { __cx } = config.paths();\n\tconst apiCacheDir = path.join(__cx, \"apiCache\");\n\n\tif (!fs.existsSync(apiCacheDir)) {\n\t\tfs.mkdirSync(apiCacheDir);\n\t}\n\n\tconsole.info(\"Cache initialized\");\n}\n\n/**\n * Generate a filename with a hash using a Petition object\n *\n * @todo Merge with createSha256\n * @param petition An object\n */\nfunction generateFilenameWithHash(petition: Petition) {\n\tconst { __cx } = config.paths();\n\tconst apiCacheDir = path.join(__cx, \"apiCache\");\n\n\tconst hashSum = crypto.createHash(\"sha256\");\n\thashSum.update(JSON.stringify(petition));\n\n\treturn `${apiCacheDir}/${hashSum.digest(\"hex\")}`;\n}\n\n/**\n * Generate a filename with a hash using a string.\n *\n * @todo Merge with generateFilenameWithHash\n * @param data A string to create a sha256 based on.\n */\nfunction createSha256(data: string) {\n\tconst uniqueString = crypto.randomBytes(16).toString(\"hex\");\n\tconst hash = crypto.createHash(\"sha256\");\n\thash.update(`${data}${uniqueString}`);\n\n\treturn hash.digest(\"hex\");\n}\n\n/**\n * Save a file using a hash name.\n *\n * @param petition An object.\n * @param content Content to be saved.\n */\nfunction saveCache<T>(petition: Petition, content: T) {\n\tconst stringContent =\n\t\ttypeof content === \"string\" ? content : JSON.stringify(content);\n\tconst filename = generateFilenameWithHash(petition);\n\tconst filepath = path.dirname(filename);\n\tif (!fs.existsSync(filepath)) {\n\t\tfs.mkdirSync(filepath, { recursive: true });\n\t}\n\tfs.writeFileSync(filename, stringContent, \"utf8\");\n}\n\n/**\n * Search in the `apiCache` dir for a file using the petition as hash generator.\n * Return the file content if found or null if not.\n *\n * @param petition An object\n */\nfunction searchCacheData<T>(petition: Petition) {\n\ttry {\n\t\tconst file = generateFilenameWithHash(petition);\n\t\tconst jsonData = fsx.readJSONSync(file, {\n\t\t\tencoding: \"utf-8\",\n\t\t});\n\t\treturn jsonData as T;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/**\n * Get site hashes from the file as an object\n */\nfunction getHashSites(): HashSites {\n\tconst { __cx } = config.paths();\n\tconst apiCacheDir = path.join(__cx, \"apiCache\");\n\tconst siteHasFilename = `${apiCacheDir}/siteHash.json`;\n\n\ttry {\n\t\tconst jsonData = fsx.readJSONSync(siteHasFilename, {\n\t\t\tencoding: \"utf-8\",\n\t\t});\n\t\treturn jsonData || {};\n\t} catch {\n\t\treturn {};\n\t}\n}\n\n/**\n * Update (write) the site hash file.\n *\n * @param siteId The id of the site.\n * @param siteHash The has of the site.\n */\nfunction updatedSiteHash(siteId: number, siteHash: SiteHash) {\n\tconst allHash = getHashSites();\n\tconst lastHash = allHash[siteId];\n\tconst currentHash = siteHash || lastHash || new Date().valueOf();\n\n\tconst { __cx } = config.paths();\n\tconst apiCacheDir = path.join(__cx, \"apiCache\");\n\tconst siteHasFilename = `${apiCacheDir}/siteHash.json`;\n\n\tif (currentHash !== lastHash) {\n\t\tallHash[siteId] = currentHash;\n\t\tfs.writeFileSync(siteHasFilename, JSON.stringify(allHash), {\n\t\t\tencoding: \"utf-8\",\n\t\t});\n\t}\n\n\treturn currentHash.toString();\n}\n\nexport {\n\tcreateAPICacheDir,\n\tcreateSha256,\n\tsaveCache,\n\tsearchCacheData,\n\tupdatedSiteHash,\n};\n", "import fsx from \"fs-extra\";\n\ntype Entry = Record<string, unknown>;\n\ntype EntryData = {\n\ttitle: string;\n\tdescription: string;\n\tentries: Array<Entry>;\n};\n\ntype Entries = Record<string, EntryData>;\n\ninterface RegisterBase<T extends Entries> {\n\tinsert(name: keyof T, entry: Entry): void;\n\tget(name: keyof T): EntryData;\n\tgetAll(): T;\n}\n\nclass MemoryRegister<T extends Entries> implements RegisterBase<T> {\n\tentries: T;\n\n\tconstructor(entries: T) {\n\t\tthis.entries = entries;\n\t}\n\n\tinsert(name: keyof T, entry: Entry) {\n\t\tthis.entries[name].entries.push(entry);\n\t}\n\n\tget(name: keyof T) {\n\t\treturn this.entries[name];\n\t}\n\n\tgetAll() {\n\t\treturn this.entries;\n\t}\n}\n\nclass FileRegister<T extends Entries> implements RegisterBase<T> {\n\tprivate readonly filePath: string;\n\tentries: T;\n\n\tconstructor(filePath: string, entries: T) {\n\t\tthis.entries = entries;\n\t\tthis.filePath = filePath;\n\t\ttry {\n\t\t\tfsx.writeJSONSync(this.filePath, this.entries);\n\t\t} catch (e) {\n\t\t\tconsole.error(`Error writing ${this.filePath}`, e);\n\t\t}\n\t}\n\n\tprivate getCurrentEntries(): T {\n\t\treturn fsx.readJSONSync(this.filePath, \"utf8\") as T;\n\t}\n\n\tinsert(name: keyof T, entry: Entry) {\n\t\ttry {\n\t\t\tconst currentEntries = this.getCurrentEntries();\n\t\t\tcurrentEntries[name].entries.push(entry);\n\t\t\tfsx.writeJSONSync(this.filePath, currentEntries);\n\t\t} catch (e) {\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tget(name: keyof T) {\n\t\ttry {\n\t\t\treturn fsx.readJSONSync(this.filePath, \"utf8\")[name] as EntryData;\n\t\t} catch (e) {\n\t\t\tthrow new Error(`Error reading ${this.filePath}`);\n\t\t}\n\t}\n\n\tgetAll() {\n\t\ttry {\n\t\t\treturn fsx.readJSONSync(this.filePath, \"utf8\") as T;\n\t\t} catch (e) {\n\t\t\tthrow new Error(`Error reading ${this.filePath}`);\n\t\t}\n\t}\n}\n\nclass Register<T extends Entries> {\n\tprivate strategy: RegisterBase<T>;\n\n\tconstructor(strategy: RegisterBase<T>) {\n\t\tthis.strategy = strategy;\n\t}\n\n\tinsert<K extends keyof T>(name: K, entry: Entry) {\n\t\tthis.strategy.insert(name, entry);\n\t}\n\n\tget<K extends keyof T>(name: K) {\n\t\treturn this.strategy.get(name);\n\t}\n\n\tgetAll() {\n\t\treturn this.strategy.getAll();\n\t}\n\n\thaveEntries() {\n\t\treturn Object.keys(this.strategy.getAll()).length > 0;\n\t}\n\n\tisEmpty() {\n\t\treturn !this.haveEntries();\n\t}\n}\n\nexport {\n\tFileRegister,\n\tMemoryRegister,\n\tRegister,\n\ttype Entries,\n\ttype Entry,\n\ttype EntryData,\n};\n", "import { MemoryRegister, Register } from \"../services/register\";\n\nconst entries = {\n\tAPI_RESPONSE_TOO_BIG: {\n\t\ttitle: \"API response size is too large (80KB)\",\n\t\tdescription:\n\t\t\t\"API response size is too large and may affect rendering performance\",\n\t\tentries: [],\n\t},\n};\n\nconst register = new Register(new MemoryRegister(entries));\n\nexport default register;\n", "import { MemoryRegister, Register } from \"../services/register\";\n\nconst entries = {\n\tGATSBY_PAGE_SIZE_TOO_BIG: {\n\t\ttitle: \"Gatsby JSON page size is too large (512KB)\",\n\t\tdescription:\n\t\t\t\"The JSON of some Gatsby pages (page-data folder) are too large and may affect rendering performance\",\n\t\tentries: [],\n\t},\n};\n\nconst register = new Register(new MemoryRegister(entries));\n\nexport default register;\n", "import type {\n\tAllSitesReponse,\n\tDistributorBody,\n\tDistributorResponse,\n\tEndPageInfoResponse,\n\tEndSiteRenderBody,\n\tLanguagesResponse,\n\tPageResponse,\n\tSitemapAPIResponse,\n\tSocialsResponse,\n\tStartPageRenderResponse,\n} from \"../types/api\";\nimport type { Site } from \"../types/sites\";\nimport type { Core } from \"@griddo/core\";\n\nimport { endpoints } from \"../constants\";\nimport { get, post } from \"../utils/api\";\n\n/**\n * Get a list of site objects.\n */\nasync function getAllSites() {\n\treturn await get<AllSitesReponse>({ endpoint: endpoints.GET_ALL });\n}\n\n/**\n * Fetch a page object from API.\n */\nasync function getPage(id: number, cacheKey: string) {\n\treturn await get<PageResponse>({\n\t\tendpoint: `${endpoints.GET_PAGE}/${id}`,\n\t\tcacheKey,\n\t});\n}\n\n/**\n * Get site info\n */\nasync function getSiteInfo(id: number, cacheKey = \"\") {\n\tconst [prefix, suffix] = endpoints.INFO;\n\n\treturn await get<Site>({\n\t\tendpoint: `${prefix}${id}${suffix}`,\n\t\tcacheKey,\n\t});\n}\n\nasync function getSiteLanguages(id: number, cacheKey = \"\") {\n\tconst [prefix, suffix] = endpoints.LANGUAGES;\n\n\treturn await get<LanguagesResponse>({\n\t\tendpoint: `${prefix}${id}${suffix}`,\n\t\tcacheKey,\n\t});\n}\n\nasync function startSiteRender(id: number) {\n\tconst [prefix, suffix] = endpoints.BUILD_START;\n\n\treturn await get<StartPageRenderResponse>({\n\t\tendpoint: `${prefix}${id}${suffix}`,\n\t});\n}\n\n/**\n * Send the end signal to API for a render site.\n */\nasync function endSiteRender(id: number, body: EndSiteRenderBody) {\n\tconst [prefix, suffix] = endpoints.BUILD_END;\n\n\treturn await post<EndPageInfoResponse>({\n\t\tendpoint: `${prefix}${id}${suffix}`,\n\t\tbody,\n\t});\n}\n\nasync function getDistributorData(\n\tpage: Core.Page,\n\tbody: DistributorBody,\n\tcacheKey: string,\n\tdataSiteId?: number,\n\tdataLangID?: number,\n) {\n\tconst [prefix, suffix] = endpoints.GET_REFERENCE_FIELD_DATA;\n\tconst site = dataSiteId || page.site;\n\tconst lang = dataLangID || page.language;\n\n\treturn await post<DistributorResponse>({\n\t\tendpoint: `${prefix}${site}${suffix}`,\n\t\tbody,\n\t\theaders: { lang },\n\t\tcacheKey,\n\t});\n}\n\nasync function getSitemap(id: number) {\n\tconst [prefix, suffix] = endpoints.GET_SITEMAP;\n\n\treturn await get<SitemapAPIResponse>({\n\t\tendpoint: `${prefix}${id}${suffix}`,\n\t});\n}\n\nasync function getSiteSocials(id: number, cacheKey = \"\") {\n\tconst [prefix, suffix] = endpoints.SOCIALS;\n\n\treturn await get<SocialsResponse>({\n\t\tendpoint: `${prefix}${id}${suffix}`,\n\t\tcacheKey,\n\t});\n}\n\nexport {\n\tendSiteRender,\n\tgetAllSites,\n\tgetSiteLanguages,\n\tgetPage,\n\tgetDistributorData,\n\tgetSiteInfo,\n\tgetSitemap,\n\tgetSiteSocials,\n\tstartSiteRender,\n};\n", "import type { Robots } from \"../types/global\";\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { endpoints } from \"../constants\";\nimport { get } from \"../utils/api\";\nimport { getConfig } from \"../utils/core-utils\";\n\nconst config = getConfig();\n\nasync function getRobots() {\n\ttry {\n\t\tconst robots = await get<Robots>({ endpoint: endpoints.ROBOTS });\n\n\t\treturn (\n\t\t\trobots\n\t\t\t\t?.filter((r) => !!r.path)\n\t\t\t\t.map(({ path, content }) => ({\n\t\t\t\t\tpath,\n\t\t\t\t\tcontent: content || \"User-agent: *\\n\\r\\n\\rAllow: /\",\n\t\t\t\t})) || []\n\t\t);\n\t} catch (e) {\n\t\tconsole.warn(`Robots: ${(e as Error).message}`);\n\t}\n}\n\nasync function writeRobots(domain: string) {\n\tconst { __cx } = config.paths(domain);\n\tconst distDirectory = path.join(__cx, \"dist\");\n\n\tconst robots = await getRobots();\n\n\tif (!robots) {\n\t\tconsole.log(`Robots not found for ${domain}`);\n\t\treturn;\n\t}\n\n\tconst robot = robots.find(({ path }) => path === `/${domain}`);\n\n\tif (!robot) {\n\t\tconsole.log(`Robots not found for ${domain}`);\n\t\treturn;\n\t}\n\n\tif (fs.existsSync(distDirectory)) {\n\t\tconst fileLocation = path.join(distDirectory, \"robots.txt\");\n\t\tfs.writeFileSync(fileLocation, robot?.content);\n\t} else {\n\t\tconsole.log(`${distDirectory} not found`);\n\t}\n}\n\nexport { writeRobots };\n", "import type { Artifacts, PlaceholderPath } from \"../types/global\";\n\nimport path from \"node:path\";\n\n/**\n * Returns the artifacts of CX.\n */\nfunction getCxArtifacts(paths: Record<PlaceholderPath, string>): Artifacts {\n\tconst { __cx, __exports, __caches } = paths;\n\n\treturn {\n\t\tinitials: [\n\t\t\t__exports, // `/exports/<domain>`\n\t\t\t__caches, // `__cx/caches/<domain>`\n\t\t],\n\t\tdisposables: [\n\t\t\tpath.join(__cx, \"store\"),\n\t\t\tpath.join(__cx, \"apiCache\"),\n\t\t\tpath.join(__cx, \"dist\"),\n\t\t],\n\t\tcacheables: [\"apiCache\", \"store\"],\n\t\tarchivables: [\"dist\", \"assets\"],\n\t};\n}\n\nexport default getCxArtifacts;\n", "import type { Artifacts, PlaceholderPath } from \"../types/global\";\n\nimport path from \"node:path\";\n\n/**\n * Returns the artifacts of Gatsby.\n */\nfunction gatsbyArtifacts(paths: Record<PlaceholderPath, string>): Artifacts {\n\tconst { __ssg } = paths;\n\n\treturn {\n\t\tdisposables: [\n\t\t\tpath.join(__ssg, \"public\"),\n\t\t\tpath.join(__ssg, \"static\"),\n\t\t\tpath.join(__ssg, \".cache\"),\n\t\t],\n\t\tcacheables: [\".cache\"],\n\n\t\t// Gatsby does not have an initials directories to be created.\n\t\tinitials: [],\n\n\t\t// Gatsby does not have any archivable artifacts. The output of Gatsby\n\t\t// is moved to the Griddo `dist` artifacts.\n\t\tarchivables: [],\n\t};\n}\n\nexport default gatsbyArtifacts;\n", "import type { Adapters } from \"../adapters\";\nimport type { PlaceholderPath } from \"../types/global\";\n\nimport getCxArtifacts from \"./cx\";\nimport getGatsbyArtifacts from \"./gatsby\";\n\n/**\n * Returns the artifacts of a specific adapter along with those of CX.\n *\n * @param adapter - The adapter for which to get the artifacts.\n * @param options.cxPaths - The cx-paths.\n */\nfunction getArtifacts(\n\tadapter: Adapters,\n\toptions: {\n\t\tcxPaths: Record<PlaceholderPath, string>;\n\t},\n) {\n\tconst { cxPaths } = options;\n\tconst ssgArtifacts = {\n\t\tgatsby: getGatsbyArtifacts(cxPaths),\n\t};\n\n\treturn {\n\t\tcx: getCxArtifacts(cxPaths),\n\t\tssg: ssgArtifacts[adapter],\n\t};\n}\n\nexport { getArtifacts };\n", "import type { GriddoAlertRegisterProps } from \"@griddo/core\";\n\nimport axios from \"axios\";\n\nimport { endpoints } from \"../constants\";\n\n// Esta funci\u00F3n est\u00E1 duplicada de core de manera intencionada por si esta recibe\n// cambios necesitados solo por CX.\n// Nota: S\u00ED estamos reutilizando el type.\nexport async function insertAlert({\n\tarea,\n\tdescription,\n\tfullData,\n\tinstantNotification = false,\n\tlevel,\n}: Omit<GriddoAlertRegisterProps, \"publicApiUrl\">) {\n\tconst url = endpoints.ALERT;\n\tconst body = { level, area, description, fullData, instantNotification };\n\n\ttry {\n\t\tawait axios.post(url, body, {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t});\n\t} catch (error) {\n\t\tconsole.error(\"Error creating Griddo alert:\", error);\n\t}\n}\n", "import type { BuildProcessData } from \"../types/global\";\nimport type {\n\tGriddoListPage,\n\tGriddoMultiPage,\n\tGriddoPageObject,\n\tGriddoSinglePage,\n\tPageAdditionalInfo,\n} from \"../types/pages\";\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport dotenv from \"dotenv\";\nimport pLimit from \"p-limit\";\n\nimport { DistributorService } from \"./distributors\";\nimport { NavigationService } from \"./navigation\";\nimport { getAllSettings } from \"./settings\";\nimport { getPage } from \"./sites\";\nimport { envs } from \"../constants\";\nimport { updatedSiteHash } from \"../utils/cache\";\nimport {\n\tgetConfig,\n\tremoveAllSiteDirsFromStore,\n\tsiteList,\n} from \"../utils/core-utils\";\nimport { infoLog, verboseLog } from \"../utils/loggin\";\nimport {\n\tcreateGriddoListPages,\n\tcreateGriddoMultiPages,\n\tcreateGriddoSinglePage,\n\tgetMultiPageElements,\n\tgetPaginatedPages,\n} from \"../utils/pages\";\nimport { checkSites, getSiteData, unpublishSites } from \"../utils/sites\";\nimport {\n\tcreateStoreDir,\n\tgetPagesToCreateOrDelete,\n\tremovePagesFromStore,\n\tsavePagesInStore,\n\tsaveRenderInfoInStore,\n} from \"../utils/store\";\n\nconst config = getConfig();\n\ndotenv.config();\n\nconst RENDER_ID = new Date().valueOf().toString();\n\n/**\n * Fetch, process and save object pages and sites data into the file system to\n * be consumed by other services (Griddo itself, Adapters, etc.)\n */\nasync function createStore(domain: string) {\n\tcreateStoreDir();\n\n\tconsole.info(`API calls with ${envs.GRIDDO_API_CONCURRENCY_COUNT} threads`);\n\n\tconst { __cx } = config.paths();\n\tconst { griddoVersion } = config;\n\tconst storeDir = path.join(__cx, \"store\");\n\n\ttry {\n\t\t// Vars to save later in the report file\n\t\tconst createdPages: Array<number> = [];\n\t\tconst buildProcessData: BuildProcessData = {};\n\n\t\t// Get sites objects to publish and unpublish from this domain\n\t\tconst { sitesToPublish, sitesToUnpublish } = await checkSites(domain);\n\n\t\tconst domainHasSites =\n\t\t\tsitesToPublish.length > 0 || sitesToUnpublish.length > 0;\n\n\t\tif (!domainHasSites) {\n\t\t\tconsole.warn(`There are no sites to update in the domain ${domain}`);\n\t\t}\n\n\t\tconsole.info(`Sites to publish: ${siteList(sitesToPublish)}`);\n\t\tconsole.info(`Sites to unpublish: ${siteList(sitesToUnpublish)}`);\n\n\t\t// Send unpublished sites to API.\n\t\t// @todo \u00BFmover esta llamada al final del proceso de render?\n\t\t// Aqu\u00ED tambi\u00E9n se est\u00E1n eliminado f\u00EDsicamente los archivos json del\n\t\t// store de los sites para despublicar.\n\t\tawait unpublishSites(sitesToUnpublish);\n\n\t\t// Solo los sites to publish...\n\t\tfor (const site of sitesToPublish) {\n\t\t\tconst {\n\t\t\t\tid: siteId,\n\t\t\t\tslug: siteSlug,\n\t\t\t\ttheme,\n\t\t\t\tfavicon,\n\t\t\t\tchangedPages = [],\n\t\t\t} = site;\n\n\t\t\tconst {\n\t\t\t\tsiteInfo,\n\t\t\t\tvalidPagesIds,\n\t\t\t\tsiteHash,\n\t\t\t\tunpublishHashes,\n\t\t\t\tsiteLangs,\n\t\t\t\tdefaultLang,\n\t\t\t\theaders,\n\t\t\t\tfooters,\n\t\t\t\tsocials,\n\t\t\t} = await getSiteData(siteId);\n\n\t\t\tconst {\n\t\t\t\tcloudinaryName,\n\t\t\t\tuseMetaTitle,\n\t\t\t\tuseMetaKeywords,\n\t\t\t\tshowBasicMetaRobots,\n\t\t\t\tavoidHrefLangsOnCanonicals,\n\t\t\t\tavoidSelfReferenceCanonicals,\n\t\t\t\tavoidHrefLangXDefault,\n\t\t\t\tavoidDebugMetas,\n\t\t\t} = await getAllSettings();\n\n\t\t\tbuildProcessData[siteId] = {\n\t\t\t\tsiteHash,\n\t\t\t\tunpublishHashes,\n\t\t\t\tpublishHashes: [],\n\t\t\t};\n\n\t\t\tconst NavService = new NavigationService();\n\t\t\tNavService.navigations = { headers, footers };\n\n\t\t\tsite.languages = siteLangs;\n\n\t\t\tconst shouldUpdateSite = updatedSiteHash(siteId, siteHash);\n\n\t\t\tconst siteScript = siteInfo.siteScript;\n\n\t\t\tconst siteMetadata = {\n\t\t\t\tsiteUrl: siteInfo.slug,\n\t\t\t\ttitle: siteInfo.name,\n\t\t\t\tfavicon,\n\t\t\t};\n\n\t\t\tconst additionalInfo = {\n\t\t\t\tbaseUrl: envs.GRIDDO_API_URL,\n\t\t\t\tpublicBaseUrl: envs.GRIDDO_PUBLIC_API_URL,\n\t\t\t\tinstance: envs.GRIDDO_REACT_APP_INSTANCE,\n\t\t\t\tsiteSlug,\n\t\t\t\ttheme,\n\t\t\t\tsiteMetadata,\n\t\t\t\tsocials,\n\t\t\t\tsiteLangs,\n\t\t\t\tcloudinaryName,\n\t\t\t\tgriddoVersion,\n\t\t\t\tsiteOptions: {\n\t\t\t\t\tuseMetaTitle,\n\t\t\t\t\tuseMetaKeywords,\n\t\t\t\t\tshowBasicMetaRobots,\n\t\t\t\t\tavoidHrefLangsOnCanonicals,\n\t\t\t\t\tavoidSelfReferenceCanonicals,\n\t\t\t\t\tavoidHrefLangXDefault,\n\t\t\t\t\tavoidDebugMetas,\n\t\t\t\t},\n\t\t\t\tsiteScript,\n\t\t\t};\n\n\t\t\tinfoLog(`${site.name} site`);\n\n\t\t\t/// Creates the store directory for each site using the id\n\t\t\tfs.mkdirSync(path.join(storeDir, siteId.toString()), {\n\t\t\t\trecursive: true,\n\t\t\t});\n\n\t\t\t// -------------------------------------------------------------------------\n\t\t\t// Pages loop promise creation\n\t\t\t// -------------------------------------------------------------------------\n\t\t\t// Async function that process every page for one site to use later in the\n\t\t\t// `Promise.all` with pLimit.\n\t\t\tconst fetchPageAndSaveInStore = async (\n\t\t\t\tsiteIdName: string,\n\t\t\t\tpageId: number,\n\t\t\t) => {\n\t\t\t\t// Here will be store every page returned by the API and processed\n\t\t\t\tlet griddoPageObjects: Array<GriddoPageObject> = [];\n\n\t\t\t\t// Get page data\n\t\t\t\tconst page = await getPage(pageId, shouldUpdateSite);\n\n\t\t\t\t// Probably a 404\n\t\t\t\tif (!page) return;\n\n\t\t\t\t// Update Array of page ids\n\t\t\t\tcreatedPages.push(pageId);\n\n\t\t\t\t// TODO: Use structuredClone() when node 18 is available.\n\t\t\t\t// SHAME: This new pageAdditionalInfo needs to be a copy because\n\t\t\t\t// additionalInfo referenced from outside this function and\n\t\t\t\t// its used by other pages.\n\t\t\t\tconst pageAdditionalInfo = JSON.parse(\n\t\t\t\t\tJSON.stringify(additionalInfo),\n\t\t\t\t) as PageAdditionalInfo;\n\n\t\t\t\t// Updated with navigations (header & footer)\n\t\t\t\tpageAdditionalInfo.navigations = NavService.getPageNavigations(page);\n\n\t\t\t\t// Content Type Data Query\n\t\t\t\t// Where the pair `hasDistributorData:true` and `data` prop exists, this\n\t\t\t\t// function will attach a `queriedItems` prop with the result of the fetch\n\t\t\t\t// for the data.\n\t\t\t\tconst template = await DistributorService.getDistributorData({\n\t\t\t\t\tpage,\n\t\t\t\t\tcacheKey: RENDER_ID,\n\t\t\t\t});\n\n\t\t\t\t// MultiPage Query\n\t\t\t\t// Where the pair `hasGriddoMultiPage:true` prop exists, this function\n\t\t\t\t// will process the schema and return a multiPageElemtens array to use\n\t\t\t\t// in `createGriddoMultiPages()`\n\t\t\t\tconst multiPageElements = await getMultiPageElements(template);\n\n\t\t\t\t// -----------------------------------------------------------------------\n\t\t\t\t// Build Griddo page objects.\n\t\t\t\t// -----------------------------------------------------------------------\n\t\t\t\t// A page from the API could be one of those:\n\t\t\t\t// - List with pagination (static list template): needs to be splitted in n pages\n\t\t\t\t// - Multi-page module: needs to be splitted in n pages\n\t\t\t\t// - Single: just one page\n\n\t\t\t\t// Griddo page types\n\t\t\t\tconst isStaticListPage = page?.mode === \"list\";\n\t\t\t\tconst isMultiPage = !isStaticListPage && multiPageElements;\n\t\t\t\tconst isSinglePage = !isMultiPage && !isStaticListPage;\n\n\t\t\t\t// >> List (static list template) <<\n\t\t\t\tif (isStaticListPage) {\n\t\t\t\t\tconst griddoListPage = {\n\t\t\t\t\t\tpage: page,\n\t\t\t\t\t\tpages: getPaginatedPages(template),\n\t\t\t\t\t\tisRoot: false,\n\t\t\t\t\t\tdefaultLang: defaultLang,\n\t\t\t\t\t\ttemplate: template,\n\t\t\t\t\t\ttotalQueriedItems: template.queriedItems,\n\t\t\t\t\t} as GriddoListPage;\n\n\t\t\t\t\t// pageObjects = await createGriddoListPages({ adapter: \"Gatsby\" })\n\t\t\t\t\tgriddoPageObjects = await createGriddoListPages(\n\t\t\t\t\t\tgriddoListPage,\n\t\t\t\t\t\tpageAdditionalInfo,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// >> Multi-page <<\n\t\t\t\tif (isMultiPage) {\n\t\t\t\t\tconst griddoMultipage = page as GriddoMultiPage;\n\n\t\t\t\t\t// The `template` key with the (maybe) distributor data items queried\n\t\t\t\t\tgriddoMultipage.template = template;\n\t\t\t\t\tgriddoMultipage.multiPageElements = multiPageElements;\n\t\t\t\t\tgriddoMultipage.defaultLang = defaultLang;\n\n\t\t\t\t\tgriddoPageObjects = await createGriddoMultiPages(\n\t\t\t\t\t\tgriddoMultipage,\n\t\t\t\t\t\tpageAdditionalInfo,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// >> Single template <<\n\t\t\t\tif (isSinglePage) {\n\t\t\t\t\tconst griddoSinglePage = page as GriddoSinglePage;\n\n\t\t\t\t\t// The `template` key with the (maybe) distributor data items queried\n\t\t\t\t\tgriddoSinglePage.template = template;\n\t\t\t\t\tgriddoSinglePage.defaultLang = defaultLang;\n\n\t\t\t\t\tgriddoPageObjects = [\n\t\t\t\t\t\tawait createGriddoSinglePage(griddoSinglePage, pageAdditionalInfo),\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\t// Upload only the valid pages hashes of pages that has been changed or created\n\t\t\t\tif (page.hash !== null) {\n\t\t\t\t\tbuildProcessData[siteId].publishHashes.push(page.hash);\n\t\t\t\t}\n\n\t\t\t\t// Save build data to store\n\t\t\t\tsavePagesInStore(siteIdName, griddoPageObjects);\n\t\t\t};\n\n\t\t\t// Pages to be created or deleted in the store\n\t\t\tconst {\n\t\t\t\tpagesMissingInStore,\n\t\t\t\tpagesToDeleteFromStore,\n\t\t\t\tpagesToWriteToStore,\n\t\t\t} = await getPagesToCreateOrDelete({\n\t\t\t\tsitesToPublish,\n\t\t\t\tvalidPagesIds,\n\t\t\t\tchangedPages,\n\t\t\t\tsiteDirName: siteId.toString(),\n\t\t\t});\n\n\t\t\t// 1 - Delete pages from the store (just remove from disk)\n\t\t\tremovePagesFromStore(siteId.toString(), pagesToDeleteFromStore);\n\n\t\t\t// 2 - Create pages to the store (fetch from API, transform, etc..)\n\t\t\tconst limit = pLimit(envs.GRIDDO_API_CONCURRENCY_COUNT);\n\t\t\tconst pagesToStore = pagesToWriteToStore.map((id: number) =>\n\t\t\t\tlimit(() => fetchPageAndSaveInStore(siteId.toString(), id)),\n\t\t\t);\n\n\t\t\t// Debug time\n\t\t\tverboseLog(`Store site: ${site.name}`);\n\t\t\tverboseLog(`${validPagesIds} valid pages from API`);\n\t\t\tverboseLog(`changed ${changedPages} pages from API`);\n\t\t\tverboseLog(`deleted ${pagesToDeleteFromStore} pages from store`);\n\t\t\tverboseLog(`missing ${pagesMissingInStore} pages in store`);\n\t\t\tverboseLog(`write ${pagesToWriteToStore} pages to store`);\n\n\t\t\tawait Promise.all(pagesToStore);\n\t\t}\n\n\t\t// Despu\u00E9s de renderizar todos los sites y sus p\u00E1ginas (las que sean que\n\t\t// hayan cambiado etc.) guardamos un archivo con la informaci\u00F3n del\n\t\t// render para usos posteriores.\n\n\t\t// Aqu\u00ED tenemos dos casos:\n\n\t\t// - 1 Render de dominios con sites para publicar o despublicar. Se\n\t\t// guarda la infor del render y ya est\u00E1.\n\n\t\t// - 2 Render de un dominio que no tiene sites ni para publicar ni para\n\t\t// despublicar, lo que llamamos un dominio \"vac\u00EDo\". Se eliminan las\n\t\t// p\u00E1ginas \"hu\u00E9rfanas\" de la carpeta `store` as\u00ED el proceso de SSG se\n\t\t// encontrar\u00E1 efectivamente con un dominio \"sin p\u00E1ginas\" y \"borrar\u00E1\" el\n\t\t// \u00FAltimo site. Adem\u00E1s se guarda la informaci\u00F3n del render con arrays\n\t\t// vac\u00EDos directamente en `createdPages` y `sitesToPublish`.\n\n\t\tif (domainHasSites) {\n\t\t\t// 1\n\t\t\tsaveRenderInfoInStore(storeDir, {\n\t\t\t\tbuildProcessData,\n\t\t\t\tcreatedPages,\n\t\t\t\tsitesToPublish,\n\t\t\t});\n\t\t} else {\n\t\t\t// 2 Remove every site folder (Except metadata folder)\n\t\t\tremoveAllSiteDirsFromStore();\n\t\t\t// 3 Reset the render info\n\t\t\tsaveRenderInfoInStore(storeDir, {\n\t\t\t\tbuildProcessData,\n\t\t\t\tcreatedPages: [],\n\t\t\t\tsitesToPublish: [],\n\t\t\t});\n\t\t}\n\t} catch (e) {\n\t\tconst error = e as { message: string };\n\t\tconsole.error(error.message);\n\t\tprocess.exit(1);\n\t}\n}\n\nexport { createStore };\n", "import type { FetchDataProps } from \"../types/global\";\nimport type { APIPageObject } from \"../types/pages\";\nimport type { Core, Fields } from \"@griddo/core\";\nimport type {\n\tQueriedData,\n\tReference,\n} from \"@griddo/core/dist/types/api-response-fields\";\n\nimport { getDistributorData } from \"./sites\";\nimport { boxLog } from \"../utils/loggin\";\n\n/**\n * Service to work with distributors.\n */\nclass DistributorService {\n\t/**\n\t * Get the body data from a ReferenceField.\n\t * `auto`, `manual` or `navigation` mode.\n\t *\n\t * @param data The ReferenceField props.\n\t * @returns The props for one of the ReferenceField mode.\n\t */\n\tstatic getBody(data: Fields.Reference<unknown>, page: Core.Page) {\n\t\tconst {\n\t\t\torder,\n\t\t\tsources,\n\t\t\tquantity,\n\t\t\tmode,\n\t\t\tfixed,\n\t\t\tfullRelations = false,\n\t\t\tallLanguages = false,\n\t\t\tpreferenceLanguage = false,\n\t\t\treferenceId,\n\t\t} = data;\n\n\t\tif (mode === \"auto\") {\n\t\t\treturn {\n\t\t\t\tmode,\n\t\t\t\torder,\n\t\t\t\tsources,\n\t\t\t\tquantity,\n\t\t\t\tfullRelations,\n\t\t\t\tallLanguages,\n\t\t\t\tpreferenceLanguage,\n\t\t\t};\n\t\t}\n\n\t\tif (mode === \"manual\") {\n\t\t\treturn { mode, fixed, fullRelations };\n\t\t}\n\n\t\tif (mode === \"navigation\") {\n\t\t\treturn {\n\t\t\t\tmode,\n\t\t\t\torder,\n\t\t\t\tquantity,\n\t\t\t\tfullRelations,\n\t\t\t\treferenceId: referenceId || page?.structuredDataContent?.id,\n\t\t\t};\n\t\t}\n\n\t\tconsole.log(\n\t\t\t`Error: Distribuidor mode: ${mode} is not recognized on page ${page?.id}.`,\n\t\t);\n\n\t\treturn data;\n\t}\n\n\t/**\n\t * Gets ContentType data from API\n\t *\n\t * @param props\n\t * @param props.page The Page object\n\t * @param props.component.data The ReferenceField, always in the data prop.\n\t * @param props.cacheKey A cache key to manage cached files or using fetch\n\t * @returns The ContentType data.\n\t */\n\tstatic async fetchContentTypeData(props: FetchDataProps) {\n\t\tconst {\n\t\t\tpage,\n\t\t\tcomponent: { data },\n\t\t\tcacheKey,\n\t\t} = props;\n\n\t\t// Distrubutor with `hasDistributorDat: true` but without `data` prop\n\t\tif (!data) {\n\t\t\tboxLog(\n\t\t\t\t`Error: Page ${page.id} has \\`hasDistributorData: true\\` but it doesn't have a \\`data\\` prop`,\n\t\t\t\t\"No data in ReferenceField\",\n\t\t\t);\n\n\t\t\treturn [];\n\t\t}\n\n\t\t// Avoid fetch distributors with empty `data.sources`\n\t\tif (Array.isArray(data.sources) && data.sources.length < 1) {\n\t\t\tboxLog(\n\t\t\t\t`Warning: Page with id: ${page.id} has a ReferenceField with empty \\`data.sources\\``,\n\t\t\t\t\"Empty data.sources in ReferenceField\",\n\t\t\t);\n\n\t\t\treturn [];\n\t\t}\n\n\t\tconst { site, lang } = data;\n\n\t\t// Infor that the distributor has not dat.sources\n\t\tif (!data.sources && data.mode === \"auto\") {\n\t\t\tboxLog(\n\t\t\t\t`Warning: Page with id: ${page.id} has a ReferenceField with \\`undefined\\` \\`data.sources\\``,\n\t\t\t\t\"undefined data.sources in ReferenceField\",\n\t\t\t);\n\t\t}\n\n\t\tconst body = this.getBody(data, page);\n\n\t\tconst response = await getDistributorData(page, body, cacheKey, site, lang);\n\n\t\treturn response;\n\t}\n\n\t/**\n\t * Compose the queriedItems prop from a distributor data of a page.\n\t *\n\t * @param props\n\t * @param props.page The APIPage object\n\t * @param props.cacheKey A cache key to manage cached files or using fetch\n\t */\n\tstatic async getDistributorData({\n\t\tpage,\n\t\tcacheKey = \"\",\n\t}: {\n\t\tpage: APIPageObject;\n\t\t/** Reference id to manage cache between renders. */\n\t\tcacheKey: string;\n\t}) {\n\t\ttry {\n\t\t\tconst { template } = page;\n\t\t\tconst checkDistributors = async (\n\t\t\t\ttemplateChunk: {\n\t\t\t\t\thasDistributorData?: boolean;\n\t\t\t\t\tqueriedItems: QueriedData<unknown>;\n\t\t\t\t},\n\t\t\t\tlevel = 1,\n\t\t\t) => {\n\t\t\t\t// If it doesn't a \"template strcuture\"\n\t\t\t\tif (!templateChunk || typeof templateChunk !== \"object\") return;\n\n\t\t\t\t// If doesn't have `hasDistributorData: true`\n\t\t\t\tif (\n\t\t\t\t\t!JSON.stringify(templateChunk).includes('\"hasDistributorData\":true')\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// For each prop in the \"template\"\n\t\t\t\tfor (const key in templateChunk) {\n\t\t\t\t\t// Si la key es `queriedItems` saltamos al siguiente `key`\n\t\t\t\t\tif (key === \"queriedItems\") continue;\n\n\t\t\t\t\tconst _key = key as \"hasDistributorData\" | \"queriedItems\";\n\t\t\t\t\tconst component = templateChunk[_key] as unknown as {\n\t\t\t\t\t\tdata: Reference<unknown>;\n\t\t\t\t\t\tqueriedItems: QueriedData<unknown>;\n\t\t\t\t\t\thasDistributorData: boolean;\n\t\t\t\t\t};\n\n\t\t\t\t\t// Si el elemento no existe o no es un objeto saltamos al siguiente `key`\n\t\t\t\t\tif (!component || typeof component !== \"object\") continue;\n\n\t\t\t\t\t// Si el elemento tiene la prop `hasDistributorData: true` hacemos el fetch\n\t\t\t\t\tif (component.hasDistributorData) {\n\t\t\t\t\t\tcomponent.queriedItems = await this.fetchContentTypeData({\n\t\t\t\t\t\t\tpage,\n\t\t\t\t\t\t\tcacheKey,\n\t\t\t\t\t\t\tcomponent,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tawait checkDistributors(component, level + 1);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst getDistributors = async (template: Core.Page[\"template\"]) => {\n\t\t\t\t// `template` es un array para que tambi\u00E9n revise la propia template como objeto.\n\t\t\t\t// @ts-expect-error\tremove the array\n\t\t\t\tawait checkDistributors([template]);\n\n\t\t\t\treturn template;\n\t\t\t};\n\n\t\t\tconst response = await getDistributors(template);\n\n\t\t\treturn response;\n\t\t} catch (err) {\n\t\t\tconsole.error(`Error en get distributor ${err}`);\n\n\t\t\tprocess.exit(1);\n\t\t}\n\t}\n}\n\nexport { DistributorService };\n", "import type { Footer, Header } from \"../types/navigation\";\nimport type { APIPageObject } from \"../types/pages\";\n\nclass NavigationService {\n\tprivate _defaultHeaders: Record<string, Header>;\n\tprivate _defaultFooters: Record<string, Footer>;\n\tprivate _navigations: {\n\t\theaders: Array<Header>;\n\t\tfooters: Array<Footer>;\n\t};\n\n\tconstructor() {\n\t\tthis._navigations = {\n\t\t\tfooters: [],\n\t\t\theaders: [],\n\t\t};\n\t\tthis._defaultHeaders = {};\n\t\tthis._defaultFooters = {};\n\t}\n\n\tset navigations(navigations) {\n\t\tthis._navigations = navigations;\n\t\tthis._defaultFooters = this.getDefaultFooters();\n\t\tthis._defaultHeaders = this.getDefaultHeaders();\n\t}\n\n\tget navigations() {\n\t\treturn this._navigations;\n\t}\n\n\tgetDefaultFooters() {\n\t\tconst safeFooters = [...this.navigations.footers];\n\t\tconst defaultFooters = safeFooters.filter(\n\t\t\t(footer) => !!footer.setAsDefault,\n\t\t);\n\t\tconst defaultFootersByLang = defaultFooters.reduce((prev, footer) => {\n\t\t\tconst { language } = footer;\n\n\t\t\treturn { ...prev, [language]: footer };\n\t\t}, {});\n\n\t\treturn defaultFootersByLang;\n\t}\n\n\tgetDefaultHeaders() {\n\t\tconst safeHeaders = [...this.navigations.headers];\n\t\tconst defaultHeaders = safeHeaders.filter(\n\t\t\t(header) => !!header.setAsDefault,\n\t\t);\n\t\tconst defaultHeadersByLang = defaultHeaders.reduce((prev, header) => {\n\t\t\tconst { language } = header;\n\n\t\t\treturn { ...prev, [language]: header };\n\t\t}, {});\n\n\t\treturn defaultHeadersByLang;\n\t}\n\n\tgetRightLanguage(\n\t\tlist: Array<{\n\t\t\tlanguage: number;\n\t\t\tnavigationLanguages: Array<{ navigationId: number }>;\n\t\t\tid: number;\n\t\t}>,\n\t\tid: number,\n\t\tlanguage: number,\n\t) {\n\t\tif (!list || !id) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst rightLanguageItem = list.find(\n\t\t\t(item) =>\n\t\t\t\titem.language === language &&\n\t\t\t\titem.navigationLanguages?.find(\n\t\t\t\t\t(version) => version.navigationId === id,\n\t\t\t\t),\n\t\t);\n\n\t\tconst result = rightLanguageItem || list.find((item) => item.id === id);\n\n\t\treturn result ? { ...result } : null;\n\t}\n\n\tgetPageHeader(id: number, language: number) {\n\t\treturn this.getRightLanguage(this.navigations.headers, id, language);\n\t}\n\n\tgetPageFooter(id: number, language: number) {\n\t\treturn this.getRightLanguage(this.navigations.footers, id, language);\n\t}\n\n\tgetPageNavigations(page: APIPageObject) {\n\t\tconst {\n\t\t\theader: pageHeader,\n\t\t\tfooter: pageFooter,\n\t\t\tlanguage,\n\t\t\ttemplate: { templateType },\n\t\t\ttemplateConfig: { defaultHeader, defaultFooter, templates },\n\t\t} = page;\n\n\t\t// The navigations would be:\n\t\t// - The one with the page or ...\n\t\t// - The one defined for that template or ...\n\t\t// - The one you have defined for that data package\n\t\tconst getValidNavigation = (values: Array<number | unknown>) => {\n\t\t\tconst fineNavigation = values.find((item) => typeof item === \"number\");\n\n\t\t\treturn typeof fineNavigation === \"number\" ? fineNavigation : null;\n\t\t};\n\n\t\tconst headerID = getValidNavigation([\n\t\t\tpageHeader,\n\t\t\ttemplates?.[templateType]?.defaultHeader,\n\t\t\tdefaultHeader,\n\t\t]);\n\n\t\tconst footerID = getValidNavigation([\n\t\t\tpageFooter,\n\t\t\ttemplates?.[templateType]?.defaultFooter,\n\t\t\tdefaultFooter,\n\t\t]);\n\n\t\tconst header = headerID\n\t\t\t? this.getPageHeader(headerID, language)\n\t\t\t: headerID === 0\n\t\t\t\t? null\n\t\t\t\t: this._defaultHeaders[language];\n\n\t\tconst footer = footerID\n\t\t\t? this.getPageFooter(footerID, language)\n\t\t\t: footerID === 0\n\t\t\t\t? null\n\t\t\t\t: this._defaultFooters[language];\n\n\t\treturn {\n\t\t\theader,\n\t\t\tfooter,\n\t\t} as { header: Header; footer: Footer };\n\t}\n}\n\nexport { NavigationService };\n", "import type { Settings } from \"../types/global\";\n\nimport { endpoints } from \"../constants\";\nimport { get, post } from \"../utils/api\";\n\nasync function getAllSettings() {\n\treturn await get<Settings>({ endpoint: endpoints.SETTINGS });\n}\n\nasync function resetRender() {\n\tawait post({ endpoint: endpoints.RESET_RENDER });\n}\n\nexport { getAllSettings, resetRender };\n", "import type { Core, Fields } from \"@griddo/core\";\nimport type {\n\tAPIPageObject,\n\tGriddoListPage,\n\tGriddoMultiPage,\n\tGriddoPageObject,\n\tGriddoSinglePage,\n\tMultiPageElement,\n\tMultiPageElements,\n\tPageAdditionalInfo,\n} from \"../types/pages\";\nimport type { TemplateWithDistributor } from \"../types/templates\";\n\nimport dotenv from \"dotenv\";\nimport { formatImage } from \"./images\";\n\ndotenv.config();\n\n// Consts\nconst DEFAULT_ITEMS_PER_PAGE_FOR_LIST_TEMPLATES = 25;\n\n/**\n * Return an OpenGraph object.\n *\n * @param props.socialTitle The social title.\n * @param props.socialDescription The social description.\n * @param props.socialImage The social image in Cloudinary or DAM url format.\n */\nfunction getOpenGraph({\n\tsocialTitle,\n\tsocialDescription,\n\tsocialImage,\n}: Pick<\n\tCore.Page,\n\t\"socialTitle\" | \"socialDescription\" | \"socialImage\"\n>): Core.Page[\"openGraph\"] {\n\treturn {\n\t\ttype: \"website\",\n\t\ttitle: socialTitle,\n\t\tdescription: socialDescription,\n\t\timage: socialImage ? formatImage(socialImage, 1280, 768) : \"\",\n\t\ttwitterImage: socialImage ? formatImage(socialImage, 1280, 768) : \"\",\n\t};\n}\n\n/**\n * Get the Page metadata object from a page Object.\n *\n * @param params A Page object\n */\nfunction getPageMetaData(params: Core.Page): Core.Page[\"pageMetaData\"] {\n\tconst {\n\t\ttitle,\n\t\tmetaTitle,\n\t\tmetaDescription,\n\t\tcanonicalURL,\n\t\tlocale,\n\t\turl,\n\t\tisIndexed,\n\t\tfollow,\n\t\tmetasAdvanced,\n\t\tpageLanguages,\n\t\tfullUrl,\n\t\tmetaKeywords,\n\t} = params;\n\n\tconst metasAdvancedList =\n\t\tmetasAdvanced\n\t\t\t?.split(\",\")\n\t\t\t.filter(Boolean)\n\t\t\t.map((item) => item.trim().toLowerCase()) || [];\n\n\treturn {\n\t\ttitle: (metaTitle || title || \"\").trim(),\n\t\tdescription: metaDescription,\n\t\tcanonical:\n\t\t\tcanonicalURL && canonicalURL.trim() && canonicalURL !== fullUrl\n\t\t\t\t? canonicalURL.trim()\n\t\t\t\t: isIndexed\n\t\t\t\t\t? fullUrl\n\t\t\t\t\t: undefined,\n\t\tlocale,\n\t\turl,\n\t\tindex: isIndexed ? \"index\" : \"noindex\",\n\t\tfollow: follow ? \"follow\" : \"nofollow\",\n\t\ttranslate: metasAdvancedList.includes(\"notranslate\") ? \"notranslate\" : \"\",\n\t\tmetasAdvanced: metasAdvancedList\n\t\t\t.filter((item) => item !== \"notranslate\")\n\t\t\t.join(),\n\t\tpageLanguages,\n\t\tmetaKeywords: metaKeywords\n\t\t\t?.filter(Boolean)\n\t\t\t.map((keyword) => keyword.replace(/\"/g, \"'\"))\n\t\t\t.join(\", \"),\n\t};\n}\n\n/**\n * Create a Griddo page object\n *\n * @param page A page object ready to pass as content of the `pageContext` to use in the React template.\n * @param additionalInfo Additional page info to pass as content of `pageContext` to use in the React template.\n * @param excludeFromSearch Boolean to avoid this page to be indexed in internal search tool.\n */\nasync function createGriddoPageObject(\n\tpage: GriddoSinglePage | GriddoListPage | GriddoMultiPage,\n\tadditionalInfo: PageAdditionalInfo,\n): Promise<GriddoPageObject> {\n\t// Extract some props from page\n\tconst {\n\t\tid,\n\t\ttitle,\n\t\tfullPath,\n\t\tlanguage: languageId,\n\t\tbreadcrumb,\n\t\tsocialDescription,\n\t\tsocialImage,\n\t\tsocialTitle,\n\t} = page;\n\n\t// Extract some props from additionalInfo\n\tconst {\n\t\tbaseUrl,\n\t\tcloudinaryName,\n\t\tgriddoVersion,\n\t\tsiteLangs,\n\t\tsiteMetadata,\n\t\tsiteOptions,\n\t\tsiteScript,\n\t\tsiteSlug,\n\t\tsocials,\n\t\ttheme,\n\t\tnavigations: { header, footer },\n\t} = additionalInfo;\n\n\t// Update page object\n\tpage.breadcrumb = breadcrumb;\n\tpage.siteSlug = siteSlug;\n\tpage.apiUrl = baseUrl;\n\tpage.publicApiUrl = additionalInfo.publicBaseUrl;\n\tpage.instance = additionalInfo.instance;\n\n\tconst foundLanguage = siteLangs.find(({ id }) => id === page?.language);\n\tconst locale = foundLanguage?.locale.replace(/_/g, \"-\");\n\n\t// Page Metadata\n\tconst pageMetadata = getPageMetaData(page);\n\n\t// Opengraph\n\tconst openGraph = getOpenGraph({\n\t\tsocialDescription,\n\t\tsocialImage,\n\t\tsocialTitle,\n\t});\n\n\tconst pagePath = fullPath.compose;\n\n\tconst renderDate = new Date().toString();\n\n\tconst griddoPageObject: GriddoPageObject = {\n\t\tpath: pagePath,\n\t\tsize: undefined,\n\t\tcontext: {\n\t\t\t// Page\n\t\t\tid,\n\t\t\ttitle,\n\t\t\tfullPath,\n\t\t\tlocale,\n\t\t\tlanguageId,\n\t\t\ttheme,\n\n\t\t\t// PARA <Helmet />\n\t\t\tsiteMetadata,\n\t\t\tpageMetadata,\n\t\t\topenGraph,\n\t\t\tsocials,\n\t\t\tsiteLangs,\n\t\t\tcloudinaryName,\n\t\t\tsiteOptions,\n\t\t\tgriddoVersion,\n\t\t\trenderDate,\n\t\t\tsiteScript,\n\n\t\t\t// Navigation sections\n\t\t\theader,\n\t\t\tfooter,\n\n\t\t\t// Page template\n\t\t\t// En este objeto se est\u00E1 pasando todos los metadatos que vienen en\n\t\t\t// el primer nivel pero el uso de los mismos en CX se hace con la\n\t\t\t// prop `pageMetadata` creada a partir de getPageMetadata. En\n\t\t\t// resumen, se est\u00E1 pasando por duplicado el contenido.\n\t\t\t// TODO: Eliminar las claves de metadata de este objeto page.\n\t\t\tpage,\n\t\t},\n\t};\n\n\treturn griddoPageObject;\n}\n\n/**\n * Create a single Griddo page object.\n *\n * @param page A Griddo single page object.\n * @param additionalInfo Additional page info.\n */\nasync function createGriddoSinglePage(\n\tpage: GriddoSinglePage,\n\tadditionalInfo: PageAdditionalInfo,\n) {\n\treturn await createGriddoPageObject(page, additionalInfo);\n}\n\n/**\n * Create multiples pages from one page as list paginated pages\n */\nasync function createGriddoListPages(\n\t{\n\t\tpage,\n\t\tpages,\n\t\tisRoot = false,\n\t\tdefaultLang,\n\t\ttemplate,\n\t\ttotalQueriedItems,\n\t}: GriddoListPage,\n\tadditionalInfo: PageAdditionalInfo,\n) {\n\tconst allPages = pages.map(async (dataInPage, idx) => {\n\t\tconst isFirstPage = idx === 0;\n\t\tconst pageNumber = idx + 1;\n\t\tconst { domainUrl, compose } = page.fullPath;\n\n\t\t// Crea un id como n\u00FAmero negativo y a\u00F1adiendo un sufijo para los\n\t\t// listados est\u00E1ticos. Esto es as\u00ED para marcarlas y posteriormente\n\t\t// borrarlas siempre en cada nuevo render desde el Adapter.\n\t\t//\n\t\t// id de p\u00E1gina con mode:\"list\": 1546\n\t\t// ids de las \"sub-p\u00E1ginas\": -15460, -15461, -1546n, (-)id(idx)\n\t\t//\n\t\t// @todo eliminar el concepto multipage de CX, deber\u00EDa ser algo core de\n\t\t// Griddo itself: API/AX, que fuesen p\u00E1ginas con sus ids, etc..\n\n\t\tconst paginatedPage = {\n\t\t\t...page,\n\t\t\tid: parseInt(\"-\" + page.id + idx),\n\t\t\tfullPath: {\n\t\t\t\t...page.fullPath,\n\t\t\t\t// Add a page number (tailPageNumber) from page 2 onwards\n\t\t\t\tcompose: addPageNumberToUrl(compose, pageNumber, {\n\t\t\t\t\taddEndingSlash: true,\n\t\t\t\t}),\n\t\t\t},\n\t\t\tfullUrl: addPageNumberToUrl(page.fullUrl, pageNumber, {\n\t\t\t\taddEndingSlash: true,\n\t\t\t}),\n\t\t\tslug: addPageNumberToUrl(page.slug, pageNumber),\n\t\t\ttitle: addPageNumberToTitle(page.title, pageNumber),\n\t\t\tmetaTitle: addPageNumberToTitle(page.metaTitle || \"\", pageNumber),\n\t\t\tdisableHrefLangs: pageNumber > 1,\n\t\t\ttemplate: {\n\t\t\t\t...template,\n\t\t\t\tisFirstPage,\n\t\t\t\tpageNumber,\n\t\t\t\ttotalPages: pages.length,\n\t\t\t\t// The base link, without page number to use in <Pagination />\n\t\t\t\t// component.\n\t\t\t\tbaseLink: `${domainUrl}${compose}`,\n\t\t\t\tqueriedItems: dataInPage,\n\t\t\t\ttotalQueriedItems: totalQueriedItems?.length,\n\t\t\t},\n\t\t\tisRoot,\n\t\t\tdefaultLang,\n\t\t};\n\n\t\treturn await createGriddoPageObject(paginatedPage, additionalInfo);\n\t});\n\n\treturn Promise.all(allPages);\n}\n\n/**\n * Create multiples pages from a MultiPage module\n *\n * @param page A Griddo Multipage object.\n * @param additionalInfo Additional page info.\n */\nfunction createGriddoMultiPages(\n\tpage: GriddoMultiPage,\n\tadditionalInfo: PageAdditionalInfo,\n) {\n\tconst { multiPageElements: multiPageElementsBulk, ...cleanPage } = page;\n\t// TODO: Use structuredClone() when node 18 is available.\n\tconst multiPageElements: MultiPageElements = JSON.parse(\n\t\tJSON.stringify(multiPageElementsBulk),\n\t);\n\n\t// Si no hay un elemento sin slug, como m\u00EDnimo hay que dibujar una p\u00E1gina\n\t// principal para el conjunto de p\u00E1ginas.\n\tif (!multiPageElements.find(({ sectionSlug }) => sectionSlug === \"/\")) {\n\t\tmultiPageElements.push({} as MultiPageElement);\n\t}\n\n\t// Creates each page based on `multiPageElements` from the schema.\n\tconst allPages = multiPageElements.map(async (pageElement, idx) => {\n\t\t// TODO: Use structuredClone() when node 18 is available.\n\t\tconst paginatedPage: APIPageObject = JSON.parse(JSON.stringify(cleanPage));\n\t\tconst {\n\t\t\tsectionSlug = \"/\",\n\t\t\ttitle: bulkTitle = \"\",\n\t\t\tmetaTitle = \"\",\n\t\t\tmetaDescription = \"\",\n\t\t} = pageElement;\n\t\tconst title = typeof bulkTitle === \"string\" ? bulkTitle : bulkTitle.content;\n\t\tconst compose = paginatedPage.fullPath.compose || \"\";\n\t\tconst fullUrl = paginatedPage.fullUrl.endsWith(\"/\")\n\t\t\t? paginatedPage.fullUrl.slice(0, -1)\n\t\t\t: paginatedPage.fullUrl;\n\n\t\tconst cleanSectionSlug = sectionSlug?.replace(/\\//g, \"\");\n\t\tconst isRootSlug = sectionSlug === \"/\";\n\t\tconst rightSectionSlug = isRootSlug\n\t\t\t? cleanSectionSlug\n\t\t\t: cleanSectionSlug + \"/\";\n\n\t\tconst slash = compose.endsWith(\"/\") ? \"\" : \"/\";\n\t\tconst newCompose = `${compose}${slash}${rightSectionSlug}`;\n\n\t\tif (title.trim()) {\n\t\t\tpaginatedPage.title = title;\n\t\t}\n\n\t\tif (metaDescription.trim()) {\n\t\t\tpaginatedPage.metaDescription = metaDescription;\n\t\t}\n\n\t\t// Crea un id como n\u00FAmero negativo y a\u00F1adiendo un sufijo para las multipages.\n\t\t// Esto es as\u00ED para marcarlas y posteriormente borrarlas siempre en cada\n\t\t// nuevo render desde el Adapter.\n\t\t//\n\t\t// id de p\u00E1gina con hasMultipageTrue: 1546\n\t\t// ids de las \"sub-p\u00E1ginas\": -15460, -15461, -1546n, (-)id(idx)\n\t\t//\n\t\t// @todo eliminar el concepto multipage de CX, deber\u00EDa ser algo core de\n\t\t// Griddo itself: API/AX, que fuesen p\u00E1ginas con sus ids, etc..\n\t\tpaginatedPage.id = parseInt(\"-\" + paginatedPage.id + idx);\n\n\t\tpaginatedPage.fullUrl = `${fullUrl}/${rightSectionSlug}`;\n\t\tpaginatedPage.fullPath.compose = newCompose;\n\t\tpaginatedPage.slug = newCompose;\n\t\tpaginatedPage.template.activeSectionSlug = sectionSlug;\n\t\tpaginatedPage.template.activeSectionBase = fullUrl;\n\t\tpaginatedPage.metaTitle =\n\t\t\tmetaTitle.trim() || title.trim() || paginatedPage.metaTitle;\n\n\t\treturn await createGriddoPageObject(paginatedPage, additionalInfo);\n\t});\n\n\treturn Promise.all(allPages);\n}\n\n/**\n * Get the multi pages elements.\n *\n * @param page The page to get the multipage parts.\n */\nfunction getMultiPageElements(\n\tpage: TemplateWithDistributor,\n): Promise<MultiPageElements> | null {\n\tconst multiPageElements = new Promise((resolve) => {\n\t\t// Recursive\n\t\tconst getMultiPageComponent = (\n\t\t\t// No puede ser Core.Page['template'] porque a medida que va bajando en\n\t\t\t// el \u00E1rbol ya no es la estructura de un template.\n\t\t\ttemplate: Record<string, unknown>,\n\t\t\tlevel = 0,\n\t\t) => {\n\t\t\t// If it doesn't have a \"template strcuture\"\n\t\t\tif (!template || typeof template !== \"object\") return;\n\n\t\t\t// For each prop in the \"template\"\n\t\t\tfor (const key in template) {\n\t\t\t\tconst currentComponent = template[key] as {\n\t\t\t\t\tcomponent: string;\n\t\t\t\t\thasGriddoMultiPage: boolean;\n\t\t\t\t\telements: Array<Record<string, unknown>>;\n\t\t\t\t};\n\t\t\t\tconst isValidComponent =\n\t\t\t\t\tcurrentComponent || typeof currentComponent === \"object\";\n\t\t\t\tconst hasGriddoMultiPageProp = JSON.stringify(\n\t\t\t\t\tcurrentComponent,\n\t\t\t\t).includes('\"hasGriddoMultiPage\":true');\n\n\t\t\t\tif (!isValidComponent) continue;\n\n\t\t\t\tif (!hasGriddoMultiPageProp) continue;\n\n\t\t\t\tconst { component, hasGriddoMultiPage, elements } = currentComponent;\n\n\t\t\t\tif (component && hasGriddoMultiPage) resolve(elements || []);\n\n\t\t\t\t// Recursive call\n\t\t\t\tgetMultiPageComponent(currentComponent, level + 1);\n\t\t\t}\n\n\t\t\t// resolve promise when...\n\t\t\tif (!level) resolve(null);\n\t\t};\n\n\t\t// `page` en un array para que tambi\u00E9n revise la propia template como objeto.\n\t\t// @ts-expect-error remove the array\n\t\tgetMultiPageComponent([page]);\n\t});\n\n\treturn multiPageElements as Promise<MultiPageElements>;\n}\n\n// -----------------------------------------------------------------------------\n// Private functions\n// -----------------------------------------------------------------------------\n\n/**\n * Get `itemsPerPage` elements from the `items` using as offset `page` number.\n * It's a kind of paginator for an array.\n *\n * @param itemsPerPage The items per page.\n * @param items An array of items, the queriedData.\n * @param page The page to be returned.\n *\n * @example\n * getPage(3, [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\"], 2)\n * // -> [\"d\", \"e\", \"f\"]\n */\nfunction getPage(\n\titemsPerPage: number,\n\titems: Array<Fields.QueriedDataItem>,\n\tpage: number,\n) {\n\treturn items?.slice(itemsPerPage * (page - 1), itemsPerPage * page);\n}\n\n/**\n * Takes an array of items and split it grouping in arrays of pages based on `itemsPerPage`.\n *\n * @param itemsPerPage The items per page.\n * @param items An array of items, the queriedData.\n *\n * @example\n * getPageCluster(3, [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\"])\n * // -> [[\"a\", \"b\", \"c\"], [\"d\", \"e\", \"f\"], [\"g\", \"h\"]]\n */\nfunction getPageCluster(\n\titemsPerPage: number,\n\titems: Array<Fields.QueriedDataItem>,\n) {\n\tconst totalPagesCount = Math.ceil(items.length / itemsPerPage) || 1;\n\tconst pageNumbers = Array.from({ length: totalPagesCount }, (_, i) => i + 1);\n\n\treturn pageNumbers?.map((pageNumber) =>\n\t\tgetPage(itemsPerPage, items, pageNumber),\n\t);\n}\n\n/**\n * Takes a template object and split the whole queriedItems into separated queriedItems to use in Griddo static list templates.\n *\n * @param listTemplate A template schema with the distributor data included.\n */\nfunction getPaginatedPages(listTemplate: TemplateWithDistributor) {\n\tconst items = listTemplate.queriedItems || [];\n\tconst itemsPerPage =\n\t\tlistTemplate?.itemsPerPage || DEFAULT_ITEMS_PER_PAGE_FOR_LIST_TEMPLATES;\n\tconst pageClusters = getPageCluster(itemsPerPage, items);\n\n\treturn pageClusters;\n}\n\n/**\n * Remove duplicate ending trailing character from a string\n *\n * @param url the strin url\n * @example\n * removeDuplicateTrailingSlash('http://griddo.com/foo/bar//')\n * // -> http://griddo.com/foo/bar/\n */\nfunction removeDuplicateTrailing(url: string) {\n\treturn url.replace(/\\/+$/, \"/\");\n}\n\n/**\n * Adds a number to an URL adding optionally an ending slash.\n *\n * @param url The url.\n * @param pageNumber A number to be added to the url.\n * @param options.addEndingSlash Boolean that indicates if return the final url with an end slash or not.\n *\n * @example\n * addPageNumberToUrl(\"web.com\", 3) // \"web.com/3\"\n * addPageNumberToUrl(\"web.com\", 3, { addEndingSlash: true }) // \"web.com/3/\"\n */\nfunction addPageNumberToUrl(\n\turl: string,\n\tpageNumber: number,\n\toptions?: { addEndingSlash: boolean },\n) {\n\tconst trailingSlash = url.endsWith(\"/\") ? \"\" : \"/\";\n\tconst endingSlash = options?.addEndingSlash ? \"/\" : \"\";\n\n\tif (pageNumber <= 1) {\n\t\treturn removeDuplicateTrailing(`${url}${endingSlash}`);\n\t}\n\n\treturn removeDuplicateTrailing(\n\t\t`${url}${trailingSlash}${pageNumber}${endingSlash}`,\n\t);\n}\n\n/**\n * Adds a number to an string with the format \"string - number\"\n *\n * @param title The title\n * @param pageNumber A number to be added to the title.\n *\n * @example\n * addPageNumberToTitle(\"The page\", 3) // \"The page - 3\"\n */\nfunction addPageNumberToTitle(title: string, pageNumber: number) {\n\tif (!title || pageNumber <= 1) {\n\t\treturn title;\n\t}\n\n\treturn `${title} - ${pageNumber}`;\n}\n\nexport {\n\tcreateGriddoListPages,\n\tcreateGriddoMultiPages,\n\tcreateGriddoSinglePage,\n\tgetMultiPageElements,\n\tgetPaginatedPages,\n};\n", "import type { Fields } from \"@griddo/core\";\n\n/**\n * Format Cloudinary or DAM URL\n *\n * @param image The image url\n * @param width With of the image\n * @param height Height of the image\n * @param format Format of the image\n * @returns A composed URL for the Cloudinary or DAM service\n */\nfunction formatImage(\n\timage: Fields.Image | string,\n\twidth: number,\n\theight: number,\n\tformat = \"jpg\",\n) {\n\tconst url = typeof image === \"string\" ? image : image?.url;\n\n\tif (!url) {\n\t\treturn null;\n\t}\n\n\tconst isCloudinary = url.split(\"/\")[2].includes(\"cloudinary.com\");\n\n\treturn isCloudinary\n\t\t? addCloudinaryParams(url, `c_fill,w_${width},h_${height}`)\n\t\t: addGriddoDamParams(url, `f/${format}/w/${width}/h/${height}`);\n}\n\n/**\n * Format Griddo DAM image url.\n */\nfunction addGriddoDamParams(image: string, params: string) {\n\tconst urlParts = image.split(\"/\");\n\tconst imagePath = urlParts.slice(0, -1).join(\"/\");\n\tconst imageName = urlParts.slice(-1)[0];\n\n\treturn `${imagePath}/${params}/${imageName}`;\n}\n\n/**\n * Take a cloudinary url and add query params.\n */\nfunction addCloudinaryParams(image: string, params: string) {\n\tconst plainUrl = image.replace(\"https://\", \"\");\n\tconst head = plainUrl.split(\"/\").slice(0, 4).join(\"/\");\n\tconst fullId = plainUrl.replace(head, \"\");\n\n\treturn `https://${head}/${params}${fullId}`;\n}\n\nexport { formatImage };\n", "import { createAPICacheDir } from \"./cache\";\nimport { sanitizeAPICacheDir } from \"./core-utils\";\nimport { createStore } from \"../services/store\";\n\n/**\n * Download all data: sites, pages etc.. from the instance private Griddo API.\n * Then you can use the generator funcion `getBuildPagesFromStore()` to get the pages and\n * `getBuildMetadata()` to get build and sites metadata as objects. Both from\n * exporter utils sites dir.\n */\nasync function createBuildData(domain: string) {\n\tcreateAPICacheDir();\n\tawait createStore(domain);\n\tsanitizeAPICacheDir();\n}\n\nexport { createBuildData };\n", "import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { getConfig } from \"./core-utils\";\nimport { throwError } from \"../errors\";\nimport { RenderUUIDError } from \"../errors/errors-data\";\n\nconst config = getConfig();\n\n/**\n * Creates a sentinel file with the current date and time.\n * This file is used to track later if node_modules/@griddo/cx was cleaned by a\n * npm install from a deploy.\n */\nfunction createSentinelRenderFile() {\n\tconst { __cx } = config.paths();\n\tconst renderSentinelFile = path.join(__cx, \".render-sentinel\");\n\tfs.writeFileSync(renderSentinelFile, new Date().toISOString());\n}\n\nfunction deleteSentinelRenderFile() {\n\tconst { __cx } = config.paths();\n\tconst renderSentinelFile = path.join(__cx, \".render-sentinel\");\n\tfs.unlinkSync(renderSentinelFile);\n}\n\nfunction isValidRenderProcessOrThrow() {\n\tconst { __cx } = config.paths();\n\tconst renderSentinelFile = path.join(__cx, \".render-sentinel\");\n\tif (!fs.existsSync(renderSentinelFile)) {\n\t\tthrowError(RenderUUIDError);\n\t}\n}\n\nfunction initRender() {\n\tcreateSentinelRenderFile();\n}\n\nfunction finishRender() {\n\treturn undefined;\n}\n\nexport {\n\tfinishRender,\n\tinitRender,\n\tisValidRenderProcessOrThrow,\n\tcreateSentinelRenderFile,\n\tdeleteSentinelRenderFile,\n};\n", "import type { ErrorsType } from \"./errors-data\";\n\nimport { boxLog } from \"../utils/loggin\";\n\nexport type ErrorData = {\n\tid: number;\n\terror: ErrorsType;\n\tmessage: string;\n\texpected?: string;\n\thint?: string;\n};\n\nclass RenderError extends Error {\n\tconstructor() {\n\t\tsuper();\n\t\tthis.name = \"InternalCXError\";\n\t\tthis.stack = \"\";\n\t}\n}\n\n/**\n * Throws an error with the provided error message, expected value, and hint.\n */\nfunction throwError({ error, message, expected = \"\", hint = \"\" }: ErrorData) {\n\tconst errorMessage = [message, expected, hint].filter(Boolean).join(\"\\n\");\n\n\tboxLog(errorMessage, error, 1, 0);\n\tthrow new RenderError();\n}\n\nexport { throwError };\n", "/**\n * Do you want to add a new error to the list?\n *\n * 1 - Add the new error type name to the `ErrorsType` union type.\n * 2 - Export a new ErrorData object in this file by completing\n * the `error` and `message` properties obligatorily.\n *\n */\n\nimport { ErrorData } from \".\";\n\nexport type ErrorsType =\n\t| \"NoDomainsFoundError\"\n\t| \"RenderUUIDError\"\n\t| \"DistributorSourcesNotFoundError\";\n\nexport const NoDomainsFoundError: ErrorData = {\n\tid: 100,\n\terror: \"NoDomainsFoundError\",\n\tmessage: \"No domains found in this instance. The process cannot continue.\",\n\texpected:\n\t\t\"This can happen if the API is not functioning or the site is not properly configured, or the domains are not registered.\",\n\thint: \"You can contact the instance administrator.\",\n};\n\nexport const RenderUUIDError: ErrorData = {\n\tid: 101,\n\terror: \"RenderUUIDError\",\n\tmessage: `Render sentinel file does not exist.\nThe rendering uuid cannot be read safely.\nThere was probably a instance deployment during the render and files were deleted.\n\nThe files generated in this render will not be published.`,\n};\n\nexport const DistributorSourcesNotFoundError: ErrorData = {\n\tid: 102,\n\terror: \"DistributorSourcesNotFoundError\",\n\tmessage: \"El distribuidor no tiene souces definidos.\",\n\texpected:\n\t\t\"Se espera que al menos tenga un fuente de datos en la propiedad `sources`, aunque est\u00E9 vac\u00EDa.\",\n};\n", "import type { Domains } from \"../types/global\";\n\nimport { endpoints } from \"../constants\";\nimport { get } from \"../utils/api\";\n\n/**\n * Get an array of domains availables.\n */\nclass DomainsService {\n\tstatic async getAll() {\n\t\treturn await get<Domains>({ endpoint: endpoints.DOMAINS });\n\t}\n}\n\nexport { DomainsService };\n", "import type { Domains } from \"../types/global\";\n\nimport { verboseLog } from \"./loggin\";\nimport { throwError } from \"../errors\";\nimport { NoDomainsFoundError } from \"../errors/errors-data\";\nimport { AuthService } from \"../services/auth\";\nimport { DomainsService } from \"../services/domains\";\n\n/**\n * Return an array of domains name (string) of the current instance.\n */\nasync function getInstanceDomainsOrThrow() {\n\tawait AuthService.login();\n\tconst domains = await DomainsService.getAll();\n\n\tif (!domains.length) {\n\t\tthrowError(NoDomainsFoundError);\n\t}\n\n\tverboseLog(`getting domains names (${domains.length})`);\n\n\treturn getDomainSlugs(domains);\n}\n\n/**\n * Return an array of domains name (string) of the current instance.\n */\nasync function getInstanceDomains() {\n\tawait AuthService.login();\n\tconst domains = await DomainsService.getAll();\n\n\tverboseLog(`Getting domains slugs (${domains.length})`);\n\n\treturn getDomainSlugs(domains);\n}\n\n/**\n * Return an unique array of domains, filtered without \"/\".\n *\n * @param domains An array of domains\n * @see Domains\n */\nfunction getDomainSlugs(domains: Domains) {\n\tconst filteredDomains = domains\n\t\t.filter(({ slug }) => !!slug)\n\t\t.map(({ slug }) => slug.replace(\"/\", \"\"));\n\n\treturn [...new Set(filteredDomains)];\n}\n\nexport { getInstanceDomains, getInstanceDomainsOrThrow };\n"],
5
- "mappings": ";4qBAAA,IAAAA,GAAAC,EAAA,CAAAC,GAAAC,KAAA,CAuBA,IAAMC,GAAK,QAAQ,IAAI,EACjBC,GAAO,QAAQ,MAAM,EAE3B,SAASC,GAAKC,EAAuB,CACnC,QAAQ,IAAI,mBAAmBA,GAAS,CAC1C,CAEA,IAAMC,GAAU;AAAA,EACVC,GAAiB,gCACjBC,GAAc,OACdC,GAAiB,aAGvB,SAASC,GAAOC,EAA4BC,EAA6D,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AAqB,CACpB,aAAa,QAAS,CACrB,OAAO,MAAMC,GAAa,CAAE,SAAUC,GAAU,OAAQ,CAAC,CAC1D,CACD,ECDA,eAAeC,IAA4B,CAC1C,MAAMC,GAAY,MAAM,EACxB,IAAMC,EAAU,MAAMC,GAAe,OAAO,EAE5C,OAAKD,EAAQ,QACZE,GAAWC,EAAmB,EAG/BC,GAAW,0BAA0BJ,EAAQ,SAAS,EAE/CK,GAAeL,CAAO,CAC9B,CAoBA,SAASM,GAAeC,EAAkB,CACzC,IAAMC,EAAkBD,EACtB,OAAO,CAAC,CAAE,KAAAE,CAAK,IAAM,CAAC,CAACA,CAAI,EAC3B,IAAI,CAAC,CAAE,KAAAA,CAAK,IAAMA,EAAK,QAAQ,IAAK,EAAE,CAAC,EAEzC,MAAO,CAAC,GAAG,IAAI,IAAID,CAAe,CAAC,CACpC,ClCxCA,eAAeE,IAAc,CAC5B,GAAI,CACH,IAAMC,EAAU,MAAMC,GAA0B,EAC1CC,EAAU,MAAMC,GAAqB,CAC1C,IAAMC,GAAiBJ,CAAO,CAC/B,CAAC,EAEDK,GAAO,2BAA2BH,MAAa,GAAI,EAAG,CAAC,EAEvD,QAAQ,KAAK,CAAC,CACf,OAASI,EAAP,CACD,QAAQ,IAAIA,CAAK,EAEjB,QAAQ,KAAK,CAAC,CACf,CACD",
6
- "names": ["require_main", "__commonJSMin", "exports", "module", "fs", "path", "log", "message", "NEWLINE", "RE_INI_KEY_VAL", "RE_NEWLINES", "NEWLINES_MATCH", "parse", "src", "options", "debug", "obj", "line", "idx", "keyValueArr", "key", "val", "end", "isDoubleQuoted", "config", "dotenvPath", "encoding", "parsed", "e", "require_universalify", "__commonJSMin", "exports", "fn", "args", "resolve", "reject", "err", "res", "cb", "r", "require_polyfills", "__commonJSMin", "exports", "module", "constants", "origCwd", "cwd", "platform", "chdir", "d", "patch", "fs", "patchLchmod", "patchLutimes", "chownFix", "chmodFix", "chownFixSync", "chmodFixSync", "statFix", "statFixSync", "path", "mode", "cb", "uid", "gid", "fs$rename", "rename", "from", "to", "start", "backoff", "CB", "er", "stater", "st", "fs$read", "read", "fd", "buffer", "offset", "length", "position", "callback_", "callback", "eagCounter", "_", "__", "fs$readSync", "err", "err2", "threw", "ret", "at", "mt", "er2", "_a", "_b", "_c", "orig", "target", "chownErOk", "options", "stats", "nonroot", "require_legacy_streams", "__commonJSMin", "exports", "module", "Stream", "legacy", "fs", "ReadStream", "WriteStream", "path", "options", "self", "keys", "index", "length", "key", "err", "fd", "require_clone", "__commonJSMin", "exports", "module", "clone", "getPrototypeOf", "obj", "copy", "key", "require_graceful_fs", "__commonJSMin", "exports", "module", "fs", "polyfills", "legacy", "clone", "util", "gracefulQueue", "previousSymbol", "noop", "publishQueue", "context", "queue", "debug", "m", "fs$close", "close", "fd", "cb", "err", "resetQueue", "fs$closeSync", "closeSync", "patch", "createReadStream", "createWriteStream", "fs$readFile", "readFile", "path", "options", "go$readFile", "startTime", "enqueue", "fs$writeFile", "writeFile", "data", "go$writeFile", "fs$appendFile", "appendFile", "go$appendFile", "fs$copyFile", "copyFile", "src", "dest", "flags", "go$copyFile", "fs$readdir", "readdir", "noReaddirOptionVersions", "go$readdir", "fs$readdirCallback", "files", "legStreams", "ReadStream", "WriteStream", "fs$ReadStream", "ReadStream$open", "fs$WriteStream", "WriteStream$open", "val", "FileReadStream", "FileWriteStream", "that", "open", "fs$open", "mode", "go$open", "elem", "retry", "retryTimer", "now", "i", "fn", "args", "lastTime", "sinceAttempt", "sinceStart", "desiredDelay", "require_fs", "__commonJSMin", "exports", "u", "fs", "api", "key", "method", "filename", "callback", "resolve", "fd", "buffer", "offset", "length", "position", "reject", "err", "bytesRead", "args", "bytesWritten", "buffers", "require_at_least_node", "__commonJSMin", "exports", "module", "r", "n", "x", "require_make_dir", "__commonJSMin", "exports", "module", "fs", "path", "atLeastNode", "useNativeRecursiveOption", "checkPath", "pth", "error", "processOptions", "options", "defaults", "permissionError", "input", "make", "require_mkdirs", "__commonJSMin", "exports", "module", "u", "_makeDir", "makeDirSync", "makeDir", "require_utimes", "__commonJSMin", "exports", "module", "fs", "utimesMillis", "path", "atime", "mtime", "callback", "err", "fd", "futimesErr", "closeErr", "utimesMillisSync", "require_stat", "__commonJSMin", "exports", "module", "fs", "path", "util", "atLeastNode", "nodeSupportsBigInt", "stat", "file", "statSync", "getStats", "src", "dest", "err", "srcStat", "destStat", "getStatsSync", "checkPaths", "funcName", "cb", "stats", "areIdentical", "isSrcSubdir", "errMsg", "checkPathsSync", "checkParentPaths", "srcParent", "destParent", "callback", "checkParentPathsSync", "srcArr", "destArr", "acc", "cur", "i", "require_copy_sync", "__commonJSMin", "exports", "module", "fs", "path", "mkdirsSync", "utimesMillisSync", "stat", "copySync", "src", "dest", "opts", "srcStat", "destStat", "handleFilterAndCopy", "destParent", "startCopy", "getStats", "onDir", "onFile", "onLink", "mayCopyFile", "copyFile", "handleTimestamps", "setDestMode", "srcMode", "fileIsNotWritable", "makeFileWritable", "setDestTimestamps", "updatedSrcStat", "mkDirAndCopy", "copyDir", "item", "copyDirItem", "srcItem", "destItem", "resolvedSrc", "resolvedDest", "err", "copyLink", "require_copy_sync", "__commonJSMin", "exports", "module", "require_path_exists", "__commonJSMin", "exports", "module", "u", "fs", "pathExists", "path", "require_copy", "__commonJSMin", "exports", "module", "fs", "path", "mkdirs", "pathExists", "utimesMillis", "stat", "copy", "src", "dest", "opts", "cb", "err", "stats", "srcStat", "destStat", "handleFilter", "checkParentDir", "destParent", "dirExists", "startCopy", "onInclude", "include", "error", "getStats", "onDir", "onFile", "onLink", "mayCopyFile", "copyFile", "handleTimestampsAndMode", "setDestMode", "srcMode", "fileIsNotWritable", "makeFileWritable", "setDestTimestampsAndMode", "setDestTimestamps", "updatedSrcStat", "copyDir", "mkDirAndCopy", "items", "copyDirItems", "item", "copyDirItem", "srcItem", "destItem", "resolvedSrc", "resolvedDest", "copyLink", "require_copy", "__commonJSMin", "exports", "module", "u", "require_rimraf", "__commonJSMin", "exports", "module", "fs", "path", "assert", "isWindows", "defaults", "options", "m", "rimraf", "p", "cb", "busyTries", "rimraf_", "CB", "er", "time", "st", "fixWinEPERM", "rmdir", "er2", "er3", "stats", "fixWinEPERMSync", "rmdirSync", "originalEr", "rmkids", "files", "n", "errState", "f", "rimrafSync", "rmkidsSync", "startTime", "require_remove", "__commonJSMin", "exports", "module", "u", "rimraf", "require_empty", "__commonJSMin", "exports", "module", "u", "fs", "path", "mkdir", "remove", "emptyDir", "dir", "callback", "err", "items", "item", "deleteItem", "emptyDirSync", "require_file", "__commonJSMin", "exports", "module", "u", "path", "fs", "mkdir", "createFile", "file", "callback", "makeFile", "err", "stats", "dir", "createFileSync", "require_link", "__commonJSMin", "exports", "module", "u", "path", "fs", "mkdir", "pathExists", "createLink", "srcpath", "dstpath", "callback", "makeLink", "err", "destinationExists", "dir", "dirExists", "createLinkSync", "require_symlink_paths", "__commonJSMin", "exports", "module", "path", "fs", "pathExists", "symlinkPaths", "srcpath", "dstpath", "callback", "err", "dstdir", "relativeToDst", "exists", "symlinkPathsSync", "require_symlink_type", "__commonJSMin", "exports", "module", "fs", "symlinkType", "srcpath", "type", "callback", "err", "stats", "symlinkTypeSync", "require_symlink", "__commonJSMin", "exports", "module", "u", "path", "fs", "_mkdirs", "mkdirs", "mkdirsSync", "_symlinkPaths", "symlinkPaths", "symlinkPathsSync", "_symlinkType", "symlinkType", "symlinkTypeSync", "pathExists", "createSymlink", "srcpath", "dstpath", "type", "callback", "err", "destinationExists", "relative", "dir", "dirExists", "createSymlinkSync", "require_ensure", "__commonJSMin", "exports", "module", "file", "link", "symlink", "require_utils", "__commonJSMin", "exports", "module", "stringify", "obj", "EOL", "finalEOL", "replacer", "spaces", "EOF", "stripBom", "content", "require_jsonfile", "__commonJSMin", "exports", "module", "_fs", "universalify", "stringify", "stripBom", "_readFile", "file", "options", "fs", "shouldThrow", "data", "obj", "err", "readFile", "readFileSync", "content", "_writeFile", "str", "writeFile", "writeFileSync", "jsonfile", "require_jsonfile", "__commonJSMin", "exports", "module", "jsonFile", "require_output", "__commonJSMin", "exports", "module", "u", "fs", "path", "mkdir", "pathExists", "outputFile", "file", "data", "encoding", "callback", "dir", "err", "itDoes", "outputFileSync", "args", "require_output_json", "__commonJSMin", "exports", "module", "stringify", "outputFile", "outputJson", "file", "data", "options", "str", "require_output_json_sync", "__commonJSMin", "exports", "module", "stringify", "outputFileSync", "outputJsonSync", "file", "data", "options", "str", "require_json", "__commonJSMin", "exports", "module", "u", "jsonFile", "require_move_sync", "__commonJSMin", "exports", "module", "fs", "path", "copySync", "removeSync", "mkdirpSync", "stat", "moveSync", "src", "dest", "opts", "overwrite", "srcStat", "doRename", "rename", "err", "moveAcrossDevice", "require_move_sync", "__commonJSMin", "exports", "module", "require_move", "__commonJSMin", "exports", "module", "fs", "path", "copy", "remove", "mkdirp", "pathExists", "stat", "move", "src", "dest", "opts", "cb", "overwrite", "err", "stats", "srcStat", "doRename", "rename", "destExists", "moveAcrossDevice", "require_move", "__commonJSMin", "exports", "module", "u", "require_lib", "__commonJSMin", "exports", "module", "fs", "require_escape_string_regexp", "__commonJSMin", "exports", "module", "matchOperatorsRe", "str", "require_color_name", "__commonJSMin", "exports", "module", "require_conversions", "__commonJSMin", "exports", "module", "cssKeywords", "reverseKeywords", "key", "convert", "model", "channels", "labels", "rgb", "r", "g", "b", "min", "max", "delta", "h", "s", "l", "rdif", "gdif", "bdif", "v", "diff", "diffc", "c", "w", "m", "y", "k", "comparativeDistance", "x", "reversed", "currentClosestDistance", "currentClosestKeyword", "keyword", "value", "distance", "z", "xyz", "a", "hsl", "t1", "t2", "t3", "val", "i", "smin", "lmin", "sv", "hsv", "hi", "f", "p", "q", "t", "vmin", "sl", "hwb", "wh", "bl", "ratio", "n", "cmyk", "lab", "y2", "x2", "z2", "hr", "lch", "args", "ansi", "color", "mult", "rem", "integer", "string", "match", "colorString", "char", "chroma", "grayscale", "hue", "hcg", "pure", "mg", "apple", "gray", "require_route", "__commonJSMin", "exports", "module", "conversions", "buildGraph", "graph", "models", "len", "i", "deriveBFS", "fromModel", "queue", "current", "adjacents", "adjacent", "node", "link", "from", "to", "args", "wrapConversion", "toModel", "path", "fn", "cur", "conversion", "require_color_convert", "__commonJSMin", "exports", "module", "conversions", "route", "convert", "models", "wrapRaw", "fn", "wrappedFn", "args", "wrapRounded", "result", "len", "i", "fromModel", "routes", "routeModels", "toModel", "require_ansi_styles", "__commonJSMin", "exports", "module", "colorConvert", "wrapAnsi16", "fn", "offset", "wrapAnsi256", "code", "wrapAnsi16m", "rgb", "assembleStyles", "codes", "styles", "groupName", "group", "styleName", "style", "ansi2ansi", "n", "rgb2rgb", "r", "g", "b", "key", "suite", "require_has_flag", "__commonJSMin", "exports", "module", "flag", "argv", "prefix", "pos", "terminatorPos", "require_supports_color", "__commonJSMin", "exports", "module", "os", "hasFlag", "env", "forceColor", "translateLevel", "level", "supportsColor", "stream", "min", "osRelease", "sign", "version", "getSupportLevel", "require_templates", "__commonJSMin", "exports", "module", "TEMPLATE_REGEX", "STYLE_REGEX", "STRING_REGEX", "ESCAPE_REGEX", "ESCAPES", "unescape", "c", "parseArguments", "name", "args", "results", "chunks", "matches", "chunk", "m", "escape", "chr", "parseStyle", "style", "buildStyle", "chalk", "styles", "enabled", "layer", "current", "styleName", "tmp", "escapeChar", "inverse", "close", "str", "errMsg", "require_chalk", "__commonJSMin", "exports", "module", "escapeStringRegexp", "ansiStyles", "stdoutColor", "template", "isSimpleWindowsTerm", "levelMapping", "skipModels", "styles", "applyOptions", "obj", "options", "scLevel", "Chalk", "chalk", "args", "chalkTag", "key", "codes", "build", "model", "level", "bgModel", "proto", "_styles", "_empty", "builder", "applyStyle", "self", "enabled", "argsLen", "str", "a", "originalDim", "code", "strings", "parts", "require_yocto_queue", "__commonJSMin", "exports", "module", "Node", "value", "Queue", "node", "current", "require_p_limit", "__commonJSMin", "exports", "module", "Queue", "pLimit", "concurrency", "queue", "activeCount", "next", "run", "fn", "resolve", "args", "result", "enqueue", "generator", "require_p_locate", "__commonJSMin", "exports", "module", "pLimit", "EndError", "value", "testElement", "element", "tester", "finder", "values", "pLocate", "iterable", "options", "limit", "items", "checkLimit", "error", "require_locate_path", "__commonJSMin", "exports", "module", "path", "fs", "promisify", "pLocate", "fsStat", "fsLStat", "typeMappings", "checkType", "type", "matchType", "stat", "paths", "options", "statFn", "path_", "require_path_exists", "__commonJSMin", "exports", "module", "fs", "promisify", "pAccess", "path", "require_find_up", "__commonJSMin", "exports", "module", "path", "locatePath", "pathExists", "stop", "name", "options", "directory", "root", "paths", "runMatcher", "locateOptions", "foundPath", "require_pkg_dir", "__commonJSMin", "exports", "module", "path", "findUp", "pkgDir", "cwd", "filePath", "require_kleur", "__commonJSMin", "exports", "module", "FORCE_COLOR", "NODE_DISABLE_COLORS", "TERM", "$", "init", "run", "arr", "str", "i", "tmp", "beg", "end", "chain", "has", "keys", "ctx", "open", "close", "blk", "txt", "require_react_production_min", "__commonJSMin", "exports", "l", "n", "p", "q", "r", "t", "u", "v", "w", "x", "y", "z", "A", "a", "B", "C", "D", "E", "b", "e", "F", "G", "H", "I", "J", "K", "L", "M", "d", "c", "k", "h", "g", "f", "m", "N", "O", "escape", "P", "Q", "R", "S", "T", "U", "V", "W", "require_react_development", "__commonJSMin", "exports", "module", "ReactVersion", "REACT_ELEMENT_TYPE", "REACT_PORTAL_TYPE", "REACT_FRAGMENT_TYPE", "REACT_STRICT_MODE_TYPE", "REACT_PROFILER_TYPE", "REACT_PROVIDER_TYPE", "REACT_CONTEXT_TYPE", "REACT_FORWARD_REF_TYPE", "REACT_SUSPENSE_TYPE", "REACT_SUSPENSE_LIST_TYPE", "REACT_MEMO_TYPE", "REACT_LAZY_TYPE", "REACT_OFFSCREEN_TYPE", "MAYBE_ITERATOR_SYMBOL", "FAUX_ITERATOR_SYMBOL", "getIteratorFn", "maybeIterable", "maybeIterator", "ReactCurrentDispatcher", "ReactCurrentBatchConfig", "ReactCurrentActQueue", "ReactCurrentOwner", "ReactDebugCurrentFrame", "currentExtraStackFrame", "setExtraStackFrame", "stack", "impl", "enableScopeAPI", "enableCacheElement", "enableTransitionTracing", "enableLegacyHidden", "enableDebugTracing", "ReactSharedInternals", "warn", "format", "_len", "args", "_key", "printWarning", "error", "_len2", "_key2", "level", "argsWithFormat", "item", "didWarnStateUpdateForUnmountedComponent", "warnNoop", "publicInstance", "callerName", "_constructor", "componentName", "warningKey", "ReactNoopUpdateQueue", "callback", "completeState", "partialState", "assign", "emptyObject", "Component", "props", "context", "updater", "deprecatedAPIs", "defineDeprecationWarning", "methodName", "info", "fnName", "ComponentDummy", "PureComponent", "pureComponentPrototype", "createRef", "refObject", "isArrayImpl", "isArray", "a", "typeName", "value", "hasToStringTag", "type", "willCoercionThrow", "testStringCoercion", "checkKeyStringCoercion", "getWrappedName", "outerType", "innerType", "wrapperName", "displayName", "functionName", "getContextName", "getComponentNameFromType", "provider", "outerName", "lazyComponent", "payload", "init", "hasOwnProperty", "RESERVED_PROPS", "specialPropKeyWarningShown", "specialPropRefWarningShown", "didWarnAboutStringRefs", "hasValidRef", "config", "getter", "hasValidKey", "defineKeyPropWarningGetter", "warnAboutAccessingKey", "defineRefPropWarningGetter", "warnAboutAccessingRef", "warnIfStringRefCannotBeAutoConverted", "ReactElement", "key", "ref", "self", "source", "owner", "element", "createElement", "children", "propName", "childrenLength", "childArray", "i", "defaultProps", "cloneAndReplaceKey", "oldElement", "newKey", "newElement", "cloneElement", "isValidElement", "object", "SEPARATOR", "SUBSEPARATOR", "escape", "escapeRegex", "escaperLookup", "escapedString", "match", "didWarnAboutMaps", "userProvidedKeyEscapeRegex", "escapeUserProvidedKey", "text", "getElementKey", "index", "mapIntoArray", "array", "escapedPrefix", "nameSoFar", "invokeCallback", "_child", "mappedChild", "childKey", "escapedChildKey", "c", "child", "nextName", "subtreeCount", "nextNamePrefix", "iteratorFn", "iterableChildren", "iterator", "step", "ii", "childrenString", "mapChildren", "func", "result", "count", "countChildren", "n", "forEachChildren", "forEachFunc", "forEachContext", "toArray", "onlyChild", "createContext", "defaultValue", "hasWarnedAboutUsingNestedContextConsumers", "hasWarnedAboutUsingConsumerProvider", "hasWarnedAboutDisplayNameOnConsumer", "Consumer", "_Provider", "_currentValue", "_currentValue2", "_threadCount", "Uninitialized", "Pending", "Resolved", "Rejected", "lazyInitializer", "ctor", "thenable", "moduleObject", "resolved", "rejected", "pending", "lazy", "lazyType", "propTypes", "newDefaultProps", "newPropTypes", "forwardRef", "render", "elementType", "ownName", "name", "REACT_MODULE_REFERENCE", "isValidElementType", "memo", "compare", "resolveDispatcher", "dispatcher", "useContext", "Context", "realContext", "useState", "initialState", "useReducer", "reducer", "initialArg", "useRef", "initialValue", "useEffect", "create", "deps", "useInsertionEffect", "useLayoutEffect", "useCallback", "useMemo", "useImperativeHandle", "useDebugValue", "formatterFn", "useTransition", "useDeferredValue", "useId", "useSyncExternalStore", "subscribe", "getSnapshot", "getServerSnapshot", "disabledDepth", "prevLog", "prevInfo", "prevWarn", "prevError", "prevGroup", "prevGroupCollapsed", "prevGroupEnd", "disabledLog", "disableLogs", "reenableLogs", "ReactCurrentDispatcher$1", "prefix", "describeBuiltInComponentFrame", "ownerFn", "x", "reentry", "componentFrameCache", "PossiblyWeakMap", "describeNativeComponentFrame", "fn", "construct", "frame", "control", "previousPrepareStackTrace", "previousDispatcher", "Fake", "sample", "sampleLines", "controlLines", "s", "_frame", "syntheticFrame", "describeFunctionComponentFrame", "shouldConstruct", "prototype", "describeUnknownElementTypeFrameInDEV", "loggedTypeFailures", "ReactDebugCurrentFrame$1", "setCurrentlyValidatingElement", "checkPropTypes", "typeSpecs", "values", "location", "has", "typeSpecName", "error$1", "err", "ex", "setCurrentlyValidatingElement$1", "propTypesMisspellWarningShown", "getDeclarationErrorAddendum", "getSourceInfoErrorAddendum", "fileName", "lineNumber", "getSourceInfoErrorAddendumForProps", "elementProps", "ownerHasKeyUseWarning", "getCurrentComponentErrorInfo", "parentType", "parentName", "validateExplicitKey", "currentComponentErrorInfo", "childOwner", "validateChildKeys", "node", "validatePropTypes", "_name", "validateFragmentProps", "fragment", "keys", "createElementWithValidation", "validType", "sourceInfo", "typeString", "didWarnAboutDeprecatedCreateFactory", "createFactoryWithValidation", "validatedFactory", "cloneElementWithValidation", "startTransition", "scope", "options", "prevTransition", "currentTransition", "updatedFibersCount", "didWarnAboutMessageChannel", "enqueueTaskImpl", "enqueueTask", "task", "requireString", "nodeRequire", "channel", "actScopeDepth", "didWarnNoAwaitAct", "act", "prevActScopeDepth", "prevIsBatchingLegacy", "queue", "flushActQueue", "popActScope", "thenableResult", "wasAwaited", "resolve", "reject", "returnValue", "recursivelyFlushAsyncActWork", "_queue", "_thenable", "_thenable2", "isFlushing", "createElement$1", "cloneElement$1", "createFactory", "Children", "require_react", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "validateChar", "str", "i", "firstChar", "secondChar", "fixChar", "newStr", "validateSingleChar", "validateName", "initialFirstChar", "initialFirstCharMatch", "initialSecondChar", "initialSecondCharMatch", "start", "fixName", "isUndefined", "val", "require_options", "__commonJSMin", "exports", "validate_1", "StringOptions", "options", "require_escape", "__commonJSMin", "exports", "escapeAmpersands", "str", "escapeLeftAngleBrackets", "escapeRightAngleBracketsInCdataTerminator", "escapeSingleQuotes", "escapeDoubleQuotes", "require_XmlAttributeText", "__commonJSMin", "exports", "error_1", "escape_1", "validate_1", "XmlAttributeText", "parent", "validation", "options", "charData", "str", "require_XmlCharRef", "__commonJSMin", "exports", "error_1", "validate_1", "XmlCharRef", "parent", "validation", "options", "char", "hex", "first", "second", "require_XmlEntityRef", "__commonJSMin", "exports", "error_1", "validate_1", "XmlEntityRef", "parent", "validation", "options", "name", "require_XmlAttribute", "__commonJSMin", "exports", "__importDefault", "mod", "error_1", "escape_1", "options_1", "validate_1", "XmlAttributeText_1", "XmlCharRef_1", "XmlEntityRef_1", "XmlAttribute", "parent", "validation", "options", "name", "charRef", "textNode", "optionsObj", "quote", "str", "_i", "_a", "child", "require_XmlDtdAttlist", "__commonJSMin", "exports", "error_1", "validate_1", "XmlDtdAttlist", "parent", "validation", "options", "charData", "require_XmlDtdElement", "__commonJSMin", "exports", "error_1", "validate_1", "XmlDtdElement", "parent", "validation", "options", "charData", "require_XmlDtdEntity", "__commonJSMin", "exports", "error_1", "validate_1", "XmlDtdEntity", "parent", "validation", "options", "charData", "require_XmlDtdNotation", "__commonJSMin", "exports", "error_1", "validate_1", "XmlDtdNotation", "parent", "validation", "options", "charData", "require_XmlDtdParamEntityRef", "__commonJSMin", "exports", "error_1", "validate_1", "XmlDtdParamEntityRef", "parent", "validation", "options", "name", "require_XmlProcInst", "__commonJSMin", "exports", "error_1", "validate_1", "XmlProcInst", "parent", "validation", "options", "content", "target", "require_XmlDtd", "__commonJSMin", "exports", "__importDefault", "mod", "error_1", "options_1", "validate_1", "XmlComment_1", "XmlDtdAttlist_1", "XmlDtdElement_1", "XmlDtdEntity_1", "XmlDtdNotation_1", "XmlDtdParamEntityRef_1", "XmlProcInst_1", "XmlDtd", "parent", "validation", "options", "name", "pubId", "validatePubId", "sysId", "attlist", "comment", "element", "entity", "notation", "paramEntity", "procInst", "optionsObj", "str", "_i", "_a", "node", "type", "value", "i", "char", "require_XmlCdata", "__commonJSMin", "exports", "error_1", "validate_1", "XmlCdata", "parent", "validation", "options", "charData", "require_XmlCharData", "__commonJSMin", "exports", "error_1", "escape_1", "validate_1", "XmlCharData", "parent", "validation", "options", "charData", "str", "require_XmlElement", "__commonJSMin", "exports", "__importDefault", "mod", "error_1", "options_1", "validate_1", "XmlAttribute_1", "XmlCdata_1", "XmlCharData_1", "XmlCharRef_1", "XmlComment_1", "XmlEntityRef_1", "XmlProcInst_1", "XmlElement", "parent", "validation", "options", "name", "attribute", "cdata", "charDataNode", "charRef", "comment", "element", "entityRef", "procInst", "indent", "optionsObj", "newIndent", "str", "nodes", "_i", "_a", "node", "childStr", "i", "next", "nextStr", "prev", "nodes_1", "require_error", "__commonJSMin", "exports", "__importDefault", "mod", "XmlAttribute_1", "XmlDocument_1", "XmlDtd_1", "XmlElement_1", "getContext", "obj", "require_XmlComment", "__commonJSMin", "exports", "error_1", "validate_1", "XmlComment", "parent", "validation", "options", "charData", "require_XmlDecl", "__commonJSMin", "exports", "error_1", "options_1", "validate_1", "XmlDecl", "parent", "validation", "options", "encoding", "validateEncoding", "standalone", "version", "validateVersion", "optionsObj", "quote", "str", "initialChar", "i", "char", "require_XmlDocument", "__commonJSMin", "exports", "__importDefault", "mod", "options_1", "validate_1", "XmlComment_1", "XmlDecl_1", "XmlDtd_1", "XmlElement_1", "XmlProcInst_1", "XmlDocument", "options", "comment", "declaration", "filteredChildren", "value", "dtd", "element", "procInst", "optionsObj", "str", "_i", "_a", "node", "len", "require_main", "__commonJSMin", "exports", "__importDefault", "mod", "XmlDocument_1", "XmlAttribute_1", "XmlAttributeText_1", "XmlCdata_1", "XmlCharData_1", "XmlCharRef_1", "XmlComment_1", "XmlDecl_1", "XmlDocument_2", "XmlDtd_1", "XmlDtdAttlist_1", "XmlDtdElement_1", "XmlDtdEntity_1", "XmlDtdNotation_1", "XmlDtdParamEntityRef_1", "XmlElement_1", "XmlEntityRef_1", "XmlProcInst_1", "document", "options", "require_utils", "__commonJSMin", "exports", "isUndefined", "val", "isNull", "isObject", "isArray", "isFunction", "isSet", "isMap", "stringify", "value", "require_options", "__commonJSMin", "exports", "utils_1", "Options", "options", "DeclarationOptions", "DtdOptions", "FormatOptions", "TypeHandlers", "WrapHandlers", "declarationOptions", "validation", "dtdOptions", "formatOptions", "typeHandlers", "key", "wrapHandlers", "require_main", "__commonJSMin", "exports", "xmlcreate_1", "options_1", "utils_1", "Absent", "getHandler", "value", "options", "type", "handler", "parseString", "str", "parentElement", "requiresCdata", "cdataStrs", "i", "parseAttribute", "name", "attribute", "parseObjectOrMapEntry", "key", "_i", "_a", "subkey", "parseValue", "element", "parseObjectOrMap", "objectOrMap", "parseArrayOrSet", "arrayOrSet", "arrayNameFunc", "arrayKey", "arrayElement", "arrayNameFuncKey", "item", "parseToExistingElement", "object", "opts", "parse", "root", "document", "rootElement", "require_bind", "__commonJSMin", "exports", "module", "fn", "thisArg", "args", "i", "require_utils", "__commonJSMin", "exports", "module", "bind", "toString", "isArray", "val", "isUndefined", "isBuffer", "isArrayBuffer", "isFormData", "isArrayBufferView", "result", "isString", "isNumber", "isObject", "isPlainObject", "prototype", "isDate", "isFile", "isBlob", "isFunction", "isStream", "isURLSearchParams", "trim", "str", "isStandardBrowserEnv", "forEach", "obj", "fn", "i", "l", "key", "merge", "assignValue", "extend", "a", "b", "thisArg", "stripBOM", "content", "require_buildURL", "__commonJSMin", "exports", "module", "utils", "encode", "val", "url", "params", "paramsSerializer", "serializedParams", "parts", "key", "v", "hashmarkIndex", "require_InterceptorManager", "__commonJSMin", "exports", "module", "utils", "InterceptorManager", "fulfilled", "rejected", "options", "id", "fn", "h", "require_normalizeHeaderName", "__commonJSMin", "exports", "module", "utils", "headers", "normalizedName", "value", "name", "require_enhanceError", "__commonJSMin", "exports", "module", "error", "config", "code", "request", "response", "require_createError", "__commonJSMin", "exports", "module", "enhanceError", "message", "config", "code", "request", "response", "error", "require_settle", "__commonJSMin", "exports", "module", "createError", "resolve", "reject", "response", "validateStatus", "require_cookies", "__commonJSMin", "exports", "module", "utils", "name", "value", "expires", "path", "domain", "secure", "cookie", "match", "require_isAbsoluteURL", "__commonJSMin", "exports", "module", "url", "require_combineURLs", "__commonJSMin", "exports", "module", "baseURL", "relativeURL", "require_buildFullPath", "__commonJSMin", "exports", "module", "isAbsoluteURL", "combineURLs", "baseURL", "requestedURL", "require_parseHeaders", "__commonJSMin", "exports", "module", "utils", "ignoreDuplicateOf", "headers", "parsed", "key", "val", "i", "line", "require_isURLSameOrigin", "__commonJSMin", "exports", "module", "utils", "msie", "urlParsingNode", "originURL", "resolveURL", "url", "href", "requestURL", "parsed", "require_xhr", "__commonJSMin", "exports", "module", "utils", "settle", "cookies", "buildURL", "buildFullPath", "parseHeaders", "isURLSameOrigin", "createError", "config", "resolve", "reject", "requestData", "requestHeaders", "responseType", "request", "username", "password", "fullPath", "onloadend", "responseHeaders", "responseData", "response", "timeoutErrorMessage", "xsrfValue", "val", "key", "cancel", "require_ms", "__commonJSMin", "exports", "module", "s", "m", "h", "d", "w", "y", "val", "options", "type", "parse", "fmtLong", "fmtShort", "str", "match", "n", "ms", "msAbs", "plural", "name", "isPlural", "require_common", "__commonJSMin", "exports", "module", "setup", "env", "createDebug", "coerce", "disable", "enable", "enabled", "destroy", "key", "selectColor", "namespace", "hash", "i", "prevTime", "enableOverride", "namespacesCache", "enabledCache", "debug", "args", "self", "curr", "ms", "index", "match", "format", "formatter", "val", "extend", "v", "delimiter", "newDebug", "namespaces", "split", "len", "toNamespace", "name", "regexp", "require_browser", "__commonJSMin", "exports", "module", "formatArgs", "save", "load", "useColors", "localstorage", "warned", "args", "c", "index", "lastC", "match", "namespaces", "r", "formatters", "v", "error", "require_has_flag", "__commonJSMin", "exports", "module", "flag", "argv", "prefix", "position", "terminatorPosition", "require_supports_color", "__commonJSMin", "exports", "module", "os", "tty", "hasFlag", "env", "forceColor", "translateLevel", "level", "supportsColor", "haveStream", "streamIsTTY", "min", "osRelease", "sign", "version", "getSupportLevel", "stream", "require_node", "__commonJSMin", "exports", "module", "tty", "util", "init", "log", "formatArgs", "save", "load", "useColors", "supportsColor", "key", "obj", "prop", "_", "k", "val", "args", "name", "c", "colorCode", "prefix", "getDate", "namespaces", "debug", "keys", "i", "formatters", "v", "str", "require_src", "__commonJSMin", "exports", "module", "require_debug", "__commonJSMin", "exports", "module", "debug", "require_follow_redirects", "__commonJSMin", "exports", "module", "url", "URL", "http", "https", "Writable", "assert", "debug", "events", "eventHandlers", "event", "arg1", "arg2", "arg3", "InvalidUrlError", "createErrorType", "RedirectionError", "TooManyRedirectsError", "MaxBodyLengthExceededError", "WriteAfterEndError", "RedirectableRequest", "options", "responseCallback", "self", "response", "abortRequest", "data", "encoding", "callback", "isString", "isBuffer", "isFunction", "currentRequest", "name", "value", "msecs", "destroyOnTimeout", "socket", "startTimer", "clearTimer", "method", "a", "b", "property", "searchPos", "protocol", "nativeProtocol", "scheme", "request", "i", "buffers", "writeNext", "error", "buffer", "statusCode", "location", "requestHeaders", "beforeRedirect", "removeMatchingHeaders", "currentHostHeader", "currentUrlParts", "currentHost", "currentUrl", "redirectUrl", "cause", "redirectUrlParts", "isSubdomain", "responseDetails", "requestDetails", "err", "wrap", "protocols", "nativeProtocols", "wrappedProtocol", "input", "parsed", "urlToOptions", "get", "wrappedRequest", "noop", "urlObject", "regex", "headers", "lastValue", "header", "code", "message", "baseClass", "CustomError", "properties", "subdomain", "domain", "dot", "require_package", "__commonJSMin", "exports", "module", "require_http", "__commonJSMin", "exports", "module", "utils", "settle", "buildFullPath", "buildURL", "http", "https", "httpFollow", "httpsFollow", "url", "zlib", "pkg", "createError", "enhanceError", "isHttps", "setProxy", "options", "proxy", "location", "base64", "redirection", "config", "resolvePromise", "rejectPromise", "resolve", "value", "reject", "data", "headers", "auth", "username", "password", "fullPath", "parsed", "protocol", "urlAuth", "urlUsername", "urlPassword", "isHttpsRequest", "agent", "proxyEnv", "proxyUrl", "parsedProxyUrl", "noProxyEnv", "shouldProxy", "noProxy", "s", "proxyElement", "proxyUrlAuth", "transport", "isHttpsProxy", "req", "res", "stream", "lastRequest", "response", "responseBuffer", "totalResponseBytes", "chunk", "err", "responseData", "timeout", "cancel", "require_defaults", "__commonJSMin", "exports", "module", "utils", "normalizeHeaderName", "enhanceError", "DEFAULT_CONTENT_TYPE", "setContentTypeIfUnset", "headers", "value", "getDefaultAdapter", "adapter", "stringifySafely", "rawValue", "parser", "encoder", "e", "defaults", "data", "transitional", "silentJSONParsing", "forcedJSONParsing", "strictJSONParsing", "status", "method", "require_transformData", "__commonJSMin", "exports", "module", "utils", "defaults", "data", "headers", "fns", "context", "fn", "require_isCancel", "__commonJSMin", "exports", "module", "value", "require_dispatchRequest", "__commonJSMin", "exports", "module", "utils", "transformData", "isCancel", "defaults", "throwIfCancellationRequested", "config", "method", "adapter", "response", "reason", "require_mergeConfig", "__commonJSMin", "exports", "module", "utils", "config1", "config2", "config", "valueFromConfig2Keys", "mergeDeepPropertiesKeys", "defaultToConfig2Keys", "directMergeKeys", "getMergedValue", "target", "source", "mergeDeepProperties", "prop", "axiosKeys", "otherKeys", "key", "require_validator", "__commonJSMin", "exports", "module", "pkg", "validators", "type", "i", "thing", "deprecatedWarnings", "currentVerArr", "isOlderVersion", "version", "thanVersion", "pkgVersionArr", "destVer", "validator", "message", "isDeprecated", "formatMessage", "opt", "desc", "value", "opts", "assertOptions", "options", "schema", "allowUnknown", "keys", "result", "require_Axios", "__commonJSMin", "exports", "module", "utils", "buildURL", "InterceptorManager", "dispatchRequest", "mergeConfig", "validator", "validators", "Axios", "instanceConfig", "config", "transitional", "requestInterceptorChain", "synchronousRequestInterceptors", "interceptor", "responseInterceptorChain", "promise", "chain", "newConfig", "onFulfilled", "onRejected", "error", "method", "url", "data", "require_Cancel", "__commonJSMin", "exports", "module", "Cancel", "message", "require_CancelToken", "__commonJSMin", "exports", "module", "Cancel", "CancelToken", "executor", "resolvePromise", "resolve", "token", "message", "cancel", "c", "require_spread", "__commonJSMin", "exports", "module", "callback", "arr", "require_isAxiosError", "__commonJSMin", "exports", "module", "payload", "require_axios", "__commonJSMin", "exports", "module", "utils", "bind", "Axios", "mergeConfig", "defaults", "createInstance", "defaultConfig", "context", "instance", "axios", "instanceConfig", "promises", "require_axios", "__commonJSMin", "exports", "module", "resolveComponentsPath", "customPath", "IS_COMPONENT_LIBRARY", "path", "pkgDir", "getComponentsJSConfig", "jsConfigPath", "findUp", "getComponentsLibAliases", "xsConfig", "currentAlias", "pathKey", "aliasKey", "pathAtJsConfig", "relativePathToDir", "absolutePath", "import_node_path", "import_find_up", "import_pkg_dir", "PROJECT_ALIASES", "init_instance", "__esmMin", "cx_config_exports", "__export", "cx_config_default", "import_node_path", "import_pkg_dir", "REPO_ROOT_DIR", "CX_ROOT_DIR", "SSG_DIR", "CX_CACHE_DIR", "COMPONENTS_DIR", "EXPORTS_DIR", "griddoVersion", "config", "init_cx_config", "__esmMin", "init_instance", "pkgDir", "path", "resolveComponentsPath", "domain", "start_render_exports", "__export", "startRender", "__toCommonJS", "import_node_path", "import_node_child_process", "import_node_path", "import_dotenv", "import_fs_extra", "import_node_fs", "import_node_path", "import_chalk", "import_dotenv", "import_fs_extra", "import_pkg_dir", "import_node_fs", "import_node_path", "import_fs_extra", "import_kleur", "import_react", "import_dotenv", "dotenv", "GRIDDO_API_URL", "GRIDDO_PUBLIC_API_URL", "GRIDDO_BOT_USER", "GRIDDO_BOT_PASSWORD", "GRIDDO_API_CONCURRENCY_COUNT", "GRIDDO_RENDER_ALL_SITES", "isTruthy", "GRIDDO_RENDER_SITE", "GRIDDO_RENDER_PAGES", "item", "GRIDDO_SKIP_BUILD_CHECKS", "GRIDDO_DEBUG_LOGS", "GRIDDO_BUILD_LOGS", "GRIDDO_RENDER_BREAKPOINTS_FEATURE", "GRIDDO_SSG_VERBOSE_LOGS", "GRIDDO_SEARCH_FEATURE", "GRIDDO_ASSET_PREFIX", "GRIDDO_REACT_APP_INSTANCE", "GRIDDO_AI_EMBEDDINGS", "GRIDDO_VERBOSE_LOGS", "GRIDDO_ALERT_FEATURE", "GRIDDO_API_MAX_RESPONSE_SIZE", "GRIDDO_SSG_MAX_PAGE_SIZE", "GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_FIXTURES_DOMAIN_NAMES", "GRIDDO_FIXTURES_SITE_NAMES", "WITH_URI", "GRIDDO_API_URL", "AI_EMBEDDINGS", "ALERT", "GRIDDO_PUBLIC_API_URL", "DOMAINS", "GET_ALL", "GET_PAGE", "LOGIN", "RESET_RENDER", "ROBOTS", "SEARCH", "SETTINGS", "BUILD_END", "BUILD_START", "GET_PAGES", "GET_REFERENCE_FIELD_DATA", "GET_SITEMAP", "INFO", "LANGUAGES", "SOCIALS", "endpoints", "ALERT", "AI_EMBEDDINGS", "BUILD_END", "BUILD_START", "DOMAINS", "GET_ALL", "GET_PAGE", "GET_PAGES", "GET_REFERENCE_FIELD_DATA", "GET_SITEMAP", "INFO", "LANGUAGES", "LOGIN", "RESET_RENDER", "ROBOTS", "SEARCH", "SETTINGS", "SOCIALS", "envs", "GRIDDO_AI_EMBEDDINGS", "GRIDDO_ALERT_FEATURE", "GRIDDO_API_CONCURRENCY_COUNT", "GRIDDO_API_MAX_RESPONSE_SIZE", "GRIDDO_API_URL", "GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_ASSET_PREFIX", "GRIDDO_BOT_PASSWORD", "GRIDDO_BOT_USER", "GRIDDO_BUILD_LOGS", "GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_DEBUG_LOGS", "GRIDDO_FIXTURES_DOMAIN_NAMES", "GRIDDO_FIXTURES_SITE_NAMES", "GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_PUBLIC_API_URL", "GRIDDO_REACT_APP_INSTANCE", "GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_RENDER_ALL_SITES", "GRIDDO_RENDER_BREAKPOINTS_FEATURE", "GRIDDO_RENDER_PAGES", "GRIDDO_RENDER_SITE", "GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_SEARCH_FEATURE", "GRIDDO_SKIP_BUILD_CHECKS", "GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_SSG_MAX_PAGE_SIZE", "GRIDDO_SSG_VERBOSE_LOGS", "GRIDDO_VERBOSE_LOGS", "verboseLog", "str", "envs", "kleur", "boxLog", "stringValue", "title", "paddingInline", "paddingBlock", "lines", "line", "windowTitle", "windowTitleLength", "longerContent", "l", "longerLine", "paddingBlockString", "minWidth", "borderTop", "borderBottom", "content", "mr", "infoLog", "str", "kleur", "debugLog", "values", "envs", "printExporterLogo", "adapter", "config", "getConfig", "nodeVersion", "griddoVersion", "logo", "reactVersion", "config", "getConfig", "clearEmptyDirs", "baseDir", "fsx", "children", "childrenCount", "xmlCount", "file", "path", "xmlFile", "fullPath", "restoreBackup", "src", "suffix", "dst", "fs", "deleteBackup", "fsx", "createBackup", "removeVirtualPagesFromStore", "__cx", "config", "storePath", "path", "allJsonPageFilesPath", "walkStore", "filePath", "removeArtifacts", "artifacts", "dir", "fsx", "fs", "verboseLog", "createArtifacts", "dirs", "options", "copyArtifacts", "src", "dst", "withBackup", "srcCompose", "path", "dstCompose", "createBackup", "deleteBackup", "restoreBackup", "renameArtifact", "moveArtifacts", "override", "e", "import_node_path", "import_fs_extra", "import_js2xmlparser", "import_node_fs", "import_node_path", "import_fs_extra", "config", "getConfig", "getBuildMetadata", "__cx", "config", "sitesToPublish", "createdPages", "buildProcessData", "fsx", "path", "createStoreDir", "storeDir", "fs", "saveRenderInfoInStore", "basePath", "renderInfo", "getPageInStoreDir", "file", "fullPathFile", "stat", "baseFilename", "page", "filename", "savePagesInStore", "siteFolderName", "pages", "removeProperties", "filePath", "e", "removePagesFromStore", "siteDirName", "filenames", "error", "getPagesToCreateOrDelete", "sitePages", "changedPages", "validPagesIds", "siteDirStorePath", "pagesInStore", "pagesMissingInStore", "pagesToStore", "pagesToDeleteFromStore", "pagesToWriteToStore", "import_axios", "import_chalk", "AuthService", "envs", "response", "axios", "endpoints", "token", "chalk", "authService", "import_axios", "import_chalk", "import_dotenv", "import_node_crypto", "import_node_fs", "import_node_path", "import_fs_extra", "config", "getConfig", "createAPICacheDir", "__cx", "apiCacheDir", "path", "fs", "generateFilenameWithHash", "petition", "hashSum", "crypto", "saveCache", "petition", "content", "stringContent", "filename", "generateFilenameWithHash", "filepath", "path", "fs", "searchCacheData", "file", "fsx", "getHashSites", "__cx", "config", "siteHasFilename", "updatedSiteHash", "siteId", "siteHash", "allHash", "lastHash", "currentHash", "import_fs_extra", "MemoryRegister", "entries", "name", "entry", "Register", "strategy", "name", "entry", "entries", "register", "Register", "MemoryRegister", "api_default", "entries", "register", "Register", "MemoryRegister", "dotenv", "RETRY_WAIT_SECONDS", "RETRY_ATTEMPTS", "requestAPI", "props", "method", "appendToLog", "endpoint", "body", "cacheKey", "attempt", "headers", "cacheOptions", "start", "cacheData", "searchCacheData", "siteId", "getSafeSiteId", "siteIdMsg", "duration", "msToSec", "infoLog", "data", "responseHeaders", "axios", "authService", "saveCache", "envs", "responseSize", "api_default", "e", "error", "showApiError", "delay", "getApi", "postApi", "props", "endpoint", "body", "headers", "distributorBodyParams", "requestAPI", "showApiError", "error", "options", "response", "message", "stack", "callInfo", "status", "statusText", "data", "callInfoArray", "item", "callInfoStr", "apiResponseStr", "errorDetailsStr", "chalk", "getAllSites", "getApi", "endpoints", "getPage", "id", "cacheKey", "getSiteInfo", "prefix", "suffix", "getSiteLanguages", "startSiteRender", "endSiteRender", "body", "postApi", "getDistributorData", "page", "dataSiteId", "dataLangID", "site", "lang", "getSitemap", "getSiteSocials", "config", "getConfig", "checkSites", "domain", "envs", "authService", "allSites", "getAllSites", "validSites", "site", "items", "getSiteLanguages", "item", "validSitesFromCurrentDomain", "sitesToPublish", "sitesToUnpublish", "unpublishSites", "sites", "__cx", "buildInfo", "startSiteRender", "siteHash", "body", "endSiteRender", "fs", "path", "getSiteData", "siteID", "buildData", "siteInfo", "getSiteInfo", "siteLangs", "socials", "getSiteSocials", "siteLangsInfo", "defaultLang", "lang", "unpublishHashes", "publishIds", "headers", "footers", "validPagesIds", "generateBuildReport", "buildProcessData", "getBuildMetadata", "authControl", "buildSitesInfo", "report", "infoLog", "generateSitemaps", "distDir", "languages", "response", "getSitemap", "sitemapPagesGroup", "home", "langDomain", "slug", "sitemaps", "sitemapPageGroupKeys", "sitemapBasePath", "templateId", "sitemapPages", "siteMap", "sitemapName", "exactPath", "saveFile", "loc", "filePath", "content", "pathName", "err", "import_node_fs", "import_node_path", "config", "getConfig", "getRobots", "getApi", "endpoints", "r", "path", "content", "writeRobots", "domain", "__cx", "distDirectory", "robots", "robot", "fs", "fileLocation", "dotenv", "config", "getConfig", "instanceRootDir", "pkgDir", "isTruthy", "value", "number", "walkStore", "dir", "results", "subdirs", "fs", "file", "fullPath", "path", "subdir", "subdirPath", "files", "delay", "ms", "res", "msToSec", "decimals", "getSafeSiteId", "response", "removeProperties", "obj", "props", "key", "siteList", "sites", "name", "id", "sanitizeAPICacheDir", "__cx", "config", "dirPath", "allCachedFiles", "filesByIdMap", "pageFilePaths", "fileName", "filePath", "fileObject", "fsx", "entity", "fullUrl", "fileCreationDate", "counter", "measureExecutionTime", "functions", "delayInMS", "start", "func", "seconds", "miliseconds", "pause", "title", "resolve", "boxLog", "doLifeCycle", "options", "steps", "bypass", "attemptsByLifeCycleName", "envs", "trysCount", "maxTrysAccepted", "chalk", "exeTime", "error", "errorString", "attemptsString", "createRenderMetadata", "domain", "generateBuildReport", "generateSitemaps", "writeRobots", "removeAllSiteDirsFromStore", "__cx", "config", "storeDir", "path", "allSiteDirsFullPath", "fs", "dirname", "name", "site", "dotenv", "config", "getConfig", "getGatsbyAssetPrefixWithDomain", "domain", "proDomain", "assetPrefix", "assetPrefixWithDomain", "verboseLog", "runGatsbyBuildCommand", "__ssg", "command", "legacy__createDistFromGatsbyPublic", "needsAssetPrefix", "__cx", "cxDistDir", "path", "cxAssetsDir", "cxDistDirWithDomain", "publicDir", "validFilesFromPublic", "fsx", "file", "pageDataSrc", "pageDataDest", "projectStaticSrc", "projectStaticDest", "gatsbyStaticSrc", "gatsbyStaticDest", "fileSrc", "fileDest", "err", "import_node_path", "getCxArtifacts", "paths", "__cx", "__exports", "__caches", "path", "cx_default", "import_node_path", "gatsbyArtifacts", "paths", "__ssg", "path", "gatsby_default", "getArtifacts", "adapter", "options", "cxPaths", "ssgArtifacts", "gatsby_default", "cx_default", "import_axios", "insertAlert", "area", "description", "fullData", "instantNotification", "level", "url", "endpoints", "body", "axios", "error", "import_node_fs", "import_node_path", "import_dotenv", "import_p_limit", "DistributorService", "data", "page", "order", "sources", "quantity", "mode", "fixed", "fullRelations", "allLanguages", "preferenceLanguage", "referenceId", "props", "cacheKey", "boxLog", "site", "lang", "body", "getDistributorData", "template", "checkDistributors", "templateChunk", "level", "key", "component", "err", "NavigationService", "navigations", "footer", "prev", "language", "header", "list", "id", "result", "item", "version", "page", "pageHeader", "pageFooter", "templateType", "defaultHeader", "defaultFooter", "templates", "getValidNavigation", "values", "fineNavigation", "headerID", "footerID", "getAllSettings", "getApi", "endpoints", "import_dotenv", "formatImage", "image", "width", "height", "format", "url", "addCloudinaryParams", "addGriddoDamParams", "params", "urlParts", "imagePath", "imageName", "plainUrl", "head", "fullId", "dotenv", "DEFAULT_ITEMS_PER_PAGE_FOR_LIST_TEMPLATES", "getOpenGraph", "socialTitle", "socialDescription", "socialImage", "formatImage", "getPageMetaData", "params", "title", "metaTitle", "metaDescription", "canonicalURL", "locale", "url", "isIndexed", "follow", "metasAdvanced", "pageLanguages", "fullUrl", "metaKeywords", "metasAdvancedList", "item", "keyword", "createGriddoPageObject", "page", "additionalInfo", "id", "fullPath", "languageId", "breadcrumb", "baseUrl", "cloudinaryName", "griddoVersion", "siteLangs", "siteMetadata", "siteOptions", "siteScript", "siteSlug", "socials", "theme", "header", "footer", "pageMetadata", "openGraph", "pagePath", "renderDate", "createGriddoSinglePage", "createGriddoListPages", "pages", "isRoot", "defaultLang", "template", "totalQueriedItems", "allPages", "dataInPage", "idx", "isFirstPage", "pageNumber", "domainUrl", "compose", "paginatedPage", "addPageNumberToUrl", "addPageNumberToTitle", "createGriddoMultiPages", "multiPageElementsBulk", "cleanPage", "multiPageElements", "sectionSlug", "pageElement", "bulkTitle", "cleanSectionSlug", "rightSectionSlug", "slash", "newCompose", "getMultiPageElements", "resolve", "getMultiPageComponent", "level", "key", "currentComponent", "isValidComponent", "hasGriddoMultiPageProp", "component", "hasGriddoMultiPage", "elements", "getPage", "itemsPerPage", "items", "getPageCluster", "totalPagesCount", "_", "i", "getPaginatedPages", "listTemplate", "removeDuplicateTrailing", "options", "trailingSlash", "endingSlash", "config", "getConfig", "dotenv", "RENDER_ID", "createStore", "domain", "createStoreDir", "envs", "__cx", "griddoVersion", "storeDir", "path", "createdPages", "buildProcessData", "sitesToPublish", "sitesToUnpublish", "checkSites", "domainHasSites", "siteList", "unpublishSites", "site", "siteId", "siteSlug", "theme", "favicon", "changedPages", "siteInfo", "validPagesIds", "siteHash", "unpublishHashes", "siteLangs", "defaultLang", "headers", "footers", "socials", "getSiteData", "cloudinaryName", "useMetaTitle", "useMetaKeywords", "showBasicMetaRobots", "avoidHrefLangsOnCanonicals", "avoidSelfReferenceCanonicals", "avoidHrefLangXDefault", "avoidDebugMetas", "getAllSettings", "NavService", "NavigationService", "shouldUpdateSite", "updatedSiteHash", "siteScript", "siteMetadata", "additionalInfo", "infoLog", "fs", "fetchPageAndSaveInStore", "siteIdName", "pageId", "griddoPageObjects", "page", "getPage", "pageAdditionalInfo", "template", "DistributorService", "multiPageElements", "getMultiPageElements", "isStaticListPage", "isMultiPage", "isSinglePage", "griddoListPage", "getPaginatedPages", "createGriddoListPages", "griddoMultipage", "createGriddoMultiPages", "griddoSinglePage", "createGriddoSinglePage", "savePagesInStore", "pagesMissingInStore", "pagesToDeleteFromStore", "pagesToWriteToStore", "getPagesToCreateOrDelete", "removePagesFromStore", "limit", "pLimit", "pagesToStore", "id", "verboseLog", "saveRenderInfoInStore", "removeAllSiteDirsFromStore", "e", "createBuildData", "domain", "createAPICacheDir", "createStore", "sanitizeAPICacheDir", "import_node_fs", "import_node_path", "RenderError", "throwError", "error", "message", "expected", "hint", "errorMessage", "boxLog", "NoDomainsFoundError", "RenderUUIDError", "config", "getConfig", "createSentinelRenderFile", "__cx", "renderSentinelFile", "path", "fs", "deleteSentinelRenderFile", "isValidRenderProcessOrThrow", "throwError", "RenderUUIDError", "config", "getConfig", "renderDomain", "domain", "infoLog", "createSentinelRenderFile", "cxPaths", "domainArtifacts", "getArtifacts", "__ssg", "__exports", "__caches", "__cx", "__components", "arts", "assetPrefix", "getGatsbyAssetPrefixWithDomain", "needsAssetPrefix", "doLifeCycle", "removeArtifacts", "createArtifacts", "copyArtifacts", "renameArtifact", "path", "moveArtifacts", "createBuildData", "runGatsbyBuildCommand", "legacy__createDistFromGatsbyPublic", "createRenderMetadata", "removeVirtualPagesFromStore", "clearEmptyDirs", "isValidRenderProcessOrThrow", "deleteSentinelRenderFile", "runGatsbyAdapter", "domains", "printExporterLogo", "envs", "api_default", "registerContent", "debugLog", "insertAlert", "DomainsService", "getApi", "endpoints", "getInstanceDomainsOrThrow", "authService", "domains", "DomainsService", "throwError", "NoDomainsFoundError", "verboseLog", "getDomainSlugs", "getDomainSlugs", "domains", "filteredDomains", "slug", "startRender", "domains", "getInstanceDomainsOrThrow", "exeTime", "measureExecutionTime", "runGatsbyAdapter", "boxLog", "error"]
4
+ "sourcesContent": ["/* @flow */\n/*::\n\ntype DotenvParseOptions = {\n debug?: boolean\n}\n\n// keys and values from src\ntype DotenvParseOutput = { [string]: string }\n\ntype DotenvConfigOptions = {\n path?: string, // path to .env file\n encoding?: string, // encoding of .env file\n debug?: string // turn on logging for debugging purposes\n}\n\ntype DotenvConfigOutput = {\n parsed?: DotenvParseOutput,\n error?: Error\n}\n\n*/\n\nconst fs = require('fs')\nconst path = require('path')\n\nfunction log (message /*: string */) {\n console.log(`[dotenv][DEBUG] ${message}`)\n}\n\nconst NEWLINE = '\\n'\nconst RE_INI_KEY_VAL = /^\\s*([\\w.-]+)\\s*=\\s*(.*)?\\s*$/\nconst RE_NEWLINES = /\\\\n/g\nconst NEWLINES_MATCH = /\\n|\\r|\\r\\n/\n\n// Parses src into an Object\nfunction parse (src /*: string | Buffer */, options /*: ?DotenvParseOptions */) /*: DotenvParseOutput */ {\n const debug = Boolean(options && options.debug)\n const obj = {}\n\n // convert Buffers before splitting into lines and processing\n src.toString().split(NEWLINES_MATCH).forEach(function (line, idx) {\n // matching \"KEY' and 'VAL' in 'KEY=VAL'\n const keyValueArr = line.match(RE_INI_KEY_VAL)\n // matched?\n if (keyValueArr != null) {\n const key = keyValueArr[1]\n // default undefined or missing values to empty string\n let val = (keyValueArr[2] || '')\n const end = val.length - 1\n const isDoubleQuoted = val[0] === '\"' && val[end] === '\"'\n const isSingleQuoted = val[0] === \"'\" && val[end] === \"'\"\n\n // if single or double quoted, remove quotes\n if (isSingleQuoted || isDoubleQuoted) {\n val = val.substring(1, end)\n\n // if double quoted, expand newlines\n if (isDoubleQuoted) {\n val = val.replace(RE_NEWLINES, NEWLINE)\n }\n } else {\n // remove surrounding whitespace\n val = val.trim()\n }\n\n obj[key] = val\n } else if (debug) {\n log(`did not match key and value when parsing line ${idx + 1}: ${line}`)\n }\n })\n\n return obj\n}\n\n// Populates process.env from .env file\nfunction config (options /*: ?DotenvConfigOptions */) /*: DotenvConfigOutput */ {\n let dotenvPath = path.resolve(process.cwd(), '.env')\n let encoding /*: string */ = 'utf8'\n let debug = false\n\n if (options) {\n if (options.path != null) {\n dotenvPath = options.path\n }\n if (options.encoding != null) {\n encoding = options.encoding\n }\n if (options.debug != null) {\n debug = true\n }\n }\n\n try {\n // specifying an encoding returns a string instead of a buffer\n const parsed = parse(fs.readFileSync(dotenvPath, { encoding }), { debug })\n\n Object.keys(parsed).forEach(function (key) {\n if (!Object.prototype.hasOwnProperty.call(process.env, key)) {\n process.env[key] = parsed[key]\n } else if (debug) {\n log(`\"${key}\" is already defined in \\`process.env\\` and will not be overwritten`)\n }\n })\n\n return { parsed }\n } catch (e) {\n return { error: e }\n }\n}\n\nmodule.exports.config = config\nmodule.exports.parse = parse\n", "'use strict'\n\nexports.fromCallback = function (fn) {\n return Object.defineProperty(function (...args) {\n if (typeof args[args.length - 1] === 'function') fn.apply(this, args)\n else {\n return new Promise((resolve, reject) => {\n fn.call(\n this,\n ...args,\n (err, res) => (err != null) ? reject(err) : resolve(res)\n )\n })\n }\n }, 'name', { value: fn.name })\n}\n\nexports.fromPromise = function (fn) {\n return Object.defineProperty(function (...args) {\n const cb = args[args.length - 1]\n if (typeof cb !== 'function') return fn.apply(this, args)\n else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb)\n }, 'name', { value: fn.name })\n}\n", "var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (fs.chmod && !fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (fs.chown && !fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = typeof fs.rename !== 'function' ? fs.rename\n : (function (fs$rename) {\n function rename (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)\n return rename\n })(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = typeof fs.read !== 'function' ? fs.read\n : (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync\n : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\") && fs.futimes) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else if (fs.futimes) {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n", "var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n", "'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n", "var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n resetQueue()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n resetQueue()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb, startTime) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb, startTime) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb, startTime) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return go$copyFile(src, dest, flags, cb)\n\n function go$copyFile (src, dest, flags, cb, startTime) {\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n var noReaddirOptionVersions = /^v[0-5]\\./\n function readdir (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n var go$readdir = noReaddirOptionVersions.test(process.version)\n ? function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n : function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, options, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n\n return go$readdir(path, options, cb)\n\n function fs$readdirCallback (path, options, cb, startTime) {\n return function (err, files) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([\n go$readdir,\n [path, options, cb],\n err,\n startTime || Date.now(),\n Date.now()\n ])\n else {\n if (files && files.sort)\n files.sort()\n\n if (typeof cb === 'function')\n cb.call(this, err, files)\n }\n }\n }\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb, startTime) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n retry()\n}\n\n// keep track of the timeout between retry() calls\nvar retryTimer\n\n// reset the startTime and lastTime to now\n// this resets the start of the 60 second overall timeout as well as the\n// delay between attempts so that we'll retry these jobs sooner\nfunction resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}\n\nfunction retry () {\n // clear the timer and remove it to help prevent unintended concurrency\n clearTimeout(retryTimer)\n retryTimer = undefined\n\n if (fs[gracefulQueue].length === 0)\n return\n\n var elem = fs[gracefulQueue].shift()\n var fn = elem[0]\n var args = elem[1]\n // these items may be unset if they were added by an older graceful-fs\n var err = elem[2]\n var startTime = elem[3]\n var lastTime = elem[4]\n\n // if we don't have a startTime we have no way of knowing if we've waited\n // long enough, so go ahead and retry this item now\n if (startTime === undefined) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args)\n } else if (Date.now() - startTime >= 60000) {\n // it's been more than 60 seconds total, bail now\n debug('TIMEOUT', fn.name, args)\n var cb = args.pop()\n if (typeof cb === 'function')\n cb.call(null, err)\n } else {\n // the amount of time between the last attempt and right now\n var sinceAttempt = Date.now() - lastTime\n // the amount of time between when we first tried, and when we last tried\n // rounded up to at least 1\n var sinceStart = Math.max(lastTime - startTime, 1)\n // backoff. wait longer than the total time we've been retrying, but only\n // up to a maximum of 100ms\n var desiredDelay = Math.min(sinceStart * 1.2, 100)\n // it's been long enough since the last retry, do it again\n if (sinceAttempt >= desiredDelay) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args.concat([startTime]))\n } else {\n // if we can't do this job yet, push it to the end of the queue\n // and let the next iteration check again\n fs[gracefulQueue].push(elem)\n }\n }\n\n // schedule our next run if one isn't already scheduled\n if (retryTimer === undefined) {\n retryTimer = setTimeout(retry, 0)\n }\n}\n", "'use strict'\n// This is adapted from https://github.com/normalize/mz\n// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\n\nconst api = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'close',\n 'copyFile',\n 'fchmod',\n 'fchown',\n 'fdatasync',\n 'fstat',\n 'fsync',\n 'ftruncate',\n 'futimes',\n 'lchmod',\n 'lchown',\n 'link',\n 'lstat',\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir',\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'rename',\n 'rm',\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile'\n].filter(key => {\n // Some commands are not available on some systems. Ex:\n // fs.opendir was added in Node.js v12.12.0\n // fs.rm was added in Node.js v14.14.0\n // fs.lchown is not available on at least some Linux\n return typeof fs[key] === 'function'\n})\n\n// Export all keys:\nObject.keys(fs).forEach(key => {\n if (key === 'promises') {\n // fs.promises is a getter property that triggers ExperimentalWarning\n // Don't re-export it here, the getter is defined in \"lib/index.js\"\n return\n }\n exports[key] = fs[key]\n})\n\n// Universalify async methods:\napi.forEach(method => {\n exports[method] = u(fs[method])\n})\n\n// We differ from mz/fs in that we still ship the old, broken, fs.exists()\n// since we are a drop-in replacement for the native module\nexports.exists = function (filename, callback) {\n if (typeof callback === 'function') {\n return fs.exists(filename, callback)\n }\n return new Promise(resolve => {\n return fs.exists(filename, resolve)\n })\n}\n\n// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args\n\nexports.read = function (fd, buffer, offset, length, position, callback) {\n if (typeof callback === 'function') {\n return fs.read(fd, buffer, offset, length, position, callback)\n }\n return new Promise((resolve, reject) => {\n fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {\n if (err) return reject(err)\n resolve({ bytesRead, buffer })\n })\n })\n}\n\n// Function signature can be\n// fs.write(fd, buffer[, offset[, length[, position]]], callback)\n// OR\n// fs.write(fd, string[, position[, encoding]], callback)\n// We need to handle both cases, so we use ...args\nexports.write = function (fd, buffer, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.write(fd, buffer, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffer })\n })\n })\n}\n\n// fs.writev only available in Node v12.9.0+\nif (typeof fs.writev === 'function') {\n // Function signature is\n // s.writev(fd, buffers[, position], callback)\n // We need to handle the optional arg, so we use ...args\n exports.writev = function (fd, buffers, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.writev(fd, buffers, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffers })\n })\n })\n }\n}\n\n// fs.realpath.native only available in Node v9.2+\nif (typeof fs.realpath.native === 'function') {\n exports.realpath.native = u(fs.realpath.native)\n}\n", "module.exports = r => {\n const n = process.versions.node.split('.').map(x => parseInt(x, 10))\n r = r.split('.').map(x => parseInt(x, 10))\n return n[0] > r[0] || (n[0] === r[0] && (n[1] > r[1] || (n[1] === r[1] && n[2] >= r[2])))\n}\n", "// Adapted from https://github.com/sindresorhus/make-dir\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)\n// 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:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// 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.\n'use strict'\nconst fs = require('../fs')\nconst path = require('path')\nconst atLeastNode = require('at-least-node')\n\nconst useNativeRecursiveOption = atLeastNode('10.12.0')\n\n// https://github.com/nodejs/node/issues/8987\n// https://github.com/libuv/libuv/pull/1088\nconst checkPath = pth => {\n if (process.platform === 'win32') {\n const pathHasInvalidWinCharacters = /[<>:\"|?*]/.test(pth.replace(path.parse(pth).root, ''))\n\n if (pathHasInvalidWinCharacters) {\n const error = new Error(`Path contains invalid characters: ${pth}`)\n error.code = 'EINVAL'\n throw error\n }\n }\n}\n\nconst processOptions = options => {\n const defaults = { mode: 0o777 }\n if (typeof options === 'number') options = { mode: options }\n return { ...defaults, ...options }\n}\n\nconst permissionError = pth => {\n // This replicates the exception of `fs.mkdir` with native the\n // `recusive` option when run on an invalid drive under Windows.\n const error = new Error(`operation not permitted, mkdir '${pth}'`)\n error.code = 'EPERM'\n error.errno = -4048\n error.path = pth\n error.syscall = 'mkdir'\n return error\n}\n\nmodule.exports.makeDir = async (input, options) => {\n checkPath(input)\n options = processOptions(options)\n\n if (useNativeRecursiveOption) {\n const pth = path.resolve(input)\n\n return fs.mkdir(pth, {\n mode: options.mode,\n recursive: true\n })\n }\n\n const make = async pth => {\n try {\n await fs.mkdir(pth, options.mode)\n } catch (error) {\n if (error.code === 'EPERM') {\n throw error\n }\n\n if (error.code === 'ENOENT') {\n if (path.dirname(pth) === pth) {\n throw permissionError(pth)\n }\n\n if (error.message.includes('null bytes')) {\n throw error\n }\n\n await make(path.dirname(pth))\n return make(pth)\n }\n\n try {\n const stats = await fs.stat(pth)\n if (!stats.isDirectory()) {\n // This error is never exposed to the user\n // it is caught below, and the original error is thrown\n throw new Error('The path is not a directory')\n }\n } catch {\n throw error\n }\n }\n }\n\n return make(path.resolve(input))\n}\n\nmodule.exports.makeDirSync = (input, options) => {\n checkPath(input)\n options = processOptions(options)\n\n if (useNativeRecursiveOption) {\n const pth = path.resolve(input)\n\n return fs.mkdirSync(pth, {\n mode: options.mode,\n recursive: true\n })\n }\n\n const make = pth => {\n try {\n fs.mkdirSync(pth, options.mode)\n } catch (error) {\n if (error.code === 'EPERM') {\n throw error\n }\n\n if (error.code === 'ENOENT') {\n if (path.dirname(pth) === pth) {\n throw permissionError(pth)\n }\n\n if (error.message.includes('null bytes')) {\n throw error\n }\n\n make(path.dirname(pth))\n return make(pth)\n }\n\n try {\n if (!fs.statSync(pth).isDirectory()) {\n // This error is never exposed to the user\n // it is caught below, and the original error is thrown\n throw new Error('The path is not a directory')\n }\n } catch {\n throw error\n }\n }\n }\n\n return make(path.resolve(input))\n}\n", "'use strict'\nconst u = require('universalify').fromPromise\nconst { makeDir: _makeDir, makeDirSync } = require('./make-dir')\nconst makeDir = u(_makeDir)\n\nmodule.exports = {\n mkdirs: makeDir,\n mkdirsSync: makeDirSync,\n // alias\n mkdirp: makeDir,\n mkdirpSync: makeDirSync,\n ensureDir: makeDir,\n ensureDirSync: makeDirSync\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\n\nfunction utimesMillis (path, atime, mtime, callback) {\n // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)\n fs.open(path, 'r+', (err, fd) => {\n if (err) return callback(err)\n fs.futimes(fd, atime, mtime, futimesErr => {\n fs.close(fd, closeErr => {\n if (callback) callback(futimesErr || closeErr)\n })\n })\n })\n}\n\nfunction utimesMillisSync (path, atime, mtime) {\n const fd = fs.openSync(path, 'r+')\n fs.futimesSync(fd, atime, mtime)\n return fs.closeSync(fd)\n}\n\nmodule.exports = {\n utimesMillis,\n utimesMillisSync\n}\n", "'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst util = require('util')\nconst atLeastNode = require('at-least-node')\n\nconst nodeSupportsBigInt = atLeastNode('10.5.0')\nconst stat = (file) => nodeSupportsBigInt ? fs.stat(file, { bigint: true }) : fs.stat(file)\nconst statSync = (file) => nodeSupportsBigInt ? fs.statSync(file, { bigint: true }) : fs.statSync(file)\n\nfunction getStats (src, dest) {\n return Promise.all([\n stat(src),\n stat(dest).catch(err => {\n if (err.code === 'ENOENT') return null\n throw err\n })\n ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))\n}\n\nfunction getStatsSync (src, dest) {\n let destStat\n const srcStat = statSync(src)\n try {\n destStat = statSync(dest)\n } catch (err) {\n if (err.code === 'ENOENT') return { srcStat, destStat: null }\n throw err\n }\n return { srcStat, destStat }\n}\n\nfunction checkPaths (src, dest, funcName, cb) {\n util.callbackify(getStats)(src, dest, (err, stats) => {\n if (err) return cb(err)\n const { srcStat, destStat } = stats\n if (destStat && areIdentical(srcStat, destStat)) {\n return cb(new Error('Source and destination must not be the same.'))\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return cb(null, { srcStat, destStat })\n })\n}\n\nfunction checkPathsSync (src, dest, funcName) {\n const { srcStat, destStat } = getStatsSync(src, dest)\n if (destStat && areIdentical(srcStat, destStat)) {\n throw new Error('Source and destination must not be the same.')\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return { srcStat, destStat }\n}\n\n// recursively check if dest parent is a subdirectory of src.\n// It works for all file types including symlinks since it\n// checks the src and dest inodes. It starts from the deepest\n// parent and stops once it reaches the src parent or the root path.\nfunction checkParentPaths (src, srcStat, dest, funcName, cb) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()\n const callback = (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (areIdentical(srcStat, destStat)) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n }\n if (nodeSupportsBigInt) fs.stat(destParent, { bigint: true }, callback)\n else fs.stat(destParent, callback)\n}\n\nfunction checkParentPathsSync (src, srcStat, dest, funcName) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return\n let destStat\n try {\n destStat = statSync(destParent)\n } catch (err) {\n if (err.code === 'ENOENT') return\n throw err\n }\n if (areIdentical(srcStat, destStat)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return checkParentPathsSync(src, srcStat, destParent, funcName)\n}\n\nfunction areIdentical (srcStat, destStat) {\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n if (nodeSupportsBigInt || destStat.ino < Number.MAX_SAFE_INTEGER) {\n // definitive answer\n return true\n }\n // Use additional heuristics if we can't use 'bigint'.\n // Different 'ino' could be represented the same if they are >= Number.MAX_SAFE_INTEGER\n // See issue 657\n if (destStat.size === srcStat.size &&\n destStat.mode === srcStat.mode &&\n destStat.nlink === srcStat.nlink &&\n destStat.atimeMs === srcStat.atimeMs &&\n destStat.mtimeMs === srcStat.mtimeMs &&\n destStat.ctimeMs === srcStat.ctimeMs &&\n destStat.birthtimeMs === srcStat.birthtimeMs) {\n // heuristic answer\n return true\n }\n }\n return false\n}\n\n// return true if dest is a subdir of src, otherwise false.\n// It only checks the path strings.\nfunction isSrcSubdir (src, dest) {\n const srcArr = path.resolve(src).split(path.sep).filter(i => i)\n const destArr = path.resolve(dest).split(path.sep).filter(i => i)\n return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true)\n}\n\nfunction errMsg (src, dest, funcName) {\n return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`\n}\n\nmodule.exports = {\n checkPaths,\n checkPathsSync,\n checkParentPaths,\n checkParentPathsSync,\n isSrcSubdir\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirsSync = require('../mkdirs').mkdirsSync\nconst utimesMillisSync = require('../util/utimes').utimesMillisSync\nconst stat = require('../util/stat')\n\nfunction copySync (src, dest, opts) {\n if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n opts = opts || {}\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)\n }\n\n const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy')\n stat.checkParentPathsSync(src, srcStat, dest, 'copy')\n return handleFilterAndCopy(destStat, src, dest, opts)\n}\n\nfunction handleFilterAndCopy (destStat, src, dest, opts) {\n if (opts.filter && !opts.filter(src, dest)) return\n const destParent = path.dirname(dest)\n if (!fs.existsSync(destParent)) mkdirsSync(destParent)\n return startCopy(destStat, src, dest, opts)\n}\n\nfunction startCopy (destStat, src, dest, opts) {\n if (opts.filter && !opts.filter(src, dest)) return\n return getStats(destStat, src, dest, opts)\n}\n\nfunction getStats (destStat, src, dest, opts) {\n const statSync = opts.dereference ? fs.statSync : fs.lstatSync\n const srcStat = statSync(src)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts) {\n if (!destStat) return copyFile(srcStat, src, dest, opts)\n return mayCopyFile(srcStat, src, dest, opts)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts) {\n if (opts.overwrite) {\n fs.unlinkSync(dest)\n return copyFile(srcStat, src, dest, opts)\n } else if (opts.errorOnExist) {\n throw new Error(`'${dest}' already exists`)\n }\n}\n\nfunction copyFile (srcStat, src, dest, opts) {\n fs.copyFileSync(src, dest)\n if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)\n return setDestMode(dest, srcStat.mode)\n}\n\nfunction handleTimestamps (srcMode, src, dest) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)\n return setDestTimestamps(src, dest)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode) {\n return setDestMode(dest, srcMode | 0o200)\n}\n\nfunction setDestMode (dest, srcMode) {\n return fs.chmodSync(dest, srcMode)\n}\n\nfunction setDestTimestamps (src, dest) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n const updatedSrcStat = fs.statSync(src)\n return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)\n if (destStat && !destStat.isDirectory()) {\n throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)\n }\n return copyDir(src, dest, opts)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts) {\n fs.mkdirSync(dest)\n copyDir(src, dest, opts)\n return setDestMode(dest, srcMode)\n}\n\nfunction copyDir (src, dest, opts) {\n fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts))\n}\n\nfunction copyDirItem (item, src, dest, opts) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy')\n return startCopy(destStat, srcItem, destItem, opts)\n}\n\nfunction onLink (destStat, src, dest, opts) {\n let resolvedSrc = fs.readlinkSync(src)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlinkSync(resolvedSrc, dest)\n } else {\n let resolvedDest\n try {\n resolvedDest = fs.readlinkSync(dest)\n } catch (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)\n throw err\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)\n }\n\n // prevent copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)\n }\n return copyLink(resolvedSrc, dest)\n }\n}\n\nfunction copyLink (resolvedSrc, dest) {\n fs.unlinkSync(dest)\n return fs.symlinkSync(resolvedSrc, dest)\n}\n\nmodule.exports = copySync\n", "'use strict'\n\nmodule.exports = {\n copySync: require('./copy-sync')\n}\n", "'use strict'\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\n\nfunction pathExists (path) {\n return fs.access(path).then(() => true).catch(() => false)\n}\n\nmodule.exports = {\n pathExists: u(pathExists),\n pathExistsSync: fs.existsSync\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirs = require('../mkdirs').mkdirs\nconst pathExists = require('../path-exists').pathExists\nconst utimesMillis = require('../util/utimes').utimesMillis\nconst stat = require('../util/stat')\n\nfunction copy (src, dest, opts, cb) {\n if (typeof opts === 'function' && !cb) {\n cb = opts\n opts = {}\n } else if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n cb = cb || function () {}\n opts = opts || {}\n\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)\n }\n\n stat.checkPaths(src, dest, 'copy', (err, stats) => {\n if (err) return cb(err)\n const { srcStat, destStat } = stats\n stat.checkParentPaths(src, srcStat, dest, 'copy', err => {\n if (err) return cb(err)\n if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb)\n return checkParentDir(destStat, src, dest, opts, cb)\n })\n })\n}\n\nfunction checkParentDir (destStat, src, dest, opts, cb) {\n const destParent = path.dirname(dest)\n pathExists(destParent, (err, dirExists) => {\n if (err) return cb(err)\n if (dirExists) return startCopy(destStat, src, dest, opts, cb)\n mkdirs(destParent, err => {\n if (err) return cb(err)\n return startCopy(destStat, src, dest, opts, cb)\n })\n })\n}\n\nfunction handleFilter (onInclude, destStat, src, dest, opts, cb) {\n Promise.resolve(opts.filter(src, dest)).then(include => {\n if (include) return onInclude(destStat, src, dest, opts, cb)\n return cb()\n }, error => cb(error))\n}\n\nfunction startCopy (destStat, src, dest, opts, cb) {\n if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb)\n return getStats(destStat, src, dest, opts, cb)\n}\n\nfunction getStats (destStat, src, dest, opts, cb) {\n const stat = opts.dereference ? fs.stat : fs.lstat\n stat(src, (err, srcStat) => {\n if (err) return cb(err)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb)\n })\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts, cb) {\n if (!destStat) return copyFile(srcStat, src, dest, opts, cb)\n return mayCopyFile(srcStat, src, dest, opts, cb)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts, cb) {\n if (opts.overwrite) {\n fs.unlink(dest, err => {\n if (err) return cb(err)\n return copyFile(srcStat, src, dest, opts, cb)\n })\n } else if (opts.errorOnExist) {\n return cb(new Error(`'${dest}' already exists`))\n } else return cb()\n}\n\nfunction copyFile (srcStat, src, dest, opts, cb) {\n fs.copyFile(src, dest, err => {\n if (err) return cb(err)\n if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb)\n return setDestMode(dest, srcStat.mode, cb)\n })\n}\n\nfunction handleTimestampsAndMode (srcMode, src, dest, cb) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) {\n return makeFileWritable(dest, srcMode, err => {\n if (err) return cb(err)\n return setDestTimestampsAndMode(srcMode, src, dest, cb)\n })\n }\n return setDestTimestampsAndMode(srcMode, src, dest, cb)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode, cb) {\n return setDestMode(dest, srcMode | 0o200, cb)\n}\n\nfunction setDestTimestampsAndMode (srcMode, src, dest, cb) {\n setDestTimestamps(src, dest, err => {\n if (err) return cb(err)\n return setDestMode(dest, srcMode, cb)\n })\n}\n\nfunction setDestMode (dest, srcMode, cb) {\n return fs.chmod(dest, srcMode, cb)\n}\n\nfunction setDestTimestamps (src, dest, cb) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n fs.stat(src, (err, updatedSrcStat) => {\n if (err) return cb(err)\n return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb)\n })\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts, cb) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb)\n if (destStat && !destStat.isDirectory()) {\n return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`))\n }\n return copyDir(src, dest, opts, cb)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts, cb) {\n fs.mkdir(dest, err => {\n if (err) return cb(err)\n copyDir(src, dest, opts, err => {\n if (err) return cb(err)\n return setDestMode(dest, srcMode, cb)\n })\n })\n}\n\nfunction copyDir (src, dest, opts, cb) {\n fs.readdir(src, (err, items) => {\n if (err) return cb(err)\n return copyDirItems(items, src, dest, opts, cb)\n })\n}\n\nfunction copyDirItems (items, src, dest, opts, cb) {\n const item = items.pop()\n if (!item) return cb()\n return copyDirItem(items, item, src, dest, opts, cb)\n}\n\nfunction copyDirItem (items, item, src, dest, opts, cb) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n stat.checkPaths(srcItem, destItem, 'copy', (err, stats) => {\n if (err) return cb(err)\n const { destStat } = stats\n startCopy(destStat, srcItem, destItem, opts, err => {\n if (err) return cb(err)\n return copyDirItems(items, src, dest, opts, cb)\n })\n })\n}\n\nfunction onLink (destStat, src, dest, opts, cb) {\n fs.readlink(src, (err, resolvedSrc) => {\n if (err) return cb(err)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlink(resolvedSrc, dest, cb)\n } else {\n fs.readlink(dest, (err, resolvedDest) => {\n if (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb)\n return cb(err)\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`))\n }\n\n // do not copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`))\n }\n return copyLink(resolvedSrc, dest, cb)\n })\n }\n })\n}\n\nfunction copyLink (resolvedSrc, dest, cb) {\n fs.unlink(dest, err => {\n if (err) return cb(err)\n return fs.symlink(resolvedSrc, dest, cb)\n })\n}\n\nmodule.exports = copy\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nmodule.exports = {\n copy: u(require('./copy'))\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst assert = require('assert')\n\nconst isWindows = (process.platform === 'win32')\n\nfunction defaults (options) {\n const methods = [\n 'unlink',\n 'chmod',\n 'stat',\n 'lstat',\n 'rmdir',\n 'readdir'\n ]\n methods.forEach(m => {\n options[m] = options[m] || fs[m]\n m = m + 'Sync'\n options[m] = options[m] || fs[m]\n })\n\n options.maxBusyTries = options.maxBusyTries || 3\n}\n\nfunction rimraf (p, options, cb) {\n let busyTries = 0\n\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n assert(p, 'rimraf: missing path')\n assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')\n assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required')\n assert(options, 'rimraf: invalid options argument provided')\n assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')\n\n defaults(options)\n\n rimraf_(p, options, function CB (er) {\n if (er) {\n if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') &&\n busyTries < options.maxBusyTries) {\n busyTries++\n const time = busyTries * 100\n // try again, with the same exact callback as this one.\n return setTimeout(() => rimraf_(p, options, CB), time)\n }\n\n // already gone\n if (er.code === 'ENOENT') er = null\n }\n\n cb(er)\n })\n}\n\n// Two possible strategies.\n// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR\n// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR\n//\n// Both result in an extra syscall when you guess wrong. However, there\n// are likely far more normal files in the world than directories. This\n// is based on the assumption that a the average number of files per\n// directory is >= 1.\n//\n// If anyone ever complains about this, then I guess the strategy could\n// be made configurable somehow. But until then, YAGNI.\nfunction rimraf_ (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // sunos lets the root user unlink directories, which is... weird.\n // so we have to lstat here and make sure it's not a dir.\n options.lstat(p, (er, st) => {\n if (er && er.code === 'ENOENT') {\n return cb(null)\n }\n\n // Windows can EPERM on stat. Life is suffering.\n if (er && er.code === 'EPERM' && isWindows) {\n return fixWinEPERM(p, options, er, cb)\n }\n\n if (st && st.isDirectory()) {\n return rmdir(p, options, er, cb)\n }\n\n options.unlink(p, er => {\n if (er) {\n if (er.code === 'ENOENT') {\n return cb(null)\n }\n if (er.code === 'EPERM') {\n return (isWindows)\n ? fixWinEPERM(p, options, er, cb)\n : rmdir(p, options, er, cb)\n }\n if (er.code === 'EISDIR') {\n return rmdir(p, options, er, cb)\n }\n }\n return cb(er)\n })\n })\n}\n\nfunction fixWinEPERM (p, options, er, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.chmod(p, 0o666, er2 => {\n if (er2) {\n cb(er2.code === 'ENOENT' ? null : er)\n } else {\n options.stat(p, (er3, stats) => {\n if (er3) {\n cb(er3.code === 'ENOENT' ? null : er)\n } else if (stats.isDirectory()) {\n rmdir(p, options, er, cb)\n } else {\n options.unlink(p, cb)\n }\n })\n }\n })\n}\n\nfunction fixWinEPERMSync (p, options, er) {\n let stats\n\n assert(p)\n assert(options)\n\n try {\n options.chmodSync(p, 0o666)\n } catch (er2) {\n if (er2.code === 'ENOENT') {\n return\n } else {\n throw er\n }\n }\n\n try {\n stats = options.statSync(p)\n } catch (er3) {\n if (er3.code === 'ENOENT') {\n return\n } else {\n throw er\n }\n }\n\n if (stats.isDirectory()) {\n rmdirSync(p, options, er)\n } else {\n options.unlinkSync(p)\n }\n}\n\nfunction rmdir (p, options, originalEr, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)\n // if we guessed wrong, and it's not a directory, then\n // raise the original error.\n options.rmdir(p, er => {\n if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) {\n rmkids(p, options, cb)\n } else if (er && er.code === 'ENOTDIR') {\n cb(originalEr)\n } else {\n cb(er)\n }\n })\n}\n\nfunction rmkids (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.readdir(p, (er, files) => {\n if (er) return cb(er)\n\n let n = files.length\n let errState\n\n if (n === 0) return options.rmdir(p, cb)\n\n files.forEach(f => {\n rimraf(path.join(p, f), options, er => {\n if (errState) {\n return\n }\n if (er) return cb(errState = er)\n if (--n === 0) {\n options.rmdir(p, cb)\n }\n })\n })\n })\n}\n\n// this looks simpler, and is strictly *faster*, but will\n// tie up the JavaScript thread and fail on excessively\n// deep directory trees.\nfunction rimrafSync (p, options) {\n let st\n\n options = options || {}\n defaults(options)\n\n assert(p, 'rimraf: missing path')\n assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')\n assert(options, 'rimraf: missing options')\n assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')\n\n try {\n st = options.lstatSync(p)\n } catch (er) {\n if (er.code === 'ENOENT') {\n return\n }\n\n // Windows can EPERM on stat. Life is suffering.\n if (er.code === 'EPERM' && isWindows) {\n fixWinEPERMSync(p, options, er)\n }\n }\n\n try {\n // sunos lets the root user unlink directories, which is... weird.\n if (st && st.isDirectory()) {\n rmdirSync(p, options, null)\n } else {\n options.unlinkSync(p)\n }\n } catch (er) {\n if (er.code === 'ENOENT') {\n return\n } else if (er.code === 'EPERM') {\n return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)\n } else if (er.code !== 'EISDIR') {\n throw er\n }\n rmdirSync(p, options, er)\n }\n}\n\nfunction rmdirSync (p, options, originalEr) {\n assert(p)\n assert(options)\n\n try {\n options.rmdirSync(p)\n } catch (er) {\n if (er.code === 'ENOTDIR') {\n throw originalEr\n } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') {\n rmkidsSync(p, options)\n } else if (er.code !== 'ENOENT') {\n throw er\n }\n }\n}\n\nfunction rmkidsSync (p, options) {\n assert(p)\n assert(options)\n options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))\n\n if (isWindows) {\n // We only end up here once we got ENOTEMPTY at least once, and\n // at this point, we are guaranteed to have removed all the kids.\n // So, we know that it won't be ENOENT or ENOTDIR or anything else.\n // try really hard to delete stuff on windows, because it has a\n // PROFOUNDLY annoying habit of not closing handles promptly when\n // files are deleted, resulting in spurious ENOTEMPTY errors.\n const startTime = Date.now()\n do {\n try {\n const ret = options.rmdirSync(p, options)\n return ret\n } catch {}\n } while (Date.now() - startTime < 500) // give up after 500ms\n } else {\n const ret = options.rmdirSync(p, options)\n return ret\n }\n}\n\nmodule.exports = rimraf\nrimraf.sync = rimrafSync\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst rimraf = require('./rimraf')\n\nmodule.exports = {\n remove: u(rimraf),\n removeSync: rimraf.sync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst remove = require('../remove')\n\nconst emptyDir = u(function emptyDir (dir, callback) {\n callback = callback || function () {}\n fs.readdir(dir, (err, items) => {\n if (err) return mkdir.mkdirs(dir, callback)\n\n items = items.map(item => path.join(dir, item))\n\n deleteItem()\n\n function deleteItem () {\n const item = items.pop()\n if (!item) return callback()\n remove.remove(item, err => {\n if (err) return callback(err)\n deleteItem()\n })\n }\n })\n})\n\nfunction emptyDirSync (dir) {\n let items\n try {\n items = fs.readdirSync(dir)\n } catch {\n return mkdir.mkdirsSync(dir)\n }\n\n items.forEach(item => {\n item = path.join(dir, item)\n remove.removeSync(item)\n })\n}\n\nmodule.exports = {\n emptyDirSync,\n emptydirSync: emptyDirSync,\n emptyDir,\n emptydir: emptyDir\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst mkdir = require('../mkdirs')\n\nfunction createFile (file, callback) {\n function makeFile () {\n fs.writeFile(file, '', err => {\n if (err) return callback(err)\n callback()\n })\n }\n\n fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err\n if (!err && stats.isFile()) return callback()\n const dir = path.dirname(file)\n fs.stat(dir, (err, stats) => {\n if (err) {\n // if the directory doesn't exist, make it\n if (err.code === 'ENOENT') {\n return mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n makeFile()\n })\n }\n return callback(err)\n }\n\n if (stats.isDirectory()) makeFile()\n else {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdir(dir, err => {\n if (err) return callback(err)\n })\n }\n })\n })\n}\n\nfunction createFileSync (file) {\n let stats\n try {\n stats = fs.statSync(file)\n } catch {}\n if (stats && stats.isFile()) return\n\n const dir = path.dirname(file)\n try {\n if (!fs.statSync(dir).isDirectory()) {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdirSync(dir)\n }\n } catch (err) {\n // If the stat call above failed because the directory doesn't exist, create it\n if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)\n else throw err\n }\n\n fs.writeFileSync(file, '')\n}\n\nmodule.exports = {\n createFile: u(createFile),\n createFileSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nfunction createLink (srcpath, dstpath, callback) {\n function makeLink (srcpath, dstpath) {\n fs.link(srcpath, dstpath, err => {\n if (err) return callback(err)\n callback(null)\n })\n }\n\n pathExists(dstpath, (err, destinationExists) => {\n if (err) return callback(err)\n if (destinationExists) return callback(null)\n fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n return callback(err)\n }\n\n const dir = path.dirname(dstpath)\n pathExists(dir, (err, dirExists) => {\n if (err) return callback(err)\n if (dirExists) return makeLink(srcpath, dstpath)\n mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n makeLink(srcpath, dstpath)\n })\n })\n })\n })\n}\n\nfunction createLinkSync (srcpath, dstpath) {\n const destinationExists = fs.existsSync(dstpath)\n if (destinationExists) return undefined\n\n try {\n fs.lstatSync(srcpath)\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n throw err\n }\n\n const dir = path.dirname(dstpath)\n const dirExists = fs.existsSync(dir)\n if (dirExists) return fs.linkSync(srcpath, dstpath)\n mkdir.mkdirsSync(dir)\n\n return fs.linkSync(srcpath, dstpath)\n}\n\nmodule.exports = {\n createLink: u(createLink),\n createLinkSync\n}\n", "'use strict'\n\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst pathExists = require('../path-exists').pathExists\n\n/**\n * Function that returns two types of paths, one relative to symlink, and one\n * relative to the current working directory. Checks if path is absolute or\n * relative. If the path is relative, this function checks if the path is\n * relative to symlink or relative to current working directory. This is an\n * initiative to find a smarter `srcpath` to supply when building symlinks.\n * This allows you to determine which path to use out of one of three possible\n * types of source paths. The first is an absolute path. This is detected by\n * `path.isAbsolute()`. When an absolute path is provided, it is checked to\n * see if it exists. If it does it's used, if not an error is returned\n * (callback)/ thrown (sync). The other two options for `srcpath` are a\n * relative url. By default Node's `fs.symlink` works by creating a symlink\n * using `dstpath` and expects the `srcpath` to be relative to the newly\n * created symlink. If you provide a `srcpath` that does not exist on the file\n * system it results in a broken symlink. To minimize this, the function\n * checks to see if the 'relative to symlink' source file exists, and if it\n * does it will use it. If it does not, it checks if there's a file that\n * exists that is relative to the current working directory, if does its used.\n * This preserves the expectations of the original fs.symlink spec and adds\n * the ability to pass in `relative to current working direcotry` paths.\n */\n\nfunction symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n toCwd: relativeToDst,\n toDst: srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}\n\nfunction symlinkPathsSync (srcpath, dstpath) {\n let exists\n if (path.isAbsolute(srcpath)) {\n exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('absolute srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: srcpath\n }\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n exists = fs.existsSync(relativeToDst)\n if (exists) {\n return {\n toCwd: relativeToDst,\n toDst: srcpath\n }\n } else {\n exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('relative srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n }\n }\n }\n}\n\nmodule.exports = {\n symlinkPaths,\n symlinkPathsSync\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\n\nfunction symlinkType (srcpath, type, callback) {\n callback = (typeof type === 'function') ? type : callback\n type = (typeof type === 'function') ? false : type\n if (type) return callback(null, type)\n fs.lstat(srcpath, (err, stats) => {\n if (err) return callback(null, 'file')\n type = (stats && stats.isDirectory()) ? 'dir' : 'file'\n callback(null, type)\n })\n}\n\nfunction symlinkTypeSync (srcpath, type) {\n let stats\n\n if (type) return type\n try {\n stats = fs.lstatSync(srcpath)\n } catch {\n return 'file'\n }\n return (stats && stats.isDirectory()) ? 'dir' : 'file'\n}\n\nmodule.exports = {\n symlinkType,\n symlinkTypeSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst _mkdirs = require('../mkdirs')\nconst mkdirs = _mkdirs.mkdirs\nconst mkdirsSync = _mkdirs.mkdirsSync\n\nconst _symlinkPaths = require('./symlink-paths')\nconst symlinkPaths = _symlinkPaths.symlinkPaths\nconst symlinkPathsSync = _symlinkPaths.symlinkPathsSync\n\nconst _symlinkType = require('./symlink-type')\nconst symlinkType = _symlinkType.symlinkType\nconst symlinkTypeSync = _symlinkType.symlinkTypeSync\n\nconst pathExists = require('../path-exists').pathExists\n\nfunction createSymlink (srcpath, dstpath, type, callback) {\n callback = (typeof type === 'function') ? type : callback\n type = (typeof type === 'function') ? false : type\n\n pathExists(dstpath, (err, destinationExists) => {\n if (err) return callback(err)\n if (destinationExists) return callback(null)\n symlinkPaths(srcpath, dstpath, (err, relative) => {\n if (err) return callback(err)\n srcpath = relative.toDst\n symlinkType(relative.toCwd, type, (err, type) => {\n if (err) return callback(err)\n const dir = path.dirname(dstpath)\n pathExists(dir, (err, dirExists) => {\n if (err) return callback(err)\n if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)\n mkdirs(dir, err => {\n if (err) return callback(err)\n fs.symlink(srcpath, dstpath, type, callback)\n })\n })\n })\n })\n })\n}\n\nfunction createSymlinkSync (srcpath, dstpath, type) {\n const destinationExists = fs.existsSync(dstpath)\n if (destinationExists) return undefined\n\n const relative = symlinkPathsSync(srcpath, dstpath)\n srcpath = relative.toDst\n type = symlinkTypeSync(relative.toCwd, type)\n const dir = path.dirname(dstpath)\n const exists = fs.existsSync(dir)\n if (exists) return fs.symlinkSync(srcpath, dstpath, type)\n mkdirsSync(dir)\n return fs.symlinkSync(srcpath, dstpath, type)\n}\n\nmodule.exports = {\n createSymlink: u(createSymlink),\n createSymlinkSync\n}\n", "'use strict'\n\nconst file = require('./file')\nconst link = require('./link')\nconst symlink = require('./symlink')\n\nmodule.exports = {\n // file\n createFile: file.createFile,\n createFileSync: file.createFileSync,\n ensureFile: file.createFile,\n ensureFileSync: file.createFileSync,\n // link\n createLink: link.createLink,\n createLinkSync: link.createLinkSync,\n ensureLink: link.createLink,\n ensureLinkSync: link.createLinkSync,\n // symlink\n createSymlink: symlink.createSymlink,\n createSymlinkSync: symlink.createSymlinkSync,\n ensureSymlink: symlink.createSymlink,\n ensureSymlinkSync: symlink.createSymlinkSync\n}\n", "function stringify (obj, { EOL = '\\n', finalEOL = true, replacer = null, spaces } = {}) {\n const EOF = finalEOL ? EOL : ''\n const str = JSON.stringify(obj, replacer, spaces)\n\n return str.replace(/\\n/g, EOL) + EOF\n}\n\nfunction stripBom (content) {\n // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified\n if (Buffer.isBuffer(content)) content = content.toString('utf8')\n return content.replace(/^\\uFEFF/, '')\n}\n\nmodule.exports = { stringify, stripBom }\n", "let _fs\ntry {\n _fs = require('graceful-fs')\n} catch (_) {\n _fs = require('fs')\n}\nconst universalify = require('universalify')\nconst { stringify, stripBom } = require('./utils')\n\nasync function _readFile (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n let data = await universalify.fromCallback(fs.readFile)(file, options)\n\n data = stripBom(data)\n\n let obj\n try {\n obj = JSON.parse(data, options ? options.reviver : null)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n\n return obj\n}\n\nconst readFile = universalify.fromPromise(_readFile)\n\nfunction readFileSync (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n try {\n let content = fs.readFileSync(file, options)\n content = stripBom(content)\n return JSON.parse(content, options.reviver)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n}\n\nasync function _writeFile (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n\n await universalify.fromCallback(fs.writeFile)(file, str, options)\n}\n\nconst writeFile = universalify.fromPromise(_writeFile)\n\nfunction writeFileSync (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n // not sure if fs.writeFileSync returns anything, but just in case\n return fs.writeFileSync(file, str, options)\n}\n\nconst jsonfile = {\n readFile,\n readFileSync,\n writeFile,\n writeFileSync\n}\n\nmodule.exports = jsonfile\n", "'use strict'\n\nconst jsonFile = require('jsonfile')\n\nmodule.exports = {\n // jsonfile exports\n readJson: jsonFile.readFile,\n readJsonSync: jsonFile.readFileSync,\n writeJson: jsonFile.writeFile,\n writeJsonSync: jsonFile.writeFileSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nfunction outputFile (file, data, encoding, callback) {\n if (typeof encoding === 'function') {\n callback = encoding\n encoding = 'utf8'\n }\n\n const dir = path.dirname(file)\n pathExists(dir, (err, itDoes) => {\n if (err) return callback(err)\n if (itDoes) return fs.writeFile(file, data, encoding, callback)\n\n mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n\n fs.writeFile(file, data, encoding, callback)\n })\n })\n}\n\nfunction outputFileSync (file, ...args) {\n const dir = path.dirname(file)\n if (fs.existsSync(dir)) {\n return fs.writeFileSync(file, ...args)\n }\n mkdir.mkdirsSync(dir)\n fs.writeFileSync(file, ...args)\n}\n\nmodule.exports = {\n outputFile: u(outputFile),\n outputFileSync\n}\n", "'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFile } = require('../output')\n\nasync function outputJson (file, data, options = {}) {\n const str = stringify(data, options)\n\n await outputFile(file, str, options)\n}\n\nmodule.exports = outputJson\n", "'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFileSync } = require('../output')\n\nfunction outputJsonSync (file, data, options) {\n const str = stringify(data, options)\n\n outputFileSync(file, str, options)\n}\n\nmodule.exports = outputJsonSync\n", "'use strict'\n\nconst u = require('universalify').fromPromise\nconst jsonFile = require('./jsonfile')\n\njsonFile.outputJson = u(require('./output-json'))\njsonFile.outputJsonSync = require('./output-json-sync')\n// aliases\njsonFile.outputJSON = jsonFile.outputJson\njsonFile.outputJSONSync = jsonFile.outputJsonSync\njsonFile.writeJSON = jsonFile.writeJson\njsonFile.writeJSONSync = jsonFile.writeJsonSync\njsonFile.readJSON = jsonFile.readJson\njsonFile.readJSONSync = jsonFile.readJsonSync\n\nmodule.exports = jsonFile\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copySync = require('../copy-sync').copySync\nconst removeSync = require('../remove').removeSync\nconst mkdirpSync = require('../mkdirs').mkdirpSync\nconst stat = require('../util/stat')\n\nfunction moveSync (src, dest, opts) {\n opts = opts || {}\n const overwrite = opts.overwrite || opts.clobber || false\n\n const { srcStat } = stat.checkPathsSync(src, dest, 'move')\n stat.checkParentPathsSync(src, srcStat, dest, 'move')\n mkdirpSync(path.dirname(dest))\n return doRename(src, dest, overwrite)\n}\n\nfunction doRename (src, dest, overwrite) {\n if (overwrite) {\n removeSync(dest)\n return rename(src, dest, overwrite)\n }\n if (fs.existsSync(dest)) throw new Error('dest already exists.')\n return rename(src, dest, overwrite)\n}\n\nfunction rename (src, dest, overwrite) {\n try {\n fs.renameSync(src, dest)\n } catch (err) {\n if (err.code !== 'EXDEV') throw err\n return moveAcrossDevice(src, dest, overwrite)\n }\n}\n\nfunction moveAcrossDevice (src, dest, overwrite) {\n const opts = {\n overwrite,\n errorOnExist: true\n }\n copySync(src, dest, opts)\n return removeSync(src)\n}\n\nmodule.exports = moveSync\n", "'use strict'\n\nmodule.exports = {\n moveSync: require('./move-sync')\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copy = require('../copy').copy\nconst remove = require('../remove').remove\nconst mkdirp = require('../mkdirs').mkdirp\nconst pathExists = require('../path-exists').pathExists\nconst stat = require('../util/stat')\n\nfunction move (src, dest, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts\n opts = {}\n }\n\n const overwrite = opts.overwrite || opts.clobber || false\n\n stat.checkPaths(src, dest, 'move', (err, stats) => {\n if (err) return cb(err)\n const { srcStat } = stats\n stat.checkParentPaths(src, srcStat, dest, 'move', err => {\n if (err) return cb(err)\n mkdirp(path.dirname(dest), err => {\n if (err) return cb(err)\n return doRename(src, dest, overwrite, cb)\n })\n })\n })\n}\n\nfunction doRename (src, dest, overwrite, cb) {\n if (overwrite) {\n return remove(dest, err => {\n if (err) return cb(err)\n return rename(src, dest, overwrite, cb)\n })\n }\n pathExists(dest, (err, destExists) => {\n if (err) return cb(err)\n if (destExists) return cb(new Error('dest already exists.'))\n return rename(src, dest, overwrite, cb)\n })\n}\n\nfunction rename (src, dest, overwrite, cb) {\n fs.rename(src, dest, err => {\n if (!err) return cb()\n if (err.code !== 'EXDEV') return cb(err)\n return moveAcrossDevice(src, dest, overwrite, cb)\n })\n}\n\nfunction moveAcrossDevice (src, dest, overwrite, cb) {\n const opts = {\n overwrite,\n errorOnExist: true\n }\n copy(src, dest, opts, err => {\n if (err) return cb(err)\n return remove(src, cb)\n })\n}\n\nmodule.exports = move\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nmodule.exports = {\n move: u(require('./move'))\n}\n", "'use strict'\n\nmodule.exports = {\n // Export promiseified graceful-fs:\n ...require('./fs'),\n // Export extra methods:\n ...require('./copy-sync'),\n ...require('./copy'),\n ...require('./empty'),\n ...require('./ensure'),\n ...require('./json'),\n ...require('./mkdirs'),\n ...require('./move-sync'),\n ...require('./move'),\n ...require('./output'),\n ...require('./path-exists'),\n ...require('./remove')\n}\n\n// Export fs.promises as a getter property so that we don't trigger\n// ExperimentalWarning before fs.promises is actually accessed.\nconst fs = require('fs')\nif (Object.getOwnPropertyDescriptor(fs, 'promises')) {\n Object.defineProperty(module.exports, 'promises', {\n get () { return fs.promises }\n })\n}\n", "'use strict';\n\nvar matchOperatorsRe = /[|\\\\{}()[\\]^$+*?.]/g;\n\nmodule.exports = function (str) {\n\tif (typeof str !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\treturn str.replace(matchOperatorsRe, '\\\\$&');\n};\n", "'use strict'\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n", "/* MIT license */\nvar cssKeywords = require('color-name');\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nvar reverseKeywords = {};\nfor (var key in cssKeywords) {\n\tif (cssKeywords.hasOwnProperty(key)) {\n\t\treverseKeywords[cssKeywords[key]] = key;\n\t}\n}\n\nvar convert = module.exports = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\tlch: {channels: 3, labels: 'lch'},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']}\n};\n\n// hide .channels and .labels properties\nfor (var model in convert) {\n\tif (convert.hasOwnProperty(model)) {\n\t\tif (!('channels' in convert[model])) {\n\t\t\tthrow new Error('missing channels property: ' + model);\n\t\t}\n\n\t\tif (!('labels' in convert[model])) {\n\t\t\tthrow new Error('missing channel labels property: ' + model);\n\t\t}\n\n\t\tif (convert[model].labels.length !== convert[model].channels) {\n\t\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t\t}\n\n\t\tvar channels = convert[model].channels;\n\t\tvar labels = convert[model].labels;\n\t\tdelete convert[model].channels;\n\t\tdelete convert[model].labels;\n\t\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\t\tObject.defineProperty(convert[model], 'labels', {value: labels});\n\t}\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar min = Math.min(r, g, b);\n\tvar max = Math.max(r, g, b);\n\tvar delta = max - min;\n\tvar h;\n\tvar s;\n\tvar l;\n\n\tif (max === min) {\n\t\th = 0;\n\t} else if (r === max) {\n\t\th = (g - b) / delta;\n\t} else if (g === max) {\n\t\th = 2 + (b - r) / delta;\n\t} else if (b === max) {\n\t\th = 4 + (r - g) / delta;\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tl = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tvar rdif;\n\tvar gdif;\n\tvar bdif;\n\tvar h;\n\tvar s;\n\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar v = Math.max(r, g, b);\n\tvar diff = v - Math.min(r, g, b);\n\tvar diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = s = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tif (r === v) {\n\t\t\th = bdif - gdif;\n\t\t} else if (g === v) {\n\t\t\th = (1 / 3) + rdif - bdif;\n\t\t} else if (b === v) {\n\t\t\th = (2 / 3) + gdif - rdif;\n\t\t}\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tvar r = rgb[0];\n\tvar g = rgb[1];\n\tvar b = rgb[2];\n\tvar h = convert.rgb.hsl(rgb)[0];\n\tvar w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar c;\n\tvar m;\n\tvar y;\n\tvar k;\n\n\tk = Math.min(1 - r, 1 - g, 1 - b);\n\tc = (1 - r - k) / (1 - k) || 0;\n\tm = (1 - g - k) / (1 - k) || 0;\n\ty = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\n/**\n * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n * */\nfunction comparativeDistance(x, y) {\n\treturn (\n\t\tMath.pow(x[0] - y[0], 2) +\n\t\tMath.pow(x[1] - y[1], 2) +\n\t\tMath.pow(x[2] - y[2], 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tvar reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tvar currentClosestDistance = Infinity;\n\tvar currentClosestKeyword;\n\n\tfor (var keyword in cssKeywords) {\n\t\tif (cssKeywords.hasOwnProperty(keyword)) {\n\t\t\tvar value = cssKeywords[keyword];\n\n\t\t\t// Compute comparative distance\n\t\t\tvar distance = comparativeDistance(rgb, value);\n\n\t\t\t// Check if its less, if so set as closest\n\t\t\tif (distance < currentClosestDistance) {\n\t\t\t\tcurrentClosestDistance = distance;\n\t\t\t\tcurrentClosestKeyword = keyword;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn cssKeywords[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\n\t// assume sRGB\n\tr = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\n\n\tvar x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n\tvar y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n\tvar z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tvar xyz = convert.rgb.xyz(rgb);\n\tvar x = xyz[0];\n\tvar y = xyz[1];\n\tvar z = xyz[2];\n\tvar l;\n\tvar a;\n\tvar b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tvar h = hsl[0] / 360;\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar t1;\n\tvar t2;\n\tvar t3;\n\tvar rgb;\n\tvar val;\n\n\tif (s === 0) {\n\t\tval = l * 255;\n\t\treturn [val, val, val];\n\t}\n\n\tif (l < 0.5) {\n\t\tt2 = l * (1 + s);\n\t} else {\n\t\tt2 = l + s - l * s;\n\t}\n\n\tt1 = 2 * l - t2;\n\n\trgb = [0, 0, 0];\n\tfor (var i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tval = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tval = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tval = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tval = t1;\n\t\t}\n\n\t\trgb[i] = val * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tvar h = hsl[0];\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar smin = s;\n\tvar lmin = Math.max(l, 0.01);\n\tvar sv;\n\tvar v;\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tv = (l + s) / 2;\n\tsv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tvar h = hsv[0] / 60;\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\tvar hi = Math.floor(h) % 6;\n\n\tvar f = h - Math.floor(h);\n\tvar p = 255 * v * (1 - s);\n\tvar q = 255 * v * (1 - (s * f));\n\tvar t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0:\n\t\t\treturn [v, t, p];\n\t\tcase 1:\n\t\t\treturn [q, v, p];\n\t\tcase 2:\n\t\t\treturn [p, v, t];\n\t\tcase 3:\n\t\t\treturn [p, q, v];\n\t\tcase 4:\n\t\t\treturn [t, p, v];\n\t\tcase 5:\n\t\t\treturn [v, p, q];\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tvar h = hsv[0];\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\tvar vmin = Math.max(v, 0.01);\n\tvar lmin;\n\tvar sl;\n\tvar l;\n\n\tl = (2 - s) * v;\n\tlmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tvar h = hwb[0] / 360;\n\tvar wh = hwb[1] / 100;\n\tvar bl = hwb[2] / 100;\n\tvar ratio = wh + bl;\n\tvar i;\n\tvar v;\n\tvar f;\n\tvar n;\n\n\t// wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\ti = Math.floor(6 * h);\n\tv = 1 - bl;\n\tf = 6 * h - i;\n\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tn = wh + f * (v - wh); // linear interpolation\n\n\tvar r;\n\tvar g;\n\tvar b;\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: r = v; g = n; b = wh; break;\n\t\tcase 1: r = n; g = v; b = wh; break;\n\t\tcase 2: r = wh; g = v; b = n; break;\n\t\tcase 3: r = wh; g = n; b = v; break;\n\t\tcase 4: r = n; g = wh; b = v; break;\n\t\tcase 5: r = v; g = wh; b = n; break;\n\t}\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tvar c = cmyk[0] / 100;\n\tvar m = cmyk[1] / 100;\n\tvar y = cmyk[2] / 100;\n\tvar k = cmyk[3] / 100;\n\tvar r;\n\tvar g;\n\tvar b;\n\n\tr = 1 - Math.min(1, c * (1 - k) + k);\n\tg = 1 - Math.min(1, m * (1 - k) + k);\n\tb = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tvar x = xyz[0] / 100;\n\tvar y = xyz[1] / 100;\n\tvar z = xyz[2] / 100;\n\tvar r;\n\tvar g;\n\tvar b;\n\n\tr = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n\tg = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n\tb = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n\t// assume sRGB\n\tr = r > 0.0031308\n\t\t? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)\n\t\t: r * 12.92;\n\n\tg = g > 0.0031308\n\t\t? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)\n\t\t: g * 12.92;\n\n\tb = b > 0.0031308\n\t\t? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)\n\t\t: b * 12.92;\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tvar x = xyz[0];\n\tvar y = xyz[1];\n\tvar z = xyz[2];\n\tvar l;\n\tvar a;\n\tvar b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.lab.xyz = function (lab) {\n\tvar l = lab[0];\n\tvar a = lab[1];\n\tvar b = lab[2];\n\tvar x;\n\tvar y;\n\tvar z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tvar y2 = Math.pow(y, 3);\n\tvar x2 = Math.pow(x, 3);\n\tvar z2 = Math.pow(z, 3);\n\ty = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\n\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tvar l = lab[0];\n\tvar a = lab[1];\n\tvar b = lab[2];\n\tvar hr;\n\tvar h;\n\tvar c;\n\n\thr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tc = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tvar l = lch[0];\n\tvar c = lch[1];\n\tvar h = lch[2];\n\tvar a;\n\tvar b;\n\tvar hr;\n\n\thr = h / 360 * 2 * Math.PI;\n\ta = c * Math.cos(hr);\n\tb = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args) {\n\tvar r = args[0];\n\tvar g = args[1];\n\tvar b = args[2];\n\tvar value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tvar ansi = 30\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tvar r = args[0];\n\tvar g = args[1];\n\tvar b = args[2];\n\n\t// we use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\tif (r === g && g === b) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tvar ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\tvar color = args % 10;\n\n\t// handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tvar mult = (~~(args > 50) + 1) * 0.5;\n\tvar r = ((color & 1) * mult) * 255;\n\tvar g = (((color >> 1) & 1) * mult) * 255;\n\tvar b = (((color >> 2) & 1) * mult) * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\t// handle greyscale\n\tif (args >= 232) {\n\t\tvar c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tvar rem;\n\tvar r = Math.floor(args / 36) / 5 * 255;\n\tvar g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tvar b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\tvar integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\n\tvar string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tvar match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tvar colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = colorString.split('').map(function (char) {\n\t\t\treturn char + char;\n\t\t}).join('');\n\t}\n\n\tvar integer = parseInt(colorString, 16);\n\tvar r = (integer >> 16) & 0xFF;\n\tvar g = (integer >> 8) & 0xFF;\n\tvar b = integer & 0xFF;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar max = Math.max(Math.max(r, g), b);\n\tvar min = Math.min(Math.min(r, g), b);\n\tvar chroma = (max - min);\n\tvar grayscale;\n\tvar hue;\n\n\tif (chroma < 1) {\n\t\tgrayscale = min / (1 - chroma);\n\t} else {\n\t\tgrayscale = 0;\n\t}\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else\n\tif (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else\n\tif (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma + 4;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar c = 1;\n\tvar f = 0;\n\n\tif (l < 0.5) {\n\t\tc = 2.0 * s * l;\n\t} else {\n\t\tc = 2.0 * s * (1.0 - l);\n\t}\n\n\tif (c < 1.0) {\n\t\tf = (l - 0.5 * c) / (1.0 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\n\tvar c = s * v;\n\tvar f = 0;\n\n\tif (c < 1.0) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tvar h = hcg[0] / 360;\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tif (c === 0.0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tvar pure = [0, 0, 0];\n\tvar hi = (h % 1) * 6;\n\tvar v = hi % 1;\n\tvar w = 1 - v;\n\tvar mg = 0;\n\n\tswitch (Math.floor(hi)) {\n\t\tcase 0:\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\tcase 1:\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\tcase 2:\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\tcase 3:\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\tcase 4:\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\tdefault:\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t}\n\n\tmg = (1.0 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tvar v = c + g * (1.0 - c);\n\tvar f = 0;\n\n\tif (v > 0.0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tvar l = g * (1.0 - c) + 0.5 * c;\n\tvar s = 0;\n\n\tif (l > 0.0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else\n\tif (l >= 0.5 && l < 1.0) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\tvar v = c + g * (1.0 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tvar w = hwb[1] / 100;\n\tvar b = hwb[2] / 100;\n\tvar v = 1 - b;\n\tvar c = v - w;\n\tvar g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = convert.gray.hsv = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\tvar val = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tvar integer = (val << 16) + (val << 8) + val;\n\n\tvar string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tvar val = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [val / 255 * 100];\n};\n", "var conversions = require('./conversions');\n\n/*\n\tthis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tvar graph = buildGraph();\n\tvar queue = [fromModel]; // unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length) {\n\t\tvar current = queue.pop();\n\t\tvar adjacents = Object.keys(conversions[current]);\n\n\t\tfor (var len = adjacents.length, i = 0; i < len; i++) {\n\t\t\tvar adjacent = adjacents[i];\n\t\t\tvar node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tvar path = [graph[toModel].parent, toModel];\n\tvar fn = conversions[graph[toModel].parent][toModel];\n\n\tvar cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nmodule.exports = function (fromModel) {\n\tvar graph = deriveBFS(fromModel);\n\tvar conversion = {};\n\n\tvar models = Object.keys(graph);\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tvar toModel = models[i];\n\t\tvar node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// no possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n};\n\n", "var conversions = require('./conversions');\nvar route = require('./route');\n\nvar convert = {};\n\nvar models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tvar wrappedFn = function (args) {\n\t\tif (args === undefined || args === null) {\n\t\t\treturn args;\n\t\t}\n\n\t\tif (arguments.length > 1) {\n\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tvar wrappedFn = function (args) {\n\t\tif (args === undefined || args === null) {\n\t\t\treturn args;\n\t\t}\n\n\t\tif (arguments.length > 1) {\n\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t}\n\n\t\tvar result = fn(args);\n\n\t\t// we're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (var len = result.length, i = 0; i < len; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nmodels.forEach(function (fromModel) {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tvar routes = route(fromModel);\n\tvar routeModels = Object.keys(routes);\n\n\trouteModels.forEach(function (toModel) {\n\t\tvar fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t});\n});\n\nmodule.exports = convert;\n", "'use strict';\nconst colorConvert = require('color-convert');\n\nconst wrapAnsi16 = (fn, offset) => function () {\n\tconst code = fn.apply(colorConvert, arguments);\n\treturn `\\u001B[${code + offset}m`;\n};\n\nconst wrapAnsi256 = (fn, offset) => function () {\n\tconst code = fn.apply(colorConvert, arguments);\n\treturn `\\u001B[${38 + offset};5;${code}m`;\n};\n\nconst wrapAnsi16m = (fn, offset) => function () {\n\tconst rgb = fn.apply(colorConvert, arguments);\n\treturn `\\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;\n};\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\tconst styles = {\n\t\tmodifier: {\n\t\t\treset: [0, 0],\n\t\t\t// 21 isn't widely supported and 22 does the same thing\n\t\t\tbold: [1, 22],\n\t\t\tdim: [2, 22],\n\t\t\titalic: [3, 23],\n\t\t\tunderline: [4, 24],\n\t\t\tinverse: [7, 27],\n\t\t\thidden: [8, 28],\n\t\t\tstrikethrough: [9, 29]\n\t\t},\n\t\tcolor: {\n\t\t\tblack: [30, 39],\n\t\t\tred: [31, 39],\n\t\t\tgreen: [32, 39],\n\t\t\tyellow: [33, 39],\n\t\t\tblue: [34, 39],\n\t\t\tmagenta: [35, 39],\n\t\t\tcyan: [36, 39],\n\t\t\twhite: [37, 39],\n\t\t\tgray: [90, 39],\n\n\t\t\t// Bright color\n\t\t\tredBright: [91, 39],\n\t\t\tgreenBright: [92, 39],\n\t\t\tyellowBright: [93, 39],\n\t\t\tblueBright: [94, 39],\n\t\t\tmagentaBright: [95, 39],\n\t\t\tcyanBright: [96, 39],\n\t\t\twhiteBright: [97, 39]\n\t\t},\n\t\tbgColor: {\n\t\t\tbgBlack: [40, 49],\n\t\t\tbgRed: [41, 49],\n\t\t\tbgGreen: [42, 49],\n\t\t\tbgYellow: [43, 49],\n\t\t\tbgBlue: [44, 49],\n\t\t\tbgMagenta: [45, 49],\n\t\t\tbgCyan: [46, 49],\n\t\t\tbgWhite: [47, 49],\n\n\t\t\t// Bright color\n\t\t\tbgBlackBright: [100, 49],\n\t\t\tbgRedBright: [101, 49],\n\t\t\tbgGreenBright: [102, 49],\n\t\t\tbgYellowBright: [103, 49],\n\t\t\tbgBlueBright: [104, 49],\n\t\t\tbgMagentaBright: [105, 49],\n\t\t\tbgCyanBright: [106, 49],\n\t\t\tbgWhiteBright: [107, 49]\n\t\t}\n\t};\n\n\t// Fix humans\n\tstyles.color.grey = styles.color.gray;\n\n\tfor (const groupName of Object.keys(styles)) {\n\t\tconst group = styles[groupName];\n\n\t\tfor (const styleName of Object.keys(group)) {\n\t\t\tconst style = group[styleName];\n\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false\n\t\t});\n\n\t\tObject.defineProperty(styles, 'codes', {\n\t\t\tvalue: codes,\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tconst ansi2ansi = n => n;\n\tconst rgb2rgb = (r, g, b) => [r, g, b];\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = {\n\t\tansi: wrapAnsi16(ansi2ansi, 0)\n\t};\n\tstyles.color.ansi256 = {\n\t\tansi256: wrapAnsi256(ansi2ansi, 0)\n\t};\n\tstyles.color.ansi16m = {\n\t\trgb: wrapAnsi16m(rgb2rgb, 0)\n\t};\n\n\tstyles.bgColor.ansi = {\n\t\tansi: wrapAnsi16(ansi2ansi, 10)\n\t};\n\tstyles.bgColor.ansi256 = {\n\t\tansi256: wrapAnsi256(ansi2ansi, 10)\n\t};\n\tstyles.bgColor.ansi16m = {\n\t\trgb: wrapAnsi16m(rgb2rgb, 10)\n\t};\n\n\tfor (let key of Object.keys(colorConvert)) {\n\t\tif (typeof colorConvert[key] !== 'object') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst suite = colorConvert[key];\n\n\t\tif (key === 'ansi16') {\n\t\t\tkey = 'ansi';\n\t\t}\n\n\t\tif ('ansi16' in suite) {\n\t\t\tstyles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);\n\t\t\tstyles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);\n\t\t}\n\n\t\tif ('ansi256' in suite) {\n\t\t\tstyles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);\n\t\t\tstyles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);\n\t\t}\n\n\t\tif ('rgb' in suite) {\n\t\t\tstyles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);\n\t\t\tstyles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);\n\t\t}\n\t}\n\n\treturn styles;\n}\n\n// Make the export immutable\nObject.defineProperty(module, 'exports', {\n\tenumerable: true,\n\tget: assembleStyles\n});\n", "'use strict';\nmodule.exports = (flag, argv) => {\n\targv = argv || process.argv;\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst pos = argv.indexOf(prefix + flag);\n\tconst terminatorPos = argv.indexOf('--');\n\treturn pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);\n};\n", "'use strict';\nconst os = require('os');\nconst hasFlag = require('has-flag');\n\nconst env = process.env;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false')) {\n\tforceColor = false;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = true;\n}\nif ('FORCE_COLOR' in env) {\n\tforceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(stream) {\n\tif (forceColor === false) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (stream && !stream.isTTY && forceColor !== true) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor ? 1 : 0;\n\n\tif (process.platform === 'win32') {\n\t\t// Node.js 7.5.0 is the first version of Node.js to include a patch to\n\t\t// libuv that enables 256 color output on Windows. Anything earlier and it\n\t\t// won't work. However, here we target Node.js 8 at minimum as it is an LTS\n\t\t// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows\n\t\t// release that supports 256 colors. Windows 10 build 14931 is the first release\n\t\t// that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(process.versions.node.split('.')[0]) >= 8 &&\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: getSupportLevel(process.stdout),\n\tstderr: getSupportLevel(process.stderr)\n};\n", "'use strict';\nconst TEMPLATE_REGEX = /(?:\\\\(u[a-f\\d]{4}|x[a-f\\d]{2}|.))|(?:\\{(~)?(\\w+(?:\\([^)]*\\))?(?:\\.\\w+(?:\\([^)]*\\))?)*)(?:[ \\t]|(?=\\r?\\n)))|(\\})|((?:.|[\\r\\n\\f])+?)/gi;\nconst STYLE_REGEX = /(?:^|\\.)(\\w+)(?:\\(([^)]*)\\))?/g;\nconst STRING_REGEX = /^(['\"])((?:\\\\.|(?!\\1)[^\\\\])*)\\1$/;\nconst ESCAPE_REGEX = /\\\\(u[a-f\\d]{4}|x[a-f\\d]{2}|.)|([^\\\\])/gi;\n\nconst ESCAPES = new Map([\n\t['n', '\\n'],\n\t['r', '\\r'],\n\t['t', '\\t'],\n\t['b', '\\b'],\n\t['f', '\\f'],\n\t['v', '\\v'],\n\t['0', '\\0'],\n\t['\\\\', '\\\\'],\n\t['e', '\\u001B'],\n\t['a', '\\u0007']\n]);\n\nfunction unescape(c) {\n\tif ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) {\n\t\treturn String.fromCharCode(parseInt(c.slice(1), 16));\n\t}\n\n\treturn ESCAPES.get(c) || c;\n}\n\nfunction parseArguments(name, args) {\n\tconst results = [];\n\tconst chunks = args.trim().split(/\\s*,\\s*/g);\n\tlet matches;\n\n\tfor (const chunk of chunks) {\n\t\tif (!isNaN(chunk)) {\n\t\t\tresults.push(Number(chunk));\n\t\t} else if ((matches = chunk.match(STRING_REGEX))) {\n\t\t\tresults.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));\n\t\t} else {\n\t\t\tthrow new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);\n\t\t}\n\t}\n\n\treturn results;\n}\n\nfunction parseStyle(style) {\n\tSTYLE_REGEX.lastIndex = 0;\n\n\tconst results = [];\n\tlet matches;\n\n\twhile ((matches = STYLE_REGEX.exec(style)) !== null) {\n\t\tconst name = matches[1];\n\n\t\tif (matches[2]) {\n\t\t\tconst args = parseArguments(name, matches[2]);\n\t\t\tresults.push([name].concat(args));\n\t\t} else {\n\t\t\tresults.push([name]);\n\t\t}\n\t}\n\n\treturn results;\n}\n\nfunction buildStyle(chalk, styles) {\n\tconst enabled = {};\n\n\tfor (const layer of styles) {\n\t\tfor (const style of layer.styles) {\n\t\t\tenabled[style[0]] = layer.inverse ? null : style.slice(1);\n\t\t}\n\t}\n\n\tlet current = chalk;\n\tfor (const styleName of Object.keys(enabled)) {\n\t\tif (Array.isArray(enabled[styleName])) {\n\t\t\tif (!(styleName in current)) {\n\t\t\t\tthrow new Error(`Unknown Chalk style: ${styleName}`);\n\t\t\t}\n\n\t\t\tif (enabled[styleName].length > 0) {\n\t\t\t\tcurrent = current[styleName].apply(current, enabled[styleName]);\n\t\t\t} else {\n\t\t\t\tcurrent = current[styleName];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn current;\n}\n\nmodule.exports = (chalk, tmp) => {\n\tconst styles = [];\n\tconst chunks = [];\n\tlet chunk = [];\n\n\t// eslint-disable-next-line max-params\n\ttmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {\n\t\tif (escapeChar) {\n\t\t\tchunk.push(unescape(escapeChar));\n\t\t} else if (style) {\n\t\t\tconst str = chunk.join('');\n\t\t\tchunk = [];\n\t\t\tchunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));\n\t\t\tstyles.push({inverse, styles: parseStyle(style)});\n\t\t} else if (close) {\n\t\t\tif (styles.length === 0) {\n\t\t\t\tthrow new Error('Found extraneous } in Chalk template literal');\n\t\t\t}\n\n\t\t\tchunks.push(buildStyle(chalk, styles)(chunk.join('')));\n\t\t\tchunk = [];\n\t\t\tstyles.pop();\n\t\t} else {\n\t\t\tchunk.push(chr);\n\t\t}\n\t});\n\n\tchunks.push(chunk.join(''));\n\n\tif (styles.length > 0) {\n\t\tconst errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\\`}\\`)`;\n\t\tthrow new Error(errMsg);\n\t}\n\n\treturn chunks.join('');\n};\n", "'use strict';\nconst escapeStringRegexp = require('escape-string-regexp');\nconst ansiStyles = require('ansi-styles');\nconst stdoutColor = require('supports-color').stdout;\n\nconst template = require('./templates.js');\n\nconst isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');\n\n// `supportsColor.level` \u2192 `ansiStyles.color[name]` mapping\nconst levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];\n\n// `color-convert` models to exclude from the Chalk API due to conflicts and such\nconst skipModels = new Set(['gray']);\n\nconst styles = Object.create(null);\n\nfunction applyOptions(obj, options) {\n\toptions = options || {};\n\n\t// Detect level if not set manually\n\tconst scLevel = stdoutColor ? stdoutColor.level : 0;\n\tobj.level = options.level === undefined ? scLevel : options.level;\n\tobj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;\n}\n\nfunction Chalk(options) {\n\t// We check for this.template here since calling `chalk.constructor()`\n\t// by itself will have a `this` of a previously constructed chalk object\n\tif (!this || !(this instanceof Chalk) || this.template) {\n\t\tconst chalk = {};\n\t\tapplyOptions(chalk, options);\n\n\t\tchalk.template = function () {\n\t\t\tconst args = [].slice.call(arguments);\n\t\t\treturn chalkTag.apply(null, [chalk.template].concat(args));\n\t\t};\n\n\t\tObject.setPrototypeOf(chalk, Chalk.prototype);\n\t\tObject.setPrototypeOf(chalk.template, chalk);\n\n\t\tchalk.template.constructor = Chalk;\n\n\t\treturn chalk.template;\n\t}\n\n\tapplyOptions(this, options);\n}\n\n// Use bright blue on Windows as the normal blue color is illegible\nif (isSimpleWindowsTerm) {\n\tansiStyles.blue.open = '\\u001B[94m';\n}\n\nfor (const key of Object.keys(ansiStyles)) {\n\tansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');\n\n\tstyles[key] = {\n\t\tget() {\n\t\t\tconst codes = ansiStyles[key];\n\t\t\treturn build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);\n\t\t}\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\treturn build.call(this, this._styles || [], true, 'visible');\n\t}\n};\n\nansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');\nfor (const model of Object.keys(ansiStyles.color.ansi)) {\n\tif (skipModels.has(model)) {\n\t\tcontinue;\n\t}\n\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst level = this.level;\n\t\t\treturn function () {\n\t\t\t\tconst open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);\n\t\t\t\tconst codes = {\n\t\t\t\t\topen,\n\t\t\t\t\tclose: ansiStyles.color.close,\n\t\t\t\t\tcloseRe: ansiStyles.color.closeRe\n\t\t\t\t};\n\t\t\t\treturn build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);\n\t\t\t};\n\t\t}\n\t};\n}\n\nansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');\nfor (const model of Object.keys(ansiStyles.bgColor.ansi)) {\n\tif (skipModels.has(model)) {\n\t\tcontinue;\n\t}\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst level = this.level;\n\t\t\treturn function () {\n\t\t\t\tconst open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);\n\t\t\t\tconst codes = {\n\t\t\t\t\topen,\n\t\t\t\t\tclose: ansiStyles.bgColor.close,\n\t\t\t\t\tcloseRe: ansiStyles.bgColor.closeRe\n\t\t\t\t};\n\t\t\t\treturn build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);\n\t\t\t};\n\t\t}\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, styles);\n\nfunction build(_styles, _empty, key) {\n\tconst builder = function () {\n\t\treturn applyStyle.apply(builder, arguments);\n\t};\n\n\tbuilder._styles = _styles;\n\tbuilder._empty = _empty;\n\n\tconst self = this;\n\n\tObject.defineProperty(builder, 'level', {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn self.level;\n\t\t},\n\t\tset(level) {\n\t\t\tself.level = level;\n\t\t}\n\t});\n\n\tObject.defineProperty(builder, 'enabled', {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn self.enabled;\n\t\t},\n\t\tset(enabled) {\n\t\t\tself.enabled = enabled;\n\t\t}\n\t});\n\n\t// See below for fix regarding invisible grey/dim combination on Windows\n\tbuilder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';\n\n\t// `__proto__` is used because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tbuilder.__proto__ = proto; // eslint-disable-line no-proto\n\n\treturn builder;\n}\n\nfunction applyStyle() {\n\t// Support varags, but simply cast to string in case there's only one arg\n\tconst args = arguments;\n\tconst argsLen = args.length;\n\tlet str = String(arguments[0]);\n\n\tif (argsLen === 0) {\n\t\treturn '';\n\t}\n\n\tif (argsLen > 1) {\n\t\t// Don't slice `arguments`, it prevents V8 optimizations\n\t\tfor (let a = 1; a < argsLen; a++) {\n\t\t\tstr += ' ' + args[a];\n\t\t}\n\t}\n\n\tif (!this.enabled || this.level <= 0 || !str) {\n\t\treturn this._empty ? '' : str;\n\t}\n\n\t// Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,\n\t// see https://github.com/chalk/chalk/issues/58\n\t// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.\n\tconst originalDim = ansiStyles.dim.open;\n\tif (isSimpleWindowsTerm && this.hasGrey) {\n\t\tansiStyles.dim.open = '';\n\t}\n\n\tfor (const code of this._styles.slice().reverse()) {\n\t\t// Replace any instances already present with a re-opening code\n\t\t// otherwise only the part of the string until said closing code\n\t\t// will be colored, and the rest will simply be 'plain'.\n\t\tstr = code.open + str.replace(code.closeRe, code.open) + code.close;\n\n\t\t// Close the styling before a linebreak and reopen\n\t\t// after next line to fix a bleed issue on macOS\n\t\t// https://github.com/chalk/chalk/pull/92\n\t\tstr = str.replace(/\\r?\\n/g, `${code.close}$&${code.open}`);\n\t}\n\n\t// Reset the original `dim` if we changed it to work around the Windows dimmed gray issue\n\tansiStyles.dim.open = originalDim;\n\n\treturn str;\n}\n\nfunction chalkTag(chalk, strings) {\n\tif (!Array.isArray(strings)) {\n\t\t// If chalk() was called by itself or with a string,\n\t\t// return the string itself as a string.\n\t\treturn [].slice.call(arguments, 1).join(' ');\n\t}\n\n\tconst args = [].slice.call(arguments, 2);\n\tconst parts = [strings.raw[0]];\n\n\tfor (let i = 1; i < strings.length; i++) {\n\t\tparts.push(String(args[i - 1]).replace(/[{}\\\\]/g, '\\\\$&'));\n\t\tparts.push(String(strings.raw[i]));\n\t}\n\n\treturn template(chalk, parts.join(''));\n}\n\nObject.defineProperties(Chalk.prototype, styles);\n\nmodule.exports = Chalk(); // eslint-disable-line new-cap\nmodule.exports.supportsColor = stdoutColor;\nmodule.exports.default = module.exports; // For TypeScript\n", "class Node {\n\t/// value;\n\t/// next;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\n\t\t// TODO: Remove this when targeting Node.js 12.\n\t\tthis.next = undefined;\n\t}\n}\n\nclass Queue {\n\t// TODO: Use private class fields when targeting Node.js 12.\n\t// #_head;\n\t// #_tail;\n\t// #_size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this._head) {\n\t\t\tthis._tail.next = node;\n\t\t\tthis._tail = node;\n\t\t} else {\n\t\t\tthis._head = node;\n\t\t\tthis._tail = node;\n\t\t}\n\n\t\tthis._size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this._head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._head = this._head.next;\n\t\tthis._size--;\n\t\treturn current.value;\n\t}\n\n\tclear() {\n\t\tthis._head = undefined;\n\t\tthis._tail = undefined;\n\t\tthis._size = 0;\n\t}\n\n\tget size() {\n\t\treturn this._size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this._head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n}\n\nmodule.exports = Queue;\n", "'use strict';\nconst Queue = require('yocto-queue');\n\nconst pLimit = concurrency => {\n\tif (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst next = () => {\n\t\tactiveCount--;\n\n\t\tif (queue.size > 0) {\n\t\t\tqueue.dequeue()();\n\t\t}\n\t};\n\n\tconst run = async (fn, resolve, ...args) => {\n\t\tactiveCount++;\n\n\t\tconst result = (async () => fn(...args))();\n\n\t\tresolve(result);\n\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\tnext();\n\t};\n\n\tconst enqueue = (fn, resolve, ...args) => {\n\t\tqueue.enqueue(run.bind(null, fn, resolve, ...args));\n\n\t\t(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// when the run function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve();\n\n\t\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\t\tqueue.dequeue()();\n\t\t\t}\n\t\t})();\n\t};\n\n\tconst generator = (fn, ...args) => new Promise(resolve => {\n\t\tenqueue(fn, resolve, ...args);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue: () => {\n\t\t\t\tqueue.clear();\n\t\t\t}\n\t\t}\n\t});\n\n\treturn generator;\n};\n\nmodule.exports = pLimit;\n", "'use strict';\nconst pLimit = require('p-limit');\n\nclass EndError extends Error {\n\tconstructor(value) {\n\t\tsuper();\n\t\tthis.value = value;\n\t}\n}\n\n// The input can also be a promise, so we await it\nconst testElement = async (element, tester) => tester(await element);\n\n// The input can also be a promise, so we `Promise.all()` them both\nconst finder = async element => {\n\tconst values = await Promise.all(element);\n\tif (values[1] === true) {\n\t\tthrow new EndError(values[0]);\n\t}\n\n\treturn false;\n};\n\nconst pLocate = async (iterable, tester, options) => {\n\toptions = {\n\t\tconcurrency: Infinity,\n\t\tpreserveOrder: true,\n\t\t...options\n\t};\n\n\tconst limit = pLimit(options.concurrency);\n\n\t// Start all the promises concurrently with optional limit\n\tconst items = [...iterable].map(element => [element, limit(testElement, element, tester)]);\n\n\t// Check the promises either serially or concurrently\n\tconst checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);\n\n\ttry {\n\t\tawait Promise.all(items.map(element => checkLimit(finder, element)));\n\t} catch (error) {\n\t\tif (error instanceof EndError) {\n\t\t\treturn error.value;\n\t\t}\n\n\t\tthrow error;\n\t}\n};\n\nmodule.exports = pLocate;\n", "'use strict';\nconst path = require('path');\nconst fs = require('fs');\nconst {promisify} = require('util');\nconst pLocate = require('p-locate');\n\nconst fsStat = promisify(fs.stat);\nconst fsLStat = promisify(fs.lstat);\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile'\n};\n\nfunction checkType({type}) {\n\tif (type in typeMappings) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => type === undefined || stat[typeMappings[type]]();\n\nmodule.exports = async (paths, options) => {\n\toptions = {\n\t\tcwd: process.cwd(),\n\t\ttype: 'file',\n\t\tallowSymlinks: true,\n\t\t...options\n\t};\n\n\tcheckType(options);\n\n\tconst statFn = options.allowSymlinks ? fsStat : fsLStat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFn(path.resolve(options.cwd, path_));\n\t\t\treturn matchType(options.type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, options);\n};\n\nmodule.exports.sync = (paths, options) => {\n\toptions = {\n\t\tcwd: process.cwd(),\n\t\tallowSymlinks: true,\n\t\ttype: 'file',\n\t\t...options\n\t};\n\n\tcheckType(options);\n\n\tconst statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFn(path.resolve(options.cwd, path_));\n\n\t\t\tif (matchType(options.type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n};\n", "'use strict';\nconst fs = require('fs');\nconst {promisify} = require('util');\n\nconst pAccess = promisify(fs.access);\n\nmodule.exports = async path => {\n\ttry {\n\t\tawait pAccess(path);\n\t\treturn true;\n\t} catch (_) {\n\t\treturn false;\n\t}\n};\n\nmodule.exports.sync = path => {\n\ttry {\n\t\tfs.accessSync(path);\n\t\treturn true;\n\t} catch (_) {\n\t\treturn false;\n\t}\n};\n", "'use strict';\nconst path = require('path');\nconst locatePath = require('locate-path');\nconst pathExists = require('path-exists');\n\nconst stop = Symbol('findUp.stop');\n\nmodule.exports = async (name, options = {}) => {\n\tlet directory = path.resolve(options.cwd || '');\n\tconst {root} = path.parse(directory);\n\tconst paths = [].concat(name);\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === stop) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\treturn path.resolve(directory, foundPath);\n\t\t}\n\n\t\tif (directory === root) {\n\t\t\treturn;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n};\n\nmodule.exports.sync = (name, options = {}) => {\n\tlet directory = path.resolve(options.cwd || '');\n\tconst {root} = path.parse(directory);\n\tconst paths = [].concat(name);\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath.sync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath.sync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === stop) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\treturn path.resolve(directory, foundPath);\n\t\t}\n\n\t\tif (directory === root) {\n\t\t\treturn;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n};\n\nmodule.exports.exists = pathExists;\n\nmodule.exports.sync.exists = pathExists.sync;\n\nmodule.exports.stop = stop;\n", "'use strict';\nconst path = require('path');\nconst findUp = require('find-up');\n\nconst pkgDir = async cwd => {\n\tconst filePath = await findUp('package.json', {cwd});\n\treturn filePath && path.dirname(filePath);\n};\n\nmodule.exports = pkgDir;\n\nmodule.exports.sync = cwd => {\n\tconst filePath = findUp.sync('package.json', {cwd});\n\treturn filePath && path.dirname(filePath);\n};\n", "'use strict';\n\nconst { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = process.env;\n\nconst $ = {\n\tenabled: !NODE_DISABLE_COLORS && TERM !== 'dumb' && FORCE_COLOR !== '0',\n\n\t// modifiers\n\treset: init(0, 0),\n\tbold: init(1, 22),\n\tdim: init(2, 22),\n\titalic: init(3, 23),\n\tunderline: init(4, 24),\n\tinverse: init(7, 27),\n\thidden: init(8, 28),\n\tstrikethrough: init(9, 29),\n\n\t// colors\n\tblack: init(30, 39),\n\tred: init(31, 39),\n\tgreen: init(32, 39),\n\tyellow: init(33, 39),\n\tblue: init(34, 39),\n\tmagenta: init(35, 39),\n\tcyan: init(36, 39),\n\twhite: init(37, 39),\n\tgray: init(90, 39),\n\tgrey: init(90, 39),\n\n\t// background colors\n\tbgBlack: init(40, 49),\n\tbgRed: init(41, 49),\n\tbgGreen: init(42, 49),\n\tbgYellow: init(43, 49),\n\tbgBlue: init(44, 49),\n\tbgMagenta: init(45, 49),\n\tbgCyan: init(46, 49),\n\tbgWhite: init(47, 49)\n};\n\nfunction run(arr, str) {\n\tlet i=0, tmp, beg='', end='';\n\tfor (; i < arr.length; i++) {\n\t\ttmp = arr[i];\n\t\tbeg += tmp.open;\n\t\tend += tmp.close;\n\t\tif (str.includes(tmp.close)) {\n\t\t\tstr = str.replace(tmp.rgx, tmp.close + tmp.open);\n\t\t}\n\t}\n\treturn beg + str + end;\n}\n\nfunction chain(has, keys) {\n\tlet ctx = { has, keys };\n\n\tctx.reset = $.reset.bind(ctx);\n\tctx.bold = $.bold.bind(ctx);\n\tctx.dim = $.dim.bind(ctx);\n\tctx.italic = $.italic.bind(ctx);\n\tctx.underline = $.underline.bind(ctx);\n\tctx.inverse = $.inverse.bind(ctx);\n\tctx.hidden = $.hidden.bind(ctx);\n\tctx.strikethrough = $.strikethrough.bind(ctx);\n\n\tctx.black = $.black.bind(ctx);\n\tctx.red = $.red.bind(ctx);\n\tctx.green = $.green.bind(ctx);\n\tctx.yellow = $.yellow.bind(ctx);\n\tctx.blue = $.blue.bind(ctx);\n\tctx.magenta = $.magenta.bind(ctx);\n\tctx.cyan = $.cyan.bind(ctx);\n\tctx.white = $.white.bind(ctx);\n\tctx.gray = $.gray.bind(ctx);\n\tctx.grey = $.grey.bind(ctx);\n\n\tctx.bgBlack = $.bgBlack.bind(ctx);\n\tctx.bgRed = $.bgRed.bind(ctx);\n\tctx.bgGreen = $.bgGreen.bind(ctx);\n\tctx.bgYellow = $.bgYellow.bind(ctx);\n\tctx.bgBlue = $.bgBlue.bind(ctx);\n\tctx.bgMagenta = $.bgMagenta.bind(ctx);\n\tctx.bgCyan = $.bgCyan.bind(ctx);\n\tctx.bgWhite = $.bgWhite.bind(ctx);\n\n\treturn ctx;\n}\n\nfunction init(open, close) {\n\tlet blk = {\n\t\topen: `\\x1b[${open}m`,\n\t\tclose: `\\x1b[${close}m`,\n\t\trgx: new RegExp(`\\\\x1b\\\\[${close}m`, 'g')\n\t};\n\treturn function (txt) {\n\t\tif (this !== void 0 && this.has !== void 0) {\n\t\t\tthis.has.includes(open) || (this.has.push(open),this.keys.push(blk));\n\t\t\treturn txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+'';\n\t\t}\n\t\treturn txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';\n\t};\n}\n\nmodule.exports = $;\n", "/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return{$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}\nfunction N(a,b){return{$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\\/+/g;function Q(a,b){return\"object\"===typeof a&&null!==a&&null!=a.key?escape(\"\"+a.key):b.toString(36)}\nfunction R(a,b,e,d,c){var k=typeof a;if(\"undefined\"===k||\"boolean\"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case \"string\":case \"number\":h=!0;break;case \"object\":switch(a.$$typeof){case l:case n:h=!0}}if(h)return h=a,c=c(h),a=\"\"===d?\".\"+Q(h,0):d,I(c)?(e=\"\",null!=a&&(e=a.replace(P,\"$&/\")+\"/\"),R(c,b,e,\"\",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?\"\":(\"\"+c.key).replace(P,\"$&/\")+\"/\")+a)),b.push(c)),1;h=0;d=\"\"===d?\".\":d+\":\";if(I(a))for(var g=0;g<a.length;g++){k=\na[g];var f=d+Q(k,g);h+=R(k,b,e,f,c)}else if(f=A(a),\"function\"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if(\"object\"===k)throw b=String(a),Error(\"Objects are not valid as a React child (found: \"+(\"[object Object]\"===b?\"object with keys {\"+Object.keys(a).join(\", \")+\"}\":b)+\"). If you meant to render a collection of children, use an array instead.\");return h}\nfunction S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,\"\",\"\",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}\nvar U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};exports.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;S(a,function(){b++});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error(\"React.Children.only expected to receive a single React element child.\");return a}};exports.Component=E;exports.Fragment=p;\nexports.Profiler=r;exports.PureComponent=G;exports.StrictMode=q;exports.Suspense=w;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;\nexports.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+a+\".\");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=\"\"+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);\nfor(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g}return{$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};exports.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};\nexports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=O;exports.lazy=function(a){return{$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:x,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=V.transition;V.transition={};try{a()}finally{V.transition=b}};exports.unstable_act=function(){throw Error(\"act(...) is not supported in production builds of React.\");};\nexports.useCallback=function(a,b){return U.current.useCallback(a,b)};exports.useContext=function(a){return U.current.useContext(a)};exports.useDebugValue=function(){};exports.useDeferredValue=function(a){return U.current.useDeferredValue(a)};exports.useEffect=function(a,b){return U.current.useEffect(a,b)};exports.useId=function(){return U.current.useId()};exports.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};\nexports.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};exports.useMemo=function(a,b){return U.current.useMemo(a,b)};exports.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};exports.useRef=function(a){return U.current.useRef(a)};exports.useState=function(a){return U.current.useState(a)};exports.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};\nexports.useTransition=function(){return U.current.useTransition()};exports.version=\"18.2.0\";\n", "/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var ReactVersion = '18.2.0';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\n/**\n * Keeps track of the current dispatcher.\n */\nvar ReactCurrentDispatcher = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\n/**\n * Keeps track of the current batch's configuration such as how long an update\n * should suspend for if it needs to.\n */\nvar ReactCurrentBatchConfig = {\n transition: null\n};\n\nvar ReactCurrentActQueue = {\n current: null,\n // Used to reproduce behavior of `batchedUpdates` in legacy mode.\n isBatchingLegacy: false,\n didScheduleLegacyUpdate: false\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\nvar ReactDebugCurrentFrame = {};\nvar currentExtraStackFrame = null;\nfunction setExtraStackFrame(stack) {\n {\n currentExtraStackFrame = stack;\n }\n}\n\n{\n ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {\n {\n currentExtraStackFrame = stack;\n }\n }; // Stack implementation injected by the current renderer.\n\n\n ReactDebugCurrentFrame.getCurrentStack = null;\n\n ReactDebugCurrentFrame.getStackAddendum = function () {\n var stack = ''; // Add an extra top frame while an element is being validated\n\n if (currentExtraStackFrame) {\n stack += currentExtraStackFrame;\n } // Delegate to the injected renderer-specific implementation\n\n\n var impl = ReactDebugCurrentFrame.getCurrentStack;\n\n if (impl) {\n stack += impl() || '';\n }\n\n return stack;\n };\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar ReactSharedInternals = {\n ReactCurrentDispatcher: ReactCurrentDispatcher,\n ReactCurrentBatchConfig: ReactCurrentBatchConfig,\n ReactCurrentOwner: ReactCurrentOwner\n};\n\n{\n ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;\n ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;\n}\n\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\n\nfunction warn(format) {\n {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }\n}\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = {};\n\nfunction warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';\n var warningKey = componentName + \".\" + callerName;\n\n if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\n return;\n }\n\n error(\"Can't call %s on a component that is not yet mounted. \" + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);\n\n didWarnStateUpdateForUnmountedComponent[warningKey] = true;\n }\n}\n/**\n * This is the abstract API for an update queue.\n */\n\n\nvar ReactNoopUpdateQueue = {\n /**\n * Checks whether or not this composite component is mounted.\n * @param {ReactClass} publicInstance The instance we want to test.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function (publicInstance) {\n return false;\n },\n\n /**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueForceUpdate: function (publicInstance, callback, callerName) {\n warnNoop(publicInstance, 'forceUpdate');\n },\n\n /**\n * Replaces all of the state. Always use this or `setState` to mutate state.\n * You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} completeState Next state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\n warnNoop(publicInstance, 'replaceState');\n },\n\n /**\n * Sets a subset of the state. This only exists because _pendingState is\n * internal. This provides a merging strategy that is not available to deep\n * properties which is confusing. TODO: Expose pendingState or don't use it\n * during the merge.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} partialState Next partial state to be merged with state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} Name of the calling function in the public API.\n * @internal\n */\n enqueueSetState: function (publicInstance, partialState, callback, callerName) {\n warnNoop(publicInstance, 'setState');\n }\n};\n\nvar assign = Object.assign;\n\nvar emptyObject = {};\n\n{\n Object.freeze(emptyObject);\n}\n/**\n * Base class helpers for the updating state of a component.\n */\n\n\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\n // renderer.\n\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nComponent.prototype.isReactComponent = {};\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together. You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n * produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\n\nComponent.prototype.setState = function (partialState, callback) {\n if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {\n throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');\n }\n\n this.updater.enqueueSetState(this, partialState, callback, 'setState');\n};\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\n\n\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\n};\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\n\n\n{\n var deprecatedAPIs = {\n isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n };\n\n var defineDeprecationWarning = function (methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\n\n return undefined;\n }\n });\n };\n\n for (var fnName in deprecatedAPIs) {\n if (deprecatedAPIs.hasOwnProperty(fnName)) {\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n }\n }\n}\n\nfunction ComponentDummy() {}\n\nComponentDummy.prototype = Component.prototype;\n/**\n * Convenience component with default shallow equality check for sCU.\n */\n\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\npureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.\n\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = true;\n\n// an immutable object with a single mutable value\nfunction createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n var warnAboutAccessingKey = function () {\n {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n var warnAboutAccessingRef = function () {\n {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * Create and return a new ReactElement of the given type.\n * See https://reactjs.org/docs/react-api.html#createelement\n */\n\nfunction createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}\n/**\n * Clone and return a new ReactElement using element as the starting point.\n * See https://reactjs.org/docs/react-api.html#cloneelement\n */\n\nfunction cloneElement(element, config, children) {\n if (element === null || element === undefined) {\n throw new Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n\n var propName; // Original props are copied\n\n var props = assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nvar SEPARATOR = '.';\nvar SUBSEPARATOR = ':';\n/**\n * Escape and wrap key so it is safe to use as a reactid\n *\n * @param {string} key to be escaped.\n * @return {string} the escaped key.\n */\n\nfunction escape(key) {\n var escapeRegex = /[=:]/g;\n var escaperLookup = {\n '=': '=0',\n ':': '=2'\n };\n var escapedString = key.replace(escapeRegex, function (match) {\n return escaperLookup[match];\n });\n return '$' + escapedString;\n}\n/**\n * TODO: Test that a single child and an array with one item have the same key\n * pattern.\n */\n\n\nvar didWarnAboutMaps = false;\nvar userProvidedKeyEscapeRegex = /\\/+/g;\n\nfunction escapeUserProvidedKey(text) {\n return text.replace(userProvidedKeyEscapeRegex, '$&/');\n}\n/**\n * Generate a key string that identifies a element within a set.\n *\n * @param {*} element A element that could contain a manual key.\n * @param {number} index Index that is used if a manual key is not provided.\n * @return {string}\n */\n\n\nfunction getElementKey(element, index) {\n // Do some typechecking here since we call this blindly. We want to ensure\n // that we don't block potential future ES APIs.\n if (typeof element === 'object' && element !== null && element.key != null) {\n // Explicit key\n {\n checkKeyStringCoercion(element.key);\n }\n\n return escape('' + element.key);\n } // Implicit key determined by the index in the set\n\n\n return index.toString(36);\n}\n\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n\n if (type === 'undefined' || type === 'boolean') {\n // All of the above are perceived as null.\n children = null;\n }\n\n var invokeCallback = false;\n\n if (children === null) {\n invokeCallback = true;\n } else {\n switch (type) {\n case 'string':\n case 'number':\n invokeCallback = true;\n break;\n\n case 'object':\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = true;\n }\n\n }\n }\n\n if (invokeCallback) {\n var _child = children;\n var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array\n // so that it's consistent if the number of children grows:\n\n var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;\n\n if (isArray(mappedChild)) {\n var escapedChildKey = '';\n\n if (childKey != null) {\n escapedChildKey = escapeUserProvidedKey(childKey) + '/';\n }\n\n mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {\n return c;\n });\n } else if (mappedChild != null) {\n if (isValidElement(mappedChild)) {\n {\n // The `if` statement here prevents auto-disabling of the safe\n // coercion ESLint rule, so we must manually disable it below.\n // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {\n checkKeyStringCoercion(mappedChild.key);\n }\n }\n\n mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as\n // traverseAllChildren used to do for objects as children\n escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number\n // eslint-disable-next-line react-internal/safe-string-coercion\n escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);\n }\n\n array.push(mappedChild);\n }\n\n return 1;\n }\n\n var child;\n var nextName;\n var subtreeCount = 0; // Count of children found in the current subtree.\n\n var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n nextName = nextNamePrefix + getElementKey(child, i);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n var iterableChildren = children;\n\n {\n // Warn about using Maps as children\n if (iteratorFn === iterableChildren.entries) {\n if (!didWarnAboutMaps) {\n warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n }\n }\n\n var iterator = iteratorFn.call(iterableChildren);\n var step;\n var ii = 0;\n\n while (!(step = iterator.next()).done) {\n child = step.value;\n nextName = nextNamePrefix + getElementKey(child, ii++);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else if (type === 'object') {\n // eslint-disable-next-line react-internal/safe-string-coercion\n var childrenString = String(children);\n throw new Error(\"Objects are not valid as a React child (found: \" + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + \"). \" + 'If you meant to render a collection of children, use an array ' + 'instead.');\n }\n }\n\n return subtreeCount;\n}\n\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenmap\n *\n * The provided mapFunction(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\nfunction mapChildren(children, func, context) {\n if (children == null) {\n return children;\n }\n\n var result = [];\n var count = 0;\n mapIntoArray(children, result, '', '', function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrencount\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\n\n\nfunction countChildren(children) {\n var n = 0;\n mapChildren(children, function () {\n n++; // Don't return anything\n });\n return n;\n}\n\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenforeach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n mapChildren(children, function () {\n forEachFunc.apply(this, arguments); // Don't return anything.\n }, forEachContext);\n}\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrentoarray\n */\n\n\nfunction toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenonly\n *\n * The current implementation of this function assumes that a single child gets\n * passed without a wrapper, but the purpose of this helper function is to\n * abstract away the particular structure of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactElement} The first and only `ReactElement` contained in the\n * structure.\n */\n\n\nfunction onlyChild(children) {\n if (!isValidElement(children)) {\n throw new Error('React.Children.only expected to receive a single React element child.');\n }\n\n return children;\n}\n\nfunction createContext(defaultValue) {\n // TODO: Second argument used to be an optional `calculateChangedBits`\n // function. Warn to reserve for future use?\n var context = {\n $$typeof: REACT_CONTEXT_TYPE,\n // As a workaround to support multiple concurrent renderers, we categorize\n // some renderers as primary and others as secondary. We only expect\n // there to be two concurrent renderers at most: React Native (primary) and\n // Fabric (secondary); React DOM (primary) and React ART (secondary).\n // Secondary renderers store their context values on separate fields.\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n // Used to track how many concurrent renderers this context currently\n // supports within in a single renderer. Such as parallel server rendering.\n _threadCount: 0,\n // These are circular\n Provider: null,\n Consumer: null,\n // Add these to use same hidden class in VM as ServerContext\n _defaultValue: null,\n _globalName: null\n };\n context.Provider = {\n $$typeof: REACT_PROVIDER_TYPE,\n _context: context\n };\n var hasWarnedAboutUsingNestedContextConsumers = false;\n var hasWarnedAboutUsingConsumerProvider = false;\n var hasWarnedAboutDisplayNameOnConsumer = false;\n\n {\n // A separate object, but proxies back to the original context object for\n // backwards compatibility. It has a different $$typeof, so we can properly\n // warn for the incorrect usage of Context as a Consumer.\n var Consumer = {\n $$typeof: REACT_CONTEXT_TYPE,\n _context: context\n }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here\n\n Object.defineProperties(Consumer, {\n Provider: {\n get: function () {\n if (!hasWarnedAboutUsingConsumerProvider) {\n hasWarnedAboutUsingConsumerProvider = true;\n\n error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');\n }\n\n return context.Provider;\n },\n set: function (_Provider) {\n context.Provider = _Provider;\n }\n },\n _currentValue: {\n get: function () {\n return context._currentValue;\n },\n set: function (_currentValue) {\n context._currentValue = _currentValue;\n }\n },\n _currentValue2: {\n get: function () {\n return context._currentValue2;\n },\n set: function (_currentValue2) {\n context._currentValue2 = _currentValue2;\n }\n },\n _threadCount: {\n get: function () {\n return context._threadCount;\n },\n set: function (_threadCount) {\n context._threadCount = _threadCount;\n }\n },\n Consumer: {\n get: function () {\n if (!hasWarnedAboutUsingNestedContextConsumers) {\n hasWarnedAboutUsingNestedContextConsumers = true;\n\n error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n }\n\n return context.Consumer;\n }\n },\n displayName: {\n get: function () {\n return context.displayName;\n },\n set: function (displayName) {\n if (!hasWarnedAboutDisplayNameOnConsumer) {\n warn('Setting `displayName` on Context.Consumer has no effect. ' + \"You should set it directly on the context with Context.displayName = '%s'.\", displayName);\n\n hasWarnedAboutDisplayNameOnConsumer = true;\n }\n }\n }\n }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty\n\n context.Consumer = Consumer;\n }\n\n {\n context._currentRenderer = null;\n context._currentRenderer2 = null;\n }\n\n return context;\n}\n\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\n\nfunction lazyInitializer(payload) {\n if (payload._status === Uninitialized) {\n var ctor = payload._result;\n var thenable = ctor(); // Transition to the next state.\n // This might throw either because it's missing or throws. If so, we treat it\n // as still uninitialized and try again next time. Which is the same as what\n // happens if the ctor or any wrappers processing the ctor throws. This might\n // end up fixing it if the resolution was a concurrency bug.\n\n thenable.then(function (moduleObject) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var resolved = payload;\n resolved._status = Resolved;\n resolved._result = moduleObject;\n }\n }, function (error) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var rejected = payload;\n rejected._status = Rejected;\n rejected._result = error;\n }\n });\n\n if (payload._status === Uninitialized) {\n // In case, we're still uninitialized, then we're waiting for the thenable\n // to resolve. Set it as pending in the meantime.\n var pending = payload;\n pending._status = Pending;\n pending._result = thenable;\n }\n }\n\n if (payload._status === Resolved) {\n var moduleObject = payload._result;\n\n {\n if (moduleObject === undefined) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\\n\\n\" + 'Did you accidentally put curly braces around the import?', moduleObject);\n }\n }\n\n {\n if (!('default' in moduleObject)) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\", moduleObject);\n }\n }\n\n return moduleObject.default;\n } else {\n throw payload._result;\n }\n}\n\nfunction lazy(ctor) {\n var payload = {\n // We use these fields to store the result.\n _status: Uninitialized,\n _result: ctor\n };\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _payload: payload,\n _init: lazyInitializer\n };\n\n {\n // In production, this would just set it on the object.\n var defaultProps;\n var propTypes; // $FlowFixMe\n\n Object.defineProperties(lazyType, {\n defaultProps: {\n configurable: true,\n get: function () {\n return defaultProps;\n },\n set: function (newDefaultProps) {\n error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n defaultProps = newDefaultProps; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'defaultProps', {\n enumerable: true\n });\n }\n },\n propTypes: {\n configurable: true,\n get: function () {\n return propTypes;\n },\n set: function (newPropTypes) {\n error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n propTypes = newPropTypes; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'propTypes', {\n enumerable: true\n });\n }\n }\n });\n }\n\n return lazyType;\n}\n\nfunction forwardRef(render) {\n {\n if (render != null && render.$$typeof === REACT_MEMO_TYPE) {\n error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');\n } else if (typeof render !== 'function') {\n error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);\n } else {\n if (render.length !== 0 && render.length !== 2) {\n error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');\n }\n }\n\n if (render != null) {\n if (render.defaultProps != null || render.propTypes != null) {\n error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');\n }\n }\n }\n\n var elementType = {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: render\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.forwardRef((props, ref) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!render.name && !render.displayName) {\n render.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction memo(type, compare) {\n {\n if (!isValidElementType(type)) {\n error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);\n }\n }\n\n var elementType = {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: compare === undefined ? null : compare\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.memo((props) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!type.name && !type.displayName) {\n type.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nfunction resolveDispatcher() {\n var dispatcher = ReactCurrentDispatcher.current;\n\n {\n if (dispatcher === null) {\n error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\\n' + '2. You might be breaking the Rules of Hooks\\n' + '3. You might have more than one copy of React in the same app\\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');\n }\n } // Will result in a null access error if accessed outside render phase. We\n // intentionally don't throw our own error because this is in a hot path.\n // Also helps ensure this is inlined.\n\n\n return dispatcher;\n}\nfunction useContext(Context) {\n var dispatcher = resolveDispatcher();\n\n {\n // TODO: add a more generic warning for invalid values.\n if (Context._context !== undefined) {\n var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs\n // and nobody should be using this in existing code.\n\n if (realContext.Consumer === Context) {\n error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');\n } else if (realContext.Provider === Context) {\n error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');\n }\n }\n }\n\n return dispatcher.useContext(Context);\n}\nfunction useState(initialState) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useState(initialState);\n}\nfunction useReducer(reducer, initialArg, init) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useReducer(reducer, initialArg, init);\n}\nfunction useRef(initialValue) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useRef(initialValue);\n}\nfunction useEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useEffect(create, deps);\n}\nfunction useInsertionEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useInsertionEffect(create, deps);\n}\nfunction useLayoutEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useLayoutEffect(create, deps);\n}\nfunction useCallback(callback, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useCallback(callback, deps);\n}\nfunction useMemo(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useMemo(create, deps);\n}\nfunction useImperativeHandle(ref, create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useImperativeHandle(ref, create, deps);\n}\nfunction useDebugValue(value, formatterFn) {\n {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDebugValue(value, formatterFn);\n }\n}\nfunction useTransition() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useTransition();\n}\nfunction useDeferredValue(value) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDeferredValue(value);\n}\nfunction useId() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useId();\n}\nfunction useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher$1.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher$1.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n setExtraStackFrame(stack);\n } else {\n setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n if (ReactCurrentOwner.current) {\n var name = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendumForProps(elementProps) {\n if (elementProps !== null && elementProps !== undefined) {\n return getSourceInfoErrorAddendum(elementProps.__source);\n }\n\n return '';\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n {\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\nfunction createElementWithValidation(type, props, children) {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendumForProps(props);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n {\n error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n }\n\n var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], type);\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n}\nvar didWarnAboutDeprecatedCreateFactory = false;\nfunction createFactoryWithValidation(type) {\n var validatedFactory = createElementWithValidation.bind(null, type);\n validatedFactory.type = type;\n\n {\n if (!didWarnAboutDeprecatedCreateFactory) {\n didWarnAboutDeprecatedCreateFactory = true;\n\n warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');\n } // Legacy hook: remove it\n\n\n Object.defineProperty(validatedFactory, 'type', {\n enumerable: false,\n get: function () {\n warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');\n\n Object.defineProperty(this, 'type', {\n value: type\n });\n return type;\n }\n });\n }\n\n return validatedFactory;\n}\nfunction cloneElementWithValidation(element, props, children) {\n var newElement = cloneElement.apply(this, arguments);\n\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], newElement.type);\n }\n\n validatePropTypes(newElement);\n return newElement;\n}\n\nfunction startTransition(scope, options) {\n var prevTransition = ReactCurrentBatchConfig.transition;\n ReactCurrentBatchConfig.transition = {};\n var currentTransition = ReactCurrentBatchConfig.transition;\n\n {\n ReactCurrentBatchConfig.transition._updatedFibers = new Set();\n }\n\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.transition = prevTransition;\n\n {\n if (prevTransition === null && currentTransition._updatedFibers) {\n var updatedFibersCount = currentTransition._updatedFibers.size;\n\n if (updatedFibersCount > 10) {\n warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');\n }\n\n currentTransition._updatedFibers.clear();\n }\n }\n }\n}\n\nvar didWarnAboutMessageChannel = false;\nvar enqueueTaskImpl = null;\nfunction enqueueTask(task) {\n if (enqueueTaskImpl === null) {\n try {\n // read require off the module object to get around the bundlers.\n // we don't want them to detect a require and bundle a Node polyfill.\n var requireString = ('require' + Math.random()).slice(0, 7);\n var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's\n // version of setImmediate, bypassing fake timers if any.\n\n enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;\n } catch (_err) {\n // we're in a browser\n // we can't use regular timers because they may still be faked\n // so we try MessageChannel+postMessage instead\n enqueueTaskImpl = function (callback) {\n {\n if (didWarnAboutMessageChannel === false) {\n didWarnAboutMessageChannel = true;\n\n if (typeof MessageChannel === 'undefined') {\n error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');\n }\n }\n }\n\n var channel = new MessageChannel();\n channel.port1.onmessage = callback;\n channel.port2.postMessage(undefined);\n };\n }\n }\n\n return enqueueTaskImpl(task);\n}\n\nvar actScopeDepth = 0;\nvar didWarnNoAwaitAct = false;\nfunction act(callback) {\n {\n // `act` calls can be nested, so we track the depth. This represents the\n // number of `act` scopes on the stack.\n var prevActScopeDepth = actScopeDepth;\n actScopeDepth++;\n\n if (ReactCurrentActQueue.current === null) {\n // This is the outermost `act` scope. Initialize the queue. The reconciler\n // will detect the queue and use it instead of Scheduler.\n ReactCurrentActQueue.current = [];\n }\n\n var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;\n var result;\n\n try {\n // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only\n // set to `true` while the given callback is executed, not for updates\n // triggered during an async event, because this is how the legacy\n // implementation of `act` behaved.\n ReactCurrentActQueue.isBatchingLegacy = true;\n result = callback(); // Replicate behavior of original `act` implementation in legacy mode,\n // which flushed updates immediately after the scope function exits, even\n // if it's an async function.\n\n if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n ReactCurrentActQueue.didScheduleLegacyUpdate = false;\n flushActQueue(queue);\n }\n }\n } catch (error) {\n popActScope(prevActScopeDepth);\n throw error;\n } finally {\n ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;\n }\n\n if (result !== null && typeof result === 'object' && typeof result.then === 'function') {\n var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait\n // for it to resolve before exiting the current scope.\n\n var wasAwaited = false;\n var thenable = {\n then: function (resolve, reject) {\n wasAwaited = true;\n thenableResult.then(function (returnValue) {\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // We've exited the outermost act scope. Recursively flush the\n // queue until there's no remaining work.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }, function (error) {\n // The callback threw an error.\n popActScope(prevActScopeDepth);\n reject(error);\n });\n }\n };\n\n {\n if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {\n // eslint-disable-next-line no-undef\n Promise.resolve().then(function () {}).then(function () {\n if (!wasAwaited) {\n didWarnNoAwaitAct = true;\n\n error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');\n }\n });\n }\n }\n\n return thenable;\n } else {\n var returnValue = result; // The callback is not an async function. Exit the current scope\n // immediately, without awaiting.\n\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // Exiting the outermost act scope. Flush the queue.\n var _queue = ReactCurrentActQueue.current;\n\n if (_queue !== null) {\n flushActQueue(_queue);\n ReactCurrentActQueue.current = null;\n } // Return a thenable. If the user awaits it, we'll flush again in\n // case additional work was scheduled by a microtask.\n\n\n var _thenable = {\n then: function (resolve, reject) {\n // Confirm we haven't re-entered another `act` scope, in case\n // the user does something weird like await the thenable\n // multiple times.\n if (ReactCurrentActQueue.current === null) {\n // Recursively flush the queue until there's no remaining work.\n ReactCurrentActQueue.current = [];\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }\n };\n return _thenable;\n } else {\n // Since we're inside a nested `act` scope, the returned thenable\n // immediately resolves. The outer scope will flush the queue.\n var _thenable2 = {\n then: function (resolve, reject) {\n resolve(returnValue);\n }\n };\n return _thenable2;\n }\n }\n }\n}\n\nfunction popActScope(prevActScopeDepth) {\n {\n if (prevActScopeDepth !== actScopeDepth - 1) {\n error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');\n }\n\n actScopeDepth = prevActScopeDepth;\n }\n}\n\nfunction recursivelyFlushAsyncActWork(returnValue, resolve, reject) {\n {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n try {\n flushActQueue(queue);\n enqueueTask(function () {\n if (queue.length === 0) {\n // No additional work was scheduled. Finish.\n ReactCurrentActQueue.current = null;\n resolve(returnValue);\n } else {\n // Keep flushing work until there's none left.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n }\n });\n } catch (error) {\n reject(error);\n }\n } else {\n resolve(returnValue);\n }\n }\n}\n\nvar isFlushing = false;\n\nfunction flushActQueue(queue) {\n {\n if (!isFlushing) {\n // Prevent re-entrance.\n isFlushing = true;\n var i = 0;\n\n try {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n\n do {\n callback = callback(true);\n } while (callback !== null);\n }\n\n queue.length = 0;\n } catch (error) {\n // If something throws, leave the remaining callbacks on the queue.\n queue = queue.slice(i + 1);\n throw error;\n } finally {\n isFlushing = false;\n }\n }\n }\n}\n\nvar createElement$1 = createElementWithValidation ;\nvar cloneElement$1 = cloneElementWithValidation ;\nvar createFactory = createFactoryWithValidation ;\nvar Children = {\n map: mapChildren,\n forEach: forEachChildren,\n count: countChildren,\n toArray: toArray,\n only: onlyChild\n};\n\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;\nexports.cloneElement = cloneElement$1;\nexports.createContext = createContext;\nexports.createElement = createElement$1;\nexports.createFactory = createFactory;\nexports.createRef = createRef;\nexports.forwardRef = forwardRef;\nexports.isValidElement = isValidElement;\nexports.lazy = lazy;\nexports.memo = memo;\nexports.startTransition = startTransition;\nexports.unstable_act = act;\nexports.useCallback = useCallback;\nexports.useContext = useContext;\nexports.useDebugValue = useDebugValue;\nexports.useDeferredValue = useDeferredValue;\nexports.useEffect = useEffect;\nexports.useId = useId;\nexports.useImperativeHandle = useImperativeHandle;\nexports.useInsertionEffect = useInsertionEffect;\nexports.useLayoutEffect = useLayoutEffect;\nexports.useMemo = useMemo;\nexports.useReducer = useReducer;\nexports.useRef = useRef;\nexports.useState = useState;\nexports.useSyncExternalStore = useSyncExternalStore;\nexports.useTransition = useTransition;\nexports.version = ReactVersion;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.min.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.isUndefined = exports.fixName = exports.validateName = exports.validateSingleChar = exports.fixChar = exports.validateChar = void 0;\r\n/**\r\n * Returns true if the specified string only contains characters permitted by\r\n * the XML specification.\r\n */\r\nfunction validateChar(str) {\r\n for (var i = 0; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD)) {\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n return false;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n i++;\r\n continue;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}\r\nexports.validateChar = validateChar;\r\n/**\r\n * Returns a version of the specified string that only contains characters\r\n * permitted by the XML specification, with invalid characters replaced\r\n * by the replacement character U+FFFD.\r\n */\r\nfunction fixChar(str) {\r\n var newStr = \"\";\r\n for (var i = 0; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD)) {\r\n newStr += str[i];\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n newStr += \"\\uFFFD\";\r\n return newStr;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n newStr += str[i] + str[i + 1];\r\n i++;\r\n continue;\r\n }\r\n newStr += \"\\uFFFD\";\r\n }\r\n return newStr;\r\n}\r\nexports.fixChar = fixChar;\r\n/**\r\n * Returns true if the specified string only contains a single character, and\r\n * that this character is permitted by the XML specification.\r\n */\r\nfunction validateSingleChar(str) {\r\n if (str.length === 0) {\r\n return false;\r\n }\r\n var firstChar = str.charCodeAt(0);\r\n if (str.length === 1) {\r\n return (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD));\r\n }\r\n if (str.length !== 2) {\r\n return false;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(1);\r\n return ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF));\r\n}\r\nexports.validateSingleChar = validateSingleChar;\r\n/**\r\n * Returns true if the specified string only contains characters permitted by\r\n * the XML specification for names.\r\n */\r\nfunction validateName(str) {\r\n if (str.length === 0) {\r\n return false;\r\n }\r\n var initialFirstChar = str.charCodeAt(0);\r\n var initialFirstCharMatch = (initialFirstChar === 0x3A\r\n || initialFirstChar === 0x5F\r\n || (initialFirstChar >= 0x41 && initialFirstChar <= 0x5A)\r\n || (initialFirstChar >= 0x61 && initialFirstChar <= 0x7A)\r\n || (initialFirstChar >= 0xC0 && initialFirstChar <= 0xD6)\r\n || (initialFirstChar >= 0xD8 && initialFirstChar <= 0xF6)\r\n || (initialFirstChar >= 0XF8 && initialFirstChar <= 0X2FF)\r\n || (initialFirstChar >= 0x370 && initialFirstChar <= 0x37D)\r\n || (initialFirstChar >= 0x37F && initialFirstChar <= 0X1FFF)\r\n || (initialFirstChar >= 0x200C && initialFirstChar <= 0x200D)\r\n || (initialFirstChar >= 0x2070 && initialFirstChar <= 0x218F)\r\n || (initialFirstChar >= 0x2C00 && initialFirstChar <= 0x2FEF)\r\n || (initialFirstChar >= 0x3001 && initialFirstChar <= 0xD7FF)\r\n || (initialFirstChar >= 0xF900 && initialFirstChar <= 0xFDCF)\r\n || (initialFirstChar >= 0xFDF0 && initialFirstChar <= 0xFFFD));\r\n if (str.length === 1) {\r\n return initialFirstCharMatch;\r\n }\r\n // UTF-16 surrogate characters\r\n var initialSecondChar = str.charCodeAt(1);\r\n var initialSecondCharMatch = ((initialFirstChar >= 0xD800 && initialFirstChar <= 0xDB7F)\r\n && (initialSecondChar >= 0xDC00 && initialSecondChar <= 0xDFFF));\r\n if (!initialFirstCharMatch && !initialSecondCharMatch) {\r\n return false;\r\n }\r\n var start = initialSecondCharMatch ? 2 : 1;\r\n for (var i = start; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x3A\r\n || firstChar === 0x5F\r\n || firstChar === 0x2D\r\n || firstChar === 0x2E\r\n || firstChar === 0xB7\r\n || (firstChar >= 0x30 && firstChar <= 0x39)\r\n || (firstChar >= 0x41 && firstChar <= 0x5A)\r\n || (firstChar >= 0x61 && firstChar <= 0x7A)\r\n || (firstChar >= 0xC0 && firstChar <= 0xD6)\r\n || (firstChar >= 0xD8 && firstChar <= 0xF6)\r\n || (firstChar >= 0XF8 && firstChar <= 0X2FF)\r\n || (firstChar >= 0x300 && firstChar <= 0x36F)\r\n || (firstChar >= 0x370 && firstChar <= 0x37D)\r\n || (firstChar >= 0x37F && firstChar <= 0X1FFF)\r\n || (firstChar >= 0x200C && firstChar <= 0x200D)\r\n || (firstChar >= 0x203F && firstChar <= 0x2040)\r\n || (firstChar >= 0x2070 && firstChar <= 0x218F)\r\n || (firstChar >= 0x2C00 && firstChar <= 0x2FEF)\r\n || (firstChar >= 0x3001 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xF900 && firstChar <= 0xFDCF)\r\n || (firstChar >= 0xFDF0 && firstChar <= 0xFFFD)) {\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n return false;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDB7F)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n i++;\r\n continue;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}\r\nexports.validateName = validateName;\r\n/**\r\n * Returns a version of the specified string that only contains characters\r\n * permitted by the XML specification for names, with invalid characters\r\n * replaced by the replacement character U+FFFD.\r\n */\r\nfunction fixName(str) {\r\n var newStr = \"\";\r\n if (str.length === 0) {\r\n return newStr;\r\n }\r\n var initialFirstChar = str.charCodeAt(0);\r\n var initialFirstCharMatch = (initialFirstChar === 0x3A\r\n || initialFirstChar === 0x5F\r\n || (initialFirstChar >= 0x41 && initialFirstChar <= 0x5A)\r\n || (initialFirstChar >= 0x61 && initialFirstChar <= 0x7A)\r\n || (initialFirstChar >= 0xC0 && initialFirstChar <= 0xD6)\r\n || (initialFirstChar >= 0xD8 && initialFirstChar <= 0xF6)\r\n || (initialFirstChar >= 0XF8 && initialFirstChar <= 0X2FF)\r\n || (initialFirstChar >= 0x370 && initialFirstChar <= 0x37D)\r\n || (initialFirstChar >= 0x37F && initialFirstChar <= 0X1FFF)\r\n || (initialFirstChar >= 0x200C && initialFirstChar <= 0x200D)\r\n || (initialFirstChar >= 0x2070 && initialFirstChar <= 0x218F)\r\n || (initialFirstChar >= 0x2C00 && initialFirstChar <= 0x2FEF)\r\n || (initialFirstChar >= 0x3001 && initialFirstChar <= 0xD7FF)\r\n || (initialFirstChar >= 0xF900 && initialFirstChar <= 0xFDCF)\r\n || (initialFirstChar >= 0xFDF0 && initialFirstChar <= 0xFFFD));\r\n if (str.length === 1) {\r\n if (initialFirstCharMatch) {\r\n newStr = str[0];\r\n }\r\n else {\r\n newStr = \"\\uFFFD\";\r\n }\r\n return newStr;\r\n }\r\n // UTF-16 surrogate characters\r\n var initialSecondChar = str.charCodeAt(1);\r\n var initialSecondCharMatch = ((initialFirstChar >= 0xD800 && initialFirstChar <= 0xDB7F)\r\n && (initialSecondChar >= 0xDC00 && initialSecondChar <= 0xDFFF));\r\n if (initialSecondCharMatch) {\r\n newStr = str[0] + str[1];\r\n }\r\n else if (initialFirstCharMatch) {\r\n newStr = str[0];\r\n }\r\n else {\r\n newStr = \"\\uFFFD\";\r\n }\r\n var start = initialSecondCharMatch ? 2 : 1;\r\n for (var i = start; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x3A\r\n || firstChar === 0x5F\r\n || firstChar === 0x2D\r\n || firstChar === 0x2E\r\n || firstChar === 0xB7\r\n || (firstChar >= 0x30 && firstChar <= 0x39)\r\n || (firstChar >= 0x41 && firstChar <= 0x5A)\r\n || (firstChar >= 0x61 && firstChar <= 0x7A)\r\n || (firstChar >= 0xC0 && firstChar <= 0xD6)\r\n || (firstChar >= 0xD8 && firstChar <= 0xF6)\r\n || (firstChar >= 0XF8 && firstChar <= 0X2FF)\r\n || (firstChar >= 0x300 && firstChar <= 0x36F)\r\n || (firstChar >= 0x370 && firstChar <= 0x37D)\r\n || (firstChar >= 0x37F && firstChar <= 0X1FFF)\r\n || (firstChar >= 0x200C && firstChar <= 0x200D)\r\n || (firstChar >= 0x203F && firstChar <= 0x2040)\r\n || (firstChar >= 0x2070 && firstChar <= 0x218F)\r\n || (firstChar >= 0x2C00 && firstChar <= 0x2FEF)\r\n || (firstChar >= 0x3001 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xF900 && firstChar <= 0xFDCF)\r\n || (firstChar >= 0xFDF0 && firstChar <= 0xFFFD)) {\r\n newStr += str[i];\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n newStr += \"\\uFFFD\";\r\n return newStr;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDB7F)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n newStr += str[i] + str[i + 1];\r\n i++;\r\n continue;\r\n }\r\n newStr += \"\\uFFFD\";\r\n }\r\n return newStr;\r\n}\r\nexports.fixName = fixName;\r\n/**\r\n * Returns true if the specified value is undefined.\r\n */\r\nfunction isUndefined(val) {\r\n return Object.prototype.toString.call(val) === \"[object Undefined]\";\r\n}\r\nexports.isUndefined = isUndefined;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StringOptions = void 0;\r\nvar validate_1 = require(\"./validate\");\r\n/**\r\n * Implementation of the IStringOptions interface used to provide default\r\n * values to fields.\r\n */\r\nvar StringOptions = /** @class */ (function () {\r\n function StringOptions(options) {\r\n this.doubleQuotes = false;\r\n this.indent = \" \";\r\n this.newline = \"\\n\";\r\n this.pretty = true;\r\n if (!(0, validate_1.isUndefined)(options.doubleQuotes)) {\r\n this.doubleQuotes = options.doubleQuotes;\r\n }\r\n if (!(0, validate_1.isUndefined)(options.indent)) {\r\n this.indent = options.indent;\r\n }\r\n if (!(0, validate_1.isUndefined)(options.newline)) {\r\n this.newline = options.newline;\r\n }\r\n if (!(0, validate_1.isUndefined)(options.pretty)) {\r\n this.pretty = options.pretty;\r\n }\r\n }\r\n return StringOptions;\r\n}());\r\nexports.StringOptions = StringOptions;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2018 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.escapeDoubleQuotes = exports.escapeSingleQuotes = exports.escapeRightAngleBracketsInCdataTerminator = exports.escapeLeftAngleBrackets = exports.escapeAmpersands = void 0;\r\n/**\r\n * Replaces ampersands (&) with the appropriate XML character reference.\r\n */\r\nfunction escapeAmpersands(str) {\r\n return str.replace(/&/g, \"&amp;\");\r\n}\r\nexports.escapeAmpersands = escapeAmpersands;\r\n/**\r\n * Replaces left angle brackets (&lt;) with the appropriate XML character\r\n * reference.\r\n */\r\nfunction escapeLeftAngleBrackets(str) {\r\n return str.replace(/</g, \"&lt;\");\r\n}\r\nexports.escapeLeftAngleBrackets = escapeLeftAngleBrackets;\r\n/**\r\n * Replaces right angle brackets (&gt;) with the appropriate XML character\r\n * reference when part of the string \"]]>\".\r\n */\r\nfunction escapeRightAngleBracketsInCdataTerminator(str) {\r\n return str.replace(/]]>/g, \"]]&gt;\");\r\n}\r\nexports.escapeRightAngleBracketsInCdataTerminator = escapeRightAngleBracketsInCdataTerminator;\r\n/**\r\n * Replaces single quotes (\") with the appropriate XML character reference.\r\n */\r\nfunction escapeSingleQuotes(str) {\r\n return str.replace(/'/g, \"&apos;\");\r\n}\r\nexports.escapeSingleQuotes = escapeSingleQuotes;\r\n/**\r\n * Replaces double quotes (\") with the appropriate XML character reference.\r\n */\r\nfunction escapeDoubleQuotes(str) {\r\n return str.replace(/\"/g, \"&quot;\");\r\n}\r\nexports.escapeDoubleQuotes = escapeDoubleQuotes;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar escape_1 = require(\"../escape\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents text in an attribute value.\r\n *\r\n * Restricted characters, such as the ampersand (`&`) and the opening angle\r\n * bracket (`<`), are all automatically escaped.\r\n */\r\nvar XmlAttributeText = /** @class */ (function () {\r\n function XmlAttributeText(parent, validation, options) {\r\n this._validation = validation;\r\n if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInCharData)) {\r\n this._replaceInvalidCharsInCharData = (options.replaceInvalidCharsInCharData);\r\n }\r\n else {\r\n this._replaceInvalidCharsInCharData = false;\r\n }\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlAttributeText.prototype, \"charData\", {\r\n /**\r\n * Gets this attribute text.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets this attribute text.\r\n */\r\n set: function (charData) {\r\n if (this._replaceInvalidCharsInCharData) {\r\n charData = (0, validate_1.fixChar)(charData);\r\n }\r\n else if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": attribute text\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain characters not\")\r\n + \" allowed in XML\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this attribute text.\r\n */\r\n XmlAttributeText.prototype.toString = function () {\r\n var str = this._charData;\r\n str = (0, escape_1.escapeAmpersands)(str);\r\n str = (0, escape_1.escapeLeftAngleBrackets)(str);\r\n return str;\r\n };\r\n /**\r\n * Returns the parent of this attribute text.\r\n */\r\n XmlAttributeText.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlAttributeText;\r\n}());\r\nexports.default = XmlAttributeText;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a character reference.\r\n *\r\n * A character reference is structured as follows, where `{dec}` is the\r\n * decimal representation code point corresponding to a particular Unicode\r\n * character:\r\n *\r\n * ```xml\r\n * &#{dec};\r\n * ```\r\n *\r\n * The corresponding hexadecimal version is structured as follows, where\r\n * `{hex}` is the hexadecimal representation code point corresponding to a\r\n * particular Unicode character:\r\n *\r\n * ```xml\r\n * &#x{hex};\r\n * ```\r\n *\r\n * Unicode characters outside of the Basic Multilingual Plane are represented\r\n * using a surrogate pair consisting of two character references.\r\n *\r\n * The `{dec}` and `{hex}` values are defined by the `char` and `hex`\r\n * properties of this node; the former is the character to be represented while\r\n * the latter indicates whether the decimal or hexadecimal representation\r\n * should be used.\r\n */\r\nvar XmlCharRef = /** @class */ (function () {\r\n function XmlCharRef(parent, validation, options) {\r\n this._hex = false;\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.char = options.char;\r\n if (!(0, validate_1.isUndefined)(options.hex)) {\r\n this.hex = options.hex;\r\n }\r\n }\r\n Object.defineProperty(XmlCharRef.prototype, \"char\", {\r\n /**\r\n * Gets the character of this character reference.\r\n */\r\n get: function () {\r\n return this._char;\r\n },\r\n /**\r\n * Sets the character of this character reference.\r\n */\r\n set: function (char) {\r\n if (this._validation && !(0, validate_1.validateSingleChar)(char)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": character reference\"\r\n + (\" \\\"\" + char + \"\\\" should reference a single character,\")\r\n + \" and this character should be allowed in XML\");\r\n }\r\n this._char = char;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(XmlCharRef.prototype, \"hex\", {\r\n /**\r\n * Gets whether the decimal or hexadecimal representation should be used\r\n * for this character reference.\r\n */\r\n get: function () {\r\n return this._hex;\r\n },\r\n /**\r\n * Sets whether the decimal or hexadecimal representation should be used\r\n * for this character reference.\r\n */\r\n set: function (hex) {\r\n this._hex = hex;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this character reference.\r\n */\r\n XmlCharRef.prototype.toString = function () {\r\n var char;\r\n if (this._char.length === 1) {\r\n char = this._char.charCodeAt(0);\r\n }\r\n else {\r\n var first = this._char.charCodeAt(0);\r\n if (first >= 0xD800 && first <= 0xDBFF && this._char.length > 1) {\r\n var second = this._char.charCodeAt(1);\r\n if (second >= 0xDC00 && second <= 0xDFFF) {\r\n char = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\r\n }\r\n else {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": character\"\r\n + (\" reference \\\"\" + this.char + \"\\\" should\")\r\n + \" reference a valid Unicode character\");\r\n }\r\n }\r\n else {\r\n char = first;\r\n }\r\n }\r\n if (this._hex) {\r\n return \"&#x\" + char.toString(16) + \";\";\r\n }\r\n else {\r\n return \"&#\" + char + \";\";\r\n }\r\n };\r\n /**\r\n * Returns the parent of this character reference.\r\n */\r\n XmlCharRef.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlCharRef;\r\n}());\r\nexports.default = XmlCharRef;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents an entity reference.\r\n *\r\n * An entity reference is structured as follows, where `{name}` is the name of\r\n * the entity to be referenced:\r\n *\r\n * ```xml\r\n * &{entity};\r\n * ```\r\n */\r\nvar XmlEntityRef = /** @class */ (function () {\r\n function XmlEntityRef(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.name = options.name;\r\n }\r\n Object.defineProperty(XmlEntityRef.prototype, \"name\", {\r\n /**\r\n * Gets the name of this entity reference.\r\n */\r\n get: function () {\r\n return this._name;\r\n },\r\n /**\r\n * Sets the name of this entity reference.\r\n */\r\n set: function (name) {\r\n if (this._validation && !(0, validate_1.validateName)(name)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": entity reference name\"\r\n + (\" \\\"\" + name + \"\\\" should not contain characters not\")\r\n + \" allowed in XML names\");\r\n }\r\n this._name = name;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this entity reference.\r\n */\r\n XmlEntityRef.prototype.toString = function () {\r\n return \"&\" + this._name + \";\";\r\n };\r\n /**\r\n * Returns the parent of this entity reference.\r\n */\r\n XmlEntityRef.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlEntityRef;\r\n}());\r\nexports.default = XmlEntityRef;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar escape_1 = require(\"../escape\");\r\nvar options_1 = require(\"../options\");\r\nvar validate_1 = require(\"../validate\");\r\nvar XmlAttributeText_1 = __importDefault(require(\"./XmlAttributeText\"));\r\nvar XmlCharRef_1 = __importDefault(require(\"./XmlCharRef\"));\r\nvar XmlEntityRef_1 = __importDefault(require(\"./XmlEntityRef\"));\r\n/**\r\n * Represents an attribute.\r\n *\r\n * An attribute is part of the start tag of an element and is\r\n * structured as follows, where `{name}` is the name of the attribute and\r\n * `{value}` is the value of the attribute:\r\n *\r\n * ```xml\r\n * <element {name}=\"{value}\">\r\n * ```\r\n *\r\n * The `{name}` value is a property of this node, while the `{value}` property\r\n * consists of the children of this node.\r\n *\r\n * Attributes can have an unlimited number of attribute text, character\r\n * references, and entity references.\r\n */\r\nvar XmlAttribute = /** @class */ (function () {\r\n function XmlAttribute(parent, validation, options) {\r\n this._validation = validation;\r\n if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInName)) {\r\n this._replaceInvalidCharsInName = options.replaceInvalidCharsInName;\r\n }\r\n else {\r\n this._replaceInvalidCharsInName = false;\r\n }\r\n this._children = [];\r\n this._parent = parent;\r\n this.name = options.name;\r\n }\r\n Object.defineProperty(XmlAttribute.prototype, \"name\", {\r\n /**\r\n * Gets the name of this attribute.\r\n */\r\n get: function () {\r\n return this._name;\r\n },\r\n /**\r\n * Sets the name of this attribute.\r\n */\r\n set: function (name) {\r\n if (this._replaceInvalidCharsInName) {\r\n name = (0, validate_1.fixName)(name);\r\n if (name.length === 0) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": attribute name\"\r\n + \" should not be empty\");\r\n }\r\n }\r\n else if (this._validation && !(0, validate_1.validateName)(name)) {\r\n if (name.length === 0) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": attribute name\"\r\n + \" should not be empty\");\r\n }\r\n else {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": attribute name\"\r\n + (\" \\\"\" + name + \"\\\" should not contain characters not\")\r\n + \" allowed in XML names\");\r\n }\r\n }\r\n this._name = name;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Adds a character reference to this attribute and returns the new\r\n * character reference.\r\n */\r\n XmlAttribute.prototype.charRef = function (options) {\r\n var charRef = new XmlCharRef_1.default(this, this._validation, options);\r\n this._children.push(charRef);\r\n return charRef;\r\n };\r\n /**\r\n * Adds an entity reference to this attribute and returns the new entity\r\n * reference.\r\n */\r\n XmlAttribute.prototype.entityRef = function (options) {\r\n var charRef = new XmlEntityRef_1.default(this, this._validation, options);\r\n this._children.push(charRef);\r\n return charRef;\r\n };\r\n /**\r\n * Adds attribute text to this attribute and returns the new text.\r\n */\r\n XmlAttribute.prototype.text = function (options) {\r\n var textNode = new XmlAttributeText_1.default(this, this._validation, options);\r\n this._children.push(textNode);\r\n return textNode;\r\n };\r\n /**\r\n * Returns an XML string representation of this attribute.\r\n */\r\n XmlAttribute.prototype.toString = function (options) {\r\n if (options === void 0) { options = {}; }\r\n var optionsObj = new options_1.StringOptions(options);\r\n var quote = optionsObj.doubleQuotes ? \"\\\"\" : \"'\";\r\n var str = this._name + \"=\" + quote;\r\n for (var _i = 0, _a = this._children; _i < _a.length; _i++) {\r\n var child = _a[_i];\r\n if (optionsObj.doubleQuotes) {\r\n str += (0, escape_1.escapeDoubleQuotes)(child.toString());\r\n }\r\n else {\r\n str += (0, escape_1.escapeSingleQuotes)(child.toString());\r\n }\r\n }\r\n str += quote;\r\n return str;\r\n };\r\n /**\r\n * Returns the parent of this attribute.\r\n */\r\n XmlAttribute.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlAttribute;\r\n}());\r\nexports.default = XmlAttribute;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents an attribute-list declaration in a document type definition.\r\n *\r\n * An attribute-list declaration is structured as follows, where `{text}`\r\n * is the text of the declaration:\r\n *\r\n * ```xml\r\n * <!ATTLIST {text}>\r\n * ```\r\n */\r\nvar XmlDtdAttlist = /** @class */ (function () {\r\n function XmlDtdAttlist(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlDtdAttlist.prototype, \"charData\", {\r\n /**\r\n * Gets the text of this entity declaration.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the text of this entity declaration.\r\n */\r\n set: function (charData) {\r\n if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": attribute-list\"\r\n + (\" declaration \\\"\" + charData + \"\\\" should not contain\")\r\n + \" characters not allowed in XML\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this entity declaration.\r\n */\r\n XmlDtdAttlist.prototype.toString = function () {\r\n return \"<!ATTLIST \" + this._charData + \">\";\r\n };\r\n /**\r\n * Returns the parent of this entity declaration.\r\n */\r\n XmlDtdAttlist.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlDtdAttlist;\r\n}());\r\nexports.default = XmlDtdAttlist;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents an element declaration in a document type definition.\r\n *\r\n * An element declaration is structured as follows, where `{text}` is the\r\n * text of the declaration:\r\n *\r\n * ```xml\r\n * <!ELEMENT {text}>\r\n * ```\r\n */\r\nvar XmlDtdElement = /** @class */ (function () {\r\n function XmlDtdElement(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlDtdElement.prototype, \"charData\", {\r\n /**\r\n * Gets the text of this element declaration.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the text of this element declaration.\r\n */\r\n set: function (charData) {\r\n if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": element declaration\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain characters\")\r\n + \" not allowed in XML\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this element declaration.\r\n */\r\n XmlDtdElement.prototype.toString = function () {\r\n return \"<!ELEMENT \" + this._charData + \">\";\r\n };\r\n /**\r\n * Returns the parent of this element declaration.\r\n */\r\n XmlDtdElement.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlDtdElement;\r\n}());\r\nexports.default = XmlDtdElement;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents an entity declaration in a document type definition.\r\n *\r\n * An entity declaration is structured as follows, where `{text}` is the\r\n * text of the declaration:\r\n *\r\n * ```xml\r\n * <!ENTITY {text}>\r\n * ```\r\n */\r\nvar XmlDtdEntity = /** @class */ (function () {\r\n function XmlDtdEntity(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlDtdEntity.prototype, \"charData\", {\r\n /**\r\n * Gets the text of this entity declaration.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the text of this entity declaration.\r\n */\r\n set: function (charData) {\r\n if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": entity declaration\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain characters\")\r\n + \" not allowed in XML\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this entity declaration.\r\n */\r\n XmlDtdEntity.prototype.toString = function () {\r\n return \"<!ENTITY \" + this._charData + \">\";\r\n };\r\n /**\r\n * Returns the parent of this entity declaration.\r\n */\r\n XmlDtdEntity.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlDtdEntity;\r\n}());\r\nexports.default = XmlDtdEntity;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a notation declaration in a document type definition.\r\n *\r\n * A notation declaration is structured as follows, where `{text}` is the\r\n * text of the declaration:\r\n *\r\n * ```xml\r\n * <!NOTATION {text}>\r\n * ```\r\n */\r\nvar XmlDtdNotation = /** @class */ (function () {\r\n function XmlDtdNotation(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlDtdNotation.prototype, \"charData\", {\r\n /**\r\n * Gets the text of this notation declaration.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the text of this notation declaration.\r\n */\r\n set: function (charData) {\r\n if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": notation declaration\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain characters\")\r\n + \" not allowed in XML\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this notation declaration.\r\n */\r\n XmlDtdNotation.prototype.toString = function () {\r\n return \"<!NOTATION \" + this._charData + \">\";\r\n };\r\n /**\r\n * Returns the parent of this notation declaration.\r\n */\r\n XmlDtdNotation.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlDtdNotation;\r\n}());\r\nexports.default = XmlDtdNotation;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a parameter entity reference in a document type definition.\r\n *\r\n * A parameter entity reference is structured as follows, where `{entity}`\r\n * is the name of the entity:\r\n *\r\n * ```xml\r\n * %{entity};\r\n * ```\r\n */\r\nvar XmlDtdParamEntityRef = /** @class */ (function () {\r\n function XmlDtdParamEntityRef(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.name = options.name;\r\n }\r\n Object.defineProperty(XmlDtdParamEntityRef.prototype, \"name\", {\r\n /**\r\n * Gets the name of this parameter entity reference.\r\n */\r\n get: function () {\r\n return this._name;\r\n },\r\n /**\r\n * Sets the name of this parameter entity reference.\r\n */\r\n set: function (name) {\r\n if (this._validation && !(0, validate_1.validateName)(name)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": parameter entity\"\r\n + (\" reference name \\\"\" + name + \"\\\" should not contain\")\r\n + \" characters not allowed in XML names\");\r\n }\r\n this._name = name;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this parameter entity reference.\r\n */\r\n XmlDtdParamEntityRef.prototype.toString = function () {\r\n return \"%\" + this._name + \";\";\r\n };\r\n /**\r\n * Returns the parent of this parameter entity reference.\r\n */\r\n XmlDtdParamEntityRef.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlDtdParamEntityRef;\r\n}());\r\nexports.default = XmlDtdParamEntityRef;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a processing instruction.\r\n *\r\n * A processing instruction is structured as follows, where `{target}` and\r\n * `{content}` are the target and content of the processing instruction\r\n * respectively:\r\n *\r\n * ```xml\r\n * <?{target} {content}?>\r\n * ```\r\n */\r\nvar XmlProcInst = /** @class */ (function () {\r\n function XmlProcInst(parent, validation, options) {\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.content = options.content;\r\n this.target = options.target;\r\n }\r\n Object.defineProperty(XmlProcInst.prototype, \"content\", {\r\n /**\r\n * Gets the content of this processing instruction.\r\n */\r\n get: function () {\r\n return this._content;\r\n },\r\n /**\r\n * Sets the content of this processing instruction.\r\n */\r\n set: function (content) {\r\n if (!(0, validate_1.isUndefined)(content)) {\r\n if (this._validation && !(0, validate_1.validateChar)(content)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": processing\"\r\n + (\" instruction content \\\"\" + content + \"\\\" should\")\r\n + \" not contain characters not allowed in XML\");\r\n }\r\n else if (this._validation && content.indexOf(\"?>\") !== -1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": processing\"\r\n + (\" instruction content \\\"\" + content + \"\\\" should\")\r\n + \" not contain the string '?>'\");\r\n }\r\n }\r\n this._content = content;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(XmlProcInst.prototype, \"target\", {\r\n /**\r\n * Gets the target of this processing instruction.\r\n */\r\n get: function () {\r\n return this._target;\r\n },\r\n /**\r\n * Sets the content of this processing instruction.\r\n */\r\n set: function (target) {\r\n if (this._validation && !(0, validate_1.validateName)(target)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": processing\"\r\n + (\" instruction target \\\"\" + target + \"\\\" should\")\r\n + \" not contain characters not allowed in XML\"\r\n + \" names\");\r\n }\r\n if (this._validation && target === \"xml\") {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": processing\"\r\n + (\" instruction target \\\"\" + target + \"\\\" should\")\r\n + \" not be the string 'xml'\");\r\n }\r\n this._target = target;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this processing instruction.\r\n */\r\n XmlProcInst.prototype.toString = function () {\r\n if ((0, validate_1.isUndefined)(this._content)) {\r\n return \"<?\" + this._target + \"?>\";\r\n }\r\n else {\r\n return \"<?\" + this._target + \" \" + this._content + \"?>\";\r\n }\r\n };\r\n /**\r\n * Returns the parent of this processing instruction.\r\n */\r\n XmlProcInst.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlProcInst;\r\n}());\r\nexports.default = XmlProcInst;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.validatePubId = void 0;\r\nvar error_1 = require(\"../error\");\r\nvar options_1 = require(\"../options\");\r\nvar validate_1 = require(\"../validate\");\r\nvar XmlComment_1 = __importDefault(require(\"./XmlComment\"));\r\nvar XmlDtdAttlist_1 = __importDefault(require(\"./XmlDtdAttlist\"));\r\nvar XmlDtdElement_1 = __importDefault(require(\"./XmlDtdElement\"));\r\nvar XmlDtdEntity_1 = __importDefault(require(\"./XmlDtdEntity\"));\r\nvar XmlDtdNotation_1 = __importDefault(require(\"./XmlDtdNotation\"));\r\nvar XmlDtdParamEntityRef_1 = __importDefault(require(\"./XmlDtdParamEntityRef\"));\r\nvar XmlProcInst_1 = __importDefault(require(\"./XmlProcInst\"));\r\n/**\r\n * Represents an XML document type definition (DTD).\r\n *\r\n * A document type definition is structured as follows, where `{name}` is\r\n * the name of the DTD, `{sysId}` is the system identifier of the DTD,\r\n * `{pubId}` is the public identifier of the DTD, and `{intSubset}` is the\r\n * internal subset of the DTD:\r\n *\r\n * ```xml\r\n * <!DOCTYPE {name} SYSTEM \"{sysId}\" PUBLIC \"{pubId}\" [\r\n * {intSubset}\r\n * ]>\r\n * ```\r\n *\r\n * DTDs can have an unlimited number of comments, attribute-list declarations,\r\n * element declarations, entity declarations, notation declarations, parameter\r\n * entity references, and processing instructions.\r\n */\r\nvar XmlDtd = /** @class */ (function () {\r\n function XmlDtd(parent, validation, options) {\r\n this._pubId = undefined;\r\n this._sysId = undefined;\r\n this._validation = validation;\r\n this._children = [];\r\n this._parent = parent;\r\n this.name = options.name;\r\n if (!(0, validate_1.isUndefined)(options.sysId)) {\r\n this.sysId = options.sysId;\r\n }\r\n if (!(0, validate_1.isUndefined)(options.pubId)) {\r\n this.pubId = options.pubId;\r\n }\r\n }\r\n Object.defineProperty(XmlDtd.prototype, \"name\", {\r\n /**\r\n * Gets the name of the DTD.\r\n */\r\n get: function () {\r\n return this._name;\r\n },\r\n /**\r\n * Sets the name of the DTD.\r\n */\r\n set: function (name) {\r\n if (this._validation && !(0, validate_1.validateName)(name)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": DTD name \\\"\" + name + \"\\\"\"\r\n + \" should not contain characters not allowed in\"\r\n + \" XML names\");\r\n }\r\n this._name = name;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(XmlDtd.prototype, \"pubId\", {\r\n /**\r\n * Gets the public identifier of the DTD.\r\n */\r\n get: function () {\r\n return this._pubId;\r\n },\r\n /**\r\n * Sets the public identifier of the DTD.\r\n */\r\n set: function (pubId) {\r\n if (!(0, validate_1.isUndefined)(pubId)) {\r\n if (this._validation && !validatePubId(pubId)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": DTD public\"\r\n + (\" identifier \\\"\" + pubId + \"\\\" should not contain\")\r\n + \" characters not allowed in public\"\r\n + \" identifiers\");\r\n }\r\n if (this._validation && (0, validate_1.isUndefined)(this._sysId)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": DTD public\"\r\n + (\" identifier \\\"\" + pubId + \"\\\" should not be defined\")\r\n + \" if system identifier is undefined\");\r\n }\r\n }\r\n this._pubId = pubId;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(XmlDtd.prototype, \"sysId\", {\r\n /**\r\n * Gets the system identifier of the DTD.\r\n */\r\n get: function () {\r\n return this._sysId;\r\n },\r\n /**\r\n * Sets the system identifier of the DTD.\r\n */\r\n set: function (sysId) {\r\n if (!(0, validate_1.isUndefined)(sysId)) {\r\n if (this._validation && !(0, validate_1.validateChar)(sysId)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": DTD system\"\r\n + (\" identifier \\\"\" + sysId + \"\\\" should not contain\")\r\n + \" characters not allowed in XML\");\r\n }\r\n else if (this._validation\r\n && sysId.indexOf(\"'\") !== -1\r\n && sysId.indexOf(\"\\\"\") !== -1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": DTD system\"\r\n + (\" identifier \\\"\" + sysId + \"\\\" should not contain\")\r\n + \" both single quotes and double quotes\");\r\n }\r\n }\r\n this._sysId = sysId;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Adds an attribute-list declaration to this document type declaration\r\n * and returns the new attribute-list declaration.\r\n */\r\n XmlDtd.prototype.attlist = function (options) {\r\n var attlist = new XmlDtdAttlist_1.default(this, this._validation, options);\r\n this._children.push(attlist);\r\n return attlist;\r\n };\r\n /**\r\n * Adds a comment to this document type declaration and returns the\r\n * new comment.\r\n */\r\n XmlDtd.prototype.comment = function (options) {\r\n var comment = new XmlComment_1.default(this, this._validation, options);\r\n this._children.push(comment);\r\n return comment;\r\n };\r\n /**\r\n * Adds an element declaration to this document type declaration\r\n * and returns the new element declaration.\r\n */\r\n XmlDtd.prototype.element = function (options) {\r\n var element = new XmlDtdElement_1.default(this, this._validation, options);\r\n this._children.push(element);\r\n return element;\r\n };\r\n /**\r\n * Adds an entity declaration to this document type declaration\r\n * and returns the new entity declaration.\r\n */\r\n XmlDtd.prototype.entity = function (options) {\r\n var entity = new XmlDtdEntity_1.default(this, this._validation, options);\r\n this._children.push(entity);\r\n return entity;\r\n };\r\n /**\r\n * Adds a notation declaration to this document type declaration\r\n * and returns the new notation declaration.\r\n */\r\n XmlDtd.prototype.notation = function (options) {\r\n var notation = new XmlDtdNotation_1.default(this, this._validation, options);\r\n this._children.push(notation);\r\n return notation;\r\n };\r\n /**\r\n * Adds a parameter entity reference to this document type declaration\r\n * and returns the new parameter entity reference.\r\n */\r\n XmlDtd.prototype.paramEntityRef = function (options) {\r\n var paramEntity = new XmlDtdParamEntityRef_1.default(this, this._validation, options);\r\n this._children.push(paramEntity);\r\n return paramEntity;\r\n };\r\n /**\r\n * Adds a processing instruction to this document type declaration\r\n * and returns the new processing instruction.\r\n */\r\n XmlDtd.prototype.procInst = function (options) {\r\n var procInst = new XmlProcInst_1.default(this, this._validation, options);\r\n this._children.push(procInst);\r\n return procInst;\r\n };\r\n /**\r\n * Returns an XML string representation of this document type declaration.\r\n */\r\n XmlDtd.prototype.toString = function (options) {\r\n if (options === void 0) { options = {}; }\r\n var optionsObj = new options_1.StringOptions(options);\r\n var str = \"<!DOCTYPE \" + this._name;\r\n if ((0, validate_1.isUndefined)(this._pubId)) {\r\n if (!(0, validate_1.isUndefined)(this._sysId)) {\r\n str += \" \";\r\n str = this.appendId(\"SYSTEM\", this._sysId, str, optionsObj);\r\n }\r\n }\r\n else {\r\n if ((0, validate_1.isUndefined)(this._sysId)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": DTD system\"\r\n + \" identifier is not undefined\");\r\n }\r\n str += \" \";\r\n str = this.appendId(\"PUBLIC\", this._pubId, str, optionsObj);\r\n str = this.appendId(\"\", this._sysId, str, optionsObj);\r\n }\r\n if (this._children.length !== 0) {\r\n str += \" [\";\r\n for (var _i = 0, _a = this._children; _i < _a.length; _i++) {\r\n var node = _a[_i];\r\n if (optionsObj.pretty) {\r\n str += optionsObj.newline + optionsObj.indent;\r\n }\r\n str += node.toString();\r\n }\r\n if (optionsObj.pretty) {\r\n str += optionsObj.newline;\r\n }\r\n str += \"]>\";\r\n }\r\n else {\r\n str += \">\";\r\n }\r\n return str;\r\n };\r\n /**\r\n * Returns the parent of this attribute.\r\n */\r\n XmlDtd.prototype.up = function () {\r\n return this._parent;\r\n };\r\n /**\r\n * Appends the XML string representation of a public or system identifier\r\n * to an existing string.\r\n */\r\n XmlDtd.prototype.appendId = function (type, value, str, options) {\r\n str += type + \" \";\r\n if (options.doubleQuotes) {\r\n if (this._validation && value.indexOf(\"\\\"\") !== -1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": doubleQuotes option\"\r\n + \" inconsistent with DTD system identifier or\"\r\n + \" public identifier\");\r\n }\r\n str += \"\\\"\" + value + \"\\\"\";\r\n }\r\n else {\r\n if (this._validation && value.indexOf(\"'\") !== -1) {\r\n throw new Error((0, error_1.getContext)(this) + \": doubleQuotes option\"\r\n + \" inconsistent with DTD system identifier or\"\r\n + \" public identifier\");\r\n }\r\n str += \"'\" + value + \"'\";\r\n }\r\n return str;\r\n };\r\n return XmlDtd;\r\n}());\r\nexports.default = XmlDtd;\r\n/**\r\n * Returns true if the specified public identifier only contains characters\r\n * permitted by the XML specification.\r\n */\r\nfunction validatePubId(str) {\r\n for (var i = 0; i < str.length; i++) {\r\n var char = str.charCodeAt(i);\r\n if (char === 0xA\r\n || char === 0xD\r\n || char === 0x20\r\n || char === 0x21\r\n || (char >= 0x23 && char <= 0x25)\r\n || (char >= 0x27 && char <= 0x2F)\r\n || (char >= 0x30 && char <= 0x39)\r\n || char === 0x3A\r\n || char === 0x3B\r\n || char === 0x3D\r\n || char === 0x3F\r\n || (char >= 0x40 && char <= 0x5A)\r\n || char === 0x5F\r\n || (char >= 0x61 && char <= 0x7A)) {\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n return false;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}\r\nexports.validatePubId = validatePubId;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a CDATA section.\r\n *\r\n * A CDATA section is structured as follows, where `{data}` is the\r\n * character data of the section:\r\n *\r\n * ```xml\r\n * <![CDATA[{data}]]>\r\n * ```\r\n */\r\nvar XmlCdata = /** @class */ (function () {\r\n function XmlCdata(parent, validation, options) {\r\n this._validation = validation;\r\n if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInCharData)) {\r\n this._replaceInvalidCharsInCharData = (options.replaceInvalidCharsInCharData);\r\n }\r\n else {\r\n this._replaceInvalidCharsInCharData = false;\r\n }\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlCdata.prototype, \"charData\", {\r\n /**\r\n * Gets the character data of this CDATA section.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the character data of this CDATA section.\r\n */\r\n set: function (charData) {\r\n if (this._replaceInvalidCharsInCharData) {\r\n charData = (0, validate_1.fixChar)(charData);\r\n }\r\n else if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": CDATA section\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain characters\")\r\n + \" not allowed in XML\");\r\n }\r\n if (this._replaceInvalidCharsInCharData) {\r\n charData = charData.replace(\"]]>\", \"\\uFFFD\\uFFFD\\uFFFD\");\r\n }\r\n else if (this._validation && charData.indexOf(\"]]>\") !== -1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": CDATA section\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain the string\")\r\n + \" ']]>'\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this CDATA section.\r\n */\r\n XmlCdata.prototype.toString = function () {\r\n return \"<![CDATA[\" + this._charData + \"]]>\";\r\n };\r\n /**\r\n * Returns the parent of this CDATA section.\r\n */\r\n XmlCdata.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlCdata;\r\n}());\r\nexports.default = XmlCdata;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar escape_1 = require(\"../escape\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents character data.\r\n *\r\n * Restricted characters, such as the ampersand (`&`), the opening angle\r\n * bracket (`<`), and the closing angle bracket (`>`) when it appears in the\r\n * string `]]>`, are all automatically escaped.\r\n */\r\nvar XmlCharData = /** @class */ (function () {\r\n function XmlCharData(parent, validation, options) {\r\n this._validation = validation;\r\n if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInCharData)) {\r\n this._replaceInvalidCharsInCharData = (options.replaceInvalidCharsInCharData);\r\n }\r\n else {\r\n this._replaceInvalidCharsInCharData = false;\r\n }\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlCharData.prototype, \"charData\", {\r\n /**\r\n * Gets the text of this character data.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the text of this character data.\r\n */\r\n set: function (charData) {\r\n if (this._replaceInvalidCharsInCharData) {\r\n charData = (0, validate_1.fixChar)(charData);\r\n }\r\n else if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": character data\"\r\n + (\"\\\"\" + charData + \"\\\" should not contain characters not\")\r\n + \" allowed in XML\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this character data.\r\n */\r\n XmlCharData.prototype.toString = function () {\r\n var str = this._charData;\r\n str = (0, escape_1.escapeAmpersands)(str);\r\n str = (0, escape_1.escapeLeftAngleBrackets)(str);\r\n str = (0, escape_1.escapeRightAngleBracketsInCdataTerminator)(str);\r\n return str;\r\n };\r\n /**\r\n * Returns the parent of this character data.\r\n */\r\n XmlCharData.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlCharData;\r\n}());\r\nexports.default = XmlCharData;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar options_1 = require(\"../options\");\r\nvar validate_1 = require(\"../validate\");\r\nvar XmlAttribute_1 = __importDefault(require(\"./XmlAttribute\"));\r\nvar XmlCdata_1 = __importDefault(require(\"./XmlCdata\"));\r\nvar XmlCharData_1 = __importDefault(require(\"./XmlCharData\"));\r\nvar XmlCharRef_1 = __importDefault(require(\"./XmlCharRef\"));\r\nvar XmlComment_1 = __importDefault(require(\"./XmlComment\"));\r\nvar XmlEntityRef_1 = __importDefault(require(\"./XmlEntityRef\"));\r\nvar XmlProcInst_1 = __importDefault(require(\"./XmlProcInst\"));\r\n/**\r\n * Represents an XML element.\r\n *\r\n * A sample element is structured as follows, where `{name}` is the name\r\n * of the element:\r\n *\r\n * ```xml\r\n * <{name} attname=\"attvalue\">\r\n * <subelem/>\r\n * <?pitarget picontent?>\r\n * text\r\n * </{name}></pre>\r\n * ```\r\n *\r\n * XML elements can have an unlimited number of attributes, CDATA sections,\r\n * character references, comments, elements, entity references, processing\r\n * instructions, and character data.\r\n *\r\n * An element with no content will be represented using an empty element tag:\r\n *\r\n * ```xml\r\n * <{name}/>\r\n * ```\r\n */\r\nvar XmlElement = /** @class */ (function () {\r\n function XmlElement(parent, validation, options) {\r\n this._validation = validation;\r\n if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInName)) {\r\n this._replaceInvalidCharsInName = options.replaceInvalidCharsInName;\r\n }\r\n else {\r\n this._replaceInvalidCharsInName = false;\r\n }\r\n if (!(0, validate_1.isUndefined)(options.useSelfClosingTagIfEmpty)) {\r\n this._useSelfClosingTagIfEmpty = options.useSelfClosingTagIfEmpty;\r\n }\r\n else {\r\n this._useSelfClosingTagIfEmpty = true;\r\n }\r\n this._children = [];\r\n this._attributeNames = [];\r\n this._parent = parent;\r\n this.name = options.name;\r\n }\r\n Object.defineProperty(XmlElement.prototype, \"name\", {\r\n /**\r\n * Gets the name of this element.\r\n */\r\n get: function () {\r\n return this._name;\r\n },\r\n /**\r\n * Sets the name of this element.\r\n */\r\n set: function (name) {\r\n if (this._replaceInvalidCharsInName) {\r\n name = (0, validate_1.fixName)(name);\r\n if (name.length === 0) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": element name should\"\r\n + \" not be empty\");\r\n }\r\n }\r\n else if (this._validation && !(0, validate_1.validateName)(name)) {\r\n if (name.length === 0) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": element name should\"\r\n + \" not be empty\");\r\n }\r\n else {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": element name\"\r\n + (\" \\\"\" + name + \"\\\" should not contain characters not\")\r\n + \" allowed in XML names\");\r\n }\r\n }\r\n this._name = name;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Adds an attribute to this element and returns the new attribute.\r\n */\r\n XmlElement.prototype.attribute = function (options) {\r\n if (this._validation\r\n && this._attributeNames.indexOf(options.name) !== -1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": element \\\"\" + this.name + \"\\\"\"\r\n + \" already contains an attribute with the\"\r\n + (\" name \\\"\" + options.name + \"\\\"\"));\r\n }\r\n var attribute = new XmlAttribute_1.default(this, this._validation, options);\r\n this._children.push(attribute);\r\n this._attributeNames.push(options.name);\r\n return attribute;\r\n };\r\n /**\r\n * Adds a CDATA section to this element and returns the new CDATA section.\r\n */\r\n XmlElement.prototype.cdata = function (options) {\r\n var cdata = new XmlCdata_1.default(this, this._validation, options);\r\n this._children.push(cdata);\r\n return cdata;\r\n };\r\n /**\r\n * Adds character data to this element and returns the new character data.\r\n */\r\n XmlElement.prototype.charData = function (options) {\r\n var charDataNode = new XmlCharData_1.default(this, this._validation, options);\r\n this._children.push(charDataNode);\r\n return charDataNode;\r\n };\r\n /**\r\n * Adds a character reference to this element and returns the new\r\n * character reference.\r\n */\r\n XmlElement.prototype.charRef = function (options) {\r\n var charRef = new XmlCharRef_1.default(this, this._validation, options);\r\n this._children.push(charRef);\r\n return charRef;\r\n };\r\n /**\r\n * Adds a comment to this element and returns the new comment.\r\n */\r\n XmlElement.prototype.comment = function (options) {\r\n var comment = new XmlComment_1.default(this, this._validation, options);\r\n this._children.push(comment);\r\n return comment;\r\n };\r\n /**\r\n * Adds an element to this element and returns the new element.\r\n */\r\n XmlElement.prototype.element = function (options) {\r\n var element = new XmlElement(this, this._validation, options);\r\n this._children.push(element);\r\n return element;\r\n };\r\n /**\r\n * Adds an entity reference to this element and returns the new entity\r\n * reference.\r\n */\r\n XmlElement.prototype.entityRef = function (options) {\r\n var entityRef = new XmlEntityRef_1.default(this, this._validation, options);\r\n this._children.push(entityRef);\r\n return entityRef;\r\n };\r\n /**\r\n * Adds a processing instruction to this element and returns the new\r\n * processing instruction.\r\n */\r\n XmlElement.prototype.procInst = function (options) {\r\n var procInst = new XmlProcInst_1.default(this, this._validation, options);\r\n this._children.push(procInst);\r\n return procInst;\r\n };\r\n /**\r\n * Returns an XML string representation of this element using the specified\r\n * options.\r\n */\r\n XmlElement.prototype.toString = function (options) {\r\n if (options === void 0) { options = {}; }\r\n return this.toStringWithIndent(options, \"\");\r\n };\r\n /**\r\n * Returns the parent of this element.\r\n */\r\n XmlElement.prototype.up = function () {\r\n return this._parent;\r\n };\r\n /**\r\n * Returns an XML string representation of this element using the specified\r\n * options and initial indent.\r\n */\r\n XmlElement.prototype.toStringWithIndent = function (options, indent) {\r\n var optionsObj = new options_1.StringOptions(options);\r\n var newIndent = indent + optionsObj.indent;\r\n // Element tag start\r\n var str = \"<\" + this._name;\r\n // Attributes and other nodes\r\n var nodes = [];\r\n for (var _i = 0, _a = this._children; _i < _a.length; _i++) {\r\n var node = _a[_i];\r\n if (node instanceof XmlAttribute_1.default) {\r\n str += \" \" + node.toString(options);\r\n }\r\n else {\r\n nodes.push(node);\r\n }\r\n }\r\n // Child nodes\r\n if (nodes.length > 0) {\r\n var childStr = \"\";\r\n for (var i = 0; i < nodes.length; i++) {\r\n var next = nodes[i];\r\n var nextStr = \"\";\r\n if (next instanceof XmlElement) {\r\n nextStr += next.toStringWithIndent(optionsObj, newIndent);\r\n }\r\n else {\r\n nextStr += next.toString();\r\n }\r\n var prev = i > 0 ? nodes[i - 1] : undefined;\r\n // Skip empty nodes\r\n if (next instanceof XmlCharData_1.default && next.toString() === \"\") {\r\n continue;\r\n }\r\n // Line break before child nodes unless all nodes, or at least\r\n // the most recent two, are of type XmlCharacterReference,\r\n // XmlEntityReference, or XmlCharData\r\n if (optionsObj.pretty) {\r\n if (!this.allSameLineNodes(nodes)) {\r\n if (!(i > 0 && this.onSameLine(next, prev))) {\r\n nextStr = optionsObj.newline + newIndent + nextStr;\r\n }\r\n }\r\n }\r\n childStr += nextStr;\r\n }\r\n // Line break before end tag unless all nodes are of type\r\n // XmlCharacterReference, XmlEntityReference, or XmlCharData\r\n if (optionsObj.pretty) {\r\n if (!this.allSameLineNodes(nodes)) {\r\n childStr += optionsObj.newline + indent;\r\n }\r\n }\r\n if (childStr.length === 0 && this._useSelfClosingTagIfEmpty) {\r\n // Element empty tag end\r\n str += \"/>\";\r\n }\r\n else {\r\n // Element start and end tags\r\n str += \">\" + childStr + \"</\" + this._name + \">\";\r\n }\r\n }\r\n else if (this._useSelfClosingTagIfEmpty) {\r\n // Element empty tag end\r\n str += \"/>\";\r\n }\r\n else {\r\n // Element start and end tags\r\n str += \"></\" + this._name + \">\";\r\n }\r\n return str;\r\n };\r\n /**\r\n * Returns true if the specified nodes are all character references,\r\n * entity references, or character data.\r\n */\r\n XmlElement.prototype.allSameLineNodes = function (nodes) {\r\n for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {\r\n var node = nodes_1[_i];\r\n if (!((node instanceof XmlCharRef_1.default\r\n || node instanceof XmlEntityRef_1.default\r\n || node instanceof XmlCharData_1.default))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n * Returns true if the specified nodes are all character references,\r\n * entity references, or character data.\r\n */\r\n XmlElement.prototype.onSameLine = function (prev, next) {\r\n return (prev instanceof XmlCharRef_1.default\r\n || prev instanceof XmlEntityRef_1.default\r\n || prev instanceof XmlCharData_1.default)\r\n && (!(0, validate_1.isUndefined)(next)\r\n && (next instanceof XmlCharRef_1.default\r\n || next instanceof XmlEntityRef_1.default\r\n || next instanceof XmlCharData_1.default));\r\n };\r\n return XmlElement;\r\n}());\r\nexports.default = XmlElement;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.getContext = void 0;\r\nvar XmlAttribute_1 = __importDefault(require(\"./nodes/XmlAttribute\"));\r\nvar XmlDocument_1 = __importDefault(require(\"./nodes/XmlDocument\"));\r\nvar XmlDtd_1 = __importDefault(require(\"./nodes/XmlDtd\"));\r\nvar XmlElement_1 = __importDefault(require(\"./nodes/XmlElement\"));\r\n/**\r\n * Returns a context string for the specified node, for use in error messages.\r\n */\r\nfunction getContext(obj) {\r\n if (obj instanceof XmlAttribute_1.default) {\r\n return getContext(obj.up()) + (\" > attribute \\\"\" + obj.name + \"\\\"\");\r\n }\r\n else if (obj instanceof XmlDocument_1.default) {\r\n return \"in XML document\";\r\n }\r\n else if (obj instanceof XmlDtd_1.default) {\r\n return getContext(obj.up()) + \" > DTD\";\r\n }\r\n else if (obj instanceof XmlElement_1.default) {\r\n return getContext(obj.up()) + (\" > element \\\"\" + obj.name + \"\\\"\");\r\n }\r\n else {\r\n throw new Error(\"Unrecognized object of type \"\r\n + Object.prototype.toString.call(obj));\r\n }\r\n}\r\nexports.getContext = getContext;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a comment.\r\n *\r\n * A comment is structured as follows, where `{content}` is the text of the\r\n * comment:\r\n *\r\n * ```xml\r\n * <!--{content}-->\r\n * ```\r\n */\r\nvar XmlComment = /** @class */ (function () {\r\n function XmlComment(parent, validation, options) {\r\n this._validation = validation;\r\n if (!(0, validate_1.isUndefined)(options.replaceInvalidCharsInCharData)) {\r\n this._replaceInvalidCharsInCharData = (options.replaceInvalidCharsInCharData);\r\n }\r\n else {\r\n this._replaceInvalidCharsInCharData = false;\r\n }\r\n this._parent = parent;\r\n this.charData = options.charData;\r\n }\r\n Object.defineProperty(XmlComment.prototype, \"charData\", {\r\n /**\r\n * Gets the text of this comment.\r\n */\r\n get: function () {\r\n return this._charData;\r\n },\r\n /**\r\n * Sets the text of this comment.\r\n */\r\n set: function (charData) {\r\n if (this._replaceInvalidCharsInCharData) {\r\n charData = (0, validate_1.fixChar)(charData);\r\n }\r\n else if (this._validation && !(0, validate_1.validateChar)(charData)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": comment content\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain characters\")\r\n + \" not allowed in XML\");\r\n }\r\n if (this._replaceInvalidCharsInCharData) {\r\n charData = charData.replace(\"--\", \"\\uFFFD\\uFFFD\");\r\n }\r\n else if (this._validation && charData.indexOf(\"--\") !== -1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": comment content\"\r\n + (\" \\\"\" + charData + \"\\\" should not contain the string\")\r\n + \" '--'\");\r\n }\r\n if (this._replaceInvalidCharsInCharData) {\r\n if (charData.lastIndexOf(\"-\") === charData.length - 1) {\r\n charData = charData.substr(0, charData.length - 1) + \"\\uFFFD\";\r\n }\r\n }\r\n else if (this._validation\r\n && charData.lastIndexOf(\"-\") === charData.length - 1) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": comment content\"\r\n + (\" \\\"\" + charData + \"\\\" should not end with the string\")\r\n + \" '-'\");\r\n }\r\n this._charData = charData;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this comment.\r\n */\r\n XmlComment.prototype.toString = function () {\r\n return \"<!--\" + this._charData + \"-->\";\r\n };\r\n /**\r\n * Returns the parent of this comment.\r\n */\r\n XmlComment.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlComment;\r\n}());\r\nexports.default = XmlComment;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar error_1 = require(\"../error\");\r\nvar options_1 = require(\"../options\");\r\nvar validate_1 = require(\"../validate\");\r\n/**\r\n * Represents a declaration.\r\n *\r\n * A declaration is structured as follows, where `{version}` is the XML\r\n * version, `{encoding}` is the encoding of the document, and `{standalone}`\r\n * is either \"yes\" or \"no\", depending on whether the document may contain\r\n * external markup declarations:\r\n *\r\n * ```xml\r\n * <?xml version=\"{version}\" encoding=\"{encoding}\" standalone=\"{standalone}\"?>\r\n * ```\r\n */\r\nvar XmlDecl = /** @class */ (function () {\r\n function XmlDecl(parent, validation, options) {\r\n this._version = \"1.0\";\r\n this._validation = validation;\r\n this._parent = parent;\r\n this.encoding = options.encoding;\r\n this.standalone = options.standalone;\r\n if (!(0, validate_1.isUndefined)(options.version)) {\r\n this.version = options.version;\r\n }\r\n }\r\n Object.defineProperty(XmlDecl.prototype, \"encoding\", {\r\n /**\r\n * Gets the encoding associated with this declaration.\r\n */\r\n get: function () {\r\n return this._encoding;\r\n },\r\n /**\r\n * Sets the encoding associated with this declaration.\r\n */\r\n set: function (encoding) {\r\n if (this._validation && !(0, validate_1.isUndefined)(encoding)) {\r\n if (!validateEncoding(encoding)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": declaration\"\r\n + (\" encoding attribute \" + encoding + \" should be a\")\r\n + \" valid encoding\");\r\n }\r\n }\r\n this._encoding = encoding;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(XmlDecl.prototype, \"standalone\", {\r\n /**\r\n * Gets the value of the standalone attribute associated with this\r\n * declaration.\r\n */\r\n get: function () {\r\n return this._standalone;\r\n },\r\n /**\r\n * Sets the value of the standalone attribute associated with this\r\n * declaration.\r\n */\r\n set: function (standalone) {\r\n if (this._validation && !(0, validate_1.isUndefined)(standalone)) {\r\n if (standalone !== \"yes\" && standalone !== \"no\") {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": declaration\"\r\n + (\" standalone attribute \" + standalone + \" should\")\r\n + \" be the string 'yes' or the string 'no'\");\r\n }\r\n }\r\n this._standalone = standalone;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(XmlDecl.prototype, \"version\", {\r\n /**\r\n * Gets the XML version associated with this declaration.\r\n */\r\n get: function () {\r\n return this._version;\r\n },\r\n /**\r\n * Sets the XML version associated with this declaration.\r\n */\r\n set: function (version) {\r\n if (this._validation && !validateVersion(version)) {\r\n throw new Error((0, error_1.getContext)(this.up()) + \": declaration version\"\r\n + (\" attribute \" + version + \" should be a valid XML\")\r\n + \" version\");\r\n }\r\n this._version = version;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Returns an XML string representation of this declaration.\r\n */\r\n XmlDecl.prototype.toString = function (options) {\r\n if (options === void 0) { options = {}; }\r\n var optionsObj = new options_1.StringOptions(options);\r\n var quote = optionsObj.doubleQuotes ? '\"' : \"'\";\r\n var str = \"<?xml version=\" + quote + this._version + quote;\r\n if (!(0, validate_1.isUndefined)(this._encoding)) {\r\n str += \" encoding=\" + quote + this._encoding + quote;\r\n }\r\n if (!(0, validate_1.isUndefined)(this._standalone)) {\r\n str += \" standalone=\" + quote + this._standalone + quote;\r\n }\r\n str += \"?>\";\r\n return str;\r\n };\r\n /**\r\n * Returns the parent of this declaration.\r\n */\r\n XmlDecl.prototype.up = function () {\r\n return this._parent;\r\n };\r\n return XmlDecl;\r\n}());\r\nexports.default = XmlDecl;\r\n/**\r\n * Returns true if the specified encoding only contains characters permitted by\r\n * the XML specification.\r\n */\r\nfunction validateEncoding(str) {\r\n if (str.length === 0) {\r\n return false;\r\n }\r\n var initialChar = str.charCodeAt(0);\r\n if (!((initialChar >= 0x41 && initialChar <= 0x5A)\r\n || (initialChar >= 0x61 && initialChar <= 0x7A))) {\r\n return false;\r\n }\r\n for (var i = 1; i < str.length; i++) {\r\n var char = str.charCodeAt(i);\r\n if (char === 0x5F\r\n || char === 0x2D\r\n || char === 0x2E\r\n || (char >= 0x30 && char <= 0x39)\r\n || (char >= 0x41 && char <= 0x5A)\r\n || (char >= 0x61 && char <= 0x7A)) {\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n return false;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}\r\n/**\r\n * Returns true if the specified version only contains characters permitted by\r\n * the XML specification.\r\n */\r\nfunction validateVersion(str) {\r\n for (var i = 0; i <= 9; i++) {\r\n if (str === \"1.\" + i) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar options_1 = require(\"../options\");\r\nvar validate_1 = require(\"../validate\");\r\nvar XmlComment_1 = __importDefault(require(\"./XmlComment\"));\r\nvar XmlDecl_1 = __importDefault(require(\"./XmlDecl\"));\r\nvar XmlDtd_1 = __importDefault(require(\"./XmlDtd\"));\r\nvar XmlElement_1 = __importDefault(require(\"./XmlElement\"));\r\nvar XmlProcInst_1 = __importDefault(require(\"./XmlProcInst\"));\r\n/**\r\n * Represents a document.\r\n *\r\n * A sample document is structured as follows:\r\n *\r\n * ```xml\r\n * <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n * <DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\r\n * \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n * <html>\r\n * <head>\r\n * <title>My page title</title>\r\n * </head>\r\n * <body>\r\n * <h1>Welcome!</h1>\r\n * <p>I hope you enjoy visiting my website.</p>\r\n * <img src=\"picture.png\"/>\r\n * </body>\r\n * </html>\r\n * ```\r\n *\r\n * Each component of the document, such as the declaration, document type\r\n * definition, and root element, are children of this node.\r\n *\r\n * Documents must have exactly one element, which is the document's root\r\n * element.\r\n *\r\n * Documents can have exactly one declaration and one document type definition\r\n * in that order, so long as they precede the element.\r\n *\r\n * Documents can have an unlimited number of comments or processing\r\n * instructions, so long as they follow the declaration, if one exists.\r\n */\r\nvar XmlDocument = /** @class */ (function () {\r\n function XmlDocument(options) {\r\n this._children = [];\r\n this._validation = !(0, validate_1.isUndefined)(options.validation)\r\n ? options.validation\r\n : true;\r\n }\r\n /**\r\n * Adds a comment to this document and returns the new comment.\r\n */\r\n XmlDocument.prototype.comment = function (options) {\r\n var comment = new XmlComment_1.default(this, this._validation, options);\r\n this._children.push(comment);\r\n return comment;\r\n };\r\n /**\r\n * Adds a declaration to this document and returns the new declaration.\r\n */\r\n XmlDocument.prototype.decl = function (options) {\r\n if (options === void 0) { options = {}; }\r\n if (this._validation && this._children.length !== 0) {\r\n throw new Error(\"in XML document: declaration must be the first\"\r\n + \" child\");\r\n }\r\n var declaration = new XmlDecl_1.default(this, this._validation, options);\r\n this._children.push(declaration);\r\n return declaration;\r\n };\r\n /**\r\n * Adds a document type definition to this document and returns the new\r\n * document type definition.\r\n */\r\n XmlDocument.prototype.dtd = function (options) {\r\n var filteredChildren = this._children.filter(function (value) {\r\n return value instanceof XmlElement_1.default;\r\n });\r\n if (this._validation && filteredChildren.length !== 0) {\r\n throw new Error(\"in XML document: DTD must precede the root\"\r\n + \" element\");\r\n }\r\n var dtd = new XmlDtd_1.default(this, this._validation, options);\r\n this._children.push(dtd);\r\n return dtd;\r\n };\r\n /**\r\n * Adds the root element to this document and returns the element.\r\n */\r\n XmlDocument.prototype.element = function (options) {\r\n var filteredChildren = this._children.filter(function (value) {\r\n return value instanceof XmlElement_1.default;\r\n });\r\n if (this._validation && filteredChildren.length !== 0) {\r\n throw new Error(\"in XML document: only one root element is\"\r\n + \" permitted\");\r\n }\r\n var element = new XmlElement_1.default(this, this._validation, options);\r\n this._children.push(element);\r\n return element;\r\n };\r\n /**\r\n * Adds a processing instruction to this document and returns the new\r\n * processing instruction.\r\n */\r\n XmlDocument.prototype.procInst = function (options) {\r\n var procInst = new XmlProcInst_1.default(this, this._validation, options);\r\n this._children.push(procInst);\r\n return procInst;\r\n };\r\n /**\r\n * Returns an XML string representation of this document using the\r\n * specified options.\r\n */\r\n XmlDocument.prototype.toString = function (options) {\r\n if (options === void 0) { options = {}; }\r\n var filteredChildren = this._children.filter(function (value) {\r\n return value instanceof XmlElement_1.default;\r\n });\r\n if (this._validation && filteredChildren.length !== 1) {\r\n throw new Error(\"in XML document: no more than one root element\"\r\n + \" is permitted\");\r\n }\r\n var optionsObj = new options_1.StringOptions(options);\r\n var str = \"\";\r\n for (var _i = 0, _a = this._children; _i < _a.length; _i++) {\r\n var node = _a[_i];\r\n if (node instanceof XmlDecl_1.default\r\n || node instanceof XmlDtd_1.default\r\n || node instanceof XmlElement_1.default) {\r\n str += node.toString(options);\r\n }\r\n else {\r\n str += node.toString();\r\n }\r\n if (optionsObj.pretty) {\r\n str += optionsObj.newline;\r\n }\r\n }\r\n var len = str.length - optionsObj.newline.length;\r\n if (str.substr(len) === optionsObj.newline) {\r\n str = str.substr(0, len);\r\n }\r\n return str;\r\n };\r\n return XmlDocument;\r\n}());\r\nexports.default = XmlDocument;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2019 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.document = exports.XmlProcInst = exports.XmlEntityRef = exports.XmlElement = exports.XmlDtdParamEntityRef = exports.XmlDtdNotation = exports.XmlDtdEntity = exports.XmlDtdElement = exports.XmlDtdAttlist = exports.XmlDtd = exports.XmlDocument = exports.XmlDecl = exports.XmlComment = exports.XmlCharRef = exports.XmlCharData = exports.XmlCdata = exports.XmlAttributeText = exports.XmlAttribute = void 0;\r\nvar XmlDocument_1 = __importDefault(require(\"./nodes/XmlDocument\"));\r\nvar XmlAttribute_1 = require(\"./nodes/XmlAttribute\");\r\nObject.defineProperty(exports, \"XmlAttribute\", { enumerable: true, get: function () { return __importDefault(XmlAttribute_1).default; } });\r\nvar XmlAttributeText_1 = require(\"./nodes/XmlAttributeText\");\r\nObject.defineProperty(exports, \"XmlAttributeText\", { enumerable: true, get: function () { return __importDefault(XmlAttributeText_1).default; } });\r\nvar XmlCdata_1 = require(\"./nodes/XmlCdata\");\r\nObject.defineProperty(exports, \"XmlCdata\", { enumerable: true, get: function () { return __importDefault(XmlCdata_1).default; } });\r\nvar XmlCharData_1 = require(\"./nodes/XmlCharData\");\r\nObject.defineProperty(exports, \"XmlCharData\", { enumerable: true, get: function () { return __importDefault(XmlCharData_1).default; } });\r\nvar XmlCharRef_1 = require(\"./nodes/XmlCharRef\");\r\nObject.defineProperty(exports, \"XmlCharRef\", { enumerable: true, get: function () { return __importDefault(XmlCharRef_1).default; } });\r\nvar XmlComment_1 = require(\"./nodes/XmlComment\");\r\nObject.defineProperty(exports, \"XmlComment\", { enumerable: true, get: function () { return __importDefault(XmlComment_1).default; } });\r\nvar XmlDecl_1 = require(\"./nodes/XmlDecl\");\r\nObject.defineProperty(exports, \"XmlDecl\", { enumerable: true, get: function () { return __importDefault(XmlDecl_1).default; } });\r\nvar XmlDocument_2 = require(\"./nodes/XmlDocument\");\r\nObject.defineProperty(exports, \"XmlDocument\", { enumerable: true, get: function () { return __importDefault(XmlDocument_2).default; } });\r\nvar XmlDtd_1 = require(\"./nodes/XmlDtd\");\r\nObject.defineProperty(exports, \"XmlDtd\", { enumerable: true, get: function () { return __importDefault(XmlDtd_1).default; } });\r\nvar XmlDtdAttlist_1 = require(\"./nodes/XmlDtdAttlist\");\r\nObject.defineProperty(exports, \"XmlDtdAttlist\", { enumerable: true, get: function () { return __importDefault(XmlDtdAttlist_1).default; } });\r\nvar XmlDtdElement_1 = require(\"./nodes/XmlDtdElement\");\r\nObject.defineProperty(exports, \"XmlDtdElement\", { enumerable: true, get: function () { return __importDefault(XmlDtdElement_1).default; } });\r\nvar XmlDtdEntity_1 = require(\"./nodes/XmlDtdEntity\");\r\nObject.defineProperty(exports, \"XmlDtdEntity\", { enumerable: true, get: function () { return __importDefault(XmlDtdEntity_1).default; } });\r\nvar XmlDtdNotation_1 = require(\"./nodes/XmlDtdNotation\");\r\nObject.defineProperty(exports, \"XmlDtdNotation\", { enumerable: true, get: function () { return __importDefault(XmlDtdNotation_1).default; } });\r\nvar XmlDtdParamEntityRef_1 = require(\"./nodes/XmlDtdParamEntityRef\");\r\nObject.defineProperty(exports, \"XmlDtdParamEntityRef\", { enumerable: true, get: function () { return __importDefault(XmlDtdParamEntityRef_1).default; } });\r\nvar XmlElement_1 = require(\"./nodes/XmlElement\");\r\nObject.defineProperty(exports, \"XmlElement\", { enumerable: true, get: function () { return __importDefault(XmlElement_1).default; } });\r\nvar XmlEntityRef_1 = require(\"./nodes/XmlEntityRef\");\r\nObject.defineProperty(exports, \"XmlEntityRef\", { enumerable: true, get: function () { return __importDefault(XmlEntityRef_1).default; } });\r\nvar XmlProcInst_1 = require(\"./nodes/XmlProcInst\");\r\nObject.defineProperty(exports, \"XmlProcInst\", { enumerable: true, get: function () { return __importDefault(XmlProcInst_1).default; } });\r\n/**\r\n * Returns a new XML document with the specified options.\r\n */\r\nfunction document(options) {\r\n if (options === void 0) { options = {}; }\r\n return new XmlDocument_1.default(options);\r\n}\r\nexports.document = document;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2020 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.stringify = exports.isMap = exports.isSet = exports.isFunction = exports.isArray = exports.isObject = exports.isNull = exports.isUndefined = void 0;\r\nfunction isUndefined(val) {\r\n return Object.prototype.toString.call(val) === \"[object Undefined]\";\r\n}\r\nexports.isUndefined = isUndefined;\r\nfunction isNull(val) {\r\n return Object.prototype.toString.call(val) === \"[object Null]\";\r\n}\r\nexports.isNull = isNull;\r\nfunction isObject(val) {\r\n return Object.prototype.toString.call(val) === \"[object Object]\";\r\n}\r\nexports.isObject = isObject;\r\nfunction isArray(val) {\r\n return Object.prototype.toString.call(val) === \"[object Array]\";\r\n}\r\nexports.isArray = isArray;\r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\nfunction isFunction(val) {\r\n return Object.prototype.toString.call(val) === \"[object Function]\";\r\n}\r\nexports.isFunction = isFunction;\r\nfunction isSet(val) {\r\n return Object.prototype.toString.call(val) === \"[object Set]\";\r\n}\r\nexports.isSet = isSet;\r\nfunction isMap(val) {\r\n return Object.prototype.toString.call(val) === \"[object Map]\";\r\n}\r\nexports.isMap = isMap;\r\n/**\r\n * Returns a string representation of the specified value, as given by the\r\n * value's toString() method (if it has one) or the global String() function\r\n * (if it does not).\r\n *\r\n * @param value The value to convert to a string.\r\n *\r\n * @returns A string representation of the specified value.\r\n */\r\n// eslint-disable-next-line max-len\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\r\nfunction stringify(value) {\r\n if (!isUndefined(value) && !isNull(value)) {\r\n if (isFunction(value === null || value === void 0 ? void 0 : value.toString)) {\r\n value = value.toString();\r\n }\r\n }\r\n return String(value);\r\n}\r\nexports.stringify = stringify;\r\n", "\"use strict\";\r\n/**\r\n * Copyright (C) 2016-2020 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.WrapHandlers = exports.TypeHandlers = exports.FormatOptions = exports.DtdOptions = exports.DeclarationOptions = exports.Options = void 0;\r\nvar utils_1 = require(\"./utils\");\r\n/**\r\n * Implementation of the IOptions interface used to provide default values\r\n * to fields.\r\n */\r\nvar Options = /** @class */ (function () {\r\n function Options(options) {\r\n if (options === void 0) { options = {}; }\r\n this.aliasString = \"=\";\r\n this.attributeString = \"@\";\r\n this.cdataInvalidChars = false;\r\n this.cdataKeys = [];\r\n this.replaceInvalidChars = false;\r\n this.useSelfClosingTagIfEmpty = true;\r\n this.validation = true;\r\n this.valueString = \"#\";\r\n if (!(0, utils_1.isUndefined)(options.validation)) {\r\n this.validation = options.validation;\r\n }\r\n if (!(0, utils_1.isUndefined)(options.aliasString)) {\r\n this.aliasString = options.aliasString;\r\n }\r\n if (!(0, utils_1.isUndefined)(options.attributeString)) {\r\n this.attributeString = options.attributeString;\r\n }\r\n if (!(0, utils_1.isUndefined)(options.cdataInvalidChars)) {\r\n this.cdataInvalidChars = options.cdataInvalidChars;\r\n }\r\n if (!(0, utils_1.isUndefined)(options.cdataKeys)) {\r\n this.cdataKeys = options.cdataKeys;\r\n }\r\n this.declaration = new DeclarationOptions(options.declaration);\r\n this.dtd = new DtdOptions(this.validation, options.dtd);\r\n this.format = new FormatOptions(options.format);\r\n if (!(0, utils_1.isUndefined)(options.replaceInvalidChars)) {\r\n this.replaceInvalidChars = options.replaceInvalidChars;\r\n }\r\n this.typeHandlers = new TypeHandlers(options.typeHandlers);\r\n if (!(0, utils_1.isUndefined)(options.useSelfClosingTagIfEmpty)) {\r\n this.useSelfClosingTagIfEmpty = options.useSelfClosingTagIfEmpty;\r\n }\r\n if (!(0, utils_1.isUndefined)(options.valueString)) {\r\n this.valueString = options.valueString;\r\n }\r\n this.wrapHandlers = new WrapHandlers(options.wrapHandlers);\r\n }\r\n return Options;\r\n}());\r\nexports.Options = Options;\r\n/**\r\n * Implementation of the IDeclarationOptions interface used to provide default\r\n * values to fields.\r\n */\r\nvar DeclarationOptions = /** @class */ (function () {\r\n function DeclarationOptions(declarationOptions) {\r\n if (declarationOptions === void 0) { declarationOptions = {}; }\r\n this.include = true;\r\n if (!(0, utils_1.isUndefined)(declarationOptions.include)) {\r\n this.include = declarationOptions.include;\r\n }\r\n // Validation performed by xmlcreate\r\n this.encoding = declarationOptions.encoding;\r\n this.standalone = declarationOptions.standalone;\r\n this.version = declarationOptions.version;\r\n }\r\n return DeclarationOptions;\r\n}());\r\nexports.DeclarationOptions = DeclarationOptions;\r\n/**\r\n * Implementation of the IDtdOptions interface used to provide default values\r\n * to fields.\r\n */\r\nvar DtdOptions = /** @class */ (function () {\r\n function DtdOptions(validation, dtdOptions) {\r\n if (dtdOptions === void 0) { dtdOptions = {}; }\r\n this.include = false;\r\n if (!(0, utils_1.isUndefined)(dtdOptions.include)) {\r\n this.include = dtdOptions.include;\r\n }\r\n if (validation && (0, utils_1.isUndefined)(dtdOptions.name) && this.include) {\r\n throw new Error(\"options.dtd.name should be defined if\" +\r\n \" options.dtd.include is true\");\r\n }\r\n this.name = dtdOptions.name;\r\n this.sysId = dtdOptions.sysId;\r\n this.pubId = dtdOptions.pubId;\r\n }\r\n return DtdOptions;\r\n}());\r\nexports.DtdOptions = DtdOptions;\r\n/**\r\n * Implementation of the IFormatOptions interface used to provide default values\r\n * to fields.\r\n */\r\nvar FormatOptions = /** @class */ (function () {\r\n function FormatOptions(formatOptions) {\r\n if (formatOptions === void 0) { formatOptions = {}; }\r\n this.doubleQuotes = formatOptions.doubleQuotes;\r\n this.indent = formatOptions.indent;\r\n this.newline = formatOptions.newline;\r\n this.pretty = formatOptions.pretty;\r\n }\r\n return FormatOptions;\r\n}());\r\nexports.FormatOptions = FormatOptions;\r\n/**\r\n * Implementation of the ITypeHandlers interface used to provide default values\r\n * to fields.\r\n */\r\nvar TypeHandlers = /** @class */ (function () {\r\n function TypeHandlers(typeHandlers) {\r\n if (typeHandlers === void 0) { typeHandlers = {}; }\r\n for (var key in typeHandlers) {\r\n if (Object.prototype.hasOwnProperty.call(typeHandlers, key)) {\r\n this[key] = typeHandlers[key];\r\n }\r\n }\r\n }\r\n return TypeHandlers;\r\n}());\r\nexports.TypeHandlers = TypeHandlers;\r\n/**\r\n * Implementation of the IWrapHandlers interface used to provide default values\r\n * to fields.\r\n */\r\nvar WrapHandlers = /** @class */ (function () {\r\n function WrapHandlers(wrapHandlers) {\r\n if (wrapHandlers === void 0) { wrapHandlers = {}; }\r\n for (var key in wrapHandlers) {\r\n if (Object.prototype.hasOwnProperty.call(wrapHandlers, key)) {\r\n this[key] = wrapHandlers[key];\r\n }\r\n }\r\n }\r\n return WrapHandlers;\r\n}());\r\nexports.WrapHandlers = WrapHandlers;\r\n", "\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.parse = exports.parseToExistingElement = exports.Absent = void 0;\r\n/**\r\n * Copyright (C) 2016-2020 Michael Kourlas\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar xmlcreate_1 = require(\"xmlcreate\");\r\nvar options_1 = require(\"./options\");\r\nvar utils_1 = require(\"./utils\");\r\n/**\r\n * Indicates that an object of a particular type should be suppressed from the\r\n * XML output.\r\n *\r\n * See the `typeHandlers` property in {@link IOptions} for more details.\r\n */\r\nvar Absent = /** @class */ (function () {\r\n function Absent() {\r\n }\r\n Object.defineProperty(Absent, \"instance\", {\r\n /**\r\n * Returns the sole instance of Absent.\r\n */\r\n get: function () {\r\n return Absent._instance;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Absent._instance = new Absent();\r\n return Absent;\r\n}());\r\nexports.Absent = Absent;\r\n/**\r\n * Gets the type handler associated with a value.\r\n */\r\nfunction getHandler(value, options) {\r\n var type = Object.prototype.toString.call(value);\r\n var handler;\r\n if (Object.prototype.hasOwnProperty.call(options.typeHandlers, \"*\")) {\r\n handler = options.typeHandlers[\"*\"];\r\n }\r\n if (Object.prototype.hasOwnProperty.call(options.typeHandlers, type)) {\r\n handler = options.typeHandlers[type];\r\n }\r\n return handler;\r\n}\r\n/**\r\n * Parses a string into XML and adds it to the parent element or attribute.\r\n */\r\nfunction parseString(str, parentElement, options) {\r\n var requiresCdata = function (s) {\r\n return ((options.cdataInvalidChars &&\r\n (s.indexOf(\"<\") !== -1 || s.indexOf(\"&\") !== -1)) ||\r\n options.cdataKeys.indexOf(parentElement.name) !== -1 ||\r\n options.cdataKeys.indexOf(\"*\") !== -1);\r\n };\r\n if (parentElement instanceof xmlcreate_1.XmlElement) {\r\n if (requiresCdata(str)) {\r\n var cdataStrs = str.split(\"]]>\");\r\n for (var i = 0; i < cdataStrs.length; i++) {\r\n if (requiresCdata(cdataStrs[i])) {\r\n parentElement.cdata({\r\n charData: cdataStrs[i],\r\n replaceInvalidCharsInCharData: options.replaceInvalidChars,\r\n });\r\n }\r\n else {\r\n parentElement.charData({\r\n charData: cdataStrs[i],\r\n replaceInvalidCharsInCharData: options.replaceInvalidChars,\r\n });\r\n }\r\n if (i < cdataStrs.length - 1) {\r\n parentElement.charData({\r\n charData: \"]]>\",\r\n replaceInvalidCharsInCharData: options.replaceInvalidChars,\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n parentElement.charData({\r\n charData: str,\r\n replaceInvalidCharsInCharData: options.replaceInvalidChars,\r\n });\r\n }\r\n }\r\n else {\r\n parentElement.text({\r\n charData: str,\r\n replaceInvalidCharsInCharData: options.replaceInvalidChars,\r\n });\r\n }\r\n}\r\n/**\r\n * Parses an attribute into XML and adds it to the parent element.\r\n */\r\nfunction parseAttribute(name, value, parentElement, options) {\r\n var attribute = parentElement.attribute({\r\n name: name,\r\n replaceInvalidCharsInName: options.replaceInvalidChars,\r\n });\r\n parseString((0, utils_1.stringify)(value), attribute, options);\r\n}\r\n/**\r\n * Parses an object or Map entry into XML and adds it to the parent element.\r\n */\r\nfunction parseObjectOrMapEntry(key, value, parentElement, options) {\r\n // Alias key\r\n if (key === options.aliasString) {\r\n parentElement.name = (0, utils_1.stringify)(value);\r\n return;\r\n }\r\n // Attributes key\r\n if (key.indexOf(options.attributeString) === 0 && (0, utils_1.isObject)(value)) {\r\n for (var _i = 0, _a = Object.keys(value); _i < _a.length; _i++) {\r\n var subkey = _a[_i];\r\n parseAttribute(subkey, (0, utils_1.stringify)(value[subkey]), parentElement, options);\r\n }\r\n return;\r\n }\r\n // Value key\r\n if (key.indexOf(options.valueString) === 0) {\r\n parseValue(key, (0, utils_1.stringify)(value), parentElement, options);\r\n return;\r\n }\r\n // Standard handling (create new element for entry)\r\n var element = parentElement;\r\n if (!(0, utils_1.isArray)(value) && !(0, utils_1.isSet)(value)) {\r\n // If handler for value returns absent, then do not add element\r\n var handler = getHandler(value, options);\r\n if (!(0, utils_1.isUndefined)(handler)) {\r\n if (handler(value) === Absent.instance) {\r\n return;\r\n }\r\n }\r\n element = parentElement.element({\r\n name: key,\r\n replaceInvalidCharsInName: options.replaceInvalidChars,\r\n useSelfClosingTagIfEmpty: options.useSelfClosingTagIfEmpty,\r\n });\r\n }\r\n parseValue(key, value, element, options);\r\n}\r\n/**\r\n * Parses an Object or Map into XML and adds it to the parent element.\r\n */\r\nfunction parseObjectOrMap(objectOrMap, parentElement, options) {\r\n if ((0, utils_1.isMap)(objectOrMap)) {\r\n objectOrMap.forEach(function (value, key) {\r\n parseObjectOrMapEntry((0, utils_1.stringify)(key), value, parentElement, options);\r\n });\r\n }\r\n else {\r\n for (var _i = 0, _a = Object.keys(objectOrMap); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n parseObjectOrMapEntry(key, objectOrMap[key], parentElement, options);\r\n }\r\n }\r\n}\r\n/**\r\n * Parses an array or Set into XML and adds it to the parent element.\r\n */\r\nfunction parseArrayOrSet(key, arrayOrSet, parentElement, options) {\r\n var arrayNameFunc;\r\n if (Object.prototype.hasOwnProperty.call(options.wrapHandlers, \"*\")) {\r\n arrayNameFunc = options.wrapHandlers[\"*\"];\r\n }\r\n if (Object.prototype.hasOwnProperty.call(options.wrapHandlers, key)) {\r\n arrayNameFunc = options.wrapHandlers[key];\r\n }\r\n var arrayKey = key;\r\n var arrayElement = parentElement;\r\n if (!(0, utils_1.isUndefined)(arrayNameFunc)) {\r\n var arrayNameFuncKey = arrayNameFunc(arrayKey, arrayOrSet);\r\n if (!(0, utils_1.isNull)(arrayNameFuncKey)) {\r\n arrayKey = arrayNameFuncKey;\r\n arrayElement = parentElement.element({\r\n name: key,\r\n replaceInvalidCharsInName: options.replaceInvalidChars,\r\n useSelfClosingTagIfEmpty: options.useSelfClosingTagIfEmpty,\r\n });\r\n }\r\n }\r\n arrayOrSet.forEach(function (item) {\r\n var element = arrayElement;\r\n if (!(0, utils_1.isArray)(item) && !(0, utils_1.isSet)(item)) {\r\n // If handler for value returns absent, then do not add element\r\n var handler = getHandler(item, options);\r\n if (!(0, utils_1.isUndefined)(handler)) {\r\n if (handler(item) === Absent.instance) {\r\n return;\r\n }\r\n }\r\n element = arrayElement.element({\r\n name: arrayKey,\r\n replaceInvalidCharsInName: options.replaceInvalidChars,\r\n useSelfClosingTagIfEmpty: options.useSelfClosingTagIfEmpty,\r\n });\r\n }\r\n parseValue(arrayKey, item, element, options);\r\n });\r\n}\r\n/**\r\n * Parses an arbitrary JavaScript value into XML and adds it to the parent\r\n * element.\r\n */\r\nfunction parseValue(key, value, parentElement, options) {\r\n // If a handler for a particular type is user-defined, use that handler\r\n // instead of the defaults\r\n var handler = getHandler(value, options);\r\n if (!(0, utils_1.isUndefined)(handler)) {\r\n value = handler(value);\r\n }\r\n if ((0, utils_1.isObject)(value) || (0, utils_1.isMap)(value)) {\r\n parseObjectOrMap(value, parentElement, options);\r\n return;\r\n }\r\n if ((0, utils_1.isArray)(value) || (0, utils_1.isSet)(value)) {\r\n parseArrayOrSet(key, value, parentElement, options);\r\n return;\r\n }\r\n parseString((0, utils_1.stringify)(value), parentElement, options);\r\n}\r\n/**\r\n * Converts the specified object to XML and adds the XML representation to the\r\n * specified XmlElement object using the specified options.\r\n *\r\n * This function does not add a root element. In addition, it does not add an\r\n * XML declaration or DTD, and the associated options in {@link IOptions} are\r\n * ignored. If desired, these must be added manually.\r\n */\r\nfunction parseToExistingElement(element, object, options) {\r\n var opts = new options_1.Options(options);\r\n parseValue(element.name, object, element, opts);\r\n}\r\nexports.parseToExistingElement = parseToExistingElement;\r\n/**\r\n * Returns a XML string representation of the specified object using the\r\n * specified options.\r\n *\r\n * `root` is the name of the root XML element. When the object is converted\r\n * to XML, it will be a child of this root element.\r\n */\r\nfunction parse(root, object, options) {\r\n var opts = new options_1.Options(options);\r\n var document = new xmlcreate_1.XmlDocument({\r\n validation: opts.validation,\r\n });\r\n if (opts.declaration.include) {\r\n document.decl(opts.declaration);\r\n }\r\n if (opts.dtd.include) {\r\n document.dtd({\r\n // Validated in options.ts\r\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\r\n name: opts.dtd.name,\r\n pubId: opts.dtd.pubId,\r\n sysId: opts.dtd.sysId,\r\n });\r\n }\r\n var rootElement = document.element({\r\n name: root,\r\n replaceInvalidCharsInName: opts.replaceInvalidChars,\r\n useSelfClosingTagIfEmpty: opts.useSelfClosingTagIfEmpty,\r\n });\r\n parseToExistingElement(rootElement, object, options);\r\n return document.toString(opts.format);\r\n}\r\nexports.parse = parse;\r\n", "'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n", "'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n", "'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n", "'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n", "'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n", "'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n", "'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n", "'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n", "'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n", "'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n", "/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n", "'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n", "/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n", "/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n", "var debug;\n\nmodule.exports = function () {\n if (!debug) {\n try {\n /* eslint global-require: off */\n debug = require(\"debug\")(\"follow-redirects\");\n }\n catch (error) { /* */ }\n if (typeof debug !== \"function\") {\n debug = function () { /* */ };\n }\n }\n debug.apply(null, arguments);\n};\n", "var url = require(\"url\");\nvar URL = url.URL;\nvar http = require(\"http\");\nvar https = require(\"https\");\nvar Writable = require(\"stream\").Writable;\nvar assert = require(\"assert\");\nvar debug = require(\"./debug\");\n\n// Create handlers that pass events from native requests\nvar events = [\"abort\", \"aborted\", \"connect\", \"error\", \"socket\", \"timeout\"];\nvar eventHandlers = Object.create(null);\nevents.forEach(function (event) {\n eventHandlers[event] = function (arg1, arg2, arg3) {\n this._redirectable.emit(event, arg1, arg2, arg3);\n };\n});\n\nvar InvalidUrlError = createErrorType(\n \"ERR_INVALID_URL\",\n \"Invalid URL\",\n TypeError\n);\n// Error types with codes\nvar RedirectionError = createErrorType(\n \"ERR_FR_REDIRECTION_FAILURE\",\n \"Redirected request failed\"\n);\nvar TooManyRedirectsError = createErrorType(\n \"ERR_FR_TOO_MANY_REDIRECTS\",\n \"Maximum number of redirects exceeded\"\n);\nvar MaxBodyLengthExceededError = createErrorType(\n \"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\",\n \"Request body larger than maxBodyLength limit\"\n);\nvar WriteAfterEndError = createErrorType(\n \"ERR_STREAM_WRITE_AFTER_END\",\n \"write after end\"\n);\n\n// An HTTP(S) request that can be redirected\nfunction RedirectableRequest(options, responseCallback) {\n // Initialize the request\n Writable.call(this);\n this._sanitizeOptions(options);\n this._options = options;\n this._ended = false;\n this._ending = false;\n this._redirectCount = 0;\n this._redirects = [];\n this._requestBodyLength = 0;\n this._requestBodyBuffers = [];\n\n // Attach a callback if passed\n if (responseCallback) {\n this.on(\"response\", responseCallback);\n }\n\n // React to responses of native requests\n var self = this;\n this._onNativeResponse = function (response) {\n self._processResponse(response);\n };\n\n // Perform the first request\n this._performRequest();\n}\nRedirectableRequest.prototype = Object.create(Writable.prototype);\n\nRedirectableRequest.prototype.abort = function () {\n abortRequest(this._currentRequest);\n this.emit(\"abort\");\n};\n\n// Writes buffered data to the current native request\nRedirectableRequest.prototype.write = function (data, encoding, callback) {\n // Writing is not allowed if end has been called\n if (this._ending) {\n throw new WriteAfterEndError();\n }\n\n // Validate input and shift parameters if necessary\n if (!isString(data) && !isBuffer(data)) {\n throw new TypeError(\"data should be a string, Buffer or Uint8Array\");\n }\n if (isFunction(encoding)) {\n callback = encoding;\n encoding = null;\n }\n\n // Ignore empty buffers, since writing them doesn't invoke the callback\n // https://github.com/nodejs/node/issues/22066\n if (data.length === 0) {\n if (callback) {\n callback();\n }\n return;\n }\n // Only write when we don't exceed the maximum body length\n if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {\n this._requestBodyLength += data.length;\n this._requestBodyBuffers.push({ data: data, encoding: encoding });\n this._currentRequest.write(data, encoding, callback);\n }\n // Error when we exceed the maximum body length\n else {\n this.emit(\"error\", new MaxBodyLengthExceededError());\n this.abort();\n }\n};\n\n// Ends the current native request\nRedirectableRequest.prototype.end = function (data, encoding, callback) {\n // Shift parameters if necessary\n if (isFunction(data)) {\n callback = data;\n data = encoding = null;\n }\n else if (isFunction(encoding)) {\n callback = encoding;\n encoding = null;\n }\n\n // Write data if needed and end\n if (!data) {\n this._ended = this._ending = true;\n this._currentRequest.end(null, null, callback);\n }\n else {\n var self = this;\n var currentRequest = this._currentRequest;\n this.write(data, encoding, function () {\n self._ended = true;\n currentRequest.end(null, null, callback);\n });\n this._ending = true;\n }\n};\n\n// Sets a header value on the current native request\nRedirectableRequest.prototype.setHeader = function (name, value) {\n this._options.headers[name] = value;\n this._currentRequest.setHeader(name, value);\n};\n\n// Clears a header value on the current native request\nRedirectableRequest.prototype.removeHeader = function (name) {\n delete this._options.headers[name];\n this._currentRequest.removeHeader(name);\n};\n\n// Global timeout for all underlying requests\nRedirectableRequest.prototype.setTimeout = function (msecs, callback) {\n var self = this;\n\n // Destroys the socket on timeout\n function destroyOnTimeout(socket) {\n socket.setTimeout(msecs);\n socket.removeListener(\"timeout\", socket.destroy);\n socket.addListener(\"timeout\", socket.destroy);\n }\n\n // Sets up a timer to trigger a timeout event\n function startTimer(socket) {\n if (self._timeout) {\n clearTimeout(self._timeout);\n }\n self._timeout = setTimeout(function () {\n self.emit(\"timeout\");\n clearTimer();\n }, msecs);\n destroyOnTimeout(socket);\n }\n\n // Stops a timeout from triggering\n function clearTimer() {\n // Clear the timeout\n if (self._timeout) {\n clearTimeout(self._timeout);\n self._timeout = null;\n }\n\n // Clean up all attached listeners\n self.removeListener(\"abort\", clearTimer);\n self.removeListener(\"error\", clearTimer);\n self.removeListener(\"response\", clearTimer);\n if (callback) {\n self.removeListener(\"timeout\", callback);\n }\n if (!self.socket) {\n self._currentRequest.removeListener(\"socket\", startTimer);\n }\n }\n\n // Attach callback if passed\n if (callback) {\n this.on(\"timeout\", callback);\n }\n\n // Start the timer if or when the socket is opened\n if (this.socket) {\n startTimer(this.socket);\n }\n else {\n this._currentRequest.once(\"socket\", startTimer);\n }\n\n // Clean up on events\n this.on(\"socket\", destroyOnTimeout);\n this.on(\"abort\", clearTimer);\n this.on(\"error\", clearTimer);\n this.on(\"response\", clearTimer);\n\n return this;\n};\n\n// Proxy all other public ClientRequest methods\n[\n \"flushHeaders\", \"getHeader\",\n \"setNoDelay\", \"setSocketKeepAlive\",\n].forEach(function (method) {\n RedirectableRequest.prototype[method] = function (a, b) {\n return this._currentRequest[method](a, b);\n };\n});\n\n// Proxy all public ClientRequest properties\n[\"aborted\", \"connection\", \"socket\"].forEach(function (property) {\n Object.defineProperty(RedirectableRequest.prototype, property, {\n get: function () { return this._currentRequest[property]; },\n });\n});\n\nRedirectableRequest.prototype._sanitizeOptions = function (options) {\n // Ensure headers are always present\n if (!options.headers) {\n options.headers = {};\n }\n\n // Since http.request treats host as an alias of hostname,\n // but the url module interprets host as hostname plus port,\n // eliminate the host property to avoid confusion.\n if (options.host) {\n // Use hostname if set, because it has precedence\n if (!options.hostname) {\n options.hostname = options.host;\n }\n delete options.host;\n }\n\n // Complete the URL object when necessary\n if (!options.pathname && options.path) {\n var searchPos = options.path.indexOf(\"?\");\n if (searchPos < 0) {\n options.pathname = options.path;\n }\n else {\n options.pathname = options.path.substring(0, searchPos);\n options.search = options.path.substring(searchPos);\n }\n }\n};\n\n\n// Executes the next native request (initial or redirect)\nRedirectableRequest.prototype._performRequest = function () {\n // Load the native protocol\n var protocol = this._options.protocol;\n var nativeProtocol = this._options.nativeProtocols[protocol];\n if (!nativeProtocol) {\n this.emit(\"error\", new TypeError(\"Unsupported protocol \" + protocol));\n return;\n }\n\n // If specified, use the agent corresponding to the protocol\n // (HTTP and HTTPS use different types of agents)\n if (this._options.agents) {\n var scheme = protocol.slice(0, -1);\n this._options.agent = this._options.agents[scheme];\n }\n\n // Create the native request and set up its event handlers\n var request = this._currentRequest =\n nativeProtocol.request(this._options, this._onNativeResponse);\n request._redirectable = this;\n for (var event of events) {\n request.on(event, eventHandlers[event]);\n }\n\n // RFC7230\u00A75.3.1: When making a request directly to an origin server, [\u2026]\n // a client MUST send only the absolute path [\u2026] as the request-target.\n this._currentUrl = /^\\//.test(this._options.path) ?\n url.format(this._options) :\n // When making a request to a proxy, [\u2026]\n // a client MUST send the target URI in absolute-form [\u2026].\n this._options.path;\n\n // End a redirected request\n // (The first request must be ended explicitly with RedirectableRequest#end)\n if (this._isRedirect) {\n // Write the request entity and end\n var i = 0;\n var self = this;\n var buffers = this._requestBodyBuffers;\n (function writeNext(error) {\n // Only write if this request has not been redirected yet\n /* istanbul ignore else */\n if (request === self._currentRequest) {\n // Report any write errors\n /* istanbul ignore if */\n if (error) {\n self.emit(\"error\", error);\n }\n // Write the next buffer if there are still left\n else if (i < buffers.length) {\n var buffer = buffers[i++];\n /* istanbul ignore else */\n if (!request.finished) {\n request.write(buffer.data, buffer.encoding, writeNext);\n }\n }\n // End the request if `end` has been called on us\n else if (self._ended) {\n request.end();\n }\n }\n }());\n }\n};\n\n// Processes a response from the current native request\nRedirectableRequest.prototype._processResponse = function (response) {\n // Store the redirected response\n var statusCode = response.statusCode;\n if (this._options.trackRedirects) {\n this._redirects.push({\n url: this._currentUrl,\n headers: response.headers,\n statusCode: statusCode,\n });\n }\n\n // RFC7231\u00A76.4: The 3xx (Redirection) class of status code indicates\n // that further action needs to be taken by the user agent in order to\n // fulfill the request. If a Location header field is provided,\n // the user agent MAY automatically redirect its request to the URI\n // referenced by the Location field value,\n // even if the specific status code is not understood.\n\n // If the response is not a redirect; return it as-is\n var location = response.headers.location;\n if (!location || this._options.followRedirects === false ||\n statusCode < 300 || statusCode >= 400) {\n response.responseUrl = this._currentUrl;\n response.redirects = this._redirects;\n this.emit(\"response\", response);\n\n // Clean up\n this._requestBodyBuffers = [];\n return;\n }\n\n // The response is a redirect, so abort the current request\n abortRequest(this._currentRequest);\n // Discard the remainder of the response to avoid waiting for data\n response.destroy();\n\n // RFC7231\u00A76.4: A client SHOULD detect and intervene\n // in cyclical redirections (i.e., \"infinite\" redirection loops).\n if (++this._redirectCount > this._options.maxRedirects) {\n this.emit(\"error\", new TooManyRedirectsError());\n return;\n }\n\n // Store the request headers if applicable\n var requestHeaders;\n var beforeRedirect = this._options.beforeRedirect;\n if (beforeRedirect) {\n requestHeaders = Object.assign({\n // The Host header was set by nativeProtocol.request\n Host: response.req.getHeader(\"host\"),\n }, this._options.headers);\n }\n\n // RFC7231\u00A76.4: Automatic redirection needs to done with\n // care for methods not known to be safe, [\u2026]\n // RFC7231\u00A76.4.2\u20133: For historical reasons, a user agent MAY change\n // the request method from POST to GET for the subsequent request.\n var method = this._options.method;\n if ((statusCode === 301 || statusCode === 302) && this._options.method === \"POST\" ||\n // RFC7231\u00A76.4.4: The 303 (See Other) status code indicates that\n // the server is redirecting the user agent to a different resource [\u2026]\n // A user agent can perform a retrieval request targeting that URI\n // (a GET or HEAD request if using HTTP) [\u2026]\n (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {\n this._options.method = \"GET\";\n // Drop a possible entity and headers related to it\n this._requestBodyBuffers = [];\n removeMatchingHeaders(/^content-/i, this._options.headers);\n }\n\n // Drop the Host header, as the redirect might lead to a different host\n var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);\n\n // If the redirect is relative, carry over the host of the last request\n var currentUrlParts = url.parse(this._currentUrl);\n var currentHost = currentHostHeader || currentUrlParts.host;\n var currentUrl = /^\\w+:/.test(location) ? this._currentUrl :\n url.format(Object.assign(currentUrlParts, { host: currentHost }));\n\n // Determine the URL of the redirection\n var redirectUrl;\n try {\n redirectUrl = url.resolve(currentUrl, location);\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError({ cause: cause }));\n return;\n }\n\n // Create the redirected request\n debug(\"redirecting to\", redirectUrl);\n this._isRedirect = true;\n var redirectUrlParts = url.parse(redirectUrl);\n Object.assign(this._options, redirectUrlParts);\n\n // Drop confidential headers when redirecting to a less secure protocol\n // or to a different domain that is not a superdomain\n if (redirectUrlParts.protocol !== currentUrlParts.protocol &&\n redirectUrlParts.protocol !== \"https:\" ||\n redirectUrlParts.host !== currentHost &&\n !isSubdomain(redirectUrlParts.host, currentHost)) {\n removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);\n }\n\n // Evaluate the beforeRedirect callback\n if (isFunction(beforeRedirect)) {\n var responseDetails = {\n headers: response.headers,\n statusCode: statusCode,\n };\n var requestDetails = {\n url: currentUrl,\n method: method,\n headers: requestHeaders,\n };\n try {\n beforeRedirect(this._options, responseDetails, requestDetails);\n }\n catch (err) {\n this.emit(\"error\", err);\n return;\n }\n this._sanitizeOptions(this._options);\n }\n\n // Perform the redirected request\n try {\n this._performRequest();\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError({ cause: cause }));\n }\n};\n\n// Wraps the key/value object of protocols with redirect functionality\nfunction wrap(protocols) {\n // Default settings\n var exports = {\n maxRedirects: 21,\n maxBodyLength: 10 * 1024 * 1024,\n };\n\n // Wrap each protocol\n var nativeProtocols = {};\n Object.keys(protocols).forEach(function (scheme) {\n var protocol = scheme + \":\";\n var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];\n var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);\n\n // Executes a request, following redirects\n function request(input, options, callback) {\n // Parse parameters\n if (isString(input)) {\n var parsed;\n try {\n parsed = urlToOptions(new URL(input));\n }\n catch (err) {\n /* istanbul ignore next */\n parsed = url.parse(input);\n }\n if (!isString(parsed.protocol)) {\n throw new InvalidUrlError({ input });\n }\n input = parsed;\n }\n else if (URL && (input instanceof URL)) {\n input = urlToOptions(input);\n }\n else {\n callback = options;\n options = input;\n input = { protocol: protocol };\n }\n if (isFunction(options)) {\n callback = options;\n options = null;\n }\n\n // Set defaults\n options = Object.assign({\n maxRedirects: exports.maxRedirects,\n maxBodyLength: exports.maxBodyLength,\n }, input, options);\n options.nativeProtocols = nativeProtocols;\n if (!isString(options.host) && !isString(options.hostname)) {\n options.hostname = \"::1\";\n }\n\n assert.equal(options.protocol, protocol, \"protocol mismatch\");\n debug(\"options\", options);\n return new RedirectableRequest(options, callback);\n }\n\n // Executes a GET request, following redirects\n function get(input, options, callback) {\n var wrappedRequest = wrappedProtocol.request(input, options, callback);\n wrappedRequest.end();\n return wrappedRequest;\n }\n\n // Expose the properties on the wrapped protocol\n Object.defineProperties(wrappedProtocol, {\n request: { value: request, configurable: true, enumerable: true, writable: true },\n get: { value: get, configurable: true, enumerable: true, writable: true },\n });\n });\n return exports;\n}\n\n/* istanbul ignore next */\nfunction noop() { /* empty */ }\n\n// from https://github.com/nodejs/node/blob/master/lib/internal/url.js\nfunction urlToOptions(urlObject) {\n var options = {\n protocol: urlObject.protocol,\n hostname: urlObject.hostname.startsWith(\"[\") ?\n /* istanbul ignore next */\n urlObject.hostname.slice(1, -1) :\n urlObject.hostname,\n hash: urlObject.hash,\n search: urlObject.search,\n pathname: urlObject.pathname,\n path: urlObject.pathname + urlObject.search,\n href: urlObject.href,\n };\n if (urlObject.port !== \"\") {\n options.port = Number(urlObject.port);\n }\n return options;\n}\n\nfunction removeMatchingHeaders(regex, headers) {\n var lastValue;\n for (var header in headers) {\n if (regex.test(header)) {\n lastValue = headers[header];\n delete headers[header];\n }\n }\n return (lastValue === null || typeof lastValue === \"undefined\") ?\n undefined : String(lastValue).trim();\n}\n\nfunction createErrorType(code, message, baseClass) {\n // Create constructor\n function CustomError(properties) {\n Error.captureStackTrace(this, this.constructor);\n Object.assign(this, properties || {});\n this.code = code;\n this.message = this.cause ? message + \": \" + this.cause.message : message;\n }\n\n // Attach constructor and set default properties\n CustomError.prototype = new (baseClass || Error)();\n CustomError.prototype.constructor = CustomError;\n CustomError.prototype.name = \"Error [\" + code + \"]\";\n return CustomError;\n}\n\nfunction abortRequest(request) {\n for (var event of events) {\n request.removeListener(event, eventHandlers[event]);\n }\n request.on(\"error\", noop);\n request.abort();\n}\n\nfunction isSubdomain(subdomain, domain) {\n assert(isString(subdomain) && isString(domain));\n var dot = subdomain.length - domain.length - 1;\n return dot > 0 && subdomain[dot] === \".\" && subdomain.endsWith(domain);\n}\n\nfunction isString(value) {\n return typeof value === \"string\" || value instanceof String;\n}\n\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\nfunction isBuffer(value) {\n return typeof value === \"object\" && (\"length\" in value);\n}\n\n// Exports\nmodule.exports = wrap({ http: http, https: https });\nmodule.exports.wrap = wrap;\n", "{\n \"name\": \"axios\",\n \"version\": \"0.21.4\",\n \"description\": \"Promise based HTTP client for the browser and node.js\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"test\": \"grunt test\",\n \"start\": \"node ./sandbox/server.js\",\n \"build\": \"NODE_ENV=production grunt build\",\n \"preversion\": \"npm test\",\n \"version\": \"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\n \"postversion\": \"git push && git push --tags\",\n \"examples\": \"node ./examples/server.js\",\n \"coveralls\": \"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\n \"fix\": \"eslint --fix lib/**/*.js\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/axios/axios.git\"\n },\n \"keywords\": [\n \"xhr\",\n \"http\",\n \"ajax\",\n \"promise\",\n \"node\"\n ],\n \"author\": \"Matt Zabriskie\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/axios/axios/issues\"\n },\n \"homepage\": \"https://axios-http.com\",\n \"devDependencies\": {\n \"coveralls\": \"^3.0.0\",\n \"es6-promise\": \"^4.2.4\",\n \"grunt\": \"^1.3.0\",\n \"grunt-banner\": \"^0.6.0\",\n \"grunt-cli\": \"^1.2.0\",\n \"grunt-contrib-clean\": \"^1.1.0\",\n \"grunt-contrib-watch\": \"^1.0.0\",\n \"grunt-eslint\": \"^23.0.0\",\n \"grunt-karma\": \"^4.0.0\",\n \"grunt-mocha-test\": \"^0.13.3\",\n \"grunt-ts\": \"^6.0.0-beta.19\",\n \"grunt-webpack\": \"^4.0.2\",\n \"istanbul-instrumenter-loader\": \"^1.0.0\",\n \"jasmine-core\": \"^2.4.1\",\n \"karma\": \"^6.3.2\",\n \"karma-chrome-launcher\": \"^3.1.0\",\n \"karma-firefox-launcher\": \"^2.1.0\",\n \"karma-jasmine\": \"^1.1.1\",\n \"karma-jasmine-ajax\": \"^0.1.13\",\n \"karma-safari-launcher\": \"^1.0.0\",\n \"karma-sauce-launcher\": \"^4.3.6\",\n \"karma-sinon\": \"^1.0.5\",\n \"karma-sourcemap-loader\": \"^0.3.8\",\n \"karma-webpack\": \"^4.0.2\",\n \"load-grunt-tasks\": \"^3.5.2\",\n \"minimist\": \"^1.2.0\",\n \"mocha\": \"^8.2.1\",\n \"sinon\": \"^4.5.0\",\n \"terser-webpack-plugin\": \"^4.2.3\",\n \"typescript\": \"^4.0.5\",\n \"url-search-params\": \"^0.10.0\",\n \"webpack\": \"^4.44.2\",\n \"webpack-dev-server\": \"^3.11.0\"\n },\n \"browser\": {\n \"./lib/adapters/http.js\": \"./lib/adapters/xhr.js\"\n },\n \"jsdelivr\": \"dist/axios.min.js\",\n \"unpkg\": \"dist/axios.min.js\",\n \"typings\": \"./index.d.ts\",\n \"dependencies\": {\n \"follow-redirects\": \"^1.14.0\"\n },\n \"bundlesize\": [\n {\n \"path\": \"./dist/axios.min.js\",\n \"threshold\": \"5kB\"\n }\n ]\n}\n", "'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildFullPath = require('../core/buildFullPath');\nvar buildURL = require('./../helpers/buildURL');\nvar http = require('http');\nvar https = require('https');\nvar httpFollow = require('follow-redirects').http;\nvar httpsFollow = require('follow-redirects').https;\nvar url = require('url');\nvar zlib = require('zlib');\nvar pkg = require('./../../package.json');\nvar createError = require('../core/createError');\nvar enhanceError = require('../core/enhanceError');\n\nvar isHttps = /https:?/;\n\n/**\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} proxy\n * @param {string} location\n */\nfunction setProxy(options, proxy, location) {\n options.hostname = proxy.host;\n options.host = proxy.host;\n options.port = proxy.port;\n options.path = location;\n\n // Basic proxy authorization\n if (proxy.auth) {\n var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n // If a proxy is used, any redirects must also pass through the proxy\n options.beforeRedirect = function beforeRedirect(redirection) {\n redirection.headers.host = redirection.host;\n setProxy(redirection, proxy, redirection.href);\n };\n}\n\n/*eslint consistent-return:0*/\nmodule.exports = function httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {\n var resolve = function resolve(value) {\n resolvePromise(value);\n };\n var reject = function reject(value) {\n rejectPromise(value);\n };\n var data = config.data;\n var headers = config.headers;\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n if ('User-Agent' in headers || 'user-agent' in headers) {\n // User-Agent is specified; handle case where no UA header is desired\n if (!headers['User-Agent'] && !headers['user-agent']) {\n delete headers['User-Agent'];\n delete headers['user-agent'];\n }\n // Otherwise, use specified value\n } else {\n // Only set header if it hasn't been set in config\n headers['User-Agent'] = 'axios/' + pkg.version;\n }\n\n if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(createError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n config\n ));\n }\n\n // Add Content-Length header if data exists\n headers['Content-Length'] = data.length;\n }\n\n // HTTP basic authentication\n var auth = undefined;\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n // Parse url\n var fullPath = buildFullPath(config.baseURL, config.url);\n var parsed = url.parse(fullPath);\n var protocol = parsed.protocol || 'http:';\n\n if (!auth && parsed.auth) {\n var urlAuth = parsed.auth.split(':');\n var urlUsername = urlAuth[0] || '';\n var urlPassword = urlAuth[1] || '';\n auth = urlUsername + ':' + urlPassword;\n }\n\n if (auth) {\n delete headers.Authorization;\n }\n\n var isHttpsRequest = isHttps.test(protocol);\n var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n\n var options = {\n path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, ''),\n method: config.method.toUpperCase(),\n headers: headers,\n agent: agent,\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth: auth\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n }\n\n var proxy = config.proxy;\n if (!proxy && proxy !== false) {\n var proxyEnv = protocol.slice(0, -1) + '_proxy';\n var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];\n if (proxyUrl) {\n var parsedProxyUrl = url.parse(proxyUrl);\n var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;\n var shouldProxy = true;\n\n if (noProxyEnv) {\n var noProxy = noProxyEnv.split(',').map(function trim(s) {\n return s.trim();\n });\n\n shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {\n if (!proxyElement) {\n return false;\n }\n if (proxyElement === '*') {\n return true;\n }\n if (proxyElement[0] === '.' &&\n parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {\n return true;\n }\n\n return parsed.hostname === proxyElement;\n });\n }\n\n if (shouldProxy) {\n proxy = {\n host: parsedProxyUrl.hostname,\n port: parsedProxyUrl.port,\n protocol: parsedProxyUrl.protocol\n };\n\n if (parsedProxyUrl.auth) {\n var proxyUrlAuth = parsedProxyUrl.auth.split(':');\n proxy.auth = {\n username: proxyUrlAuth[0],\n password: proxyUrlAuth[1]\n };\n }\n }\n }\n }\n\n if (proxy) {\n options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');\n setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n var transport;\n var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsProxy ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n transport = isHttpsProxy ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n }\n\n // Create the request\n var req = transport.request(options, function handleResponse(res) {\n if (req.aborted) return;\n\n // uncompress the response body transparently if required\n var stream = res;\n\n // return the last request in case of redirects\n var lastRequest = res.req || req;\n\n\n // if no content, is HEAD request or decompress disabled we should not decompress\n if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {\n switch (res.headers['content-encoding']) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'compress':\n case 'deflate':\n // add the unzipper to the body stream processing pipeline\n stream = stream.pipe(zlib.createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n }\n }\n\n var response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: res.headers,\n config: config,\n request: lastRequest\n };\n\n if (config.responseType === 'stream') {\n response.data = stream;\n settle(resolve, reject, response);\n } else {\n var responseBuffer = [];\n var totalResponseBytes = 0;\n stream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n totalResponseBytes += chunk.length;\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {\n stream.destroy();\n reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n config, null, lastRequest));\n }\n });\n\n stream.on('error', function handleStreamError(err) {\n if (req.aborted) return;\n reject(enhanceError(err, config, null, lastRequest));\n });\n\n stream.on('end', function handleStreamEnd() {\n var responseData = Buffer.concat(responseBuffer);\n if (config.responseType !== 'arraybuffer') {\n responseData = responseData.toString(config.responseEncoding);\n if (!config.responseEncoding || config.responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n\n response.data = responseData;\n settle(resolve, reject, response);\n });\n }\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return;\n reject(enhanceError(err, config, null, req));\n });\n\n // Handle request timeout\n if (config.timeout) {\n // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.\n var timeout = parseInt(config.timeout, 10);\n\n if (isNaN(timeout)) {\n reject(createError(\n 'error trying to parse `config.timeout` to int',\n config,\n 'ERR_PARSE_TIMEOUT',\n req\n ));\n\n return;\n }\n\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devoring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(timeout, function handleRequestTimeout() {\n req.abort();\n reject(createError(\n 'timeout of ' + timeout + 'ms exceeded',\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n req\n ));\n });\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (req.aborted) return;\n\n req.abort();\n reject(cancel);\n });\n }\n\n // Send the request\n if (utils.isStream(data)) {\n data.on('error', function handleStreamError(err) {\n reject(enhanceError(err, config, null, req));\n }).pipe(req);\n } else {\n req.end(data);\n }\n });\n};\n", "'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n", "'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n", "'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n", "'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n", "'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n", "'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n", "'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n", "'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n", "'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n", "'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n", "module.exports = require('./lib/axios');", "import path from \"node:path\";\n\nimport findUp from \"find-up\";\nimport pkgDir from \"pkg-dir\";\n\n// Consts\nconst IS_COMPONENT_LIBRARY = __dirname.includes(\"node_modules\");\nconst PROJECT_ALIASES = getComponentsLibAliases();\n\n/**\n * Returns the instance or monorepo paths.\n *\n * @param customPath The path for the instance components\n */\nfunction resolveComponentsPath(customPath = \"\") {\n\treturn IS_COMPONENT_LIBRARY\n\t\t? path.resolve(pkgDir.sync(__dirname) as string, \"../../../\", customPath)\n\t\t: path.resolve(\n\t\t\t\tpkgDir.sync(__dirname) as string,\n\t\t\t\t\"../griddo-components\",\n\t\t\t\tcustomPath,\n\t\t\t);\n}\n\n/**\n * Return the instance or monorepo components {t|j}sconfig.json file.\n */\nfunction getComponentsJSConfig() {\n\tconst jsConfigPath = findUp.sync(\"jsconfig.json\", {\n\t\tcwd: resolveComponentsPath(),\n\t});\n\tconst tsConfigPath = findUp.sync(\"tsconfig.json\", {\n\t\tcwd: resolveComponentsPath(),\n\t});\n\n\treturn tsConfigPath || jsConfigPath;\n}\n\n/**\n * Get the instance webpack aliases\n */\nfunction getComponentsLibAliases() {\n\t// eslint-disable-next-line @typescript-eslint/no-var-requires\n\tconst xsConfig = require(getComponentsJSConfig() as string);\n\n\treturn Object.keys(xsConfig?.compilerOptions?.paths).reduce(\n\t\t(currentAlias, pathKey) => {\n\t\t\tconst [aliasKey] = pathKey.split(\"/\");\n\t\t\tconst [pathAtJsConfig] =\n\t\t\t\txsConfig &&\n\t\t\t\txsConfig.compilerOptions &&\n\t\t\t\txsConfig.compilerOptions.paths &&\n\t\t\t\txsConfig.compilerOptions.paths[pathKey];\n\n\t\t\tconst [relativePathToDir] = pathAtJsConfig.split(\"/*\");\n\n\t\t\tconst absolutePath = resolveComponentsPath(relativePathToDir);\n\n\t\t\treturn {\n\t\t\t\t...currentAlias,\n\t\t\t\t[aliasKey]: absolutePath,\n\t\t\t};\n\t\t},\n\t\t{\n\t\t\t// Por este motivo se puede hacer `... import from \"@griddo-instance\" en\n\t\t\t// los packages del monorepo.\n\t\t\t\"@griddo-instance\": `${resolveComponentsPath()}/src/index.js`,\n\t\t},\n\t);\n}\n\nexport {\n\tIS_COMPONENT_LIBRARY,\n\tPROJECT_ALIASES,\n\tgetComponentsJSConfig,\n\tgetComponentsLibAliases,\n\tresolveComponentsPath,\n};\n", "import path from \"node:path\";\n\nimport pkgDir from \"pkg-dir\";\n\nimport { resolveComponentsPath } from \"./exporter/utils/instance\";\n\n// Paths\nconst REPO_ROOT_DIR = pkgDir.sync(path.resolve(__dirname, \"../..\"));\nconst CX_ROOT_DIR = pkgDir.sync(__dirname);\nconst SSG_DIR = path.resolve(pkgDir.sync(__dirname));\nconst CX_CACHE_DIR = path.resolve(CX_ROOT_DIR, \"caches\");\nconst COMPONENTS_DIR = resolveComponentsPath();\nconst EXPORTS_DIR = path.join(REPO_ROOT_DIR, \"exports/sites\");\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst { version: griddoVersion } = require(\n\tpath.join(CX_ROOT_DIR, \"package.json\"),\n);\n\nconst config = {\n\tproDomain: \"pro-\",\n\tgriddoVersion,\n\tpaths: (domain) => ({\n\t\t__caches: path.join(CX_CACHE_DIR, domain || \"\"),\n\t\t__components: COMPONENTS_DIR,\n\t\t__cx: CX_ROOT_DIR,\n\t\t__exports: path.join(EXPORTS_DIR, domain || \"\"),\n\t\t__root: REPO_ROOT_DIR,\n\t\t__ssg: SSG_DIR,\n\t\t__exports_dist: domain ? path.join(EXPORTS_DIR, domain, \"dist\") : \"\",\n\t\t__cx_dist: path.join(CX_ROOT_DIR, \"dist\"),\n\t}),\n};\n\nexport default config;\n", "#!/usr/bin/env node\n/* eslint-disable node/shebang */\n\nimport { runGatsbyAdapter } from \"../adapters\";\nimport { measureExecutionTime } from \"../utils/core-utils\";\nimport { getInstanceDomainsOrThrow } from \"../utils/domains\";\nimport { boxLog } from \"../utils/loggin\";\n\nasync function startRender() {\n\ttry {\n\t\tconst domains = await getInstanceDomainsOrThrow();\n\t\tconst exeTime = await measureExecutionTime([\n\t\t\t() => runGatsbyAdapter(domains),\n\t\t]);\n\n\t\tboxLog(`All domains rendered in ${exeTime}s.`, \"\", 1, 0);\n\n\t\tprocess.exit(0);\n\t} catch (error) {\n\t\tconsole.log(error);\n\n\t\tprocess.exit(1);\n\t}\n}\n\nexport { startRender };\n", "import path from \"node:path\";\n\nimport {\n\tgetGatsbyAssetPrefixWithDomain,\n\tlegacy__createDistFromGatsbyPublic,\n\trunGatsbyBuildCommand,\n} from \"./utils\";\nimport { getArtifacts } from \"../../artifacts\";\nimport { envs } from \"../../constants\";\nimport { apiRegister } from \"../../registers\";\nimport { insertAlert } from \"../../utils/alerts\";\nimport {\n\tcreateRenderMetadata,\n\tdoLifeCycle,\n\tgetConfig,\n} from \"../../utils/core-utils\";\nimport { createBuildData } from \"../../utils/create-build-data\";\nimport {\n\tclearEmptyDirs,\n\tcopyArtifacts,\n\tcreateArtifacts,\n\tmoveArtifacts,\n\tremoveArtifacts,\n\tremoveVirtualPagesFromStore,\n\trenameArtifact,\n} from \"../../utils/folders\";\nimport { debugLog, infoLog, printExporterLogo } from \"../../utils/loggin\";\nimport {\n\tcreateSentinelRenderFile,\n\tdeleteSentinelRenderFile,\n\tisValidRenderProcessOrThrow,\n} from \"../../utils/render\";\n\nconst config = getConfig();\n\nasync function renderDomain(domain: string) {\n\tinfoLog(`Initializing render for the domain ${domain}`);\n\n\tcreateSentinelRenderFile();\n\n\tconst cxPaths = config.paths(domain);\n\tconst domainArtifacts = getArtifacts(\"gatsby\", { cxPaths });\n\tconst { __ssg, __exports, __caches, __cx, __components } = cxPaths;\n\n\tconst arts = {\n\t\t...domainArtifacts,\n\t\tall: {\n\t\t\tdisposables: [\n\t\t\t\t...domainArtifacts.cx.disposables,\n\t\t\t\t...domainArtifacts.ssg.disposables,\n\t\t\t],\n\t\t\tinitials: [\n\t\t\t\t...domainArtifacts.cx.initials,\n\t\t\t\t...domainArtifacts.ssg.initials,\n\t\t\t],\n\t\t},\n\t};\n\n\t// This variables are for:\n\t// - Create the dist directory from public in the Relocation LifeCycle.\n\t// - Pass to the gatsby-build command via spawnSync in the SSG LifeCycle.\n\tconst assetPrefix = getGatsbyAssetPrefixWithDomain(domain);\n\tconst needsAssetPrefix = !!assetPrefix && assetPrefix !== \"\";\n\n\t// LifeCycles\n\n\tawait doLifeCycle(\"Clean\", {\n\t\tsteps: [() => removeArtifacts(arts.all.disposables)],\n\t});\n\n\tawait doLifeCycle(\"Prepare\", {\n\t\tsteps: [() => createArtifacts(arts.all.initials)],\n\t});\n\n\tawait doLifeCycle(\"Restore\", {\n\t\tsteps: [\n\t\t\t() => copyArtifacts(__components, __ssg, [\"static\"]),\n\t\t\t() => copyArtifacts(__exports, __cx, arts.cx.archivables),\n\t\t\t() => renameArtifact(path.join(__cx, \"dist\"), path.join(__ssg, \"public\")),\n\t\t\t() => moveArtifacts(__caches, __cx, arts.cx.cacheables),\n\t\t\t() => moveArtifacts(__caches, __ssg, arts.ssg.cacheables),\n\t\t],\n\t});\n\n\tawait doLifeCycle(\"Data\", {\n\t\tsteps: [() => createBuildData(domain)],\n\t});\n\n\tawait doLifeCycle(\"SSG\", {\n\t\tsteps: [() => runGatsbyBuildCommand(assetPrefix)],\n\t});\n\n\tawait doLifeCycle(\"Relocation\", {\n\t\tsteps: [() => legacy__createDistFromGatsbyPublic(domain, needsAssetPrefix)],\n\t});\n\n\tawait doLifeCycle(\"Meta\", {\n\t\tsteps: [() => createRenderMetadata(domain)],\n\t});\n\n\tawait doLifeCycle(\"Archive\", {\n\t\tsteps: [\n\t\t\t() => removeVirtualPagesFromStore(),\n\t\t\t() => clearEmptyDirs(path.join(__cx, \"dist\")),\n\t\t\t() =>\n\t\t\t\tmoveArtifacts(__cx, __exports, arts.cx.archivables, {\n\t\t\t\t\twithBackup: true,\n\t\t\t\t}),\n\t\t\t() => moveArtifacts(__cx, __caches, arts.cx.cacheables),\n\t\t\t() => moveArtifacts(__ssg, __caches, arts.ssg.cacheables),\n\t\t],\n\t});\n\n\tawait doLifeCycle(\"Close\", {\n\t\tsteps: [() => removeArtifacts(arts.all.disposables)],\n\t});\n\n\tawait doLifeCycle(\"HealthCheck\", {\n\t\tsteps: [() => isValidRenderProcessOrThrow()],\n\t});\n\n\tdeleteSentinelRenderFile();\n}\n\nasync function runGatsbyAdapter(domains: Array<string>) {\n\tprintExporterLogo(\"gatsby\");\n\n\tfor (const domain of domains) {\n\t\tawait renderDomain(domain);\n\t}\n\n\tif (envs.GRIDDO_ALERT_FEATURE && apiRegister.haveEntries()) {\n\t\tconst registerContent = apiRegister.get(\"API_RESPONSE_TOO_BIG\");\n\n\t\tdebugLog(\"\\nRender register report\\n\");\n\t\tdebugLog(registerContent);\n\t\tdebugLog();\n\n\t\tinsertAlert({\n\t\t\tdescription: \"API response size is too large (80KB).\",\n\t\t\tarea: \"Griddo\",\n\t\t\tlevel: \"W\",\n\t\t\tfullData: {\n\t\t\t\toutput: registerContent,\n\t\t\t\tdate: new Date().toISOString(),\n\t\t\t},\n\t\t});\n\t}\n}\n\nexport { runGatsbyAdapter };\n", "import { spawnSync } from \"node:child_process\";\nimport path from \"node:path\";\n\nimport dotenv from \"dotenv\";\nimport fsx from \"fs-extra\";\n\nimport { getConfig } from \"../../utils/core-utils\";\nimport { verboseLog } from \"../../utils/loggin\";\n\ndotenv.config();\n\nconst config = getConfig();\n\n/**\n * Return the assetPrefix with the domain concatenated `assetPrefix/domain` only\n * if the domain is \"pro-\" **and** there is a env `GRIDDO_ASSET_PREFIX` with any\n * value different from `null`, `undefined` or `empty string`\n *\n * else...\n * - If assetPrefix or domain is falsy, returns \"\"\n * - If the domain is not \"pro-\", returns \"\"\n */\nfunction getGatsbyAssetPrefixWithDomain(domain: string) {\n\tconst { proDomain } = getConfig();\n\tconst assetPrefix =\n\t\tprocess.env.GRIDDO_ASSET_PREFIX || process.env.ASSET_PREFIX;\n\n\tif (!assetPrefix || !domain) return \"\";\n\tif (!domain.startsWith(proDomain)) return \"\";\n\n\tconst assetPrefixWithDomain = `${assetPrefix}/${domain}`;\n\n\tverboseLog(\n\t\t`Reading env.GRIDDO_ASSET_PREFIX, ${process.env.GRIDDO_ASSET_PREFIX}`,\n\t);\n\tverboseLog(\n\t\t`Setting the asset prefix with the domain concatenated, ${assetPrefixWithDomain}`,\n\t);\n\n\treturn assetPrefixWithDomain;\n}\n\n/**\n * Spawn a new node process `yarn gatsby-build`\n * @note This proccess (`yarn gatsby-build`) can not access to the custom Griddo\n * `process.env` so it needs variables passed to it via the `env` prop.\n */\nfunction runGatsbyBuildCommand(assetPrefixWithDomain: string) {\n\tverboseLog(`read assetPrefixWithDomain, ${assetPrefixWithDomain}`);\n\n\tconst { __ssg } = config.paths();\n\n\tconst command = spawnSync(\n\t\t\"yarn\",\n\t\t[\"gatsby-build\", process.env.GRIDDO_SSG_VERBOSE ? \"--verbose\" : \"\"],\n\t\t{\n\t\t\tcwd: __ssg,\n\t\t\tstdio: [\"ignore\", \"inherit\", \"ignore\"],\n\t\t\tencoding: \"utf8\",\n\t\t\tshell: true,\n\t\t\tenv: Object.assign(process.env, {\n\t\t\t\tGRIDDO_EXPORTER: \"true\",\n\t\t\t\tSPAWN_ASSET_PREFIX_WITH_DOMAIN: assetPrefixWithDomain,\n\t\t\t}),\n\t\t},\n\t);\n\n\tif (command.status !== 0) {\n\t\tthrow new Error(`Error in gatsby build ${JSON.stringify(command)}`);\n\t}\n}\n\n/**\n * Update the Griddo's `/dist` dir with the contents from `public` dir only\n * with files of type: js, json and css.\n */\nasync function legacy__createDistFromGatsbyPublic(\n\tdomain: string,\n\tneedsAssetPrefix: boolean,\n) {\n\tconst { __cx, __ssg } = config.paths(domain);\n\n\tconst cxDistDir = path.join(__cx, \"dist\");\n\tconst cxAssetsDir = path.join(__cx, \"assets\");\n\tconst cxDistDirWithDomain = path.join(__cx, \"dist\", domain);\n\tconst publicDir = path.join(__ssg, \"public\");\n\n\tconst validFilesFromPublic = fsx\n\t\t.readdirSync(publicDir)\n\t\t.filter(\n\t\t\t(file) =>\n\t\t\t\tpath.extname(file) === \".js\" ||\n\t\t\t\tpath.extname(file) === \".json\" ||\n\t\t\t\tpath.extname(file) === \".css\",\n\t\t);\n\n\tconst pageDataSrc = `${publicDir}/page-data`;\n\tconst pageDataDest = `${cxAssetsDir}/page-data`;\n\n\tconst projectStaticSrc = path.join(__ssg, \"static\");\n\tconst projectStaticDest = cxAssetsDir;\n\n\tconst gatsbyStaticSrc = `${cxDistDir}/static`;\n\tconst gatsbyStaticDest = `${cxAssetsDir}/static`;\n\n\ttry {\n\t\tfsx.mkdirSync(cxAssetsDir, { recursive: true });\n\t\tfsx.copySync(publicDir, cxDistDir, { preserveTimestamps: true });\n\n\t\tif (needsAssetPrefix) {\n\t\t\tfsx.copySync(pageDataSrc, pageDataDest, { preserveTimestamps: true });\n\t\t\tif (fsx.existsSync(projectStaticSrc)) {\n\t\t\t\tfsx.copySync(projectStaticSrc, projectStaticDest, {\n\t\t\t\t\toverwrite: false,\n\t\t\t\t\tpreserveTimestamps: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\tfsx.copySync(gatsbyStaticSrc, gatsbyStaticDest, {\n\t\t\t\toverwrite: false,\n\t\t\t\tpreserveTimestamps: true,\n\t\t\t});\n\t\t\tif (fsx.existsSync(projectStaticSrc)) {\n\t\t\t\tfsx.copySync(projectStaticSrc, cxDistDirWithDomain, {\n\t\t\t\t\toverwrite: false,\n\t\t\t\t\tpreserveTimestamps: true,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Copia el resto de archivos...\n\t\t\tvalidFilesFromPublic.map(async (file) => {\n\t\t\t\tconst fileSrc = `${publicDir}/${file}`;\n\t\t\t\tconst fileDest = `${cxAssetsDir}/${file}`;\n\t\t\t\tfsx.copySync(fileSrc, fileDest, { preserveTimestamps: true });\n\t\t\t});\n\t\t}\n\t} catch (err) {\n\t\tconsole.error(err);\n\t}\n}\n\nexport {\n\tgetGatsbyAssetPrefixWithDomain,\n\tlegacy__createDistFromGatsbyPublic,\n\trunGatsbyBuildCommand,\n};\n", "import type { APIResponses } from \"../types/api\";\nimport type { CXConfig, LifeCyclesNames } from \"../types/global\";\nimport type { APIPageObject } from \"../types/pages\";\nimport type { Site } from \"../types/sites\";\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport chalk from \"chalk\";\nimport dotenv from \"dotenv\";\nimport fsx from \"fs-extra\";\nimport pkgDir from \"pkg-dir\";\n\nimport { createDirsSync, removeDirsSync } from \"./folders\";\nimport { boxLog, verboseLog } from \"./loggin\";\nimport { generateBuildReport, generateSitemaps } from \"./sites\";\nimport { envs } from \"../constants\";\nimport { writeRobots } from \"../services/robots\";\n\ndotenv.config();\n\nconst config = getConfig();\n\nconst instanceRootDir = pkgDir.sync()!; // instance root dir\n\n/**\n * Returns the configuration file content.\n *\n * @example\n * const config = getConfig()\n * const { __cx } = config.paths()\n * const { griddoVersion, proDomain } = config\n */\nfunction getConfig(): CXConfig {\n\ttry {\n\t\t// eslint-disable-next-line @typescript-eslint/no-var-requires, node/no-missing-require, node/no-unpublished-require\n\t\tconst configModule = require(\"../../cx.config.js\");\n\t\tconst config = configModule.default;\n\n\t\treturn config;\n\t} catch (error) {\n\t\tconsole.log(\"Error while reading configuration file\");\n\t\tprocess.exit(1);\n\t}\n}\n\n/**\n * Create the initial mandatory directories for a render.\n *\n * @param domain The current domain in render.\n */\nasync function exporterCreateInitialDirectories(domain: string) {\n\tconst { __exports, __caches } = config.paths(domain);\n\n\tcreateDirsSync([__exports]);\n\tverboseLog(\"create `exports/sites/<domain>` directory\");\n\tcreateDirsSync([__caches]);\n\tverboseLog(\"create `caches/<domain>` directory\");\n}\n\n/**\n * Remove trash directories from __cx, maybe from a failed render.\n *\n * @param domain The current domain in render.\n */\nasync function exporterCleanDisposableDirectories(domain: string) {\n\tconst { __cx } = config.paths(domain);\n\n\tremoveDirsSync(__cx, [\"store\", \"apiCache\", \"dist\"]);\n\tverboseLog(\"clean `store`, `apiCache` and `dist` directories from `__cx`\");\n}\n\n/**\n * Returns true for \"true\", \"on\", true and positive numbers.\n * Returns false for \"false\", \"off\", false, 0, negative integers and anything else.\n */\nfunction isTruthy(value: any): boolean {\n\t// Return if Boolean\n\tif (typeof value === \"boolean\") return value;\n\n\t// Return false if null or undefined\n\tif (value === undefined || value === null) return false;\n\n\t// If the String is true or false\n\tif (value.toLowerCase() === \"true\") return true;\n\tif (value.toLowerCase() === \"false\") return false;\n\n\t// \"on\" | \"off\", We love them in Griddo ^^.\n\tif (value.toLowerCase() === \"on\") return true;\n\tif (value.toLowerCase() === \"off\") return false;\n\n\t// Now check if it's a number\n\tconst number = parseInt(value, 10);\n\tif (isNaN(number)) return false;\n\tif (number > 0) return true;\n\n\t// Default to false\n\treturn false;\n}\n\n/**\n * Walk a directory and returns the file pathts.\n *\n * @param dir A directory path.\n */\nfunction walk(dir: string) {\n\tconst results: Array<string> = [];\n\tconst list = fs.readdirSync(dir);\n\tlist.forEach((file) => {\n\t\tconst newLocalFile = `${dir}/${file}`;\n\t\tresults.push(newLocalFile);\n\t});\n\n\treturn results;\n}\n\n/**\n * Walk a directory and returns the JSON file absolute paths with one level of depth.\n * Bypass the `metadata` folder.\n * /abs/.../sotre/<siteId>/jsonfile.json\n * /abs/.../sotre/<siteId>/jsonfile.json\n * /abs/.../sotre/<siteId>/jsonfile.json\n * /abs/.../sotre/<siteId>/jsonfile.json\n */\nfunction walkStore(dir: string): Array<string> {\n\tconst results: Array<string> = [];\n\n\t// Listamos todas las subcarpetas y evitamos entrar en 'metadata'\n\tconst subdirs = fs.readdirSync(dir).filter((file) => {\n\t\tconst fullPath = path.join(dir, file);\n\t\treturn fs.statSync(fullPath).isDirectory() && file !== \"metadata\";\n\t});\n\n\t// Iteramos sobre las subcarpetas\n\tfor (const subdir of subdirs) {\n\t\tconst subdirPath = path.join(dir, subdir);\n\n\t\t// Listamos los archivos en cada subcarpeta y filtramos los .json\n\t\tconst files = fs\n\t\t\t.readdirSync(subdirPath)\n\t\t\t.filter((file) => file.endsWith(\".json\"));\n\n\t\tfor (const file of files) {\n\t\t\tresults.push(path.join(subdirPath, file));\n\t\t}\n\t}\n\n\treturn results;\n}\n\n/**\n * Custom delay using the \"promise hack\",\n *\n * @param ms Amount of miliseconds to be delayed\n */\nfunction delay(ms: number) {\n\treturn new Promise((res) => setTimeout(res, ms));\n}\n\n/**\n * Converts milliseconds to seconds with a fixed number of decimals.\n *\n * @param ms The number in milliseconds.\n * @param fixed The amount of fixed decimals.\n * @returns The converted number in seconds with the fixed number of decimals.\n */\nexport function msToSec(ms: number, decimals = 3) {\n\treturn (ms / 1000).toFixed(decimals);\n}\n\n/**\n * Return a siteID from a response object if exist\n * @param response A response object\n */\nexport function getSafeSiteId(response: APIResponses) {\n\tif (typeof response === \"string\") {\n\t\treturn undefined;\n\t}\n\n\treturn \"site\" in response && response.site ? response?.site : undefined;\n}\n\n/**\n * Remove props from an object\n *\n * @param obj The object\n * @param props An array of props to be removed\n */\nfunction removeProperties(obj: Record<string, unknown>, props: Array<string>) {\n\tfor (const key in obj) {\n\t\tif (props.includes(key)) {\n\t\t\tdelete obj[key];\n\t\t} else if (typeof obj[key] === \"object\") {\n\t\t\tremoveProperties(obj[key] as Record<string, unknown>, props);\n\t\t}\n\t}\n}\n\n/**\n * Return a list of sites with their names and ids.\n *\n * @param sites An array of sites objects\n */\nfunction siteList(sites: Array<Site>) {\n\treturn sites.map(({ name, id }) => `${name} (${id})`).join(\", \");\n}\n\n/**\n * Remove unused files (old) inside the `apiCache` dir\n *\n * @todo remove other file types: sites, socials, etc..\n */\nfunction sanitizeAPICacheDir() {\n\tconst { __cx } = config.paths();\n\tconst dirPath = path.join(__cx, \"apiCache\");\n\tconst allCachedFiles = fs.readdirSync(dirPath);\n\n\t// Object to store the the more rencent file names\n\t// Record<string, string> = { \"234856872634\", \"3268746238747238.json\"};\n\tconst filesByIdMap: Record<string, string> = {};\n\t// ^id ^path\n\n\t// Page files.\n\t// We only need files that describes a page object.\n\tconst pageFilePaths = allCachedFiles.filter((fileName) => {\n\t\tconst filePath = `${dirPath}/${fileName}`;\n\t\tconst fileObject = fsx.readJSONSync(filePath, \"utf-8\") as APIPageObject;\n\t\tconst { id, entity, fullUrl } = fileObject;\n\n\t\t// Is a page file if has id, entity and fullUrl\n\t\treturn !!(id && entity && fullUrl);\n\t});\n\n\t// Fill the filesById object\n\tfor (const fileName of pageFilePaths) {\n\t\tconst filePath = `${dirPath}/${fileName}`;\n\t\tconst fileObject = fsx.readJSONSync(filePath, \"utf-8\") as APIPageObject;\n\t\tconst fileCreationDate = fs.statSync(filePath).mtimeMs;\n\n\t\tconst { id } = fileObject;\n\n\t\t// Is a valid page if doesn't exists in the store object or is newer\n\t\t// that the stored one.\n\t\tconst validPageFile =\n\t\t\t!filesByIdMap[id] ||\n\t\t\tfileCreationDate > fs.statSync(`${dirPath}/${filesByIdMap[id]}`).mtimeMs;\n\n\t\tif (validPageFile) filesByIdMap[id] = fileName;\n\t}\n\n\tlet counter = 0;\n\n\t// Delete files using the store object filesById as reference map.\n\tfor (const fileName of pageFilePaths) {\n\t\tconst filePath = `${dirPath}/${fileName}`;\n\t\tconst fileObject = fsx.readJSONSync(filePath, \"utf-8\") as APIPageObject;\n\n\t\tconst { id } = fileObject;\n\n\t\t// If the filename is not present in the map, remove it!\n\t\tif (fileName !== filesByIdMap[id]) {\n\t\t\tfs.unlinkSync(filePath);\n\t\t\tcounter++;\n\t\t}\n\t}\n\n\tconsole.log(`Sanitize apiCache dir for ${counter} files`);\n}\n\n/**\n * Measures the execution time of a series of sync or async functions.\n * @param functions - Functions to be executed to measure their execution time.\n * @returns A promise that resolves with the total execution time in seconds.\n */\nasync function measureExecutionTime(\n\tfunctions: Array<(...args: Array<unknown>) => unknown | Promise<unknown>>,\n\tdelayInMS = 0,\n): Promise<number> {\n\tconst start = process.hrtime();\n\n\tfor (const func of functions) {\n\t\tawait func();\n\t\tif (delayInMS > 0) {\n\t\t\tawait delay(delayInMS);\n\t\t}\n\t}\n\n\tconst [seconds, miliseconds] = process.hrtime(start);\n\tconst timeInSeconds = seconds + miliseconds / 1e9;\n\n\treturn +timeInSeconds.toFixed(3);\n}\n\nfunction pause(title: string) {\n\tconst isPauseEnabled = !!JSON.parse(\n\t\tprocess.env.GRIDDO_RENDER_BREAKPOINTS_FEATURE || \"false\",\n\t);\n\n\tif (!isPauseEnabled) {\n\t\treturn;\n\t}\n\n\treturn new Promise<void>((resolve) => {\n\t\tconsole.log(\"\\n\");\n\t\tboxLog(`\u231B\uFE0F ${title}`, \"\", 1, 0);\n\t\tprocess.stdin.once(\"data\", () => {\n\t\t\tresolve();\n\t\t});\n\t});\n}\n\n/**\n * Executes a life cycle process, which involves executing an array of\n * functions, printing to the console, and handling errors with optional\n * retries.\n *\n * @async\n * @param name - The name of the life cycle.\n * @param options - The arguments object.\n * @param options.steps - An array of functions to execute.\n * @param options.delay - Delay between steps functions.\n * @param options.bypass - Skip the step functions.\n * @returns - A promise that resolves when the life cycle process is completed.\n */\nasync function doLifeCycle(\n\tname: LifeCyclesNames,\n\toptions: {\n\t\tsteps: Array<(...args: Array<unknown>) => unknown | Promise<any>>;\n\t\tdelay?: number;\n\t\tbypass?: boolean;\n\t},\n) {\n\tconst { steps, bypass, delay } = options;\n\n\tif (bypass) {\n\t\treturn;\n\t}\n\n\tconst attemptsByLifeCycleName: Record<LifeCyclesNames, number> = {\n\t\tArchive: envs.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS,\n\t\tData: envs.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS,\n\t\tMeta: envs.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS,\n\t\tRelocation: envs.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS,\n\t\tClean: envs.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS,\n\t\tRestore: envs.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS,\n\t\tPrepare: envs.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS,\n\t\tClose: envs.GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS,\n\t\tSSG: envs.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS,\n\t\tHealthCheck: 1,\n\t\t__DEBUG__: 1,\n\t};\n\n\tlet trysCount = 0;\n\tconst maxTrysAccepted = attemptsByLifeCycleName[name] || 1;\n\n\twhile (trysCount < maxTrysAccepted) {\n\t\ttry {\n\t\t\tconsole.info(`\\n${chalk.blue(`info`)} start ${name} life-cycle`);\n\t\t\tconst exeTime = await measureExecutionTime(steps, delay);\n\t\t\tconsole.info(`${chalk.green(\"success\")} ${name} - ${exeTime}s`);\n\t\t\t// if no errors, go out!! :)\n\t\t\tawait pause(`${name} LifeCycle`);\n\t\t\tbreak;\n\t\t} catch (error) {\n\t\t\tconst errorString = chalk.bgRed.black(` Error in ${name} LifeCycle `);\n\t\t\tconst attemptsString = chalk.yellow(`Attempt (${trysCount + 1})`);\n\t\t\tconsole.log(`\\n${errorString} ${attemptsString}\\n`);\n\t\t\tconsole.log(error);\n\t\t\tconsole.log();\n\n\t\t\ttrysCount++;\n\t\t}\n\t}\n\tif (trysCount === maxTrysAccepted) {\n\t\tthrow new Error(\n\t\t\t`Exceeded maximum retry attempts (${maxTrysAccepted}) for ${name} LifeCycle`,\n\t\t);\n\t}\n}\n\nfunction isVersionGreaterThan(versionA: string, versionB: string) {\n\tconst [majorA, minorA, patchA] = versionA.split(\".\").map(Number);\n\tconst [majorB, minorB, patchB] = versionB.split(\".\").map(Number);\n\n\tif (majorA !== majorB) {\n\t\treturn majorA > majorB;\n\t}\n\n\tif (minorA !== minorB) {\n\t\treturn minorA > minorB;\n\t}\n\n\treturn patchA > patchB;\n}\n\nfunction isVersionLowerThan(versionA: string, versionB: string) {\n\treturn !isVersionGreaterThan(versionA, versionB);\n}\n\n/**\n * Creates additional files after the render: sitemaps, robots and a report of\n * the finished render.\n *\n * @async\n * @param domain\n */\nasync function createRenderMetadata(domain: string) {\n\tawait generateBuildReport();\n\tawait generateSitemaps();\n\tawait writeRobots(domain);\n}\n\nfunction removeAllSiteDirsFromStore() {\n\tconst { __cx } = config.paths();\n\tconst storeDir = path.join(__cx, \"store\");\n\tconst allDirs = fs.readdirSync(storeDir);\n\n\tconst allSiteDirs = allDirs.filter((dirname) => dirname !== \"metadata\");\n\n\tconst allSiteDirsFullPath = allSiteDirs.map((name) =>\n\t\tpath.join(storeDir, name),\n\t);\n\n\t// Remove all site directories except \"metadata\" directory.\n\tfor (const site of allSiteDirsFullPath) {\n\t\tfs.rmSync(site, { recursive: true, force: true });\n\t}\n}\n\nexport {\n\tcreateRenderMetadata,\n\tdelay,\n\tdoLifeCycle,\n\texporterCleanDisposableDirectories,\n\texporterCreateInitialDirectories,\n\tgetConfig,\n\tinstanceRootDir,\n\tisTruthy,\n\tisVersionGreaterThan,\n\tisVersionLowerThan,\n\tmeasureExecutionTime,\n\tpause,\n\tremoveProperties,\n\tremoveAllSiteDirsFromStore,\n\tsanitizeAPICacheDir,\n\tsiteList,\n\twalk,\n\twalkStore,\n};\n", "import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport fsx, { MakeDirectoryOptions } from \"fs-extra\";\n\nimport { getConfig, walkStore } from \"./core-utils\";\nimport { verboseLog } from \"./loggin\";\n\nconst config = getConfig();\n\n/**\n * Remove an empty directory from the basePath recursively.\n * If the directory has only .xml files it will handle as empty too (empty site)\n *\n * @param baseDir - The base directory.\n */\nconst clearEmptyDirs = (baseDir: string) => {\n\tconst isDir = fsx.statSync(baseDir).isDirectory();\n\tif (!isDir) {\n\t\treturn;\n\t}\n\n\t// archivos o direvtorios dentro de `dir`\n\tlet children = fsx.readdirSync(baseDir);\n\t// let children = childrenRaw.filter((file) => {\n\t// \treturn path.extname(file).toLowerCase() !== \".xml\";\n\t// });\n\tconst dirHasChildren = children.length > 0;\n\n\t// Por cada uno de ellos miramos si tiene hijos, enviamos cada uno de ellos\n\t// a `clearEmptyDirsWithXML`\n\tif (dirHasChildren) {\n\t\tconst childrenCount = children.length;\n\t\tconst xmlCount = children.filter((file) => {\n\t\t\treturn path.extname(file).toLowerCase() === \".xml\";\n\t\t}).length;\n\n\t\t// Todos los hijos son archivos .xml\n\t\t// Podemos borrarlos y dejar el dir vac\u00EDo.\n\t\tif (childrenCount === xmlCount) {\n\t\t\tchildren.forEach(function (xmlFile) {\n\t\t\t\tconst fullPath = path.join(baseDir, xmlFile);\n\t\t\t\tfsx.rmSync(fullPath);\n\t\t\t});\n\t\t\tchildren = fsx.readdirSync(baseDir);\n\t\t}\n\n\t\tchildren.forEach(function (file) {\n\t\t\tconst fullPath = path.join(baseDir, file);\n\t\t\tclearEmptyDirs(fullPath);\n\t\t});\n\n\t\t// re-evaluate files; after deleting subdir we may have parent dir\n\t\t// empty now...\n\t\tchildren = fsx.readdirSync(baseDir);\n\t}\n\n\t// Si no tiene hijos, lo borramos\n\tif (children.length === 0) {\n\t\tfsx.rmdirSync(baseDir);\n\t\treturn;\n\t}\n};\n\n/**\n * Creates multiple directories.\n *\n * @param dirs - An array of directory paths.\n * @param options - Same option as `fs.mkdirSync()`\n */\nfunction createDirsSync(dirs: Array<string>, options?: MakeDirectoryOptions) {\n\tfor (const dir of dirs) {\n\t\tif (!fs.existsSync(dir)) {\n\t\t\tfs.mkdirSync(dir, { recursive: true, ...options });\n\t\t}\n\t}\n}\n\n/**\n * Copy multiple directories with backup option.\n *\n * @param src - Source directory.\n * @param dst - Destination directory.\n * @param dirs - Directories to copy.\n * @param options.withBackup - Create a previous backup before copy.\n */\nfunction copyDirsSync(\n\tsrc: string,\n\tdst: string,\n\tdirs: Array<string>,\n\toptions = {\n\t\twithBackup: false,\n\t},\n) {\n\tconst { withBackup } = options;\n\tfor (const dir of dirs) {\n\t\tconst srcCompose = path.join(src, dir);\n\t\tconst dstCompose = path.join(dst, dir);\n\n\t\t// The dir we want to copy, doesn't exist.\n\t\tif (!fsx.existsSync(srcCompose)) {\n\t\t\tconsole.log(`Source directory does not exist: ${srcCompose}`);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Create the backup\n\t\tif (withBackup) {\n\t\t\tcreateBackup(dstCompose);\n\t\t}\n\n\t\t// Copy directory\n\t\ttry {\n\t\t\t// First clean destination\n\t\t\tif (fsx.existsSync(dstCompose)) {\n\t\t\t\tfs.rmSync(dstCompose, { recursive: true, force: true });\n\t\t\t}\n\t\t\t// Then copy src to dst\n\t\t\tfs.cpSync(srcCompose, dstCompose, {\n\t\t\t\trecursive: true,\n\t\t\t\tpreserveTimestamps: true,\n\t\t\t});\n\t\t\tif (withBackup) {\n\t\t\t\tdeleteBackup(dstCompose);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(\"Copy failed!\");\n\t\t\tif (withBackup) {\n\t\t\t\trestoreBackup(dstCompose);\n\t\t\t\tconsole.log(\"Backup has been restored.\");\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Remove directories from `basePath` directory.\n *\n * @param basePath - Base directory.\n * @param dirs - Directory to remove.\n */\nfunction removeDirsSync(basePath: string, dirs: Array<string>) {\n\tfor (const dir of dirs) {\n\t\tif (!dir) continue;\n\n\t\tconst composePath = path.join(basePath, dir);\n\n\t\tif (fsx.existsSync(composePath)) {\n\t\t\tfs.rmSync(composePath, { recursive: true, force: true });\n\t\t}\n\t}\n}\n\nfunction restoreBackup(src: string, suffix = \"-BACKUP\") {\n\tconst dst = src + suffix;\n\ttry {\n\t\tfs.renameSync(dst, src);\n\t\tconsole.log(`Backup ${dst} has been restored`);\n\t} catch (e) {\n\t\tconsole.log(`Error while delete ${dst} backup`);\n\t}\n}\n\nfunction deleteBackup(src: string, suffix = \"-BACKUP\") {\n\tconst dst = src + suffix;\n\n\tif (!fsx.existsSync(dst)) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tfs.rmSync(dst, { recursive: true, force: true });\n\t\tconsole.log(`Backup ${dst} has been deleted`);\n\t} catch (e) {\n\t\tconsole.log(`Error while delete ${dst} backup`);\n\t}\n}\n\nfunction createBackup(src: string, suffix = \"-BACKUP\") {\n\tconst dst = src + suffix;\n\n\tif (!fsx.existsSync(src)) {\n\t\treturn;\n\t}\n\n\tif (fsx.existsSync(dst)) {\n\t\tconsole.log(`Destination ${dst} already exists`);\n\t\treturn;\n\t}\n\n\ttry {\n\t\tfs.renameSync(src, dst);\n\t\tconsole.log(`Backup of ${src} has been created in ${dst}`);\n\t} catch (e) {\n\t\tconsole.log(`Error while coping ${src} to ${dst} backup`);\n\t}\n}\n\n/**\n * Elimina todas las p\u00E1ginas del store (de todos los sites) cuyo nombre empiece con un gui\u00F3n \"-\".\n * Estas p\u00E1ginas son \"virtuales\" y no tienen ids desde API por lo que mantenerlas en el store es un problema cuando se hacen modificaciones en la p\u00E1gina \"madre\".\n * La soluci\u00F3n por ahora es borrarlas del store y rehacerlas en todos los renders.\n */\nasync function removeVirtualPagesFromStore() {\n\tconst { __cx } = config.paths();\n\tconst storePath = path.join(__cx, \"store\");\n\n\ttry {\n\t\tconst allJsonPageFilesPath = walkStore(storePath);\n\n\t\tfor (const filePath of allJsonPageFilesPath) {\n\t\t\tif (path.basename(filePath).startsWith(\"-\")) {\n\t\t\t\tfs.unlinkSync(filePath);\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tconsole.info(\n\t\t\t\"`store` folder does not exist. Skipping multipage or static list template cleaning.\",\n\t\t);\n\t}\n}\n\n/**\n * Remove every .xml file in the directories in a recursive way\n * @param initialFolder - The initial folder to start the searching...\n */\nfunction clearSitemapsFromDirs(initialFolder: string) {\n\t// Recursively remove .xml files\n\n\tfunction removeXmlFiles(folder: string): void {\n\t\ttry {\n\t\t\t// Read the content of the directory\n\t\t\tconst files = fs.readdirSync(folder);\n\t\t\t// Iterate over each file/folder in the directory\n\t\t\tfor (const file of files) {\n\t\t\t\tconst fullPath = path.join(folder, file);\n\t\t\t\t// Check if the current path is a directory or file\n\t\t\t\tconst stats = fs.statSync(fullPath);\n\t\t\t\tif (stats.isDirectory()) {\n\t\t\t\t\t// Recursively call removeXmlFiles if it's a directory\n\t\t\t\t\tremoveXmlFiles(fullPath);\n\t\t\t\t} else if (stats.isFile() && path.extname(fullPath) === \".xml\") {\n\t\t\t\t\t// Remove the file if it's an .xml file\n\t\t\t\t\tfs.unlinkSync(fullPath);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.error(`Error processing directory: ${folder}`, err);\n\t\t}\n\t}\n\n\t// Start the process from the initial folder\n\tremoveXmlFiles(initialFolder);\n}\n\n/**\n * Removes multiple artifact directories.\n *\n * @param artifacts - An array of artifact directory paths.\n */\nfunction removeArtifacts(artifacts: Array<string>) {\n\tfor (const dir of artifacts) {\n\t\tif (!dir) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (fsx.existsSync(dir)) {\n\t\t\tfs.rmSync(dir, { recursive: true, force: true });\n\t\t\tverboseLog(`removed directory: ${dir}`);\n\t\t}\n\t}\n}\n\n/**\n * Creates multiple directories.\n *\n * @param dirs - An array of directory paths.\n * @param options - Same option as `fs.mkdirSync()`\n */\nfunction createArtifacts(dirs: Array<string>, options?: MakeDirectoryOptions) {\n\tfor (const dir of dirs) {\n\t\tif (!fs.existsSync(dir)) {\n\t\t\tfs.mkdirSync(dir, { recursive: true, ...options });\n\t\t\tverboseLog(`create directory: ${dir}`);\n\t\t}\n\t}\n}\n\n/**\n * Copy multiple directories with backup option.\n *\n * @param src - Source directory.\n * @param dst - Destination directory.\n * @param dirs - Directories to copy.\n * @param options.withBackup - Create a previous backup before copy.\n */\nfunction copyArtifacts(\n\tsrc: string,\n\tdst: string,\n\tdirs: Array<string>,\n\toptions = {\n\t\twithBackup: false,\n\t},\n) {\n\tconst { withBackup } = options;\n\tfor (const dir of dirs) {\n\t\tconst srcCompose = path.join(src, dir);\n\t\tconst dstCompose = path.join(dst, dir);\n\n\t\t// The dir we want to copy, doesn't exist.\n\t\tif (!fsx.existsSync(srcCompose)) {\n\t\t\tconsole.log(\n\t\t\t\t`(Maybe first render) Source directory does not exist: ${srcCompose}`,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Create the backup\n\t\tif (withBackup) {\n\t\t\tcreateBackup(dstCompose);\n\t\t\tverboseLog(`create backup: ${dstCompose}`);\n\t\t}\n\n\t\t// Copy directory\n\t\ttry {\n\t\t\t// First clean destination\n\t\t\tif (fsx.existsSync(dstCompose)) {\n\t\t\t\tfs.rmSync(dstCompose, { recursive: true, force: true });\n\t\t\t\tverboseLog(`clean destination: ${dstCompose}`);\n\t\t\t}\n\n\t\t\t// Then copy src to dst\n\t\t\tfs.cpSync(srcCompose, dstCompose, {\n\t\t\t\trecursive: true,\n\t\t\t\tpreserveTimestamps: true,\n\t\t\t});\n\t\t\tverboseLog(`copy: ${srcCompose} to ${dstCompose}`);\n\n\t\t\tif (withBackup) {\n\t\t\t\tdeleteBackup(dstCompose);\n\t\t\t\tverboseLog(`delete backup: ${dstCompose}`);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(\"copy failed!\");\n\t\t\tif (withBackup) {\n\t\t\t\trestoreBackup(dstCompose);\n\t\t\t\tconsole.log(\"Backup has been restored.\");\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction renameArtifact(src: string, dst: string) {\n\tif (fs.existsSync(src)) {\n\t\tfs.renameSync(src, dst);\n\t\tverboseLog(`rename ${src} to ${dst}`);\n\t}\n}\n\n/**\n * Move artifacts between cx-paths\n *\n * @param src - Source directory.\n * @param dst - Destination directory.\n * @param dirs - Directories to move.\n * @param options - Options.\n */\nfunction moveArtifacts(\n\tsrc: string,\n\tdst: string,\n\tdirs: Array<string>,\n\toptions?: { withBackup?: boolean; override?: boolean },\n) {\n\tconst { override, withBackup } = options || {};\n\n\tfor (const dir of dirs) {\n\t\tconst srcCompose = path.join(src, dir);\n\t\tconst dstCompose = path.join(dst, dir);\n\n\t\tif (!fsx.existsSync(srcCompose)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (withBackup) {\n\t\t\tcreateBackup(dstCompose);\n\t\t}\n\n\t\ttry {\n\t\t\t// Clean destination\n\t\t\tif (override && fsx.existsSync(dstCompose)) {\n\t\t\t\tfs.rmSync(dstCompose, { recursive: true, force: true });\n\t\t\t}\n\n\t\t\tfs.renameSync(srcCompose, dstCompose);\n\t\t\tverboseLog(`moved: ${srcCompose} to ${dstCompose}`);\n\n\t\t\tif (withBackup) {\n\t\t\t\tdeleteBackup(dstCompose);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tif (withBackup) {\n\t\t\t\trestoreBackup(dstCompose);\n\t\t\t\tconsole.log(\"Backup has been restored.\");\n\t\t\t}\n\n\t\t\tthrow new Error(JSON.stringify(e));\n\t\t}\n\t}\n}\n\nexport {\n\tclearEmptyDirs,\n\tclearSitemapsFromDirs,\n\tcopyArtifacts,\n\tcopyDirsSync,\n\tcreateArtifacts,\n\tcreateDirsSync,\n\tmoveArtifacts,\n\tremoveArtifacts,\n\tremoveDirsSync,\n\tremoveVirtualPagesFromStore,\n\trenameArtifact,\n};\n", "import type { Adapters } from \"../adapters\";\n\nimport kleur from \"kleur\";\nimport { version as reactVersion } from \"react\";\n\nimport { getConfig } from \"./core-utils\";\nimport { envs } from \"../constants\";\n\n/**\n * Custom basic logging function controlled by a environment variable.\n *\n * @param str The string to be logged.\n */\nfunction verboseLog(str: string) {\n\tif (envs.GRIDDO_VERBOSE_LOGS) {\n\t\tconsole.log(\n\t\t\tkleur.yellow(\"verbose\"),\n\t\t\tkleur.dim(str.replace(/(\\s)\\s+/g, \"$1\").trim()),\n\t\t);\n\t}\n}\n\n/**\n * Custom log inside a line-box.\n *\n * @param stringValue The string to be logged.\n * @param paddingInline The number of white spaces inside the box at left and right.\n * @param paddingBlock The number of white spaces inside the box at top and bottom.\n */\nfunction boxLog(\n\tstringValue: string,\n\ttitle = \"\",\n\tpaddingInline = 1,\n\tpaddingBlock = 1,\n) {\n\tconst lines = stringValue\n\t\t.split(\"\\n\") // lines\n\t\t.map((line) => line.trim()); // remove extra spaces\n\tconst windowTitle = title ? ` ${title} ` : \"\";\n\tconst windowTitleLength = title ? windowTitle.length : 0;\n\tconst longerContent =\n\t\tMath.max(...lines.map((l) => l.length)) + paddingInline * 2;\n\tconst longerLine = Math.max(longerContent, windowTitleLength);\n\tconst paddingBlockString = `\u2502${\" \".repeat(longerLine)}\u2502\\n`.repeat(\n\t\tpaddingBlock,\n\t);\n\tconst minWidth = longerLine;\n\tconst borderTop = `\u256D${windowTitle}${\"\u2500\".repeat(\n\t\tminWidth - windowTitleLength,\n\t)}\u256E\\n`;\n\tconst borderBottom = `\u2570${\"\u2500\".repeat(minWidth)}\u256F`;\n\tconst content = lines\n\t\t.map((l) => {\n\t\t\tconst mr = \" \".repeat(longerLine - l.length - paddingInline);\n\t\t\treturn `\u2502${\" \".repeat(paddingInline)}${l}${mr}\u2502\\n`;\n\t\t})\n\t\t.join(\"\");\n\n\tconsole.log(\n\t\t`${borderTop}${paddingBlockString}${content}${paddingBlockString}${borderBottom}`,\n\t);\n}\n\n/**\n * Custom basic logging function controlled by a environment variable.\n * Strip double spaces.\n *\n * @param str The string to be logged.\n */\nfunction buildLog(str: string) {\n\tif (envs.GRIDDO_BUILD_LOGS) {\n\t\tconsole.log(str.replace(/(\\s)\\s+/g, \"$1\").trim());\n\t}\n}\n\n/**\n * Console log with a blue color in the info prefix.\n * @param str The string to be logged.\n */\nfunction infoLog(str: string) {\n\tconsole.log(`${kleur.blue(\"info\")} ${str}`);\n}\n\n/**\n * Console log with a green color in the success prefix.\n * @param str The string to be logged.\n */\nfunction successLog(str: string) {\n\tconsole.log(`${kleur.green(\"success\")} ${str}`);\n}\n\n/**\n * Internal log\n * @param values The values to be logged.\n */\nfunction debugLog(...values: Array<unknown>) {\n\tif (!envs.GRIDDO_DEBUG_LOGS) {\n\t\treturn;\n\t}\n\tconsole.log(...values);\n}\n\n/**\n * Return a scale size colors with a number and a measure string (KB by default).\n *\n * @param size The page size in KB.\n * @param measure The measure string to be added in the log.\n */\nfunction pageSizeLog(size: number, measure = \"KB\") {\n\tconst sizeScale = {\n\t\tlow: 50,\n\t\tmid: 80,\n\t\tlarge: 130,\n\t\textraLarge: 210,\n\t};\n\n\t// Ternary pawa!\n\tconst color =\n\t\tsize > sizeScale.large\n\t\t\t? \"red\"\n\t\t\t: size > sizeScale.mid\n\t\t\t\t? \"magenta\"\n\t\t\t\t: size > sizeScale.low\n\t\t\t\t\t? \"blue\"\n\t\t\t\t\t: \"green\";\n\n\treturn kleur[color](kleur.bold(`${size}${measure}`));\n}\n\n/**\n * Print Griddo, adapter and Node version.\n */\nfunction printExporterLogo(adapter: Adapters) {\n\tconst config = getConfig();\n\tconst nodeVersion = process.version;\n\tconst { griddoVersion } = config;\n\tconst logo = `\n\u00B7\u00B7\n\u00B7\u00B7 Griddo ${griddoVersion}\n\u00B7\u00B7\n\u00B7\u00B7 Adapter: ${adapter}\n\u00B7\u00B7 Node: ${nodeVersion}\n\u00B7\u00B7 React: ${reactVersion}\n\u00B7\u00B7\n`;\n\n\tconsole.log(logo);\n}\n\nexport {\n\tboxLog,\n\tbuildLog,\n\tdebugLog,\n\tinfoLog,\n\tpageSizeLog,\n\tprintExporterLogo,\n\tsuccessLog,\n\tverboseLog,\n};\n", "/**\n * Here are all the environment variables that the CX code uses.\n */\n\nimport dotenv from \"dotenv\";\n\nimport { isTruthy } from \"../utils/core-utils\";\n\ndotenv.config();\n\n//\n// Credentials\n//\n/* prettier-ignore */ const GRIDDO_API_URL = process.env.GRIDDO_API_URL || process.env.API_URL;\n/* prettier-ignore */ const GRIDDO_PUBLIC_API_URL = process.env.GRIDDO_PUBLIC_API_URL || process.env.PUBLIC_API_URL;\n/* prettier-ignore */ const GRIDDO_BOT_USER = process.env.botEmail;\n/* prettier-ignore */ const GRIDDO_BOT_PASSWORD = process.env.botPassword;\n\n//\n// Rendering\n//\n/* prettier-ignore */ const GRIDDO_API_CONCURRENCY_COUNT = Number.parseInt( process.env.GRIDDO_API_CONCURRENCY_COUNT || \"10\");\n/* prettier-ignore */ const GRIDDO_RENDER_ALL_SITES = isTruthy(process.env.GRIDDO_RENDER_ALL_SITES || process.env.updateAllSites);\n/* prettier-ignore */ const GRIDDO_RENDER_SITE = Number.parseInt(process.env.GRIDDO_RENDER_SITE || \"\")\n/* prettier-ignore */ const GRIDDO_RENDER_PAGES = (process.env.GRIDDO_RENDER_PAGES || \"\").split(\",\").map((item) => Number.parseInt(item)).filter(Boolean);\n/* prettier-ignore */ const GRIDDO_SKIP_BUILD_CHECKS = isTruthy(process.env.GRIDDO_SKIP_BUILD_CHECKS)\n/* prettier-ignore */ const GRIDDO_DEBUG_LOGS = isTruthy(process.env.GRIDDO_DEBUG_LOGS);\n/* prettier-ignore */ const GRIDDO_BUILD_LOGS = isTruthy(process.env.GRIDDO_BUILD_LOGS);\n/* prettier-ignore */ const GRIDDO_RENDER_BREAKPOINTS_FEATURE = isTruthy(process.env.GRIDDO_RENDER_BREAKPOINTS_FEATURE);\n/* prettier-ignore */ const GRIDDO_SSG_VERBOSE_LOGS = isTruthy(process.env.GRIDDO_SSG_VERBOSE_LOGS)\n/* prettier-ignore */ const GRIDDO_SEARCH_FEATURE = isTruthy(process.env.GRIDGRIDDO_SEARCH_FEATURE_FEATURE);\n/* prettier-ignore */ const GRIDDO_ASSET_PREFIX = process.env.GRIDDO_ASSET_PREFIX || process.env.ASSET_PREFIX;\n/* prettier-ignore */ const GRIDDO_REACT_APP_INSTANCE = process.env.GRIDDO_REACT_APP_INSTANCE || process.env.REACT_APP_INSTANCE;\n/* prettier-ignore */ const GRIDDO_AI_EMBEDDINGS = isTruthy(process.env.GRIDDO_AI_EMBEDDINGS);\n/* prettier-ignore */ const GRIDDO_VERBOSE_LOGS = isTruthy(process.env.GRIDDO_VERBOSE_LOGS);\n/* prettier-ignore */ const GRIDDO_ALERT_FEATURE = isTruthy(process.env.GRIDDO_ALERT_FEATURE);\n/* prettier-ignore */ const GRIDDO_API_MAX_RESPONSE_SIZE = Number.parseInt(process.env.GRIDDO_API_MAX_RESPONSE_SIZE || \"81920\") // 80KB\n/* prettier-ignore */ const GRIDDO_SSG_MAX_PAGE_SIZE = Number.parseInt(process.env.GRIDDO_SSG_MAX_PAGE_SIZE || \"524288\") // 512KB\n\n//\n// LifeCycle\n//\n/* prettier-ignore */ const GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n/* prettier-ignore */ const GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n/* prettier-ignore */ const GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n/* prettier-ignore */ const GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n/* prettier-ignore */ const GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n/* prettier-ignore */ const GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS || \"2\");\n/* prettier-ignore */ const GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n/* prettier-ignore */ const GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS || \"4\");\n/* prettier-ignore */ const GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS = Number.parseInt(process.env.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS || \"1\");\n\n//\n// Testing\n//\n/* prettier-ignore */ const GRIDDO_FIXTURES_DOMAIN_NAMES = process.env.GRIDDO_CX_FIXTURES_DOMAIN_NAMES;\n/* prettier-ignore */ const GRIDDO_FIXTURES_SITE_NAMES = process.env.GRIDDO_CX_FIXTURES_SITE_NAMES;\n\nexport {\n\tGRIDDO_AI_EMBEDDINGS,\n\tGRIDDO_ALERT_FEATURE,\n\tGRIDDO_API_CONCURRENCY_COUNT,\n\tGRIDDO_API_MAX_RESPONSE_SIZE,\n\tGRIDDO_API_URL,\n\tGRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_ASSET_PREFIX,\n\tGRIDDO_BOT_PASSWORD,\n\tGRIDDO_BOT_USER,\n\tGRIDDO_BUILD_LOGS,\n\tGRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_DEBUG_LOGS,\n\tGRIDDO_FIXTURES_DOMAIN_NAMES,\n\tGRIDDO_FIXTURES_SITE_NAMES,\n\tGRIDDO_META_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_PUBLIC_API_URL,\n\tGRIDDO_REACT_APP_INSTANCE,\n\tGRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_RENDER_ALL_SITES,\n\tGRIDDO_RENDER_BREAKPOINTS_FEATURE,\n\tGRIDDO_RENDER_PAGES,\n\tGRIDDO_RENDER_SITE,\n\tGRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_SEARCH_FEATURE,\n\tGRIDDO_SKIP_BUILD_CHECKS,\n\tGRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_SSG_MAX_PAGE_SIZE,\n\tGRIDDO_SSG_VERBOSE_LOGS,\n\tGRIDDO_VERBOSE_LOGS,\n};\n", "import { GRIDDO_API_URL, GRIDDO_PUBLIC_API_URL } from \"./envs\";\n\nconst WITH_URI = `${GRIDDO_API_URL}/site/`;\n\nconst AI_EMBEDDINGS = `${GRIDDO_API_URL}/ai/embeddings`;\nconst ALERT = `${GRIDDO_PUBLIC_API_URL}/alert`;\nconst DOMAINS = `${GRIDDO_API_URL}/domains`;\nconst GET_ALL = `${GRIDDO_API_URL}/sites/all`;\nconst GET_PAGE = `${GRIDDO_API_URL}/page`;\nconst LOGIN = `${GRIDDO_API_URL}/login_check`;\nconst RESET_RENDER = `${GRIDDO_API_URL}/debug/reset-render`;\nconst ROBOTS = `${GRIDDO_API_URL}/domains/robots`;\nconst SEARCH = `${GRIDDO_API_URL}/search`;\nconst SETTINGS = `${GRIDDO_API_URL}/settings`;\n\nconst BUILD_END = [WITH_URI, \"/build/end\"];\nconst BUILD_START = [WITH_URI, \"/build/start\"];\nconst GET_PAGES = [WITH_URI, \"/pages?pagination=false\"];\nconst GET_REFERENCE_FIELD_DATA = [WITH_URI, \"/distributor\"];\nconst GET_SITEMAP = [WITH_URI, \"/sitemap\"];\nconst INFO = [WITH_URI, \"/all\"];\nconst LANGUAGES = [WITH_URI, \"/languages\"];\nconst SOCIALS = [WITH_URI, \"/socials\"];\n\nexport {\n\tAI_EMBEDDINGS,\n\tALERT,\n\tBUILD_END,\n\tBUILD_START,\n\tDOMAINS,\n\tGET_ALL,\n\tGET_PAGE,\n\tGET_PAGES,\n\tGET_REFERENCE_FIELD_DATA,\n\tGET_SITEMAP,\n\tINFO,\n\tLANGUAGES,\n\tLOGIN,\n\tRESET_RENDER,\n\tROBOTS,\n\tSEARCH,\n\tSETTINGS,\n\tSOCIALS,\n};\n", "import type { LifeCyclesNames } from \"../types/global\";\n\nimport {\n\tAI_EMBEDDINGS,\n\tALERT,\n\tBUILD_END,\n\tBUILD_START,\n\tDOMAINS,\n\tGET_ALL,\n\tGET_PAGE,\n\tGET_PAGES,\n\tGET_REFERENCE_FIELD_DATA,\n\tGET_SITEMAP,\n\tINFO,\n\tLANGUAGES,\n\tLOGIN,\n\tRESET_RENDER,\n\tROBOTS,\n\tSEARCH,\n\tSETTINGS,\n\tSOCIALS,\n} from \"./endpoints\";\nimport {\n\tGRIDDO_AI_EMBEDDINGS,\n\tGRIDDO_ALERT_FEATURE,\n\tGRIDDO_API_CONCURRENCY_COUNT,\n\tGRIDDO_API_MAX_RESPONSE_SIZE,\n\tGRIDDO_API_URL,\n\tGRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_ASSET_PREFIX,\n\tGRIDDO_BOT_PASSWORD,\n\tGRIDDO_BOT_USER,\n\tGRIDDO_BUILD_LOGS,\n\tGRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_DEBUG_LOGS,\n\tGRIDDO_FIXTURES_DOMAIN_NAMES,\n\tGRIDDO_FIXTURES_SITE_NAMES,\n\tGRIDDO_META_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_PUBLIC_API_URL,\n\tGRIDDO_REACT_APP_INSTANCE,\n\tGRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_RENDER_ALL_SITES,\n\tGRIDDO_RENDER_BREAKPOINTS_FEATURE,\n\tGRIDDO_RENDER_PAGES,\n\tGRIDDO_RENDER_SITE,\n\tGRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_SEARCH_FEATURE,\n\tGRIDDO_SKIP_BUILD_CHECKS,\n\tGRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_SSG_MAX_PAGE_SIZE,\n\tGRIDDO_SSG_VERBOSE_LOGS,\n\tGRIDDO_VERBOSE_LOGS,\n} from \"./envs\";\n\nconst endpoints = {\n\tALERT,\n\tAI_EMBEDDINGS,\n\tBUILD_END,\n\tBUILD_START,\n\tDOMAINS,\n\tGET_ALL,\n\tGET_PAGE,\n\tGET_PAGES,\n\tGET_REFERENCE_FIELD_DATA,\n\tGET_SITEMAP,\n\tINFO,\n\tLANGUAGES,\n\tLOGIN,\n\tRESET_RENDER,\n\tROBOTS,\n\tSEARCH,\n\tSETTINGS,\n\tSOCIALS,\n};\n\nconst envs = {\n\tGRIDDO_AI_EMBEDDINGS,\n\tGRIDDO_ALERT_FEATURE,\n\tGRIDDO_API_CONCURRENCY_COUNT,\n\tGRIDDO_API_MAX_RESPONSE_SIZE,\n\tGRIDDO_API_URL,\n\tGRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_ASSET_PREFIX,\n\tGRIDDO_BOT_PASSWORD,\n\tGRIDDO_BOT_USER,\n\tGRIDDO_BUILD_LOGS,\n\tGRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_DEBUG_LOGS,\n\tGRIDDO_FIXTURES_DOMAIN_NAMES,\n\tGRIDDO_FIXTURES_SITE_NAMES,\n\tGRIDDO_META_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_PUBLIC_API_URL,\n\tGRIDDO_REACT_APP_INSTANCE,\n\tGRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_RENDER_ALL_SITES,\n\tGRIDDO_RENDER_BREAKPOINTS_FEATURE,\n\tGRIDDO_RENDER_PAGES,\n\tGRIDDO_RENDER_SITE,\n\tGRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_SEARCH_FEATURE,\n\tGRIDDO_SKIP_BUILD_CHECKS,\n\tGRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS,\n\tGRIDDO_SSG_MAX_PAGE_SIZE,\n\tGRIDDO_SSG_VERBOSE_LOGS,\n\tGRIDDO_VERBOSE_LOGS,\n};\n\nconst lifeCycleNames: Record<LifeCyclesNames, LifeCyclesNames> = {\n\tHealthCheck: \"HealthCheck\",\n\t__DEBUG__: \"__DEBUG__\",\n\tClean: \"Clean\",\n\tClose: \"Close\",\n\tPrepare: \"Prepare\",\n\tRestore: \"Restore\",\n\tData: \"Data\",\n\tSSG: \"SSG\",\n\tRelocation: \"Relocation\",\n\tMeta: \"Meta\",\n\tArchive: \"Archive\",\n} as const;\n\nexport { endpoints, envs, lifeCycleNames };\n", "import type { Site, SiteData } from \"../types/sites\";\n\nimport path from \"node:path\";\n\nimport fs from \"fs-extra\";\nimport { parse } from \"js2xmlparser\";\n\nimport { getConfig } from \"./core-utils\";\nimport { infoLog } from \"./loggin\";\nimport { getBuildMetadata } from \"./store\";\nimport { envs } from \"../constants\";\nimport { AuthService } from \"../services/auth\";\nimport {\n\tendSiteRender,\n\tgetAllSites,\n\tgetSiteInfo,\n\tgetSiteLanguages,\n\tgetSitemap,\n\tgetSiteSocials,\n\tstartSiteRender,\n} from \"../services/sites\";\n\nconst config = getConfig();\n\n/**\n * Check the instance sites and returns site prepared to be published and unpublished.\n */\nasync function checkSites(domain: string) {\n\tconsole.info(`API URL ${envs.GRIDDO_API_URL as string}`);\n\n\t// Login to API\n\tawait AuthService.login();\n\n\t// Get all sites. An array of Site\n\tconst allSites = await getAllSites();\n\n\t// Filter the array of sites to get only the ones to build/render\n\tconst validSites = envs.GRIDDO_RENDER_ALL_SITES\n\t\t? allSites.filter(\n\t\t\t\t(site) =>\n\t\t\t\t\t!envs.GRIDDO_RENDER_SITE || site.id === envs.GRIDDO_RENDER_SITE,\n\t\t\t)\n\t\t: allSites.filter((site) =>\n\t\t\t\tenvs.GRIDDO_RENDER_SITE\n\t\t\t\t\t? site.id === envs.GRIDDO_RENDER_SITE\n\t\t\t\t\t: !!site.shouldBeUpdated,\n\t\t\t);\n\n\t// If there are valid sites...\n\tif (validSites.length) {\n\t\tfor (const site of validSites) {\n\t\t\tconst { items } = await getSiteLanguages(site.id);\n\n\t\t\t// A\u00F1adimos la prop domains con el dominio \"cocinado\" con los idiomas y teniendo en cuenta solo el dominio actual\n\t\t\tsite.domains = items\n\t\t\t\t.filter(\n\t\t\t\t\t(item) =>\n\t\t\t\t\t\titem.domain &&\n\t\t\t\t\t\t(item.domain.slug === domain || item.domain.slug === `/${domain}`),\n\t\t\t\t)\n\t\t\t\t.map((item) => ({ [item.id]: `${item.domain.slug}${item.path}` }));\n\t\t}\n\t}\n\n\t// Sites with domains as empty arrays are sites that are not from the\n\t// current domain.\n\tconst validSitesFromCurrentDomain = validSites.filter(\n\t\t(site) => site.domains.length > 0,\n\t);\n\n\t// Save sites object to publish\n\tconst sitesToPublish = validSitesFromCurrentDomain.filter((site) =>\n\t\tenvs.GRIDDO_RENDER_SITE\n\t\t\t? site.id === envs.GRIDDO_RENDER_SITE\n\t\t\t: !!site.isPublished,\n\t);\n\n\t// Save sites object to unpublish\n\tconst sitesToUnpublish = validSitesFromCurrentDomain.filter(\n\t\t(site) => !site.isPublished && site.shouldBeUpdated,\n\t);\n\n\treturn {\n\t\tsitesToPublish,\n\t\tsitesToUnpublish,\n\t};\n}\n\n/**\n * Unpublish an array of sites sending the information to the API.\n *\n * @param sites An array of sites\n * @see https://griddoio.notion.site/Sites-d7bb0b7cb8d24894a5337e1139fc3d09#2019d3255bda4d219c7e19cf28d0c4fe\n */\nasync function unpublishSites(sites: Array<Site>) {\n\tconst { __cx } = config.paths();\n\n\tfor (const site of sites) {\n\t\t// API\n\t\tconst buildInfo = await startSiteRender(site.id);\n\t\tconst { siteHash } = buildInfo;\n\t\tconst body = {\n\t\t\tsiteHash,\n\t\t\tpublishHashes: [],\n\t\t\tunpublishHashes: [],\n\t\t};\n\n\t\tawait endSiteRender(site.id, body);\n\n\t\t// STORE\n\t\t// Remove site directory from the Store\n\t\tfs.rmSync(path.join(__cx, \"store\", site.id.toString()), {\n\t\t\tforce: true,\n\t\t\trecursive: true,\n\t\t});\n\t}\n}\n\n/**\n * Return a single site generic data.\n *\n * @param siteID The site id.\n * @param cacheKey Boolean that indicates if we want to get cache version.\n *\n * @see SiteData\n */\nasync function getSiteData(siteID: number) {\n\tconst buildData = await startSiteRender(siteID);\n\tconst siteInfo = await getSiteInfo(siteID);\n\tconst siteLangs = await getSiteLanguages(siteID);\n\tconst socials = await getSiteSocials(siteID);\n\tconst siteLangsInfo = siteLangs.items;\n\tconst defaultLang = siteLangsInfo.find((lang) => lang.isDefault);\n\n\tconst { siteHash, unpublishHashes, publishIds } = buildData;\n\tconst { headers, footers } = siteInfo;\n\tconst validPagesIds = envs.GRIDDO_RENDER_PAGES.length\n\t\t? envs.GRIDDO_RENDER_PAGES.filter((item) => publishIds.includes(item))\n\t\t: publishIds;\n\n\tconst siteData: SiteData = {\n\t\tsiteInfo,\n\t\tvalidPagesIds,\n\t\tsiteHash,\n\t\tunpublishHashes,\n\t\tsiteLangs: siteLangsInfo,\n\t\tdefaultLang,\n\t\theaders,\n\t\tfooters,\n\t\tsocials,\n\t};\n\n\treturn siteData;\n}\n\n/**\n * Save a file with the end of build process\n */\nasync function generateBuildReport() {\n\tconst { __cx } = config.paths();\n\n\tconst { buildProcessData } = await getBuildMetadata();\n\n\t// Get the token\n\tconst authControl = await AuthService.login();\n\n\tconst buildSitesInfo = Object.keys(buildProcessData).map((siteID) => ({\n\t\t...buildProcessData[siteID],\n\t\tsiteId: parseInt(siteID),\n\t}));\n\n\tconst report = {\n\t\tauthControl,\n\t\tsites: buildSitesInfo,\n\t};\n\n\tfs.writeFileSync(\n\t\tpath.join(__cx, \"dist\", \"__build-report__.json\"),\n\t\tJSON.stringify(report),\n\t);\n\n\tinfoLog(`Build report saved for ${buildSitesInfo.length} site(s)`);\n}\n\n/**\n * Generate sitemaps and save them into file system.\n *\n * @param sites An array of sites\n */\nasync function generateSitemaps() {\n\tconst { sitesToPublish } = await getBuildMetadata();\n\tconst { __cx } = config.paths();\n\tconst distDir = path.join(__cx, \"dist\");\n\n\tfor (const site of sitesToPublish) {\n\t\tconst { id: siteID, languages } = site;\n\n\t\tfor (const lang of languages) {\n\t\t\tif (AuthService.headers) AuthService.headers[\"lang\"] = lang.id.toString();\n\n\t\t\tconst response = await getSitemap(siteID);\n\n\t\t\tif (!response) continue;\n\n\t\t\tconst {\n\t\t\t\titems: sitemapPagesGroup,\n\t\t\t\turl: { home, domain },\n\t\t\t} = response;\n\n\t\t\tif (!home) continue;\n\n\t\t\tconst langDomain = site.domains.find(\n\t\t\t\t(domain) => Object.keys(domain)[0] == lang.id.toString(),\n\t\t\t);\n\n\t\t\tif (!langDomain) continue;\n\n\t\t\tconst slug = Object.values(langDomain)[0];\n\t\t\tconst sitemaps: Array<string> = [];\n\t\t\tconst sitemapPageGroupKeys = Object.keys(sitemapPagesGroup);\n\t\t\tconst sitemapBasePath = path.join(distDir, slug.replace(domain, \"\"));\n\n\t\t\tfor (const templateId of sitemapPageGroupKeys) {\n\t\t\t\tconst sitemapPages = sitemapPagesGroup[templateId];\n\n\t\t\t\tif (!sitemapPages.length) continue;\n\n\t\t\t\tconst siteMap = parse(\"urlset\", {\n\t\t\t\t\t\"@\": {\n\t\t\t\t\t\txmlns: \"http://www.sitemaps.org/schemas/sitemap/0.9\",\n\t\t\t\t\t\t\"xmlns:xsi\": \"http://www.w3.org/2001/XMLSchema-instance\",\n\t\t\t\t\t\t\"xsi:schemaLocation\":\n\t\t\t\t\t\t\t\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\",\n\t\t\t\t\t},\n\t\t\t\t\turl: sitemapPages,\n\t\t\t\t});\n\n\t\t\t\tconst sitemapName = `/sitemap-${templateId.toLowerCase()}.xml`;\n\t\t\t\tconst exactPath = path.join(sitemapBasePath, sitemapName);\n\n\t\t\t\tsaveFile(exactPath, siteMap);\n\n\t\t\t\tsitemaps.push(\n\t\t\t\t\t`${home.endsWith(\"/\") ? home.slice(0, -1) : home}${sitemapName}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (!sitemaps.length) continue;\n\n\t\t\tconst siteMap = parse(\"sitemapindex\", {\n\t\t\t\t\"@\": { xmlns: \"http://www.sitemaps.org/schemas/sitemap/0.9\" },\n\t\t\t\tsitemap: sitemaps.map((loc) => ({ loc })),\n\t\t\t});\n\n\t\t\tconst exactPath = path.join(sitemapBasePath, \"sitemap.xml\");\n\n\t\t\tsaveFile(exactPath, siteMap);\n\t\t}\n\t}\n}\n\n/**\n * Saves the content to a file specified by its path. If the file exists, it will be overwritten.\n *\n * @param filePath The path of the file to save the content to.\n * @param content The content to save to the file.\n */\nfunction saveFile(filePath: string, content: string) {\n\ttry {\n\t\tconst pathName = path.dirname(filePath);\n\t\tif (!fs.existsSync(pathName)) fs.mkdirSync(pathName, { recursive: true });\n\t\tfs.writeFileSync(filePath, content);\n\t} catch (err) {\n\t\tconsole.error(`Error saving file: ${err}`);\n\t}\n}\n\nexport {\n\tcheckSites,\n\tgenerateBuildReport,\n\tgenerateSitemaps,\n\tgetSiteData,\n\tunpublishSites,\n};\n", "import type { BuildMetaData } from \"../types/api\";\nimport type { RenderInfo } from \"../types/global\";\nimport type { GriddoPageObject } from \"../types/pages\";\nimport type { Site } from \"../types/sites\";\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport fsx from \"fs-extra\";\n\nimport { getConfig, removeProperties, walk, walkStore } from \"./core-utils\";\n\nconst config = getConfig();\n\n/**\n * Read all path pages stored in the `store` Griddo directory and returns the\n * absolute file path.\n *\n * @param domain - The domain to get the pages from.\n */\nfunction getBuildPagesFromCachedStore<PageType extends GriddoPageObject>(\n\tdomain: string,\n) {\n\tconst { __caches } = config.paths(domain);\n\treturn getBuildPagesFromStore<PageType>({\n\t\tbasePath: path.join(__caches, \"store\"),\n\t\twithSizeProp: false,\n\t});\n}\n\n/**\n * Read all pages stored in the `store` Griddo directory and returns one by one\n * with a generator.\n *\n * @param basePath - Base directory to get pages from.\n * @param options.withSizeProp - Add size prop to the page object.\n * @todo throw error if the basePath is not an store folder\n */\nfunction* getBuildPagesFromStore<PageType extends GriddoPageObject>(args?: {\n\tbasePath?: string;\n\twithSizeProp?: boolean;\n}) {\n\tconst { basePath, withSizeProp } = args || {};\n\tconst { __cx } = config.paths();\n\tconst pagesDirPath = basePath || path.join(__cx, \"store\");\n\n\tconst jsonFilePaths = walkStore(pagesDirPath).filter(\n\t\t(file) => path.extname(file) === \".json\",\n\t);\n\n\tfor (const filePath of jsonFilePaths) {\n\t\ttry {\n\t\t\tconst page = fsx.readJsonSync(filePath, {\n\t\t\t\tencoding: \"utf-8\",\n\t\t\t}) as PageType;\n\n\t\t\tif (withSizeProp) {\n\t\t\t\tconst fileStats = fs.statSync(filePath);\n\t\t\t\tpage.size = fileStats.size / 1024;\n\t\t\t}\n\n\t\t\t// SECURITY: Only returns valid page objects\n\t\t\tif (page.path) {\n\t\t\t\tyield page;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error(`Error: The file ${filePath} doesn't exist`, error);\n\t\t}\n\t}\n}\n\n/**\n * Read all pages stored in `store` Griddo directory and return the absolute path.\n */\nfunction getBuildPagesPath() {\n\tconst config = getConfig();\n\tconst { __cx } = config.paths();\n\n\tconst PAGES_DIR = path.join(__cx, \"store\");\n\tconst PAGE_FILES = walk(PAGES_DIR).filter(\n\t\t(file) => path.extname(file) === \".json\",\n\t);\n\n\treturn PAGE_FILES;\n}\n\n/**\n * Get the build metadata from the Store.\n */\nasync function getBuildMetadata(): Promise<BuildMetaData> {\n\tconst { __cx } = config.paths();\n\tconst { sitesToPublish, createdPages, buildProcessData } = fsx.readJSONSync(\n\t\tpath.join(__cx, \"store\", \"metadata\", \"render-info.json\"),\n\t);\n\n\treturn {\n\t\tbuildProcessData,\n\t\tcreatedPages,\n\t\tsitesToPublish,\n\t};\n}\n\n/**\n * Creates an `store` dir to store pages transformed by createStore\n */\nfunction createStoreDir() {\n\tconst { __cx } = config.paths();\n\tconst storeDir = path.join(__cx, \"store\");\n\n\tif (!fs.existsSync(storeDir)) {\n\t\tfs.mkdirSync(storeDir);\n\t\tfs.mkdirSync(path.join(storeDir, \"metadata\"));\n\t}\n\n\tconsole.info(\"Store initialized\");\n}\n\n/**\n * Write render info into a file.\n * @param basePath - Absolute path of the dir from which files will be saved.\n * @param renderInfo - Data that will be saved related to the render process.\n */\nfunction saveRenderInfoInStore(basePath: string, renderInfo: RenderInfo) {\n\tconst { __cx } = config.paths();\n\n\tfs.writeFileSync(\n\t\tpath.join(__cx, \"store\", \"metadata\", \"render-info.json\"),\n\t\tJSON.stringify(renderInfo),\n\t);\n}\n\n/**\n * Return an array of ids only from `.json` files (no dirs) in the `basePath` dir based in the file name and filtered by the pages ids in a concrete site.\n * @param basePath - Absolute path of the dir from which files will be read.\n * @returns A Array<number> of pages ids in `basePath` dir filtered by pages ids in a concrete site.\n */\n// function getPagesInStoreDirBySitePages(\n// \tbasePath: string,\n// \tpages: Array<number>,\n// ): Array<number> {\n// \tconst allPagesInStore = getPageInStoreDir(basePath);\n// \tconst pagesBySite = allPagesInStore.filter((page) => pages.includes(page));\n\n// \treturn pagesBySite;\n// }\n\n/**\n * Return an array of ids only from `.json` files (no dirs) in the `basePath` dir based in the file name.\n * @param basePath - Absolute path of the dir from which files will be read.\n * @returns A Array<number> of pages ids in `basePath` dir.\n */\nfunction getPageInStoreDir(basePath: string): Array<number> {\n\tconst filesInStore = fs.readdirSync(basePath);\n\n\treturn (\n\t\tfilesInStore\n\t\t\t.filter((file) => {\n\t\t\t\tconst fullPathFile = `${basePath}/${file}`;\n\t\t\t\tconst stat = fs.statSync(fullPathFile);\n\t\t\t\t// Si es un directorio, no lo incluimos.\n\t\t\t\tif (stat && stat.isDirectory()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// Si es un archivo pero no tiene la extensi\u00F3n `.json`, no lo incluimos\n\t\t\t\tif (path.extname(file) !== \".json\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// Si es un archivo con el nombre NO pasable a n\u00FAmero (NaN), no lo incluimos.\n\t\t\t\tconst baseFilename = path.basename(file, path.extname(file));\n\t\t\t\tif (isNaN(parseInt(baseFilename))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// no es dir, es json y con nombre pasable a n\u00FAmero, ok :)\n\t\t\t\treturn true;\n\t\t\t})\n\t\t\t// Tenemos solo jsons donde el nombre es un \"n\u00FAmero\": \"21345.json\"\n\t\t\t.map((page) => {\n\t\t\t\tconst filename = path.basename(page, path.extname(page));\n\t\t\t\treturn parseInt(filename);\n\t\t\t})\n\t);\n}\n\n/**\n * Save the pages into the file system.\n * @param pages - An array of Griddo page objects to be saved.\n */\nfunction savePagesInStore(\n\tsiteFolderName: string,\n\tpages: Array<GriddoPageObject>,\n) {\n\tconst { __cx } = config.paths();\n\n\ttry {\n\t\tpages.forEach((page) => {\n\t\t\tremoveProperties(page, [\"editorID\", \"parentEditorID\"]);\n\t\t\tconst filename = `${page.context.page.id}.json`;\n\t\t\tconst filePath = path.join(__cx, \"store\", siteFolderName, filename);\n\t\t\tfsx.writeJSONSync(filePath, page);\n\t\t});\n\t} catch (e) {\n\t\tconsole.log(\"ERROR\", e);\n\t}\n}\n\n/**\n * Remove files from dir.\n * @param filenames - An array of ids representing file page names.\n */\nfunction removePagesFromStore(siteDirName: string, filenames: Array<number>) {\n\tconst { __cx } = config.paths();\n\n\tif (filenames.length === 0) {\n\t\treturn;\n\t}\n\n\tfilenames.forEach((filename) => {\n\t\tconst filePath = path.join(__cx, \"store\", siteDirName, `${filename}.json`);\n\t\ttry {\n\t\t\tfs.unlinkSync(filePath);\n\t\t} catch (error) {\n\t\t\tconsole.log(`Error removing file ${filename}`, (error as Error).message);\n\t\t}\n\t});\n}\n\n/**\n * Returns pages that need to be created or deleted for a site in the store based on the provided arguments.\n * @param sitePages - Properties for page retrieval.\n * @param props.storeDir - Absolute path of the Griddo store.\n * @param props.pages - Exhaustive array of all pages in the site.\n * @param props.validPagesIds - Array of valid pages in the site.\n * @param props.changedPages - Array of pages that have been modified in the site.\n * @returns - An object containing the pages to be created and deleted in the site.\n */\nasync function getPagesToCreateOrDelete(sitePages: {\n\tsitesToPublish: Array<Site>;\n\tvalidPagesIds: Array<number>;\n\tchangedPages: Array<number>;\n\tsiteDirName: string;\n}) {\n\tconst { __cx } = config.paths();\n\tconst storeDir = path.join(__cx, \"store\");\n\n\tconst { changedPages, validPagesIds, siteDirName } = sitePages;\n\n\t// Array<ids> de las p\u00E1ginas que est\u00E1n f\u00EDsicamente en el store en el\n\t// site actual del bucle.\n\tconst siteDirStorePath = path.join(storeDir, siteDirName);\n\tconst pagesInStore = getPageInStoreDir(siteDirStorePath);\n\n\t// Array<ids> que est\u00E1n el `validPagesIds` pero no est\u00E1n por alg\u00FAn\n\t// motivo en el store. Se incluyen porque deben ser creadas.\n\tconst pagesMissingInStore = validPagesIds.filter(\n\t\t(page) => !pagesInStore.includes(page),\n\t);\n\n\t// Array<ids> para enviar al store, que son las que han cambiado y\n\t// las missings.\n\tconst pagesToStore = pagesMissingInStore.concat(changedPages);\n\n\t// Array<ids> de las p\u00E1ginas que han sido eliminadas para quitarlas\n\t// f\u00EDsicamente de la carpeta store.\n\tconst pagesToDeleteFromStore = pagesInStore.filter((page) => {\n\t\t// Las que no est\u00E9n en validPages\n\t\treturn !validPagesIds.includes(page);\n\t});\n\n\t// 1 - Elimina del array final las p\u00E1ginas borradas.\n\t// 2 - Elimina las posibles p\u00E1ginas (ids) duplicadas. (new Set)\n\tconst pagesToWriteToStore = Array.from(new Set(pagesToStore)).filter(\n\t\t(page) => !pagesToDeleteFromStore.includes(page),\n\t);\n\n\t// 1 - Leer el store\n\t// 2 - eliminar las p\u00E1ginas que tengan como site uno despublicado o borrado\n\t// const allPagesInStore = getBuildPagesFromStore();\n\n\t// const pagesFromInvalidSites: Array<number> = [];\n\t// for await (const page of allPagesInStore) {\n\t// \tconst pageSite = page.context.page.site;\n\t// \tconst pageId = page.context.page.id!;\n\t// \t// Si el `site.id` de la p\u00E1gina no es ninguno de los `sitesToPublish`\n\t// \t// a\u00F1adimos la p\u00E1gina a `pagesFromIvalidSites` para borrarla\n\t// \t// posteriormente.\n\t// \tif (!sitesToPublish.map((site) => site.id).includes(pageSite)) {\n\t// \t\tpagesFromInvalidSites.push(pageId);\n\t// \t}\n\t// }\n\n\treturn {\n\t\tpagesInStore,\n\t\tpagesMissingInStore,\n\t\tpagesToDeleteFromStore: [\n\t\t\t...pagesToDeleteFromStore,\n\t\t\t// ...pagesFromInvalidSites,\n\t\t],\n\t\tpagesToWriteToStore,\n\t};\n}\n\nexport {\n\tcreateStoreDir,\n\tgetBuildMetadata,\n\tgetBuildPagesFromCachedStore,\n\tgetBuildPagesFromStore,\n\tgetBuildPagesPath,\n\tgetPageInStoreDir,\n\tgetPagesToCreateOrDelete,\n\tremovePagesFromStore,\n\tsavePagesInStore,\n\tsaveRenderInfoInStore,\n};\n", "import axios from \"axios\";\nimport chalk from \"chalk\";\n\nimport { endpoints, envs } from \"../constants\";\n\n/**\n * Service for authentication in the Griddo Private API\n */\nclass AuthService {\n\tuser: string | undefined;\n\tpassword: string | undefined;\n\tbaseUrl: string | undefined;\n\theaders:\n\t\t| { Authorization: string; \"Cache-Control\": string; lang?: string }\n\t\t| undefined;\n\n\tconstructor() {\n\t\tthis.user = envs.GRIDDO_BOT_USER;\n\t\tthis.password = envs.GRIDDO_BOT_PASSWORD;\n\t\tthis.baseUrl = envs.GRIDDO_API_URL;\n\t}\n\n\tasync login() {\n\t\ttry {\n\t\t\tconst response = await axios({\n\t\t\t\turl: endpoints.LOGIN,\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: {\n\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\tConnection: \"close\",\n\t\t\t\t},\n\t\t\t\tdata: {\n\t\t\t\t\tusername: this.user,\n\t\t\t\t\tpassword: this.password,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tif (response.status === 200) {\n\t\t\t\tconst {\n\t\t\t\t\tdata: { token },\n\t\t\t\t} = response;\n\t\t\t\tthis.headers = {\n\t\t\t\t\tAuthorization: \"bearer \" + token,\n\t\t\t\t\t\"Cache-Control\": \"no-store\",\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn this.headers;\n\t\t} catch (e) {\n\t\t\tconsole.error(\n\t\t\t\tchalk.red(`\n\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E\n\u2502 Access credentials failure \u2502\n\u2502 Check that the login details are correct in your .env file \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\n`),\n\t\t\t);\n\n\t\t\tprocess.exit(1);\n\t\t}\n\t}\n}\n\nconst authService = new AuthService();\n\nexport { authService as AuthService };\n", "import type {\n\tAPIRequest,\n\tAPIResponses,\n\tGetAPI,\n\tPostAPI,\n\tPutAPI,\n\tShowApiErrorOptions,\n} from \"../types/api\";\nimport type { AxiosError, Method } from \"axios\";\n\nimport axios from \"axios\";\nimport chalk from \"chalk\";\nimport dotenv from \"dotenv\";\n\nimport { saveCache, searchCacheData } from \"./cache\";\nimport { delay, getSafeSiteId, msToSec } from \"./core-utils\";\nimport { infoLog } from \"./loggin\";\nimport { envs } from \"../constants\";\nimport { apiRegister } from \"../registers\";\nimport { AuthService } from \"../services/auth\";\n\ndotenv.config();\n\n// Envs\nconst {\n\tenv: { RETRY_WAIT_SECONDS = \"4\", RETRY_ATTEMPTS = \"4\" },\n} = process;\n\n/**\n * Make a GET/PUT/POST request to the Griddo API.\n *\n * @template T Response Type returned.\n * @returns {Promise<T>} A promise that is resolved with the data from the API response.\n *\n * @example\n *\tconst response = await requestAPI<Site>(\n *\t\t{ endpoint: \"...\", cacheKey: \"...\", ... },\n *\t\t\"get\",\n *\t\t\"...\"\n *\t);\n */\nasync function requestAPI<T extends APIResponses>(\n\tprops: APIRequest,\n\tmethod: Method,\n\tappendToLog = \"\",\n): Promise<T> {\n\tconst { endpoint, body, cacheKey = \"\", attempt = 1, headers } = props;\n\tconst cacheOptions = { endpoint, body, headers, cacheKey };\n\n\t// Cache\n\tif (cacheKey) {\n\t\tconst start = new Date();\n\t\tconst cacheData = searchCacheData<T>(cacheOptions);\n\n\t\tif (cacheData) {\n\t\t\tconst siteId = getSafeSiteId(cacheData);\n\t\t\tconst siteIdMsg = siteId ? `site: ${siteId}` : \"\";\n\t\t\tconst duration = msToSec(new Date().getTime() - start.getTime());\n\t\t\tinfoLog(\n\t\t\t\t`${method} (cache) ${siteIdMsg} ${endpoint} - ${duration}s ${appendToLog}`,\n\t\t\t);\n\t\t\treturn cacheData;\n\t\t}\n\t}\n\n\t// Network\n\ttry {\n\t\tconst start = new Date();\n\t\tconst {\n\t\t\tdata,\n\t\t\theaders: responseHeaders,\n\t\t}: { data: T; headers: { \"content-length\": string } } = await axios({\n\t\t\turl: endpoint,\n\t\t\tmethod,\n\t\t\theaders: Object.assign({}, headers, AuthService.headers),\n\t\t\tdata: body,\n\t\t});\n\n\t\tconst siteId = getSafeSiteId(data);\n\t\tconst siteIdMsg = siteId ? `site: ${siteId}` : \"\";\n\t\tconst duration = msToSec(new Date().getTime() - start.getTime());\n\t\tinfoLog(\n\t\t\t`${method} (fetch) ${siteIdMsg} ${endpoint} - ${duration}s ${appendToLog}`,\n\t\t);\n\n\t\tsaveCache(cacheOptions, data);\n\n\t\t// Only save registers in alerts are enabled\n\t\tif (envs.GRIDDO_ALERT_FEATURE) {\n\t\t\tconst responseSize = Number.parseInt(responseHeaders[\"content-length\"]);\n\t\t\tif (responseSize > envs.GRIDDO_API_MAX_RESPONSE_SIZE) {\n\t\t\t\tapiRegister.insert(\"API_RESPONSE_TOO_BIG\", {\n\t\t\t\t\tendpoint,\n\t\t\t\t\tresponseSize,\n\t\t\t\t\tduration,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn data;\n\t} catch (e) {\n\t\tconst error = e as AxiosError;\n\n\t\tif (error.response?.status === 404) {\n\t\t\t// @ts-expect-error page maybe will be 404\n\t\t\treturn null;\n\t\t}\n\n\t\tif (attempt > parseInt(RETRY_ATTEMPTS)) {\n\t\t\tconsole.log(`\nMax attempts ${RETRY_ATTEMPTS} reached\n--------------------------------------\n- ${method.toUpperCase()} ${endpoint}\n- BODY: ${JSON.stringify(body)}\n- HEADERS: ${JSON.stringify(headers)}\n- RESPONSE: ${(error.response?.status, JSON.stringify(error.response?.data))}\n--------------------------------------\n`);\n\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\tif (!error.response) {\n\t\t\tconsole.log(\"Unknown error occurred\");\n\t\t\tconsole.log(JSON.stringify(error, null, 2));\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\tshowApiError(error, { callInfo: { endpoint, body } });\n\n\t\tconsole.warn(`Waiting for retry: ${method}`, endpoint);\n\n\t\tawait delay(parseInt(RETRY_WAIT_SECONDS) * 1000);\n\n\t\treturn requestAPI<T>(\n\t\t\t{\n\t\t\t\tendpoint,\n\t\t\t\tbody,\n\t\t\t\theaders,\n\t\t\t\tcacheKey,\n\t\t\t\tattempt: attempt + 1,\n\t\t\t},\n\t\t\tmethod,\n\t\t\tappendToLog,\n\t\t);\n\t}\n}\n\n/**\n * Make a GET request to the Griddo API.\n *\n * @template T Response Type returned.\n * @returns A promise that is resolved with the data from the API response.\n */\nasync function getApi<T extends APIResponses>(props: GetAPI) {\n\treturn await requestAPI<T>(props, \"get\");\n}\n\n/**\n * Make a PUT request to the Griddo API.\n *\n * @template T Response Type returned.\n * @returns A promise that is resolved with the data from the API response.\n */\nasync function putApi<T extends APIResponses>(props: PutAPI) {\n\treturn await requestAPI<T>(props, \"put\");\n}\n\n/**\n * Make a POST request to the Griddo API.\n *\n * @template T Response Type returned.\n * @returns A promise that is resolved with the data from the API response.\n */\nasync function postApi<T extends APIResponses>(props: PostAPI) {\n\tconst { endpoint, body, headers } = props;\n\tconst distributorBodyParams =\n\t\tendpoint.endsWith(\"/distributor\") &&\n\t\t`# Distributor body: ${JSON.stringify(body)} lang: ${JSON.stringify(\n\t\t\theaders?.lang,\n\t\t)}`;\n\n\treturn await requestAPI<T>(props, \"post\", distributorBodyParams || \"\");\n}\n\n/**\n * Shows an API error through the terminal.\n */\nfunction showApiError(error: AxiosError, options: ShowApiErrorOptions) {\n\tconst { response, message, stack } = error;\n\tconst { callInfo } = options;\n\tconst { status, statusText, data } = response || {};\n\tconst callInfoArray = [];\n\n\tfor (const item of Object.keys(callInfo) as Array<keyof typeof callInfo>) {\n\t\tcallInfoArray.push(\n\t\t\t`${item}: ${\n\t\t\t\ttypeof callInfo[item] === \"object\"\n\t\t\t\t\t? JSON.stringify(callInfo[item])\n\t\t\t\t\t: callInfo[item]\n\t\t\t}`,\n\t\t);\n\t}\n\n\t// Compose the errors output\n\tconst callInfoStr = callInfoArray.join(\"\\n\");\n\tconst apiResponseStr = response\n\t\t? `Code: ${status} - ${statusText}\\nResponse: ${JSON.stringify(data)}`\n\t\t: \"\";\n\tconst errorDetailsStr = `${message}\\n${stack}`;\n\n\t// Print the error\n\tconsole.warn(\n\t\tchalk.bold.red(`\n=============\n\n{ Call info }\n${callInfoStr}\n\n{ API Response }\n${apiResponseStr}\n\n{ Error details }\n${errorDetailsStr}\n\n=============\n`),\n\t);\n}\n\nexport { getApi as get, postApi as post, putApi as put };\n", "import type { Petition } from \"../types/global\";\nimport type { HashSites, SiteHash } from \"../types/sites\";\n\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport fsx from \"fs-extra\";\n\nimport { getConfig } from \"./core-utils\";\n\nconst config = getConfig();\n\n/**\n * Creates an `apiCache` dir to store pages fetched from them API.\n */\nfunction createAPICacheDir() {\n\tconst { __cx } = config.paths();\n\tconst apiCacheDir = path.join(__cx, \"apiCache\");\n\n\tif (!fs.existsSync(apiCacheDir)) {\n\t\tfs.mkdirSync(apiCacheDir);\n\t}\n\n\tconsole.info(\"Cache initialized\");\n}\n\n/**\n * Generate a filename with a hash using a Petition object\n *\n * @todo Merge with createSha256\n * @param petition An object\n */\nfunction generateFilenameWithHash(petition: Petition) {\n\tconst { __cx } = config.paths();\n\tconst apiCacheDir = path.join(__cx, \"apiCache\");\n\n\tconst hashSum = crypto.createHash(\"sha256\");\n\thashSum.update(JSON.stringify(petition));\n\n\treturn `${apiCacheDir}/${hashSum.digest(\"hex\")}`;\n}\n\n/**\n * Generate a filename with a hash using a string.\n *\n * @todo Merge with generateFilenameWithHash\n * @param data A string to create a sha256 based on.\n */\nfunction createSha256(data: string) {\n\tconst uniqueString = crypto.randomBytes(16).toString(\"hex\");\n\tconst hash = crypto.createHash(\"sha256\");\n\thash.update(`${data}${uniqueString}`);\n\n\treturn hash.digest(\"hex\");\n}\n\n/**\n * Save a file using a hash name.\n *\n * @param petition An object.\n * @param content Content to be saved.\n */\nfunction saveCache<T>(petition: Petition, content: T) {\n\tconst stringContent =\n\t\ttypeof content === \"string\" ? content : JSON.stringify(content);\n\tconst filename = generateFilenameWithHash(petition);\n\tconst filepath = path.dirname(filename);\n\tif (!fs.existsSync(filepath)) {\n\t\tfs.mkdirSync(filepath, { recursive: true });\n\t}\n\tfs.writeFileSync(filename, stringContent, \"utf8\");\n}\n\n/**\n * Search in the `apiCache` dir for a file using the petition as hash generator.\n * Return the file content if found or null if not.\n *\n * @param petition An object\n */\nfunction searchCacheData<T>(petition: Petition) {\n\ttry {\n\t\tconst file = generateFilenameWithHash(petition);\n\t\tconst jsonData = fsx.readJSONSync(file, {\n\t\t\tencoding: \"utf-8\",\n\t\t});\n\t\treturn jsonData as T;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/**\n * Get site hashes from the file as an object\n */\nfunction getHashSites(): HashSites {\n\tconst { __cx } = config.paths();\n\tconst apiCacheDir = path.join(__cx, \"apiCache\");\n\tconst siteHasFilename = `${apiCacheDir}/siteHash.json`;\n\n\ttry {\n\t\tconst jsonData = fsx.readJSONSync(siteHasFilename, {\n\t\t\tencoding: \"utf-8\",\n\t\t});\n\t\treturn jsonData || {};\n\t} catch {\n\t\treturn {};\n\t}\n}\n\n/**\n * Update (write) the site hash file.\n *\n * @param siteId The id of the site.\n * @param siteHash The has of the site.\n */\nfunction updatedSiteHash(siteId: number, siteHash: SiteHash) {\n\tconst allHash = getHashSites();\n\tconst lastHash = allHash[siteId];\n\tconst currentHash = siteHash || lastHash || new Date().valueOf();\n\n\tconst { __cx } = config.paths();\n\tconst apiCacheDir = path.join(__cx, \"apiCache\");\n\tconst siteHasFilename = `${apiCacheDir}/siteHash.json`;\n\n\tif (currentHash !== lastHash) {\n\t\tallHash[siteId] = currentHash;\n\t\tfs.writeFileSync(siteHasFilename, JSON.stringify(allHash), {\n\t\t\tencoding: \"utf-8\",\n\t\t});\n\t}\n\n\treturn currentHash.toString();\n}\n\nexport {\n\tcreateAPICacheDir,\n\tcreateSha256,\n\tsaveCache,\n\tsearchCacheData,\n\tupdatedSiteHash,\n};\n", "import fsx from \"fs-extra\";\n\ntype Entry = Record<string, unknown>;\n\ntype EntryData = {\n\ttitle: string;\n\tdescription: string;\n\tentries: Array<Entry>;\n};\n\ntype Entries = Record<string, EntryData>;\n\ninterface RegisterBase<T extends Entries> {\n\tinsert(name: keyof T, entry: Entry): void;\n\tget(name: keyof T): EntryData;\n\tgetAll(): T;\n}\n\nclass MemoryRegister<T extends Entries> implements RegisterBase<T> {\n\tentries: T;\n\n\tconstructor(entries: T) {\n\t\tthis.entries = entries;\n\t}\n\n\tinsert(name: keyof T, entry: Entry) {\n\t\tthis.entries[name].entries.push(entry);\n\t}\n\n\tget(name: keyof T) {\n\t\treturn this.entries[name];\n\t}\n\n\tgetAll() {\n\t\treturn this.entries;\n\t}\n}\n\nclass FileRegister<T extends Entries> implements RegisterBase<T> {\n\tprivate readonly filePath: string;\n\tentries: T;\n\n\tconstructor(filePath: string, entries: T) {\n\t\tthis.entries = entries;\n\t\tthis.filePath = filePath;\n\t\ttry {\n\t\t\tfsx.writeJSONSync(this.filePath, this.entries);\n\t\t} catch (e) {\n\t\t\tconsole.error(`Error writing ${this.filePath}`, e);\n\t\t}\n\t}\n\n\tprivate getCurrentEntries(): T {\n\t\treturn fsx.readJSONSync(this.filePath, \"utf8\") as T;\n\t}\n\n\tinsert(name: keyof T, entry: Entry) {\n\t\ttry {\n\t\t\tconst currentEntries = this.getCurrentEntries();\n\t\t\tcurrentEntries[name].entries.push(entry);\n\t\t\tfsx.writeJSONSync(this.filePath, currentEntries);\n\t\t} catch (e) {\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tget(name: keyof T) {\n\t\ttry {\n\t\t\treturn fsx.readJSONSync(this.filePath, \"utf8\")[name] as EntryData;\n\t\t} catch (e) {\n\t\t\tthrow new Error(`Error reading ${this.filePath}`);\n\t\t}\n\t}\n\n\tgetAll() {\n\t\ttry {\n\t\t\treturn fsx.readJSONSync(this.filePath, \"utf8\") as T;\n\t\t} catch (e) {\n\t\t\tthrow new Error(`Error reading ${this.filePath}`);\n\t\t}\n\t}\n}\n\nclass Register<T extends Entries> {\n\tprivate strategy: RegisterBase<T>;\n\n\tconstructor(strategy: RegisterBase<T>) {\n\t\tthis.strategy = strategy;\n\t}\n\n\tinsert<K extends keyof T>(name: K, entry: Entry) {\n\t\tthis.strategy.insert(name, entry);\n\t}\n\n\tget<K extends keyof T>(name: K) {\n\t\treturn this.strategy.get(name);\n\t}\n\n\tgetAll() {\n\t\treturn this.strategy.getAll();\n\t}\n\n\thaveEntries() {\n\t\treturn Object.keys(this.strategy.getAll()).length > 0;\n\t}\n\n\tisEmpty() {\n\t\treturn !this.haveEntries();\n\t}\n}\n\nexport {\n\tFileRegister,\n\tMemoryRegister,\n\tRegister,\n\ttype Entries,\n\ttype Entry,\n\ttype EntryData,\n};\n", "import { MemoryRegister, Register } from \"../services/register\";\n\nconst entries = {\n\tAPI_RESPONSE_TOO_BIG: {\n\t\ttitle: \"API response size is too large (80KB)\",\n\t\tdescription:\n\t\t\t\"API response size is too large and may affect rendering performance\",\n\t\tentries: [],\n\t},\n};\n\nconst register = new Register(new MemoryRegister(entries));\n\nexport default register;\n", "import { MemoryRegister, Register } from \"../services/register\";\n\nconst entries = {\n\tGATSBY_PAGE_SIZE_TOO_BIG: {\n\t\ttitle: \"Gatsby JSON page size is too large (512KB)\",\n\t\tdescription:\n\t\t\t\"The JSON of some Gatsby pages (page-data folder) are too large and may affect rendering performance\",\n\t\tentries: [],\n\t},\n};\n\nconst register = new Register(new MemoryRegister(entries));\n\nexport default register;\n", "import type {\n\tAllSitesReponse,\n\tDistributorBody,\n\tDistributorResponse,\n\tEndPageInfoResponse,\n\tEndSiteRenderBody,\n\tLanguagesResponse,\n\tPageResponse,\n\tSitemapAPIResponse,\n\tSocialsResponse,\n\tStartPageRenderResponse,\n} from \"../types/api\";\nimport type { Site } from \"../types/sites\";\nimport type { Core } from \"@griddo/core\";\n\nimport { endpoints } from \"../constants\";\nimport { get, post } from \"../utils/api\";\n\n/**\n * Get a list of site objects.\n */\nasync function getAllSites() {\n\treturn await get<AllSitesReponse>({ endpoint: endpoints.GET_ALL });\n}\n\n/**\n * Fetch a page object from API.\n */\nasync function getPage(id: number, cacheKey: string) {\n\treturn await get<PageResponse>({\n\t\tendpoint: `${endpoints.GET_PAGE}/${id}`,\n\t\tcacheKey,\n\t});\n}\n\n/**\n * Get site info\n */\nasync function getSiteInfo(id: number, cacheKey = \"\") {\n\tconst [prefix, suffix] = endpoints.INFO;\n\n\treturn await get<Site>({\n\t\tendpoint: `${prefix}${id}${suffix}`,\n\t\tcacheKey,\n\t});\n}\n\nasync function getSiteLanguages(id: number, cacheKey = \"\") {\n\tconst [prefix, suffix] = endpoints.LANGUAGES;\n\n\treturn await get<LanguagesResponse>({\n\t\tendpoint: `${prefix}${id}${suffix}`,\n\t\tcacheKey,\n\t});\n}\n\nasync function startSiteRender(id: number) {\n\tconst [prefix, suffix] = endpoints.BUILD_START;\n\n\treturn await get<StartPageRenderResponse>({\n\t\tendpoint: `${prefix}${id}${suffix}`,\n\t});\n}\n\n/**\n * Send the end signal to API for a render site.\n */\nasync function endSiteRender(id: number, body: EndSiteRenderBody) {\n\tconst [prefix, suffix] = endpoints.BUILD_END;\n\n\treturn await post<EndPageInfoResponse>({\n\t\tendpoint: `${prefix}${id}${suffix}`,\n\t\tbody,\n\t});\n}\n\nasync function getDistributorData(\n\tpage: Core.Page,\n\tbody: DistributorBody,\n\tcacheKey: string,\n\tdataSiteId?: number,\n\tdataLangID?: number,\n) {\n\tconst [prefix, suffix] = endpoints.GET_REFERENCE_FIELD_DATA;\n\tconst site = dataSiteId || page.site;\n\tconst lang = dataLangID || page.language;\n\n\treturn await post<DistributorResponse>({\n\t\tendpoint: `${prefix}${site}${suffix}`,\n\t\tbody,\n\t\theaders: { lang },\n\t\tcacheKey,\n\t});\n}\n\nasync function getSitemap(id: number) {\n\tconst [prefix, suffix] = endpoints.GET_SITEMAP;\n\n\treturn await get<SitemapAPIResponse>({\n\t\tendpoint: `${prefix}${id}${suffix}`,\n\t});\n}\n\nasync function getSiteSocials(id: number, cacheKey = \"\") {\n\tconst [prefix, suffix] = endpoints.SOCIALS;\n\n\treturn await get<SocialsResponse>({\n\t\tendpoint: `${prefix}${id}${suffix}`,\n\t\tcacheKey,\n\t});\n}\n\nexport {\n\tendSiteRender,\n\tgetAllSites,\n\tgetSiteLanguages,\n\tgetPage,\n\tgetDistributorData,\n\tgetSiteInfo,\n\tgetSitemap,\n\tgetSiteSocials,\n\tstartSiteRender,\n};\n", "import type { Robots } from \"../types/global\";\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { endpoints } from \"../constants\";\nimport { get } from \"../utils/api\";\nimport { getConfig } from \"../utils/core-utils\";\n\nconst config = getConfig();\n\nasync function getRobots() {\n\ttry {\n\t\tconst robots = await get<Robots>({ endpoint: endpoints.ROBOTS });\n\n\t\treturn (\n\t\t\trobots\n\t\t\t\t?.filter((r) => !!r.path)\n\t\t\t\t.map(({ path, content }) => ({\n\t\t\t\t\tpath,\n\t\t\t\t\tcontent: content || \"User-agent: *\\n\\r\\n\\rAllow: /\",\n\t\t\t\t})) || []\n\t\t);\n\t} catch (e) {\n\t\tconsole.warn(`Robots: ${(e as Error).message}`);\n\t}\n}\n\nasync function writeRobots(domain: string) {\n\tconst { __cx } = config.paths(domain);\n\tconst distDirectory = path.join(__cx, \"dist\");\n\n\tconst robots = await getRobots();\n\n\tif (!robots) {\n\t\tconsole.log(`Robots not found for ${domain}`);\n\t\treturn;\n\t}\n\n\tconst robot = robots.find(({ path }) => path === `/${domain}`);\n\n\tif (!robot) {\n\t\tconsole.log(`Robots not found for ${domain}`);\n\t\treturn;\n\t}\n\n\tif (fs.existsSync(distDirectory)) {\n\t\tconst fileLocation = path.join(distDirectory, \"robots.txt\");\n\t\tfs.writeFileSync(fileLocation, robot?.content);\n\t} else {\n\t\tconsole.log(`${distDirectory} not found`);\n\t}\n}\n\nexport { writeRobots };\n", "import type { Artifacts, PlaceholderPath } from \"../types/global\";\n\nimport path from \"node:path\";\n\n/**\n * Returns the artifacts of CX.\n */\nfunction getCxArtifacts(paths: Record<PlaceholderPath, string>): Artifacts {\n\tconst { __cx, __exports, __caches } = paths;\n\n\treturn {\n\t\tinitials: [\n\t\t\t__exports, // `/exports/<domain>`\n\t\t\t__caches, // `__cx/caches/<domain>`\n\t\t],\n\t\tdisposables: [\n\t\t\tpath.join(__cx, \"store\"),\n\t\t\tpath.join(__cx, \"apiCache\"),\n\t\t\tpath.join(__cx, \"dist\"),\n\t\t],\n\t\tcacheables: [\"apiCache\", \"store\"],\n\t\tarchivables: [\"dist\", \"assets\"],\n\t};\n}\n\nexport default getCxArtifacts;\n", "import type { Artifacts, PlaceholderPath } from \"../types/global\";\n\nimport path from \"node:path\";\n\n/**\n * Returns the artifacts of Gatsby.\n */\nfunction gatsbyArtifacts(paths: Record<PlaceholderPath, string>): Artifacts {\n\tconst { __ssg } = paths;\n\n\treturn {\n\t\tdisposables: [\n\t\t\tpath.join(__ssg, \"public\"),\n\t\t\tpath.join(__ssg, \"static\"),\n\t\t\tpath.join(__ssg, \".cache\"),\n\t\t],\n\t\tcacheables: [\".cache\"],\n\n\t\t// Gatsby does not have an initials directories to be created.\n\t\tinitials: [],\n\n\t\t// Gatsby does not have any archivable artifacts. The output of Gatsby\n\t\t// is moved to the Griddo `dist` artifacts.\n\t\tarchivables: [],\n\t};\n}\n\nexport default gatsbyArtifacts;\n", "import type { Adapters } from \"../adapters\";\nimport type { PlaceholderPath } from \"../types/global\";\n\nimport getCxArtifacts from \"./cx\";\nimport getGatsbyArtifacts from \"./gatsby\";\n\n/**\n * Returns the artifacts of a specific adapter along with those of CX.\n *\n * @param adapter - The adapter for which to get the artifacts.\n * @param options.cxPaths - The cx-paths.\n */\nfunction getArtifacts(\n\tadapter: Adapters,\n\toptions: {\n\t\tcxPaths: Record<PlaceholderPath, string>;\n\t},\n) {\n\tconst { cxPaths } = options;\n\tconst ssgArtifacts = {\n\t\tgatsby: getGatsbyArtifacts(cxPaths),\n\t};\n\n\treturn {\n\t\tcx: getCxArtifacts(cxPaths),\n\t\tssg: ssgArtifacts[adapter],\n\t};\n}\n\nexport { getArtifacts };\n", "import type { GriddoAlertRegisterProps } from \"@griddo/core\";\n\nimport axios from \"axios\";\n\nimport { endpoints } from \"../constants\";\n\n// Esta funci\u00F3n est\u00E1 duplicada de core de manera intencionada por si esta recibe\n// cambios necesitados solo por CX.\n// Nota: S\u00ED estamos reutilizando el type.\nexport async function insertAlert({\n\tarea,\n\tdescription,\n\tfullData,\n\tinstantNotification = false,\n\tlevel,\n}: Omit<GriddoAlertRegisterProps, \"publicApiUrl\">) {\n\tconst url = endpoints.ALERT;\n\tconst body = { level, area, description, fullData, instantNotification };\n\n\ttry {\n\t\tawait axios.post(url, body, {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t});\n\t} catch (error) {\n\t\tconsole.error(\"Error creating Griddo alert:\", error);\n\t}\n}\n", "import type { BuildProcessData } from \"../types/global\";\nimport type {\n\tGriddoListPage,\n\tGriddoMultiPage,\n\tGriddoPageObject,\n\tGriddoSinglePage,\n\tPageAdditionalInfo,\n} from \"../types/pages\";\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport dotenv from \"dotenv\";\nimport pLimit from \"p-limit\";\n\nimport { DistributorService } from \"./distributors\";\nimport { NavigationService } from \"./navigation\";\nimport { getAllSettings } from \"./settings\";\nimport { getPage } from \"./sites\";\nimport { envs } from \"../constants\";\nimport { updatedSiteHash } from \"../utils/cache\";\nimport {\n\tgetConfig,\n\tremoveAllSiteDirsFromStore,\n\tsiteList,\n} from \"../utils/core-utils\";\nimport { infoLog, verboseLog } from \"../utils/loggin\";\nimport {\n\tcreateGriddoListPages,\n\tcreateGriddoMultiPages,\n\tcreateGriddoSinglePage,\n\tgetMultiPageElements,\n\tgetPaginatedPages,\n} from \"../utils/pages\";\nimport { checkSites, getSiteData, unpublishSites } from \"../utils/sites\";\nimport {\n\tcreateStoreDir,\n\tgetPagesToCreateOrDelete,\n\tremovePagesFromStore,\n\tsavePagesInStore,\n\tsaveRenderInfoInStore,\n} from \"../utils/store\";\n\nconst config = getConfig();\n\ndotenv.config();\n\nconst RENDER_ID = new Date().valueOf().toString();\n\n/**\n * Fetch, process and save object pages and sites data into the file system to\n * be consumed by other services (Griddo itself, Adapters, etc.)\n */\nasync function createStore(domain: string) {\n\tcreateStoreDir();\n\n\tconsole.info(`API calls with ${envs.GRIDDO_API_CONCURRENCY_COUNT} threads`);\n\n\tconst { __cx } = config.paths();\n\tconst { griddoVersion } = config;\n\tconst storeDir = path.join(__cx, \"store\");\n\n\ttry {\n\t\t// Vars to save later in the report file\n\t\tconst createdPages: Array<number> = [];\n\t\tconst buildProcessData: BuildProcessData = {};\n\n\t\t// Get sites objects to publish and unpublish from this domain\n\t\tconst { sitesToPublish, sitesToUnpublish } = await checkSites(domain);\n\n\t\tconst domainHasSites =\n\t\t\tsitesToPublish.length > 0 || sitesToUnpublish.length > 0;\n\n\t\tif (!domainHasSites) {\n\t\t\tconsole.warn(`There are no sites to update in the domain ${domain}`);\n\t\t}\n\n\t\tconsole.info(`Sites to publish: ${siteList(sitesToPublish)}`);\n\t\tconsole.info(`Sites to unpublish: ${siteList(sitesToUnpublish)}`);\n\n\t\t// Send unpublished sites to API.\n\t\t// @todo \u00BFmover esta llamada al final del proceso de render?\n\t\t// Aqu\u00ED tambi\u00E9n se est\u00E1n eliminado f\u00EDsicamente los archivos json del\n\t\t// store de los sites para despublicar.\n\t\tawait unpublishSites(sitesToUnpublish);\n\n\t\t// Solo los sites to publish...\n\t\tfor (const site of sitesToPublish) {\n\t\t\tconst {\n\t\t\t\tid: siteId,\n\t\t\t\tslug: siteSlug,\n\t\t\t\ttheme,\n\t\t\t\tfavicon,\n\t\t\t\tchangedPages = [],\n\t\t\t} = site;\n\n\t\t\tconst {\n\t\t\t\tsiteInfo,\n\t\t\t\tvalidPagesIds,\n\t\t\t\tsiteHash,\n\t\t\t\tunpublishHashes,\n\t\t\t\tsiteLangs,\n\t\t\t\tdefaultLang,\n\t\t\t\theaders,\n\t\t\t\tfooters,\n\t\t\t\tsocials,\n\t\t\t} = await getSiteData(siteId);\n\n\t\t\tconst {\n\t\t\t\tcloudinaryName,\n\t\t\t\tuseMetaTitle,\n\t\t\t\tuseMetaKeywords,\n\t\t\t\tshowBasicMetaRobots,\n\t\t\t\tavoidHrefLangsOnCanonicals,\n\t\t\t\tavoidSelfReferenceCanonicals,\n\t\t\t\tavoidHrefLangXDefault,\n\t\t\t\tavoidDebugMetas,\n\t\t\t} = await getAllSettings();\n\n\t\t\tbuildProcessData[siteId] = {\n\t\t\t\tsiteHash,\n\t\t\t\tunpublishHashes,\n\t\t\t\tpublishHashes: [],\n\t\t\t};\n\n\t\t\tconst NavService = new NavigationService();\n\t\t\tNavService.navigations = { headers, footers };\n\n\t\t\tsite.languages = siteLangs;\n\n\t\t\tconst shouldUpdateSite = updatedSiteHash(siteId, siteHash);\n\n\t\t\tconst siteScript = siteInfo.siteScript;\n\n\t\t\tconst siteMetadata = {\n\t\t\t\tsiteUrl: siteInfo.slug,\n\t\t\t\ttitle: siteInfo.name,\n\t\t\t\tfavicon,\n\t\t\t};\n\n\t\t\tconst additionalInfo = {\n\t\t\t\tbaseUrl: envs.GRIDDO_API_URL,\n\t\t\t\tpublicBaseUrl: envs.GRIDDO_PUBLIC_API_URL,\n\t\t\t\tinstance: envs.GRIDDO_REACT_APP_INSTANCE,\n\t\t\t\tsiteSlug,\n\t\t\t\ttheme,\n\t\t\t\tsiteMetadata,\n\t\t\t\tsocials,\n\t\t\t\tsiteLangs,\n\t\t\t\tcloudinaryName,\n\t\t\t\tgriddoVersion,\n\t\t\t\tsiteOptions: {\n\t\t\t\t\tuseMetaTitle,\n\t\t\t\t\tuseMetaKeywords,\n\t\t\t\t\tshowBasicMetaRobots,\n\t\t\t\t\tavoidHrefLangsOnCanonicals,\n\t\t\t\t\tavoidSelfReferenceCanonicals,\n\t\t\t\t\tavoidHrefLangXDefault,\n\t\t\t\t\tavoidDebugMetas,\n\t\t\t\t},\n\t\t\t\tsiteScript,\n\t\t\t};\n\n\t\t\tinfoLog(`${site.name} site`);\n\n\t\t\t/// Creates the store directory for each site using the id\n\t\t\tfs.mkdirSync(path.join(storeDir, siteId.toString()), {\n\t\t\t\trecursive: true,\n\t\t\t});\n\n\t\t\t// -------------------------------------------------------------------------\n\t\t\t// Pages loop promise creation\n\t\t\t// -------------------------------------------------------------------------\n\t\t\t// Async function that process every page for one site to use later in the\n\t\t\t// `Promise.all` with pLimit.\n\t\t\tconst fetchPageAndSaveInStore = async (\n\t\t\t\tsiteIdName: string,\n\t\t\t\tpageId: number,\n\t\t\t) => {\n\t\t\t\t// Here will be store every page returned by the API and processed\n\t\t\t\tlet griddoPageObjects: Array<GriddoPageObject> = [];\n\n\t\t\t\t// Get page data\n\t\t\t\tconst page = await getPage(pageId, shouldUpdateSite);\n\n\t\t\t\t// Probably a 404\n\t\t\t\tif (!page) return;\n\n\t\t\t\t// Update Array of page ids\n\t\t\t\tcreatedPages.push(pageId);\n\n\t\t\t\t// TODO: Use structuredClone() when node 18 is available.\n\t\t\t\t// SHAME: This new pageAdditionalInfo needs to be a copy because\n\t\t\t\t// additionalInfo referenced from outside this function and\n\t\t\t\t// its used by other pages.\n\t\t\t\tconst pageAdditionalInfo = JSON.parse(\n\t\t\t\t\tJSON.stringify(additionalInfo),\n\t\t\t\t) as PageAdditionalInfo;\n\n\t\t\t\t// Updated with navigations (header & footer)\n\t\t\t\tpageAdditionalInfo.navigations = NavService.getPageNavigations(page);\n\n\t\t\t\t// Content Type Data Query\n\t\t\t\t// Where the pair `hasDistributorData:true` and `data` prop exists, this\n\t\t\t\t// function will attach a `queriedItems` prop with the result of the fetch\n\t\t\t\t// for the data.\n\t\t\t\tconst template = await DistributorService.getDistributorData({\n\t\t\t\t\tpage,\n\t\t\t\t\tcacheKey: RENDER_ID,\n\t\t\t\t});\n\n\t\t\t\t// MultiPage Query\n\t\t\t\t// Where the pair `hasGriddoMultiPage:true` prop exists, this function\n\t\t\t\t// will process the schema and return a multiPageElemtens array to use\n\t\t\t\t// in `createGriddoMultiPages()`\n\t\t\t\tconst multiPageElements = await getMultiPageElements(template);\n\n\t\t\t\t// -----------------------------------------------------------------------\n\t\t\t\t// Build Griddo page objects.\n\t\t\t\t// -----------------------------------------------------------------------\n\t\t\t\t// A page from the API could be one of those:\n\t\t\t\t// - List with pagination (static list template): needs to be splitted in n pages\n\t\t\t\t// - Multi-page module: needs to be splitted in n pages\n\t\t\t\t// - Single: just one page\n\n\t\t\t\t// Griddo page types\n\t\t\t\tconst isStaticListPage = page?.mode === \"list\";\n\t\t\t\tconst isMultiPage = !isStaticListPage && multiPageElements;\n\t\t\t\tconst isSinglePage = !isMultiPage && !isStaticListPage;\n\n\t\t\t\t// >> List (static list template) <<\n\t\t\t\tif (isStaticListPage) {\n\t\t\t\t\tconst griddoListPage = {\n\t\t\t\t\t\tpage: page,\n\t\t\t\t\t\tpages: getPaginatedPages(template),\n\t\t\t\t\t\tisRoot: false,\n\t\t\t\t\t\tdefaultLang: defaultLang,\n\t\t\t\t\t\ttemplate: template,\n\t\t\t\t\t\ttotalQueriedItems: template.queriedItems,\n\t\t\t\t\t} as GriddoListPage;\n\n\t\t\t\t\t// pageObjects = await createGriddoListPages({ adapter: \"Gatsby\" })\n\t\t\t\t\tgriddoPageObjects = await createGriddoListPages(\n\t\t\t\t\t\tgriddoListPage,\n\t\t\t\t\t\tpageAdditionalInfo,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// >> Multi-page <<\n\t\t\t\tif (isMultiPage) {\n\t\t\t\t\tconst griddoMultipage = page as GriddoMultiPage;\n\n\t\t\t\t\t// The `template` key with the (maybe) distributor data items queried\n\t\t\t\t\tgriddoMultipage.template = template;\n\t\t\t\t\tgriddoMultipage.multiPageElements = multiPageElements;\n\t\t\t\t\tgriddoMultipage.defaultLang = defaultLang;\n\n\t\t\t\t\tgriddoPageObjects = await createGriddoMultiPages(\n\t\t\t\t\t\tgriddoMultipage,\n\t\t\t\t\t\tpageAdditionalInfo,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// >> Single template <<\n\t\t\t\tif (isSinglePage) {\n\t\t\t\t\tconst griddoSinglePage = page as GriddoSinglePage;\n\n\t\t\t\t\t// The `template` key with the (maybe) distributor data items queried\n\t\t\t\t\tgriddoSinglePage.template = template;\n\t\t\t\t\tgriddoSinglePage.defaultLang = defaultLang;\n\n\t\t\t\t\tgriddoPageObjects = [\n\t\t\t\t\t\tawait createGriddoSinglePage(griddoSinglePage, pageAdditionalInfo),\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\t// Upload only the valid pages hashes of pages that has been changed or created\n\t\t\t\tif (page.hash !== null) {\n\t\t\t\t\tbuildProcessData[siteId].publishHashes.push(page.hash);\n\t\t\t\t}\n\n\t\t\t\t// Save build data to store\n\t\t\t\tsavePagesInStore(siteIdName, griddoPageObjects);\n\t\t\t};\n\n\t\t\t// Pages to be created or deleted in the store\n\t\t\tconst {\n\t\t\t\tpagesMissingInStore,\n\t\t\t\tpagesToDeleteFromStore,\n\t\t\t\tpagesToWriteToStore,\n\t\t\t} = await getPagesToCreateOrDelete({\n\t\t\t\tsitesToPublish,\n\t\t\t\tvalidPagesIds,\n\t\t\t\tchangedPages,\n\t\t\t\tsiteDirName: siteId.toString(),\n\t\t\t});\n\n\t\t\t// 1 - Delete pages from the store (just remove from disk)\n\t\t\tremovePagesFromStore(siteId.toString(), pagesToDeleteFromStore);\n\n\t\t\t// 2 - Create pages to the store (fetch from API, transform, etc..)\n\t\t\tconst limit = pLimit(envs.GRIDDO_API_CONCURRENCY_COUNT);\n\t\t\tconst pagesToStore = pagesToWriteToStore.map((id: number) =>\n\t\t\t\tlimit(() => fetchPageAndSaveInStore(siteId.toString(), id)),\n\t\t\t);\n\n\t\t\t// Debug time\n\t\t\tverboseLog(`Store site: ${site.name}`);\n\t\t\tverboseLog(`${validPagesIds} valid pages from API`);\n\t\t\tverboseLog(`changed ${changedPages} pages from API`);\n\t\t\tverboseLog(`deleted ${pagesToDeleteFromStore} pages from store`);\n\t\t\tverboseLog(`missing ${pagesMissingInStore} pages in store`);\n\t\t\tverboseLog(`write ${pagesToWriteToStore} pages to store`);\n\n\t\t\tawait Promise.all(pagesToStore);\n\t\t}\n\n\t\t// Despu\u00E9s de renderizar todos los sites y sus p\u00E1ginas (las que sean que\n\t\t// hayan cambiado etc.) guardamos un archivo con la informaci\u00F3n del\n\t\t// render para usos posteriores.\n\n\t\t// Aqu\u00ED tenemos dos casos:\n\n\t\t// - 1 Render de dominios con sites para publicar o despublicar. Se\n\t\t// guarda la infor del render y ya est\u00E1.\n\n\t\t// - 2 Render de un dominio que no tiene sites ni para publicar ni para\n\t\t// despublicar, lo que llamamos un dominio \"vac\u00EDo\". Se eliminan las\n\t\t// p\u00E1ginas \"hu\u00E9rfanas\" de la carpeta `store` as\u00ED el proceso de SSG se\n\t\t// encontrar\u00E1 efectivamente con un dominio \"sin p\u00E1ginas\" y \"borrar\u00E1\" el\n\t\t// \u00FAltimo site. Adem\u00E1s se guarda la informaci\u00F3n del render con arrays\n\t\t// vac\u00EDos directamente en `createdPages` y `sitesToPublish`.\n\n\t\tif (domainHasSites) {\n\t\t\t// 1\n\t\t\tsaveRenderInfoInStore(storeDir, {\n\t\t\t\tbuildProcessData,\n\t\t\t\tcreatedPages,\n\t\t\t\tsitesToPublish,\n\t\t\t});\n\t\t} else {\n\t\t\t// 2 Remove every site folder (Except metadata folder)\n\t\t\tremoveAllSiteDirsFromStore();\n\t\t\t// 3 Reset the render info\n\t\t\tsaveRenderInfoInStore(storeDir, {\n\t\t\t\tbuildProcessData,\n\t\t\t\tcreatedPages: [],\n\t\t\t\tsitesToPublish: [],\n\t\t\t});\n\t\t}\n\t} catch (e) {\n\t\tconst error = e as { message: string };\n\t\tconsole.error(error.message);\n\t\tprocess.exit(1);\n\t}\n}\n\nexport { createStore };\n", "import type { FetchDataProps } from \"../types/global\";\nimport type { APIPageObject } from \"../types/pages\";\nimport type { Core, Fields } from \"@griddo/core\";\nimport type {\n\tQueriedData,\n\tReference,\n} from \"@griddo/core/dist/types/api-response-fields\";\n\nimport { getDistributorData } from \"./sites\";\nimport { boxLog } from \"../utils/loggin\";\n\n/**\n * Service to work with distributors.\n */\nclass DistributorService {\n\t/**\n\t * Get the body data from a ReferenceField.\n\t * `auto`, `manual` or `navigation` mode.\n\t *\n\t * @param data The ReferenceField props.\n\t * @returns The props for one of the ReferenceField mode.\n\t */\n\tstatic getBody(data: Fields.Reference<unknown>, page: Core.Page) {\n\t\tconst {\n\t\t\torder,\n\t\t\tsources,\n\t\t\tquantity,\n\t\t\tmode,\n\t\t\tfixed,\n\t\t\tfullRelations = false,\n\t\t\tallLanguages = false,\n\t\t\tpreferenceLanguage = false,\n\t\t\treferenceId,\n\t\t\tfields,\n\t\t} = data;\n\n\t\tif (mode === \"auto\") {\n\t\t\treturn {\n\t\t\t\tmode,\n\t\t\t\torder,\n\t\t\t\tsources,\n\t\t\t\tquantity,\n\t\t\t\tfullRelations,\n\t\t\t\tallLanguages,\n\t\t\t\tpreferenceLanguage,\n\t\t\t\tfields,\n\t\t\t};\n\t\t}\n\n\t\tif (mode === \"manual\") {\n\t\t\treturn { mode, fixed, fullRelations, fields };\n\t\t}\n\n\t\tif (mode === \"navigation\") {\n\t\t\treturn {\n\t\t\t\tmode,\n\t\t\t\torder,\n\t\t\t\tquantity,\n\t\t\t\tfullRelations,\n\t\t\t\treferenceId: referenceId || page?.structuredDataContent?.id,\n\t\t\t\tfields,\n\t\t\t};\n\t\t}\n\n\t\tconsole.log(\n\t\t\t`Error: Distribuidor mode: ${mode} is not recognized on page ${page?.id}.`,\n\t\t);\n\n\t\treturn data;\n\t}\n\n\t/**\n\t * Gets ContentType data from API\n\t *\n\t * @param props\n\t * @param props.page The Page object\n\t * @param props.component.data The ReferenceField, always in the data prop.\n\t * @param props.cacheKey A cache key to manage cached files or using fetch\n\t * @returns The ContentType data.\n\t */\n\tstatic async fetchContentTypeData(props: FetchDataProps) {\n\t\tconst {\n\t\t\tpage,\n\t\t\tcomponent: { data },\n\t\t\tcacheKey,\n\t\t} = props;\n\n\t\t// Distrubutor with `hasDistributorDat: true` but without `data` prop\n\t\tif (!data) {\n\t\t\tboxLog(\n\t\t\t\t`Error: Page ${page.id} has \\`hasDistributorData: true\\` but it doesn't have a \\`data\\` prop`,\n\t\t\t\t\"No data in ReferenceField\",\n\t\t\t);\n\n\t\t\treturn [];\n\t\t}\n\n\t\t// Avoid fetch distributors with empty `data.sources`\n\t\tif (Array.isArray(data.sources) && data.sources.length < 1) {\n\t\t\tboxLog(\n\t\t\t\t`Warning: Page with id: ${page.id} has a ReferenceField with empty \\`data.sources\\``,\n\t\t\t\t\"Empty data.sources in ReferenceField\",\n\t\t\t);\n\n\t\t\treturn [];\n\t\t}\n\n\t\tconst { site, lang } = data;\n\n\t\t// Infor that the distributor has not dat.sources\n\t\tif (!data.sources && data.mode === \"auto\") {\n\t\t\tboxLog(\n\t\t\t\t`Warning: Page with id: ${page.id} has a ReferenceField with \\`undefined\\` \\`data.sources\\``,\n\t\t\t\t\"undefined data.sources in ReferenceField\",\n\t\t\t);\n\t\t}\n\n\t\tconst body = this.getBody(data, page);\n\n\t\tconst response = await getDistributorData(page, body, cacheKey, site, lang);\n\n\t\treturn response;\n\t}\n\n\t/**\n\t * Compose the queriedItems prop from a distributor data of a page.\n\t *\n\t * @param props\n\t * @param props.page The APIPage object\n\t * @param props.cacheKey A cache key to manage cached files or using fetch\n\t */\n\tstatic async getDistributorData({\n\t\tpage,\n\t\tcacheKey = \"\",\n\t}: {\n\t\tpage: APIPageObject;\n\t\t/** Reference id to manage cache between renders. */\n\t\tcacheKey: string;\n\t}) {\n\t\ttry {\n\t\t\tconst { template } = page;\n\t\t\tconst checkDistributors = async (\n\t\t\t\ttemplateChunk: {\n\t\t\t\t\thasDistributorData?: boolean;\n\t\t\t\t\tqueriedItems: QueriedData<unknown>;\n\t\t\t\t},\n\t\t\t\tlevel = 1,\n\t\t\t) => {\n\t\t\t\t// If it doesn't a \"template strcuture\"\n\t\t\t\tif (!templateChunk || typeof templateChunk !== \"object\") return;\n\n\t\t\t\t// If doesn't have `hasDistributorData: true`\n\t\t\t\tif (\n\t\t\t\t\t!JSON.stringify(templateChunk).includes('\"hasDistributorData\":true')\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// For each prop in the \"template\"\n\t\t\t\tfor (const key in templateChunk) {\n\t\t\t\t\t// Si la key es `queriedItems` saltamos al siguiente `key`\n\t\t\t\t\tif (key === \"queriedItems\") continue;\n\n\t\t\t\t\tconst _key = key as \"hasDistributorData\" | \"queriedItems\";\n\t\t\t\t\tconst component = templateChunk[_key] as unknown as {\n\t\t\t\t\t\tdata: Reference<unknown>;\n\t\t\t\t\t\tqueriedItems: QueriedData<unknown>;\n\t\t\t\t\t\thasDistributorData: boolean;\n\t\t\t\t\t};\n\n\t\t\t\t\t// Si el elemento no existe o no es un objeto saltamos al siguiente `key`\n\t\t\t\t\tif (!component || typeof component !== \"object\") continue;\n\n\t\t\t\t\t// Si el elemento tiene la prop `hasDistributorData: true` hacemos el fetch\n\t\t\t\t\tif (component.hasDistributorData) {\n\t\t\t\t\t\tcomponent.queriedItems = await this.fetchContentTypeData({\n\t\t\t\t\t\t\tpage,\n\t\t\t\t\t\t\tcacheKey,\n\t\t\t\t\t\t\tcomponent,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tawait checkDistributors(component, level + 1);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst getDistributors = async (template: Core.Page[\"template\"]) => {\n\t\t\t\t// `template` es un array para que tambi\u00E9n revise la propia template como objeto.\n\t\t\t\t// @ts-expect-error\tremove the array\n\t\t\t\tawait checkDistributors([template]);\n\n\t\t\t\treturn template;\n\t\t\t};\n\n\t\t\tconst response = await getDistributors(template);\n\n\t\t\treturn response;\n\t\t} catch (err) {\n\t\t\tconsole.error(`Error en get distributor ${err}`);\n\n\t\t\tprocess.exit(1);\n\t\t}\n\t}\n}\n\nexport { DistributorService };\n", "import type { Footer, Header } from \"../types/navigation\";\nimport type { APIPageObject } from \"../types/pages\";\n\nclass NavigationService {\n\tprivate _defaultHeaders: Record<string, Header>;\n\tprivate _defaultFooters: Record<string, Footer>;\n\tprivate _navigations: {\n\t\theaders: Array<Header>;\n\t\tfooters: Array<Footer>;\n\t};\n\n\tconstructor() {\n\t\tthis._navigations = {\n\t\t\tfooters: [],\n\t\t\theaders: [],\n\t\t};\n\t\tthis._defaultHeaders = {};\n\t\tthis._defaultFooters = {};\n\t}\n\n\tset navigations(navigations) {\n\t\tthis._navigations = navigations;\n\t\tthis._defaultFooters = this.getDefaultFooters();\n\t\tthis._defaultHeaders = this.getDefaultHeaders();\n\t}\n\n\tget navigations() {\n\t\treturn this._navigations;\n\t}\n\n\tgetDefaultFooters() {\n\t\tconst safeFooters = [...this.navigations.footers];\n\t\tconst defaultFooters = safeFooters.filter(\n\t\t\t(footer) => !!footer.setAsDefault,\n\t\t);\n\t\tconst defaultFootersByLang = defaultFooters.reduce((prev, footer) => {\n\t\t\tconst { language } = footer;\n\n\t\t\treturn { ...prev, [language]: footer };\n\t\t}, {});\n\n\t\treturn defaultFootersByLang;\n\t}\n\n\tgetDefaultHeaders() {\n\t\tconst safeHeaders = [...this.navigations.headers];\n\t\tconst defaultHeaders = safeHeaders.filter(\n\t\t\t(header) => !!header.setAsDefault,\n\t\t);\n\t\tconst defaultHeadersByLang = defaultHeaders.reduce((prev, header) => {\n\t\t\tconst { language } = header;\n\n\t\t\treturn { ...prev, [language]: header };\n\t\t}, {});\n\n\t\treturn defaultHeadersByLang;\n\t}\n\n\tgetRightLanguage(\n\t\tlist: Array<{\n\t\t\tlanguage: number;\n\t\t\tnavigationLanguages: Array<{ navigationId: number }>;\n\t\t\tid: number;\n\t\t}>,\n\t\tid: number,\n\t\tlanguage: number,\n\t) {\n\t\tif (!list || !id) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst rightLanguageItem = list.find(\n\t\t\t(item) =>\n\t\t\t\titem.language === language &&\n\t\t\t\titem.navigationLanguages?.find(\n\t\t\t\t\t(version) => version.navigationId === id,\n\t\t\t\t),\n\t\t);\n\n\t\tconst result = rightLanguageItem || list.find((item) => item.id === id);\n\n\t\treturn result ? { ...result } : null;\n\t}\n\n\tgetPageHeader(id: number, language: number) {\n\t\treturn this.getRightLanguage(this.navigations.headers, id, language);\n\t}\n\n\tgetPageFooter(id: number, language: number) {\n\t\treturn this.getRightLanguage(this.navigations.footers, id, language);\n\t}\n\n\tgetPageNavigations(page: APIPageObject) {\n\t\tconst {\n\t\t\theader: pageHeader,\n\t\t\tfooter: pageFooter,\n\t\t\tlanguage,\n\t\t\ttemplate: { templateType },\n\t\t\ttemplateConfig: { defaultHeader, defaultFooter, templates },\n\t\t} = page;\n\n\t\t// The navigations would be:\n\t\t// - The one with the page or ...\n\t\t// - The one defined for that template or ...\n\t\t// - The one you have defined for that data package\n\t\tconst getValidNavigation = (values: Array<number | unknown>) => {\n\t\t\tconst fineNavigation = values.find((item) => typeof item === \"number\");\n\n\t\t\treturn typeof fineNavigation === \"number\" ? fineNavigation : null;\n\t\t};\n\n\t\tconst headerID = getValidNavigation([\n\t\t\tpageHeader,\n\t\t\ttemplates?.[templateType]?.defaultHeader,\n\t\t\tdefaultHeader,\n\t\t]);\n\n\t\tconst footerID = getValidNavigation([\n\t\t\tpageFooter,\n\t\t\ttemplates?.[templateType]?.defaultFooter,\n\t\t\tdefaultFooter,\n\t\t]);\n\n\t\tconst header = headerID\n\t\t\t? this.getPageHeader(headerID, language)\n\t\t\t: headerID === 0\n\t\t\t\t? null\n\t\t\t\t: this._defaultHeaders[language];\n\n\t\tconst footer = footerID\n\t\t\t? this.getPageFooter(footerID, language)\n\t\t\t: footerID === 0\n\t\t\t\t? null\n\t\t\t\t: this._defaultFooters[language];\n\n\t\treturn {\n\t\t\theader,\n\t\t\tfooter,\n\t\t} as { header: Header; footer: Footer };\n\t}\n}\n\nexport { NavigationService };\n", "import type { Settings } from \"../types/global\";\n\nimport { endpoints } from \"../constants\";\nimport { get, post } from \"../utils/api\";\n\nasync function getAllSettings() {\n\treturn await get<Settings>({ endpoint: endpoints.SETTINGS });\n}\n\nasync function resetRender() {\n\tawait post({ endpoint: endpoints.RESET_RENDER });\n}\n\nexport { getAllSettings, resetRender };\n", "import type { Core, Fields } from \"@griddo/core\";\nimport type {\n\tAPIPageObject,\n\tGriddoListPage,\n\tGriddoMultiPage,\n\tGriddoPageObject,\n\tGriddoSinglePage,\n\tMultiPageElement,\n\tMultiPageElements,\n\tPageAdditionalInfo,\n} from \"../types/pages\";\nimport type { TemplateWithDistributor } from \"../types/templates\";\n\nimport dotenv from \"dotenv\";\nimport { formatImage } from \"./images\";\n\ndotenv.config();\n\n// Consts\nconst DEFAULT_ITEMS_PER_PAGE_FOR_LIST_TEMPLATES = 25;\n\n/**\n * Return an OpenGraph object.\n *\n * @param props.socialTitle The social title.\n * @param props.socialDescription The social description.\n * @param props.socialImage The social image in Cloudinary or DAM url format.\n */\nfunction getOpenGraph({\n\tsocialTitle,\n\tsocialDescription,\n\tsocialImage,\n}: Pick<\n\tCore.Page,\n\t\"socialTitle\" | \"socialDescription\" | \"socialImage\"\n>): Core.Page[\"openGraph\"] {\n\treturn {\n\t\ttype: \"website\",\n\t\ttitle: socialTitle,\n\t\tdescription: socialDescription,\n\t\timage: socialImage ? formatImage(socialImage, 1280, 768) : \"\",\n\t\ttwitterImage: socialImage ? formatImage(socialImage, 1280, 768) : \"\",\n\t};\n}\n\n/**\n * Get the Page metadata object from a page Object.\n *\n * @param params A Page object\n */\nfunction getPageMetaData(params: Core.Page): Core.Page[\"pageMetaData\"] {\n\tconst {\n\t\ttitle,\n\t\tmetaTitle,\n\t\tmetaDescription,\n\t\tcanonicalURL,\n\t\tlocale,\n\t\turl,\n\t\tisIndexed,\n\t\tfollow,\n\t\tmetasAdvanced,\n\t\tpageLanguages,\n\t\tfullUrl,\n\t\tmetaKeywords,\n\t} = params;\n\n\tconst metasAdvancedList =\n\t\tmetasAdvanced\n\t\t\t?.split(\",\")\n\t\t\t.filter(Boolean)\n\t\t\t.map((item) => item.trim().toLowerCase()) || [];\n\n\treturn {\n\t\ttitle: (metaTitle || title || \"\").trim(),\n\t\tdescription: metaDescription,\n\t\tcanonical:\n\t\t\tcanonicalURL && canonicalURL.trim() && canonicalURL !== fullUrl\n\t\t\t\t? canonicalURL.trim()\n\t\t\t\t: isIndexed\n\t\t\t\t\t? fullUrl\n\t\t\t\t\t: undefined,\n\t\tlocale,\n\t\turl,\n\t\tindex: isIndexed ? \"index\" : \"noindex\",\n\t\tfollow: follow ? \"follow\" : \"nofollow\",\n\t\ttranslate: metasAdvancedList.includes(\"notranslate\") ? \"notranslate\" : \"\",\n\t\tmetasAdvanced: metasAdvancedList\n\t\t\t.filter((item) => item !== \"notranslate\")\n\t\t\t.join(),\n\t\tpageLanguages,\n\t\tmetaKeywords: metaKeywords\n\t\t\t?.filter(Boolean)\n\t\t\t.map((keyword) => keyword.replace(/\"/g, \"'\"))\n\t\t\t.join(\", \"),\n\t};\n}\n\n/**\n * Create a Griddo page object\n *\n * @param page A page object ready to pass as content of the `pageContext` to use in the React template.\n * @param additionalInfo Additional page info to pass as content of `pageContext` to use in the React template.\n * @param excludeFromSearch Boolean to avoid this page to be indexed in internal search tool.\n */\nasync function createGriddoPageObject(\n\tpage: GriddoSinglePage | GriddoListPage | GriddoMultiPage,\n\tadditionalInfo: PageAdditionalInfo,\n): Promise<GriddoPageObject> {\n\t// Extract some props from page\n\tconst {\n\t\tid,\n\t\ttitle,\n\t\tfullPath,\n\t\tlanguage: languageId,\n\t\tbreadcrumb,\n\t\tsocialDescription,\n\t\tsocialImage,\n\t\tsocialTitle,\n\t} = page;\n\n\t// Extract some props from additionalInfo\n\tconst {\n\t\tbaseUrl,\n\t\tcloudinaryName,\n\t\tgriddoVersion,\n\t\tsiteLangs,\n\t\tsiteMetadata,\n\t\tsiteOptions,\n\t\tsiteScript,\n\t\tsiteSlug,\n\t\tsocials,\n\t\ttheme,\n\t\tnavigations: { header, footer },\n\t} = additionalInfo;\n\n\t// Update page object\n\tpage.breadcrumb = breadcrumb;\n\tpage.siteSlug = siteSlug;\n\tpage.apiUrl = baseUrl;\n\tpage.publicApiUrl = additionalInfo.publicBaseUrl;\n\tpage.instance = additionalInfo.instance;\n\n\tconst foundLanguage = siteLangs.find(({ id }) => id === page?.language);\n\tconst locale = foundLanguage?.locale.replace(/_/g, \"-\");\n\n\t// Page Metadata\n\tconst pageMetadata = getPageMetaData(page);\n\n\t// Opengraph\n\tconst openGraph = getOpenGraph({\n\t\tsocialDescription,\n\t\tsocialImage,\n\t\tsocialTitle,\n\t});\n\n\tconst pagePath = fullPath.compose;\n\n\tconst renderDate = new Date().toString();\n\n\tconst griddoPageObject: GriddoPageObject = {\n\t\tpath: pagePath,\n\t\tsize: undefined,\n\t\tcontext: {\n\t\t\t// Page\n\t\t\tid,\n\t\t\ttitle,\n\t\t\tfullPath,\n\t\t\tlocale,\n\t\t\tlanguageId,\n\t\t\ttheme,\n\n\t\t\t// PARA <Helmet />\n\t\t\tsiteMetadata,\n\t\t\tpageMetadata,\n\t\t\topenGraph,\n\t\t\tsocials,\n\t\t\tsiteLangs,\n\t\t\tcloudinaryName,\n\t\t\tsiteOptions,\n\t\t\tgriddoVersion,\n\t\t\trenderDate,\n\t\t\tsiteScript,\n\n\t\t\t// Navigation sections\n\t\t\theader,\n\t\t\tfooter,\n\n\t\t\t// Page template\n\t\t\t// En este objeto se est\u00E1 pasando todos los metadatos que vienen en\n\t\t\t// el primer nivel pero el uso de los mismos en CX se hace con la\n\t\t\t// prop `pageMetadata` creada a partir de getPageMetadata. En\n\t\t\t// resumen, se est\u00E1 pasando por duplicado el contenido.\n\t\t\t// TODO: Eliminar las claves de metadata de este objeto page.\n\t\t\tpage,\n\t\t},\n\t};\n\n\treturn griddoPageObject;\n}\n\n/**\n * Create a single Griddo page object.\n *\n * @param page A Griddo single page object.\n * @param additionalInfo Additional page info.\n */\nasync function createGriddoSinglePage(\n\tpage: GriddoSinglePage,\n\tadditionalInfo: PageAdditionalInfo,\n) {\n\treturn await createGriddoPageObject(page, additionalInfo);\n}\n\n/**\n * Create multiples pages from one page as list paginated pages\n */\nasync function createGriddoListPages(\n\t{\n\t\tpage,\n\t\tpages,\n\t\tisRoot = false,\n\t\tdefaultLang,\n\t\ttemplate,\n\t\ttotalQueriedItems,\n\t}: GriddoListPage,\n\tadditionalInfo: PageAdditionalInfo,\n) {\n\tconst allPages = pages.map(async (dataInPage, idx) => {\n\t\tconst isFirstPage = idx === 0;\n\t\tconst pageNumber = idx + 1;\n\t\tconst { domainUrl, compose } = page.fullPath;\n\n\t\t// Crea un id como n\u00FAmero negativo y a\u00F1adiendo un sufijo para los\n\t\t// listados est\u00E1ticos. Esto es as\u00ED para marcarlas y posteriormente\n\t\t// borrarlas siempre en cada nuevo render desde el Adapter.\n\t\t//\n\t\t// id de p\u00E1gina con mode:\"list\": 1546\n\t\t// ids de las \"sub-p\u00E1ginas\": -15460, -15461, -1546n, (-)id(idx)\n\t\t//\n\t\t// @todo eliminar el concepto multipage de CX, deber\u00EDa ser algo core de\n\t\t// Griddo itself: API/AX, que fuesen p\u00E1ginas con sus ids, etc..\n\n\t\tconst paginatedPage = {\n\t\t\t...page,\n\t\t\tid: parseInt(\"-\" + page.id + idx),\n\t\t\tfullPath: {\n\t\t\t\t...page.fullPath,\n\t\t\t\t// Add a page number (tailPageNumber) from page 2 onwards\n\t\t\t\tcompose: addPageNumberToUrl(compose, pageNumber, {\n\t\t\t\t\taddEndingSlash: true,\n\t\t\t\t}),\n\t\t\t},\n\t\t\tfullUrl: addPageNumberToUrl(page.fullUrl, pageNumber, {\n\t\t\t\taddEndingSlash: true,\n\t\t\t}),\n\t\t\tslug: addPageNumberToUrl(page.slug, pageNumber),\n\t\t\ttitle: addPageNumberToTitle(page.title, pageNumber),\n\t\t\tmetaTitle: addPageNumberToTitle(page.metaTitle || \"\", pageNumber),\n\t\t\tdisableHrefLangs: pageNumber > 1,\n\t\t\ttemplate: {\n\t\t\t\t...template,\n\t\t\t\tisFirstPage,\n\t\t\t\tpageNumber,\n\t\t\t\ttotalPages: pages.length,\n\t\t\t\t// The base link, without page number to use in <Pagination />\n\t\t\t\t// component.\n\t\t\t\tbaseLink: `${domainUrl}${compose}`,\n\t\t\t\tqueriedItems: dataInPage,\n\t\t\t\ttotalQueriedItems: totalQueriedItems?.length,\n\t\t\t},\n\t\t\tisRoot,\n\t\t\tdefaultLang,\n\t\t};\n\n\t\treturn await createGriddoPageObject(paginatedPage, additionalInfo);\n\t});\n\n\treturn Promise.all(allPages);\n}\n\n/**\n * Create multiples pages from a MultiPage module\n *\n * @param page A Griddo Multipage object.\n * @param additionalInfo Additional page info.\n */\nfunction createGriddoMultiPages(\n\tpage: GriddoMultiPage,\n\tadditionalInfo: PageAdditionalInfo,\n) {\n\tconst { multiPageElements: multiPageElementsBulk, ...cleanPage } = page;\n\t// TODO: Use structuredClone() when node 18 is available.\n\tconst multiPageElements: MultiPageElements = JSON.parse(\n\t\tJSON.stringify(multiPageElementsBulk),\n\t);\n\n\t// Si no hay un elemento sin slug, como m\u00EDnimo hay que dibujar una p\u00E1gina\n\t// principal para el conjunto de p\u00E1ginas.\n\tif (!multiPageElements.find(({ sectionSlug }) => sectionSlug === \"/\")) {\n\t\tmultiPageElements.push({} as MultiPageElement);\n\t}\n\n\t// Creates each page based on `multiPageElements` from the schema.\n\tconst allPages = multiPageElements.map(async (pageElement, idx) => {\n\t\t// TODO: Use structuredClone() when node 18 is available.\n\t\tconst paginatedPage: APIPageObject = JSON.parse(JSON.stringify(cleanPage));\n\t\tconst {\n\t\t\tsectionSlug = \"/\",\n\t\t\ttitle: bulkTitle = \"\",\n\t\t\tmetaTitle = \"\",\n\t\t\tmetaDescription = \"\",\n\t\t} = pageElement;\n\t\tconst title = typeof bulkTitle === \"string\" ? bulkTitle : bulkTitle.content;\n\t\tconst compose = paginatedPage.fullPath.compose || \"\";\n\t\tconst fullUrl = paginatedPage.fullUrl.endsWith(\"/\")\n\t\t\t? paginatedPage.fullUrl.slice(0, -1)\n\t\t\t: paginatedPage.fullUrl;\n\n\t\tconst cleanSectionSlug = sectionSlug?.replace(/\\//g, \"\");\n\t\tconst isRootSlug = sectionSlug === \"/\";\n\t\tconst rightSectionSlug = isRootSlug\n\t\t\t? cleanSectionSlug\n\t\t\t: cleanSectionSlug + \"/\";\n\n\t\tconst slash = compose.endsWith(\"/\") ? \"\" : \"/\";\n\t\tconst newCompose = `${compose}${slash}${rightSectionSlug}`;\n\n\t\tif (title.trim()) {\n\t\t\tpaginatedPage.title = title;\n\t\t}\n\n\t\tif (metaDescription.trim()) {\n\t\t\tpaginatedPage.metaDescription = metaDescription;\n\t\t}\n\n\t\t// Crea un id como n\u00FAmero negativo y a\u00F1adiendo un sufijo para las multipages.\n\t\t// Esto es as\u00ED para marcarlas y posteriormente borrarlas siempre en cada\n\t\t// nuevo render desde el Adapter.\n\t\t//\n\t\t// id de p\u00E1gina con hasMultipageTrue: 1546\n\t\t// ids de las \"sub-p\u00E1ginas\": -15460, -15461, -1546n, (-)id(idx)\n\t\t//\n\t\t// @todo eliminar el concepto multipage de CX, deber\u00EDa ser algo core de\n\t\t// Griddo itself: API/AX, que fuesen p\u00E1ginas con sus ids, etc..\n\t\tpaginatedPage.id = parseInt(\"-\" + paginatedPage.id + idx);\n\n\t\tpaginatedPage.fullUrl = `${fullUrl}/${rightSectionSlug}`;\n\t\tpaginatedPage.fullPath.compose = newCompose;\n\t\tpaginatedPage.slug = newCompose;\n\t\tpaginatedPage.template.activeSectionSlug = sectionSlug;\n\t\tpaginatedPage.template.activeSectionBase = fullUrl;\n\t\tpaginatedPage.metaTitle =\n\t\t\tmetaTitle.trim() || title.trim() || paginatedPage.metaTitle;\n\n\t\treturn await createGriddoPageObject(paginatedPage, additionalInfo);\n\t});\n\n\treturn Promise.all(allPages);\n}\n\n/**\n * Get the multi pages elements.\n *\n * @param page The page to get the multipage parts.\n */\nfunction getMultiPageElements(\n\tpage: TemplateWithDistributor,\n): Promise<MultiPageElements> | null {\n\tconst multiPageElements = new Promise((resolve) => {\n\t\t// Recursive\n\t\tconst getMultiPageComponent = (\n\t\t\t// No puede ser Core.Page['template'] porque a medida que va bajando en\n\t\t\t// el \u00E1rbol ya no es la estructura de un template.\n\t\t\ttemplate: Record<string, unknown>,\n\t\t\tlevel = 0,\n\t\t) => {\n\t\t\t// If it doesn't have a \"template strcuture\"\n\t\t\tif (!template || typeof template !== \"object\") return;\n\n\t\t\t// For each prop in the \"template\"\n\t\t\tfor (const key in template) {\n\t\t\t\tconst currentComponent = template[key] as {\n\t\t\t\t\tcomponent: string;\n\t\t\t\t\thasGriddoMultiPage: boolean;\n\t\t\t\t\telements: Array<Record<string, unknown>>;\n\t\t\t\t};\n\t\t\t\tconst isValidComponent =\n\t\t\t\t\tcurrentComponent || typeof currentComponent === \"object\";\n\t\t\t\tconst hasGriddoMultiPageProp = JSON.stringify(\n\t\t\t\t\tcurrentComponent,\n\t\t\t\t).includes('\"hasGriddoMultiPage\":true');\n\n\t\t\t\tif (!isValidComponent) continue;\n\n\t\t\t\tif (!hasGriddoMultiPageProp) continue;\n\n\t\t\t\tconst { component, hasGriddoMultiPage, elements } = currentComponent;\n\n\t\t\t\tif (component && hasGriddoMultiPage) resolve(elements || []);\n\n\t\t\t\t// Recursive call\n\t\t\t\tgetMultiPageComponent(currentComponent, level + 1);\n\t\t\t}\n\n\t\t\t// resolve promise when...\n\t\t\tif (!level) resolve(null);\n\t\t};\n\n\t\t// `page` en un array para que tambi\u00E9n revise la propia template como objeto.\n\t\t// @ts-expect-error remove the array\n\t\tgetMultiPageComponent([page]);\n\t});\n\n\treturn multiPageElements as Promise<MultiPageElements>;\n}\n\n// -----------------------------------------------------------------------------\n// Private functions\n// -----------------------------------------------------------------------------\n\n/**\n * Get `itemsPerPage` elements from the `items` using as offset `page` number.\n * It's a kind of paginator for an array.\n *\n * @param itemsPerPage The items per page.\n * @param items An array of items, the queriedData.\n * @param page The page to be returned.\n *\n * @example\n * getPage(3, [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\"], 2)\n * // -> [\"d\", \"e\", \"f\"]\n */\nfunction getPage(\n\titemsPerPage: number,\n\titems: Array<Fields.QueriedDataItem>,\n\tpage: number,\n) {\n\treturn items?.slice(itemsPerPage * (page - 1), itemsPerPage * page);\n}\n\n/**\n * Takes an array of items and split it grouping in arrays of pages based on `itemsPerPage`.\n *\n * @param itemsPerPage The items per page.\n * @param items An array of items, the queriedData.\n *\n * @example\n * getPageCluster(3, [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\"])\n * // -> [[\"a\", \"b\", \"c\"], [\"d\", \"e\", \"f\"], [\"g\", \"h\"]]\n */\nfunction getPageCluster(\n\titemsPerPage: number,\n\titems: Array<Fields.QueriedDataItem>,\n) {\n\tconst totalPagesCount = Math.ceil(items.length / itemsPerPage) || 1;\n\tconst pageNumbers = Array.from({ length: totalPagesCount }, (_, i) => i + 1);\n\n\treturn pageNumbers?.map((pageNumber) =>\n\t\tgetPage(itemsPerPage, items, pageNumber),\n\t);\n}\n\n/**\n * Takes a template object and split the whole queriedItems into separated queriedItems to use in Griddo static list templates.\n *\n * @param listTemplate A template schema with the distributor data included.\n */\nfunction getPaginatedPages(listTemplate: TemplateWithDistributor) {\n\tconst items = listTemplate.queriedItems || [];\n\tconst itemsPerPage =\n\t\tlistTemplate?.itemsPerPage || DEFAULT_ITEMS_PER_PAGE_FOR_LIST_TEMPLATES;\n\tconst pageClusters = getPageCluster(itemsPerPage, items);\n\n\treturn pageClusters;\n}\n\n/**\n * Remove duplicate ending trailing character from a string\n *\n * @param url the strin url\n * @example\n * removeDuplicateTrailingSlash('http://griddo.com/foo/bar//')\n * // -> http://griddo.com/foo/bar/\n */\nfunction removeDuplicateTrailing(url: string) {\n\treturn url.replace(/\\/+$/, \"/\");\n}\n\n/**\n * Adds a number to an URL adding optionally an ending slash.\n *\n * @param url The url.\n * @param pageNumber A number to be added to the url.\n * @param options.addEndingSlash Boolean that indicates if return the final url with an end slash or not.\n *\n * @example\n * addPageNumberToUrl(\"web.com\", 3) // \"web.com/3\"\n * addPageNumberToUrl(\"web.com\", 3, { addEndingSlash: true }) // \"web.com/3/\"\n */\nfunction addPageNumberToUrl(\n\turl: string,\n\tpageNumber: number,\n\toptions?: { addEndingSlash: boolean },\n) {\n\tconst trailingSlash = url.endsWith(\"/\") ? \"\" : \"/\";\n\tconst endingSlash = options?.addEndingSlash ? \"/\" : \"\";\n\n\tif (pageNumber <= 1) {\n\t\treturn removeDuplicateTrailing(`${url}${endingSlash}`);\n\t}\n\n\treturn removeDuplicateTrailing(\n\t\t`${url}${trailingSlash}${pageNumber}${endingSlash}`,\n\t);\n}\n\n/**\n * Adds a number to an string with the format \"string - number\"\n *\n * @param title The title\n * @param pageNumber A number to be added to the title.\n *\n * @example\n * addPageNumberToTitle(\"The page\", 3) // \"The page - 3\"\n */\nfunction addPageNumberToTitle(title: string, pageNumber: number) {\n\tif (!title || pageNumber <= 1) {\n\t\treturn title;\n\t}\n\n\treturn `${title} - ${pageNumber}`;\n}\n\nexport {\n\tcreateGriddoListPages,\n\tcreateGriddoMultiPages,\n\tcreateGriddoSinglePage,\n\tgetMultiPageElements,\n\tgetPaginatedPages,\n};\n", "import type { Fields } from \"@griddo/core\";\n\n/**\n * Format Cloudinary or DAM URL\n *\n * @param image The image url\n * @param width With of the image\n * @param height Height of the image\n * @param format Format of the image\n * @returns A composed URL for the Cloudinary or DAM service\n */\nfunction formatImage(\n\timage: Fields.Image | string,\n\twidth: number,\n\theight: number,\n\tformat = \"jpg\",\n) {\n\tconst url = typeof image === \"string\" ? image : image?.url;\n\n\tif (!url) {\n\t\treturn null;\n\t}\n\n\tconst isCloudinary = url.split(\"/\")[2].includes(\"cloudinary.com\");\n\n\treturn isCloudinary\n\t\t? addCloudinaryParams(url, `c_fill,w_${width},h_${height}`)\n\t\t: addGriddoDamParams(url, `f/${format}/w/${width}/h/${height}`);\n}\n\n/**\n * Format Griddo DAM image url.\n */\nfunction addGriddoDamParams(image: string, params: string) {\n\tconst urlParts = image.split(\"/\");\n\tconst imagePath = urlParts.slice(0, -1).join(\"/\");\n\tconst imageName = urlParts.slice(-1)[0];\n\n\treturn `${imagePath}/${params}/${imageName}`;\n}\n\n/**\n * Take a cloudinary url and add query params.\n */\nfunction addCloudinaryParams(image: string, params: string) {\n\tconst plainUrl = image.replace(\"https://\", \"\");\n\tconst head = plainUrl.split(\"/\").slice(0, 4).join(\"/\");\n\tconst fullId = plainUrl.replace(head, \"\");\n\n\treturn `https://${head}/${params}${fullId}`;\n}\n\nexport { formatImage };\n", "import { createAPICacheDir } from \"./cache\";\nimport { sanitizeAPICacheDir } from \"./core-utils\";\nimport { createStore } from \"../services/store\";\n\n/**\n * Download all data: sites, pages etc.. from the instance private Griddo API.\n * Then you can use the generator funcion `getBuildPagesFromStore()` to get the pages and\n * `getBuildMetadata()` to get build and sites metadata as objects. Both from\n * exporter utils sites dir.\n */\nasync function createBuildData(domain: string) {\n\tcreateAPICacheDir();\n\tawait createStore(domain);\n\tsanitizeAPICacheDir();\n}\n\nexport { createBuildData };\n", "import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { getConfig } from \"./core-utils\";\nimport { throwError } from \"../errors\";\nimport { RenderUUIDError } from \"../errors/errors-data\";\n\nconst config = getConfig();\n\n/**\n * Creates a sentinel file with the current date and time.\n * This file is used to track later if node_modules/@griddo/cx was cleaned by a\n * npm install from a deploy.\n */\nfunction createSentinelRenderFile() {\n\tconst { __cx } = config.paths();\n\tconst renderSentinelFile = path.join(__cx, \".render-sentinel\");\n\tfs.writeFileSync(renderSentinelFile, new Date().toISOString());\n}\n\nfunction deleteSentinelRenderFile() {\n\tconst { __cx } = config.paths();\n\tconst renderSentinelFile = path.join(__cx, \".render-sentinel\");\n\tfs.unlinkSync(renderSentinelFile);\n}\n\nfunction isValidRenderProcessOrThrow() {\n\tconst { __cx } = config.paths();\n\tconst renderSentinelFile = path.join(__cx, \".render-sentinel\");\n\tif (!fs.existsSync(renderSentinelFile)) {\n\t\tthrowError(RenderUUIDError);\n\t}\n}\n\nfunction initRender() {\n\tcreateSentinelRenderFile();\n}\n\nfunction finishRender() {\n\treturn undefined;\n}\n\nexport {\n\tfinishRender,\n\tinitRender,\n\tisValidRenderProcessOrThrow,\n\tcreateSentinelRenderFile,\n\tdeleteSentinelRenderFile,\n};\n", "import type { ErrorsType } from \"./errors-data\";\n\nimport { boxLog } from \"../utils/loggin\";\n\nexport type ErrorData = {\n\tid: number;\n\terror: ErrorsType;\n\tmessage: string;\n\texpected?: string;\n\thint?: string;\n};\n\nclass RenderError extends Error {\n\tconstructor() {\n\t\tsuper();\n\t\tthis.name = \"InternalCXError\";\n\t\tthis.stack = \"\";\n\t}\n}\n\n/**\n * Throws an error with the provided error message, expected value, and hint.\n */\nfunction throwError({ error, message, expected = \"\", hint = \"\" }: ErrorData) {\n\tconst errorMessage = [message, expected, hint].filter(Boolean).join(\"\\n\");\n\n\tboxLog(errorMessage, error, 1, 0);\n\tthrow new RenderError();\n}\n\nexport { throwError };\n", "/**\n * Do you want to add a new error to the list?\n *\n * 1 - Add the new error type name to the `ErrorsType` union type.\n * 2 - Export a new ErrorData object in this file by completing\n * the `error` and `message` properties obligatorily.\n *\n */\n\nimport { ErrorData } from \".\";\n\nexport type ErrorsType =\n\t| \"NoDomainsFoundError\"\n\t| \"RenderUUIDError\"\n\t| \"DistributorSourcesNotFoundError\";\n\nexport const NoDomainsFoundError: ErrorData = {\n\tid: 100,\n\terror: \"NoDomainsFoundError\",\n\tmessage: \"No domains found in this instance. The process cannot continue.\",\n\texpected:\n\t\t\"This can happen if the API is not functioning or the site is not properly configured, or the domains are not registered.\",\n\thint: \"You can contact the instance administrator.\",\n};\n\nexport const RenderUUIDError: ErrorData = {\n\tid: 101,\n\terror: \"RenderUUIDError\",\n\tmessage: `Render sentinel file does not exist.\nThe rendering uuid cannot be read safely.\nThere was probably a instance deployment during the render and files were deleted.\n\nThe files generated in this render will not be published.`,\n};\n\nexport const DistributorSourcesNotFoundError: ErrorData = {\n\tid: 102,\n\terror: \"DistributorSourcesNotFoundError\",\n\tmessage: \"El distribuidor no tiene souces definidos.\",\n\texpected:\n\t\t\"Se espera que al menos tenga un fuente de datos en la propiedad `sources`, aunque est\u00E9 vac\u00EDa.\",\n};\n", "import type { Domains } from \"../types/global\";\n\nimport { endpoints } from \"../constants\";\nimport { get } from \"../utils/api\";\n\n/**\n * Get an array of domains availables.\n */\nclass DomainsService {\n\tstatic async getAll() {\n\t\treturn await get<Domains>({ endpoint: endpoints.DOMAINS });\n\t}\n}\n\nexport { DomainsService };\n", "import type { Domains } from \"../types/global\";\n\nimport { verboseLog } from \"./loggin\";\nimport { throwError } from \"../errors\";\nimport { NoDomainsFoundError } from \"../errors/errors-data\";\nimport { AuthService } from \"../services/auth\";\nimport { DomainsService } from \"../services/domains\";\n\n/**\n * Return an array of domains name (string) of the current instance.\n */\nasync function getInstanceDomainsOrThrow() {\n\tawait AuthService.login();\n\tconst domains = await DomainsService.getAll();\n\n\tif (!domains.length) {\n\t\tthrowError(NoDomainsFoundError);\n\t}\n\n\tverboseLog(`getting domains names (${domains.length})`);\n\n\treturn getDomainSlugs(domains);\n}\n\n/**\n * Return an array of domains name (string) of the current instance.\n */\nasync function getInstanceDomains() {\n\tawait AuthService.login();\n\tconst domains = await DomainsService.getAll();\n\n\tverboseLog(`Getting domains slugs (${domains.length})`);\n\n\treturn getDomainSlugs(domains);\n}\n\n/**\n * Return an unique array of domains, filtered without \"/\".\n *\n * @param domains An array of domains\n * @see Domains\n */\nfunction getDomainSlugs(domains: Domains) {\n\tconst filteredDomains = domains\n\t\t.filter(({ slug }) => !!slug)\n\t\t.map(({ slug }) => slug.replace(\"/\", \"\"));\n\n\treturn [...new Set(filteredDomains)];\n}\n\nexport { getInstanceDomains, getInstanceDomainsOrThrow };\n"],
5
+ "mappings": ";4qBAAA,IAAAA,GAAAC,EAAA,CAAAC,GAAAC,KAAA,CAuBA,IAAMC,G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,EAAG,CAC3D,IAAMC,EAAkBD,GAAY,IAAI,sBAAsB,EAE9DE,GAAS;AAAA;AAAA,CAA4B,EACrCA,GAASD,CAAe,EACxBC,GAAS,EAETC,GAAY,CACX,YAAa,yCACb,KAAM,SACN,MAAO,IACP,SAAU,CACT,OAAQF,EACR,KAAM,IAAI,KAAK,EAAE,YAAY,CAC9B,CACD,CAAC,EAEH,CgC5IA,IAAMG,GAAN,KAAqB,CACpB,aAAa,QAAS,CACrB,OAAO,MAAMC,GAAa,CAAE,SAAUC,GAAU,OAAQ,CAAC,CAC1D,CACD,ECDA,eAAeC,IAA4B,CAC1C,MAAMC,GAAY,MAAM,EACxB,IAAMC,EAAU,MAAMC,GAAe,OAAO,EAE5C,OAAKD,EAAQ,QACZE,GAAWC,EAAmB,EAG/BC,GAAW,0BAA0BJ,EAAQ,SAAS,EAE/CK,GAAeL,CAAO,CAC9B,CAoBA,SAASM,GAAeC,EAAkB,CACzC,IAAMC,EAAkBD,EACtB,OAAO,CAAC,CAAE,KAAAE,CAAK,IAAM,CAAC,CAACA,CAAI,EAC3B,IAAI,CAAC,CAAE,KAAAA,CAAK,IAAMA,EAAK,QAAQ,IAAK,EAAE,CAAC,EAEzC,MAAO,CAAC,GAAG,IAAI,IAAID,CAAe,CAAC,CACpC,ClCxCA,eAAeE,IAAc,CAC5B,GAAI,CACH,IAAMC,EAAU,MAAMC,GAA0B,EAC1CC,EAAU,MAAMC,GAAqB,CAC1C,IAAMC,GAAiBJ,CAAO,CAC/B,CAAC,EAEDK,GAAO,2BAA2BH,MAAa,GAAI,EAAG,CAAC,EAEvD,QAAQ,KAAK,CAAC,CACf,OAASI,EAAP,CACD,QAAQ,IAAIA,CAAK,EAEjB,QAAQ,KAAK,CAAC,CACf,CACD",
6
+ "names": ["require_main", "__commonJSMin", "exports", "module", "fs", "path", "log", "message", "NEWLINE", "RE_INI_KEY_VAL", "RE_NEWLINES", "NEWLINES_MATCH", "parse", "src", "options", "debug", "obj", "line", "idx", "keyValueArr", "key", "val", "end", "isDoubleQuoted", "config", "dotenvPath", "encoding", "parsed", "e", "require_universalify", "__commonJSMin", "exports", "fn", "args", "resolve", "reject", "err", "res", "cb", "r", "require_polyfills", "__commonJSMin", "exports", "module", "constants", "origCwd", "cwd", "platform", "chdir", "d", "patch", "fs", "patchLchmod", "patchLutimes", "chownFix", "chmodFix", "chownFixSync", "chmodFixSync", "statFix", "statFixSync", "path", "mode", "cb", "uid", "gid", "fs$rename", "rename", "from", "to", "start", "backoff", "CB", "er", "stater", "st", "fs$read", "read", "fd", "buffer", "offset", "length", "position", "callback_", "callback", "eagCounter", "_", "__", "fs$readSync", "err", "err2", "threw", "ret", "at", "mt", "er2", "_a", "_b", "_c", "orig", "target", "chownErOk", "options", "stats", "nonroot", "require_legacy_streams", "__commonJSMin", "exports", "module", "Stream", "legacy", "fs", "ReadStream", "WriteStream", "path", "options", "self", "keys", "index", "length", "key", "err", "fd", "require_clone", "__commonJSMin", "exports", "module", "clone", "getPrototypeOf", "obj", "copy", "key", "require_graceful_fs", "__commonJSMin", "exports", "module", "fs", "polyfills", "legacy", "clone", "util", "gracefulQueue", "previousSymbol", "noop", "publishQueue", "context", "queue", "debug", "m", "fs$close", "close", "fd", "cb", "err", "resetQueue", "fs$closeSync", "closeSync", "patch", "createReadStream", "createWriteStream", "fs$readFile", "readFile", "path", "options", "go$readFile", "startTime", "enqueue", "fs$writeFile", "writeFile", "data", "go$writeFile", "fs$appendFile", "appendFile", "go$appendFile", "fs$copyFile", "copyFile", "src", "dest", "flags", "go$copyFile", "fs$readdir", "readdir", "noReaddirOptionVersions", "go$readdir", "fs$readdirCallback", "files", "legStreams", "ReadStream", "WriteStream", "fs$ReadStream", "ReadStream$open", "fs$WriteStream", "WriteStream$open", "val", "FileReadStream", "FileWriteStream", "that", "open", "fs$open", "mode", "go$open", "elem", "retry", "retryTimer", "now", "i", "fn", "args", "lastTime", "sinceAttempt", "sinceStart", "desiredDelay", "require_fs", "__commonJSMin", "exports", "u", "fs", "api", "key", "method", "filename", "callback", "resolve", "fd", "buffer", "offset", "length", "position", "reject", "err", "bytesRead", "args", "bytesWritten", "buffers", "require_at_least_node", "__commonJSMin", "exports", "module", "r", "n", "x", "require_make_dir", "__commonJSMin", "exports", "module", "fs", "path", "atLeastNode", "useNativeRecursiveOption", "checkPath", "pth", "error", "processOptions", "options", "defaults", "permissionError", "input", "make", "require_mkdirs", "__commonJSMin", "exports", "module", "u", "_makeDir", "makeDirSync", "makeDir", "require_utimes", "__commonJSMin", "exports", "module", "fs", "utimesMillis", "path", "atime", "mtime", "callback", "err", "fd", "futimesErr", "closeErr", "utimesMillisSync", "require_stat", "__commonJSMin", "exports", "module", "fs", "path", "util", "atLeastNode", "nodeSupportsBigInt", "stat", "file", "statSync", "getStats", "src", "dest", "err", "srcStat", "destStat", "getStatsSync", "checkPaths", "funcName", "cb", "stats", "areIdentical", "isSrcSubdir", "errMsg", "checkPathsSync", "checkParentPaths", "srcParent", "destParent", "callback", "checkParentPathsSync", "srcArr", "destArr", "acc", "cur", "i", "require_copy_sync", "__commonJSMin", "exports", "module", "fs", "path", "mkdirsSync", "utimesMillisSync", "stat", "copySync", "src", "dest", "opts", "srcStat", "destStat", "handleFilterAndCopy", "destParent", "startCopy", "getStats", "onDir", "onFile", "onLink", "mayCopyFile", "copyFile", "handleTimestamps", "setDestMode", "srcMode", "fileIsNotWritable", "makeFileWritable", "setDestTimestamps", "updatedSrcStat", "mkDirAndCopy", "copyDir", "item", "copyDirItem", "srcItem", "destItem", "resolvedSrc", "resolvedDest", "err", "copyLink", "require_copy_sync", "__commonJSMin", "exports", "module", "require_path_exists", "__commonJSMin", "exports", "module", "u", "fs", "pathExists", "path", "require_copy", "__commonJSMin", "exports", "module", "fs", "path", "mkdirs", "pathExists", "utimesMillis", "stat", "copy", "src", "dest", "opts", "cb", "err", "stats", "srcStat", "destStat", "handleFilter", "checkParentDir", "destParent", "dirExists", "startCopy", "onInclude", "include", "error", "getStats", "onDir", "onFile", "onLink", "mayCopyFile", "copyFile", "handleTimestampsAndMode", "setDestMode", "srcMode", "fileIsNotWritable", "makeFileWritable", "setDestTimestampsAndMode", "setDestTimestamps", "updatedSrcStat", "copyDir", "mkDirAndCopy", "items", "copyDirItems", "item", "copyDirItem", "srcItem", "destItem", "resolvedSrc", "resolvedDest", "copyLink", "require_copy", "__commonJSMin", "exports", "module", "u", "require_rimraf", "__commonJSMin", "exports", "module", "fs", "path", "assert", "isWindows", "defaults", "options", "m", "rimraf", "p", "cb", "busyTries", "rimraf_", "CB", "er", "time", "st", "fixWinEPERM", "rmdir", "er2", "er3", "stats", "fixWinEPERMSync", "rmdirSync", "originalEr", "rmkids", "files", "n", "errState", "f", "rimrafSync", "rmkidsSync", "startTime", "require_remove", "__commonJSMin", "exports", "module", "u", "rimraf", "require_empty", "__commonJSMin", "exports", "module", "u", "fs", "path", "mkdir", "remove", "emptyDir", "dir", "callback", "err", "items", "item", "deleteItem", "emptyDirSync", "require_file", "__commonJSMin", "exports", "module", "u", "path", "fs", "mkdir", "createFile", "file", "callback", "makeFile", "err", "stats", "dir", "createFileSync", "require_link", "__commonJSMin", "exports", "module", "u", "path", "fs", "mkdir", "pathExists", "createLink", "srcpath", "dstpath", "callback", "makeLink", "err", "destinationExists", "dir", "dirExists", "createLinkSync", "require_symlink_paths", "__commonJSMin", "exports", "module", "path", "fs", "pathExists", "symlinkPaths", "srcpath", "dstpath", "callback", "err", "dstdir", "relativeToDst", "exists", "symlinkPathsSync", "require_symlink_type", "__commonJSMin", "exports", "module", "fs", "symlinkType", "srcpath", "type", "callback", "err", "stats", "symlinkTypeSync", "require_symlink", "__commonJSMin", "exports", "module", "u", "path", "fs", "_mkdirs", "mkdirs", "mkdirsSync", "_symlinkPaths", "symlinkPaths", "symlinkPathsSync", "_symlinkType", "symlinkType", "symlinkTypeSync", "pathExists", "createSymlink", "srcpath", "dstpath", "type", "callback", "err", "destinationExists", "relative", "dir", "dirExists", "createSymlinkSync", "require_ensure", "__commonJSMin", "exports", "module", "file", "link", "symlink", "require_utils", "__commonJSMin", "exports", "module", "stringify", "obj", "EOL", "finalEOL", "replacer", "spaces", "EOF", "stripBom", "content", "require_jsonfile", "__commonJSMin", "exports", "module", "_fs", "universalify", "stringify", "stripBom", "_readFile", "file", "options", "fs", "shouldThrow", "data", "obj", "err", "readFile", "readFileSync", "content", "_writeFile", "str", "writeFile", "writeFileSync", "jsonfile", "require_jsonfile", "__commonJSMin", "exports", "module", "jsonFile", "require_output", "__commonJSMin", "exports", "module", "u", "fs", "path", "mkdir", "pathExists", "outputFile", "file", "data", "encoding", "callback", "dir", "err", "itDoes", "outputFileSync", "args", "require_output_json", "__commonJSMin", "exports", "module", "stringify", "outputFile", "outputJson", "file", "data", "options", "str", "require_output_json_sync", "__commonJSMin", "exports", "module", "stringify", "outputFileSync", "outputJsonSync", "file", "data", "options", "str", "require_json", "__commonJSMin", "exports", "module", "u", "jsonFile", "require_move_sync", "__commonJSMin", "exports", "module", "fs", "path", "copySync", "removeSync", "mkdirpSync", "stat", "moveSync", "src", "dest", "opts", "overwrite", "srcStat", "doRename", "rename", "err", "moveAcrossDevice", "require_move_sync", "__commonJSMin", "exports", "module", "require_move", "__commonJSMin", "exports", "module", "fs", "path", "copy", "remove", "mkdirp", "pathExists", "stat", "move", "src", "dest", "opts", "cb", "overwrite", "err", "stats", "srcStat", "doRename", "rename", "destExists", "moveAcrossDevice", "require_move", "__commonJSMin", "exports", "module", "u", "require_lib", "__commonJSMin", "exports", "module", "fs", "require_escape_string_regexp", "__commonJSMin", "exports", "module", "matchOperatorsRe", "str", "require_color_name", "__commonJSMin", "exports", "module", "require_conversions", "__commonJSMin", "exports", "module", "cssKeywords", "reverseKeywords", "key", "convert", "model", "channels", "labels", "rgb", "r", "g", "b", "min", "max", "delta", "h", "s", "l", "rdif", "gdif", "bdif", "v", "diff", "diffc", "c", "w", "m", "y", "k", "comparativeDistance", "x", "reversed", "currentClosestDistance", "currentClosestKeyword", "keyword", "value", "distance", "z", "xyz", "a", "hsl", "t1", "t2", "t3", "val", "i", "smin", "lmin", "sv", "hsv", "hi", "f", "p", "q", "t", "vmin", "sl", "hwb", "wh", "bl", "ratio", "n", "cmyk", "lab", "y2", "x2", "z2", "hr", "lch", "args", "ansi", "color", "mult", "rem", "integer", "string", "match", "colorString", "char", "chroma", "grayscale", "hue", "hcg", "pure", "mg", "apple", "gray", "require_route", "__commonJSMin", "exports", "module", "conversions", "buildGraph", "graph", "models", "len", "i", "deriveBFS", "fromModel", "queue", "current", "adjacents", "adjacent", "node", "link", "from", "to", "args", "wrapConversion", "toModel", "path", "fn", "cur", "conversion", "require_color_convert", "__commonJSMin", "exports", "module", "conversions", "route", "convert", "models", "wrapRaw", "fn", "wrappedFn", "args", "wrapRounded", "result", "len", "i", "fromModel", "routes", "routeModels", "toModel", "require_ansi_styles", "__commonJSMin", "exports", "module", "colorConvert", "wrapAnsi16", "fn", "offset", "wrapAnsi256", "code", "wrapAnsi16m", "rgb", "assembleStyles", "codes", "styles", "groupName", "group", "styleName", "style", "ansi2ansi", "n", "rgb2rgb", "r", "g", "b", "key", "suite", "require_has_flag", "__commonJSMin", "exports", "module", "flag", "argv", "prefix", "pos", "terminatorPos", "require_supports_color", "__commonJSMin", "exports", "module", "os", "hasFlag", "env", "forceColor", "translateLevel", "level", "supportsColor", "stream", "min", "osRelease", "sign", "version", "getSupportLevel", "require_templates", "__commonJSMin", "exports", "module", "TEMPLATE_REGEX", "STYLE_REGEX", "STRING_REGEX", "ESCAPE_REGEX", "ESCAPES", "unescape", "c", "parseArguments", "name", "args", "results", "chunks", "matches", "chunk", "m", "escape", "chr", "parseStyle", "style", "buildStyle", "chalk", "styles", "enabled", "layer", "current", "styleName", "tmp", "escapeChar", "inverse", "close", "str", "errMsg", "require_chalk", "__commonJSMin", "exports", "module", "escapeStringRegexp", "ansiStyles", "stdoutColor", "template", "isSimpleWindowsTerm", "levelMapping", "skipModels", "styles", "applyOptions", "obj", "options", "scLevel", "Chalk", "chalk", "args", "chalkTag", "key", "codes", "build", "model", "level", "bgModel", "proto", "_styles", "_empty", "builder", "applyStyle", "self", "enabled", "argsLen", "str", "a", "originalDim", "code", "strings", "parts", "require_yocto_queue", "__commonJSMin", "exports", "module", "Node", "value", "Queue", "node", "current", "require_p_limit", "__commonJSMin", "exports", "module", "Queue", "pLimit", "concurrency", "queue", "activeCount", "next", "run", "fn", "resolve", "args", "result", "enqueue", "generator", "require_p_locate", "__commonJSMin", "exports", "module", "pLimit", "EndError", "value", "testElement", "element", "tester", "finder", "values", "pLocate", "iterable", "options", "limit", "items", "checkLimit", "error", "require_locate_path", "__commonJSMin", "exports", "module", "path", "fs", "promisify", "pLocate", "fsStat", "fsLStat", "typeMappings", "checkType", "type", "matchType", "stat", "paths", "options", "statFn", "path_", "require_path_exists", "__commonJSMin", "exports", "module", "fs", "promisify", "pAccess", "path", "require_find_up", "__commonJSMin", "exports", "module", "path", "locatePath", "pathExists", "stop", "name", "options", "directory", "root", "paths", "runMatcher", "locateOptions", "foundPath", "require_pkg_dir", "__commonJSMin", "exports", "module", "path", "findUp", "pkgDir", "cwd", "filePath", "require_kleur", "__commonJSMin", "exports", "module", "FORCE_COLOR", "NODE_DISABLE_COLORS", "TERM", "$", "init", "run", "arr", "str", "i", "tmp", "beg", "end", "chain", "has", "keys", "ctx", "open", "close", "blk", "txt", "require_react_production_min", "__commonJSMin", "exports", "l", "n", "p", "q", "r", "t", "u", "v", "w", "x", "y", "z", "A", "a", "B", "C", "D", "E", "b", "e", "F", "G", "H", "I", "J", "K", "L", "M", "d", "c", "k", "h", "g", "f", "m", "N", "O", "escape", "P", "Q", "R", "S", "T", "U", "V", "W", "require_react_development", "__commonJSMin", "exports", "module", "ReactVersion", "REACT_ELEMENT_TYPE", "REACT_PORTAL_TYPE", "REACT_FRAGMENT_TYPE", "REACT_STRICT_MODE_TYPE", "REACT_PROFILER_TYPE", "REACT_PROVIDER_TYPE", "REACT_CONTEXT_TYPE", "REACT_FORWARD_REF_TYPE", "REACT_SUSPENSE_TYPE", "REACT_SUSPENSE_LIST_TYPE", "REACT_MEMO_TYPE", "REACT_LAZY_TYPE", "REACT_OFFSCREEN_TYPE", "MAYBE_ITERATOR_SYMBOL", "FAUX_ITERATOR_SYMBOL", "getIteratorFn", "maybeIterable", "maybeIterator", "ReactCurrentDispatcher", "ReactCurrentBatchConfig", "ReactCurrentActQueue", "ReactCurrentOwner", "ReactDebugCurrentFrame", "currentExtraStackFrame", "setExtraStackFrame", "stack", "impl", "enableScopeAPI", "enableCacheElement", "enableTransitionTracing", "enableLegacyHidden", "enableDebugTracing", "ReactSharedInternals", "warn", "format", "_len", "args", "_key", "printWarning", "error", "_len2", "_key2", "level", "argsWithFormat", "item", "didWarnStateUpdateForUnmountedComponent", "warnNoop", "publicInstance", "callerName", "_constructor", "componentName", "warningKey", "ReactNoopUpdateQueue", "callback", "completeState", "partialState", "assign", "emptyObject", "Component", "props", "context", "updater", "deprecatedAPIs", "defineDeprecationWarning", "methodName", "info", "fnName", "ComponentDummy", "PureComponent", "pureComponentPrototype", "createRef", "refObject", "isArrayImpl", "isArray", "a", "typeName", "value", "hasToStringTag", "type", "willCoercionThrow", "testStringCoercion", "checkKeyStringCoercion", "getWrappedName", "outerType", "innerType", "wrapperName", "displayName", "functionName", "getContextName", "getComponentNameFromType", "provider", "outerName", "lazyComponent", "payload", "init", "hasOwnProperty", "RESERVED_PROPS", "specialPropKeyWarningShown", "specialPropRefWarningShown", "didWarnAboutStringRefs", "hasValidRef", "config", "getter", "hasValidKey", "defineKeyPropWarningGetter", "warnAboutAccessingKey", "defineRefPropWarningGetter", "warnAboutAccessingRef", "warnIfStringRefCannotBeAutoConverted", "ReactElement", "key", "ref", "self", "source", "owner", "element", "createElement", "children", "propName", "childrenLength", "childArray", "i", "defaultProps", "cloneAndReplaceKey", "oldElement", "newKey", "newElement", "cloneElement", "isValidElement", "object", "SEPARATOR", "SUBSEPARATOR", "escape", "escapeRegex", "escaperLookup", "escapedString", "match", "didWarnAboutMaps", "userProvidedKeyEscapeRegex", "escapeUserProvidedKey", "text", "getElementKey", "index", "mapIntoArray", "array", "escapedPrefix", "nameSoFar", "invokeCallback", "_child", "mappedChild", "childKey", "escapedChildKey", "c", "child", "nextName", "subtreeCount", "nextNamePrefix", "iteratorFn", "iterableChildren", "iterator", "step", "ii", "childrenString", "mapChildren", "func", "result", "count", "countChildren", "n", "forEachChildren", "forEachFunc", "forEachContext", "toArray", "onlyChild", "createContext", "defaultValue", "hasWarnedAboutUsingNestedContextConsumers", "hasWarnedAboutUsingConsumerProvider", "hasWarnedAboutDisplayNameOnConsumer", "Consumer", "_Provider", "_currentValue", "_currentValue2", "_threadCount", "Uninitialized", "Pending", "Resolved", "Rejected", "lazyInitializer", "ctor", "thenable", "moduleObject", "resolved", "rejected", "pending", "lazy", "lazyType", "propTypes", "newDefaultProps", "newPropTypes", "forwardRef", "render", "elementType", "ownName", "name", "REACT_MODULE_REFERENCE", "isValidElementType", "memo", "compare", "resolveDispatcher", "dispatcher", "useContext", "Context", "realContext", "useState", "initialState", "useReducer", "reducer", "initialArg", "useRef", "initialValue", "useEffect", "create", "deps", "useInsertionEffect", "useLayoutEffect", "useCallback", "useMemo", "useImperativeHandle", "useDebugValue", "formatterFn", "useTransition", "useDeferredValue", "useId", "useSyncExternalStore", "subscribe", "getSnapshot", "getServerSnapshot", "disabledDepth", "prevLog", "prevInfo", "prevWarn", "prevError", "prevGroup", "prevGroupCollapsed", "prevGroupEnd", "disabledLog", "disableLogs", "reenableLogs", "ReactCurrentDispatcher$1", "prefix", "describeBuiltInComponentFrame", "ownerFn", "x", "reentry", "componentFrameCache", "PossiblyWeakMap", "describeNativeComponentFrame", "fn", "construct", "frame", "control", "previousPrepareStackTrace", "previousDispatcher", "Fake", "sample", "sampleLines", "controlLines", "s", "_frame", "syntheticFrame", "describeFunctionComponentFrame", "shouldConstruct", "prototype", "describeUnknownElementTypeFrameInDEV", "loggedTypeFailures", "ReactDebugCurrentFrame$1", "setCurrentlyValidatingElement", "checkPropTypes", "typeSpecs", "values", "location", "has", "typeSpecName", "error$1", "err", "ex", "setCurrentlyValidatingElement$1", "propTypesMisspellWarningShown", "getDeclarationErrorAddendum", "getSourceInfoErrorAddendum", "fileName", "lineNumber", "getSourceInfoErrorAddendumForProps", "elementProps", "ownerHasKeyUseWarning", "getCurrentComponentErrorInfo", "parentType", "parentName", "validateExplicitKey", "currentComponentErrorInfo", "childOwner", "validateChildKeys", "node", "validatePropTypes", "_name", "validateFragmentProps", "fragment", "keys", "createElementWithValidation", "validType", "sourceInfo", "typeString", "didWarnAboutDeprecatedCreateFactory", "createFactoryWithValidation", "validatedFactory", "cloneElementWithValidation", "startTransition", "scope", "options", "prevTransition", "currentTransition", "updatedFibersCount", "didWarnAboutMessageChannel", "enqueueTaskImpl", "enqueueTask", "task", "requireString", "nodeRequire", "channel", "actScopeDepth", "didWarnNoAwaitAct", "act", "prevActScopeDepth", "prevIsBatchingLegacy", "queue", "flushActQueue", "popActScope", "thenableResult", "wasAwaited", "resolve", "reject", "returnValue", "recursivelyFlushAsyncActWork", "_queue", "_thenable", "_thenable2", "isFlushing", "createElement$1", "cloneElement$1", "createFactory", "Children", "require_react", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "validateChar", "str", "i", "firstChar", "secondChar", "fixChar", "newStr", "validateSingleChar", "validateName", "initialFirstChar", "initialFirstCharMatch", "initialSecondChar", "initialSecondCharMatch", "start", "fixName", "isUndefined", "val", "require_options", "__commonJSMin", "exports", "validate_1", "StringOptions", "options", "require_escape", "__commonJSMin", "exports", "escapeAmpersands", "str", "escapeLeftAngleBrackets", "escapeRightAngleBracketsInCdataTerminator", "escapeSingleQuotes", "escapeDoubleQuotes", "require_XmlAttributeText", "__commonJSMin", "exports", "error_1", "escape_1", "validate_1", "XmlAttributeText", "parent", "validation", "options", "charData", "str", "require_XmlCharRef", "__commonJSMin", "exports", "error_1", "validate_1", "XmlCharRef", "parent", "validation", "options", "char", "hex", "first", "second", "require_XmlEntityRef", "__commonJSMin", "exports", "error_1", "validate_1", "XmlEntityRef", "parent", "validation", "options", "name", "require_XmlAttribute", "__commonJSMin", "exports", "__importDefault", "mod", "error_1", "escape_1", "options_1", "validate_1", "XmlAttributeText_1", "XmlCharRef_1", "XmlEntityRef_1", "XmlAttribute", "parent", "validation", "options", "name", "charRef", "textNode", "optionsObj", "quote", "str", "_i", "_a", "child", "require_XmlDtdAttlist", "__commonJSMin", "exports", "error_1", "validate_1", "XmlDtdAttlist", "parent", "validation", "options", "charData", "require_XmlDtdElement", "__commonJSMin", "exports", "error_1", "validate_1", "XmlDtdElement", "parent", "validation", "options", "charData", "require_XmlDtdEntity", "__commonJSMin", "exports", "error_1", "validate_1", "XmlDtdEntity", "parent", "validation", "options", "charData", "require_XmlDtdNotation", "__commonJSMin", "exports", "error_1", "validate_1", "XmlDtdNotation", "parent", "validation", "options", "charData", "require_XmlDtdParamEntityRef", "__commonJSMin", "exports", "error_1", "validate_1", "XmlDtdParamEntityRef", "parent", "validation", "options", "name", "require_XmlProcInst", "__commonJSMin", "exports", "error_1", "validate_1", "XmlProcInst", "parent", "validation", "options", "content", "target", "require_XmlDtd", "__commonJSMin", "exports", "__importDefault", "mod", "error_1", "options_1", "validate_1", "XmlComment_1", "XmlDtdAttlist_1", "XmlDtdElement_1", "XmlDtdEntity_1", "XmlDtdNotation_1", "XmlDtdParamEntityRef_1", "XmlProcInst_1", "XmlDtd", "parent", "validation", "options", "name", "pubId", "validatePubId", "sysId", "attlist", "comment", "element", "entity", "notation", "paramEntity", "procInst", "optionsObj", "str", "_i", "_a", "node", "type", "value", "i", "char", "require_XmlCdata", "__commonJSMin", "exports", "error_1", "validate_1", "XmlCdata", "parent", "validation", "options", "charData", "require_XmlCharData", "__commonJSMin", "exports", "error_1", "escape_1", "validate_1", "XmlCharData", "parent", "validation", "options", "charData", "str", "require_XmlElement", "__commonJSMin", "exports", "__importDefault", "mod", "error_1", "options_1", "validate_1", "XmlAttribute_1", "XmlCdata_1", "XmlCharData_1", "XmlCharRef_1", "XmlComment_1", "XmlEntityRef_1", "XmlProcInst_1", "XmlElement", "parent", "validation", "options", "name", "attribute", "cdata", "charDataNode", "charRef", "comment", "element", "entityRef", "procInst", "indent", "optionsObj", "newIndent", "str", "nodes", "_i", "_a", "node", "childStr", "i", "next", "nextStr", "prev", "nodes_1", "require_error", "__commonJSMin", "exports", "__importDefault", "mod", "XmlAttribute_1", "XmlDocument_1", "XmlDtd_1", "XmlElement_1", "getContext", "obj", "require_XmlComment", "__commonJSMin", "exports", "error_1", "validate_1", "XmlComment", "parent", "validation", "options", "charData", "require_XmlDecl", "__commonJSMin", "exports", "error_1", "options_1", "validate_1", "XmlDecl", "parent", "validation", "options", "encoding", "validateEncoding", "standalone", "version", "validateVersion", "optionsObj", "quote", "str", "initialChar", "i", "char", "require_XmlDocument", "__commonJSMin", "exports", "__importDefault", "mod", "options_1", "validate_1", "XmlComment_1", "XmlDecl_1", "XmlDtd_1", "XmlElement_1", "XmlProcInst_1", "XmlDocument", "options", "comment", "declaration", "filteredChildren", "value", "dtd", "element", "procInst", "optionsObj", "str", "_i", "_a", "node", "len", "require_main", "__commonJSMin", "exports", "__importDefault", "mod", "XmlDocument_1", "XmlAttribute_1", "XmlAttributeText_1", "XmlCdata_1", "XmlCharData_1", "XmlCharRef_1", "XmlComment_1", "XmlDecl_1", "XmlDocument_2", "XmlDtd_1", "XmlDtdAttlist_1", "XmlDtdElement_1", "XmlDtdEntity_1", "XmlDtdNotation_1", "XmlDtdParamEntityRef_1", "XmlElement_1", "XmlEntityRef_1", "XmlProcInst_1", "document", "options", "require_utils", "__commonJSMin", "exports", "isUndefined", "val", "isNull", "isObject", "isArray", "isFunction", "isSet", "isMap", "stringify", "value", "require_options", "__commonJSMin", "exports", "utils_1", "Options", "options", "DeclarationOptions", "DtdOptions", "FormatOptions", "TypeHandlers", "WrapHandlers", "declarationOptions", "validation", "dtdOptions", "formatOptions", "typeHandlers", "key", "wrapHandlers", "require_main", "__commonJSMin", "exports", "xmlcreate_1", "options_1", "utils_1", "Absent", "getHandler", "value", "options", "type", "handler", "parseString", "str", "parentElement", "requiresCdata", "cdataStrs", "i", "parseAttribute", "name", "attribute", "parseObjectOrMapEntry", "key", "_i", "_a", "subkey", "parseValue", "element", "parseObjectOrMap", "objectOrMap", "parseArrayOrSet", "arrayOrSet", "arrayNameFunc", "arrayKey", "arrayElement", "arrayNameFuncKey", "item", "parseToExistingElement", "object", "opts", "parse", "root", "document", "rootElement", "require_bind", "__commonJSMin", "exports", "module", "fn", "thisArg", "args", "i", "require_utils", "__commonJSMin", "exports", "module", "bind", "toString", "isArray", "val", "isUndefined", "isBuffer", "isArrayBuffer", "isFormData", "isArrayBufferView", "result", "isString", "isNumber", "isObject", "isPlainObject", "prototype", "isDate", "isFile", "isBlob", "isFunction", "isStream", "isURLSearchParams", "trim", "str", "isStandardBrowserEnv", "forEach", "obj", "fn", "i", "l", "key", "merge", "assignValue", "extend", "a", "b", "thisArg", "stripBOM", "content", "require_buildURL", "__commonJSMin", "exports", "module", "utils", "encode", "val", "url", "params", "paramsSerializer", "serializedParams", "parts", "key", "v", "hashmarkIndex", "require_InterceptorManager", "__commonJSMin", "exports", "module", "utils", "InterceptorManager", "fulfilled", "rejected", "options", "id", "fn", "h", "require_normalizeHeaderName", "__commonJSMin", "exports", "module", "utils", "headers", "normalizedName", "value", "name", "require_enhanceError", "__commonJSMin", "exports", "module", "error", "config", "code", "request", "response", "require_createError", "__commonJSMin", "exports", "module", "enhanceError", "message", "config", "code", "request", "response", "error", "require_settle", "__commonJSMin", "exports", "module", "createError", "resolve", "reject", "response", "validateStatus", "require_cookies", "__commonJSMin", "exports", "module", "utils", "name", "value", "expires", "path", "domain", "secure", "cookie", "match", "require_isAbsoluteURL", "__commonJSMin", "exports", "module", "url", "require_combineURLs", "__commonJSMin", "exports", "module", "baseURL", "relativeURL", "require_buildFullPath", "__commonJSMin", "exports", "module", "isAbsoluteURL", "combineURLs", "baseURL", "requestedURL", "require_parseHeaders", "__commonJSMin", "exports", "module", "utils", "ignoreDuplicateOf", "headers", "parsed", "key", "val", "i", "line", "require_isURLSameOrigin", "__commonJSMin", "exports", "module", "utils", "msie", "urlParsingNode", "originURL", "resolveURL", "url", "href", "requestURL", "parsed", "require_xhr", "__commonJSMin", "exports", "module", "utils", "settle", "cookies", "buildURL", "buildFullPath", "parseHeaders", "isURLSameOrigin", "createError", "config", "resolve", "reject", "requestData", "requestHeaders", "responseType", "request", "username", "password", "fullPath", "onloadend", "responseHeaders", "responseData", "response", "timeoutErrorMessage", "xsrfValue", "val", "key", "cancel", "require_ms", "__commonJSMin", "exports", "module", "s", "m", "h", "d", "w", "y", "val", "options", "type", "parse", "fmtLong", "fmtShort", "str", "match", "n", "ms", "msAbs", "plural", "name", "isPlural", "require_common", "__commonJSMin", "exports", "module", "setup", "env", "createDebug", "coerce", "disable", "enable", "enabled", "destroy", "key", "selectColor", "namespace", "hash", "i", "prevTime", "enableOverride", "namespacesCache", "enabledCache", "debug", "args", "self", "curr", "ms", "index", "match", "format", "formatter", "val", "extend", "v", "delimiter", "newDebug", "namespaces", "split", "len", "toNamespace", "name", "regexp", "require_browser", "__commonJSMin", "exports", "module", "formatArgs", "save", "load", "useColors", "localstorage", "warned", "args", "c", "index", "lastC", "match", "namespaces", "r", "formatters", "v", "error", "require_has_flag", "__commonJSMin", "exports", "module", "flag", "argv", "prefix", "position", "terminatorPosition", "require_supports_color", "__commonJSMin", "exports", "module", "os", "tty", "hasFlag", "env", "forceColor", "translateLevel", "level", "supportsColor", "haveStream", "streamIsTTY", "min", "osRelease", "sign", "version", "getSupportLevel", "stream", "require_node", "__commonJSMin", "exports", "module", "tty", "util", "init", "log", "formatArgs", "save", "load", "useColors", "supportsColor", "key", "obj", "prop", "_", "k", "val", "args", "name", "c", "colorCode", "prefix", "getDate", "namespaces", "debug", "keys", "i", "formatters", "v", "str", "require_src", "__commonJSMin", "exports", "module", "require_debug", "__commonJSMin", "exports", "module", "debug", "require_follow_redirects", "__commonJSMin", "exports", "module", "url", "URL", "http", "https", "Writable", "assert", "debug", "events", "eventHandlers", "event", "arg1", "arg2", "arg3", "InvalidUrlError", "createErrorType", "RedirectionError", "TooManyRedirectsError", "MaxBodyLengthExceededError", "WriteAfterEndError", "RedirectableRequest", "options", "responseCallback", "self", "response", "abortRequest", "data", "encoding", "callback", "isString", "isBuffer", "isFunction", "currentRequest", "name", "value", "msecs", "destroyOnTimeout", "socket", "startTimer", "clearTimer", "method", "a", "b", "property", "searchPos", "protocol", "nativeProtocol", "scheme", "request", "i", "buffers", "writeNext", "error", "buffer", "statusCode", "location", "requestHeaders", "beforeRedirect", "removeMatchingHeaders", "currentHostHeader", "currentUrlParts", "currentHost", "currentUrl", "redirectUrl", "cause", "redirectUrlParts", "isSubdomain", "responseDetails", "requestDetails", "err", "wrap", "protocols", "nativeProtocols", "wrappedProtocol", "input", "parsed", "urlToOptions", "get", "wrappedRequest", "noop", "urlObject", "regex", "headers", "lastValue", "header", "code", "message", "baseClass", "CustomError", "properties", "subdomain", "domain", "dot", "require_package", "__commonJSMin", "exports", "module", "require_http", "__commonJSMin", "exports", "module", "utils", "settle", "buildFullPath", "buildURL", "http", "https", "httpFollow", "httpsFollow", "url", "zlib", "pkg", "createError", "enhanceError", "isHttps", "setProxy", "options", "proxy", "location", "base64", "redirection", "config", "resolvePromise", "rejectPromise", "resolve", "value", "reject", "data", "headers", "auth", "username", "password", "fullPath", "parsed", "protocol", "urlAuth", "urlUsername", "urlPassword", "isHttpsRequest", "agent", "proxyEnv", "proxyUrl", "parsedProxyUrl", "noProxyEnv", "shouldProxy", "noProxy", "s", "proxyElement", "proxyUrlAuth", "transport", "isHttpsProxy", "req", "res", "stream", "lastRequest", "response", "responseBuffer", "totalResponseBytes", "chunk", "err", "responseData", "timeout", "cancel", "require_defaults", "__commonJSMin", "exports", "module", "utils", "normalizeHeaderName", "enhanceError", "DEFAULT_CONTENT_TYPE", "setContentTypeIfUnset", "headers", "value", "getDefaultAdapter", "adapter", "stringifySafely", "rawValue", "parser", "encoder", "e", "defaults", "data", "transitional", "silentJSONParsing", "forcedJSONParsing", "strictJSONParsing", "status", "method", "require_transformData", "__commonJSMin", "exports", "module", "utils", "defaults", "data", "headers", "fns", "context", "fn", "require_isCancel", "__commonJSMin", "exports", "module", "value", "require_dispatchRequest", "__commonJSMin", "exports", "module", "utils", "transformData", "isCancel", "defaults", "throwIfCancellationRequested", "config", "method", "adapter", "response", "reason", "require_mergeConfig", "__commonJSMin", "exports", "module", "utils", "config1", "config2", "config", "valueFromConfig2Keys", "mergeDeepPropertiesKeys", "defaultToConfig2Keys", "directMergeKeys", "getMergedValue", "target", "source", "mergeDeepProperties", "prop", "axiosKeys", "otherKeys", "key", "require_validator", "__commonJSMin", "exports", "module", "pkg", "validators", "type", "i", "thing", "deprecatedWarnings", "currentVerArr", "isOlderVersion", "version", "thanVersion", "pkgVersionArr", "destVer", "validator", "message", "isDeprecated", "formatMessage", "opt", "desc", "value", "opts", "assertOptions", "options", "schema", "allowUnknown", "keys", "result", "require_Axios", "__commonJSMin", "exports", "module", "utils", "buildURL", "InterceptorManager", "dispatchRequest", "mergeConfig", "validator", "validators", "Axios", "instanceConfig", "config", "transitional", "requestInterceptorChain", "synchronousRequestInterceptors", "interceptor", "responseInterceptorChain", "promise", "chain", "newConfig", "onFulfilled", "onRejected", "error", "method", "url", "data", "require_Cancel", "__commonJSMin", "exports", "module", "Cancel", "message", "require_CancelToken", "__commonJSMin", "exports", "module", "Cancel", "CancelToken", "executor", "resolvePromise", "resolve", "token", "message", "cancel", "c", "require_spread", "__commonJSMin", "exports", "module", "callback", "arr", "require_isAxiosError", "__commonJSMin", "exports", "module", "payload", "require_axios", "__commonJSMin", "exports", "module", "utils", "bind", "Axios", "mergeConfig", "defaults", "createInstance", "defaultConfig", "context", "instance", "axios", "instanceConfig", "promises", "require_axios", "__commonJSMin", "exports", "module", "resolveComponentsPath", "customPath", "IS_COMPONENT_LIBRARY", "path", "pkgDir", "getComponentsJSConfig", "jsConfigPath", "findUp", "getComponentsLibAliases", "xsConfig", "currentAlias", "pathKey", "aliasKey", "pathAtJsConfig", "relativePathToDir", "absolutePath", "import_node_path", "import_find_up", "import_pkg_dir", "PROJECT_ALIASES", "init_instance", "__esmMin", "cx_config_exports", "__export", "cx_config_default", "import_node_path", "import_pkg_dir", "REPO_ROOT_DIR", "CX_ROOT_DIR", "SSG_DIR", "CX_CACHE_DIR", "COMPONENTS_DIR", "EXPORTS_DIR", "griddoVersion", "config", "init_cx_config", "__esmMin", "init_instance", "pkgDir", "path", "resolveComponentsPath", "domain", "start_render_exports", "__export", "startRender", "__toCommonJS", "import_node_path", "import_node_child_process", "import_node_path", "import_dotenv", "import_fs_extra", "import_node_fs", "import_node_path", "import_chalk", "import_dotenv", "import_fs_extra", "import_pkg_dir", "import_node_fs", "import_node_path", "import_fs_extra", "import_kleur", "import_react", "import_dotenv", "dotenv", "GRIDDO_API_URL", "GRIDDO_PUBLIC_API_URL", "GRIDDO_BOT_USER", "GRIDDO_BOT_PASSWORD", "GRIDDO_API_CONCURRENCY_COUNT", "GRIDDO_RENDER_ALL_SITES", "isTruthy", "GRIDDO_RENDER_SITE", "GRIDDO_RENDER_PAGES", "item", "GRIDDO_SKIP_BUILD_CHECKS", "GRIDDO_DEBUG_LOGS", "GRIDDO_BUILD_LOGS", "GRIDDO_RENDER_BREAKPOINTS_FEATURE", "GRIDDO_SSG_VERBOSE_LOGS", "GRIDDO_SEARCH_FEATURE", "GRIDDO_ASSET_PREFIX", "GRIDDO_REACT_APP_INSTANCE", "GRIDDO_AI_EMBEDDINGS", "GRIDDO_VERBOSE_LOGS", "GRIDDO_ALERT_FEATURE", "GRIDDO_API_MAX_RESPONSE_SIZE", "GRIDDO_SSG_MAX_PAGE_SIZE", "GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_FIXTURES_DOMAIN_NAMES", "GRIDDO_FIXTURES_SITE_NAMES", "WITH_URI", "GRIDDO_API_URL", "AI_EMBEDDINGS", "ALERT", "GRIDDO_PUBLIC_API_URL", "DOMAINS", "GET_ALL", "GET_PAGE", "LOGIN", "RESET_RENDER", "ROBOTS", "SEARCH", "SETTINGS", "BUILD_END", "BUILD_START", "GET_PAGES", "GET_REFERENCE_FIELD_DATA", "GET_SITEMAP", "INFO", "LANGUAGES", "SOCIALS", "endpoints", "ALERT", "AI_EMBEDDINGS", "BUILD_END", "BUILD_START", "DOMAINS", "GET_ALL", "GET_PAGE", "GET_PAGES", "GET_REFERENCE_FIELD_DATA", "GET_SITEMAP", "INFO", "LANGUAGES", "LOGIN", "RESET_RENDER", "ROBOTS", "SEARCH", "SETTINGS", "SOCIALS", "envs", "GRIDDO_AI_EMBEDDINGS", "GRIDDO_ALERT_FEATURE", "GRIDDO_API_CONCURRENCY_COUNT", "GRIDDO_API_MAX_RESPONSE_SIZE", "GRIDDO_API_URL", "GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_ASSET_PREFIX", "GRIDDO_BOT_PASSWORD", "GRIDDO_BOT_USER", "GRIDDO_BUILD_LOGS", "GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_DEBUG_LOGS", "GRIDDO_FIXTURES_DOMAIN_NAMES", "GRIDDO_FIXTURES_SITE_NAMES", "GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_PUBLIC_API_URL", "GRIDDO_REACT_APP_INSTANCE", "GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_RENDER_ALL_SITES", "GRIDDO_RENDER_BREAKPOINTS_FEATURE", "GRIDDO_RENDER_PAGES", "GRIDDO_RENDER_SITE", "GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_SEARCH_FEATURE", "GRIDDO_SKIP_BUILD_CHECKS", "GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS", "GRIDDO_SSG_MAX_PAGE_SIZE", "GRIDDO_SSG_VERBOSE_LOGS", "GRIDDO_VERBOSE_LOGS", "verboseLog", "str", "envs", "kleur", "boxLog", "stringValue", "title", "paddingInline", "paddingBlock", "lines", "line", "windowTitle", "windowTitleLength", "longerContent", "l", "longerLine", "paddingBlockString", "minWidth", "borderTop", "borderBottom", "content", "mr", "infoLog", "str", "kleur", "debugLog", "values", "envs", "printExporterLogo", "adapter", "config", "getConfig", "nodeVersion", "griddoVersion", "logo", "reactVersion", "config", "getConfig", "clearEmptyDirs", "baseDir", "fsx", "children", "childrenCount", "xmlCount", "file", "path", "xmlFile", "fullPath", "restoreBackup", "src", "suffix", "dst", "fs", "deleteBackup", "fsx", "createBackup", "removeVirtualPagesFromStore", "__cx", "config", "storePath", "path", "allJsonPageFilesPath", "walkStore", "filePath", "removeArtifacts", "artifacts", "dir", "fsx", "fs", "verboseLog", "createArtifacts", "dirs", "options", "copyArtifacts", "src", "dst", "withBackup", "srcCompose", "path", "dstCompose", "createBackup", "deleteBackup", "restoreBackup", "renameArtifact", "moveArtifacts", "override", "e", "import_node_path", "import_fs_extra", "import_js2xmlparser", "import_node_fs", "import_node_path", "import_fs_extra", "config", "getConfig", "getBuildMetadata", "__cx", "config", "sitesToPublish", "createdPages", "buildProcessData", "fsx", "path", "createStoreDir", "storeDir", "fs", "saveRenderInfoInStore", "basePath", "renderInfo", "getPageInStoreDir", "file", "fullPathFile", "stat", "baseFilename", "page", "filename", "savePagesInStore", "siteFolderName", "pages", "removeProperties", "filePath", "e", "removePagesFromStore", "siteDirName", "filenames", "error", "getPagesToCreateOrDelete", "sitePages", "changedPages", "validPagesIds", "siteDirStorePath", "pagesInStore", "pagesMissingInStore", "pagesToStore", "pagesToDeleteFromStore", "pagesToWriteToStore", "import_axios", "import_chalk", "AuthService", "envs", "response", "axios", "endpoints", "token", "chalk", "authService", "import_axios", "import_chalk", "import_dotenv", "import_node_crypto", "import_node_fs", "import_node_path", "import_fs_extra", "config", "getConfig", "createAPICacheDir", "__cx", "apiCacheDir", "path", "fs", "generateFilenameWithHash", "petition", "hashSum", "crypto", "saveCache", "petition", "content", "stringContent", "filename", "generateFilenameWithHash", "filepath", "path", "fs", "searchCacheData", "file", "fsx", "getHashSites", "__cx", "config", "siteHasFilename", "updatedSiteHash", "siteId", "siteHash", "allHash", "lastHash", "currentHash", "import_fs_extra", "MemoryRegister", "entries", "name", "entry", "Register", "strategy", "name", "entry", "entries", "register", "Register", "MemoryRegister", "api_default", "entries", "register", "Register", "MemoryRegister", "dotenv", "RETRY_WAIT_SECONDS", "RETRY_ATTEMPTS", "requestAPI", "props", "method", "appendToLog", "endpoint", "body", "cacheKey", "attempt", "headers", "cacheOptions", "start", "cacheData", "searchCacheData", "siteId", "getSafeSiteId", "siteIdMsg", "duration", "msToSec", "infoLog", "data", "responseHeaders", "axios", "authService", "saveCache", "envs", "responseSize", "api_default", "e", "error", "showApiError", "delay", "getApi", "postApi", "props", "endpoint", "body", "headers", "distributorBodyParams", "requestAPI", "showApiError", "error", "options", "response", "message", "stack", "callInfo", "status", "statusText", "data", "callInfoArray", "item", "callInfoStr", "apiResponseStr", "errorDetailsStr", "chalk", "getAllSites", "getApi", "endpoints", "getPage", "id", "cacheKey", "getSiteInfo", "prefix", "suffix", "getSiteLanguages", "startSiteRender", "endSiteRender", "body", "postApi", "getDistributorData", "page", "dataSiteId", "dataLangID", "site", "lang", "getSitemap", "getSiteSocials", "config", "getConfig", "checkSites", "domain", "envs", "authService", "allSites", "getAllSites", "validSites", "site", "items", "getSiteLanguages", "item", "validSitesFromCurrentDomain", "sitesToPublish", "sitesToUnpublish", "unpublishSites", "sites", "__cx", "buildInfo", "startSiteRender", "siteHash", "body", "endSiteRender", "fs", "path", "getSiteData", "siteID", "buildData", "siteInfo", "getSiteInfo", "siteLangs", "socials", "getSiteSocials", "siteLangsInfo", "defaultLang", "lang", "unpublishHashes", "publishIds", "headers", "footers", "validPagesIds", "generateBuildReport", "buildProcessData", "getBuildMetadata", "authControl", "buildSitesInfo", "report", "infoLog", "generateSitemaps", "distDir", "languages", "response", "getSitemap", "sitemapPagesGroup", "home", "langDomain", "slug", "sitemaps", "sitemapPageGroupKeys", "sitemapBasePath", "templateId", "sitemapPages", "siteMap", "sitemapName", "exactPath", "saveFile", "loc", "filePath", "content", "pathName", "err", "import_node_fs", "import_node_path", "config", "getConfig", "getRobots", "getApi", "endpoints", "r", "path", "content", "writeRobots", "domain", "__cx", "distDirectory", "robots", "robot", "fs", "fileLocation", "dotenv", "config", "getConfig", "instanceRootDir", "pkgDir", "isTruthy", "value", "number", "walkStore", "dir", "results", "subdirs", "fs", "file", "fullPath", "path", "subdir", "subdirPath", "files", "delay", "ms", "res", "msToSec", "decimals", "getSafeSiteId", "response", "removeProperties", "obj", "props", "key", "siteList", "sites", "name", "id", "sanitizeAPICacheDir", "__cx", "config", "dirPath", "allCachedFiles", "filesByIdMap", "pageFilePaths", "fileName", "filePath", "fileObject", "fsx", "entity", "fullUrl", "fileCreationDate", "counter", "measureExecutionTime", "functions", "delayInMS", "start", "func", "seconds", "miliseconds", "pause", "title", "resolve", "boxLog", "doLifeCycle", "options", "steps", "bypass", "attemptsByLifeCycleName", "envs", "trysCount", "maxTrysAccepted", "chalk", "exeTime", "error", "errorString", "attemptsString", "createRenderMetadata", "domain", "generateBuildReport", "generateSitemaps", "writeRobots", "removeAllSiteDirsFromStore", "__cx", "config", "storeDir", "path", "allSiteDirsFullPath", "fs", "dirname", "name", "site", "dotenv", "config", "getConfig", "getGatsbyAssetPrefixWithDomain", "domain", "proDomain", "assetPrefix", "assetPrefixWithDomain", "verboseLog", "runGatsbyBuildCommand", "__ssg", "command", "legacy__createDistFromGatsbyPublic", "needsAssetPrefix", "__cx", "cxDistDir", "path", "cxAssetsDir", "cxDistDirWithDomain", "publicDir", "validFilesFromPublic", "fsx", "file", "pageDataSrc", "pageDataDest", "projectStaticSrc", "projectStaticDest", "gatsbyStaticSrc", "gatsbyStaticDest", "fileSrc", "fileDest", "err", "import_node_path", "getCxArtifacts", "paths", "__cx", "__exports", "__caches", "path", "cx_default", "import_node_path", "gatsbyArtifacts", "paths", "__ssg", "path", "gatsby_default", "getArtifacts", "adapter", "options", "cxPaths", "ssgArtifacts", "gatsby_default", "cx_default", "import_axios", "insertAlert", "area", "description", "fullData", "instantNotification", "level", "url", "endpoints", "body", "axios", "error", "import_node_fs", "import_node_path", "import_dotenv", "import_p_limit", "DistributorService", "data", "page", "order", "sources", "quantity", "mode", "fixed", "fullRelations", "allLanguages", "preferenceLanguage", "referenceId", "fields", "props", "cacheKey", "boxLog", "site", "lang", "body", "getDistributorData", "template", "checkDistributors", "templateChunk", "level", "key", "component", "err", "NavigationService", "navigations", "footer", "prev", "language", "header", "list", "id", "result", "item", "version", "page", "pageHeader", "pageFooter", "templateType", "defaultHeader", "defaultFooter", "templates", "getValidNavigation", "values", "fineNavigation", "headerID", "footerID", "getAllSettings", "getApi", "endpoints", "import_dotenv", "formatImage", "image", "width", "height", "format", "url", "addCloudinaryParams", "addGriddoDamParams", "params", "urlParts", "imagePath", "imageName", "plainUrl", "head", "fullId", "dotenv", "DEFAULT_ITEMS_PER_PAGE_FOR_LIST_TEMPLATES", "getOpenGraph", "socialTitle", "socialDescription", "socialImage", "formatImage", "getPageMetaData", "params", "title", "metaTitle", "metaDescription", "canonicalURL", "locale", "url", "isIndexed", "follow", "metasAdvanced", "pageLanguages", "fullUrl", "metaKeywords", "metasAdvancedList", "item", "keyword", "createGriddoPageObject", "page", "additionalInfo", "id", "fullPath", "languageId", "breadcrumb", "baseUrl", "cloudinaryName", "griddoVersion", "siteLangs", "siteMetadata", "siteOptions", "siteScript", "siteSlug", "socials", "theme", "header", "footer", "pageMetadata", "openGraph", "pagePath", "renderDate", "createGriddoSinglePage", "createGriddoListPages", "pages", "isRoot", "defaultLang", "template", "totalQueriedItems", "allPages", "dataInPage", "idx", "isFirstPage", "pageNumber", "domainUrl", "compose", "paginatedPage", "addPageNumberToUrl", "addPageNumberToTitle", "createGriddoMultiPages", "multiPageElementsBulk", "cleanPage", "multiPageElements", "sectionSlug", "pageElement", "bulkTitle", "cleanSectionSlug", "rightSectionSlug", "slash", "newCompose", "getMultiPageElements", "resolve", "getMultiPageComponent", "level", "key", "currentComponent", "isValidComponent", "hasGriddoMultiPageProp", "component", "hasGriddoMultiPage", "elements", "getPage", "itemsPerPage", "items", "getPageCluster", "totalPagesCount", "_", "i", "getPaginatedPages", "listTemplate", "removeDuplicateTrailing", "options", "trailingSlash", "endingSlash", "config", "getConfig", "dotenv", "RENDER_ID", "createStore", "domain", "createStoreDir", "envs", "__cx", "griddoVersion", "storeDir", "path", "createdPages", "buildProcessData", "sitesToPublish", "sitesToUnpublish", "checkSites", "domainHasSites", "siteList", "unpublishSites", "site", "siteId", "siteSlug", "theme", "favicon", "changedPages", "siteInfo", "validPagesIds", "siteHash", "unpublishHashes", "siteLangs", "defaultLang", "headers", "footers", "socials", "getSiteData", "cloudinaryName", "useMetaTitle", "useMetaKeywords", "showBasicMetaRobots", "avoidHrefLangsOnCanonicals", "avoidSelfReferenceCanonicals", "avoidHrefLangXDefault", "avoidDebugMetas", "getAllSettings", "NavService", "NavigationService", "shouldUpdateSite", "updatedSiteHash", "siteScript", "siteMetadata", "additionalInfo", "infoLog", "fs", "fetchPageAndSaveInStore", "siteIdName", "pageId", "griddoPageObjects", "page", "getPage", "pageAdditionalInfo", "template", "DistributorService", "multiPageElements", "getMultiPageElements", "isStaticListPage", "isMultiPage", "isSinglePage", "griddoListPage", "getPaginatedPages", "createGriddoListPages", "griddoMultipage", "createGriddoMultiPages", "griddoSinglePage", "createGriddoSinglePage", "savePagesInStore", "pagesMissingInStore", "pagesToDeleteFromStore", "pagesToWriteToStore", "getPagesToCreateOrDelete", "removePagesFromStore", "limit", "pLimit", "pagesToStore", "id", "verboseLog", "saveRenderInfoInStore", "removeAllSiteDirsFromStore", "e", "createBuildData", "domain", "createAPICacheDir", "createStore", "sanitizeAPICacheDir", "import_node_fs", "import_node_path", "RenderError", "throwError", "error", "message", "expected", "hint", "errorMessage", "boxLog", "NoDomainsFoundError", "RenderUUIDError", "config", "getConfig", "createSentinelRenderFile", "__cx", "renderSentinelFile", "path", "fs", "deleteSentinelRenderFile", "isValidRenderProcessOrThrow", "throwError", "RenderUUIDError", "config", "getConfig", "renderDomain", "domain", "infoLog", "createSentinelRenderFile", "cxPaths", "domainArtifacts", "getArtifacts", "__ssg", "__exports", "__caches", "__cx", "__components", "arts", "assetPrefix", "getGatsbyAssetPrefixWithDomain", "needsAssetPrefix", "doLifeCycle", "removeArtifacts", "createArtifacts", "copyArtifacts", "renameArtifact", "path", "moveArtifacts", "createBuildData", "runGatsbyBuildCommand", "legacy__createDistFromGatsbyPublic", "createRenderMetadata", "removeVirtualPagesFromStore", "clearEmptyDirs", "isValidRenderProcessOrThrow", "deleteSentinelRenderFile", "runGatsbyAdapter", "domains", "printExporterLogo", "envs", "api_default", "registerContent", "debugLog", "insertAlert", "DomainsService", "getApi", "endpoints", "getInstanceDomainsOrThrow", "authService", "domains", "DomainsService", "throwError", "NoDomainsFoundError", "verboseLog", "getDomainSlugs", "getDomainSlugs", "domains", "filteredDomains", "slug", "startRender", "domains", "getInstanceDomainsOrThrow", "exeTime", "measureExecutionTime", "runGatsbyAdapter", "boxLog", "error"]
7
7
  }