/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ var __create = Object.create; var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropNames = Object.getOwnPropertyNames; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject2) => { var fulfilled = (value) => { try { step(generator.next(value)); } catch (e) { reject2(e); } }; var rejected = (value) => { try { step(generator.throw(value)); } catch (e) { reject2(e); } }; var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); step((generator = generator.apply(__this, __arguments)).next()); }); }; // node_modules/isexe/windows.js var require_windows = __commonJS({ "node_modules/isexe/windows.js"(exports, module2) { module2.exports = isexe; isexe.sync = sync; var fs3 = require("fs"); function checkPathExt(path2, options) { var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT; if (!pathext) { return true; } pathext = pathext.split(";"); if (pathext.indexOf("") !== -1) { return true; } for (var i = 0; i < pathext.length; i++) { var p = pathext[i].toLowerCase(); if (p && path2.substr(-p.length).toLowerCase() === p) { return true; } } return false; } __name(checkPathExt, "checkPathExt"); function checkStat(stat, path2, options) { if (!stat.isSymbolicLink() && !stat.isFile()) { return false; } return checkPathExt(path2, options); } __name(checkStat, "checkStat"); function isexe(path2, options, cb) { fs3.stat(path2, function(er, stat) { cb(er, er ? false : checkStat(stat, path2, options)); }); } __name(isexe, "isexe"); function sync(path2, options) { return checkStat(fs3.statSync(path2), path2, options); } __name(sync, "sync"); } }); // node_modules/isexe/mode.js var require_mode = __commonJS({ "node_modules/isexe/mode.js"(exports, module2) { module2.exports = isexe; isexe.sync = sync; var fs3 = require("fs"); function isexe(path2, options, cb) { fs3.stat(path2, function(er, stat) { cb(er, er ? false : checkStat(stat, options)); }); } __name(isexe, "isexe"); function sync(path2, options) { return checkStat(fs3.statSync(path2), options); } __name(sync, "sync"); function checkStat(stat, options) { return stat.isFile() && checkMode(stat, options); } __name(checkStat, "checkStat"); function checkMode(stat, options) { var mod = stat.mode; var uid = stat.uid; var gid = stat.gid; var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid(); var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid(); var u = parseInt("100", 8); var g = parseInt("010", 8); var o = parseInt("001", 8); var ug = u | g; var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0; return ret; } __name(checkMode, "checkMode"); } }); // node_modules/isexe/index.js var require_isexe = __commonJS({ "node_modules/isexe/index.js"(exports, module2) { var fs3 = require("fs"); var core2; if (process.platform === "win32" || global.TESTING_WINDOWS) { core2 = require_windows(); } else { core2 = require_mode(); } module2.exports = isexe; isexe.sync = sync; function isexe(path2, options, cb) { if (typeof options === "function") { cb = options; options = {}; } if (!cb) { if (typeof Promise !== "function") { throw new TypeError("callback not provided"); } return new Promise(function(resolve, reject2) { isexe(path2, options || {}, function(er, is) { if (er) { reject2(er); } else { resolve(is); } }); }); } core2(path2, options || {}, function(er, is) { if (er) { if (er.code === "EACCES" || options && options.ignoreErrors) { er = null; is = false; } } cb(er, is); }); } __name(isexe, "isexe"); function sync(path2, options) { try { return core2.sync(path2, options || {}); } catch (er) { if (options && options.ignoreErrors || er.code === "EACCES") { return false; } else { throw er; } } } __name(sync, "sync"); } }); // node_modules/which/lib/index.js var require_lib = __commonJS({ "node_modules/which/lib/index.js"(exports, module2) { var isexe = require_isexe(); var { join: join4, delimiter: delimiter3, sep, posix } = require("path"); var isWindows = process.platform === "win32"; var rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? "" : sep}]`.replace(/(\\)/g, "\\$1")); var rRel = new RegExp(`^\\.${rSlash.source}`); var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError"); var getPathInfo = /* @__PURE__ */ __name((cmd, { path: optPath = process.env.PATH, pathExt: optPathExt = process.env.PATHEXT, delimiter: optDelimiter = delimiter3 }) => { const pathEnv = cmd.match(rSlash) ? [""] : [ ...isWindows ? [process.cwd()] : [], ...(optPath || "").split(optDelimiter) ]; if (isWindows) { const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter); const pathExt = pathExtExe.split(optDelimiter); if (cmd.includes(".") && pathExt[0] !== "") { pathExt.unshift(""); } return { pathEnv, pathExt, pathExtExe }; } return { pathEnv, pathExt: [""] }; }, "getPathInfo"); var getPathPart = /* @__PURE__ */ __name((raw, cmd) => { const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw; const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : ""; return prefix + join4(pathPart, cmd); }, "getPathPart"); var which2 = /* @__PURE__ */ __name((_0, ..._1) => __async(exports, [_0, ..._1], function* (cmd, opt = {}) { const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); const found = []; for (const envPart of pathEnv) { const p = getPathPart(envPart, cmd); for (const ext of pathExt) { const withExt = p + ext; const is = yield isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true }); if (is) { if (!opt.all) { return withExt; } found.push(withExt); } } } if (opt.all && found.length) { return found; } if (opt.nothrow) { return null; } throw getNotFoundError(cmd); }), "which"); var whichSync = /* @__PURE__ */ __name((cmd, opt = {}) => { const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); const found = []; for (const pathEnvPart of pathEnv) { const p = getPathPart(pathEnvPart, cmd); for (const ext of pathExt) { const withExt = p + ext; const is = isexe.sync(withExt, { pathExt: pathExtExe, ignoreErrors: true }); if (is) { if (!opt.all) { return withExt; } found.push(withExt); } } } if (opt.all && found.length) { return found; } if (opt.nothrow) { return null; } throw getNotFoundError(cmd); }, "whichSync"); module2.exports = which2; which2.sync = whichSync; } }); // node_modules/randombytes/browser.js var require_browser = __commonJS({ "node_modules/randombytes/browser.js"(exports, module2) { "use strict"; function oldBrowser() { throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11"); } __name(oldBrowser, "oldBrowser"); var crypto2 = global.crypto || global.msCrypto; if (crypto2 && crypto2.getRandomValues) { module2.exports = randomBytes; } else { module2.exports = oldBrowser; } function randomBytes(size, cb) { if (size > 65536) throw new Error("requested too many random bytes"); var rawBytes = new global.Uint8Array(size); if (size > 0) { crypto2.getRandomValues(rawBytes); } var bytes = new Buffer(rawBytes.buffer); if (typeof cb === "function") { return process.nextTick(function() { cb(null, bytes); }); } return bytes; } __name(randomBytes, "randomBytes"); } }); // node_modules/array-uniq/index.js var require_array_uniq = __commonJS({ "node_modules/array-uniq/index.js"(exports, module2) { "use strict"; function uniqNoSet(arr) { var ret = []; for (var i = 0; i < arr.length; i++) { if (ret.indexOf(arr[i]) === -1) { ret.push(arr[i]); } } return ret; } __name(uniqNoSet, "uniqNoSet"); function uniqSet(arr) { var seen = /* @__PURE__ */ new Set(); return arr.filter(function(el) { if (!seen.has(el)) { seen.add(el); return true; } }); } __name(uniqSet, "uniqSet"); function uniqSetWithForEach(arr) { var ret = []; new Set(arr).forEach(function(el) { ret.push(el); }); return ret; } __name(uniqSetWithForEach, "uniqSetWithForEach"); function doesForEachActuallyWork() { var ret = false; (/* @__PURE__ */ new Set([true])).forEach(function(el) { ret = el; }); return ret === true; } __name(doesForEachActuallyWork, "doesForEachActuallyWork"); if ("Set" in global) { if (typeof Set.prototype.forEach === "function" && doesForEachActuallyWork()) { module2.exports = uniqSetWithForEach; } else { module2.exports = uniqSet; } } else { module2.exports = uniqNoSet; } } }); // node_modules/randomstring/lib/charset.js var require_charset = __commonJS({ "node_modules/randomstring/lib/charset.js"(exports, module2) { var arrayUniq = require_array_uniq(); function Charset() { this.chars = ""; } __name(Charset, "Charset"); Charset.prototype.setType = function(type) { var chars; var numbers = "0123456789"; var charsLower = "abcdefghijklmnopqrstuvwxyz"; var charsUpper = charsLower.toUpperCase(); var hexChars = "abcdef"; var binaryChars = "01"; var octalChars = "01234567"; if (type === "alphanumeric") { chars = numbers + charsLower + charsUpper; } else if (type === "numeric") { chars = numbers; } else if (type === "alphabetic") { chars = charsLower + charsUpper; } else if (type === "hex") { chars = numbers + hexChars; } else if (type === "binary") { chars = binaryChars; } else if (type === "octal") { chars = octalChars; } else { chars = type; } this.chars = chars; }; Charset.prototype.removeUnreadable = function() { var unreadableChars = /[0OIl]/g; this.chars = this.chars.replace(unreadableChars, ""); }; Charset.prototype.setcapitalization = function(capitalization) { if (capitalization === "uppercase") { this.chars = this.chars.toUpperCase(); } else if (capitalization === "lowercase") { this.chars = this.chars.toLowerCase(); } }; Charset.prototype.removeDuplicates = function() { var charMap = this.chars.split(""); charMap = arrayUniq(charMap); this.chars = charMap.join(""); }; module2.exports = exports = Charset; } }); // node_modules/randomstring/lib/randomstring.js var require_randomstring = __commonJS({ "node_modules/randomstring/lib/randomstring.js"(exports) { "use strict"; var randomBytes = require_browser(); var Charset = require_charset(); function unsafeRandomBytes(length) { var stack = []; for (var i = 0; i < length; i++) { stack.push(Math.floor(Math.random() * 255)); } return { length, readUInt8: function(index2) { return stack[index2]; } }; } __name(unsafeRandomBytes, "unsafeRandomBytes"); function safeRandomBytes(length) { try { return randomBytes(length); } catch (e) { return unsafeRandomBytes(length); } } __name(safeRandomBytes, "safeRandomBytes"); function processString(buf, initialString, chars, reqLen, maxByte) { var string = initialString; for (var i = 0; i < buf.length && string.length < reqLen; i++) { var randomByte = buf.readUInt8(i); if (randomByte < maxByte) { string += chars.charAt(randomByte % chars.length); } } return string; } __name(processString, "processString"); function getAsyncString(string, chars, length, maxByte, cb) { randomBytes(length, function(err, buf) { if (err) { cb(err); } var generatedString = processString(buf, string, chars, length, maxByte); if (generatedString.length < length) { getAsyncString(generatedString, chars, length, maxByte, cb); } else { cb(null, generatedString); } }); } __name(getAsyncString, "getAsyncString"); exports.generate = function(options, cb) { var charset = new Charset(); var length, chars, capitalization, string = ""; if (typeof options === "object") { length = typeof options.length === "number" ? options.length : 32; if (options.charset) { charset.setType(options.charset); } else { charset.setType("alphanumeric"); } if (options.capitalization) { charset.setcapitalization(options.capitalization); } if (options.readable) { charset.removeUnreadable(); } charset.removeDuplicates(); } else if (typeof options === "number") { length = options; charset.setType("alphanumeric"); } else { length = 32; charset.setType("alphanumeric"); } var charsLen = charset.chars.length; var maxByte = 256 - 256 % charsLen; if (!cb) { while (string.length < length) { var buf = safeRandomBytes(Math.ceil(length * 256 / maxByte)); string = processString(buf, string, charset.chars, length, maxByte); } return string; } getAsyncString(string, charset.chars, length, maxByte, cb); }; } }); // node_modules/randomstring/index.js var require_randomstring2 = __commonJS({ "node_modules/randomstring/index.js"(exports, module2) { module2.exports = require_randomstring(); } }); // node_modules/@simplyhexagonal/elean/dist/elean.js var require_elean = __commonJS({ "node_modules/@simplyhexagonal/elean/dist/elean.js"(exports, module2) { var elean = (() => { var __defProp2 = Object.defineProperty; var __markAsModule = /* @__PURE__ */ __name((target) => __defProp2(target, "__esModule", { value: true }), "__markAsModule"); var __export2 = /* @__PURE__ */ __name((target, all) => { __markAsModule(target); for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true }); }, "__export"); var src_exports = {}; __export2(src_exports, { default: () => src_default, version: () => version2 }); var version2 = "1.0.0"; var src_default = /* @__PURE__ */ __name((envVar) => { const strVar = String(envVar).toLowerCase(); if (strVar === "" || strVar === "false" || strVar === "0" || strVar === "null" || strVar === "undefined") { return false; } return true; }, "src_default"); return src_exports; })(); typeof module2 != "undefined" && (module2.exports = elean.default), typeof window != "undefined" && (elean = elean.default); } }); // node_modules/@simplyhexagonal/mono-context/dist/mono-context.js var require_mono_context = __commonJS({ "node_modules/@simplyhexagonal/mono-context/dist/mono-context.js"(exports, module2) { var MonoContext = (() => { var __defProp2 = Object.defineProperty; var __defProps2 = Object.defineProperties; var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols2 = Object.getOwnPropertySymbols; var __hasOwnProp2 = Object.prototype.hasOwnProperty; var __propIsEnum2 = Object.prototype.propertyIsEnumerable; var __defNormalProp2 = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value, "__defNormalProp"); var __spreadValues2 = /* @__PURE__ */ __name((a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp2.call(b, prop)) __defNormalProp2(a, prop, b[prop]); if (__getOwnPropSymbols2) for (var prop of __getOwnPropSymbols2(b)) { if (__propIsEnum2.call(b, prop)) __defNormalProp2(a, prop, b[prop]); } return a; }, "__spreadValues"); var __spreadProps2 = /* @__PURE__ */ __name((a, b) => __defProps2(a, __getOwnPropDescs2(b)), "__spreadProps"); var __markAsModule = /* @__PURE__ */ __name((target) => __defProp2(target, "__esModule", { value: true }), "__markAsModule"); var __objRest = /* @__PURE__ */ __name((source, exclude) => { var target = {}; for (var prop in source) if (__hasOwnProp2.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && __getOwnPropSymbols2) for (var prop of __getOwnPropSymbols2(source)) { if (exclude.indexOf(prop) < 0 && __propIsEnum2.call(source, prop)) target[prop] = source[prop]; } return target; }, "__objRest"); var __export2 = /* @__PURE__ */ __name((target, all) => { __markAsModule(target); for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true }); }, "__export"); var src_exports = {}; __export2(src_exports, { default: () => MonoContext2, version: () => version2 }); var version2 = "1.1.2"; var _MonoContext = /* @__PURE__ */ __name(class { constructor(warningOff = false) { this.count = _MonoContext.count; this.getCount = _MonoContext.getCount; this.resetCount = _MonoContext.resetCount; this.resetAllCounts = _MonoContext.resetAllCounts; this.setState = _MonoContext.setState; this.getState = _MonoContext.getState; this.getStateValue = _MonoContext.getStateValue; this.resetState = _MonoContext.resetState; if (!warningOff) { console.log("WARNING: instantiating MonoContext is unnecessary, all methods are statically defined"); } if (!_MonoContext.instance) { _MonoContext.instance = this; return this; } return _MonoContext.instance; } }, "_MonoContext"); var MonoContext2 = _MonoContext; MonoContext2._stateCreatedAt = new Date(); MonoContext2._stateUpdatedAt = new Date(); MonoContext2._counts = {}; MonoContext2._state = {}; MonoContext2.version = version2; MonoContext2.default = _MonoContext; MonoContext2._warningMessage = 'WARNING: refusing to override "PROPERTY" property in MonoContext state'; MonoContext2.count = (key) => { if (!_MonoContext._counts[key]) { _MonoContext._counts[key] = 0; } _MonoContext._counts[key] += 1; return _MonoContext._counts[key]; }; MonoContext2.getCount = (key) => _MonoContext._counts[key] || 0; MonoContext2.resetCount = (key) => { if (_MonoContext._counts[key]) { _MonoContext._counts[key] = 0; } }; MonoContext2.resetAllCounts = () => { _MonoContext._counts = {}; }; MonoContext2.setState = (newState) => { if (Object.keys(newState).includes("stateCreatedAt")) { console.log(_MonoContext._warningMessage.replace("PROPERTY", "stateCreatedAt")); } if (Object.keys(newState).includes("stateUpdatedAt")) { console.log(_MonoContext._warningMessage.replace("PROPERTY", "stateUpdatedAt")); } if (Object.keys(newState).includes("counts")) { console.log(_MonoContext._warningMessage.replace("PROPERTY", "counts")); } const _a = newState, { counts, stateCreatedAt, stateUpdatedAt } = _a, safeNewState = __objRest(_a, [ "counts", "stateCreatedAt", "stateUpdatedAt" ]); if (Object.keys(safeNewState).length > 0) { _MonoContext._state = __spreadValues2(__spreadValues2({}, _MonoContext._state), safeNewState); _MonoContext._stateUpdatedAt = new Date(); } return _MonoContext.getState(); }; MonoContext2.getState = () => { return _MonoContext._state = __spreadProps2(__spreadValues2({}, _MonoContext._state), { counts: __spreadValues2({}, _MonoContext._counts), stateCreatedAt: _MonoContext._stateCreatedAt, stateUpdatedAt: _MonoContext._stateUpdatedAt }); }; MonoContext2.getStateValue = (key) => _MonoContext._state[key]; MonoContext2.resetState = () => { _MonoContext._stateCreatedAt = new Date(); _MonoContext._stateUpdatedAt = new Date(); _MonoContext._state = {}; }; return src_exports; })(); typeof module2 != "undefined" && (module2.exports = MonoContext.default), typeof window != "undefined" && (MonoContext = MonoContext.default); } }); // node_modules/@simplyhexagonal/exec/dist/exec.js var require_exec = __commonJS({ "node_modules/@simplyhexagonal/exec/dist/exec.js"(exports, module2) { var __create2 = Object.create; var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; var __getProtoOf2 = Object.getPrototypeOf; var __hasOwnProp2 = Object.prototype.hasOwnProperty; var __markAsModule = /* @__PURE__ */ __name((target) => __defProp2(target, "__esModule", { value: true }), "__markAsModule"); var __export2 = /* @__PURE__ */ __name((target, all) => { __markAsModule(target); for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true }); }, "__export"); var __reExport = /* @__PURE__ */ __name((target, module22, desc) => { if (module22 && typeof module22 === "object" || typeof module22 === "function") { for (let key of __getOwnPropNames2(module22)) if (!__hasOwnProp2.call(target, key) && key !== "default") __defProp2(target, key, { get: () => module22[key], enumerable: !(desc = __getOwnPropDesc2(module22, key)) || desc.enumerable }); } return target; }, "__reExport"); var __toModule = /* @__PURE__ */ __name((module22) => { return __reExport(__markAsModule(__defProp2(module22 != null ? __create2(__getProtoOf2(module22)) : {}, "default", module22 && module22.__esModule && "default" in module22 ? { get: () => module22.default, enumerable: true } : { value: module22, enumerable: true })), module22); }, "__toModule"); __export2(exports, { ExecError: () => ExecError, default: () => src_default, version: () => version2 }); var import_child_process = __toModule(require("child_process")); var import_elean = __toModule(require_elean()); var import_mono_context = __toModule(require_mono_context()); var version2 = "2.0.2"; var ExecError = /* @__PURE__ */ __name(class extends Error { constructor(message, exitCode, stdoutOutput, stderrOutput) { super(message); this.exitCode = exitCode; this.stdoutOutput = stdoutOutput; this.stderrOutput = stderrOutput; } }, "ExecError"); var { REALTIME_LOG } = process.env; var exec6 = /* @__PURE__ */ __name((command, options) => { const { realtimeStdout, logStdout, logStderr, loggerInstance, stdoutLogLevel, stderrLogLevel } = options || {}; const shouldRealtimeLog = realtimeStdout || (0, import_elean.default)(REALTIME_LOG); const logger = loggerInstance || import_mono_context.default.getStateValue("logger") || console; const child = (0, import_child_process.exec)(command); const { stdout, stderr } = child; const stdoutChunks = []; const stderrChunks = []; let stdoutOutput = ""; let stderrOutput = ""; stdout == null ? void 0 : stdout.on("data", (chunk) => { logStdout && realtimeStdout && chunk && logger && logger[stdoutLogLevel || "debug"](chunk); stdoutChunks.push(Buffer.from(chunk)); }); stderr == null ? void 0 : stderr.on("data", (chunk) => { logStderr && realtimeStdout && chunk && logger && logger[stderrLogLevel || "debug"](chunk); stderrChunks.push(Buffer.from(chunk)); }); const stdoutPromise = new Promise((resolve, reject2) => { stdout == null ? void 0 : stdout.on("end", () => { stdoutOutput = Buffer.concat(stdoutChunks).toString("utf8"); resolve(); }); }); const stderrPromise = new Promise((resolve, reject2) => { stderr == null ? void 0 : stderr.on("end", () => { stderrOutput = Buffer.concat(stderrChunks).toString("utf8"); resolve(); }); }); return { execProcess: child, execPromise: new Promise((resolve, reject2) => { child.addListener("error", reject2); child.addListener("exit", (exitCode) => __async(exports, null, function* () { yield stdoutPromise; yield stderrPromise; if (stdoutOutput && !shouldRealtimeLog && logStdout) { logger[stdoutLogLevel || "debug"](stdoutOutput); } if (exitCode === 0 && stderrOutput && logStderr) { yield logger[stderrLogLevel || "warn"](stderrOutput); } if (exitCode !== 0 && logStderr) { logger[stderrLogLevel || "warn"](`Error exit code of command "${command}" is: ${exitCode}`); reject2(new ExecError(stderrOutput || stdoutOutput, exitCode, stdoutOutput, stderrOutput)); } resolve({ exitCode, stdoutOutput, stderrOutput }); })); }) }; }, "exec"); var src_default = exec6; typeof module2 != "undefined" && (module2.exports = exec6), typeof window != "undefined" && (exec6 = exec6); } }); // node_modules/merge2/index.js var require_merge2 = __commonJS({ "node_modules/merge2/index.js"(exports, module2) { "use strict"; var Stream = require("stream"); var PassThrough = Stream.PassThrough; var slice = Array.prototype.slice; module2.exports = merge22; function merge22() { const streamsQueue = []; const args = slice.call(arguments); let merging = false; let options = args[args.length - 1]; if (options && !Array.isArray(options) && options.pipe == null) { args.pop(); } else { options = {}; } const doEnd = options.end !== false; const doPipeError = options.pipeError === true; if (options.objectMode == null) { options.objectMode = true; } if (options.highWaterMark == null) { options.highWaterMark = 64 * 1024; } const mergedStream = PassThrough(options); function addStream() { for (let i = 0, len = arguments.length; i < len; i++) { streamsQueue.push(pauseStreams(arguments[i], options)); } mergeStream(); return this; } __name(addStream, "addStream"); function mergeStream() { if (merging) { return; } merging = true; let streams = streamsQueue.shift(); if (!streams) { process.nextTick(endStream); return; } if (!Array.isArray(streams)) { streams = [streams]; } let pipesCount = streams.length + 1; function next() { if (--pipesCount > 0) { return; } merging = false; mergeStream(); } __name(next, "next"); function pipe(stream) { function onend() { stream.removeListener("merge2UnpipeEnd", onend); stream.removeListener("end", onend); if (doPipeError) { stream.removeListener("error", onerror); } next(); } __name(onend, "onend"); function onerror(err) { mergedStream.emit("error", err); } __name(onerror, "onerror"); if (stream._readableState.endEmitted) { return next(); } stream.on("merge2UnpipeEnd", onend); stream.on("end", onend); if (doPipeError) { stream.on("error", onerror); } stream.pipe(mergedStream, { end: false }); stream.resume(); } __name(pipe, "pipe"); for (let i = 0; i < streams.length; i++) { pipe(streams[i]); } next(); } __name(mergeStream, "mergeStream"); function endStream() { merging = false; mergedStream.emit("queueDrain"); if (doEnd) { mergedStream.end(); } } __name(endStream, "endStream"); mergedStream.setMaxListeners(0); mergedStream.add = addStream; mergedStream.on("unpipe", function(stream) { stream.emit("merge2UnpipeEnd"); }); if (args.length) { addStream.apply(null, args); } return mergedStream; } __name(merge22, "merge2"); function pauseStreams(streams, options) { if (!Array.isArray(streams)) { if (!streams._readableState && streams.pipe) { streams = streams.pipe(PassThrough(options)); } if (!streams._readableState || !streams.pause || !streams.pipe) { throw new Error("Only readable stream can be merged."); } streams.pause(); } else { for (let i = 0, len = streams.length; i < len; i++) { streams[i] = pauseStreams(streams[i], options); } } return streams; } __name(pauseStreams, "pauseStreams"); } }); // node_modules/fast-glob/out/utils/array.js var require_array = __commonJS({ "node_modules/fast-glob/out/utils/array.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.splitWhen = exports.flatten = void 0; function flatten(items) { return items.reduce((collection, item) => [].concat(collection, item), []); } __name(flatten, "flatten"); exports.flatten = flatten; function splitWhen(items, predicate) { const result = [[]]; let groupIndex = 0; for (const item of items) { if (predicate(item)) { groupIndex++; result[groupIndex] = []; } else { result[groupIndex].push(item); } } return result; } __name(splitWhen, "splitWhen"); exports.splitWhen = splitWhen; } }); // node_modules/fast-glob/out/utils/errno.js var require_errno = __commonJS({ "node_modules/fast-glob/out/utils/errno.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isEnoentCodeError = void 0; function isEnoentCodeError(error) { return error.code === "ENOENT"; } __name(isEnoentCodeError, "isEnoentCodeError"); exports.isEnoentCodeError = isEnoentCodeError; } }); // node_modules/fast-glob/out/utils/fs.js var require_fs = __commonJS({ "node_modules/fast-glob/out/utils/fs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createDirentFromStats = void 0; var DirentFromStats = class { constructor(name, stats) { this.name = name; this.isBlockDevice = stats.isBlockDevice.bind(stats); this.isCharacterDevice = stats.isCharacterDevice.bind(stats); this.isDirectory = stats.isDirectory.bind(stats); this.isFIFO = stats.isFIFO.bind(stats); this.isFile = stats.isFile.bind(stats); this.isSocket = stats.isSocket.bind(stats); this.isSymbolicLink = stats.isSymbolicLink.bind(stats); } }; __name(DirentFromStats, "DirentFromStats"); function createDirentFromStats(name, stats) { return new DirentFromStats(name, stats); } __name(createDirentFromStats, "createDirentFromStats"); exports.createDirentFromStats = createDirentFromStats; } }); // node_modules/fast-glob/out/utils/path.js var require_path = __commonJS({ "node_modules/fast-glob/out/utils/path.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0; var path2 = require("path"); var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; var UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g; function unixify(filepath) { return filepath.replace(/\\/g, "/"); } __name(unixify, "unixify"); exports.unixify = unixify; function makeAbsolute(cwd, filepath) { return path2.resolve(cwd, filepath); } __name(makeAbsolute, "makeAbsolute"); exports.makeAbsolute = makeAbsolute; function escape(pattern) { return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); } __name(escape, "escape"); exports.escape = escape; function removeLeadingDotSegment(entry) { if (entry.charAt(0) === ".") { const secondCharactery = entry.charAt(1); if (secondCharactery === "/" || secondCharactery === "\\") { return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); } } return entry; } __name(removeLeadingDotSegment, "removeLeadingDotSegment"); exports.removeLeadingDotSegment = removeLeadingDotSegment; } }); // node_modules/is-extglob/index.js var require_is_extglob = __commonJS({ "node_modules/is-extglob/index.js"(exports, module2) { module2.exports = /* @__PURE__ */ __name(function isExtglob(str) { if (typeof str !== "string" || str === "") { return false; } var match; while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) { if (match[2]) return true; str = str.slice(match.index + match[0].length); } return false; }, "isExtglob"); } }); // node_modules/is-glob/index.js var require_is_glob = __commonJS({ "node_modules/is-glob/index.js"(exports, module2) { var isExtglob = require_is_extglob(); var chars = { "{": "}", "(": ")", "[": "]" }; var strictCheck = /* @__PURE__ */ __name(function(str) { if (str[0] === "!") { return true; } var index2 = 0; var pipeIndex = -2; var closeSquareIndex = -2; var closeCurlyIndex = -2; var closeParenIndex = -2; var backSlashIndex = -2; while (index2 < str.length) { if (str[index2] === "*") { return true; } if (str[index2 + 1] === "?" && /[\].+)]/.test(str[index2])) { return true; } if (closeSquareIndex !== -1 && str[index2] === "[" && str[index2 + 1] !== "]") { if (closeSquareIndex < index2) { closeSquareIndex = str.indexOf("]", index2); } if (closeSquareIndex > index2) { if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { return true; } backSlashIndex = str.indexOf("\\", index2); if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { return true; } } } if (closeCurlyIndex !== -1 && str[index2] === "{" && str[index2 + 1] !== "}") { closeCurlyIndex = str.indexOf("}", index2); if (closeCurlyIndex > index2) { backSlashIndex = str.indexOf("\\", index2); if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { return true; } } } if (closeParenIndex !== -1 && str[index2] === "(" && str[index2 + 1] === "?" && /[:!=]/.test(str[index2 + 2]) && str[index2 + 3] !== ")") { closeParenIndex = str.indexOf(")", index2); if (closeParenIndex > index2) { backSlashIndex = str.indexOf("\\", index2); if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { return true; } } } if (pipeIndex !== -1 && str[index2] === "(" && str[index2 + 1] !== "|") { if (pipeIndex < index2) { pipeIndex = str.indexOf("|", index2); } if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") { closeParenIndex = str.indexOf(")", pipeIndex); if (closeParenIndex > pipeIndex) { backSlashIndex = str.indexOf("\\", pipeIndex); if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { return true; } } } } if (str[index2] === "\\") { var open = str[index2 + 1]; index2 += 2; var close = chars[open]; if (close) { var n = str.indexOf(close, index2); if (n !== -1) { index2 = n + 1; } } if (str[index2] === "!") { return true; } } else { index2++; } } return false; }, "strictCheck"); var relaxedCheck = /* @__PURE__ */ __name(function(str) { if (str[0] === "!") { return true; } var index2 = 0; while (index2 < str.length) { if (/[*?{}()[\]]/.test(str[index2])) { return true; } if (str[index2] === "\\") { var open = str[index2 + 1]; index2 += 2; var close = chars[open]; if (close) { var n = str.indexOf(close, index2); if (n !== -1) { index2 = n + 1; } } if (str[index2] === "!") { return true; } } else { index2++; } } return false; }, "relaxedCheck"); module2.exports = /* @__PURE__ */ __name(function isGlob(str, options) { if (typeof str !== "string" || str === "") { return false; } if (isExtglob(str)) { return true; } var check = strictCheck; if (options && options.strict === false) { check = relaxedCheck; } return check(str); }, "isGlob"); } }); // node_modules/fast-glob/node_modules/glob-parent/index.js var require_glob_parent = __commonJS({ "node_modules/fast-glob/node_modules/glob-parent/index.js"(exports, module2) { "use strict"; var isGlob = require_is_glob(); var pathPosixDirname = require("path").posix.dirname; var isWin32 = require("os").platform() === "win32"; var slash2 = "/"; var backslash = /\\/g; var enclosure = /[\{\[].*[\}\]]$/; var globby2 = /(^|[^\\])([\{\[]|\([^\)]+$)/; var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; module2.exports = /* @__PURE__ */ __name(function globParent(str, opts) { var options = Object.assign({ flipBackslashes: true }, opts); if (options.flipBackslashes && isWin32 && str.indexOf(slash2) < 0) { str = str.replace(backslash, slash2); } if (enclosure.test(str)) { str += slash2; } str += "a"; do { str = pathPosixDirname(str); } while (isGlob(str) || globby2.test(str)); return str.replace(escaped, "$1"); }, "globParent"); } }); // node_modules/braces/lib/utils.js var require_utils = __commonJS({ "node_modules/braces/lib/utils.js"(exports) { "use strict"; exports.isInteger = (num) => { if (typeof num === "number") { return Number.isInteger(num); } if (typeof num === "string" && num.trim() !== "") { return Number.isInteger(Number(num)); } return false; }; exports.find = (node, type) => node.nodes.find((node2) => node2.type === type); exports.exceedsLimit = (min, max, step = 1, limit) => { if (limit === false) return false; if (!exports.isInteger(min) || !exports.isInteger(max)) return false; return (Number(max) - Number(min)) / Number(step) >= limit; }; exports.escapeNode = (block, n = 0, type) => { let node = block.nodes[n]; if (!node) return; if (type && node.type === type || node.type === "open" || node.type === "close") { if (node.escaped !== true) { node.value = "\\" + node.value; node.escaped = true; } } }; exports.encloseBrace = (node) => { if (node.type !== "brace") return false; if (node.commas >> 0 + node.ranges >> 0 === 0) { node.invalid = true; return true; } return false; }; exports.isInvalidBrace = (block) => { if (block.type !== "brace") return false; if (block.invalid === true || block.dollar) return true; if (block.commas >> 0 + block.ranges >> 0 === 0) { block.invalid = true; return true; } if (block.open !== true || block.close !== true) { block.invalid = true; return true; } return false; }; exports.isOpenOrClose = (node) => { if (node.type === "open" || node.type === "close") { return true; } return node.open === true || node.close === true; }; exports.reduce = (nodes) => nodes.reduce((acc, node) => { if (node.type === "text") acc.push(node.value); if (node.type === "range") node.type = "text"; return acc; }, []); exports.flatten = (...args) => { const result = []; const flat = /* @__PURE__ */ __name((arr) => { for (let i = 0; i < arr.length; i++) { let ele = arr[i]; Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele); } return result; }, "flat"); flat(args); return result; }; } }); // node_modules/braces/lib/stringify.js var require_stringify = __commonJS({ "node_modules/braces/lib/stringify.js"(exports, module2) { "use strict"; var utils = require_utils(); module2.exports = (ast, options = {}) => { let stringify = /* @__PURE__ */ __name((node, parent2 = {}) => { let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent2); let invalidNode = node.invalid === true && options.escapeInvalid === true; let output = ""; if (node.value) { if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { return "\\" + node.value; } return node.value; } if (node.value) { return node.value; } if (node.nodes) { for (let child of node.nodes) { output += stringify(child); } } return output; }, "stringify"); return stringify(ast); }; } }); // node_modules/is-number/index.js var require_is_number = __commonJS({ "node_modules/is-number/index.js"(exports, module2) { "use strict"; module2.exports = function(num) { if (typeof num === "number") { return num - num === 0; } if (typeof num === "string" && num.trim() !== "") { return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); } return false; }; } }); // node_modules/to-regex-range/index.js var require_to_regex_range = __commonJS({ "node_modules/to-regex-range/index.js"(exports, module2) { "use strict"; var isNumber = require_is_number(); var toRegexRange = /* @__PURE__ */ __name((min, max, options) => { if (isNumber(min) === false) { throw new TypeError("toRegexRange: expected the first argument to be a number"); } if (max === void 0 || min === max) { return String(min); } if (isNumber(max) === false) { throw new TypeError("toRegexRange: expected the second argument to be a number."); } let opts = __spreadValues({ relaxZeros: true }, options); if (typeof opts.strictZeros === "boolean") { opts.relaxZeros = opts.strictZeros === false; } let relax = String(opts.relaxZeros); let shorthand = String(opts.shorthand); let capture = String(opts.capture); let wrap2 = String(opts.wrap); let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap2; if (toRegexRange.cache.hasOwnProperty(cacheKey)) { return toRegexRange.cache[cacheKey].result; } let a = Math.min(min, max); let b = Math.max(min, max); if (Math.abs(a - b) === 1) { let result = min + "|" + max; if (opts.capture) { return `(${result})`; } if (opts.wrap === false) { return result; } return `(?:${result})`; } let isPadded = hasPadding(min) || hasPadding(max); let state = { min, max, a, b }; let positives = []; let negatives = []; if (isPadded) { state.isPadded = isPadded; state.maxLen = String(state.max).length; } if (a < 0) { let newMin = b < 0 ? Math.abs(b) : 1; negatives = splitToPatterns(newMin, Math.abs(a), state, opts); a = state.a = 0; } if (b >= 0) { positives = splitToPatterns(a, b, state, opts); } state.negatives = negatives; state.positives = positives; state.result = collatePatterns(negatives, positives, opts); if (opts.capture === true) { state.result = `(${state.result})`; } else if (opts.wrap !== false && positives.length + negatives.length > 1) { state.result = `(?:${state.result})`; } toRegexRange.cache[cacheKey] = state; return state.result; }, "toRegexRange"); function collatePatterns(neg, pos, options) { let onlyNegative = filterPatterns(neg, pos, "-", false, options) || []; let onlyPositive = filterPatterns(pos, neg, "", false, options) || []; let intersected = filterPatterns(neg, pos, "-?", true, options) || []; let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); return subpatterns.join("|"); } __name(collatePatterns, "collatePatterns"); function splitToRanges(min, max) { let nines = 1; let zeros = 1; let stop = countNines(min, nines); let stops = /* @__PURE__ */ new Set([max]); while (min <= stop && stop <= max) { stops.add(stop); nines += 1; stop = countNines(min, nines); } stop = countZeros(max + 1, zeros) - 1; while (min < stop && stop <= max) { stops.add(stop); zeros += 1; stop = countZeros(max + 1, zeros) - 1; } stops = [...stops]; stops.sort(compare); return stops; } __name(splitToRanges, "splitToRanges"); function rangeToPattern(start, stop, options) { if (start === stop) { return { pattern: start, count: [], digits: 0 }; } let zipped = zip(start, stop); let digits = zipped.length; let pattern = ""; let count = 0; for (let i = 0; i < digits; i++) { let [startDigit, stopDigit] = zipped[i]; if (startDigit === stopDigit) { pattern += startDigit; } else if (startDigit !== "0" || stopDigit !== "9") { pattern += toCharacterClass(startDigit, stopDigit, options); } else { count++; } } if (count) { pattern += options.shorthand === true ? "\\d" : "[0-9]"; } return { pattern, count: [count], digits }; } __name(rangeToPattern, "rangeToPattern"); function splitToPatterns(min, max, tok, options) { let ranges = splitToRanges(min, max); let tokens = []; let start = min; let prev; for (let i = 0; i < ranges.length; i++) { let max2 = ranges[i]; let obj = rangeToPattern(String(start), String(max2), options); let zeros = ""; if (!tok.isPadded && prev && prev.pattern === obj.pattern) { if (prev.count.length > 1) { prev.count.pop(); } prev.count.push(obj.count[0]); prev.string = prev.pattern + toQuantifier(prev.count); start = max2 + 1; continue; } if (tok.isPadded) { zeros = padZeros(max2, tok, options); } obj.string = zeros + obj.pattern + toQuantifier(obj.count); tokens.push(obj); start = max2 + 1; prev = obj; } return tokens; } __name(splitToPatterns, "splitToPatterns"); function filterPatterns(arr, comparison, prefix, intersection, options) { let result = []; for (let ele of arr) { let { string } = ele; if (!intersection && !contains(comparison, "string", string)) { result.push(prefix + string); } if (intersection && contains(comparison, "string", string)) { result.push(prefix + string); } } return result; } __name(filterPatterns, "filterPatterns"); function zip(a, b) { let arr = []; for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); return arr; } __name(zip, "zip"); function compare(a, b) { return a > b ? 1 : b > a ? -1 : 0; } __name(compare, "compare"); function contains(arr, key, val) { return arr.some((ele) => ele[key] === val); } __name(contains, "contains"); function countNines(min, len) { return Number(String(min).slice(0, -len) + "9".repeat(len)); } __name(countNines, "countNines"); function countZeros(integer, zeros) { return integer - integer % Math.pow(10, zeros); } __name(countZeros, "countZeros"); function toQuantifier(digits) { let [start = 0, stop = ""] = digits; if (stop || start > 1) { return `{${start + (stop ? "," + stop : "")}}`; } return ""; } __name(toQuantifier, "toQuantifier"); function toCharacterClass(a, b, options) { return `[${a}${b - a === 1 ? "" : "-"}${b}]`; } __name(toCharacterClass, "toCharacterClass"); function hasPadding(str) { return /^-?(0+)\d/.test(str); } __name(hasPadding, "hasPadding"); function padZeros(value, tok, options) { if (!tok.isPadded) { return value; } let diff = Math.abs(tok.maxLen - String(value).length); let relax = options.relaxZeros !== false; switch (diff) { case 0: return ""; case 1: return relax ? "0?" : "0"; case 2: return relax ? "0{0,2}" : "00"; default: { return relax ? `0{0,${diff}}` : `0{${diff}}`; } } } __name(padZeros, "padZeros"); toRegexRange.cache = {}; toRegexRange.clearCache = () => toRegexRange.cache = {}; module2.exports = toRegexRange; } }); // node_modules/fill-range/index.js var require_fill_range = __commonJS({ "node_modules/fill-range/index.js"(exports, module2) { "use strict"; var util2 = require("util"); var toRegexRange = require_to_regex_range(); var isObject = /* @__PURE__ */ __name((val) => val !== null && typeof val === "object" && !Array.isArray(val), "isObject"); var transform2 = /* @__PURE__ */ __name((toNumber) => { return (value) => toNumber === true ? Number(value) : String(value); }, "transform"); var isValidValue = /* @__PURE__ */ __name((value) => { return typeof value === "number" || typeof value === "string" && value !== ""; }, "isValidValue"); var isNumber = /* @__PURE__ */ __name((num) => Number.isInteger(+num), "isNumber"); var zeros = /* @__PURE__ */ __name((input) => { let value = `${input}`; let index2 = -1; if (value[0] === "-") value = value.slice(1); if (value === "0") return false; while (value[++index2] === "0") ; return index2 > 0; }, "zeros"); var stringify = /* @__PURE__ */ __name((start, end, options) => { if (typeof start === "string" || typeof end === "string") { return true; } return options.stringify === true; }, "stringify"); var pad = /* @__PURE__ */ __name((input, maxLength, toNumber) => { if (maxLength > 0) { let dash = input[0] === "-" ? "-" : ""; if (dash) input = input.slice(1); input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0"); } if (toNumber === false) { return String(input); } return input; }, "pad"); var toMaxLen = /* @__PURE__ */ __name((input, maxLength) => { let negative = input[0] === "-" ? "-" : ""; if (negative) { input = input.slice(1); maxLength--; } while (input.length < maxLength) input = "0" + input; return negative ? "-" + input : input; }, "toMaxLen"); var toSequence = /* @__PURE__ */ __name((parts, options) => { parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); let prefix = options.capture ? "" : "?:"; let positives = ""; let negatives = ""; let result; if (parts.positives.length) { positives = parts.positives.join("|"); } if (parts.negatives.length) { negatives = `-(${prefix}${parts.negatives.join("|")})`; } if (positives && negatives) { result = `${positives}|${negatives}`; } else { result = positives || negatives; } if (options.wrap) { return `(${prefix}${result})`; } return result; }, "toSequence"); var toRange = /* @__PURE__ */ __name((a, b, isNumbers, options) => { if (isNumbers) { return toRegexRange(a, b, __spreadValues({ wrap: false }, options)); } let start = String.fromCharCode(a); if (a === b) return start; let stop = String.fromCharCode(b); return `[${start}-${stop}]`; }, "toRange"); var toRegex = /* @__PURE__ */ __name((start, end, options) => { if (Array.isArray(start)) { let wrap2 = options.wrap === true; let prefix = options.capture ? "" : "?:"; return wrap2 ? `(${prefix}${start.join("|")})` : start.join("|"); } return toRegexRange(start, end, options); }, "toRegex"); var rangeError = /* @__PURE__ */ __name((...args) => { return new RangeError("Invalid range arguments: " + util2.inspect(...args)); }, "rangeError"); var invalidRange = /* @__PURE__ */ __name((start, end, options) => { if (options.strictRanges === true) throw rangeError([start, end]); return []; }, "invalidRange"); var invalidStep = /* @__PURE__ */ __name((step, options) => { if (options.strictRanges === true) { throw new TypeError(`Expected step "${step}" to be a number`); } return []; }, "invalidStep"); var fillNumbers = /* @__PURE__ */ __name((start, end, step = 1, options = {}) => { let a = Number(start); let b = Number(end); if (!Number.isInteger(a) || !Number.isInteger(b)) { if (options.strictRanges === true) throw rangeError([start, end]); return []; } if (a === 0) a = 0; if (b === 0) b = 0; let descending = a > b; let startString = String(start); let endString = String(end); let stepString = String(step); step = Math.max(Math.abs(step), 1); let padded = zeros(startString) || zeros(endString) || zeros(stepString); let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; let toNumber = padded === false && stringify(start, end, options) === false; let format = options.transform || transform2(toNumber); if (options.toRegex && step === 1) { return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); } let parts = { negatives: [], positives: [] }; let push = /* @__PURE__ */ __name((num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num)), "push"); let range2 = []; let index2 = 0; while (descending ? a >= b : a <= b) { if (options.toRegex === true && step > 1) { push(a); } else { range2.push(pad(format(a, index2), maxLen, toNumber)); } a = descending ? a - step : a + step; index2++; } if (options.toRegex === true) { return step > 1 ? toSequence(parts, options) : toRegex(range2, null, __spreadValues({ wrap: false }, options)); } return range2; }, "fillNumbers"); var fillLetters = /* @__PURE__ */ __name((start, end, step = 1, options = {}) => { if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) { return invalidRange(start, end, options); } let format = options.transform || ((val) => String.fromCharCode(val)); let a = `${start}`.charCodeAt(0); let b = `${end}`.charCodeAt(0); let descending = a > b; let min = Math.min(a, b); let max = Math.max(a, b); if (options.toRegex && step === 1) { return toRange(min, max, false, options); } let range2 = []; let index2 = 0; while (descending ? a >= b : a <= b) { range2.push(format(a, index2)); a = descending ? a - step : a + step; index2++; } if (options.toRegex === true) { return toRegex(range2, null, { wrap: false, options }); } return range2; }, "fillLetters"); var fill = /* @__PURE__ */ __name((start, end, step, options = {}) => { if (end == null && isValidValue(start)) { return [start]; } if (!isValidValue(start) || !isValidValue(end)) { return invalidRange(start, end, options); } if (typeof step === "function") { return fill(start, end, 1, { transform: step }); } if (isObject(step)) { return fill(start, end, 0, step); } let opts = __spreadValues({}, options); if (opts.capture === true) opts.wrap = true; step = step || opts.step || 1; if (!isNumber(step)) { if (step != null && !isObject(step)) return invalidStep(step, opts); return fill(start, end, 1, step); } if (isNumber(start) && isNumber(end)) { return fillNumbers(start, end, step, opts); } return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); }, "fill"); module2.exports = fill; } }); // node_modules/braces/lib/compile.js var require_compile = __commonJS({ "node_modules/braces/lib/compile.js"(exports, module2) { "use strict"; var fill = require_fill_range(); var utils = require_utils(); var compile = /* @__PURE__ */ __name((ast, options = {}) => { let walk = /* @__PURE__ */ __name((node, parent2 = {}) => { let invalidBlock = utils.isInvalidBrace(parent2); let invalidNode = node.invalid === true && options.escapeInvalid === true; let invalid = invalidBlock === true || invalidNode === true; let prefix = options.escapeInvalid === true ? "\\" : ""; let output = ""; if (node.isOpen === true) { return prefix + node.value; } if (node.isClose === true) { return prefix + node.value; } if (node.type === "open") { return invalid ? prefix + node.value : "("; } if (node.type === "close") { return invalid ? prefix + node.value : ")"; } if (node.type === "comma") { return node.prev.type === "comma" ? "" : invalid ? node.value : "|"; } if (node.value) { return node.value; } if (node.nodes && node.ranges > 0) { let args = utils.reduce(node.nodes); let range2 = fill(...args, __spreadProps(__spreadValues({}, options), { wrap: false, toRegex: true })); if (range2.length !== 0) { return args.length > 1 && range2.length > 1 ? `(${range2})` : range2; } } if (node.nodes) { for (let child of node.nodes) { output += walk(child, node); } } return output; }, "walk"); return walk(ast); }, "compile"); module2.exports = compile; } }); // node_modules/braces/lib/expand.js var require_expand = __commonJS({ "node_modules/braces/lib/expand.js"(exports, module2) { "use strict"; var fill = require_fill_range(); var stringify = require_stringify(); var utils = require_utils(); var append = /* @__PURE__ */ __name((queue2 = "", stash = "", enclose = false) => { let result = []; queue2 = [].concat(queue2); stash = [].concat(stash); if (!stash.length) return queue2; if (!queue2.length) { return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash; } for (let item of queue2) { if (Array.isArray(item)) { for (let value of item) { result.push(append(value, stash, enclose)); } } else { for (let ele of stash) { if (enclose === true && typeof ele === "string") ele = `{${ele}}`; result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); } } } return utils.flatten(result); }, "append"); var expand = /* @__PURE__ */ __name((ast, options = {}) => { let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit; let walk = /* @__PURE__ */ __name((node, parent2 = {}) => { node.queue = []; let p = parent2; let q = parent2.queue; while (p.type !== "brace" && p.type !== "root" && p.parent) { p = p.parent; q = p.queue; } if (node.invalid || node.dollar) { q.push(append(q.pop(), stringify(node, options))); return; } if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) { q.push(append(q.pop(), ["{}"])); return; } if (node.nodes && node.ranges > 0) { let args = utils.reduce(node.nodes); if (utils.exceedsLimit(...args, options.step, rangeLimit)) { throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit."); } let range2 = fill(...args, options); if (range2.length === 0) { range2 = stringify(node, options); } q.push(append(q.pop(), range2)); node.nodes = []; return; } let enclose = utils.encloseBrace(node); let queue2 = node.queue; let block = node; while (block.type !== "brace" && block.type !== "root" && block.parent) { block = block.parent; queue2 = block.queue; } for (let i = 0; i < node.nodes.length; i++) { let child = node.nodes[i]; if (child.type === "comma" && node.type === "brace") { if (i === 1) queue2.push(""); queue2.push(""); continue; } if (child.type === "close") { q.push(append(q.pop(), queue2, enclose)); continue; } if (child.value && child.type !== "open") { queue2.push(append(queue2.pop(), child.value)); continue; } if (child.nodes) { walk(child, node); } } return queue2; }, "walk"); return utils.flatten(walk(ast)); }, "expand"); module2.exports = expand; } }); // node_modules/braces/lib/constants.js var require_constants = __commonJS({ "node_modules/braces/lib/constants.js"(exports, module2) { "use strict"; module2.exports = { MAX_LENGTH: 1024 * 64, CHAR_0: "0", CHAR_9: "9", CHAR_UPPERCASE_A: "A", CHAR_LOWERCASE_A: "a", CHAR_UPPERCASE_Z: "Z", CHAR_LOWERCASE_Z: "z", CHAR_LEFT_PARENTHESES: "(", CHAR_RIGHT_PARENTHESES: ")", CHAR_ASTERISK: "*", CHAR_AMPERSAND: "&", CHAR_AT: "@", CHAR_BACKSLASH: "\\", CHAR_BACKTICK: "`", CHAR_CARRIAGE_RETURN: "\r", CHAR_CIRCUMFLEX_ACCENT: "^", CHAR_COLON: ":", CHAR_COMMA: ",", CHAR_DOLLAR: "$", CHAR_DOT: ".", CHAR_DOUBLE_QUOTE: '"', CHAR_EQUAL: "=", CHAR_EXCLAMATION_MARK: "!", CHAR_FORM_FEED: "\f", CHAR_FORWARD_SLASH: "/", CHAR_HASH: "#", CHAR_HYPHEN_MINUS: "-", CHAR_LEFT_ANGLE_BRACKET: "<", CHAR_LEFT_CURLY_BRACE: "{", CHAR_LEFT_SQUARE_BRACKET: "[", CHAR_LINE_FEED: "\n", CHAR_NO_BREAK_SPACE: "\xA0", CHAR_PERCENT: "%", CHAR_PLUS: "+", CHAR_QUESTION_MARK: "?", CHAR_RIGHT_ANGLE_BRACKET: ">", CHAR_RIGHT_CURLY_BRACE: "}", CHAR_RIGHT_SQUARE_BRACKET: "]", CHAR_SEMICOLON: ";", CHAR_SINGLE_QUOTE: "'", CHAR_SPACE: " ", CHAR_TAB: " ", CHAR_UNDERSCORE: "_", CHAR_VERTICAL_LINE: "|", CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF" }; } }); // node_modules/braces/lib/parse.js var require_parse = __commonJS({ "node_modules/braces/lib/parse.js"(exports, module2) { "use strict"; var stringify = require_stringify(); var { MAX_LENGTH, CHAR_BACKSLASH, CHAR_BACKTICK, CHAR_COMMA, CHAR_DOT, CHAR_LEFT_PARENTHESES, CHAR_RIGHT_PARENTHESES, CHAR_LEFT_CURLY_BRACE, CHAR_RIGHT_CURLY_BRACE, CHAR_LEFT_SQUARE_BRACKET, CHAR_RIGHT_SQUARE_BRACKET, CHAR_DOUBLE_QUOTE, CHAR_SINGLE_QUOTE, CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = require_constants(); var parse = /* @__PURE__ */ __name((input, options = {}) => { if (typeof input !== "string") { throw new TypeError("Expected a string"); } let opts = options || {}; let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; if (input.length > max) { throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); } let ast = { type: "root", input, nodes: [] }; let stack = [ast]; let block = ast; let prev = ast; let brackets = 0; let length = input.length; let index2 = 0; let depth = 0; let value; let memo = {}; const advance = /* @__PURE__ */ __name(() => input[index2++], "advance"); const push = /* @__PURE__ */ __name((node) => { if (node.type === "text" && prev.type === "dot") { prev.type = "text"; } if (prev && prev.type === "text" && node.type === "text") { prev.value += node.value; return; } block.nodes.push(node); node.parent = block; node.prev = prev; prev = node; return node; }, "push"); push({ type: "bos" }); while (index2 < length) { block = stack[stack.length - 1]; value = advance(); if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { continue; } if (value === CHAR_BACKSLASH) { push({ type: "text", value: (options.keepEscaping ? value : "") + advance() }); continue; } if (value === CHAR_RIGHT_SQUARE_BRACKET) { push({ type: "text", value: "\\" + value }); continue; } if (value === CHAR_LEFT_SQUARE_BRACKET) { brackets++; let closed = true; let next; while (index2 < length && (next = advance())) { value += next; if (next === CHAR_LEFT_SQUARE_BRACKET) { brackets++; continue; } if (next === CHAR_BACKSLASH) { value += advance(); continue; } if (next === CHAR_RIGHT_SQUARE_BRACKET) { brackets--; if (brackets === 0) { break; } } } push({ type: "text", value }); continue; } if (value === CHAR_LEFT_PARENTHESES) { block = push({ type: "paren", nodes: [] }); stack.push(block); push({ type: "text", value }); continue; } if (value === CHAR_RIGHT_PARENTHESES) { if (block.type !== "paren") { push({ type: "text", value }); continue; } block = stack.pop(); push({ type: "text", value }); block = stack[stack.length - 1]; continue; } if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { let open = value; let next; if (options.keepQuotes !== true) { value = ""; } while (index2 < length && (next = advance())) { if (next === CHAR_BACKSLASH) { value += next + advance(); continue; } if (next === open) { if (options.keepQuotes === true) value += next; break; } value += next; } push({ type: "text", value }); continue; } if (value === CHAR_LEFT_CURLY_BRACE) { depth++; let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true; let brace = { type: "brace", open: true, close: false, dollar, depth, commas: 0, ranges: 0, nodes: [] }; block = push(brace); stack.push(block); push({ type: "open", value }); continue; } if (value === CHAR_RIGHT_CURLY_BRACE) { if (block.type !== "brace") { push({ type: "text", value }); continue; } let type = "close"; block = stack.pop(); block.close = true; push({ type, value }); depth--; block = stack[stack.length - 1]; continue; } if (value === CHAR_COMMA && depth > 0) { if (block.ranges > 0) { block.ranges = 0; let open = block.nodes.shift(); block.nodes = [open, { type: "text", value: stringify(block) }]; } push({ type: "comma", value }); block.commas++; continue; } if (value === CHAR_DOT && depth > 0 && block.commas === 0) { let siblings = block.nodes; if (depth === 0 || siblings.length === 0) { push({ type: "text", value }); continue; } if (prev.type === "dot") { block.range = []; prev.value += value; prev.type = "range"; if (block.nodes.length !== 3 && block.nodes.length !== 5) { block.invalid = true; block.ranges = 0; prev.type = "text"; continue; } block.ranges++; block.args = []; continue; } if (prev.type === "range") { siblings.pop(); let before = siblings[siblings.length - 1]; before.value += prev.value + value; prev = before; block.ranges--; continue; } push({ type: "dot", value }); continue; } push({ type: "text", value }); } do { block = stack.pop(); if (block.type !== "root") { block.nodes.forEach((node) => { if (!node.nodes) { if (node.type === "open") node.isOpen = true; if (node.type === "close") node.isClose = true; if (!node.nodes) node.type = "text"; node.invalid = true; } }); let parent2 = stack[stack.length - 1]; let index3 = parent2.nodes.indexOf(block); parent2.nodes.splice(index3, 1, ...block.nodes); } } while (stack.length > 0); push({ type: "eos" }); return ast; }, "parse"); module2.exports = parse; } }); // node_modules/braces/index.js var require_braces = __commonJS({ "node_modules/braces/index.js"(exports, module2) { "use strict"; var stringify = require_stringify(); var compile = require_compile(); var expand = require_expand(); var parse = require_parse(); var braces = /* @__PURE__ */ __name((input, options = {}) => { let output = []; if (Array.isArray(input)) { for (let pattern of input) { let result = braces.create(pattern, options); if (Array.isArray(result)) { output.push(...result); } else { output.push(result); } } } else { output = [].concat(braces.create(input, options)); } if (options && options.expand === true && options.nodupes === true) { output = [...new Set(output)]; } return output; }, "braces"); braces.parse = (input, options = {}) => parse(input, options); braces.stringify = (input, options = {}) => { if (typeof input === "string") { return stringify(braces.parse(input, options), options); } return stringify(input, options); }; braces.compile = (input, options = {}) => { if (typeof input === "string") { input = braces.parse(input, options); } return compile(input, options); }; braces.expand = (input, options = {}) => { if (typeof input === "string") { input = braces.parse(input, options); } let result = expand(input, options); if (options.noempty === true) { result = result.filter(Boolean); } if (options.nodupes === true) { result = [...new Set(result)]; } return result; }; braces.create = (input, options = {}) => { if (input === "" || input.length < 3) { return [input]; } return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options); }; module2.exports = braces; } }); // node_modules/picomatch/lib/constants.js var require_constants2 = __commonJS({ "node_modules/picomatch/lib/constants.js"(exports, module2) { "use strict"; var path2 = require("path"); var WIN_SLASH = "\\\\/"; var WIN_NO_SLASH = `[^${WIN_SLASH}]`; var DOT_LITERAL = "\\."; var PLUS_LITERAL = "\\+"; var QMARK_LITERAL = "\\?"; var SLASH_LITERAL = "\\/"; var ONE_CHAR = "(?=.)"; var QMARK = "[^/]"; var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; var START_ANCHOR = `(?:^|${SLASH_LITERAL})`; var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; var NO_DOT = `(?!${DOT_LITERAL})`; var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; var STAR = `${QMARK}*?`; var POSIX_CHARS = { DOT_LITERAL, PLUS_LITERAL, QMARK_LITERAL, SLASH_LITERAL, ONE_CHAR, QMARK, END_ANCHOR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK_NO_DOT, STAR, START_ANCHOR }; var WINDOWS_CHARS = __spreadProps(__spreadValues({}, POSIX_CHARS), { SLASH_LITERAL: `[${WIN_SLASH}]`, QMARK: WIN_NO_SLASH, STAR: `${WIN_NO_SLASH}*?`, DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, NO_DOT: `(?!${DOT_LITERAL})`, NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, QMARK_NO_DOT: `[^.${WIN_SLASH}]`, START_ANCHOR: `(?:^|[${WIN_SLASH}])`, END_ANCHOR: `(?:[${WIN_SLASH}]|$)` }); var POSIX_REGEX_SOURCE = { alnum: "a-zA-Z0-9", alpha: "a-zA-Z", ascii: "\\x00-\\x7F", blank: " \\t", cntrl: "\\x00-\\x1F\\x7F", digit: "0-9", graph: "\\x21-\\x7E", lower: "a-z", print: "\\x20-\\x7E ", punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~", space: " \\t\\r\\n\\v\\f", upper: "A-Z", word: "A-Za-z0-9_", xdigit: "A-Fa-f0-9" }; module2.exports = { MAX_LENGTH: 1024 * 64, POSIX_REGEX_SOURCE, REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, REPLACEMENTS: { "***": "*", "**/**": "**", "**/**/**": "**" }, CHAR_0: 48, CHAR_9: 57, CHAR_UPPERCASE_A: 65, CHAR_LOWERCASE_A: 97, CHAR_UPPERCASE_Z: 90, CHAR_LOWERCASE_Z: 122, CHAR_LEFT_PARENTHESES: 40, CHAR_RIGHT_PARENTHESES: 41, CHAR_ASTERISK: 42, CHAR_AMPERSAND: 38, CHAR_AT: 64, CHAR_BACKWARD_SLASH: 92, CHAR_CARRIAGE_RETURN: 13, CHAR_CIRCUMFLEX_ACCENT: 94, CHAR_COLON: 58, CHAR_COMMA: 44, CHAR_DOT: 46, CHAR_DOUBLE_QUOTE: 34, CHAR_EQUAL: 61, CHAR_EXCLAMATION_MARK: 33, CHAR_FORM_FEED: 12, CHAR_FORWARD_SLASH: 47, CHAR_GRAVE_ACCENT: 96, CHAR_HASH: 35, CHAR_HYPHEN_MINUS: 45, CHAR_LEFT_ANGLE_BRACKET: 60, CHAR_LEFT_CURLY_BRACE: 123, CHAR_LEFT_SQUARE_BRACKET: 91, CHAR_LINE_FEED: 10, CHAR_NO_BREAK_SPACE: 160, CHAR_PERCENT: 37, CHAR_PLUS: 43, CHAR_QUESTION_MARK: 63, CHAR_RIGHT_ANGLE_BRACKET: 62, CHAR_RIGHT_CURLY_BRACE: 125, CHAR_RIGHT_SQUARE_BRACKET: 93, CHAR_SEMICOLON: 59, CHAR_SINGLE_QUOTE: 39, CHAR_SPACE: 32, CHAR_TAB: 9, CHAR_UNDERSCORE: 95, CHAR_VERTICAL_LINE: 124, CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, SEP: path2.sep, extglobChars(chars) { return { "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` }, "?": { type: "qmark", open: "(?:", close: ")?" }, "+": { type: "plus", open: "(?:", close: ")+" }, "*": { type: "star", open: "(?:", close: ")*" }, "@": { type: "at", open: "(?:", close: ")" } }; }, globChars(win32) { return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; } }; } }); // node_modules/picomatch/lib/utils.js var require_utils2 = __commonJS({ "node_modules/picomatch/lib/utils.js"(exports) { "use strict"; var path2 = require("path"); var win32 = process.platform === "win32"; var { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants2(); exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val); exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str); exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str); exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1"); exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/"); exports.removeBackslashes = (str) => { return str.replace(REGEX_REMOVE_BACKSLASH, (match) => { return match === "\\" ? "" : match; }); }; exports.supportsLookbehinds = () => { const segs = process.version.slice(1).split(".").map(Number); if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) { return true; } return false; }; exports.isWindows = (options) => { if (options && typeof options.windows === "boolean") { return options.windows; } return win32 === true || path2.sep === "\\"; }; exports.escapeLast = (input, char, lastIdx) => { const idx = input.lastIndexOf(char, lastIdx); if (idx === -1) return input; if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1); return `${input.slice(0, idx)}\\${input.slice(idx)}`; }; exports.removePrefix = (input, state = {}) => { let output = input; if (output.startsWith("./")) { output = output.slice(2); state.prefix = "./"; } return output; }; exports.wrapOutput = (input, state = {}, options = {}) => { const prepend = options.contains ? "" : "^"; const append = options.contains ? "" : "$"; let output = `${prepend}(?:${input})${append}`; if (state.negated === true) { output = `(?:^(?!${output}).*$)`; } return output; }; } }); // node_modules/picomatch/lib/scan.js var require_scan = __commonJS({ "node_modules/picomatch/lib/scan.js"(exports, module2) { "use strict"; var utils = require_utils2(); var { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants2(); var isPathSeparator = /* @__PURE__ */ __name((code) => { return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; }, "isPathSeparator"); var depth = /* @__PURE__ */ __name((token) => { if (token.isPrefix !== true) { token.depth = token.isGlobstar ? Infinity : 1; } }, "depth"); var scan = /* @__PURE__ */ __name((input, options) => { const opts = options || {}; const length = input.length - 1; const scanToEnd = opts.parts === true || opts.scanToEnd === true; const slashes = []; const tokens = []; const parts = []; let str = input; let index2 = -1; let start = 0; let lastIndex = 0; let isBrace = false; let isBracket = false; let isGlob = false; let isExtglob = false; let isGlobstar = false; let braceEscaped = false; let backslashes = false; let negated = false; let negatedExtglob = false; let finished = false; let braces = 0; let prev; let code; let token = { value: "", depth: 0, isGlob: false }; const eos = /* @__PURE__ */ __name(() => index2 >= length, "eos"); const peek = /* @__PURE__ */ __name(() => str.charCodeAt(index2 + 1), "peek"); const advance = /* @__PURE__ */ __name(() => { prev = code; return str.charCodeAt(++index2); }, "advance"); while (index2 < length) { code = advance(); let next; if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; code = advance(); if (code === CHAR_LEFT_CURLY_BRACE) { braceEscaped = true; } continue; } if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { braces++; while (eos() !== true && (code = advance())) { if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; advance(); continue; } if (code === CHAR_LEFT_CURLY_BRACE) { braces++; continue; } if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { isBrace = token.isBrace = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (braceEscaped !== true && code === CHAR_COMMA) { isBrace = token.isBrace = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_RIGHT_CURLY_BRACE) { braces--; if (braces === 0) { braceEscaped = false; isBrace = token.isBrace = true; finished = true; break; } } } if (scanToEnd === true) { continue; } break; } if (code === CHAR_FORWARD_SLASH) { slashes.push(index2); tokens.push(token); token = { value: "", depth: 0, isGlob: false }; if (finished === true) continue; if (prev === CHAR_DOT && index2 === start + 1) { start += 2; continue; } lastIndex = index2 + 1; continue; } if (opts.noext !== true) { const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK; if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { isGlob = token.isGlob = true; isExtglob = token.isExtglob = true; finished = true; if (code === CHAR_EXCLAMATION_MARK && index2 === start) { negatedExtglob = true; } if (scanToEnd === true) { while (eos() !== true && (code = advance())) { if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; code = advance(); continue; } if (code === CHAR_RIGHT_PARENTHESES) { isGlob = token.isGlob = true; finished = true; break; } } continue; } break; } } if (code === CHAR_ASTERISK) { if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_QUESTION_MARK) { isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_LEFT_SQUARE_BRACKET) { while (eos() !== true && (next = advance())) { if (next === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; advance(); continue; } if (next === CHAR_RIGHT_SQUARE_BRACKET) { isBracket = token.isBracket = true; isGlob = token.isGlob = true; finished = true; break; } } if (scanToEnd === true) { continue; } break; } if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index2 === start) { negated = token.negated = true; start++; continue; } if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { isGlob = token.isGlob = true; if (scanToEnd === true) { while (eos() !== true && (code = advance())) { if (code === CHAR_LEFT_PARENTHESES) { backslashes = token.backslashes = true; code = advance(); continue; } if (code === CHAR_RIGHT_PARENTHESES) { finished = true; break; } } continue; } break; } if (isGlob === true) { finished = true; if (scanToEnd === true) { continue; } break; } } if (opts.noext === true) { isExtglob = false; isGlob = false; } let base = str; let prefix = ""; let glob = ""; if (start > 0) { prefix = str.slice(0, start); str = str.slice(start); lastIndex -= start; } if (base && isGlob === true && lastIndex > 0) { base = str.slice(0, lastIndex); glob = str.slice(lastIndex); } else if (isGlob === true) { base = ""; glob = str; } else { base = str; } if (base && base !== "" && base !== "/" && base !== str) { if (isPathSeparator(base.charCodeAt(base.length - 1))) { base = base.slice(0, -1); } } if (opts.unescape === true) { if (glob) glob = utils.removeBackslashes(glob); if (base && backslashes === true) { base = utils.removeBackslashes(base); } } const state = { prefix, input, start, base, glob, isBrace, isBracket, isGlob, isExtglob, isGlobstar, negated, negatedExtglob }; if (opts.tokens === true) { state.maxDepth = 0; if (!isPathSeparator(code)) { tokens.push(token); } state.tokens = tokens; } if (opts.parts === true || opts.tokens === true) { let prevIndex; for (let idx = 0; idx < slashes.length; idx++) { const n = prevIndex ? prevIndex + 1 : start; const i = slashes[idx]; const value = input.slice(n, i); if (opts.tokens) { if (idx === 0 && start !== 0) { tokens[idx].isPrefix = true; tokens[idx].value = prefix; } else { tokens[idx].value = value; } depth(tokens[idx]); state.maxDepth += tokens[idx].depth; } if (idx !== 0 || value !== "") { parts.push(value); } prevIndex = i; } if (prevIndex && prevIndex + 1 < input.length) { const value = input.slice(prevIndex + 1); parts.push(value); if (opts.tokens) { tokens[tokens.length - 1].value = value; depth(tokens[tokens.length - 1]); state.maxDepth += tokens[tokens.length - 1].depth; } } state.slashes = slashes; state.parts = parts; } return state; }, "scan"); module2.exports = scan; } }); // node_modules/picomatch/lib/parse.js var require_parse2 = __commonJS({ "node_modules/picomatch/lib/parse.js"(exports, module2) { "use strict"; var constants = require_constants2(); var utils = require_utils2(); var { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants; var expandRange = /* @__PURE__ */ __name((args, options) => { if (typeof options.expandRange === "function") { return options.expandRange(...args, options); } args.sort(); const value = `[${args.join("-")}]`; try { new RegExp(value); } catch (ex) { return args.map((v) => utils.escapeRegex(v)).join(".."); } return value; }, "expandRange"); var syntaxError = /* @__PURE__ */ __name((type, char) => { return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; }, "syntaxError"); var parse = /* @__PURE__ */ __name((input, options) => { if (typeof input !== "string") { throw new TypeError("Expected a string"); } input = REPLACEMENTS[input] || input; const opts = __spreadValues({}, options); const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; let len = input.length; if (len > max) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } const bos = { type: "bos", value: "", output: opts.prepend || "" }; const tokens = [bos]; const capture = opts.capture ? "" : "?:"; const win32 = utils.isWindows(options); const PLATFORM_CHARS = constants.globChars(win32); const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS; const globstar = /* @__PURE__ */ __name((opts2) => { return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }, "globstar"); const nodot = opts.dot ? "" : NO_DOT; const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; let star = opts.bash === true ? globstar(opts) : STAR; if (opts.capture) { star = `(${star})`; } if (typeof opts.noext === "boolean") { opts.noextglob = opts.noext; } const state = { input, index: -1, start: 0, dot: opts.dot === true, consumed: "", output: "", prefix: "", backtrack: false, negated: false, brackets: 0, braces: 0, parens: 0, quotes: 0, globstar: false, tokens }; input = utils.removePrefix(input, state); len = input.length; const extglobs = []; const braces = []; const stack = []; let prev = bos; let value; const eos = /* @__PURE__ */ __name(() => state.index === len - 1, "eos"); const peek = state.peek = (n = 1) => input[state.index + n]; const advance = state.advance = () => input[++state.index] || ""; const remaining = /* @__PURE__ */ __name(() => input.slice(state.index + 1), "remaining"); const consume = /* @__PURE__ */ __name((value2 = "", num = 0) => { state.consumed += value2; state.index += num; }, "consume"); const append = /* @__PURE__ */ __name((token) => { state.output += token.output != null ? token.output : token.value; consume(token.value); }, "append"); const negate = /* @__PURE__ */ __name(() => { let count = 1; while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) { advance(); state.start++; count++; } if (count % 2 === 0) { return false; } state.negated = true; state.start++; return true; }, "negate"); const increment = /* @__PURE__ */ __name((type) => { state[type]++; stack.push(type); }, "increment"); const decrement = /* @__PURE__ */ __name((type) => { state[type]--; stack.pop(); }, "decrement"); const push = /* @__PURE__ */ __name((tok) => { if (prev.type === "globstar") { const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace"); const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren"); if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) { state.output = state.output.slice(0, -prev.output.length); prev.type = "star"; prev.value = "*"; prev.output = star; state.output += prev.output; } } if (extglobs.length && tok.type !== "paren") { extglobs[extglobs.length - 1].inner += tok.value; } if (tok.value || tok.output) append(tok); if (prev && prev.type === "text" && tok.type === "text") { prev.value += tok.value; prev.output = (prev.output || "") + tok.value; return; } tok.prev = prev; tokens.push(tok); prev = tok; }, "push"); const extglobOpen = /* @__PURE__ */ __name((type, value2) => { const token = __spreadProps(__spreadValues({}, EXTGLOB_CHARS[value2]), { conditions: 1, inner: "" }); token.prev = prev; token.parens = state.parens; token.output = state.output; const output = (opts.capture ? "(" : "") + token.open; increment("parens"); push({ type, value: value2, output: state.output ? "" : ONE_CHAR }); push({ type: "paren", extglob: true, value: advance(), output }); extglobs.push(token); }, "extglobOpen"); const extglobClose = /* @__PURE__ */ __name((token) => { let output = token.close + (opts.capture ? ")" : ""); let rest; if (token.type === "negate") { let extglobStar = star; if (token.inner && token.inner.length > 1 && token.inner.includes("/")) { extglobStar = globstar(opts); } if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { output = token.close = `)$))${extglobStar}`; } if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { const expression = parse(rest, __spreadProps(__spreadValues({}, options), { fastpaths: false })).output; output = token.close = `)${expression})${extglobStar})`; } if (token.prev.type === "bos") { state.negatedExtglob = true; } } push({ type: "paren", extglob: true, value, output }); decrement("parens"); }, "extglobClose"); if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { let backslashes = false; let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index2) => { if (first === "\\") { backslashes = true; return m; } if (first === "?") { if (esc) { return esc + first + (rest ? QMARK.repeat(rest.length) : ""); } if (index2 === 0) { return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ""); } return QMARK.repeat(chars.length); } if (first === ".") { return DOT_LITERAL.repeat(chars.length); } if (first === "*") { if (esc) { return esc + first + (rest ? star : ""); } return star; } return esc ? m : `\\${m}`; }); if (backslashes === true) { if (opts.unescape === true) { output = output.replace(/\\/g, ""); } else { output = output.replace(/\\+/g, (m) => { return m.length % 2 === 0 ? "\\\\" : m ? "\\" : ""; }); } } if (output === input && opts.contains === true) { state.output = input; return state; } state.output = utils.wrapOutput(output, state, options); return state; } while (!eos()) { value = advance(); if (value === "\0") { continue; } if (value === "\\") { const next = peek(); if (next === "/" && opts.bash !== true) { continue; } if (next === "." || next === ";") { continue; } if (!next) { value += "\\"; push({ type: "text", value }); continue; } const match = /^\\+/.exec(remaining()); let slashes = 0; if (match && match[0].length > 2) { slashes = match[0].length; state.index += slashes; if (slashes % 2 !== 0) { value += "\\"; } } if (opts.unescape === true) { value = advance(); } else { value += advance(); } if (state.brackets === 0) { push({ type: "text", value }); continue; } } if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) { if (opts.posix !== false && value === ":") { const inner = prev.value.slice(1); if (inner.includes("[")) { prev.posix = true; if (inner.includes(":")) { const idx = prev.value.lastIndexOf("["); const pre = prev.value.slice(0, idx); const rest2 = prev.value.slice(idx + 2); const posix = POSIX_REGEX_SOURCE[rest2]; if (posix) { prev.value = pre + posix; state.backtrack = true; advance(); if (!bos.output && tokens.indexOf(prev) === 1) { bos.output = ONE_CHAR; } continue; } } } } if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") { value = `\\${value}`; } if (value === "]" && (prev.value === "[" || prev.value === "[^")) { value = `\\${value}`; } if (opts.posix === true && value === "!" && prev.value === "[") { value = "^"; } prev.value += value; append({ value }); continue; } if (state.quotes === 1 && value !== '"') { value = utils.escapeRegex(value); prev.value += value; append({ value }); continue; } if (value === '"') { state.quotes = state.quotes === 1 ? 0 : 1; if (opts.keepQuotes === true) { push({ type: "text", value }); } continue; } if (value === "(") { increment("parens"); push({ type: "paren", value }); continue; } if (value === ")") { if (state.parens === 0 && opts.strictBrackets === true) { throw new SyntaxError(syntaxError("opening", "(")); } const extglob = extglobs[extglobs.length - 1]; if (extglob && state.parens === extglob.parens + 1) { extglobClose(extglobs.pop()); continue; } push({ type: "paren", value, output: state.parens ? ")" : "\\)" }); decrement("parens"); continue; } if (value === "[") { if (opts.nobracket === true || !remaining().includes("]")) { if (opts.nobracket !== true && opts.strictBrackets === true) { throw new SyntaxError(syntaxError("closing", "]")); } value = `\\${value}`; } else { increment("brackets"); } push({ type: "bracket", value }); continue; } if (value === "]") { if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) { push({ type: "text", value, output: `\\${value}` }); continue; } if (state.brackets === 0) { if (opts.strictBrackets === true) { throw new SyntaxError(syntaxError("opening", "[")); } push({ type: "text", value, output: `\\${value}` }); continue; } decrement("brackets"); const prevValue = prev.value.slice(1); if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) { value = `/${value}`; } prev.value += value; append({ value }); if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { continue; } const escaped = utils.escapeRegex(prev.value); state.output = state.output.slice(0, -prev.value.length); if (opts.literalBrackets === true) { state.output += escaped; prev.value = escaped; continue; } prev.value = `(${capture}${escaped}|${prev.value})`; state.output += prev.value; continue; } if (value === "{" && opts.nobrace !== true) { increment("braces"); const open = { type: "brace", value, output: "(", outputIndex: state.output.length, tokensIndex: state.tokens.length }; braces.push(open); push(open); continue; } if (value === "}") { const brace = braces[braces.length - 1]; if (opts.nobrace === true || !brace) { push({ type: "text", value, output: value }); continue; } let output = ")"; if (brace.dots === true) { const arr = tokens.slice(); const range2 = []; for (let i = arr.length - 1; i >= 0; i--) { tokens.pop(); if (arr[i].type === "brace") { break; } if (arr[i].type !== "dots") { range2.unshift(arr[i].value); } } output = expandRange(range2, opts); state.backtrack = true; } if (brace.comma !== true && brace.dots !== true) { const out = state.output.slice(0, brace.outputIndex); const toks = state.tokens.slice(brace.tokensIndex); brace.value = brace.output = "\\{"; value = output = "\\}"; state.output = out; for (const t of toks) { state.output += t.output || t.value; } } push({ type: "brace", value, output }); decrement("braces"); braces.pop(); continue; } if (value === "|") { if (extglobs.length > 0) { extglobs[extglobs.length - 1].conditions++; } push({ type: "text", value }); continue; } if (value === ",") { let output = value; const brace = braces[braces.length - 1]; if (brace && stack[stack.length - 1] === "braces") { brace.comma = true; output = "|"; } push({ type: "comma", value, output }); continue; } if (value === "/") { if (prev.type === "dot" && state.index === state.start + 1) { state.start = state.index + 1; state.consumed = ""; state.output = ""; tokens.pop(); prev = bos; continue; } push({ type: "slash", value, output: SLASH_LITERAL }); continue; } if (value === ".") { if (state.braces > 0 && prev.type === "dot") { if (prev.value === ".") prev.output = DOT_LITERAL; const brace = braces[braces.length - 1]; prev.type = "dots"; prev.output += value; prev.value += value; brace.dots = true; continue; } if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") { push({ type: "text", value, output: DOT_LITERAL }); continue; } push({ type: "dot", value, output: DOT_LITERAL }); continue; } if (value === "?") { const isGroup = prev && prev.value === "("; if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") { extglobOpen("qmark", value); continue; } if (prev && prev.type === "paren") { const next = peek(); let output = value; if (next === "<" && !utils.supportsLookbehinds()) { throw new Error("Node.js v10 or higher is required for regex lookbehinds"); } if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) { output = `\\${value}`; } push({ type: "text", value, output }); continue; } if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) { push({ type: "qmark", value, output: QMARK_NO_DOT }); continue; } push({ type: "qmark", value, output: QMARK }); continue; } if (value === "!") { if (opts.noextglob !== true && peek() === "(") { if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) { extglobOpen("negate", value); continue; } } if (opts.nonegate !== true && state.index === 0) { negate(); continue; } } if (value === "+") { if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") { extglobOpen("plus", value); continue; } if (prev && prev.value === "(" || opts.regex === false) { push({ type: "plus", value, output: PLUS_LITERAL }); continue; } if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) { push({ type: "plus", value }); continue; } push({ type: "plus", value: PLUS_LITERAL }); continue; } if (value === "@") { if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") { push({ type: "at", extglob: true, value, output: "" }); continue; } push({ type: "text", value }); continue; } if (value !== "*") { if (value === "$" || value === "^") { value = `\\${value}`; } const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); if (match) { value += match[0]; state.index += match[0].length; } push({ type: "text", value }); continue; } if (prev && (prev.type === "globstar" || prev.star === true)) { prev.type = "star"; prev.star = true; prev.value += value; prev.output = star; state.backtrack = true; state.globstar = true; consume(value); continue; } let rest = remaining(); if (opts.noextglob !== true && /^\([^?]/.test(rest)) { extglobOpen("star", value); continue; } if (prev.type === "star") { if (opts.noglobstar === true) { consume(value); continue; } const prior = prev.prev; const before = prior.prev; const isStart = prior.type === "slash" || prior.type === "bos"; const afterStar = before && (before.type === "star" || before.type === "globstar"); if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) { push({ type: "star", value, output: "" }); continue; } const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace"); const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren"); if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) { push({ type: "star", value, output: "" }); continue; } while (rest.slice(0, 3) === "/**") { const after = input[state.index + 4]; if (after && after !== "/") { break; } rest = rest.slice(3); consume("/**", 3); } if (prior.type === "bos" && eos()) { prev.type = "globstar"; prev.value += value; prev.output = globstar(opts); state.output = prev.output; state.globstar = true; consume(value); continue; } if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) { state.output = state.output.slice(0, -(prior.output + prev.output).length); prior.output = `(?:${prior.output}`; prev.type = "globstar"; prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)"); prev.value += value; state.globstar = true; state.output += prior.output + prev.output; consume(value); continue; } if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") { const end = rest[1] !== void 0 ? "|$" : ""; state.output = state.output.slice(0, -(prior.output + prev.output).length); prior.output = `(?:${prior.output}`; prev.type = "globstar"; prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; prev.value += value; state.output += prior.output + prev.output; state.globstar = true; consume(value + advance()); push({ type: "slash", value: "/", output: "" }); continue; } if (prior.type === "bos" && rest[0] === "/") { prev.type = "globstar"; prev.value += value; prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; state.output = prev.output; state.globstar = true; consume(value + advance()); push({ type: "slash", value: "/", output: "" }); continue; } state.output = state.output.slice(0, -prev.output.length); prev.type = "globstar"; prev.output = globstar(opts); prev.value += value; state.output += prev.output; state.globstar = true; consume(value); continue; } const token = { type: "star", value, output: star }; if (opts.bash === true) { token.output = ".*?"; if (prev.type === "bos" || prev.type === "slash") { token.output = nodot + token.output; } push(token); continue; } if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) { token.output = value; push(token); continue; } if (state.index === state.start || prev.type === "slash" || prev.type === "dot") { if (prev.type === "dot") { state.output += NO_DOT_SLASH; prev.output += NO_DOT_SLASH; } else if (opts.dot === true) { state.output += NO_DOTS_SLASH; prev.output += NO_DOTS_SLASH; } else { state.output += nodot; prev.output += nodot; } if (peek() !== "*") { state.output += ONE_CHAR; prev.output += ONE_CHAR; } } push(token); } while (state.brackets > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]")); state.output = utils.escapeLast(state.output, "["); decrement("brackets"); } while (state.parens > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")")); state.output = utils.escapeLast(state.output, "("); decrement("parens"); } while (state.braces > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}")); state.output = utils.escapeLast(state.output, "{"); decrement("braces"); } if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) { push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` }); } if (state.backtrack === true) { state.output = ""; for (const token of state.tokens) { state.output += token.output != null ? token.output : token.value; if (token.suffix) { state.output += token.suffix; } } } return state; }, "parse"); parse.fastpaths = (input, options) => { const opts = __spreadValues({}, options); const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; const len = input.length; if (len > max) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } input = REPLACEMENTS[input] || input; const win32 = utils.isWindows(options); const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(win32); const nodot = opts.dot ? NO_DOTS : NO_DOT; const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; const capture = opts.capture ? "" : "?:"; const state = { negated: false, prefix: "" }; let star = opts.bash === true ? ".*?" : STAR; if (opts.capture) { star = `(${star})`; } const globstar = /* @__PURE__ */ __name((opts2) => { if (opts2.noglobstar === true) return star; return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }, "globstar"); const create = /* @__PURE__ */ __name((str) => { switch (str) { case "*": return `${nodot}${ONE_CHAR}${star}`; case ".*": return `${DOT_LITERAL}${ONE_CHAR}${star}`; case "*.*": return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; case "*/*": return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; case "**": return nodot + globstar(opts); case "**/*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; case "**/*.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; default: { const match = /^(.*?)\.(\w+)$/.exec(str); if (!match) return; const source2 = create(match[1]); if (!source2) return; return source2 + DOT_LITERAL + match[2]; } } }, "create"); const output = utils.removePrefix(input, state); let source = create(output); if (source && opts.strictSlashes !== true) { source += `${SLASH_LITERAL}?`; } return source; }; module2.exports = parse; } }); // node_modules/picomatch/lib/picomatch.js var require_picomatch = __commonJS({ "node_modules/picomatch/lib/picomatch.js"(exports, module2) { "use strict"; var path2 = require("path"); var scan = require_scan(); var parse = require_parse2(); var utils = require_utils2(); var constants = require_constants2(); var isObject = /* @__PURE__ */ __name((val) => val && typeof val === "object" && !Array.isArray(val), "isObject"); var picomatch = /* @__PURE__ */ __name((glob, options, returnState = false) => { if (Array.isArray(glob)) { const fns = glob.map((input) => picomatch(input, options, returnState)); const arrayMatcher = /* @__PURE__ */ __name((str) => { for (const isMatch of fns) { const state2 = isMatch(str); if (state2) return state2; } return false; }, "arrayMatcher"); return arrayMatcher; } const isState = isObject(glob) && glob.tokens && glob.input; if (glob === "" || typeof glob !== "string" && !isState) { throw new TypeError("Expected pattern to be a non-empty string"); } const opts = options || {}; const posix = utils.isWindows(options); const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true); const state = regex.state; delete regex.state; let isIgnored = /* @__PURE__ */ __name(() => false, "isIgnored"); if (opts.ignore) { const ignoreOpts = __spreadProps(__spreadValues({}, options), { ignore: null, onMatch: null, onResult: null }); isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); } const matcher = /* @__PURE__ */ __name((input, returnObject = false) => { const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); const result = { glob, state, regex, posix, input, output, match, isMatch }; if (typeof opts.onResult === "function") { opts.onResult(result); } if (isMatch === false) { result.isMatch = false; return returnObject ? result : false; } if (isIgnored(input)) { if (typeof opts.onIgnore === "function") { opts.onIgnore(result); } result.isMatch = false; return returnObject ? result : false; } if (typeof opts.onMatch === "function") { opts.onMatch(result); } return returnObject ? result : true; }, "matcher"); if (returnState) { matcher.state = state; } return matcher; }, "picomatch"); picomatch.test = (input, regex, options, { glob, posix } = {}) => { if (typeof input !== "string") { throw new TypeError("Expected input to be a string"); } if (input === "") { return { isMatch: false, output: "" }; } const opts = options || {}; const format = opts.format || (posix ? utils.toPosixSlashes : null); let match = input === glob; let output = match && format ? format(input) : input; if (match === false) { output = format ? format(input) : input; match = output === glob; } if (match === false || opts.capture === true) { if (opts.matchBase === true || opts.basename === true) { match = picomatch.matchBase(input, regex, options, posix); } else { match = regex.exec(output); } } return { isMatch: Boolean(match), match, output }; }; picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); return regex.test(path2.basename(input)); }; picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); picomatch.parse = (pattern, options) => { if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options)); return parse(pattern, __spreadProps(__spreadValues({}, options), { fastpaths: false })); }; picomatch.scan = (input, options) => scan(input, options); picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { if (returnOutput === true) { return state.output; } const opts = options || {}; const prepend = opts.contains ? "" : "^"; const append = opts.contains ? "" : "$"; let source = `${prepend}(?:${state.output})${append}`; if (state && state.negated === true) { source = `^(?!${source}).*$`; } const regex = picomatch.toRegex(source, options); if (returnState === true) { regex.state = state; } return regex; }; picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { if (!input || typeof input !== "string") { throw new TypeError("Expected a non-empty string"); } let parsed = { negated: false, fastpaths: true }; if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) { parsed.output = parse.fastpaths(input, options); } if (!parsed.output) { parsed = parse(input, options); } return picomatch.compileRe(parsed, options, returnOutput, returnState); }; picomatch.toRegex = (source, options) => { try { const opts = options || {}; return new RegExp(source, opts.flags || (opts.nocase ? "i" : "")); } catch (err) { if (options && options.debug === true) throw err; return /$^/; } }; picomatch.constants = constants; module2.exports = picomatch; } }); // node_modules/picomatch/index.js var require_picomatch2 = __commonJS({ "node_modules/picomatch/index.js"(exports, module2) { "use strict"; module2.exports = require_picomatch(); } }); // node_modules/micromatch/index.js var require_micromatch = __commonJS({ "node_modules/micromatch/index.js"(exports, module2) { "use strict"; var util2 = require("util"); var braces = require_braces(); var picomatch = require_picomatch2(); var utils = require_utils2(); var isEmptyString = /* @__PURE__ */ __name((val) => val === "" || val === "./", "isEmptyString"); var micromatch = /* @__PURE__ */ __name((list, patterns, options) => { patterns = [].concat(patterns); list = [].concat(list); let omit = /* @__PURE__ */ new Set(); let keep = /* @__PURE__ */ new Set(); let items = /* @__PURE__ */ new Set(); let negatives = 0; let onResult = /* @__PURE__ */ __name((state) => { items.add(state.output); if (options && options.onResult) { options.onResult(state); } }, "onResult"); for (let i = 0; i < patterns.length; i++) { let isMatch = picomatch(String(patterns[i]), __spreadProps(__spreadValues({}, options), { onResult }), true); let negated = isMatch.state.negated || isMatch.state.negatedExtglob; if (negated) negatives++; for (let item of list) { let matched = isMatch(item, true); let match = negated ? !matched.isMatch : matched.isMatch; if (!match) continue; if (negated) { omit.add(matched.output); } else { omit.delete(matched.output); keep.add(matched.output); } } } let result = negatives === patterns.length ? [...items] : [...keep]; let matches = result.filter((item) => !omit.has(item)); if (options && matches.length === 0) { if (options.failglob === true) { throw new Error(`No matches found for "${patterns.join(", ")}"`); } if (options.nonull === true || options.nullglob === true) { return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns; } } return matches; }, "micromatch"); micromatch.match = micromatch; micromatch.matcher = (pattern, options) => picomatch(pattern, options); micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); micromatch.any = micromatch.isMatch; micromatch.not = (list, patterns, options = {}) => { patterns = [].concat(patterns).map(String); let result = /* @__PURE__ */ new Set(); let items = []; let onResult = /* @__PURE__ */ __name((state) => { if (options.onResult) options.onResult(state); items.push(state.output); }, "onResult"); let matches = new Set(micromatch(list, patterns, __spreadProps(__spreadValues({}, options), { onResult }))); for (let item of items) { if (!matches.has(item)) { result.add(item); } } return [...result]; }; micromatch.contains = (str, pattern, options) => { if (typeof str !== "string") { throw new TypeError(`Expected a string: "${util2.inspect(str)}"`); } if (Array.isArray(pattern)) { return pattern.some((p) => micromatch.contains(str, p, options)); } if (typeof pattern === "string") { if (isEmptyString(str) || isEmptyString(pattern)) { return false; } if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) { return true; } } return micromatch.isMatch(str, pattern, __spreadProps(__spreadValues({}, options), { contains: true })); }; micromatch.matchKeys = (obj, patterns, options) => { if (!utils.isObject(obj)) { throw new TypeError("Expected the first argument to be an object"); } let keys = micromatch(Object.keys(obj), patterns, options); let res = {}; for (let key of keys) res[key] = obj[key]; return res; }; micromatch.some = (list, patterns, options) => { let items = [].concat(list); for (let pattern of [].concat(patterns)) { let isMatch = picomatch(String(pattern), options); if (items.some((item) => isMatch(item))) { return true; } } return false; }; micromatch.every = (list, patterns, options) => { let items = [].concat(list); for (let pattern of [].concat(patterns)) { let isMatch = picomatch(String(pattern), options); if (!items.every((item) => isMatch(item))) { return false; } } return true; }; micromatch.all = (str, patterns, options) => { if (typeof str !== "string") { throw new TypeError(`Expected a string: "${util2.inspect(str)}"`); } return [].concat(patterns).every((p) => picomatch(p, options)(str)); }; micromatch.capture = (glob, input, options) => { let posix = utils.isWindows(options); let regex = picomatch.makeRe(String(glob), __spreadProps(__spreadValues({}, options), { capture: true })); let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); if (match) { return match.slice(1).map((v) => v === void 0 ? "" : v); } }; micromatch.makeRe = (...args) => picomatch.makeRe(...args); micromatch.scan = (...args) => picomatch.scan(...args); micromatch.parse = (patterns, options) => { let res = []; for (let pattern of [].concat(patterns || [])) { for (let str of braces(String(pattern), options)) { res.push(picomatch.parse(str, options)); } } return res; }; micromatch.braces = (pattern, options) => { if (typeof pattern !== "string") throw new TypeError("Expected a string"); if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) { return [pattern]; } return braces(pattern, options); }; micromatch.braceExpand = (pattern, options) => { if (typeof pattern !== "string") throw new TypeError("Expected a string"); return micromatch.braces(pattern, __spreadProps(__spreadValues({}, options), { expand: true })); }; module2.exports = micromatch; } }); // node_modules/fast-glob/out/utils/pattern.js var require_pattern = __commonJS({ "node_modules/fast-glob/out/utils/pattern.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; var path2 = require("path"); var globParent = require_glob_parent(); var micromatch = require_micromatch(); var GLOBSTAR = "**"; var ESCAPE_SYMBOL = "\\"; var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; function isStaticPattern(pattern, options = {}) { return !isDynamicPattern2(pattern, options); } __name(isStaticPattern, "isStaticPattern"); exports.isStaticPattern = isStaticPattern; function isDynamicPattern2(pattern, options = {}) { if (pattern === "") { return false; } if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { return true; } if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { return true; } if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { return true; } if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { return true; } return false; } __name(isDynamicPattern2, "isDynamicPattern"); exports.isDynamicPattern = isDynamicPattern2; function hasBraceExpansion(pattern) { const openingBraceIndex = pattern.indexOf("{"); if (openingBraceIndex === -1) { return false; } const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1); if (closingBraceIndex === -1) { return false; } const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); } __name(hasBraceExpansion, "hasBraceExpansion"); function convertToPositivePattern(pattern) { return isNegativePattern2(pattern) ? pattern.slice(1) : pattern; } __name(convertToPositivePattern, "convertToPositivePattern"); exports.convertToPositivePattern = convertToPositivePattern; function convertToNegativePattern(pattern) { return "!" + pattern; } __name(convertToNegativePattern, "convertToNegativePattern"); exports.convertToNegativePattern = convertToNegativePattern; function isNegativePattern2(pattern) { return pattern.startsWith("!") && pattern[1] !== "("; } __name(isNegativePattern2, "isNegativePattern"); exports.isNegativePattern = isNegativePattern2; function isPositivePattern(pattern) { return !isNegativePattern2(pattern); } __name(isPositivePattern, "isPositivePattern"); exports.isPositivePattern = isPositivePattern; function getNegativePatterns(patterns) { return patterns.filter(isNegativePattern2); } __name(getNegativePatterns, "getNegativePatterns"); exports.getNegativePatterns = getNegativePatterns; function getPositivePatterns(patterns) { return patterns.filter(isPositivePattern); } __name(getPositivePatterns, "getPositivePatterns"); exports.getPositivePatterns = getPositivePatterns; function getPatternsInsideCurrentDirectory(patterns) { return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); } __name(getPatternsInsideCurrentDirectory, "getPatternsInsideCurrentDirectory"); exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; function getPatternsOutsideCurrentDirectory(patterns) { return patterns.filter(isPatternRelatedToParentDirectory); } __name(getPatternsOutsideCurrentDirectory, "getPatternsOutsideCurrentDirectory"); exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; function isPatternRelatedToParentDirectory(pattern) { return pattern.startsWith("..") || pattern.startsWith("./.."); } __name(isPatternRelatedToParentDirectory, "isPatternRelatedToParentDirectory"); exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; function getBaseDirectory(pattern) { return globParent(pattern, { flipBackslashes: false }); } __name(getBaseDirectory, "getBaseDirectory"); exports.getBaseDirectory = getBaseDirectory; function hasGlobStar(pattern) { return pattern.includes(GLOBSTAR); } __name(hasGlobStar, "hasGlobStar"); exports.hasGlobStar = hasGlobStar; function endsWithSlashGlobStar(pattern) { return pattern.endsWith("/" + GLOBSTAR); } __name(endsWithSlashGlobStar, "endsWithSlashGlobStar"); exports.endsWithSlashGlobStar = endsWithSlashGlobStar; function isAffectDepthOfReadingPattern(pattern) { const basename = path2.basename(pattern); return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); } __name(isAffectDepthOfReadingPattern, "isAffectDepthOfReadingPattern"); exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; function expandPatternsWithBraceExpansion(patterns) { return patterns.reduce((collection, pattern) => { return collection.concat(expandBraceExpansion(pattern)); }, []); } __name(expandPatternsWithBraceExpansion, "expandPatternsWithBraceExpansion"); exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; function expandBraceExpansion(pattern) { return micromatch.braces(pattern, { expand: true, nodupes: true }); } __name(expandBraceExpansion, "expandBraceExpansion"); exports.expandBraceExpansion = expandBraceExpansion; function getPatternParts(pattern, options) { let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); if (parts.length === 0) { parts = [pattern]; } if (parts[0].startsWith("/")) { parts[0] = parts[0].slice(1); parts.unshift(""); } return parts; } __name(getPatternParts, "getPatternParts"); exports.getPatternParts = getPatternParts; function makeRe(pattern, options) { return micromatch.makeRe(pattern, options); } __name(makeRe, "makeRe"); exports.makeRe = makeRe; function convertPatternsToRe(patterns, options) { return patterns.map((pattern) => makeRe(pattern, options)); } __name(convertPatternsToRe, "convertPatternsToRe"); exports.convertPatternsToRe = convertPatternsToRe; function matchAny(entry, patternsRe) { return patternsRe.some((patternRe) => patternRe.test(entry)); } __name(matchAny, "matchAny"); exports.matchAny = matchAny; } }); // node_modules/fast-glob/out/utils/stream.js var require_stream = __commonJS({ "node_modules/fast-glob/out/utils/stream.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.merge = void 0; var merge22 = require_merge2(); function merge(streams) { const mergedStream = merge22(streams); streams.forEach((stream) => { stream.once("error", (error) => mergedStream.emit("error", error)); }); mergedStream.once("close", () => propagateCloseEventToSources(streams)); mergedStream.once("end", () => propagateCloseEventToSources(streams)); return mergedStream; } __name(merge, "merge"); exports.merge = merge; function propagateCloseEventToSources(streams) { streams.forEach((stream) => stream.emit("close")); } __name(propagateCloseEventToSources, "propagateCloseEventToSources"); } }); // node_modules/fast-glob/out/utils/string.js var require_string = __commonJS({ "node_modules/fast-glob/out/utils/string.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isEmpty = exports.isString = void 0; function isString(input) { return typeof input === "string"; } __name(isString, "isString"); exports.isString = isString; function isEmpty(input) { return input === ""; } __name(isEmpty, "isEmpty"); exports.isEmpty = isEmpty; } }); // node_modules/fast-glob/out/utils/index.js var require_utils3 = __commonJS({ "node_modules/fast-glob/out/utils/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; var array = require_array(); exports.array = array; var errno = require_errno(); exports.errno = errno; var fs3 = require_fs(); exports.fs = fs3; var path2 = require_path(); exports.path = path2; var pattern = require_pattern(); exports.pattern = pattern; var stream = require_stream(); exports.stream = stream; var string = require_string(); exports.string = string; } }); // node_modules/fast-glob/out/managers/tasks.js var require_tasks = __commonJS({ "node_modules/fast-glob/out/managers/tasks.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; var utils = require_utils3(); function generate2(patterns, settings2) { const positivePatterns = getPositivePatterns(patterns); const negativePatterns = getNegativePatternsAsPositive(patterns, settings2.ignore); const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2)); const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2)); const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, false); const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, true); return staticTasks.concat(dynamicTasks); } __name(generate2, "generate"); exports.generate = generate2; function convertPatternsToTasks(positive, negative, dynamic) { const tasks = []; const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); if ("." in insideCurrentDirectoryGroup) { tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic)); } else { tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); } return tasks; } __name(convertPatternsToTasks, "convertPatternsToTasks"); exports.convertPatternsToTasks = convertPatternsToTasks; function getPositivePatterns(patterns) { return utils.pattern.getPositivePatterns(patterns); } __name(getPositivePatterns, "getPositivePatterns"); exports.getPositivePatterns = getPositivePatterns; function getNegativePatternsAsPositive(patterns, ignore) { const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); const positive = negative.map(utils.pattern.convertToPositivePattern); return positive; } __name(getNegativePatternsAsPositive, "getNegativePatternsAsPositive"); exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; function groupPatternsByBaseDirectory(patterns) { const group = {}; return patterns.reduce((collection, pattern) => { const base = utils.pattern.getBaseDirectory(pattern); if (base in collection) { collection[base].push(pattern); } else { collection[base] = [pattern]; } return collection; }, group); } __name(groupPatternsByBaseDirectory, "groupPatternsByBaseDirectory"); exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; function convertPatternGroupsToTasks(positive, negative, dynamic) { return Object.keys(positive).map((base) => { return convertPatternGroupToTask(base, positive[base], negative, dynamic); }); } __name(convertPatternGroupsToTasks, "convertPatternGroupsToTasks"); exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; function convertPatternGroupToTask(base, positive, negative, dynamic) { return { dynamic, positive, negative, base, patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) }; } __name(convertPatternGroupToTask, "convertPatternGroupToTask"); exports.convertPatternGroupToTask = convertPatternGroupToTask; } }); // node_modules/fast-glob/out/managers/patterns.js var require_patterns = __commonJS({ "node_modules/fast-glob/out/managers/patterns.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.removeDuplicateSlashes = exports.transform = void 0; var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; function transform2(patterns) { return patterns.map((pattern) => removeDuplicateSlashes(pattern)); } __name(transform2, "transform"); exports.transform = transform2; function removeDuplicateSlashes(pattern) { return pattern.replace(DOUBLE_SLASH_RE, "/"); } __name(removeDuplicateSlashes, "removeDuplicateSlashes"); exports.removeDuplicateSlashes = removeDuplicateSlashes; } }); // node_modules/@nodelib/fs.stat/out/providers/async.js var require_async = __commonJS({ "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.read = void 0; function read(path2, settings2, callback) { settings2.fs.lstat(path2, (lstatError, lstat) => { if (lstatError !== null) { callFailureCallback(callback, lstatError); return; } if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) { callSuccessCallback(callback, lstat); return; } settings2.fs.stat(path2, (statError, stat) => { if (statError !== null) { if (settings2.throwErrorOnBrokenSymbolicLink) { callFailureCallback(callback, statError); return; } callSuccessCallback(callback, lstat); return; } if (settings2.markSymbolicLink) { stat.isSymbolicLink = () => true; } callSuccessCallback(callback, stat); }); }); } __name(read, "read"); exports.read = read; function callFailureCallback(callback, error) { callback(error); } __name(callFailureCallback, "callFailureCallback"); function callSuccessCallback(callback, result) { callback(null, result); } __name(callSuccessCallback, "callSuccessCallback"); } }); // node_modules/@nodelib/fs.stat/out/providers/sync.js var require_sync = __commonJS({ "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.read = void 0; function read(path2, settings2) { const lstat = settings2.fs.lstatSync(path2); if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) { return lstat; } try { const stat = settings2.fs.statSync(path2); if (settings2.markSymbolicLink) { stat.isSymbolicLink = () => true; } return stat; } catch (error) { if (!settings2.throwErrorOnBrokenSymbolicLink) { return lstat; } throw error; } } __name(read, "read"); exports.read = read; } }); // node_modules/@nodelib/fs.stat/out/adapters/fs.js var require_fs2 = __commonJS({ "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; var fs3 = require("fs"); exports.FILE_SYSTEM_ADAPTER = { lstat: fs3.lstat, stat: fs3.stat, lstatSync: fs3.lstatSync, statSync: fs3.statSync }; function createFileSystemAdapter(fsMethods) { if (fsMethods === void 0) { return exports.FILE_SYSTEM_ADAPTER; } return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); } __name(createFileSystemAdapter, "createFileSystemAdapter"); exports.createFileSystemAdapter = createFileSystemAdapter; } }); // node_modules/@nodelib/fs.stat/out/settings.js var require_settings = __commonJS({ "node_modules/@nodelib/fs.stat/out/settings.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var fs3 = require_fs2(); var Settings3 = class { constructor(_options = {}) { this._options = _options; this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); this.fs = fs3.createFileSystemAdapter(this._options.fs); this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); } _getValue(option, value) { return option !== null && option !== void 0 ? option : value; } }; __name(Settings3, "Settings"); exports.default = Settings3; } }); // node_modules/@nodelib/fs.stat/out/index.js var require_out = __commonJS({ "node_modules/@nodelib/fs.stat/out/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.statSync = exports.stat = exports.Settings = void 0; var async = require_async(); var sync = require_sync(); var settings_1 = require_settings(); exports.Settings = settings_1.default; function stat(path2, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === "function") { async.read(path2, getSettings(), optionsOrSettingsOrCallback); return; } async.read(path2, getSettings(optionsOrSettingsOrCallback), callback); } __name(stat, "stat"); exports.stat = stat; function statSync(path2, optionsOrSettings) { const settings2 = getSettings(optionsOrSettings); return sync.read(path2, settings2); } __name(statSync, "statSync"); exports.statSync = statSync; function getSettings(settingsOrOptions = {}) { if (settingsOrOptions instanceof settings_1.default) { return settingsOrOptions; } return new settings_1.default(settingsOrOptions); } __name(getSettings, "getSettings"); } }); // node_modules/queue-microtask/index.js var require_queue_microtask = __commonJS({ "node_modules/queue-microtask/index.js"(exports, module2) { var promise; module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => { throw err; }, 0)); } }); // node_modules/run-parallel/index.js var require_run_parallel = __commonJS({ "node_modules/run-parallel/index.js"(exports, module2) { module2.exports = runParallel; var queueMicrotask2 = require_queue_microtask(); function runParallel(tasks, cb) { let results, pending, keys; let isSync = true; if (Array.isArray(tasks)) { results = []; pending = tasks.length; } else { keys = Object.keys(tasks); results = {}; pending = keys.length; } function done(err) { function end() { if (cb) cb(err, results); cb = null; } __name(end, "end"); if (isSync) queueMicrotask2(end); else end(); } __name(done, "done"); function each2(i, err, result) { results[i] = result; if (--pending === 0 || err) { done(err); } } __name(each2, "each"); if (!pending) { done(null); } else if (keys) { keys.forEach(function(key) { tasks[key](function(err, result) { each2(key, err, result); }); }); } else { tasks.forEach(function(task, i) { task(function(err, result) { each2(i, err, result); }); }); } isSync = false; } __name(runParallel, "runParallel"); } }); // node_modules/@nodelib/fs.scandir/out/constants.js var require_constants3 = __commonJS({ "node_modules/@nodelib/fs.scandir/out/constants.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; var NODE_PROCESS_VERSION_PARTS = process.versions.node.split("."); if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) { throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); } var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); var SUPPORTED_MAJOR_VERSION = 10; var SUPPORTED_MINOR_VERSION = 10; var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; } }); // node_modules/@nodelib/fs.scandir/out/utils/fs.js var require_fs3 = __commonJS({ "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createDirentFromStats = void 0; var DirentFromStats = class { constructor(name, stats) { this.name = name; this.isBlockDevice = stats.isBlockDevice.bind(stats); this.isCharacterDevice = stats.isCharacterDevice.bind(stats); this.isDirectory = stats.isDirectory.bind(stats); this.isFIFO = stats.isFIFO.bind(stats); this.isFile = stats.isFile.bind(stats); this.isSocket = stats.isSocket.bind(stats); this.isSymbolicLink = stats.isSymbolicLink.bind(stats); } }; __name(DirentFromStats, "DirentFromStats"); function createDirentFromStats(name, stats) { return new DirentFromStats(name, stats); } __name(createDirentFromStats, "createDirentFromStats"); exports.createDirentFromStats = createDirentFromStats; } }); // node_modules/@nodelib/fs.scandir/out/utils/index.js var require_utils4 = __commonJS({ "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fs = void 0; var fs3 = require_fs3(); exports.fs = fs3; } }); // node_modules/@nodelib/fs.scandir/out/providers/common.js var require_common = __commonJS({ "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.joinPathSegments = void 0; function joinPathSegments(a, b, separator) { if (a.endsWith(separator)) { return a + b; } return a + separator + b; } __name(joinPathSegments, "joinPathSegments"); exports.joinPathSegments = joinPathSegments; } }); // node_modules/@nodelib/fs.scandir/out/providers/async.js var require_async2 = __commonJS({ "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; var fsStat = require_out(); var rpl = require_run_parallel(); var constants_1 = require_constants3(); var utils = require_utils4(); var common = require_common(); function read(directory, settings2, callback) { if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { readdirWithFileTypes(directory, settings2, callback); return; } readdir(directory, settings2, callback); } __name(read, "read"); exports.read = read; function readdirWithFileTypes(directory, settings2, callback) { settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { if (readdirError !== null) { callFailureCallback(callback, readdirError); return; } const entries = dirents.map((dirent) => ({ dirent, name: dirent.name, path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator) })); if (!settings2.followSymbolicLinks) { callSuccessCallback(callback, entries); return; } const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2)); rpl(tasks, (rplError, rplEntries) => { if (rplError !== null) { callFailureCallback(callback, rplError); return; } callSuccessCallback(callback, rplEntries); }); }); } __name(readdirWithFileTypes, "readdirWithFileTypes"); exports.readdirWithFileTypes = readdirWithFileTypes; function makeRplTaskEntry(entry, settings2) { return (done) => { if (!entry.dirent.isSymbolicLink()) { done(null, entry); return; } settings2.fs.stat(entry.path, (statError, stats) => { if (statError !== null) { if (settings2.throwErrorOnBrokenSymbolicLink) { done(statError); return; } done(null, entry); return; } entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); done(null, entry); }); }; } __name(makeRplTaskEntry, "makeRplTaskEntry"); function readdir(directory, settings2, callback) { settings2.fs.readdir(directory, (readdirError, names) => { if (readdirError !== null) { callFailureCallback(callback, readdirError); return; } const tasks = names.map((name) => { const path2 = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator); return (done) => { fsStat.stat(path2, settings2.fsStatSettings, (error, stats) => { if (error !== null) { done(error); return; } const entry = { name, path: path2, dirent: utils.fs.createDirentFromStats(name, stats) }; if (settings2.stats) { entry.stats = stats; } done(null, entry); }); }; }); rpl(tasks, (rplError, entries) => { if (rplError !== null) { callFailureCallback(callback, rplError); return; } callSuccessCallback(callback, entries); }); }); } __name(readdir, "readdir"); exports.readdir = readdir; function callFailureCallback(callback, error) { callback(error); } __name(callFailureCallback, "callFailureCallback"); function callSuccessCallback(callback, result) { callback(null, result); } __name(callSuccessCallback, "callSuccessCallback"); } }); // node_modules/@nodelib/fs.scandir/out/providers/sync.js var require_sync2 = __commonJS({ "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; var fsStat = require_out(); var constants_1 = require_constants3(); var utils = require_utils4(); var common = require_common(); function read(directory, settings2) { if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { return readdirWithFileTypes(directory, settings2); } return readdir(directory, settings2); } __name(read, "read"); exports.read = read; function readdirWithFileTypes(directory, settings2) { const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true }); return dirents.map((dirent) => { const entry = { dirent, name: dirent.name, path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator) }; if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) { try { const stats = settings2.fs.statSync(entry.path); entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); } catch (error) { if (settings2.throwErrorOnBrokenSymbolicLink) { throw error; } } } return entry; }); } __name(readdirWithFileTypes, "readdirWithFileTypes"); exports.readdirWithFileTypes = readdirWithFileTypes; function readdir(directory, settings2) { const names = settings2.fs.readdirSync(directory); return names.map((name) => { const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator); const stats = fsStat.statSync(entryPath, settings2.fsStatSettings); const entry = { name, path: entryPath, dirent: utils.fs.createDirentFromStats(name, stats) }; if (settings2.stats) { entry.stats = stats; } return entry; }); } __name(readdir, "readdir"); exports.readdir = readdir; } }); // node_modules/@nodelib/fs.scandir/out/adapters/fs.js var require_fs4 = __commonJS({ "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; var fs3 = require("fs"); exports.FILE_SYSTEM_ADAPTER = { lstat: fs3.lstat, stat: fs3.stat, lstatSync: fs3.lstatSync, statSync: fs3.statSync, readdir: fs3.readdir, readdirSync: fs3.readdirSync }; function createFileSystemAdapter(fsMethods) { if (fsMethods === void 0) { return exports.FILE_SYSTEM_ADAPTER; } return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); } __name(createFileSystemAdapter, "createFileSystemAdapter"); exports.createFileSystemAdapter = createFileSystemAdapter; } }); // node_modules/@nodelib/fs.scandir/out/settings.js var require_settings2 = __commonJS({ "node_modules/@nodelib/fs.scandir/out/settings.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var path2 = require("path"); var fsStat = require_out(); var fs3 = require_fs4(); var Settings3 = class { constructor(_options = {}) { this._options = _options; this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); this.fs = fs3.createFileSystemAdapter(this._options.fs); this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path2.sep); this.stats = this._getValue(this._options.stats, false); this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); this.fsStatSettings = new fsStat.Settings({ followSymbolicLink: this.followSymbolicLinks, fs: this.fs, throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink }); } _getValue(option, value) { return option !== null && option !== void 0 ? option : value; } }; __name(Settings3, "Settings"); exports.default = Settings3; } }); // node_modules/@nodelib/fs.scandir/out/index.js var require_out2 = __commonJS({ "node_modules/@nodelib/fs.scandir/out/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Settings = exports.scandirSync = exports.scandir = void 0; var async = require_async2(); var sync = require_sync2(); var settings_1 = require_settings2(); exports.Settings = settings_1.default; function scandir(path2, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === "function") { async.read(path2, getSettings(), optionsOrSettingsOrCallback); return; } async.read(path2, getSettings(optionsOrSettingsOrCallback), callback); } __name(scandir, "scandir"); exports.scandir = scandir; function scandirSync(path2, optionsOrSettings) { const settings2 = getSettings(optionsOrSettings); return sync.read(path2, settings2); } __name(scandirSync, "scandirSync"); exports.scandirSync = scandirSync; function getSettings(settingsOrOptions = {}) { if (settingsOrOptions instanceof settings_1.default) { return settingsOrOptions; } return new settings_1.default(settingsOrOptions); } __name(getSettings, "getSettings"); } }); // node_modules/reusify/reusify.js var require_reusify = __commonJS({ "node_modules/reusify/reusify.js"(exports, module2) { "use strict"; function reusify(Constructor) { var head = new Constructor(); var tail = head; function get() { var current = head; if (current.next) { head = current.next; } else { head = new Constructor(); tail = head; } current.next = null; return current; } __name(get, "get"); function release(obj) { tail.next = obj; tail = obj; } __name(release, "release"); return { get, release }; } __name(reusify, "reusify"); module2.exports = reusify; } }); // node_modules/fastq/queue.js var require_queue = __commonJS({ "node_modules/fastq/queue.js"(exports, module2) { "use strict"; var reusify = require_reusify(); function fastqueue(context, worker, concurrency) { if (typeof context === "function") { concurrency = worker; worker = context; context = null; } if (concurrency < 1) { throw new Error("fastqueue concurrency must be greater than 1"); } var cache = reusify(Task); var queueHead = null; var queueTail = null; var _running = 0; var errorHandler = null; var self2 = { push, drain: noop, saturated: noop, pause, paused: false, concurrency, running, resume, idle, length, getQueue, unshift, empty: noop, kill, killAndDrain, error }; return self2; function running() { return _running; } __name(running, "running"); function pause() { self2.paused = true; } __name(pause, "pause"); function length() { var current = queueHead; var counter = 0; while (current) { current = current.next; counter++; } return counter; } __name(length, "length"); function getQueue() { var current = queueHead; var tasks = []; while (current) { tasks.push(current.value); current = current.next; } return tasks; } __name(getQueue, "getQueue"); function resume() { if (!self2.paused) return; self2.paused = false; for (var i = 0; i < self2.concurrency; i++) { _running++; release(); } } __name(resume, "resume"); function idle() { return _running === 0 && self2.length() === 0; } __name(idle, "idle"); function push(value, done) { var current = cache.get(); current.context = context; current.release = release; current.value = value; current.callback = done || noop; current.errorHandler = errorHandler; if (_running === self2.concurrency || self2.paused) { if (queueTail) { queueTail.next = current; queueTail = current; } else { queueHead = current; queueTail = current; self2.saturated(); } } else { _running++; worker.call(context, current.value, current.worked); } } __name(push, "push"); function unshift(value, done) { var current = cache.get(); current.context = context; current.release = release; current.value = value; current.callback = done || noop; if (_running === self2.concurrency || self2.paused) { if (queueHead) { current.next = queueHead; queueHead = current; } else { queueHead = current; queueTail = current; self2.saturated(); } } else { _running++; worker.call(context, current.value, current.worked); } } __name(unshift, "unshift"); function release(holder) { if (holder) { cache.release(holder); } var next = queueHead; if (next) { if (!self2.paused) { if (queueTail === queueHead) { queueTail = null; } queueHead = next.next; next.next = null; worker.call(context, next.value, next.worked); if (queueTail === null) { self2.empty(); } } else { _running--; } } else if (--_running === 0) { self2.drain(); } } __name(release, "release"); function kill() { queueHead = null; queueTail = null; self2.drain = noop; } __name(kill, "kill"); function killAndDrain() { queueHead = null; queueTail = null; self2.drain(); self2.drain = noop; } __name(killAndDrain, "killAndDrain"); function error(handler) { errorHandler = handler; } __name(error, "error"); } __name(fastqueue, "fastqueue"); function noop() { } __name(noop, "noop"); function Task() { this.value = null; this.callback = noop; this.next = null; this.release = noop; this.context = null; this.errorHandler = null; var self2 = this; this.worked = /* @__PURE__ */ __name(function worked(err, result) { var callback = self2.callback; var errorHandler = self2.errorHandler; var val = self2.value; self2.value = null; self2.callback = noop; if (self2.errorHandler) { errorHandler(err, val); } callback.call(self2.context, err, result); self2.release(self2); }, "worked"); } __name(Task, "Task"); function queueAsPromised(context, worker, concurrency) { if (typeof context === "function") { concurrency = worker; worker = context; context = null; } function asyncWrapper(arg, cb) { worker.call(this, arg).then(function(res) { cb(null, res); }, cb); } __name(asyncWrapper, "asyncWrapper"); var queue2 = fastqueue(context, asyncWrapper, concurrency); var pushCb = queue2.push; var unshiftCb = queue2.unshift; queue2.push = push; queue2.unshift = unshift; queue2.drained = drained; return queue2; function push(value) { var p = new Promise(function(resolve, reject2) { pushCb(value, function(err, result) { if (err) { reject2(err); return; } resolve(result); }); }); p.catch(noop); return p; } __name(push, "push"); function unshift(value) { var p = new Promise(function(resolve, reject2) { unshiftCb(value, function(err, result) { if (err) { reject2(err); return; } resolve(result); }); }); p.catch(noop); return p; } __name(unshift, "unshift"); function drained() { var previousDrain = queue2.drain; var p = new Promise(function(resolve) { queue2.drain = function() { previousDrain(); resolve(); }; }); return p; } __name(drained, "drained"); } __name(queueAsPromised, "queueAsPromised"); module2.exports = fastqueue; module2.exports.promise = queueAsPromised; } }); // node_modules/@nodelib/fs.walk/out/readers/common.js var require_common2 = __commonJS({ "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; function isFatalError(settings2, error) { if (settings2.errorFilter === null) { return true; } return !settings2.errorFilter(error); } __name(isFatalError, "isFatalError"); exports.isFatalError = isFatalError; function isAppliedFilter(filter2, value) { return filter2 === null || filter2(value); } __name(isAppliedFilter, "isAppliedFilter"); exports.isAppliedFilter = isAppliedFilter; function replacePathSegmentSeparator(filepath, separator) { return filepath.split(/[/\\]/).join(separator); } __name(replacePathSegmentSeparator, "replacePathSegmentSeparator"); exports.replacePathSegmentSeparator = replacePathSegmentSeparator; function joinPathSegments(a, b, separator) { if (a === "") { return b; } if (a.endsWith(separator)) { return a + b; } return a + separator + b; } __name(joinPathSegments, "joinPathSegments"); exports.joinPathSegments = joinPathSegments; } }); // node_modules/@nodelib/fs.walk/out/readers/reader.js var require_reader = __commonJS({ "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var common = require_common2(); var Reader = class { constructor(_root, _settings) { this._root = _root; this._settings = _settings; this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); } }; __name(Reader, "Reader"); exports.default = Reader; } }); // node_modules/@nodelib/fs.walk/out/readers/async.js var require_async3 = __commonJS({ "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var events_1 = require("events"); var fsScandir = require_out2(); var fastq = require_queue(); var common = require_common2(); var reader_1 = require_reader(); var AsyncReader = class extends reader_1.default { constructor(_root, _settings) { super(_root, _settings); this._settings = _settings; this._scandir = fsScandir.scandir; this._emitter = new events_1.EventEmitter(); this._queue = fastq(this._worker.bind(this), this._settings.concurrency); this._isFatalError = false; this._isDestroyed = false; this._queue.drain = () => { if (!this._isFatalError) { this._emitter.emit("end"); } }; } read() { this._isFatalError = false; this._isDestroyed = false; setImmediate(() => { this._pushToQueue(this._root, this._settings.basePath); }); return this._emitter; } get isDestroyed() { return this._isDestroyed; } destroy() { if (this._isDestroyed) { throw new Error("The reader is already destroyed"); } this._isDestroyed = true; this._queue.killAndDrain(); } onEntry(callback) { this._emitter.on("entry", callback); } onError(callback) { this._emitter.once("error", callback); } onEnd(callback) { this._emitter.once("end", callback); } _pushToQueue(directory, base) { const queueItem = { directory, base }; this._queue.push(queueItem, (error) => { if (error !== null) { this._handleError(error); } }); } _worker(item, done) { this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { if (error !== null) { done(error, void 0); return; } for (const entry of entries) { this._handleEntry(entry, item.base); } done(null, void 0); }); } _handleError(error) { if (this._isDestroyed || !common.isFatalError(this._settings, error)) { return; } this._isFatalError = true; this._isDestroyed = true; this._emitter.emit("error", error); } _handleEntry(entry, base) { if (this._isDestroyed || this._isFatalError) { return; } const fullpath = entry.path; if (base !== void 0) { entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); } if (common.isAppliedFilter(this._settings.entryFilter, entry)) { this._emitEntry(entry); } if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); } } _emitEntry(entry) { this._emitter.emit("entry", entry); } }; __name(AsyncReader, "AsyncReader"); exports.default = AsyncReader; } }); // node_modules/@nodelib/fs.walk/out/providers/async.js var require_async4 = __commonJS({ "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var async_1 = require_async3(); var AsyncProvider = class { constructor(_root, _settings) { this._root = _root; this._settings = _settings; this._reader = new async_1.default(this._root, this._settings); this._storage = []; } read(callback) { this._reader.onError((error) => { callFailureCallback(callback, error); }); this._reader.onEntry((entry) => { this._storage.push(entry); }); this._reader.onEnd(() => { callSuccessCallback(callback, this._storage); }); this._reader.read(); } }; __name(AsyncProvider, "AsyncProvider"); exports.default = AsyncProvider; function callFailureCallback(callback, error) { callback(error); } __name(callFailureCallback, "callFailureCallback"); function callSuccessCallback(callback, entries) { callback(null, entries); } __name(callSuccessCallback, "callSuccessCallback"); } }); // node_modules/@nodelib/fs.walk/out/providers/stream.js var require_stream2 = __commonJS({ "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var stream_1 = require("stream"); var async_1 = require_async3(); var StreamProvider = class { constructor(_root, _settings) { this._root = _root; this._settings = _settings; this._reader = new async_1.default(this._root, this._settings); this._stream = new stream_1.Readable({ objectMode: true, read: () => { }, destroy: () => { if (!this._reader.isDestroyed) { this._reader.destroy(); } } }); } read() { this._reader.onError((error) => { this._stream.emit("error", error); }); this._reader.onEntry((entry) => { this._stream.push(entry); }); this._reader.onEnd(() => { this._stream.push(null); }); this._reader.read(); return this._stream; } }; __name(StreamProvider, "StreamProvider"); exports.default = StreamProvider; } }); // node_modules/@nodelib/fs.walk/out/readers/sync.js var require_sync3 = __commonJS({ "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var fsScandir = require_out2(); var common = require_common2(); var reader_1 = require_reader(); var SyncReader = class extends reader_1.default { constructor() { super(...arguments); this._scandir = fsScandir.scandirSync; this._storage = []; this._queue = /* @__PURE__ */ new Set(); } read() { this._pushToQueue(this._root, this._settings.basePath); this._handleQueue(); return this._storage; } _pushToQueue(directory, base) { this._queue.add({ directory, base }); } _handleQueue() { for (const item of this._queue.values()) { this._handleDirectory(item.directory, item.base); } } _handleDirectory(directory, base) { try { const entries = this._scandir(directory, this._settings.fsScandirSettings); for (const entry of entries) { this._handleEntry(entry, base); } } catch (error) { this._handleError(error); } } _handleError(error) { if (!common.isFatalError(this._settings, error)) { return; } throw error; } _handleEntry(entry, base) { const fullpath = entry.path; if (base !== void 0) { entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); } if (common.isAppliedFilter(this._settings.entryFilter, entry)) { this._pushToStorage(entry); } if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); } } _pushToStorage(entry) { this._storage.push(entry); } }; __name(SyncReader, "SyncReader"); exports.default = SyncReader; } }); // node_modules/@nodelib/fs.walk/out/providers/sync.js var require_sync4 = __commonJS({ "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var sync_1 = require_sync3(); var SyncProvider = class { constructor(_root, _settings) { this._root = _root; this._settings = _settings; this._reader = new sync_1.default(this._root, this._settings); } read() { return this._reader.read(); } }; __name(SyncProvider, "SyncProvider"); exports.default = SyncProvider; } }); // node_modules/@nodelib/fs.walk/out/settings.js var require_settings3 = __commonJS({ "node_modules/@nodelib/fs.walk/out/settings.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var path2 = require("path"); var fsScandir = require_out2(); var Settings3 = class { constructor(_options = {}) { this._options = _options; this.basePath = this._getValue(this._options.basePath, void 0); this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); this.deepFilter = this._getValue(this._options.deepFilter, null); this.entryFilter = this._getValue(this._options.entryFilter, null); this.errorFilter = this._getValue(this._options.errorFilter, null); this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path2.sep); this.fsScandirSettings = new fsScandir.Settings({ followSymbolicLinks: this._options.followSymbolicLinks, fs: this._options.fs, pathSegmentSeparator: this._options.pathSegmentSeparator, stats: this._options.stats, throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink }); } _getValue(option, value) { return option !== null && option !== void 0 ? option : value; } }; __name(Settings3, "Settings"); exports.default = Settings3; } }); // node_modules/@nodelib/fs.walk/out/index.js var require_out3 = __commonJS({ "node_modules/@nodelib/fs.walk/out/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; var async_1 = require_async4(); var stream_1 = require_stream2(); var sync_1 = require_sync4(); var settings_1 = require_settings3(); exports.Settings = settings_1.default; function walk(directory, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === "function") { new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); return; } new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); } __name(walk, "walk"); exports.walk = walk; function walkSync(directory, optionsOrSettings) { const settings2 = getSettings(optionsOrSettings); const provider = new sync_1.default(directory, settings2); return provider.read(); } __name(walkSync, "walkSync"); exports.walkSync = walkSync; function walkStream(directory, optionsOrSettings) { const settings2 = getSettings(optionsOrSettings); const provider = new stream_1.default(directory, settings2); return provider.read(); } __name(walkStream, "walkStream"); exports.walkStream = walkStream; function getSettings(settingsOrOptions = {}) { if (settingsOrOptions instanceof settings_1.default) { return settingsOrOptions; } return new settings_1.default(settingsOrOptions); } __name(getSettings, "getSettings"); } }); // node_modules/fast-glob/out/readers/reader.js var require_reader2 = __commonJS({ "node_modules/fast-glob/out/readers/reader.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var path2 = require("path"); var fsStat = require_out(); var utils = require_utils3(); var Reader = class { constructor(_settings) { this._settings = _settings; this._fsStatSettings = new fsStat.Settings({ followSymbolicLink: this._settings.followSymbolicLinks, fs: this._settings.fs, throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks }); } _getFullEntryPath(filepath) { return path2.resolve(this._settings.cwd, filepath); } _makeEntry(stats, pattern) { const entry = { name: pattern, path: pattern, dirent: utils.fs.createDirentFromStats(pattern, stats) }; if (this._settings.stats) { entry.stats = stats; } return entry; } _isFatalError(error) { return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; } }; __name(Reader, "Reader"); exports.default = Reader; } }); // node_modules/fast-glob/out/readers/stream.js var require_stream3 = __commonJS({ "node_modules/fast-glob/out/readers/stream.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var stream_1 = require("stream"); var fsStat = require_out(); var fsWalk = require_out3(); var reader_1 = require_reader2(); var ReaderStream = class extends reader_1.default { constructor() { super(...arguments); this._walkStream = fsWalk.walkStream; this._stat = fsStat.stat; } dynamic(root, options) { return this._walkStream(root, options); } static(patterns, options) { const filepaths = patterns.map(this._getFullEntryPath, this); const stream = new stream_1.PassThrough({ objectMode: true }); stream._write = (index2, _enc, done) => { return this._getEntry(filepaths[index2], patterns[index2], options).then((entry) => { if (entry !== null && options.entryFilter(entry)) { stream.push(entry); } if (index2 === filepaths.length - 1) { stream.end(); } done(); }).catch(done); }; for (let i = 0; i < filepaths.length; i++) { stream.write(i); } return stream; } _getEntry(filepath, pattern, options) { return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => { if (options.errorFilter(error)) { return null; } throw error; }); } _getStat(filepath) { return new Promise((resolve, reject2) => { this._stat(filepath, this._fsStatSettings, (error, stats) => { return error === null ? resolve(stats) : reject2(error); }); }); } }; __name(ReaderStream, "ReaderStream"); exports.default = ReaderStream; } }); // node_modules/fast-glob/out/readers/async.js var require_async5 = __commonJS({ "node_modules/fast-glob/out/readers/async.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var fsWalk = require_out3(); var reader_1 = require_reader2(); var stream_1 = require_stream3(); var ReaderAsync = class extends reader_1.default { constructor() { super(...arguments); this._walkAsync = fsWalk.walk; this._readerStream = new stream_1.default(this._settings); } dynamic(root, options) { return new Promise((resolve, reject2) => { this._walkAsync(root, options, (error, entries) => { if (error === null) { resolve(entries); } else { reject2(error); } }); }); } static(patterns, options) { return __async(this, null, function* () { const entries = []; const stream = this._readerStream.static(patterns, options); return new Promise((resolve, reject2) => { stream.once("error", reject2); stream.on("data", (entry) => entries.push(entry)); stream.once("end", () => resolve(entries)); }); }); } }; __name(ReaderAsync, "ReaderAsync"); exports.default = ReaderAsync; } }); // node_modules/fast-glob/out/providers/matchers/matcher.js var require_matcher = __commonJS({ "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var utils = require_utils3(); var Matcher = class { constructor(_patterns, _settings, _micromatchOptions) { this._patterns = _patterns; this._settings = _settings; this._micromatchOptions = _micromatchOptions; this._storage = []; this._fillStorage(); } _fillStorage() { const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns); for (const pattern of patterns) { const segments = this._getPatternSegments(pattern); const sections = this._splitSegmentsIntoSections(segments); this._storage.push({ complete: sections.length <= 1, pattern, segments, sections }); } } _getPatternSegments(pattern) { const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); return parts.map((part) => { const dynamic = utils.pattern.isDynamicPattern(part, this._settings); if (!dynamic) { return { dynamic: false, pattern: part }; } return { dynamic: true, pattern: part, patternRe: utils.pattern.makeRe(part, this._micromatchOptions) }; }); } _splitSegmentsIntoSections(segments) { return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); } }; __name(Matcher, "Matcher"); exports.default = Matcher; } }); // node_modules/fast-glob/out/providers/matchers/partial.js var require_partial = __commonJS({ "node_modules/fast-glob/out/providers/matchers/partial.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var matcher_1 = require_matcher(); var PartialMatcher = class extends matcher_1.default { match(filepath) { const parts = filepath.split("/"); const levels = parts.length; const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); for (const pattern of patterns) { const section = pattern.sections[0]; if (!pattern.complete && levels > section.length) { return true; } const match = parts.every((part, index2) => { const segment = pattern.segments[index2]; if (segment.dynamic && segment.patternRe.test(part)) { return true; } if (!segment.dynamic && segment.pattern === part) { return true; } return false; }); if (match) { return true; } } return false; } }; __name(PartialMatcher, "PartialMatcher"); exports.default = PartialMatcher; } }); // node_modules/fast-glob/out/providers/filters/deep.js var require_deep = __commonJS({ "node_modules/fast-glob/out/providers/filters/deep.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var utils = require_utils3(); var partial_1 = require_partial(); var DeepFilter = class { constructor(_settings, _micromatchOptions) { this._settings = _settings; this._micromatchOptions = _micromatchOptions; } getFilter(basePath, positive, negative) { const matcher = this._getMatcher(positive); const negativeRe = this._getNegativePatternsRe(negative); return (entry) => this._filter(basePath, entry, matcher, negativeRe); } _getMatcher(patterns) { return new partial_1.default(patterns, this._settings, this._micromatchOptions); } _getNegativePatternsRe(patterns) { const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); } _filter(basePath, entry, matcher, negativeRe) { if (this._isSkippedByDeep(basePath, entry.path)) { return false; } if (this._isSkippedSymbolicLink(entry)) { return false; } const filepath = utils.path.removeLeadingDotSegment(entry.path); if (this._isSkippedByPositivePatterns(filepath, matcher)) { return false; } return this._isSkippedByNegativePatterns(filepath, negativeRe); } _isSkippedByDeep(basePath, entryPath) { if (this._settings.deep === Infinity) { return false; } return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; } _getEntryLevel(basePath, entryPath) { const entryPathDepth = entryPath.split("/").length; if (basePath === "") { return entryPathDepth; } const basePathDepth = basePath.split("/").length; return entryPathDepth - basePathDepth; } _isSkippedSymbolicLink(entry) { return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); } _isSkippedByPositivePatterns(entryPath, matcher) { return !this._settings.baseNameMatch && !matcher.match(entryPath); } _isSkippedByNegativePatterns(entryPath, patternsRe) { return !utils.pattern.matchAny(entryPath, patternsRe); } }; __name(DeepFilter, "DeepFilter"); exports.default = DeepFilter; } }); // node_modules/fast-glob/out/providers/filters/entry.js var require_entry = __commonJS({ "node_modules/fast-glob/out/providers/filters/entry.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var utils = require_utils3(); var EntryFilter = class { constructor(_settings, _micromatchOptions) { this._settings = _settings; this._micromatchOptions = _micromatchOptions; this.index = /* @__PURE__ */ new Map(); } getFilter(positive, negative) { const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions); return (entry) => this._filter(entry, positiveRe, negativeRe); } _filter(entry, positiveRe, negativeRe) { if (this._settings.unique && this._isDuplicateEntry(entry)) { return false; } if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { return false; } if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) { return false; } const filepath = this._settings.baseNameMatch ? entry.name : entry.path; const isDirectory = entry.dirent.isDirectory(); const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(entry.path, negativeRe, isDirectory); if (this._settings.unique && isMatched) { this._createIndexRecord(entry); } return isMatched; } _isDuplicateEntry(entry) { return this.index.has(entry.path); } _createIndexRecord(entry) { this.index.set(entry.path, void 0); } _onlyFileFilter(entry) { return this._settings.onlyFiles && !entry.dirent.isFile(); } _onlyDirectoryFilter(entry) { return this._settings.onlyDirectories && !entry.dirent.isDirectory(); } _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { if (!this._settings.absolute) { return false; } const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); return utils.pattern.matchAny(fullpath, patternsRe); } _isMatchToPatterns(entryPath, patternsRe, isDirectory) { const filepath = utils.path.removeLeadingDotSegment(entryPath); const isMatched = utils.pattern.matchAny(filepath, patternsRe); if (!isMatched && isDirectory) { return utils.pattern.matchAny(filepath + "/", patternsRe); } return isMatched; } }; __name(EntryFilter, "EntryFilter"); exports.default = EntryFilter; } }); // node_modules/fast-glob/out/providers/filters/error.js var require_error = __commonJS({ "node_modules/fast-glob/out/providers/filters/error.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var utils = require_utils3(); var ErrorFilter = class { constructor(_settings) { this._settings = _settings; } getFilter() { return (error) => this._isNonFatalError(error); } _isNonFatalError(error) { return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; } }; __name(ErrorFilter, "ErrorFilter"); exports.default = ErrorFilter; } }); // node_modules/fast-glob/out/providers/transformers/entry.js var require_entry2 = __commonJS({ "node_modules/fast-glob/out/providers/transformers/entry.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var utils = require_utils3(); var EntryTransformer = class { constructor(_settings) { this._settings = _settings; } getTransformer() { return (entry) => this._transform(entry); } _transform(entry) { let filepath = entry.path; if (this._settings.absolute) { filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); filepath = utils.path.unixify(filepath); } if (this._settings.markDirectories && entry.dirent.isDirectory()) { filepath += "/"; } if (!this._settings.objectMode) { return filepath; } return Object.assign(Object.assign({}, entry), { path: filepath }); } }; __name(EntryTransformer, "EntryTransformer"); exports.default = EntryTransformer; } }); // node_modules/fast-glob/out/providers/provider.js var require_provider = __commonJS({ "node_modules/fast-glob/out/providers/provider.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var path2 = require("path"); var deep_1 = require_deep(); var entry_1 = require_entry(); var error_1 = require_error(); var entry_2 = require_entry2(); var Provider = class { constructor(_settings) { this._settings = _settings; this.errorFilter = new error_1.default(this._settings); this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); this.entryTransformer = new entry_2.default(this._settings); } _getRootDirectory(task) { return path2.resolve(this._settings.cwd, task.base); } _getReaderOptions(task) { const basePath = task.base === "." ? "" : task.base; return { basePath, pathSegmentSeparator: "/", concurrency: this._settings.concurrency, deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), entryFilter: this.entryFilter.getFilter(task.positive, task.negative), errorFilter: this.errorFilter.getFilter(), followSymbolicLinks: this._settings.followSymbolicLinks, fs: this._settings.fs, stats: this._settings.stats, throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, transform: this.entryTransformer.getTransformer() }; } _getMicromatchOptions() { return { dot: this._settings.dot, matchBase: this._settings.baseNameMatch, nobrace: !this._settings.braceExpansion, nocase: !this._settings.caseSensitiveMatch, noext: !this._settings.extglob, noglobstar: !this._settings.globstar, posix: true, strictSlashes: false }; } }; __name(Provider, "Provider"); exports.default = Provider; } }); // node_modules/fast-glob/out/providers/async.js var require_async6 = __commonJS({ "node_modules/fast-glob/out/providers/async.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var async_1 = require_async5(); var provider_1 = require_provider(); var ProviderAsync = class extends provider_1.default { constructor() { super(...arguments); this._reader = new async_1.default(this._settings); } read(task) { return __async(this, null, function* () { const root = this._getRootDirectory(task); const options = this._getReaderOptions(task); const entries = yield this.api(root, task, options); return entries.map((entry) => options.transform(entry)); }); } api(root, task, options) { if (task.dynamic) { return this._reader.dynamic(root, options); } return this._reader.static(task.patterns, options); } }; __name(ProviderAsync, "ProviderAsync"); exports.default = ProviderAsync; } }); // node_modules/fast-glob/out/providers/stream.js var require_stream4 = __commonJS({ "node_modules/fast-glob/out/providers/stream.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var stream_1 = require("stream"); var stream_2 = require_stream3(); var provider_1 = require_provider(); var ProviderStream = class extends provider_1.default { constructor() { super(...arguments); this._reader = new stream_2.default(this._settings); } read(task) { const root = this._getRootDirectory(task); const options = this._getReaderOptions(task); const source = this.api(root, task, options); const destination = new stream_1.Readable({ objectMode: true, read: () => { } }); source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end")); destination.once("close", () => source.destroy()); return destination; } api(root, task, options) { if (task.dynamic) { return this._reader.dynamic(root, options); } return this._reader.static(task.patterns, options); } }; __name(ProviderStream, "ProviderStream"); exports.default = ProviderStream; } }); // node_modules/fast-glob/out/readers/sync.js var require_sync5 = __commonJS({ "node_modules/fast-glob/out/readers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var fsStat = require_out(); var fsWalk = require_out3(); var reader_1 = require_reader2(); var ReaderSync = class extends reader_1.default { constructor() { super(...arguments); this._walkSync = fsWalk.walkSync; this._statSync = fsStat.statSync; } dynamic(root, options) { return this._walkSync(root, options); } static(patterns, options) { const entries = []; for (const pattern of patterns) { const filepath = this._getFullEntryPath(pattern); const entry = this._getEntry(filepath, pattern, options); if (entry === null || !options.entryFilter(entry)) { continue; } entries.push(entry); } return entries; } _getEntry(filepath, pattern, options) { try { const stats = this._getStat(filepath); return this._makeEntry(stats, pattern); } catch (error) { if (options.errorFilter(error)) { return null; } throw error; } } _getStat(filepath) { return this._statSync(filepath, this._fsStatSettings); } }; __name(ReaderSync, "ReaderSync"); exports.default = ReaderSync; } }); // node_modules/fast-glob/out/providers/sync.js var require_sync6 = __commonJS({ "node_modules/fast-glob/out/providers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var sync_1 = require_sync5(); var provider_1 = require_provider(); var ProviderSync = class extends provider_1.default { constructor() { super(...arguments); this._reader = new sync_1.default(this._settings); } read(task) { const root = this._getRootDirectory(task); const options = this._getReaderOptions(task); const entries = this.api(root, task, options); return entries.map(options.transform); } api(root, task, options) { if (task.dynamic) { return this._reader.dynamic(root, options); } return this._reader.static(task.patterns, options); } }; __name(ProviderSync, "ProviderSync"); exports.default = ProviderSync; } }); // node_modules/fast-glob/out/settings.js var require_settings4 = __commonJS({ "node_modules/fast-glob/out/settings.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; var fs3 = require("fs"); var os = require("os"); var CPU_COUNT = Math.max(os.cpus().length, 1); exports.DEFAULT_FILE_SYSTEM_ADAPTER = { lstat: fs3.lstat, lstatSync: fs3.lstatSync, stat: fs3.stat, statSync: fs3.statSync, readdir: fs3.readdir, readdirSync: fs3.readdirSync }; var Settings3 = class { constructor(_options = {}) { this._options = _options; this.absolute = this._getValue(this._options.absolute, false); this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); this.braceExpansion = this._getValue(this._options.braceExpansion, true); this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); this.cwd = this._getValue(this._options.cwd, process.cwd()); this.deep = this._getValue(this._options.deep, Infinity); this.dot = this._getValue(this._options.dot, false); this.extglob = this._getValue(this._options.extglob, true); this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); this.fs = this._getFileSystemMethods(this._options.fs); this.globstar = this._getValue(this._options.globstar, true); this.ignore = this._getValue(this._options.ignore, []); this.markDirectories = this._getValue(this._options.markDirectories, false); this.objectMode = this._getValue(this._options.objectMode, false); this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); this.onlyFiles = this._getValue(this._options.onlyFiles, true); this.stats = this._getValue(this._options.stats, false); this.suppressErrors = this._getValue(this._options.suppressErrors, false); this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); this.unique = this._getValue(this._options.unique, true); if (this.onlyDirectories) { this.onlyFiles = false; } if (this.stats) { this.objectMode = true; } } _getValue(option, value) { return option === void 0 ? value : option; } _getFileSystemMethods(methods = {}) { return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); } }; __name(Settings3, "Settings"); exports.default = Settings3; } }); // node_modules/fast-glob/out/index.js var require_out4 = __commonJS({ "node_modules/fast-glob/out/index.js"(exports, module2) { "use strict"; var taskManager = require_tasks(); var patternManager = require_patterns(); var async_1 = require_async6(); var stream_1 = require_stream4(); var sync_1 = require_sync6(); var settings_1 = require_settings4(); var utils = require_utils3(); function FastGlob(source, options) { return __async(this, null, function* () { assertPatternsInput2(source); const works = getWorks(source, async_1.default, options); const result = yield Promise.all(works); return utils.array.flatten(result); }); } __name(FastGlob, "FastGlob"); (function(FastGlob2) { function sync(source, options) { assertPatternsInput2(source); const works = getWorks(source, sync_1.default, options); return utils.array.flatten(works); } __name(sync, "sync"); FastGlob2.sync = sync; function stream(source, options) { assertPatternsInput2(source); const works = getWorks(source, stream_1.default, options); return utils.stream.merge(works); } __name(stream, "stream"); FastGlob2.stream = stream; function generateTasks2(source, options) { assertPatternsInput2(source); const patterns = patternManager.transform([].concat(source)); const settings2 = new settings_1.default(options); return taskManager.generate(patterns, settings2); } __name(generateTasks2, "generateTasks"); FastGlob2.generateTasks = generateTasks2; function isDynamicPattern2(source, options) { assertPatternsInput2(source); const settings2 = new settings_1.default(options); return utils.pattern.isDynamicPattern(source, settings2); } __name(isDynamicPattern2, "isDynamicPattern"); FastGlob2.isDynamicPattern = isDynamicPattern2; function escapePath(source) { assertPatternsInput2(source); return utils.path.escape(source); } __name(escapePath, "escapePath"); FastGlob2.escapePath = escapePath; })(FastGlob || (FastGlob = {})); function getWorks(source, _Provider, options) { const patterns = patternManager.transform([].concat(source)); const settings2 = new settings_1.default(options); const tasks = taskManager.generate(patterns, settings2); const provider = new _Provider(settings2); return tasks.map(provider.read, provider); } __name(getWorks, "getWorks"); function assertPatternsInput2(input) { const source = [].concat(input); const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); if (!isValidSource) { throw new TypeError("Patterns must be a string (non empty) or an array of strings"); } } __name(assertPatternsInput2, "assertPatternsInput"); module2.exports = FastGlob; } }); // node_modules/path-type/index.js var require_path_type = __commonJS({ "node_modules/path-type/index.js"(exports) { "use strict"; var { promisify } = require("util"); var fs3 = require("fs"); function isType(fsStatType, statsMethodName, filePath) { return __async(this, null, function* () { if (typeof filePath !== "string") { throw new TypeError(`Expected a string, got ${typeof filePath}`); } try { const stats = yield promisify(fs3[fsStatType])(filePath); return stats[statsMethodName](); } catch (error) { if (error.code === "ENOENT") { return false; } throw error; } }); } __name(isType, "isType"); function isTypeSync(fsStatType, statsMethodName, filePath) { if (typeof filePath !== "string") { throw new TypeError(`Expected a string, got ${typeof filePath}`); } try { return fs3[fsStatType](filePath)[statsMethodName](); } catch (error) { if (error.code === "ENOENT") { return false; } throw error; } } __name(isTypeSync, "isTypeSync"); exports.isFile = isType.bind(null, "stat", "isFile"); exports.isDirectory = isType.bind(null, "stat", "isDirectory"); exports.isSymlink = isType.bind(null, "lstat", "isSymbolicLink"); exports.isFileSync = isTypeSync.bind(null, "statSync", "isFile"); exports.isDirectorySync = isTypeSync.bind(null, "statSync", "isDirectory"); exports.isSymlinkSync = isTypeSync.bind(null, "lstatSync", "isSymbolicLink"); } }); // node_modules/dir-glob/index.js var require_dir_glob = __commonJS({ "node_modules/dir-glob/index.js"(exports, module2) { "use strict"; var path2 = require("path"); var pathType = require_path_type(); var getExtensions = /* @__PURE__ */ __name((extensions) => extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0], "getExtensions"); var getPath = /* @__PURE__ */ __name((filepath, cwd) => { const pth = filepath[0] === "!" ? filepath.slice(1) : filepath; return path2.isAbsolute(pth) ? pth : path2.join(cwd, pth); }, "getPath"); var addExtensions = /* @__PURE__ */ __name((file, extensions) => { if (path2.extname(file)) { return `**/${file}`; } return `**/${file}.${getExtensions(extensions)}`; }, "addExtensions"); var getGlob = /* @__PURE__ */ __name((directory, options) => { if (options.files && !Array.isArray(options.files)) { throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof options.files}\``); } if (options.extensions && !Array.isArray(options.extensions)) { throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof options.extensions}\``); } if (options.files && options.extensions) { return options.files.map((x) => path2.posix.join(directory, addExtensions(x, options.extensions))); } if (options.files) { return options.files.map((x) => path2.posix.join(directory, `**/${x}`)); } if (options.extensions) { return [path2.posix.join(directory, `**/*.${getExtensions(options.extensions)}`)]; } return [path2.posix.join(directory, "**")]; }, "getGlob"); module2.exports = (input, options) => __async(exports, null, function* () { options = __spreadValues({ cwd: process.cwd() }, options); if (typeof options.cwd !== "string") { throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``); } const globs = yield Promise.all([].concat(input).map((x) => __async(exports, null, function* () { const isDirectory = yield pathType.isDirectory(getPath(x, options.cwd)); return isDirectory ? getGlob(x, options) : x; }))); return [].concat.apply([], globs); }); module2.exports.sync = (input, options) => { options = __spreadValues({ cwd: process.cwd() }, options); if (typeof options.cwd !== "string") { throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``); } const globs = [].concat(input).map((x) => pathType.isDirectorySync(getPath(x, options.cwd)) ? getGlob(x, options) : x); return [].concat.apply([], globs); }; } }); // node_modules/ignore/index.js var require_ignore = __commonJS({ "node_modules/ignore/index.js"(exports, module2) { function makeArray(subject) { return Array.isArray(subject) ? subject : [subject]; } __name(makeArray, "makeArray"); var EMPTY = ""; var SPACE = " "; var ESCAPE = "\\"; var REGEX_TEST_BLANK_LINE = /^\s+$/; var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; var REGEX_SPLITALL_CRLF = /\r?\n/g; var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/; var SLASH = "/"; var KEY_IGNORE = typeof Symbol !== "undefined" ? Symbol.for("node-ignore") : "node-ignore"; var define2 = /* @__PURE__ */ __name((object, key, value) => Object.defineProperty(object, key, { value }), "define"); var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; var RETURN_FALSE = /* @__PURE__ */ __name(() => false, "RETURN_FALSE"); var sanitizeRange = /* @__PURE__ */ __name((range2) => range2.replace(REGEX_REGEXP_RANGE, (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY), "sanitizeRange"); var cleanRangeBackSlash = /* @__PURE__ */ __name((slashes) => { const { length } = slashes; return slashes.slice(0, length - length % 2); }, "cleanRangeBackSlash"); var REPLACERS = [ [ /\\?\s+$/, (match) => match.indexOf("\\") === 0 ? SPACE : EMPTY ], [ /\\\s/g, () => SPACE ], [ /[\\$.|*+(){^]/g, (match) => `\\${match}` ], [ /(?!\\)\?/g, () => "[^/]" ], [ /^\//, () => "^" ], [ /\//g, () => "\\/" ], [ /^\^*\\\*\\\*\\\//, () => "^(?:.*\\/)?" ], [ /^(?=[^^])/, /* @__PURE__ */ __name(function startingReplacer() { return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^"; }, "startingReplacer") ], [ /\\\/\\\*\\\*(?=\\\/|$)/g, (_, index2, str) => index2 + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+" ], [ /(^|[^\\]+)\\\*(?=.+)/g, (_, p1) => `${p1}[^\\/]*` ], [ /\\\\\\(?=[$.|*+(){^])/g, () => ESCAPE ], [ /\\\\/g, () => ESCAPE ], [ /(\\)?\[([^\]/]*?)(\\*)($|\])/g, (match, leadEscape, range2, endEscape, close) => leadEscape === ESCAPE ? `\\[${range2}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range2)}${endEscape}]` : "[]" : "[]" ], [ /(?:[^*])$/, (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)` ], [ /(\^|\\\/)?\\\*$/, (_, p1) => { const prefix = p1 ? `${p1}[^/]+` : "[^/]*"; return `${prefix}(?=$|\\/$)`; } ] ]; var regexCache = /* @__PURE__ */ Object.create(null); var makeRegex = /* @__PURE__ */ __name((pattern, ignoreCase) => { let source = regexCache[pattern]; if (!source) { source = REPLACERS.reduce((prev, current) => prev.replace(current[0], current[1].bind(pattern)), pattern); regexCache[pattern] = source; } return ignoreCase ? new RegExp(source, "i") : new RegExp(source); }, "makeRegex"); var isString = /* @__PURE__ */ __name((subject) => typeof subject === "string", "isString"); var checkPattern = /* @__PURE__ */ __name((pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && pattern.indexOf("#") !== 0, "checkPattern"); var splitPattern = /* @__PURE__ */ __name((pattern) => pattern.split(REGEX_SPLITALL_CRLF), "splitPattern"); var IgnoreRule = class { constructor(origin, pattern, negative, regex) { this.origin = origin; this.pattern = pattern; this.negative = negative; this.regex = regex; } }; __name(IgnoreRule, "IgnoreRule"); var createRule = /* @__PURE__ */ __name((pattern, ignoreCase) => { const origin = pattern; let negative = false; if (pattern.indexOf("!") === 0) { negative = true; pattern = pattern.substr(1); } pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#"); const regex = makeRegex(pattern, ignoreCase); return new IgnoreRule(origin, pattern, negative, regex); }, "createRule"); var throwError = /* @__PURE__ */ __name((message, Ctor) => { throw new Ctor(message); }, "throwError"); var checkPath = /* @__PURE__ */ __name((path2, originalPath, doThrow) => { if (!isString(path2)) { return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError); } if (!path2) { return doThrow(`path must not be empty`, TypeError); } if (checkPath.isNotRelative(path2)) { const r = "`path.relative()`d"; return doThrow(`path should be a ${r} string, but got "${originalPath}"`, RangeError); } return true; }, "checkPath"); var isNotRelative = /* @__PURE__ */ __name((path2) => REGEX_TEST_INVALID_PATH.test(path2), "isNotRelative"); checkPath.isNotRelative = isNotRelative; checkPath.convert = (p) => p; var Ignore = class { constructor({ ignorecase = true, ignoreCase = ignorecase, allowRelativePaths = false } = {}) { define2(this, KEY_IGNORE, true); this._rules = []; this._ignoreCase = ignoreCase; this._allowRelativePaths = allowRelativePaths; this._initCache(); } _initCache() { this._ignoreCache = /* @__PURE__ */ Object.create(null); this._testCache = /* @__PURE__ */ Object.create(null); } _addPattern(pattern) { if (pattern && pattern[KEY_IGNORE]) { this._rules = this._rules.concat(pattern._rules); this._added = true; return; } if (checkPattern(pattern)) { const rule = createRule(pattern, this._ignoreCase); this._added = true; this._rules.push(rule); } } add(pattern) { this._added = false; makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._addPattern, this); if (this._added) { this._initCache(); } return this; } addPattern(pattern) { return this.add(pattern); } _testOne(path2, checkUnignored) { let ignored = false; let unignored = false; this._rules.forEach((rule) => { const { negative } = rule; if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { return; } const matched = rule.regex.test(path2); if (matched) { ignored = !negative; unignored = negative; } }); return { ignored, unignored }; } _test(originalPath, cache, checkUnignored, slices) { const path2 = originalPath && checkPath.convert(originalPath); checkPath(path2, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError); return this._t(path2, cache, checkUnignored, slices); } _t(path2, cache, checkUnignored, slices) { if (path2 in cache) { return cache[path2]; } if (!slices) { slices = path2.split(SLASH); } slices.pop(); if (!slices.length) { return cache[path2] = this._testOne(path2, checkUnignored); } const parent2 = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices); return cache[path2] = parent2.ignored ? parent2 : this._testOne(path2, checkUnignored); } ignores(path2) { return this._test(path2, this._ignoreCache, false).ignored; } createFilter() { return (path2) => !this.ignores(path2); } filter(paths) { return makeArray(paths).filter(this.createFilter()); } test(path2) { return this._test(path2, this._testCache, true); } }; __name(Ignore, "Ignore"); var factory = /* @__PURE__ */ __name((options) => new Ignore(options), "factory"); var isPathValid = /* @__PURE__ */ __name((path2) => checkPath(path2 && checkPath.convert(path2), path2, RETURN_FALSE), "isPathValid"); factory.isPathValid = isPathValid; factory.default = factory; module2.exports = factory; if (typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")) { const makePosix = /* @__PURE__ */ __name((str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/"), "makePosix"); checkPath.convert = makePosix; const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; checkPath.isNotRelative = (path2) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path2) || isNotRelative(path2); } } }); // node_modules/moment/moment.js var require_moment = __commonJS({ "node_modules/moment/moment.js"(exports, module2) { (function(global2, factory) { typeof exports === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.moment = factory(); })(exports, function() { "use strict"; var hookCallback; function hooks() { return hookCallback.apply(null, arguments); } __name(hooks, "hooks"); function setHookCallback(callback) { hookCallback = callback; } __name(setHookCallback, "setHookCallback"); function isArray(input) { return input instanceof Array || Object.prototype.toString.call(input) === "[object Array]"; } __name(isArray, "isArray"); function isObject(input) { return input != null && Object.prototype.toString.call(input) === "[object Object]"; } __name(isObject, "isObject"); function hasOwnProp(a, b) { return Object.prototype.hasOwnProperty.call(a, b); } __name(hasOwnProp, "hasOwnProp"); function isObjectEmpty(obj) { if (Object.getOwnPropertyNames) { return Object.getOwnPropertyNames(obj).length === 0; } else { var k; for (k in obj) { if (hasOwnProp(obj, k)) { return false; } } return true; } } __name(isObjectEmpty, "isObjectEmpty"); function isUndefined(input) { return input === void 0; } __name(isUndefined, "isUndefined"); function isNumber(input) { return typeof input === "number" || Object.prototype.toString.call(input) === "[object Number]"; } __name(isNumber, "isNumber"); function isDate(input) { return input instanceof Date || Object.prototype.toString.call(input) === "[object Date]"; } __name(isDate, "isDate"); function map2(arr, fn) { var res = [], i, arrLen = arr.length; for (i = 0; i < arrLen; ++i) { res.push(fn(arr[i], i)); } return res; } __name(map2, "map"); function extend(a, b) { for (var i in b) { if (hasOwnProp(b, i)) { a[i] = b[i]; } } if (hasOwnProp(b, "toString")) { a.toString = b.toString; } if (hasOwnProp(b, "valueOf")) { a.valueOf = b.valueOf; } return a; } __name(extend, "extend"); function createUTC(input, format2, locale2, strict) { return createLocalOrUTC(input, format2, locale2, strict, true).utc(); } __name(createUTC, "createUTC"); function defaultParsingFlags() { return { empty: false, unusedTokens: [], unusedInput: [], overflow: -2, charsLeftOver: 0, nullInput: false, invalidEra: null, invalidMonth: null, invalidFormat: false, userInvalidated: false, iso: false, parsedDateParts: [], era: null, meridiem: null, rfc2822: false, weekdayMismatch: false }; } __name(defaultParsingFlags, "defaultParsingFlags"); function getParsingFlags(m) { if (m._pf == null) { m._pf = defaultParsingFlags(); } return m._pf; } __name(getParsingFlags, "getParsingFlags"); var some2; if (Array.prototype.some) { some2 = Array.prototype.some; } else { some2 = /* @__PURE__ */ __name(function(fun) { var t = Object(this), len = t.length >>> 0, i; for (i = 0; i < len; i++) { if (i in t && fun.call(this, t[i], i, t)) { return true; } } return false; }, "some"); } function isValid(m) { if (m._isValid == null) { var flags = getParsingFlags(m), parsedParts = some2.call(flags.parsedDateParts, function(i) { return i != null; }), isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts); if (m._strict) { isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === void 0; } if (Object.isFrozen == null || !Object.isFrozen(m)) { m._isValid = isNowValid; } else { return isNowValid; } } return m._isValid; } __name(isValid, "isValid"); function createInvalid(flags) { var m = createUTC(NaN); if (flags != null) { extend(getParsingFlags(m), flags); } else { getParsingFlags(m).userInvalidated = true; } return m; } __name(createInvalid, "createInvalid"); var momentProperties = hooks.momentProperties = [], updateInProgress = false; function copyConfig(to2, from2) { var i, prop, val, momentPropertiesLen = momentProperties.length; if (!isUndefined(from2._isAMomentObject)) { to2._isAMomentObject = from2._isAMomentObject; } if (!isUndefined(from2._i)) { to2._i = from2._i; } if (!isUndefined(from2._f)) { to2._f = from2._f; } if (!isUndefined(from2._l)) { to2._l = from2._l; } if (!isUndefined(from2._strict)) { to2._strict = from2._strict; } if (!isUndefined(from2._tzm)) { to2._tzm = from2._tzm; } if (!isUndefined(from2._isUTC)) { to2._isUTC = from2._isUTC; } if (!isUndefined(from2._offset)) { to2._offset = from2._offset; } if (!isUndefined(from2._pf)) { to2._pf = getParsingFlags(from2); } if (!isUndefined(from2._locale)) { to2._locale = from2._locale; } if (momentPropertiesLen > 0) { for (i = 0; i < momentPropertiesLen; i++) { prop = momentProperties[i]; val = from2[prop]; if (!isUndefined(val)) { to2[prop] = val; } } } return to2; } __name(copyConfig, "copyConfig"); function Moment(config2) { copyConfig(this, config2); this._d = new Date(config2._d != null ? config2._d.getTime() : NaN); if (!this.isValid()) { this._d = new Date(NaN); } if (updateInProgress === false) { updateInProgress = true; hooks.updateOffset(this); updateInProgress = false; } } __name(Moment, "Moment"); function isMoment(obj) { return obj instanceof Moment || obj != null && obj._isAMomentObject != null; } __name(isMoment, "isMoment"); function warn(msg) { if (hooks.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) { console.warn("Deprecation warning: " + msg); } } __name(warn, "warn"); function deprecate(msg, fn) { var firstTime = true; return extend(function() { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(null, msg); } if (firstTime) { var args = [], arg, i, key, argLen = arguments.length; for (i = 0; i < argLen; i++) { arg = ""; if (typeof arguments[i] === "object") { arg += "\n[" + i + "] "; for (key in arguments[0]) { if (hasOwnProp(arguments[0], key)) { arg += key + ": " + arguments[0][key] + ", "; } } arg = arg.slice(0, -2); } else { arg = arguments[i]; } args.push(arg); } warn(msg + "\nArguments: " + Array.prototype.slice.call(args).join("") + "\n" + new Error().stack); firstTime = false; } return fn.apply(this, arguments); }, fn); } __name(deprecate, "deprecate"); var deprecations = {}; function deprecateSimple(name, msg) { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(name, msg); } if (!deprecations[name]) { warn(msg); deprecations[name] = true; } } __name(deprecateSimple, "deprecateSimple"); hooks.suppressDeprecationWarnings = false; hooks.deprecationHandler = null; function isFunction(input) { return typeof Function !== "undefined" && input instanceof Function || Object.prototype.toString.call(input) === "[object Function]"; } __name(isFunction, "isFunction"); function set(config2) { var prop, i; for (i in config2) { if (hasOwnProp(config2, i)) { prop = config2[i]; if (isFunction(prop)) { this[i] = prop; } else { this["_" + i] = prop; } } } this._config = config2; this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source); } __name(set, "set"); function mergeConfigs(parentConfig, childConfig) { var res = extend({}, parentConfig), prop; for (prop in childConfig) { if (hasOwnProp(childConfig, prop)) { if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { res[prop] = {}; extend(res[prop], parentConfig[prop]); extend(res[prop], childConfig[prop]); } else if (childConfig[prop] != null) { res[prop] = childConfig[prop]; } else { delete res[prop]; } } } for (prop in parentConfig) { if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) { res[prop] = extend({}, res[prop]); } } return res; } __name(mergeConfigs, "mergeConfigs"); function Locale(config2) { if (config2 != null) { this.set(config2); } } __name(Locale, "Locale"); var keys; if (Object.keys) { keys = Object.keys; } else { keys = /* @__PURE__ */ __name(function(obj) { var i, res = []; for (i in obj) { if (hasOwnProp(obj, i)) { res.push(i); } } return res; }, "keys"); } var defaultCalendar = { sameDay: "[Today at] LT", nextDay: "[Tomorrow at] LT", nextWeek: "dddd [at] LT", lastDay: "[Yesterday at] LT", lastWeek: "[Last] dddd [at] LT", sameElse: "L" }; function calendar(key, mom, now2) { var output = this._calendar[key] || this._calendar["sameElse"]; return isFunction(output) ? output.call(mom, now2) : output; } __name(calendar, "calendar"); function zeroFill(number, targetLength, forceSign) { var absNumber = "" + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign2 = number >= 0; return (sign2 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } __name(zeroFill, "zeroFill"); var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {}; function addFormatToken(token2, padded, ordinal2, callback) { var func = callback; if (typeof callback === "string") { func = /* @__PURE__ */ __name(function() { return this[callback](); }, "func"); } if (token2) { formatTokenFunctions[token2] = func; } if (padded) { formatTokenFunctions[padded[0]] = function() { return zeroFill(func.apply(this, arguments), padded[1], padded[2]); }; } if (ordinal2) { formatTokenFunctions[ordinal2] = function() { return this.localeData().ordinal(func.apply(this, arguments), token2); }; } } __name(addFormatToken, "addFormatToken"); function removeFormattingTokens(input) { if (input.match(/\[[\s\S]/)) { return input.replace(/^\[|\]$/g, ""); } return input.replace(/\\/g, ""); } __name(removeFormattingTokens, "removeFormattingTokens"); function makeFormatFunction(format2) { var array = format2.match(formattingTokens), i, length; for (i = 0, length = array.length; i < length; i++) { if (formatTokenFunctions[array[i]]) { array[i] = formatTokenFunctions[array[i]]; } else { array[i] = removeFormattingTokens(array[i]); } } return function(mom) { var output = "", i2; for (i2 = 0; i2 < length; i2++) { output += isFunction(array[i2]) ? array[i2].call(mom, format2) : array[i2]; } return output; }; } __name(makeFormatFunction, "makeFormatFunction"); function formatMoment(m, format2) { if (!m.isValid()) { return m.localeData().invalidDate(); } format2 = expandFormat(format2, m.localeData()); formatFunctions[format2] = formatFunctions[format2] || makeFormatFunction(format2); return formatFunctions[format2](m); } __name(formatMoment, "formatMoment"); function expandFormat(format2, locale2) { var i = 5; function replaceLongDateFormatTokens(input) { return locale2.longDateFormat(input) || input; } __name(replaceLongDateFormatTokens, "replaceLongDateFormatTokens"); localFormattingTokens.lastIndex = 0; while (i >= 0 && localFormattingTokens.test(format2)) { format2 = format2.replace(localFormattingTokens, replaceLongDateFormatTokens); localFormattingTokens.lastIndex = 0; i -= 1; } return format2; } __name(expandFormat, "expandFormat"); var defaultLongDateFormat = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }; function longDateFormat(key) { var format2 = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()]; if (format2 || !formatUpper) { return format2; } this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function(tok) { if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") { return tok.slice(1); } return tok; }).join(""); return this._longDateFormat[key]; } __name(longDateFormat, "longDateFormat"); var defaultInvalidDate = "Invalid date"; function invalidDate() { return this._invalidDate; } __name(invalidDate, "invalidDate"); var defaultOrdinal = "%d", defaultDayOfMonthOrdinalParse = /\d{1,2}/; function ordinal(number) { return this._ordinal.replace("%d", number); } __name(ordinal, "ordinal"); var defaultRelativeTime = { future: "in %s", past: "%s ago", s: "a few seconds", ss: "%d seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", w: "a week", ww: "%d weeks", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }; function relativeTime(number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } __name(relativeTime, "relativeTime"); function pastFuture(diff2, output) { var format2 = this._relativeTime[diff2 > 0 ? "future" : "past"]; return isFunction(format2) ? format2(output) : format2.replace(/%s/i, output); } __name(pastFuture, "pastFuture"); var aliases = {}; function addUnitAlias(unit, shorthand) { var lowerCase = unit.toLowerCase(); aliases[lowerCase] = aliases[lowerCase + "s"] = aliases[shorthand] = unit; } __name(addUnitAlias, "addUnitAlias"); function normalizeUnits(units) { return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0; } __name(normalizeUnits, "normalizeUnits"); function normalizeObjectUnits(inputObject) { var normalizedInput = {}, normalizedProp, prop; for (prop in inputObject) { if (hasOwnProp(inputObject, prop)) { normalizedProp = normalizeUnits(prop); if (normalizedProp) { normalizedInput[normalizedProp] = inputObject[prop]; } } } return normalizedInput; } __name(normalizeObjectUnits, "normalizeObjectUnits"); var priorities = {}; function addUnitPriority(unit, priority) { priorities[unit] = priority; } __name(addUnitPriority, "addUnitPriority"); function getPrioritizedUnits(unitsObj) { var units = [], u; for (u in unitsObj) { if (hasOwnProp(unitsObj, u)) { units.push({ unit: u, priority: priorities[u] }); } } units.sort(function(a, b) { return a.priority - b.priority; }); return units; } __name(getPrioritizedUnits, "getPrioritizedUnits"); function isLeapYear(year) { return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; } __name(isLeapYear, "isLeapYear"); function absFloor(number) { if (number < 0) { return Math.ceil(number) || 0; } else { return Math.floor(number); } } __name(absFloor, "absFloor"); function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; if (coercedNumber !== 0 && isFinite(coercedNumber)) { value = absFloor(coercedNumber); } return value; } __name(toInt, "toInt"); function makeGetSet(unit, keepTime) { return function(value) { if (value != null) { set$1(this, unit, value); hooks.updateOffset(this, keepTime); return this; } else { return get(this, unit); } }; } __name(makeGetSet, "makeGetSet"); function get(mom, unit) { return mom.isValid() ? mom._d["get" + (mom._isUTC ? "UTC" : "") + unit]() : NaN; } __name(get, "get"); function set$1(mom, unit, value) { if (mom.isValid() && !isNaN(value)) { if (unit === "FullYear" && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) { value = toInt(value); mom._d["set" + (mom._isUTC ? "UTC" : "") + unit](value, mom.month(), daysInMonth(value, mom.month())); } else { mom._d["set" + (mom._isUTC ? "UTC" : "") + unit](value); } } } __name(set$1, "set$1"); function stringGet(units) { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](); } return this; } __name(stringGet, "stringGet"); function stringSet(units, value) { if (typeof units === "object") { units = normalizeObjectUnits(units); var prioritized = getPrioritizedUnits(units), i, prioritizedLen = prioritized.length; for (i = 0; i < prioritizedLen; i++) { this[prioritized[i].unit](units[prioritized[i].unit]); } } else { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](value); } } return this; } __name(stringSet, "stringSet"); var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match3to4 = /\d\d\d\d?/, match5to6 = /\d\d\d\d\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, regexes; regexes = {}; function addRegexToken(token2, regex, strictRegex) { regexes[token2] = isFunction(regex) ? regex : function(isStrict, localeData2) { return isStrict && strictRegex ? strictRegex : regex; }; } __name(addRegexToken, "addRegexToken"); function getParseRegexForToken(token2, config2) { if (!hasOwnProp(regexes, token2)) { return new RegExp(unescapeFormat(token2)); } return regexes[token2](config2._strict, config2._locale); } __name(getParseRegexForToken, "getParseRegexForToken"); function unescapeFormat(s) { return regexEscape(s.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; })); } __name(unescapeFormat, "unescapeFormat"); function regexEscape(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); } __name(regexEscape, "regexEscape"); var tokens = {}; function addParseToken(token2, callback) { var i, func = callback, tokenLen; if (typeof token2 === "string") { token2 = [token2]; } if (isNumber(callback)) { func = /* @__PURE__ */ __name(function(input, array) { array[callback] = toInt(input); }, "func"); } tokenLen = token2.length; for (i = 0; i < tokenLen; i++) { tokens[token2[i]] = func; } } __name(addParseToken, "addParseToken"); function addWeekParseToken(token2, callback) { addParseToken(token2, function(input, array, config2, token3) { config2._w = config2._w || {}; callback(input, config2._w, config2, token3); }); } __name(addWeekParseToken, "addWeekParseToken"); function addTimeToArrayFromToken(token2, input, config2) { if (input != null && hasOwnProp(tokens, token2)) { tokens[token2](input, config2._a, config2, token2); } } __name(addTimeToArrayFromToken, "addTimeToArrayFromToken"); var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8; function mod(n, x) { return (n % x + x) % x; } __name(mod, "mod"); var indexOf; if (Array.prototype.indexOf) { indexOf = Array.prototype.indexOf; } else { indexOf = /* @__PURE__ */ __name(function(o) { var i; for (i = 0; i < this.length; ++i) { if (this[i] === o) { return i; } } return -1; }, "indexOf"); } function daysInMonth(year, month) { if (isNaN(year) || isNaN(month)) { return NaN; } var modMonth = mod(month, 12); year += (month - modMonth) / 12; return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2; } __name(daysInMonth, "daysInMonth"); addFormatToken("M", ["MM", 2], "Mo", function() { return this.month() + 1; }); addFormatToken("MMM", 0, 0, function(format2) { return this.localeData().monthsShort(this, format2); }); addFormatToken("MMMM", 0, 0, function(format2) { return this.localeData().months(this, format2); }); addUnitAlias("month", "M"); addUnitPriority("month", 8); addRegexToken("M", match1to2); addRegexToken("MM", match1to2, match2); addRegexToken("MMM", function(isStrict, locale2) { return locale2.monthsShortRegex(isStrict); }); addRegexToken("MMMM", function(isStrict, locale2) { return locale2.monthsRegex(isStrict); }); addParseToken(["M", "MM"], function(input, array) { array[MONTH] = toInt(input) - 1; }); addParseToken(["MMM", "MMMM"], function(input, array, config2, token2) { var month = config2._locale.monthsParse(input, token2, config2._strict); if (month != null) { array[MONTH] = month; } else { getParsingFlags(config2).invalidMonth = input; } }); var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord; function localeMonths(m, format2) { if (!m) { return isArray(this._months) ? this._months : this._months["standalone"]; } return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format2) ? "format" : "standalone"][m.month()]; } __name(localeMonths, "localeMonths"); function localeMonthsShort(m, format2) { if (!m) { return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"]; } return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format2) ? "format" : "standalone"][m.month()]; } __name(localeMonthsShort, "localeMonthsShort"); function handleStrictParse(monthName, format2, strict) { var i, ii, mom, llc = monthName.toLocaleLowerCase(); if (!this._monthsParse) { this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; for (i = 0; i < 12; ++i) { mom = createUTC([2e3, i]); this._shortMonthsParse[i] = this.monthsShort(mom, "").toLocaleLowerCase(); this._longMonthsParse[i] = this.months(mom, "").toLocaleLowerCase(); } } if (strict) { if (format2 === "MMM") { ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } } else { if (format2 === "MMM") { ii = indexOf.call(this._shortMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } } } __name(handleStrictParse, "handleStrictParse"); function localeMonthsParse(monthName, format2, strict) { var i, mom, regex; if (this._monthsParseExact) { return handleStrictParse.call(this, monthName, format2, strict); } if (!this._monthsParse) { this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; } for (i = 0; i < 12; i++) { mom = createUTC([2e3, i]); if (strict && !this._longMonthsParse[i]) { this._longMonthsParse[i] = new RegExp("^" + this.months(mom, "").replace(".", "") + "$", "i"); this._shortMonthsParse[i] = new RegExp("^" + this.monthsShort(mom, "").replace(".", "") + "$", "i"); } if (!strict && !this._monthsParse[i]) { regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, ""); this._monthsParse[i] = new RegExp(regex.replace(".", ""), "i"); } if (strict && format2 === "MMMM" && this._longMonthsParse[i].test(monthName)) { return i; } else if (strict && format2 === "MMM" && this._shortMonthsParse[i].test(monthName)) { return i; } else if (!strict && this._monthsParse[i].test(monthName)) { return i; } } } __name(localeMonthsParse, "localeMonthsParse"); function setMonth(mom, value) { var dayOfMonth; if (!mom.isValid()) { return mom; } if (typeof value === "string") { if (/^\d+$/.test(value)) { value = toInt(value); } else { value = mom.localeData().monthsParse(value); if (!isNumber(value)) { return mom; } } } dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); mom._d["set" + (mom._isUTC ? "UTC" : "") + "Month"](value, dayOfMonth); return mom; } __name(setMonth, "setMonth"); function getSetMonth(value) { if (value != null) { setMonth(this, value); hooks.updateOffset(this, true); return this; } else { return get(this, "Month"); } } __name(getSetMonth, "getSetMonth"); function getDaysInMonth() { return daysInMonth(this.year(), this.month()); } __name(getDaysInMonth, "getDaysInMonth"); function monthsShortRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, "_monthsRegex")) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsShortStrictRegex; } else { return this._monthsShortRegex; } } else { if (!hasOwnProp(this, "_monthsShortRegex")) { this._monthsShortRegex = defaultMonthsShortRegex; } return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex; } } __name(monthsShortRegex, "monthsShortRegex"); function monthsRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, "_monthsRegex")) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsStrictRegex; } else { return this._monthsRegex; } } else { if (!hasOwnProp(this, "_monthsRegex")) { this._monthsRegex = defaultMonthsRegex; } return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex; } } __name(monthsRegex, "monthsRegex"); function computeMonthsParse() { function cmpLenRev(a, b) { return b.length - a.length; } __name(cmpLenRev, "cmpLenRev"); var shortPieces = [], longPieces = [], mixedPieces = [], i, mom; for (i = 0; i < 12; i++) { mom = createUTC([2e3, i]); shortPieces.push(this.monthsShort(mom, "")); longPieces.push(this.months(mom, "")); mixedPieces.push(this.months(mom, "")); mixedPieces.push(this.monthsShort(mom, "")); } shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); for (i = 0; i < 12; i++) { shortPieces[i] = regexEscape(shortPieces[i]); longPieces[i] = regexEscape(longPieces[i]); } for (i = 0; i < 24; i++) { mixedPieces[i] = regexEscape(mixedPieces[i]); } this._monthsRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i"); this._monthsShortRegex = this._monthsRegex; this._monthsStrictRegex = new RegExp("^(" + longPieces.join("|") + ")", "i"); this._monthsShortStrictRegex = new RegExp("^(" + shortPieces.join("|") + ")", "i"); } __name(computeMonthsParse, "computeMonthsParse"); addFormatToken("Y", 0, 0, function() { var y = this.year(); return y <= 9999 ? zeroFill(y, 4) : "+" + y; }); addFormatToken(0, ["YY", 2], 0, function() { return this.year() % 100; }); addFormatToken(0, ["YYYY", 4], 0, "year"); addFormatToken(0, ["YYYYY", 5], 0, "year"); addFormatToken(0, ["YYYYYY", 6, true], 0, "year"); addUnitAlias("year", "y"); addUnitPriority("year", 1); addRegexToken("Y", matchSigned); addRegexToken("YY", match1to2, match2); addRegexToken("YYYY", match1to4, match4); addRegexToken("YYYYY", match1to6, match6); addRegexToken("YYYYYY", match1to6, match6); addParseToken(["YYYYY", "YYYYYY"], YEAR); addParseToken("YYYY", function(input, array) { array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); }); addParseToken("YY", function(input, array) { array[YEAR] = hooks.parseTwoDigitYear(input); }); addParseToken("Y", function(input, array) { array[YEAR] = parseInt(input, 10); }); function daysInYear(year) { return isLeapYear(year) ? 366 : 365; } __name(daysInYear, "daysInYear"); hooks.parseTwoDigitYear = function(input) { return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3); }; var getSetYear = makeGetSet("FullYear", true); function getIsLeapYear() { return isLeapYear(this.year()); } __name(getIsLeapYear, "getIsLeapYear"); function createDate(y, m, d, h, M, s, ms) { var date; if (y < 100 && y >= 0) { date = new Date(y + 400, m, d, h, M, s, ms); if (isFinite(date.getFullYear())) { date.setFullYear(y); } } else { date = new Date(y, m, d, h, M, s, ms); } return date; } __name(createDate, "createDate"); function createUTCDate(y) { var date, args; if (y < 100 && y >= 0) { args = Array.prototype.slice.call(arguments); args[0] = y + 400; date = new Date(Date.UTC.apply(null, args)); if (isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } } else { date = new Date(Date.UTC.apply(null, arguments)); } return date; } __name(createUTCDate, "createUTCDate"); function firstWeekOffset(year, dow, doy) { var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; return -fwdlw + fwd - 1; } __name(firstWeekOffset, "firstWeekOffset"); function dayOfYearFromWeeks(year, week, weekday, dow, doy) { var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear; if (dayOfYear <= 0) { resYear = year - 1; resDayOfYear = daysInYear(resYear) + dayOfYear; } else if (dayOfYear > daysInYear(year)) { resYear = year + 1; resDayOfYear = dayOfYear - daysInYear(year); } else { resYear = year; resDayOfYear = dayOfYear; } return { year: resYear, dayOfYear: resDayOfYear }; } __name(dayOfYearFromWeeks, "dayOfYearFromWeeks"); function weekOfYear(mom, dow, doy) { var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear; if (week < 1) { resYear = mom.year() - 1; resWeek = week + weeksInYear(resYear, dow, doy); } else if (week > weeksInYear(mom.year(), dow, doy)) { resWeek = week - weeksInYear(mom.year(), dow, doy); resYear = mom.year() + 1; } else { resYear = mom.year(); resWeek = week; } return { week: resWeek, year: resYear }; } __name(weekOfYear, "weekOfYear"); function weeksInYear(year, dow, doy) { var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy); return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } __name(weeksInYear, "weeksInYear"); addFormatToken("w", ["ww", 2], "wo", "week"); addFormatToken("W", ["WW", 2], "Wo", "isoWeek"); addUnitAlias("week", "w"); addUnitAlias("isoWeek", "W"); addUnitPriority("week", 5); addUnitPriority("isoWeek", 5); addRegexToken("w", match1to2); addRegexToken("ww", match1to2, match2); addRegexToken("W", match1to2); addRegexToken("WW", match1to2, match2); addWeekParseToken(["w", "ww", "W", "WW"], function(input, week, config2, token2) { week[token2.substr(0, 1)] = toInt(input); }); function localeWeek(mom) { return weekOfYear(mom, this._week.dow, this._week.doy).week; } __name(localeWeek, "localeWeek"); var defaultLocaleWeek = { dow: 0, doy: 6 }; function localeFirstDayOfWeek() { return this._week.dow; } __name(localeFirstDayOfWeek, "localeFirstDayOfWeek"); function localeFirstDayOfYear() { return this._week.doy; } __name(localeFirstDayOfYear, "localeFirstDayOfYear"); function getSetWeek(input) { var week = this.localeData().week(this); return input == null ? week : this.add((input - week) * 7, "d"); } __name(getSetWeek, "getSetWeek"); function getSetISOWeek(input) { var week = weekOfYear(this, 1, 4).week; return input == null ? week : this.add((input - week) * 7, "d"); } __name(getSetISOWeek, "getSetISOWeek"); addFormatToken("d", 0, "do", "day"); addFormatToken("dd", 0, 0, function(format2) { return this.localeData().weekdaysMin(this, format2); }); addFormatToken("ddd", 0, 0, function(format2) { return this.localeData().weekdaysShort(this, format2); }); addFormatToken("dddd", 0, 0, function(format2) { return this.localeData().weekdays(this, format2); }); addFormatToken("e", 0, 0, "weekday"); addFormatToken("E", 0, 0, "isoWeekday"); addUnitAlias("day", "d"); addUnitAlias("weekday", "e"); addUnitAlias("isoWeekday", "E"); addUnitPriority("day", 11); addUnitPriority("weekday", 11); addUnitPriority("isoWeekday", 11); addRegexToken("d", match1to2); addRegexToken("e", match1to2); addRegexToken("E", match1to2); addRegexToken("dd", function(isStrict, locale2) { return locale2.weekdaysMinRegex(isStrict); }); addRegexToken("ddd", function(isStrict, locale2) { return locale2.weekdaysShortRegex(isStrict); }); addRegexToken("dddd", function(isStrict, locale2) { return locale2.weekdaysRegex(isStrict); }); addWeekParseToken(["dd", "ddd", "dddd"], function(input, week, config2, token2) { var weekday = config2._locale.weekdaysParse(input, token2, config2._strict); if (weekday != null) { week.d = weekday; } else { getParsingFlags(config2).invalidWeekday = input; } }); addWeekParseToken(["d", "e", "E"], function(input, week, config2, token2) { week[token2] = toInt(input); }); function parseWeekday(input, locale2) { if (typeof input !== "string") { return input; } if (!isNaN(input)) { return parseInt(input, 10); } input = locale2.weekdaysParse(input); if (typeof input === "number") { return input; } return null; } __name(parseWeekday, "parseWeekday"); function parseIsoWeekday(input, locale2) { if (typeof input === "string") { return locale2.weekdaysParse(input) % 7 || 7; } return isNaN(input) ? null : input; } __name(parseIsoWeekday, "parseIsoWeekday"); function shiftWeekdays(ws, n) { return ws.slice(n, 7).concat(ws.slice(0, n)); } __name(shiftWeekdays, "shiftWeekdays"); var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord; function localeWeekdays(m, format2) { var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format2) ? "format" : "standalone"]; return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays; } __name(localeWeekdays, "localeWeekdays"); function localeWeekdaysShort(m) { return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort; } __name(localeWeekdaysShort, "localeWeekdaysShort"); function localeWeekdaysMin(m) { return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin; } __name(localeWeekdaysMin, "localeWeekdaysMin"); function handleStrictParse$1(weekdayName, format2, strict) { var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); if (!this._weekdaysParse) { this._weekdaysParse = []; this._shortWeekdaysParse = []; this._minWeekdaysParse = []; for (i = 0; i < 7; ++i) { mom = createUTC([2e3, 1]).day(i); this._minWeekdaysParse[i] = this.weekdaysMin(mom, "").toLocaleLowerCase(); this._shortWeekdaysParse[i] = this.weekdaysShort(mom, "").toLocaleLowerCase(); this._weekdaysParse[i] = this.weekdays(mom, "").toLocaleLowerCase(); } } if (strict) { if (format2 === "dddd") { ii = indexOf.call(this._weekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format2 === "ddd") { ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } } else { if (format2 === "dddd") { ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format2 === "ddd") { ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } } } __name(handleStrictParse$1, "handleStrictParse$1"); function localeWeekdaysParse(weekdayName, format2, strict) { var i, mom, regex; if (this._weekdaysParseExact) { return handleStrictParse$1.call(this, weekdayName, format2, strict); } if (!this._weekdaysParse) { this._weekdaysParse = []; this._minWeekdaysParse = []; this._shortWeekdaysParse = []; this._fullWeekdaysParse = []; } for (i = 0; i < 7; i++) { mom = createUTC([2e3, 1]).day(i); if (strict && !this._fullWeekdaysParse[i]) { this._fullWeekdaysParse[i] = new RegExp("^" + this.weekdays(mom, "").replace(".", "\\.?") + "$", "i"); this._shortWeekdaysParse[i] = new RegExp("^" + this.weekdaysShort(mom, "").replace(".", "\\.?") + "$", "i"); this._minWeekdaysParse[i] = new RegExp("^" + this.weekdaysMin(mom, "").replace(".", "\\.?") + "$", "i"); } if (!this._weekdaysParse[i]) { regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, ""); this._weekdaysParse[i] = new RegExp(regex.replace(".", ""), "i"); } if (strict && format2 === "dddd" && this._fullWeekdaysParse[i].test(weekdayName)) { return i; } else if (strict && format2 === "ddd" && this._shortWeekdaysParse[i].test(weekdayName)) { return i; } else if (strict && format2 === "dd" && this._minWeekdaysParse[i].test(weekdayName)) { return i; } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } } __name(localeWeekdaysParse, "localeWeekdaysParse"); function getSetDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); return this.add(input - day, "d"); } else { return day; } } __name(getSetDayOfWeek, "getSetDayOfWeek"); function getSetLocaleDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, "d"); } __name(getSetLocaleDayOfWeek, "getSetLocaleDayOfWeek"); function getSetISODayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { var weekday = parseIsoWeekday(input, this.localeData()); return this.day(this.day() % 7 ? weekday : weekday - 7); } else { return this.day() || 7; } } __name(getSetISODayOfWeek, "getSetISODayOfWeek"); function weekdaysRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, "_weekdaysRegex")) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysStrictRegex; } else { return this._weekdaysRegex; } } else { if (!hasOwnProp(this, "_weekdaysRegex")) { this._weekdaysRegex = defaultWeekdaysRegex; } return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex; } } __name(weekdaysRegex, "weekdaysRegex"); function weekdaysShortRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, "_weekdaysRegex")) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysShortStrictRegex; } else { return this._weekdaysShortRegex; } } else { if (!hasOwnProp(this, "_weekdaysShortRegex")) { this._weekdaysShortRegex = defaultWeekdaysShortRegex; } return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex; } } __name(weekdaysShortRegex, "weekdaysShortRegex"); function weekdaysMinRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, "_weekdaysRegex")) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysMinStrictRegex; } else { return this._weekdaysMinRegex; } } else { if (!hasOwnProp(this, "_weekdaysMinRegex")) { this._weekdaysMinRegex = defaultWeekdaysMinRegex; } return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex; } } __name(weekdaysMinRegex, "weekdaysMinRegex"); function computeWeekdaysParse() { function cmpLenRev(a, b) { return b.length - a.length; } __name(cmpLenRev, "cmpLenRev"); var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp; for (i = 0; i < 7; i++) { mom = createUTC([2e3, 1]).day(i); minp = regexEscape(this.weekdaysMin(mom, "")); shortp = regexEscape(this.weekdaysShort(mom, "")); longp = regexEscape(this.weekdays(mom, "")); minPieces.push(minp); shortPieces.push(shortp); longPieces.push(longp); mixedPieces.push(minp); mixedPieces.push(shortp); mixedPieces.push(longp); } minPieces.sort(cmpLenRev); shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); this._weekdaysRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i"); this._weekdaysShortRegex = this._weekdaysRegex; this._weekdaysMinRegex = this._weekdaysRegex; this._weekdaysStrictRegex = new RegExp("^(" + longPieces.join("|") + ")", "i"); this._weekdaysShortStrictRegex = new RegExp("^(" + shortPieces.join("|") + ")", "i"); this._weekdaysMinStrictRegex = new RegExp("^(" + minPieces.join("|") + ")", "i"); } __name(computeWeekdaysParse, "computeWeekdaysParse"); function hFormat() { return this.hours() % 12 || 12; } __name(hFormat, "hFormat"); function kFormat() { return this.hours() || 24; } __name(kFormat, "kFormat"); addFormatToken("H", ["HH", 2], 0, "hour"); addFormatToken("h", ["hh", 2], 0, hFormat); addFormatToken("k", ["kk", 2], 0, kFormat); addFormatToken("hmm", 0, 0, function() { return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2); }); addFormatToken("hmmss", 0, 0, function() { return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2); }); addFormatToken("Hmm", 0, 0, function() { return "" + this.hours() + zeroFill(this.minutes(), 2); }); addFormatToken("Hmmss", 0, 0, function() { return "" + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2); }); function meridiem(token2, lowercase) { addFormatToken(token2, 0, 0, function() { return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); }); } __name(meridiem, "meridiem"); meridiem("a", true); meridiem("A", false); addUnitAlias("hour", "h"); addUnitPriority("hour", 13); function matchMeridiem(isStrict, locale2) { return locale2._meridiemParse; } __name(matchMeridiem, "matchMeridiem"); addRegexToken("a", matchMeridiem); addRegexToken("A", matchMeridiem); addRegexToken("H", match1to2); addRegexToken("h", match1to2); addRegexToken("k", match1to2); addRegexToken("HH", match1to2, match2); addRegexToken("hh", match1to2, match2); addRegexToken("kk", match1to2, match2); addRegexToken("hmm", match3to4); addRegexToken("hmmss", match5to6); addRegexToken("Hmm", match3to4); addRegexToken("Hmmss", match5to6); addParseToken(["H", "HH"], HOUR); addParseToken(["k", "kk"], function(input, array, config2) { var kInput = toInt(input); array[HOUR] = kInput === 24 ? 0 : kInput; }); addParseToken(["a", "A"], function(input, array, config2) { config2._isPm = config2._locale.isPM(input); config2._meridiem = input; }); addParseToken(["h", "hh"], function(input, array, config2) { array[HOUR] = toInt(input); getParsingFlags(config2).bigHour = true; }); addParseToken("hmm", function(input, array, config2) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); getParsingFlags(config2).bigHour = true; }); addParseToken("hmmss", function(input, array, config2) { var pos1 = input.length - 4, pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); getParsingFlags(config2).bigHour = true; }); addParseToken("Hmm", function(input, array, config2) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); }); addParseToken("Hmmss", function(input, array, config2) { var pos1 = input.length - 4, pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); }); function localeIsPM(input) { return (input + "").toLowerCase().charAt(0) === "p"; } __name(localeIsPM, "localeIsPM"); var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, getSetHour = makeGetSet("Hours", true); function localeMeridiem(hours2, minutes2, isLower) { if (hours2 > 11) { return isLower ? "pm" : "PM"; } else { return isLower ? "am" : "AM"; } } __name(localeMeridiem, "localeMeridiem"); var baseConfig = { calendar: defaultCalendar, longDateFormat: defaultLongDateFormat, invalidDate: defaultInvalidDate, ordinal: defaultOrdinal, dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, relativeTime: defaultRelativeTime, months: defaultLocaleMonths, monthsShort: defaultLocaleMonthsShort, week: defaultLocaleWeek, weekdays: defaultLocaleWeekdays, weekdaysMin: defaultLocaleWeekdaysMin, weekdaysShort: defaultLocaleWeekdaysShort, meridiemParse: defaultLocaleMeridiemParse }; var locales = {}, localeFamilies = {}, globalLocale; function commonPrefix(arr1, arr2) { var i, minl = Math.min(arr1.length, arr2.length); for (i = 0; i < minl; i += 1) { if (arr1[i] !== arr2[i]) { return i; } } return minl; } __name(commonPrefix, "commonPrefix"); function normalizeLocale(key) { return key ? key.toLowerCase().replace("_", "-") : key; } __name(normalizeLocale, "normalizeLocale"); function chooseLocale(names) { var i = 0, j, next, locale2, split; while (i < names.length) { split = normalizeLocale(names[i]).split("-"); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split("-") : null; while (j > 0) { locale2 = loadLocale(split.slice(0, j).join("-")); if (locale2) { return locale2; } if (next && next.length >= j && commonPrefix(split, next) >= j - 1) { break; } j--; } i++; } return globalLocale; } __name(chooseLocale, "chooseLocale"); function isLocaleNameSane(name) { return name.match("^[^/\\\\]*$") != null; } __name(isLocaleNameSane, "isLocaleNameSane"); function loadLocale(name) { var oldLocale = null, aliasedRequire; if (locales[name] === void 0 && typeof module2 !== "undefined" && module2 && module2.exports && isLocaleNameSane(name)) { try { oldLocale = globalLocale._abbr; aliasedRequire = require; aliasedRequire("./locale/" + name); getSetGlobalLocale(oldLocale); } catch (e) { locales[name] = null; } } return locales[name]; } __name(loadLocale, "loadLocale"); function getSetGlobalLocale(key, values) { var data; if (key) { if (isUndefined(values)) { data = getLocale(key); } else { data = defineLocale(key, values); } if (data) { globalLocale = data; } else { if (typeof console !== "undefined" && console.warn) { console.warn("Locale " + key + " not found. Did you forget to load it?"); } } } return globalLocale._abbr; } __name(getSetGlobalLocale, "getSetGlobalLocale"); function defineLocale(name, config2) { if (config2 !== null) { var locale2, parentConfig = baseConfig; config2.abbr = name; if (locales[name] != null) { deprecateSimple("defineLocaleOverride", "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."); parentConfig = locales[name]._config; } else if (config2.parentLocale != null) { if (locales[config2.parentLocale] != null) { parentConfig = locales[config2.parentLocale]._config; } else { locale2 = loadLocale(config2.parentLocale); if (locale2 != null) { parentConfig = locale2._config; } else { if (!localeFamilies[config2.parentLocale]) { localeFamilies[config2.parentLocale] = []; } localeFamilies[config2.parentLocale].push({ name, config: config2 }); return null; } } } locales[name] = new Locale(mergeConfigs(parentConfig, config2)); if (localeFamilies[name]) { localeFamilies[name].forEach(function(x) { defineLocale(x.name, x.config); }); } getSetGlobalLocale(name); return locales[name]; } else { delete locales[name]; return null; } } __name(defineLocale, "defineLocale"); function updateLocale(name, config2) { if (config2 != null) { var locale2, tmpLocale, parentConfig = baseConfig; if (locales[name] != null && locales[name].parentLocale != null) { locales[name].set(mergeConfigs(locales[name]._config, config2)); } else { tmpLocale = loadLocale(name); if (tmpLocale != null) { parentConfig = tmpLocale._config; } config2 = mergeConfigs(parentConfig, config2); if (tmpLocale == null) { config2.abbr = name; } locale2 = new Locale(config2); locale2.parentLocale = locales[name]; locales[name] = locale2; } getSetGlobalLocale(name); } else { if (locales[name] != null) { if (locales[name].parentLocale != null) { locales[name] = locales[name].parentLocale; if (name === getSetGlobalLocale()) { getSetGlobalLocale(name); } } else if (locales[name] != null) { delete locales[name]; } } } return locales[name]; } __name(updateLocale, "updateLocale"); function getLocale(key) { var locale2; if (key && key._locale && key._locale._abbr) { key = key._locale._abbr; } if (!key) { return globalLocale; } if (!isArray(key)) { locale2 = loadLocale(key); if (locale2) { return locale2; } key = [key]; } return chooseLocale(key); } __name(getLocale, "getLocale"); function listLocales() { return keys(locales); } __name(listLocales, "listLocales"); function checkOverflow(m) { var overflow, a = m._a; if (a && getParsingFlags(m).overflow === -2) { overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1; if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } if (getParsingFlags(m)._overflowWeeks && overflow === -1) { overflow = WEEK; } if (getParsingFlags(m)._overflowWeekday && overflow === -1) { overflow = WEEKDAY; } getParsingFlags(m).overflow = overflow; } return m; } __name(checkOverflow, "checkOverflow"); var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [ ["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/], ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/], ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/], ["GGGG-[W]WW", /\d{4}-W\d\d/, false], ["YYYY-DDD", /\d{4}-\d{3}/], ["YYYY-MM", /\d{4}-\d\d/, false], ["YYYYYYMMDD", /[+-]\d{10}/], ["YYYYMMDD", /\d{8}/], ["GGGG[W]WWE", /\d{4}W\d{3}/], ["GGGG[W]WW", /\d{4}W\d{2}/, false], ["YYYYDDD", /\d{7}/], ["YYYYMM", /\d{6}/, false], ["YYYY", /\d{4}/, false] ], isoTimes = [ ["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/], ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/], ["HH:mm:ss", /\d\d:\d\d:\d\d/], ["HH:mm", /\d\d:\d\d/], ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/], ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/], ["HHmmss", /\d\d\d\d\d\d/], ["HHmm", /\d\d\d\d/], ["HH", /\d\d/] ], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = { UT: 0, GMT: 0, EDT: -4 * 60, EST: -5 * 60, CDT: -5 * 60, CST: -6 * 60, MDT: -6 * 60, MST: -7 * 60, PDT: -7 * 60, PST: -8 * 60 }; function configFromISO(config2) { var i, l, string = config2._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length; if (match) { getParsingFlags(config2).iso = true; for (i = 0, l = isoDatesLen; i < l; i++) { if (isoDates[i][1].exec(match[1])) { dateFormat = isoDates[i][0]; allowTime = isoDates[i][2] !== false; break; } } if (dateFormat == null) { config2._isValid = false; return; } if (match[3]) { for (i = 0, l = isoTimesLen; i < l; i++) { if (isoTimes[i][1].exec(match[3])) { timeFormat = (match[2] || " ") + isoTimes[i][0]; break; } } if (timeFormat == null) { config2._isValid = false; return; } } if (!allowTime && timeFormat != null) { config2._isValid = false; return; } if (match[4]) { if (tzRegex.exec(match[4])) { tzFormat = "Z"; } else { config2._isValid = false; return; } } config2._f = dateFormat + (timeFormat || "") + (tzFormat || ""); configFromStringAndFormat(config2); } else { config2._isValid = false; } } __name(configFromISO, "configFromISO"); function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { var result = [ untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10) ]; if (secondStr) { result.push(parseInt(secondStr, 10)); } return result; } __name(extractFromRFC2822Strings, "extractFromRFC2822Strings"); function untruncateYear(yearStr) { var year = parseInt(yearStr, 10); if (year <= 49) { return 2e3 + year; } else if (year <= 999) { return 1900 + year; } return year; } __name(untruncateYear, "untruncateYear"); function preprocessRFC2822(s) { return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, ""); } __name(preprocessRFC2822, "preprocessRFC2822"); function checkWeekday(weekdayStr, parsedInput, config2) { if (weekdayStr) { var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay(); if (weekdayProvided !== weekdayActual) { getParsingFlags(config2).weekdayMismatch = true; config2._isValid = false; return false; } } return true; } __name(checkWeekday, "checkWeekday"); function calculateOffset(obsOffset, militaryOffset, numOffset) { if (obsOffset) { return obsOffsets[obsOffset]; } else if (militaryOffset) { return 0; } else { var hm = parseInt(numOffset, 10), m = hm % 100, h = (hm - m) / 100; return h * 60 + m; } } __name(calculateOffset, "calculateOffset"); function configFromRFC2822(config2) { var match = rfc2822.exec(preprocessRFC2822(config2._i)), parsedArray; if (match) { parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); if (!checkWeekday(match[1], parsedArray, config2)) { return; } config2._a = parsedArray; config2._tzm = calculateOffset(match[8], match[9], match[10]); config2._d = createUTCDate.apply(null, config2._a); config2._d.setUTCMinutes(config2._d.getUTCMinutes() - config2._tzm); getParsingFlags(config2).rfc2822 = true; } else { config2._isValid = false; } } __name(configFromRFC2822, "configFromRFC2822"); function configFromString(config2) { var matched = aspNetJsonRegex.exec(config2._i); if (matched !== null) { config2._d = new Date(+matched[1]); return; } configFromISO(config2); if (config2._isValid === false) { delete config2._isValid; } else { return; } configFromRFC2822(config2); if (config2._isValid === false) { delete config2._isValid; } else { return; } if (config2._strict) { config2._isValid = false; } else { hooks.createFromInputFallback(config2); } } __name(configFromString, "configFromString"); hooks.createFromInputFallback = deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.", function(config2) { config2._d = new Date(config2._i + (config2._useUTC ? " UTC" : "")); }); function defaults(a, b, c) { if (a != null) { return a; } if (b != null) { return b; } return c; } __name(defaults, "defaults"); function currentDateArray(config2) { var nowValue = new Date(hooks.now()); if (config2._useUTC) { return [ nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate() ]; } return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } __name(currentDateArray, "currentDateArray"); function configFromArray(config2) { var i, date, input = [], currentDate, expectedWeekday, yearToUse; if (config2._d) { return; } currentDate = currentDateArray(config2); if (config2._w && config2._a[DATE] == null && config2._a[MONTH] == null) { dayOfYearFromWeekInfo(config2); } if (config2._dayOfYear != null) { yearToUse = defaults(config2._a[YEAR], currentDate[YEAR]); if (config2._dayOfYear > daysInYear(yearToUse) || config2._dayOfYear === 0) { getParsingFlags(config2)._overflowDayOfYear = true; } date = createUTCDate(yearToUse, 0, config2._dayOfYear); config2._a[MONTH] = date.getUTCMonth(); config2._a[DATE] = date.getUTCDate(); } for (i = 0; i < 3 && config2._a[i] == null; ++i) { config2._a[i] = input[i] = currentDate[i]; } for (; i < 7; i++) { config2._a[i] = input[i] = config2._a[i] == null ? i === 2 ? 1 : 0 : config2._a[i]; } if (config2._a[HOUR] === 24 && config2._a[MINUTE] === 0 && config2._a[SECOND] === 0 && config2._a[MILLISECOND] === 0) { config2._nextDay = true; config2._a[HOUR] = 0; } config2._d = (config2._useUTC ? createUTCDate : createDate).apply(null, input); expectedWeekday = config2._useUTC ? config2._d.getUTCDay() : config2._d.getDay(); if (config2._tzm != null) { config2._d.setUTCMinutes(config2._d.getUTCMinutes() - config2._tzm); } if (config2._nextDay) { config2._a[HOUR] = 24; } if (config2._w && typeof config2._w.d !== "undefined" && config2._w.d !== expectedWeekday) { getParsingFlags(config2).weekdayMismatch = true; } } __name(configFromArray, "configFromArray"); function dayOfYearFromWeekInfo(config2) { var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek; w = config2._w; if (w.GG != null || w.W != null || w.E != null) { dow = 1; doy = 4; weekYear = defaults(w.GG, config2._a[YEAR], weekOfYear(createLocal(), 1, 4).year); week = defaults(w.W, 1); weekday = defaults(w.E, 1); if (weekday < 1 || weekday > 7) { weekdayOverflow = true; } } else { dow = config2._locale._week.dow; doy = config2._locale._week.doy; curWeek = weekOfYear(createLocal(), dow, doy); weekYear = defaults(w.gg, config2._a[YEAR], curWeek.year); week = defaults(w.w, curWeek.week); if (w.d != null) { weekday = w.d; if (weekday < 0 || weekday > 6) { weekdayOverflow = true; } } else if (w.e != null) { weekday = w.e + dow; if (w.e < 0 || w.e > 6) { weekdayOverflow = true; } } else { weekday = dow; } } if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { getParsingFlags(config2)._overflowWeeks = true; } else if (weekdayOverflow != null) { getParsingFlags(config2)._overflowWeekday = true; } else { temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); config2._a[YEAR] = temp.year; config2._dayOfYear = temp.dayOfYear; } } __name(dayOfYearFromWeekInfo, "dayOfYearFromWeekInfo"); hooks.ISO_8601 = function() { }; hooks.RFC_2822 = function() { }; function configFromStringAndFormat(config2) { if (config2._f === hooks.ISO_8601) { configFromISO(config2); return; } if (config2._f === hooks.RFC_2822) { configFromRFC2822(config2); return; } config2._a = []; getParsingFlags(config2).empty = true; var string = "" + config2._i, i, parsedInput, tokens2, token2, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen; tokens2 = expandFormat(config2._f, config2._locale).match(formattingTokens) || []; tokenLen = tokens2.length; for (i = 0; i < tokenLen; i++) { token2 = tokens2[i]; parsedInput = (string.match(getParseRegexForToken(token2, config2)) || [])[0]; if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { getParsingFlags(config2).unusedInput.push(skipped); } string = string.slice(string.indexOf(parsedInput) + parsedInput.length); totalParsedInputLength += parsedInput.length; } if (formatTokenFunctions[token2]) { if (parsedInput) { getParsingFlags(config2).empty = false; } else { getParsingFlags(config2).unusedTokens.push(token2); } addTimeToArrayFromToken(token2, parsedInput, config2); } else if (config2._strict && !parsedInput) { getParsingFlags(config2).unusedTokens.push(token2); } } getParsingFlags(config2).charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { getParsingFlags(config2).unusedInput.push(string); } if (config2._a[HOUR] <= 12 && getParsingFlags(config2).bigHour === true && config2._a[HOUR] > 0) { getParsingFlags(config2).bigHour = void 0; } getParsingFlags(config2).parsedDateParts = config2._a.slice(0); getParsingFlags(config2).meridiem = config2._meridiem; config2._a[HOUR] = meridiemFixWrap(config2._locale, config2._a[HOUR], config2._meridiem); era = getParsingFlags(config2).era; if (era !== null) { config2._a[YEAR] = config2._locale.erasConvertYear(era, config2._a[YEAR]); } configFromArray(config2); checkOverflow(config2); } __name(configFromStringAndFormat, "configFromStringAndFormat"); function meridiemFixWrap(locale2, hour, meridiem2) { var isPm; if (meridiem2 == null) { return hour; } if (locale2.meridiemHour != null) { return locale2.meridiemHour(hour, meridiem2); } else if (locale2.isPM != null) { isPm = locale2.isPM(meridiem2); if (isPm && hour < 12) { hour += 12; } if (!isPm && hour === 12) { hour = 0; } return hour; } else { return hour; } } __name(meridiemFixWrap, "meridiemFixWrap"); function configFromStringAndArray(config2) { var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config2._f.length; if (configfLen === 0) { getParsingFlags(config2).invalidFormat = true; config2._d = new Date(NaN); return; } for (i = 0; i < configfLen; i++) { currentScore = 0; validFormatFound = false; tempConfig = copyConfig({}, config2); if (config2._useUTC != null) { tempConfig._useUTC = config2._useUTC; } tempConfig._f = config2._f[i]; configFromStringAndFormat(tempConfig); if (isValid(tempConfig)) { validFormatFound = true; } currentScore += getParsingFlags(tempConfig).charsLeftOver; currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; getParsingFlags(tempConfig).score = currentScore; if (!bestFormatIsValid) { if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) { scoreToBeat = currentScore; bestMoment = tempConfig; if (validFormatFound) { bestFormatIsValid = true; } } } else { if (currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } } extend(config2, bestMoment || tempConfig); } __name(configFromStringAndArray, "configFromStringAndArray"); function configFromObject(config2) { if (config2._d) { return; } var i = normalizeObjectUnits(config2._i), dayOrDate = i.day === void 0 ? i.date : i.day; config2._a = map2([i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], function(obj) { return obj && parseInt(obj, 10); }); configFromArray(config2); } __name(configFromObject, "configFromObject"); function createFromConfig(config2) { var res = new Moment(checkOverflow(prepareConfig(config2))); if (res._nextDay) { res.add(1, "d"); res._nextDay = void 0; } return res; } __name(createFromConfig, "createFromConfig"); function prepareConfig(config2) { var input = config2._i, format2 = config2._f; config2._locale = config2._locale || getLocale(config2._l); if (input === null || format2 === void 0 && input === "") { return createInvalid({ nullInput: true }); } if (typeof input === "string") { config2._i = input = config2._locale.preparse(input); } if (isMoment(input)) { return new Moment(checkOverflow(input)); } else if (isDate(input)) { config2._d = input; } else if (isArray(format2)) { configFromStringAndArray(config2); } else if (format2) { configFromStringAndFormat(config2); } else { configFromInput(config2); } if (!isValid(config2)) { config2._d = null; } return config2; } __name(prepareConfig, "prepareConfig"); function configFromInput(config2) { var input = config2._i; if (isUndefined(input)) { config2._d = new Date(hooks.now()); } else if (isDate(input)) { config2._d = new Date(input.valueOf()); } else if (typeof input === "string") { configFromString(config2); } else if (isArray(input)) { config2._a = map2(input.slice(0), function(obj) { return parseInt(obj, 10); }); configFromArray(config2); } else if (isObject(input)) { configFromObject(config2); } else if (isNumber(input)) { config2._d = new Date(input); } else { hooks.createFromInputFallback(config2); } } __name(configFromInput, "configFromInput"); function createLocalOrUTC(input, format2, locale2, strict, isUTC) { var c = {}; if (format2 === true || format2 === false) { strict = format2; format2 = void 0; } if (locale2 === true || locale2 === false) { strict = locale2; locale2 = void 0; } if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) { input = void 0; } c._isAMomentObject = true; c._useUTC = c._isUTC = isUTC; c._l = locale2; c._i = input; c._f = format2; c._strict = strict; return createFromConfig(c); } __name(createLocalOrUTC, "createLocalOrUTC"); function createLocal(input, format2, locale2, strict) { return createLocalOrUTC(input, format2, locale2, strict, false); } __name(createLocal, "createLocal"); var prototypeMin = deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/", function() { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other < this ? this : other; } else { return createInvalid(); } }), prototypeMax = deprecate("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/", function() { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other > this ? this : other; } else { return createInvalid(); } }); function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return createLocal(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (!moments[i].isValid() || moments[i][fn](res)) { res = moments[i]; } } return res; } __name(pickBy, "pickBy"); function min() { var args = [].slice.call(arguments, 0); return pickBy("isBefore", args); } __name(min, "min"); function max() { var args = [].slice.call(arguments, 0); return pickBy("isAfter", args); } __name(max, "max"); var now = /* @__PURE__ */ __name(function() { return Date.now ? Date.now() : +new Date(); }, "now"); var ordering = [ "year", "quarter", "month", "week", "day", "hour", "minute", "second", "millisecond" ]; function isDurationValid(m) { var key, unitHasDecimal = false, i, orderLen = ordering.length; for (key in m) { if (hasOwnProp(m, key) && !(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) { return false; } } for (i = 0; i < orderLen; ++i) { if (m[ordering[i]]) { if (unitHasDecimal) { return false; } if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { unitHasDecimal = true; } } } return true; } __name(isDurationValid, "isDurationValid"); function isValid$1() { return this._isValid; } __name(isValid$1, "isValid$1"); function createInvalid$1() { return createDuration(NaN); } __name(createInvalid$1, "createInvalid$1"); function Duration(duration) { var normalizedInput = normalizeObjectUnits(duration), years2 = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months2 = normalizedInput.month || 0, weeks2 = normalizedInput.week || normalizedInput.isoWeek || 0, days2 = normalizedInput.day || 0, hours2 = normalizedInput.hour || 0, minutes2 = normalizedInput.minute || 0, seconds2 = normalizedInput.second || 0, milliseconds2 = normalizedInput.millisecond || 0; this._isValid = isDurationValid(normalizedInput); this._milliseconds = +milliseconds2 + seconds2 * 1e3 + minutes2 * 6e4 + hours2 * 1e3 * 60 * 60; this._days = +days2 + weeks2 * 7; this._months = +months2 + quarters * 3 + years2 * 12; this._data = {}; this._locale = getLocale(); this._bubble(); } __name(Duration, "Duration"); function isDuration(obj) { return obj instanceof Duration; } __name(isDuration, "isDuration"); function absRound(number) { if (number < 0) { return Math.round(-1 * number) * -1; } else { return Math.round(number); } } __name(absRound, "absRound"); function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) { diffs++; } } return diffs + lengthDiff; } __name(compareArrays, "compareArrays"); function offset(token2, separator) { addFormatToken(token2, 0, 0, function() { var offset2 = this.utcOffset(), sign2 = "+"; if (offset2 < 0) { offset2 = -offset2; sign2 = "-"; } return sign2 + zeroFill(~~(offset2 / 60), 2) + separator + zeroFill(~~offset2 % 60, 2); }); } __name(offset, "offset"); offset("Z", ":"); offset("ZZ", ""); addRegexToken("Z", matchShortOffset); addRegexToken("ZZ", matchShortOffset); addParseToken(["Z", "ZZ"], function(input, array, config2) { config2._useUTC = true; config2._tzm = offsetFromString(matchShortOffset, input); }); var chunkOffset = /([\+\-]|\d\d)/gi; function offsetFromString(matcher, string) { var matches = (string || "").match(matcher), chunk, parts, minutes2; if (matches === null) { return null; } chunk = matches[matches.length - 1] || []; parts = (chunk + "").match(chunkOffset) || ["-", 0, 0]; minutes2 = +(parts[1] * 60) + toInt(parts[2]); return minutes2 === 0 ? 0 : parts[0] === "+" ? minutes2 : -minutes2; } __name(offsetFromString, "offsetFromString"); function cloneWithOffset(input, model) { var res, diff2; if (model._isUTC) { res = model.clone(); diff2 = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); res._d.setTime(res._d.valueOf() + diff2); hooks.updateOffset(res, false); return res; } else { return createLocal(input).local(); } } __name(cloneWithOffset, "cloneWithOffset"); function getDateOffset(m) { return -Math.round(m._d.getTimezoneOffset()); } __name(getDateOffset, "getDateOffset"); hooks.updateOffset = function() { }; function getSetOffset(input, keepLocalTime, keepMinutes) { var offset2 = this._offset || 0, localAdjust; if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { if (typeof input === "string") { input = offsetFromString(matchShortOffset, input); if (input === null) { return this; } } else if (Math.abs(input) < 16 && !keepMinutes) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = getDateOffset(this); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.add(localAdjust, "m"); } if (offset2 !== input) { if (!keepLocalTime || this._changeInProgress) { addSubtract(this, createDuration(input - offset2, "m"), 1, false); } else if (!this._changeInProgress) { this._changeInProgress = true; hooks.updateOffset(this, true); this._changeInProgress = null; } } return this; } else { return this._isUTC ? offset2 : getDateOffset(this); } } __name(getSetOffset, "getSetOffset"); function getSetZone(input, keepLocalTime) { if (input != null) { if (typeof input !== "string") { input = -input; } this.utcOffset(input, keepLocalTime); return this; } else { return -this.utcOffset(); } } __name(getSetZone, "getSetZone"); function setOffsetToUTC(keepLocalTime) { return this.utcOffset(0, keepLocalTime); } __name(setOffsetToUTC, "setOffsetToUTC"); function setOffsetToLocal(keepLocalTime) { if (this._isUTC) { this.utcOffset(0, keepLocalTime); this._isUTC = false; if (keepLocalTime) { this.subtract(getDateOffset(this), "m"); } } return this; } __name(setOffsetToLocal, "setOffsetToLocal"); function setOffsetToParsedOffset() { if (this._tzm != null) { this.utcOffset(this._tzm, false, true); } else if (typeof this._i === "string") { var tZone = offsetFromString(matchOffset, this._i); if (tZone != null) { this.utcOffset(tZone); } else { this.utcOffset(0, true); } } return this; } __name(setOffsetToParsedOffset, "setOffsetToParsedOffset"); function hasAlignedHourOffset(input) { if (!this.isValid()) { return false; } input = input ? createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; } __name(hasAlignedHourOffset, "hasAlignedHourOffset"); function isDaylightSavingTime() { return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset(); } __name(isDaylightSavingTime, "isDaylightSavingTime"); function isDaylightSavingTimeShifted() { if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } var c = {}, other; copyConfig(c, this); c = prepareConfig(c); if (c._a) { other = c._isUTC ? createUTC(c._a) : createLocal(c._a); this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0; } else { this._isDSTShifted = false; } return this._isDSTShifted; } __name(isDaylightSavingTimeShifted, "isDaylightSavingTimeShifted"); function isLocal() { return this.isValid() ? !this._isUTC : false; } __name(isLocal, "isLocal"); function isUtcOffset() { return this.isValid() ? this._isUTC : false; } __name(isUtcOffset, "isUtcOffset"); function isUtc() { return this.isValid() ? this._isUTC && this._offset === 0 : false; } __name(isUtc, "isUtc"); var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; function createDuration(input, key) { var duration = input, match = null, sign2, ret, diffRes; if (isDuration(input)) { duration = { ms: input._milliseconds, d: input._days, M: input._months }; } else if (isNumber(input) || !isNaN(+input)) { duration = {}; if (key) { duration[key] = +input; } else { duration.milliseconds = +input; } } else if (match = aspNetRegex.exec(input)) { sign2 = match[1] === "-" ? -1 : 1; duration = { y: 0, d: toInt(match[DATE]) * sign2, h: toInt(match[HOUR]) * sign2, m: toInt(match[MINUTE]) * sign2, s: toInt(match[SECOND]) * sign2, ms: toInt(absRound(match[MILLISECOND] * 1e3)) * sign2 }; } else if (match = isoRegex.exec(input)) { sign2 = match[1] === "-" ? -1 : 1; duration = { y: parseIso(match[2], sign2), M: parseIso(match[3], sign2), w: parseIso(match[4], sign2), d: parseIso(match[5], sign2), h: parseIso(match[6], sign2), m: parseIso(match[7], sign2), s: parseIso(match[8], sign2) }; } else if (duration == null) { duration = {}; } else if (typeof duration === "object" && ("from" in duration || "to" in duration)) { diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to)); duration = {}; duration.ms = diffRes.milliseconds; duration.M = diffRes.months; } ret = new Duration(duration); if (isDuration(input) && hasOwnProp(input, "_locale")) { ret._locale = input._locale; } if (isDuration(input) && hasOwnProp(input, "_isValid")) { ret._isValid = input._isValid; } return ret; } __name(createDuration, "createDuration"); createDuration.fn = Duration.prototype; createDuration.invalid = createInvalid$1; function parseIso(inp, sign2) { var res = inp && parseFloat(inp.replace(",", ".")); return (isNaN(res) ? 0 : res) * sign2; } __name(parseIso, "parseIso"); function positiveMomentsDifference(base, other) { var res = {}; res.months = other.month() - base.month() + (other.year() - base.year()) * 12; if (base.clone().add(res.months, "M").isAfter(other)) { --res.months; } res.milliseconds = +other - +base.clone().add(res.months, "M"); return res; } __name(positiveMomentsDifference, "positiveMomentsDifference"); function momentsDifference(base, other) { var res; if (!(base.isValid() && other.isValid())) { return { milliseconds: 0, months: 0 }; } other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); } else { res = positiveMomentsDifference(other, base); res.milliseconds = -res.milliseconds; res.months = -res.months; } return res; } __name(momentsDifference, "momentsDifference"); function createAdder(direction, name) { return function(val, period) { var dur, tmp; if (period !== null && !isNaN(+period)) { deprecateSimple(name, "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."); tmp = val; val = period; period = tmp; } dur = createDuration(val, period); addSubtract(this, dur, direction); return this; }; } __name(createAdder, "createAdder"); function addSubtract(mom, duration, isAdding, updateOffset) { var milliseconds2 = duration._milliseconds, days2 = absRound(duration._days), months2 = absRound(duration._months); if (!mom.isValid()) { return; } updateOffset = updateOffset == null ? true : updateOffset; if (months2) { setMonth(mom, get(mom, "Month") + months2 * isAdding); } if (days2) { set$1(mom, "Date", get(mom, "Date") + days2 * isAdding); } if (milliseconds2) { mom._d.setTime(mom._d.valueOf() + milliseconds2 * isAdding); } if (updateOffset) { hooks.updateOffset(mom, days2 || months2); } } __name(addSubtract, "addSubtract"); var add = createAdder(1, "add"), subtract = createAdder(-1, "subtract"); function isString(input) { return typeof input === "string" || input instanceof String; } __name(isString, "isString"); function isMomentInput(input) { return isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === void 0; } __name(isMomentInput, "isMomentInput"); function isMomentInputObject(input) { var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [ "years", "year", "y", "months", "month", "M", "days", "day", "d", "dates", "date", "D", "hours", "hour", "h", "minutes", "minute", "m", "seconds", "second", "s", "milliseconds", "millisecond", "ms" ], i, property, propertyLen = properties.length; for (i = 0; i < propertyLen; i += 1) { property = properties[i]; propertyTest = propertyTest || hasOwnProp(input, property); } return objectTest && propertyTest; } __name(isMomentInputObject, "isMomentInputObject"); function isNumberOrStringArray(input) { var arrayTest = isArray(input), dataTypeTest = false; if (arrayTest) { dataTypeTest = input.filter(function(item) { return !isNumber(item) && isString(input); }).length === 0; } return arrayTest && dataTypeTest; } __name(isNumberOrStringArray, "isNumberOrStringArray"); function isCalendarSpec(input) { var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [ "sameDay", "nextDay", "lastDay", "nextWeek", "lastWeek", "sameElse" ], i, property; for (i = 0; i < properties.length; i += 1) { property = properties[i]; propertyTest = propertyTest || hasOwnProp(input, property); } return objectTest && propertyTest; } __name(isCalendarSpec, "isCalendarSpec"); function getCalendarFormat(myMoment, now2) { var diff2 = myMoment.diff(now2, "days", true); return diff2 < -6 ? "sameElse" : diff2 < -1 ? "lastWeek" : diff2 < 0 ? "lastDay" : diff2 < 1 ? "sameDay" : diff2 < 2 ? "nextDay" : diff2 < 7 ? "nextWeek" : "sameElse"; } __name(getCalendarFormat, "getCalendarFormat"); function calendar$1(time, formats) { if (arguments.length === 1) { if (!arguments[0]) { time = void 0; formats = void 0; } else if (isMomentInput(arguments[0])) { time = arguments[0]; formats = void 0; } else if (isCalendarSpec(arguments[0])) { formats = arguments[0]; time = void 0; } } var now2 = time || createLocal(), sod = cloneWithOffset(now2, this).startOf("day"), format2 = hooks.calendarFormat(this, sod) || "sameElse", output = formats && (isFunction(formats[format2]) ? formats[format2].call(this, now2) : formats[format2]); return this.format(output || this.localeData().calendar(format2, this, createLocal(now2))); } __name(calendar$1, "calendar$1"); function clone() { return new Moment(this); } __name(clone, "clone"); function isAfter(input, units) { var localInput = isMoment(input) ? input : createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || "millisecond"; if (units === "millisecond") { return this.valueOf() > localInput.valueOf(); } else { return localInput.valueOf() < this.clone().startOf(units).valueOf(); } } __name(isAfter, "isAfter"); function isBefore(input, units) { var localInput = isMoment(input) ? input : createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || "millisecond"; if (units === "millisecond") { return this.valueOf() < localInput.valueOf(); } else { return this.clone().endOf(units).valueOf() < localInput.valueOf(); } } __name(isBefore, "isBefore"); function isBetween(from2, to2, units, inclusivity) { var localFrom = isMoment(from2) ? from2 : createLocal(from2), localTo = isMoment(to2) ? to2 : createLocal(to2); if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { return false; } inclusivity = inclusivity || "()"; return (inclusivity[0] === "(" ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ")" ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)); } __name(isBetween, "isBetween"); function isSame(input, units) { var localInput = isMoment(input) ? input : createLocal(input), inputMs; if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || "millisecond"; if (units === "millisecond") { return this.valueOf() === localInput.valueOf(); } else { inputMs = localInput.valueOf(); return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); } } __name(isSame, "isSame"); function isSameOrAfter(input, units) { return this.isSame(input, units) || this.isAfter(input, units); } __name(isSameOrAfter, "isSameOrAfter"); function isSameOrBefore(input, units) { return this.isSame(input, units) || this.isBefore(input, units); } __name(isSameOrBefore, "isSameOrBefore"); function diff(input, units, asFloat) { var that, zoneDelta, output; if (!this.isValid()) { return NaN; } that = cloneWithOffset(input, this); if (!that.isValid()) { return NaN; } zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; units = normalizeUnits(units); switch (units) { case "year": output = monthDiff(this, that) / 12; break; case "month": output = monthDiff(this, that); break; case "quarter": output = monthDiff(this, that) / 3; break; case "second": output = (this - that) / 1e3; break; case "minute": output = (this - that) / 6e4; break; case "hour": output = (this - that) / 36e5; break; case "day": output = (this - that - zoneDelta) / 864e5; break; case "week": output = (this - that - zoneDelta) / 6048e5; break; default: output = this - that; } return asFloat ? output : absFloor(output); } __name(diff, "diff"); function monthDiff(a, b) { if (a.date() < b.date()) { return -monthDiff(b, a); } var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), anchor = a.clone().add(wholeMonthDiff, "months"), anchor2, adjust; if (b - anchor < 0) { anchor2 = a.clone().add(wholeMonthDiff - 1, "months"); adjust = (b - anchor) / (anchor - anchor2); } else { anchor2 = a.clone().add(wholeMonthDiff + 1, "months"); adjust = (b - anchor) / (anchor2 - anchor); } return -(wholeMonthDiff + adjust) || 0; } __name(monthDiff, "monthDiff"); hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ"; hooks.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]"; function toString() { return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ"); } __name(toString, "toString"); function toISOString(keepOffset) { if (!this.isValid()) { return null; } var utc = keepOffset !== true, m = utc ? this.clone().utc() : this; if (m.year() < 0 || m.year() > 9999) { return formatMoment(m, utc ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"); } if (isFunction(Date.prototype.toISOString)) { if (utc) { return this.toDate().toISOString(); } else { return new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", formatMoment(m, "Z")); } } return formatMoment(m, utc ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ"); } __name(toISOString, "toISOString"); function inspect() { if (!this.isValid()) { return "moment.invalid(/* " + this._i + " */)"; } var func = "moment", zone = "", prefix, year, datetime, suffix; if (!this.isLocal()) { func = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone"; zone = "Z"; } prefix = "[" + func + '("]'; year = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY"; datetime = "-MM-DD[T]HH:mm:ss.SSS"; suffix = zone + '[")]'; return this.format(prefix + year + datetime + suffix); } __name(inspect, "inspect"); function format(inputString) { if (!inputString) { inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; } var output = formatMoment(this, inputString); return this.localeData().postformat(output); } __name(format, "format"); function from(time, withoutSuffix) { if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) { return createDuration({ to: this, from: time }).locale(this.locale()).humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } __name(from, "from"); function fromNow(withoutSuffix) { return this.from(createLocal(), withoutSuffix); } __name(fromNow, "fromNow"); function to(time, withoutSuffix) { if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) { return createDuration({ from: this, to: time }).locale(this.locale()).humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } __name(to, "to"); function toNow(withoutSuffix) { return this.to(createLocal(), withoutSuffix); } __name(toNow, "toNow"); function locale(key) { var newLocaleData; if (key === void 0) { return this._locale._abbr; } else { newLocaleData = getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; } } __name(locale, "locale"); var lang = deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function(key) { if (key === void 0) { return this.localeData(); } else { return this.locale(key); } }); function localeData() { return this._locale; } __name(localeData, "localeData"); var MS_PER_SECOND = 1e3, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; function mod$1(dividend, divisor) { return (dividend % divisor + divisor) % divisor; } __name(mod$1, "mod$1"); function localStartOfDate(y, m, d) { if (y < 100 && y >= 0) { return new Date(y + 400, m, d) - MS_PER_400_YEARS; } else { return new Date(y, m, d).valueOf(); } } __name(localStartOfDate, "localStartOfDate"); function utcStartOfDate(y, m, d) { if (y < 100 && y >= 0) { return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; } else { return Date.UTC(y, m, d); } } __name(utcStartOfDate, "utcStartOfDate"); function startOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === void 0 || units === "millisecond" || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { case "year": time = startOfDate(this.year(), 0, 1); break; case "quarter": time = startOfDate(this.year(), this.month() - this.month() % 3, 1); break; case "month": time = startOfDate(this.year(), this.month(), 1); break; case "week": time = startOfDate(this.year(), this.month(), this.date() - this.weekday()); break; case "isoWeek": time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1)); break; case "day": case "date": time = startOfDate(this.year(), this.month(), this.date()); break; case "hour": time = this._d.valueOf(); time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR); break; case "minute": time = this._d.valueOf(); time -= mod$1(time, MS_PER_MINUTE); break; case "second": time = this._d.valueOf(); time -= mod$1(time, MS_PER_SECOND); break; } this._d.setTime(time); hooks.updateOffset(this, true); return this; } __name(startOf, "startOf"); function endOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === void 0 || units === "millisecond" || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { case "year": time = startOfDate(this.year() + 1, 0, 1) - 1; break; case "quarter": time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1; break; case "month": time = startOfDate(this.year(), this.month() + 1, 1) - 1; break; case "week": time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1; break; case "isoWeek": time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1; break; case "day": case "date": time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; break; case "hour": time = this._d.valueOf(); time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1; break; case "minute": time = this._d.valueOf(); time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; break; case "second": time = this._d.valueOf(); time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; break; } this._d.setTime(time); hooks.updateOffset(this, true); return this; } __name(endOf, "endOf"); function valueOf() { return this._d.valueOf() - (this._offset || 0) * 6e4; } __name(valueOf, "valueOf"); function unix() { return Math.floor(this.valueOf() / 1e3); } __name(unix, "unix"); function toDate() { return new Date(this.valueOf()); } __name(toDate, "toDate"); function toArray() { var m = this; return [ m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond() ]; } __name(toArray, "toArray"); function toObject() { var m = this; return { years: m.year(), months: m.month(), date: m.date(), hours: m.hours(), minutes: m.minutes(), seconds: m.seconds(), milliseconds: m.milliseconds() }; } __name(toObject, "toObject"); function toJSON() { return this.isValid() ? this.toISOString() : null; } __name(toJSON, "toJSON"); function isValid$2() { return isValid(this); } __name(isValid$2, "isValid$2"); function parsingFlags() { return extend({}, getParsingFlags(this)); } __name(parsingFlags, "parsingFlags"); function invalidAt() { return getParsingFlags(this).overflow; } __name(invalidAt, "invalidAt"); function creationData() { return { input: this._i, format: this._f, locale: this._locale, isUTC: this._isUTC, strict: this._strict }; } __name(creationData, "creationData"); addFormatToken("N", 0, 0, "eraAbbr"); addFormatToken("NN", 0, 0, "eraAbbr"); addFormatToken("NNN", 0, 0, "eraAbbr"); addFormatToken("NNNN", 0, 0, "eraName"); addFormatToken("NNNNN", 0, 0, "eraNarrow"); addFormatToken("y", ["y", 1], "yo", "eraYear"); addFormatToken("y", ["yy", 2], 0, "eraYear"); addFormatToken("y", ["yyy", 3], 0, "eraYear"); addFormatToken("y", ["yyyy", 4], 0, "eraYear"); addRegexToken("N", matchEraAbbr); addRegexToken("NN", matchEraAbbr); addRegexToken("NNN", matchEraAbbr); addRegexToken("NNNN", matchEraName); addRegexToken("NNNNN", matchEraNarrow); addParseToken(["N", "NN", "NNN", "NNNN", "NNNNN"], function(input, array, config2, token2) { var era = config2._locale.erasParse(input, token2, config2._strict); if (era) { getParsingFlags(config2).era = era; } else { getParsingFlags(config2).invalidEra = input; } }); addRegexToken("y", matchUnsigned); addRegexToken("yy", matchUnsigned); addRegexToken("yyy", matchUnsigned); addRegexToken("yyyy", matchUnsigned); addRegexToken("yo", matchEraYearOrdinal); addParseToken(["y", "yy", "yyy", "yyyy"], YEAR); addParseToken(["yo"], function(input, array, config2, token2) { var match; if (config2._locale._eraYearOrdinalRegex) { match = input.match(config2._locale._eraYearOrdinalRegex); } if (config2._locale.eraYearOrdinalParse) { array[YEAR] = config2._locale.eraYearOrdinalParse(input, match); } else { array[YEAR] = parseInt(input, 10); } }); function localeEras(m, format2) { var i, l, date, eras = this._eras || getLocale("en")._eras; for (i = 0, l = eras.length; i < l; ++i) { switch (typeof eras[i].since) { case "string": date = hooks(eras[i].since).startOf("day"); eras[i].since = date.valueOf(); break; } switch (typeof eras[i].until) { case "undefined": eras[i].until = Infinity; break; case "string": date = hooks(eras[i].until).startOf("day").valueOf(); eras[i].until = date.valueOf(); break; } } return eras; } __name(localeEras, "localeEras"); function localeErasParse(eraName, format2, strict) { var i, l, eras = this.eras(), name, abbr, narrow; eraName = eraName.toUpperCase(); for (i = 0, l = eras.length; i < l; ++i) { name = eras[i].name.toUpperCase(); abbr = eras[i].abbr.toUpperCase(); narrow = eras[i].narrow.toUpperCase(); if (strict) { switch (format2) { case "N": case "NN": case "NNN": if (abbr === eraName) { return eras[i]; } break; case "NNNN": if (name === eraName) { return eras[i]; } break; case "NNNNN": if (narrow === eraName) { return eras[i]; } break; } } else if ([name, abbr, narrow].indexOf(eraName) >= 0) { return eras[i]; } } } __name(localeErasParse, "localeErasParse"); function localeErasConvertYear(era, year) { var dir2 = era.since <= era.until ? 1 : -1; if (year === void 0) { return hooks(era.since).year(); } else { return hooks(era.since).year() + (year - era.offset) * dir2; } } __name(localeErasConvertYear, "localeErasConvertYear"); function getEraName() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { val = this.clone().startOf("day").valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].name; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].name; } } return ""; } __name(getEraName, "getEraName"); function getEraNarrow() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { val = this.clone().startOf("day").valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].narrow; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].narrow; } } return ""; } __name(getEraNarrow, "getEraNarrow"); function getEraAbbr() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { val = this.clone().startOf("day").valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].abbr; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].abbr; } } return ""; } __name(getEraAbbr, "getEraAbbr"); function getEraYear() { var i, l, dir2, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { dir2 = eras[i].since <= eras[i].until ? 1 : -1; val = this.clone().startOf("day").valueOf(); if (eras[i].since <= val && val <= eras[i].until || eras[i].until <= val && val <= eras[i].since) { return (this.year() - hooks(eras[i].since).year()) * dir2 + eras[i].offset; } } return this.year(); } __name(getEraYear, "getEraYear"); function erasNameRegex(isStrict) { if (!hasOwnProp(this, "_erasNameRegex")) { computeErasParse.call(this); } return isStrict ? this._erasNameRegex : this._erasRegex; } __name(erasNameRegex, "erasNameRegex"); function erasAbbrRegex(isStrict) { if (!hasOwnProp(this, "_erasAbbrRegex")) { computeErasParse.call(this); } return isStrict ? this._erasAbbrRegex : this._erasRegex; } __name(erasAbbrRegex, "erasAbbrRegex"); function erasNarrowRegex(isStrict) { if (!hasOwnProp(this, "_erasNarrowRegex")) { computeErasParse.call(this); } return isStrict ? this._erasNarrowRegex : this._erasRegex; } __name(erasNarrowRegex, "erasNarrowRegex"); function matchEraAbbr(isStrict, locale2) { return locale2.erasAbbrRegex(isStrict); } __name(matchEraAbbr, "matchEraAbbr"); function matchEraName(isStrict, locale2) { return locale2.erasNameRegex(isStrict); } __name(matchEraName, "matchEraName"); function matchEraNarrow(isStrict, locale2) { return locale2.erasNarrowRegex(isStrict); } __name(matchEraNarrow, "matchEraNarrow"); function matchEraYearOrdinal(isStrict, locale2) { return locale2._eraYearOrdinalRegex || matchUnsigned; } __name(matchEraYearOrdinal, "matchEraYearOrdinal"); function computeErasParse() { var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, eras = this.eras(); for (i = 0, l = eras.length; i < l; ++i) { namePieces.push(regexEscape(eras[i].name)); abbrPieces.push(regexEscape(eras[i].abbr)); narrowPieces.push(regexEscape(eras[i].narrow)); mixedPieces.push(regexEscape(eras[i].name)); mixedPieces.push(regexEscape(eras[i].abbr)); mixedPieces.push(regexEscape(eras[i].narrow)); } this._erasRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i"); this._erasNameRegex = new RegExp("^(" + namePieces.join("|") + ")", "i"); this._erasAbbrRegex = new RegExp("^(" + abbrPieces.join("|") + ")", "i"); this._erasNarrowRegex = new RegExp("^(" + narrowPieces.join("|") + ")", "i"); } __name(computeErasParse, "computeErasParse"); addFormatToken(0, ["gg", 2], 0, function() { return this.weekYear() % 100; }); addFormatToken(0, ["GG", 2], 0, function() { return this.isoWeekYear() % 100; }); function addWeekYearFormatToken(token2, getter) { addFormatToken(0, [token2, token2.length], 0, getter); } __name(addWeekYearFormatToken, "addWeekYearFormatToken"); addWeekYearFormatToken("gggg", "weekYear"); addWeekYearFormatToken("ggggg", "weekYear"); addWeekYearFormatToken("GGGG", "isoWeekYear"); addWeekYearFormatToken("GGGGG", "isoWeekYear"); addUnitAlias("weekYear", "gg"); addUnitAlias("isoWeekYear", "GG"); addUnitPriority("weekYear", 1); addUnitPriority("isoWeekYear", 1); addRegexToken("G", matchSigned); addRegexToken("g", matchSigned); addRegexToken("GG", match1to2, match2); addRegexToken("gg", match1to2, match2); addRegexToken("GGGG", match1to4, match4); addRegexToken("gggg", match1to4, match4); addRegexToken("GGGGG", match1to6, match6); addRegexToken("ggggg", match1to6, match6); addWeekParseToken(["gggg", "ggggg", "GGGG", "GGGGG"], function(input, week, config2, token2) { week[token2.substr(0, 2)] = toInt(input); }); addWeekParseToken(["gg", "GG"], function(input, week, config2, token2) { week[token2] = hooks.parseTwoDigitYear(input); }); function getSetWeekYear(input) { return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy); } __name(getSetWeekYear, "getSetWeekYear"); function getSetISOWeekYear(input) { return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4); } __name(getSetISOWeekYear, "getSetISOWeekYear"); function getISOWeeksInYear() { return weeksInYear(this.year(), 1, 4); } __name(getISOWeeksInYear, "getISOWeeksInYear"); function getISOWeeksInISOWeekYear() { return weeksInYear(this.isoWeekYear(), 1, 4); } __name(getISOWeeksInISOWeekYear, "getISOWeeksInISOWeekYear"); function getWeeksInYear() { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } __name(getWeeksInYear, "getWeeksInYear"); function getWeeksInWeekYear() { var weekInfo = this.localeData()._week; return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy); } __name(getWeeksInWeekYear, "getWeeksInWeekYear"); function getSetWeekYearHelper(input, week, weekday, dow, doy) { var weeksTarget; if (input == null) { return weekOfYear(this, dow, doy).year; } else { weeksTarget = weeksInYear(input, dow, doy); if (week > weeksTarget) { week = weeksTarget; } return setWeekAll.call(this, input, week, weekday, dow, doy); } } __name(getSetWeekYearHelper, "getSetWeekYearHelper"); function setWeekAll(weekYear, week, weekday, dow, doy) { var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); this.year(date.getUTCFullYear()); this.month(date.getUTCMonth()); this.date(date.getUTCDate()); return this; } __name(setWeekAll, "setWeekAll"); addFormatToken("Q", 0, "Qo", "quarter"); addUnitAlias("quarter", "Q"); addUnitPriority("quarter", 7); addRegexToken("Q", match1); addParseToken("Q", function(input, array) { array[MONTH] = (toInt(input) - 1) * 3; }); function getSetQuarter(input) { return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); } __name(getSetQuarter, "getSetQuarter"); addFormatToken("D", ["DD", 2], "Do", "date"); addUnitAlias("date", "D"); addUnitPriority("date", 9); addRegexToken("D", match1to2); addRegexToken("DD", match1to2, match2); addRegexToken("Do", function(isStrict, locale2) { return isStrict ? locale2._dayOfMonthOrdinalParse || locale2._ordinalParse : locale2._dayOfMonthOrdinalParseLenient; }); addParseToken(["D", "DD"], DATE); addParseToken("Do", function(input, array) { array[DATE] = toInt(input.match(match1to2)[0]); }); var getSetDayOfMonth = makeGetSet("Date", true); addFormatToken("DDD", ["DDDD", 3], "DDDo", "dayOfYear"); addUnitAlias("dayOfYear", "DDD"); addUnitPriority("dayOfYear", 4); addRegexToken("DDD", match1to3); addRegexToken("DDDD", match3); addParseToken(["DDD", "DDDD"], function(input, array, config2) { config2._dayOfYear = toInt(input); }); function getSetDayOfYear(input) { var dayOfYear = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1; return input == null ? dayOfYear : this.add(input - dayOfYear, "d"); } __name(getSetDayOfYear, "getSetDayOfYear"); addFormatToken("m", ["mm", 2], 0, "minute"); addUnitAlias("minute", "m"); addUnitPriority("minute", 14); addRegexToken("m", match1to2); addRegexToken("mm", match1to2, match2); addParseToken(["m", "mm"], MINUTE); var getSetMinute = makeGetSet("Minutes", false); addFormatToken("s", ["ss", 2], 0, "second"); addUnitAlias("second", "s"); addUnitPriority("second", 15); addRegexToken("s", match1to2); addRegexToken("ss", match1to2, match2); addParseToken(["s", "ss"], SECOND); var getSetSecond = makeGetSet("Seconds", false); addFormatToken("S", 0, 0, function() { return ~~(this.millisecond() / 100); }); addFormatToken(0, ["SS", 2], 0, function() { return ~~(this.millisecond() / 10); }); addFormatToken(0, ["SSS", 3], 0, "millisecond"); addFormatToken(0, ["SSSS", 4], 0, function() { return this.millisecond() * 10; }); addFormatToken(0, ["SSSSS", 5], 0, function() { return this.millisecond() * 100; }); addFormatToken(0, ["SSSSSS", 6], 0, function() { return this.millisecond() * 1e3; }); addFormatToken(0, ["SSSSSSS", 7], 0, function() { return this.millisecond() * 1e4; }); addFormatToken(0, ["SSSSSSSS", 8], 0, function() { return this.millisecond() * 1e5; }); addFormatToken(0, ["SSSSSSSSS", 9], 0, function() { return this.millisecond() * 1e6; }); addUnitAlias("millisecond", "ms"); addUnitPriority("millisecond", 16); addRegexToken("S", match1to3, match1); addRegexToken("SS", match1to3, match2); addRegexToken("SSS", match1to3, match3); var token, getSetMillisecond; for (token = "SSSS"; token.length <= 9; token += "S") { addRegexToken(token, matchUnsigned); } function parseMs(input, array) { array[MILLISECOND] = toInt(("0." + input) * 1e3); } __name(parseMs, "parseMs"); for (token = "S"; token.length <= 9; token += "S") { addParseToken(token, parseMs); } getSetMillisecond = makeGetSet("Milliseconds", false); addFormatToken("z", 0, 0, "zoneAbbr"); addFormatToken("zz", 0, 0, "zoneName"); function getZoneAbbr() { return this._isUTC ? "UTC" : ""; } __name(getZoneAbbr, "getZoneAbbr"); function getZoneName() { return this._isUTC ? "Coordinated Universal Time" : ""; } __name(getZoneName, "getZoneName"); var proto = Moment.prototype; proto.add = add; proto.calendar = calendar$1; proto.clone = clone; proto.diff = diff; proto.endOf = endOf; proto.format = format; proto.from = from; proto.fromNow = fromNow; proto.to = to; proto.toNow = toNow; proto.get = stringGet; proto.invalidAt = invalidAt; proto.isAfter = isAfter; proto.isBefore = isBefore; proto.isBetween = isBetween; proto.isSame = isSame; proto.isSameOrAfter = isSameOrAfter; proto.isSameOrBefore = isSameOrBefore; proto.isValid = isValid$2; proto.lang = lang; proto.locale = locale; proto.localeData = localeData; proto.max = prototypeMax; proto.min = prototypeMin; proto.parsingFlags = parsingFlags; proto.set = stringSet; proto.startOf = startOf; proto.subtract = subtract; proto.toArray = toArray; proto.toObject = toObject; proto.toDate = toDate; proto.toISOString = toISOString; proto.inspect = inspect; if (typeof Symbol !== "undefined" && Symbol.for != null) { proto[Symbol.for("nodejs.util.inspect.custom")] = function() { return "Moment<" + this.format() + ">"; }; } proto.toJSON = toJSON; proto.toString = toString; proto.unix = unix; proto.valueOf = valueOf; proto.creationData = creationData; proto.eraName = getEraName; proto.eraNarrow = getEraNarrow; proto.eraAbbr = getEraAbbr; proto.eraYear = getEraYear; proto.year = getSetYear; proto.isLeapYear = getIsLeapYear; proto.weekYear = getSetWeekYear; proto.isoWeekYear = getSetISOWeekYear; proto.quarter = proto.quarters = getSetQuarter; proto.month = getSetMonth; proto.daysInMonth = getDaysInMonth; proto.week = proto.weeks = getSetWeek; proto.isoWeek = proto.isoWeeks = getSetISOWeek; proto.weeksInYear = getWeeksInYear; proto.weeksInWeekYear = getWeeksInWeekYear; proto.isoWeeksInYear = getISOWeeksInYear; proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear; proto.date = getSetDayOfMonth; proto.day = proto.days = getSetDayOfWeek; proto.weekday = getSetLocaleDayOfWeek; proto.isoWeekday = getSetISODayOfWeek; proto.dayOfYear = getSetDayOfYear; proto.hour = proto.hours = getSetHour; proto.minute = proto.minutes = getSetMinute; proto.second = proto.seconds = getSetSecond; proto.millisecond = proto.milliseconds = getSetMillisecond; proto.utcOffset = getSetOffset; proto.utc = setOffsetToUTC; proto.local = setOffsetToLocal; proto.parseZone = setOffsetToParsedOffset; proto.hasAlignedHourOffset = hasAlignedHourOffset; proto.isDST = isDaylightSavingTime; proto.isLocal = isLocal; proto.isUtcOffset = isUtcOffset; proto.isUtc = isUtc; proto.isUTC = isUtc; proto.zoneAbbr = getZoneAbbr; proto.zoneName = getZoneName; proto.dates = deprecate("dates accessor is deprecated. Use date instead.", getSetDayOfMonth); proto.months = deprecate("months accessor is deprecated. Use month instead", getSetMonth); proto.years = deprecate("years accessor is deprecated. Use year instead", getSetYear); proto.zone = deprecate("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/", getSetZone); proto.isDSTShifted = deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information", isDaylightSavingTimeShifted); function createUnix(input) { return createLocal(input * 1e3); } __name(createUnix, "createUnix"); function createInZone() { return createLocal.apply(null, arguments).parseZone(); } __name(createInZone, "createInZone"); function preParsePostFormat(string) { return string; } __name(preParsePostFormat, "preParsePostFormat"); var proto$1 = Locale.prototype; proto$1.calendar = calendar; proto$1.longDateFormat = longDateFormat; proto$1.invalidDate = invalidDate; proto$1.ordinal = ordinal; proto$1.preparse = preParsePostFormat; proto$1.postformat = preParsePostFormat; proto$1.relativeTime = relativeTime; proto$1.pastFuture = pastFuture; proto$1.set = set; proto$1.eras = localeEras; proto$1.erasParse = localeErasParse; proto$1.erasConvertYear = localeErasConvertYear; proto$1.erasAbbrRegex = erasAbbrRegex; proto$1.erasNameRegex = erasNameRegex; proto$1.erasNarrowRegex = erasNarrowRegex; proto$1.months = localeMonths; proto$1.monthsShort = localeMonthsShort; proto$1.monthsParse = localeMonthsParse; proto$1.monthsRegex = monthsRegex; proto$1.monthsShortRegex = monthsShortRegex; proto$1.week = localeWeek; proto$1.firstDayOfYear = localeFirstDayOfYear; proto$1.firstDayOfWeek = localeFirstDayOfWeek; proto$1.weekdays = localeWeekdays; proto$1.weekdaysMin = localeWeekdaysMin; proto$1.weekdaysShort = localeWeekdaysShort; proto$1.weekdaysParse = localeWeekdaysParse; proto$1.weekdaysRegex = weekdaysRegex; proto$1.weekdaysShortRegex = weekdaysShortRegex; proto$1.weekdaysMinRegex = weekdaysMinRegex; proto$1.isPM = localeIsPM; proto$1.meridiem = localeMeridiem; function get$1(format2, index2, field, setter) { var locale2 = getLocale(), utc = createUTC().set(setter, index2); return locale2[field](utc, format2); } __name(get$1, "get$1"); function listMonthsImpl(format2, index2, field) { if (isNumber(format2)) { index2 = format2; format2 = void 0; } format2 = format2 || ""; if (index2 != null) { return get$1(format2, index2, field, "month"); } var i, out = []; for (i = 0; i < 12; i++) { out[i] = get$1(format2, i, field, "month"); } return out; } __name(listMonthsImpl, "listMonthsImpl"); function listWeekdaysImpl(localeSorted, format2, index2, field) { if (typeof localeSorted === "boolean") { if (isNumber(format2)) { index2 = format2; format2 = void 0; } format2 = format2 || ""; } else { format2 = localeSorted; index2 = format2; localeSorted = false; if (isNumber(format2)) { index2 = format2; format2 = void 0; } format2 = format2 || ""; } var locale2 = getLocale(), shift = localeSorted ? locale2._week.dow : 0, i, out = []; if (index2 != null) { return get$1(format2, (index2 + shift) % 7, field, "day"); } for (i = 0; i < 7; i++) { out[i] = get$1(format2, (i + shift) % 7, field, "day"); } return out; } __name(listWeekdaysImpl, "listWeekdaysImpl"); function listMonths(format2, index2) { return listMonthsImpl(format2, index2, "months"); } __name(listMonths, "listMonths"); function listMonthsShort(format2, index2) { return listMonthsImpl(format2, index2, "monthsShort"); } __name(listMonthsShort, "listMonthsShort"); function listWeekdays(localeSorted, format2, index2) { return listWeekdaysImpl(localeSorted, format2, index2, "weekdays"); } __name(listWeekdays, "listWeekdays"); function listWeekdaysShort(localeSorted, format2, index2) { return listWeekdaysImpl(localeSorted, format2, index2, "weekdaysShort"); } __name(listWeekdaysShort, "listWeekdaysShort"); function listWeekdaysMin(localeSorted, format2, index2) { return listWeekdaysImpl(localeSorted, format2, index2, "weekdaysMin"); } __name(listWeekdaysMin, "listWeekdaysMin"); getSetGlobalLocale("en", { eras: [ { since: "0001-01-01", until: Infinity, offset: 1, name: "Anno Domini", narrow: "AD", abbr: "AD" }, { since: "0000-12-31", until: -Infinity, offset: 1, name: "Before Christ", narrow: "BC", abbr: "BC" } ], dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function(number) { var b = number % 10, output = toInt(number % 100 / 10) === 1 ? "th" : b === 1 ? "st" : b === 2 ? "nd" : b === 3 ? "rd" : "th"; return number + output; } }); hooks.lang = deprecate("moment.lang is deprecated. Use moment.locale instead.", getSetGlobalLocale); hooks.langData = deprecate("moment.langData is deprecated. Use moment.localeData instead.", getLocale); var mathAbs = Math.abs; function abs() { var data = this._data; this._milliseconds = mathAbs(this._milliseconds); this._days = mathAbs(this._days); this._months = mathAbs(this._months); data.milliseconds = mathAbs(data.milliseconds); data.seconds = mathAbs(data.seconds); data.minutes = mathAbs(data.minutes); data.hours = mathAbs(data.hours); data.months = mathAbs(data.months); data.years = mathAbs(data.years); return this; } __name(abs, "abs"); function addSubtract$1(duration, input, value, direction) { var other = createDuration(input, value); duration._milliseconds += direction * other._milliseconds; duration._days += direction * other._days; duration._months += direction * other._months; return duration._bubble(); } __name(addSubtract$1, "addSubtract$1"); function add$1(input, value) { return addSubtract$1(this, input, value, 1); } __name(add$1, "add$1"); function subtract$1(input, value) { return addSubtract$1(this, input, value, -1); } __name(subtract$1, "subtract$1"); function absCeil(number) { if (number < 0) { return Math.floor(number); } else { return Math.ceil(number); } } __name(absCeil, "absCeil"); function bubble() { var milliseconds2 = this._milliseconds, days2 = this._days, months2 = this._months, data = this._data, seconds2, minutes2, hours2, years2, monthsFromDays; if (!(milliseconds2 >= 0 && days2 >= 0 && months2 >= 0 || milliseconds2 <= 0 && days2 <= 0 && months2 <= 0)) { milliseconds2 += absCeil(monthsToDays(months2) + days2) * 864e5; days2 = 0; months2 = 0; } data.milliseconds = milliseconds2 % 1e3; seconds2 = absFloor(milliseconds2 / 1e3); data.seconds = seconds2 % 60; minutes2 = absFloor(seconds2 / 60); data.minutes = minutes2 % 60; hours2 = absFloor(minutes2 / 60); data.hours = hours2 % 24; days2 += absFloor(hours2 / 24); monthsFromDays = absFloor(daysToMonths(days2)); months2 += monthsFromDays; days2 -= absCeil(monthsToDays(monthsFromDays)); years2 = absFloor(months2 / 12); months2 %= 12; data.days = days2; data.months = months2; data.years = years2; return this; } __name(bubble, "bubble"); function daysToMonths(days2) { return days2 * 4800 / 146097; } __name(daysToMonths, "daysToMonths"); function monthsToDays(months2) { return months2 * 146097 / 4800; } __name(monthsToDays, "monthsToDays"); function as(units) { if (!this.isValid()) { return NaN; } var days2, months2, milliseconds2 = this._milliseconds; units = normalizeUnits(units); if (units === "month" || units === "quarter" || units === "year") { days2 = this._days + milliseconds2 / 864e5; months2 = this._months + daysToMonths(days2); switch (units) { case "month": return months2; case "quarter": return months2 / 3; case "year": return months2 / 12; } } else { days2 = this._days + Math.round(monthsToDays(this._months)); switch (units) { case "week": return days2 / 7 + milliseconds2 / 6048e5; case "day": return days2 + milliseconds2 / 864e5; case "hour": return days2 * 24 + milliseconds2 / 36e5; case "minute": return days2 * 1440 + milliseconds2 / 6e4; case "second": return days2 * 86400 + milliseconds2 / 1e3; case "millisecond": return Math.floor(days2 * 864e5) + milliseconds2; default: throw new Error("Unknown unit " + units); } } } __name(as, "as"); function valueOf$1() { if (!this.isValid()) { return NaN; } return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6; } __name(valueOf$1, "valueOf$1"); function makeAs(alias) { return function() { return this.as(alias); }; } __name(makeAs, "makeAs"); var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asQuarters = makeAs("Q"), asYears = makeAs("y"); function clone$1() { return createDuration(this); } __name(clone$1, "clone$1"); function get$2(units) { units = normalizeUnits(units); return this.isValid() ? this[units + "s"]() : NaN; } __name(get$2, "get$2"); function makeGetter(name) { return function() { return this.isValid() ? this._data[name] : NaN; }; } __name(makeGetter, "makeGetter"); var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days = makeGetter("days"), months = makeGetter("months"), years = makeGetter("years"); function weeks() { return absFloor(this.days() / 7); } __name(weeks, "weeks"); var round = Math.round, thresholds = { ss: 44, s: 45, m: 45, h: 22, d: 26, w: null, M: 11 }; function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale2) { return locale2.relativeTime(number || 1, !!withoutSuffix, string, isFuture); } __name(substituteTimeAgo, "substituteTimeAgo"); function relativeTime$1(posNegDuration, withoutSuffix, thresholds2, locale2) { var duration = createDuration(posNegDuration).abs(), seconds2 = round(duration.as("s")), minutes2 = round(duration.as("m")), hours2 = round(duration.as("h")), days2 = round(duration.as("d")), months2 = round(duration.as("M")), weeks2 = round(duration.as("w")), years2 = round(duration.as("y")), a = seconds2 <= thresholds2.ss && ["s", seconds2] || seconds2 < thresholds2.s && ["ss", seconds2] || minutes2 <= 1 && ["m"] || minutes2 < thresholds2.m && ["mm", minutes2] || hours2 <= 1 && ["h"] || hours2 < thresholds2.h && ["hh", hours2] || days2 <= 1 && ["d"] || days2 < thresholds2.d && ["dd", days2]; if (thresholds2.w != null) { a = a || weeks2 <= 1 && ["w"] || weeks2 < thresholds2.w && ["ww", weeks2]; } a = a || months2 <= 1 && ["M"] || months2 < thresholds2.M && ["MM", months2] || years2 <= 1 && ["y"] || ["yy", years2]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; a[4] = locale2; return substituteTimeAgo.apply(null, a); } __name(relativeTime$1, "relativeTime$1"); function getSetRelativeTimeRounding(roundingFunction) { if (roundingFunction === void 0) { return round; } if (typeof roundingFunction === "function") { round = roundingFunction; return true; } return false; } __name(getSetRelativeTimeRounding, "getSetRelativeTimeRounding"); function getSetRelativeTimeThreshold(threshold, limit) { if (thresholds[threshold] === void 0) { return false; } if (limit === void 0) { return thresholds[threshold]; } thresholds[threshold] = limit; if (threshold === "s") { thresholds.ss = limit - 1; } return true; } __name(getSetRelativeTimeThreshold, "getSetRelativeTimeThreshold"); function humanize(argWithSuffix, argThresholds) { if (!this.isValid()) { return this.localeData().invalidDate(); } var withSuffix = false, th = thresholds, locale2, output; if (typeof argWithSuffix === "object") { argThresholds = argWithSuffix; argWithSuffix = false; } if (typeof argWithSuffix === "boolean") { withSuffix = argWithSuffix; } if (typeof argThresholds === "object") { th = Object.assign({}, thresholds, argThresholds); if (argThresholds.s != null && argThresholds.ss == null) { th.ss = argThresholds.s - 1; } } locale2 = this.localeData(); output = relativeTime$1(this, !withSuffix, th, locale2); if (withSuffix) { output = locale2.pastFuture(+this, output); } return locale2.postformat(output); } __name(humanize, "humanize"); var abs$1 = Math.abs; function sign(x) { return (x > 0) - (x < 0) || +x; } __name(sign, "sign"); function toISOString$1() { if (!this.isValid()) { return this.localeData().invalidDate(); } var seconds2 = abs$1(this._milliseconds) / 1e3, days2 = abs$1(this._days), months2 = abs$1(this._months), minutes2, hours2, years2, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign; if (!total) { return "P0D"; } minutes2 = absFloor(seconds2 / 60); hours2 = absFloor(minutes2 / 60); seconds2 %= 60; minutes2 %= 60; years2 = absFloor(months2 / 12); months2 %= 12; s = seconds2 ? seconds2.toFixed(3).replace(/\.?0+$/, "") : ""; totalSign = total < 0 ? "-" : ""; ymSign = sign(this._months) !== sign(total) ? "-" : ""; daysSign = sign(this._days) !== sign(total) ? "-" : ""; hmsSign = sign(this._milliseconds) !== sign(total) ? "-" : ""; return totalSign + "P" + (years2 ? ymSign + years2 + "Y" : "") + (months2 ? ymSign + months2 + "M" : "") + (days2 ? daysSign + days2 + "D" : "") + (hours2 || minutes2 || seconds2 ? "T" : "") + (hours2 ? hmsSign + hours2 + "H" : "") + (minutes2 ? hmsSign + minutes2 + "M" : "") + (seconds2 ? hmsSign + s + "S" : ""); } __name(toISOString$1, "toISOString$1"); var proto$2 = Duration.prototype; proto$2.isValid = isValid$1; proto$2.abs = abs; proto$2.add = add$1; proto$2.subtract = subtract$1; proto$2.as = as; proto$2.asMilliseconds = asMilliseconds; proto$2.asSeconds = asSeconds; proto$2.asMinutes = asMinutes; proto$2.asHours = asHours; proto$2.asDays = asDays; proto$2.asWeeks = asWeeks; proto$2.asMonths = asMonths; proto$2.asQuarters = asQuarters; proto$2.asYears = asYears; proto$2.valueOf = valueOf$1; proto$2._bubble = bubble; proto$2.clone = clone$1; proto$2.get = get$2; proto$2.milliseconds = milliseconds; proto$2.seconds = seconds; proto$2.minutes = minutes; proto$2.hours = hours; proto$2.days = days; proto$2.weeks = weeks; proto$2.months = months; proto$2.years = years; proto$2.humanize = humanize; proto$2.toISOString = toISOString$1; proto$2.toString = toISOString$1; proto$2.toJSON = toISOString$1; proto$2.locale = locale; proto$2.localeData = localeData; proto$2.toIsoString = deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", toISOString$1); proto$2.lang = lang; addFormatToken("X", 0, 0, "unix"); addFormatToken("x", 0, 0, "valueOf"); addRegexToken("x", matchSigned); addRegexToken("X", matchTimestamp); addParseToken("X", function(input, array, config2) { config2._d = new Date(parseFloat(input) * 1e3); }); addParseToken("x", function(input, array, config2) { config2._d = new Date(toInt(input)); }); hooks.version = "2.29.4"; setHookCallback(createLocal); hooks.fn = proto; hooks.min = min; hooks.max = max; hooks.now = now; hooks.utc = createUTC; hooks.unix = createUnix; hooks.months = listMonths; hooks.isDate = isDate; hooks.locale = getSetGlobalLocale; hooks.invalid = createInvalid; hooks.duration = createDuration; hooks.isMoment = isMoment; hooks.weekdays = listWeekdays; hooks.parseZone = createInZone; hooks.localeData = getLocale; hooks.isDuration = isDuration; hooks.monthsShort = listMonthsShort; hooks.weekdaysMin = listWeekdaysMin; hooks.defineLocale = defineLocale; hooks.updateLocale = updateLocale; hooks.locales = listLocales; hooks.weekdaysShort = listWeekdaysShort; hooks.normalizeUnits = normalizeUnits; hooks.relativeTimeRounding = getSetRelativeTimeRounding; hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; hooks.calendarFormat = getCalendarFormat; hooks.prototype = proto; hooks.HTML5_FMT = { DATETIME_LOCAL: "YYYY-MM-DDTHH:mm", DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss", DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS", DATE: "YYYY-MM-DD", TIME: "HH:mm", TIME_SECONDS: "HH:mm:ss", TIME_MS: "HH:mm:ss.SSS", WEEK: "GGGG-[W]WW", MONTH: "YYYY-MM" }; return hooks; }); } }); // node_modules/truncate-utf8-bytes/lib/truncate.js var require_truncate = __commonJS({ "node_modules/truncate-utf8-bytes/lib/truncate.js"(exports, module2) { "use strict"; function isHighSurrogate(codePoint) { return codePoint >= 55296 && codePoint <= 56319; } __name(isHighSurrogate, "isHighSurrogate"); function isLowSurrogate(codePoint) { return codePoint >= 56320 && codePoint <= 57343; } __name(isLowSurrogate, "isLowSurrogate"); module2.exports = /* @__PURE__ */ __name(function truncate(getLength, string, byteLength) { if (typeof string !== "string") { throw new Error("Input must be string"); } var charLength = string.length; var curByteLength = 0; var codePoint; var segment; for (var i = 0; i < charLength; i += 1) { codePoint = string.charCodeAt(i); segment = string[i]; if (isHighSurrogate(codePoint) && isLowSurrogate(string.charCodeAt(i + 1))) { i += 1; segment += string[i]; } curByteLength += getLength(segment); if (curByteLength === byteLength) { return string.slice(0, i + 1); } else if (curByteLength > byteLength) { return string.slice(0, i - segment.length + 1); } } return string; }, "truncate"); } }); // node_modules/utf8-byte-length/browser.js var require_browser2 = __commonJS({ "node_modules/utf8-byte-length/browser.js"(exports, module2) { "use strict"; function isHighSurrogate(codePoint) { return codePoint >= 55296 && codePoint <= 56319; } __name(isHighSurrogate, "isHighSurrogate"); function isLowSurrogate(codePoint) { return codePoint >= 56320 && codePoint <= 57343; } __name(isLowSurrogate, "isLowSurrogate"); module2.exports = /* @__PURE__ */ __name(function getByteLength(string) { if (typeof string !== "string") { throw new Error("Input must be string"); } var charLength = string.length; var byteLength = 0; var codePoint = null; var prevCodePoint = null; for (var i = 0; i < charLength; i++) { codePoint = string.charCodeAt(i); if (isLowSurrogate(codePoint)) { if (prevCodePoint != null && isHighSurrogate(prevCodePoint)) { byteLength += 1; } else { byteLength += 3; } } else if (codePoint <= 127) { byteLength += 1; } else if (codePoint >= 128 && codePoint <= 2047) { byteLength += 2; } else if (codePoint >= 2048 && codePoint <= 65535) { byteLength += 3; } prevCodePoint = codePoint; } return byteLength; }, "getByteLength"); } }); // node_modules/truncate-utf8-bytes/browser.js var require_browser3 = __commonJS({ "node_modules/truncate-utf8-bytes/browser.js"(exports, module2) { "use strict"; var truncate = require_truncate(); var getLength = require_browser2(); module2.exports = truncate.bind(null, getLength); } }); // node_modules/sanitize-filename/index.js var require_sanitize_filename = __commonJS({ "node_modules/sanitize-filename/index.js"(exports, module2) { "use strict"; var truncate = require_browser3(); var illegalRe = /[\/\?<>\\:\*\|"]/g; var controlRe = /[\x00-\x1f\x80-\x9f]/g; var reservedRe = /^\.+$/; var windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i; var windowsTrailingRe = /[\. ]+$/; function sanitize2(input, replacement) { if (typeof input !== "string") { throw new Error("Input must be string"); } var sanitized = input.replace(illegalRe, replacement).replace(controlRe, replacement).replace(reservedRe, replacement).replace(windowsReservedRe, replacement).replace(windowsTrailingRe, replacement); return truncate(sanitized, 255); } __name(sanitize2, "sanitize"); module2.exports = function(input, options) { var replacement = options && options.replacement || ""; var output = sanitize2(input, replacement); if (replacement === "") { return output; } return sanitize2(output, ""); }; } }); // node_modules/lodash/lodash.js var require_lodash = __commonJS({ "node_modules/lodash/lodash.js"(exports, module2) { (function() { var undefined2; var VERSION = "4.17.21"; var LARGE_ARRAY_SIZE = 200; var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`"; var HASH_UNDEFINED = "__lodash_hash_undefined__"; var MAX_MEMOIZE_SIZE = 500; var PLACEHOLDER = "__lodash_placeholder__"; var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "..."; var HOT_COUNT = 800, HOT_SPAN = 16; var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0; var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; var wrapFlags = [ ["ary", WRAP_ARY_FLAG], ["bind", WRAP_BIND_FLAG], ["bindKey", WRAP_BIND_KEY_FLAG], ["curry", WRAP_CURRY_FLAG], ["curryRight", WRAP_CURRY_RIGHT_FLAG], ["flip", WRAP_FLIP_FLAG], ["partial", WRAP_PARTIAL_FLAG], ["partialRight", WRAP_PARTIAL_RIGHT_FLAG], ["rearg", WRAP_REARG_FLAG] ]; var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]"; var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); var reTrimStart = /^\s+/; var reWhitespace = /\s/; var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; var reEscapeChar = /\\(\\)?/g; var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; var reFlags = /\w*$/; var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; var reIsBinary = /^0b[01]+$/i; var reIsHostCtor = /^\[object .+?Constructor\]$/; var reIsOctal = /^0o[0-7]+$/i; var reIsUint = /^(?:0|[1-9]\d*)$/; var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; var reNoMatch = /($^)/; var reUnescapedString = /['\n\r\u2028\u2029\\]/g; var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; var rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d"; var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; var reApos = RegExp(rsApos, "g"); var reComboMark = RegExp(rsCombo, "g"); var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); var reUnicodeWord = RegExp([ rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")", rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, rsUpper + "+" + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji ].join("|"), "g"); var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]"); var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; var contextProps = [ "Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout" ]; var templateCounter = -1; var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; var deburredLetters = { "\xC0": "A", "\xC1": "A", "\xC2": "A", "\xC3": "A", "\xC4": "A", "\xC5": "A", "\xE0": "a", "\xE1": "a", "\xE2": "a", "\xE3": "a", "\xE4": "a", "\xE5": "a", "\xC7": "C", "\xE7": "c", "\xD0": "D", "\xF0": "d", "\xC8": "E", "\xC9": "E", "\xCA": "E", "\xCB": "E", "\xE8": "e", "\xE9": "e", "\xEA": "e", "\xEB": "e", "\xCC": "I", "\xCD": "I", "\xCE": "I", "\xCF": "I", "\xEC": "i", "\xED": "i", "\xEE": "i", "\xEF": "i", "\xD1": "N", "\xF1": "n", "\xD2": "O", "\xD3": "O", "\xD4": "O", "\xD5": "O", "\xD6": "O", "\xD8": "O", "\xF2": "o", "\xF3": "o", "\xF4": "o", "\xF5": "o", "\xF6": "o", "\xF8": "o", "\xD9": "U", "\xDA": "U", "\xDB": "U", "\xDC": "U", "\xF9": "u", "\xFA": "u", "\xFB": "u", "\xFC": "u", "\xDD": "Y", "\xFD": "y", "\xFF": "y", "\xC6": "Ae", "\xE6": "ae", "\xDE": "Th", "\xFE": "th", "\xDF": "ss", "\u0100": "A", "\u0102": "A", "\u0104": "A", "\u0101": "a", "\u0103": "a", "\u0105": "a", "\u0106": "C", "\u0108": "C", "\u010A": "C", "\u010C": "C", "\u0107": "c", "\u0109": "c", "\u010B": "c", "\u010D": "c", "\u010E": "D", "\u0110": "D", "\u010F": "d", "\u0111": "d", "\u0112": "E", "\u0114": "E", "\u0116": "E", "\u0118": "E", "\u011A": "E", "\u0113": "e", "\u0115": "e", "\u0117": "e", "\u0119": "e", "\u011B": "e", "\u011C": "G", "\u011E": "G", "\u0120": "G", "\u0122": "G", "\u011D": "g", "\u011F": "g", "\u0121": "g", "\u0123": "g", "\u0124": "H", "\u0126": "H", "\u0125": "h", "\u0127": "h", "\u0128": "I", "\u012A": "I", "\u012C": "I", "\u012E": "I", "\u0130": "I", "\u0129": "i", "\u012B": "i", "\u012D": "i", "\u012F": "i", "\u0131": "i", "\u0134": "J", "\u0135": "j", "\u0136": "K", "\u0137": "k", "\u0138": "k", "\u0139": "L", "\u013B": "L", "\u013D": "L", "\u013F": "L", "\u0141": "L", "\u013A": "l", "\u013C": "l", "\u013E": "l", "\u0140": "l", "\u0142": "l", "\u0143": "N", "\u0145": "N", "\u0147": "N", "\u014A": "N", "\u0144": "n", "\u0146": "n", "\u0148": "n", "\u014B": "n", "\u014C": "O", "\u014E": "O", "\u0150": "O", "\u014D": "o", "\u014F": "o", "\u0151": "o", "\u0154": "R", "\u0156": "R", "\u0158": "R", "\u0155": "r", "\u0157": "r", "\u0159": "r", "\u015A": "S", "\u015C": "S", "\u015E": "S", "\u0160": "S", "\u015B": "s", "\u015D": "s", "\u015F": "s", "\u0161": "s", "\u0162": "T", "\u0164": "T", "\u0166": "T", "\u0163": "t", "\u0165": "t", "\u0167": "t", "\u0168": "U", "\u016A": "U", "\u016C": "U", "\u016E": "U", "\u0170": "U", "\u0172": "U", "\u0169": "u", "\u016B": "u", "\u016D": "u", "\u016F": "u", "\u0171": "u", "\u0173": "u", "\u0174": "W", "\u0175": "w", "\u0176": "Y", "\u0177": "y", "\u0178": "Y", "\u0179": "Z", "\u017B": "Z", "\u017D": "Z", "\u017A": "z", "\u017C": "z", "\u017E": "z", "\u0132": "IJ", "\u0133": "ij", "\u0152": "Oe", "\u0153": "oe", "\u0149": "'n", "\u017F": "s" }; var htmlEscapes = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }; var htmlUnescapes = { "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }; var stringEscapes = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }; var freeParseFloat = parseFloat, freeParseInt = parseInt; var freeGlobal = typeof global == "object" && global && global.Object === Object && global; var freeSelf = typeof self == "object" && self && self.Object === Object && self; var root = freeGlobal || freeSelf || Function("return this")(); var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2; var moduleExports = freeModule && freeModule.exports === freeExports; var freeProcess = moduleExports && freeGlobal.process; var nodeUtil = function() { try { var types = freeModule && freeModule.require && freeModule.require("util").types; if (types) { return types; } return freeProcess && freeProcess.binding && freeProcess.binding("util"); } catch (e) { } }(); var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; function apply2(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } __name(apply2, "apply"); function arrayAggregator(array, setter, iteratee, accumulator) { var index2 = -1, length = array == null ? 0 : array.length; while (++index2 < length) { var value = array[index2]; setter(accumulator, value, iteratee(value), array); } return accumulator; } __name(arrayAggregator, "arrayAggregator"); function arrayEach(array, iteratee) { var index2 = -1, length = array == null ? 0 : array.length; while (++index2 < length) { if (iteratee(array[index2], index2, array) === false) { break; } } return array; } __name(arrayEach, "arrayEach"); function arrayEachRight(array, iteratee) { var length = array == null ? 0 : array.length; while (length--) { if (iteratee(array[length], length, array) === false) { break; } } return array; } __name(arrayEachRight, "arrayEachRight"); function arrayEvery(array, predicate) { var index2 = -1, length = array == null ? 0 : array.length; while (++index2 < length) { if (!predicate(array[index2], index2, array)) { return false; } } return true; } __name(arrayEvery, "arrayEvery"); function arrayFilter(array, predicate) { var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index2 < length) { var value = array[index2]; if (predicate(value, index2, array)) { result[resIndex++] = value; } } return result; } __name(arrayFilter, "arrayFilter"); function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } __name(arrayIncludes, "arrayIncludes"); function arrayIncludesWith(array, value, comparator) { var index2 = -1, length = array == null ? 0 : array.length; while (++index2 < length) { if (comparator(value, array[index2])) { return true; } } return false; } __name(arrayIncludesWith, "arrayIncludesWith"); function arrayMap(array, iteratee) { var index2 = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index2 < length) { result[index2] = iteratee(array[index2], index2, array); } return result; } __name(arrayMap, "arrayMap"); function arrayPush(array, values) { var index2 = -1, length = values.length, offset = array.length; while (++index2 < length) { array[offset + index2] = values[index2]; } return array; } __name(arrayPush, "arrayPush"); function arrayReduce(array, iteratee, accumulator, initAccum) { var index2 = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index2]; } while (++index2 < length) { accumulator = iteratee(accumulator, array[index2], index2, array); } return accumulator; } __name(arrayReduce, "arrayReduce"); function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; } __name(arrayReduceRight, "arrayReduceRight"); function arraySome(array, predicate) { var index2 = -1, length = array == null ? 0 : array.length; while (++index2 < length) { if (predicate(array[index2], index2, array)) { return true; } } return false; } __name(arraySome, "arraySome"); var asciiSize = baseProperty("length"); function asciiToArray(string) { return string.split(""); } __name(asciiToArray, "asciiToArray"); function asciiWords(string) { return string.match(reAsciiWord) || []; } __name(asciiWords, "asciiWords"); function baseFindKey(collection, predicate, eachFunc) { var result; eachFunc(collection, function(value, key, collection2) { if (predicate(value, key, collection2)) { result = key; return false; } }); return result; } __name(baseFindKey, "baseFindKey"); function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index2 = fromIndex + (fromRight ? 1 : -1); while (fromRight ? index2-- : ++index2 < length) { if (predicate(array[index2], index2, array)) { return index2; } } return -1; } __name(baseFindIndex, "baseFindIndex"); function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } __name(baseIndexOf, "baseIndexOf"); function baseIndexOfWith(array, value, fromIndex, comparator) { var index2 = fromIndex - 1, length = array.length; while (++index2 < length) { if (comparator(array[index2], value)) { return index2; } } return -1; } __name(baseIndexOfWith, "baseIndexOfWith"); function baseIsNaN(value) { return value !== value; } __name(baseIsNaN, "baseIsNaN"); function baseMean(array, iteratee) { var length = array == null ? 0 : array.length; return length ? baseSum(array, iteratee) / length : NAN; } __name(baseMean, "baseMean"); function baseProperty(key) { return function(object) { return object == null ? undefined2 : object[key]; }; } __name(baseProperty, "baseProperty"); function basePropertyOf(object) { return function(key) { return object == null ? undefined2 : object[key]; }; } __name(basePropertyOf, "basePropertyOf"); function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index2, collection2) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index2, collection2); }); return accumulator; } __name(baseReduce, "baseReduce"); function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } __name(baseSortBy, "baseSortBy"); function baseSum(array, iteratee) { var result, index2 = -1, length = array.length; while (++index2 < length) { var current = iteratee(array[index2]); if (current !== undefined2) { result = result === undefined2 ? current : result + current; } } return result; } __name(baseSum, "baseSum"); function baseTimes(n, iteratee) { var index2 = -1, result = Array(n); while (++index2 < n) { result[index2] = iteratee(index2); } return result; } __name(baseTimes, "baseTimes"); function baseToPairs(object, props) { return arrayMap(props, function(key) { return [key, object[key]]; }); } __name(baseToPairs, "baseToPairs"); function baseTrim(string) { return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string; } __name(baseTrim, "baseTrim"); function baseUnary(func) { return function(value) { return func(value); }; } __name(baseUnary, "baseUnary"); function baseValues(object, props) { return arrayMap(props, function(key) { return object[key]; }); } __name(baseValues, "baseValues"); function cacheHas(cache, key) { return cache.has(key); } __name(cacheHas, "cacheHas"); function charsStartIndex(strSymbols, chrSymbols) { var index2 = -1, length = strSymbols.length; while (++index2 < length && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) { } return index2; } __name(charsStartIndex, "charsStartIndex"); function charsEndIndex(strSymbols, chrSymbols) { var index2 = strSymbols.length; while (index2-- && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) { } return index2; } __name(charsEndIndex, "charsEndIndex"); function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } __name(countHolders, "countHolders"); var deburrLetter = basePropertyOf(deburredLetters); var escapeHtmlChar = basePropertyOf(htmlEscapes); function escapeStringChar(chr) { return "\\" + stringEscapes[chr]; } __name(escapeStringChar, "escapeStringChar"); function getValue(object, key) { return object == null ? undefined2 : object[key]; } __name(getValue, "getValue"); function hasUnicode(string) { return reHasUnicode.test(string); } __name(hasUnicode, "hasUnicode"); function hasUnicodeWord(string) { return reHasUnicodeWord.test(string); } __name(hasUnicodeWord, "hasUnicodeWord"); function iteratorToArray(iterator) { var data, result = []; while (!(data = iterator.next()).done) { result.push(data.value); } return result; } __name(iteratorToArray, "iteratorToArray"); function mapToArray(map2) { var index2 = -1, result = Array(map2.size); map2.forEach(function(value, key) { result[++index2] = [key, value]; }); return result; } __name(mapToArray, "mapToArray"); function overArg(func, transform2) { return function(arg) { return func(transform2(arg)); }; } __name(overArg, "overArg"); function replaceHolders(array, placeholder) { var index2 = -1, length = array.length, resIndex = 0, result = []; while (++index2 < length) { var value = array[index2]; if (value === placeholder || value === PLACEHOLDER) { array[index2] = PLACEHOLDER; result[resIndex++] = index2; } } return result; } __name(replaceHolders, "replaceHolders"); function setToArray(set) { var index2 = -1, result = Array(set.size); set.forEach(function(value) { result[++index2] = value; }); return result; } __name(setToArray, "setToArray"); function setToPairs(set) { var index2 = -1, result = Array(set.size); set.forEach(function(value) { result[++index2] = [value, value]; }); return result; } __name(setToPairs, "setToPairs"); function strictIndexOf(array, value, fromIndex) { var index2 = fromIndex - 1, length = array.length; while (++index2 < length) { if (array[index2] === value) { return index2; } } return -1; } __name(strictIndexOf, "strictIndexOf"); function strictLastIndexOf(array, value, fromIndex) { var index2 = fromIndex + 1; while (index2--) { if (array[index2] === value) { return index2; } } return index2; } __name(strictLastIndexOf, "strictLastIndexOf"); function stringSize(string) { return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); } __name(stringSize, "stringSize"); function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } __name(stringToArray, "stringToArray"); function trimmedEndIndex(string) { var index2 = string.length; while (index2-- && reWhitespace.test(string.charAt(index2))) { } return index2; } __name(trimmedEndIndex, "trimmedEndIndex"); var unescapeHtmlChar = basePropertyOf(htmlUnescapes); function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { ++result; } return result; } __name(unicodeSize, "unicodeSize"); function unicodeToArray(string) { return string.match(reUnicode) || []; } __name(unicodeToArray, "unicodeToArray"); function unicodeWords(string) { return string.match(reUnicodeWord) || []; } __name(unicodeWords, "unicodeWords"); var runInContext = /* @__PURE__ */ __name(function runInContext2(context) { context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError; var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype; var coreJsData = context["__core-js_shared__"]; var funcToString = funcProto.toString; var hasOwnProperty = objectProto.hasOwnProperty; var idCounter = 0; var maskSrcKey = function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); return uid ? "Symbol(src)_1." + uid : ""; }(); var nativeObjectToString = objectProto.toString; var objectCtorString = funcToString.call(Object2); var oldDash = root._; var reIsNative = RegExp2("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); var Buffer2 = moduleExports ? context.Buffer : undefined2, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined2, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined2, symIterator = Symbol2 ? Symbol2.iterator : undefined2, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined2; var defineProperty = function() { try { var func = getNative(Object2, "defineProperty"); func({}, "", {}); return func; } catch (e) { } }(); var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined2, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse; var DataView2 = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create"); var metaMap = WeakMap2 && new WeakMap2(); var realNames = {}; var dataViewCtorString = toSource(DataView2), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2); var symbolProto = Symbol2 ? Symbol2.prototype : undefined2, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined2, symbolToString = symbolProto ? symbolProto.toString : undefined2; function lodash(value) { if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty.call(value, "__wrapped__")) { return wrapperClone(value); } } return new LodashWrapper(value); } __name(lodash, "lodash"); var baseCreate = function() { function object() { } __name(object, "object"); return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result2 = new object(); object.prototype = undefined2; return result2; }; }(); function baseLodash() { } __name(baseLodash, "baseLodash"); function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined2; } __name(LodashWrapper, "LodashWrapper"); lodash.templateSettings = { "escape": reEscape, "evaluate": reEvaluate, "interpolate": reInterpolate, "variable": "", "imports": { "_": lodash } }; lodash.prototype = baseLodash.prototype; lodash.prototype.constructor = lodash; LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } __name(LazyWrapper, "LazyWrapper"); function lazyClone() { var result2 = new LazyWrapper(this.__wrapped__); result2.__actions__ = copyArray(this.__actions__); result2.__dir__ = this.__dir__; result2.__filtered__ = this.__filtered__; result2.__iteratees__ = copyArray(this.__iteratees__); result2.__takeCount__ = this.__takeCount__; result2.__views__ = copyArray(this.__views__); return result2; } __name(lazyClone, "lazyClone"); function lazyReverse() { if (this.__filtered__) { var result2 = new LazyWrapper(this); result2.__dir__ = -1; result2.__filtered__ = true; } else { result2 = this.clone(); result2.__dir__ *= -1; } return result2; } __name(lazyReverse, "lazyReverse"); function lazyValue() { var array = this.__wrapped__.value(), dir2 = this.__dir__, isArr = isArray(array), isRight = dir2 < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index2 = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); if (!isArr || !isRight && arrLength == length && takeCount == length) { return baseWrapperValue(array, this.__actions__); } var result2 = []; outer: while (length-- && resIndex < takeCount) { index2 += dir2; var iterIndex = -1, value = array[index2]; while (++iterIndex < iterLength) { var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed = iteratee2(value); if (type == LAZY_MAP_FLAG) { value = computed; } else if (!computed) { if (type == LAZY_FILTER_FLAG) { continue outer; } else { break outer; } } } result2[resIndex++] = value; } return result2; } __name(lazyValue, "lazyValue"); LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; function Hash(entries) { var index2 = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index2 < length) { var entry = entries[index2]; this.set(entry[0], entry[1]); } } __name(Hash, "Hash"); function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } __name(hashClear, "hashClear"); function hashDelete(key) { var result2 = this.has(key) && delete this.__data__[key]; this.size -= result2 ? 1 : 0; return result2; } __name(hashDelete, "hashDelete"); function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result2 = data[key]; return result2 === HASH_UNDEFINED ? undefined2 : result2; } return hasOwnProperty.call(data, key) ? data[key] : undefined2; } __name(hashGet, "hashGet"); function hashHas(key) { var data = this.__data__; return nativeCreate ? data[key] !== undefined2 : hasOwnProperty.call(data, key); } __name(hashHas, "hashHas"); function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = nativeCreate && value === undefined2 ? HASH_UNDEFINED : value; return this; } __name(hashSet, "hashSet"); Hash.prototype.clear = hashClear; Hash.prototype["delete"] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; function ListCache(entries) { var index2 = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index2 < length) { var entry = entries[index2]; this.set(entry[0], entry[1]); } } __name(ListCache, "ListCache"); function listCacheClear() { this.__data__ = []; this.size = 0; } __name(listCacheClear, "listCacheClear"); function listCacheDelete(key) { var data = this.__data__, index2 = assocIndexOf(data, key); if (index2 < 0) { return false; } var lastIndex = data.length - 1; if (index2 == lastIndex) { data.pop(); } else { splice.call(data, index2, 1); } --this.size; return true; } __name(listCacheDelete, "listCacheDelete"); function listCacheGet(key) { var data = this.__data__, index2 = assocIndexOf(data, key); return index2 < 0 ? undefined2 : data[index2][1]; } __name(listCacheGet, "listCacheGet"); function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } __name(listCacheHas, "listCacheHas"); function listCacheSet(key, value) { var data = this.__data__, index2 = assocIndexOf(data, key); if (index2 < 0) { ++this.size; data.push([key, value]); } else { data[index2][1] = value; } return this; } __name(listCacheSet, "listCacheSet"); ListCache.prototype.clear = listCacheClear; ListCache.prototype["delete"] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; function MapCache(entries) { var index2 = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index2 < length) { var entry = entries[index2]; this.set(entry[0], entry[1]); } } __name(MapCache, "MapCache"); function mapCacheClear() { this.size = 0; this.__data__ = { "hash": new Hash(), "map": new (Map2 || ListCache)(), "string": new Hash() }; } __name(mapCacheClear, "mapCacheClear"); function mapCacheDelete(key) { var result2 = getMapData(this, key)["delete"](key); this.size -= result2 ? 1 : 0; return result2; } __name(mapCacheDelete, "mapCacheDelete"); function mapCacheGet(key) { return getMapData(this, key).get(key); } __name(mapCacheGet, "mapCacheGet"); function mapCacheHas(key) { return getMapData(this, key).has(key); } __name(mapCacheHas, "mapCacheHas"); function mapCacheSet(key, value) { var data = getMapData(this, key), size2 = data.size; data.set(key, value); this.size += data.size == size2 ? 0 : 1; return this; } __name(mapCacheSet, "mapCacheSet"); MapCache.prototype.clear = mapCacheClear; MapCache.prototype["delete"] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; function SetCache(values2) { var index2 = -1, length = values2 == null ? 0 : values2.length; this.__data__ = new MapCache(); while (++index2 < length) { this.add(values2[index2]); } } __name(SetCache, "SetCache"); function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } __name(setCacheAdd, "setCacheAdd"); function setCacheHas(value) { return this.__data__.has(value); } __name(setCacheHas, "setCacheHas"); SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } __name(Stack, "Stack"); function stackClear() { this.__data__ = new ListCache(); this.size = 0; } __name(stackClear, "stackClear"); function stackDelete(key) { var data = this.__data__, result2 = data["delete"](key); this.size = data.size; return result2; } __name(stackDelete, "stackDelete"); function stackGet(key) { return this.__data__.get(key); } __name(stackGet, "stackGet"); function stackHas(key) { return this.__data__.has(key); } __name(stackHas, "stackHas"); function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } __name(stackSet, "stackSet"); Stack.prototype.clear = stackClear; Stack.prototype["delete"] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) { result2.push(key); } } return result2; } __name(arrayLikeKeys, "arrayLikeKeys"); function arraySample(array) { var length = array.length; return length ? array[baseRandom(0, length - 1)] : undefined2; } __name(arraySample, "arraySample"); function arraySampleSize(array, n) { return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } __name(arraySampleSize, "arraySampleSize"); function arrayShuffle(array) { return shuffleSelf(copyArray(array)); } __name(arrayShuffle, "arrayShuffle"); function assignMergeValue(object, key, value) { if (value !== undefined2 && !eq(object[key], value) || value === undefined2 && !(key in object)) { baseAssignValue(object, key, value); } } __name(assignMergeValue, "assignMergeValue"); function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined2 && !(key in object)) { baseAssignValue(object, key, value); } } __name(assignValue, "assignValue"); function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } __name(assocIndexOf, "assocIndexOf"); function baseAggregator(collection, setter, iteratee2, accumulator) { baseEach(collection, function(value, key, collection2) { setter(accumulator, value, iteratee2(value), collection2); }); return accumulator; } __name(baseAggregator, "baseAggregator"); function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } __name(baseAssign, "baseAssign"); function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } __name(baseAssignIn, "baseAssignIn"); function baseAssignValue(object, key, value) { if (key == "__proto__" && defineProperty) { defineProperty(object, key, { "configurable": true, "enumerable": true, "value": value, "writable": true }); } else { object[key] = value; } } __name(baseAssignValue, "baseAssignValue"); function baseAt(object, paths) { var index2 = -1, length = paths.length, result2 = Array2(length), skip = object == null; while (++index2 < length) { result2[index2] = skip ? undefined2 : get(object, paths[index2]); } return result2; } __name(baseAt, "baseAt"); function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined2) { number = number <= upper ? number : upper; } if (lower !== undefined2) { number = number >= lower ? number : lower; } } return number; } __name(baseClamp, "baseClamp"); function baseClone(value, bitmask, customizer, key, object, stack) { var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer) { result2 = object ? customizer(value, key, object, stack) : customizer(value); } if (result2 !== undefined2) { return result2; } if (!isObject(value)) { return value; } var isArr = isArray(value); if (isArr) { result2 = initCloneArray(value); if (!isDeep) { return copyArray(value, result2); } } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || isFunc && !object) { result2 = isFlat || isFunc ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result2 = initCloneByTag(value, tag, isDeep); } } stack || (stack = new Stack()); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result2); if (isSet(value)) { value.forEach(function(subValue) { result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); } else if (isMap(value)) { value.forEach(function(subValue, key2) { result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack)); }); } var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; var props = isArr ? undefined2 : keysFunc(value); arrayEach(props || value, function(subValue, key2) { if (props) { key2 = subValue; subValue = value[key2]; } assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack)); }); return result2; } __name(baseClone, "baseClone"); function baseConforms(source) { var props = keys(source); return function(object) { return baseConformsTo(object, source, props); }; } __name(baseConforms, "baseConforms"); function baseConformsTo(object, source, props) { var length = props.length; if (object == null) { return !length; } object = Object2(object); while (length--) { var key = props[length], predicate = source[key], value = object[key]; if (value === undefined2 && !(key in object) || !predicate(value)) { return false; } } return true; } __name(baseConformsTo, "baseConformsTo"); function baseDelay(func, wait, args) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } return setTimeout3(function() { func.apply(undefined2, args); }, wait); } __name(baseDelay, "baseDelay"); function baseDifference(array, values2, iteratee2, comparator) { var index2 = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length; if (!length) { return result2; } if (iteratee2) { values2 = arrayMap(values2, baseUnary(iteratee2)); } if (comparator) { includes2 = arrayIncludesWith; isCommon = false; } else if (values2.length >= LARGE_ARRAY_SIZE) { includes2 = cacheHas; isCommon = false; values2 = new SetCache(values2); } outer: while (++index2 < length) { var value = array[index2], computed = iteratee2 == null ? value : iteratee2(value); value = comparator || value !== 0 ? value : 0; if (isCommon && computed === computed) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values2[valuesIndex] === computed) { continue outer; } } result2.push(value); } else if (!includes2(values2, computed, comparator)) { result2.push(value); } } return result2; } __name(baseDifference, "baseDifference"); var baseEach = createBaseEach(baseForOwn); var baseEachRight = createBaseEach(baseForOwnRight, true); function baseEvery(collection, predicate) { var result2 = true; baseEach(collection, function(value, index2, collection2) { result2 = !!predicate(value, index2, collection2); return result2; }); return result2; } __name(baseEvery, "baseEvery"); function baseExtremum(array, iteratee2, comparator) { var index2 = -1, length = array.length; while (++index2 < length) { var value = array[index2], current = iteratee2(value); if (current != null && (computed === undefined2 ? current === current && !isSymbol(current) : comparator(current, computed))) { var computed = current, result2 = value; } } return result2; } __name(baseExtremum, "baseExtremum"); function baseFill(array, value, start, end) { var length = array.length; start = toInteger(start); if (start < 0) { start = -start > length ? 0 : length + start; } end = end === undefined2 || end > length ? length : toInteger(end); if (end < 0) { end += length; } end = start > end ? 0 : toLength(end); while (start < end) { array[start++] = value; } return array; } __name(baseFill, "baseFill"); function baseFilter(collection, predicate) { var result2 = []; baseEach(collection, function(value, index2, collection2) { if (predicate(value, index2, collection2)) { result2.push(value); } }); return result2; } __name(baseFilter, "baseFilter"); function baseFlatten(array, depth, predicate, isStrict, result2) { var index2 = -1, length = array.length; predicate || (predicate = isFlattenable); result2 || (result2 = []); while (++index2 < length) { var value = array[index2]; if (depth > 0 && predicate(value)) { if (depth > 1) { baseFlatten(value, depth - 1, predicate, isStrict, result2); } else { arrayPush(result2, value); } } else if (!isStrict) { result2[result2.length] = value; } } return result2; } __name(baseFlatten, "baseFlatten"); var baseFor = createBaseFor(); var baseForRight = createBaseFor(true); function baseForOwn(object, iteratee2) { return object && baseFor(object, iteratee2, keys); } __name(baseForOwn, "baseForOwn"); function baseForOwnRight(object, iteratee2) { return object && baseForRight(object, iteratee2, keys); } __name(baseForOwnRight, "baseForOwnRight"); function baseFunctions(object, props) { return arrayFilter(props, function(key) { return isFunction(object[key]); }); } __name(baseFunctions, "baseFunctions"); function baseGet(object, path2) { path2 = castPath(path2, object); var index2 = 0, length = path2.length; while (object != null && index2 < length) { object = object[toKey(path2[index2++])]; } return index2 && index2 == length ? object : undefined2; } __name(baseGet, "baseGet"); function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result2 = keysFunc(object); return isArray(object) ? result2 : arrayPush(result2, symbolsFunc(object)); } __name(baseGetAllKeys, "baseGetAllKeys"); function baseGetTag(value) { if (value == null) { return value === undefined2 ? undefinedTag : nullTag; } return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value); } __name(baseGetTag, "baseGetTag"); function baseGt(value, other) { return value > other; } __name(baseGt, "baseGt"); function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } __name(baseHas, "baseHas"); function baseHasIn(object, key) { return object != null && key in Object2(object); } __name(baseHasIn, "baseHasIn"); function baseInRange(number, start, end) { return number >= nativeMin(start, end) && number < nativeMax(start, end); } __name(baseInRange, "baseInRange"); function baseIntersection(arrays, iteratee2, comparator) { var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee2) { array = arrayMap(array, baseUnary(iteratee2)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined2; } array = arrays[0]; var index2 = -1, seen = caches[0]; outer: while (++index2 < length && result2.length < maxLength) { var value = array[index2], computed = iteratee2 ? iteratee2(value) : value; value = comparator || value !== 0 ? value : 0; if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? cacheHas(cache, computed) : includes2(arrays[othIndex], computed, comparator))) { continue outer; } } if (seen) { seen.push(computed); } result2.push(value); } } return result2; } __name(baseIntersection, "baseIntersection"); function baseInverter(object, setter, iteratee2, accumulator) { baseForOwn(object, function(value, key, object2) { setter(accumulator, iteratee2(value), key, object2); }); return accumulator; } __name(baseInverter, "baseInverter"); function baseInvoke(object, path2, args) { path2 = castPath(path2, object); object = parent2(object, path2); var func = object == null ? object : object[toKey(last(path2))]; return func == null ? undefined2 : apply2(func, object, args); } __name(baseInvoke, "baseInvoke"); function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } __name(baseIsArguments, "baseIsArguments"); function baseIsArrayBuffer(value) { return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; } __name(baseIsArrayBuffer, "baseIsArrayBuffer"); function baseIsDate(value) { return isObjectLike(value) && baseGetTag(value) == dateTag; } __name(baseIsDate, "baseIsDate"); function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } __name(baseIsEqual, "baseIsEqual"); function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack()); return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__"); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack()); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack()); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } __name(baseIsEqualDeep, "baseIsEqualDeep"); function baseIsMap(value) { return isObjectLike(value) && getTag(value) == mapTag; } __name(baseIsMap, "baseIsMap"); function baseIsMatch(object, source, matchData, customizer) { var index2 = matchData.length, length = index2, noCustomizer = !customizer; if (object == null) { return !length; } object = Object2(object); while (index2--) { var data = matchData[index2]; if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { return false; } } while (++index2 < length) { data = matchData[index2]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined2 && !(key in object)) { return false; } } else { var stack = new Stack(); if (customizer) { var result2 = customizer(objValue, srcValue, key, object, source, stack); } if (!(result2 === undefined2 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result2)) { return false; } } } return true; } __name(baseIsMatch, "baseIsMatch"); function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } __name(baseIsNative, "baseIsNative"); function baseIsRegExp(value) { return isObjectLike(value) && baseGetTag(value) == regexpTag; } __name(baseIsRegExp, "baseIsRegExp"); function baseIsSet(value) { return isObjectLike(value) && getTag(value) == setTag; } __name(baseIsSet, "baseIsSet"); function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } __name(baseIsTypedArray, "baseIsTypedArray"); function baseIteratee(value) { if (typeof value == "function") { return value; } if (value == null) { return identity; } if (typeof value == "object") { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } __name(baseIteratee, "baseIteratee"); function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result2 = []; for (var key in Object2(object)) { if (hasOwnProperty.call(object, key) && key != "constructor") { result2.push(key); } } return result2; } __name(baseKeys, "baseKeys"); function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result2 = []; for (var key in object) { if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) { result2.push(key); } } return result2; } __name(baseKeysIn, "baseKeysIn"); function baseLt(value, other) { return value < other; } __name(baseLt, "baseLt"); function baseMap(collection, iteratee2) { var index2 = -1, result2 = isArrayLike2(collection) ? Array2(collection.length) : []; baseEach(collection, function(value, key, collection2) { result2[++index2] = iteratee2(value, key, collection2); }); return result2; } __name(baseMap, "baseMap"); function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } __name(baseMatches, "baseMatches"); function baseMatchesProperty(path2, srcValue) { if (isKey(path2) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path2), srcValue); } return function(object) { var objValue = get(object, path2); return objValue === undefined2 && objValue === srcValue ? hasIn(object, path2) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } __name(baseMatchesProperty, "baseMatchesProperty"); function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { stack || (stack = new Stack()); if (isObject(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined2; if (newValue === undefined2) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } __name(baseMerge, "baseMerge"); function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined2; var isCommon = newValue === undefined2; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack["delete"](srcValue); } assignMergeValue(object, key, newValue); } __name(baseMergeDeep, "baseMergeDeep"); function baseNth(array, n) { var length = array.length; if (!length) { return; } n += n < 0 ? length : 0; return isIndex(n, length) ? array[n] : undefined2; } __name(baseNth, "baseNth"); function baseOrderBy(collection, iteratees, orders) { if (iteratees.length) { iteratees = arrayMap(iteratees, function(iteratee2) { if (isArray(iteratee2)) { return function(value) { return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2); }; } return iteratee2; }); } else { iteratees = [identity]; } var index2 = -1; iteratees = arrayMap(iteratees, baseUnary(getIteratee())); var result2 = baseMap(collection, function(value, key, collection2) { var criteria = arrayMap(iteratees, function(iteratee2) { return iteratee2(value); }); return { "criteria": criteria, "index": ++index2, "value": value }; }); return baseSortBy(result2, function(object, other) { return compareMultiple(object, other, orders); }); } __name(baseOrderBy, "baseOrderBy"); function basePick(object, paths) { return basePickBy(object, paths, function(value, path2) { return hasIn(object, path2); }); } __name(basePick, "basePick"); function basePickBy(object, paths, predicate) { var index2 = -1, length = paths.length, result2 = {}; while (++index2 < length) { var path2 = paths[index2], value = baseGet(object, path2); if (predicate(value, path2)) { baseSet(result2, castPath(path2, object), value); } } return result2; } __name(basePickBy, "basePickBy"); function basePropertyDeep(path2) { return function(object) { return baseGet(object, path2); }; } __name(basePropertyDeep, "basePropertyDeep"); function basePullAll(array, values2, iteratee2, comparator) { var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index2 = -1, length = values2.length, seen = array; if (array === values2) { values2 = copyArray(values2); } if (iteratee2) { seen = arrayMap(array, baseUnary(iteratee2)); } while (++index2 < length) { var fromIndex = 0, value = values2[index2], computed = iteratee2 ? iteratee2(value) : value; while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { splice.call(seen, fromIndex, 1); } splice.call(array, fromIndex, 1); } } return array; } __name(basePullAll, "basePullAll"); function basePullAt(array, indexes) { var length = array ? indexes.length : 0, lastIndex = length - 1; while (length--) { var index2 = indexes[length]; if (length == lastIndex || index2 !== previous) { var previous = index2; if (isIndex(index2)) { splice.call(array, index2, 1); } else { baseUnset(array, index2); } } } return array; } __name(basePullAt, "basePullAt"); function baseRandom(lower, upper) { return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); } __name(baseRandom, "baseRandom"); function baseRange(start, end, step, fromRight) { var index2 = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result2 = Array2(length); while (length--) { result2[fromRight ? length : ++index2] = start; start += step; } return result2; } __name(baseRange, "baseRange"); function baseRepeat(string, n) { var result2 = ""; if (!string || n < 1 || n > MAX_SAFE_INTEGER) { return result2; } do { if (n % 2) { result2 += string; } n = nativeFloor(n / 2); if (n) { string += string; } } while (n); return result2; } __name(baseRepeat, "baseRepeat"); function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ""); } __name(baseRest, "baseRest"); function baseSample(collection) { return arraySample(values(collection)); } __name(baseSample, "baseSample"); function baseSampleSize(collection, n) { var array = values(collection); return shuffleSelf(array, baseClamp(n, 0, array.length)); } __name(baseSampleSize, "baseSampleSize"); function baseSet(object, path2, value, customizer) { if (!isObject(object)) { return object; } path2 = castPath(path2, object); var index2 = -1, length = path2.length, lastIndex = length - 1, nested = object; while (nested != null && ++index2 < length) { var key = toKey(path2[index2]), newValue = value; if (key === "__proto__" || key === "constructor" || key === "prototype") { return object; } if (index2 != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined2; if (newValue === undefined2) { newValue = isObject(objValue) ? objValue : isIndex(path2[index2 + 1]) ? [] : {}; } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } __name(baseSet, "baseSet"); var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, "toString", { "configurable": true, "enumerable": false, "value": constant2(string), "writable": true }); }; function baseShuffle(collection) { return shuffleSelf(values(collection)); } __name(baseShuffle, "baseShuffle"); function baseSlice(array, start, end) { var index2 = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : length + start; } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : end - start >>> 0; start >>>= 0; var result2 = Array2(length); while (++index2 < length) { result2[index2] = array[index2 + start]; } return result2; } __name(baseSlice, "baseSlice"); function baseSome(collection, predicate) { var result2; baseEach(collection, function(value, index2, collection2) { result2 = predicate(value, index2, collection2); return !result2; }); return !!result2; } __name(baseSome, "baseSome"); function baseSortedIndex(array, value, retHighest) { var low = 0, high = array == null ? low : array.length; if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { var mid = low + high >>> 1, computed = array[mid]; if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) { low = mid + 1; } else { high = mid; } } return high; } return baseSortedIndexBy(array, value, identity, retHighest); } __name(baseSortedIndex, "baseSortedIndex"); function baseSortedIndexBy(array, value, iteratee2, retHighest) { var low = 0, high = array == null ? 0 : array.length; if (high === 0) { return 0; } value = iteratee2(value); var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined2; while (low < high) { var mid = nativeFloor((low + high) / 2), computed = iteratee2(array[mid]), othIsDefined = computed !== undefined2, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed); if (valIsNaN) { var setLow = retHighest || othIsReflexive; } else if (valIsUndefined) { setLow = othIsReflexive && (retHighest || othIsDefined); } else if (valIsNull) { setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); } else if (valIsSymbol) { setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); } else if (othIsNull || othIsSymbol) { setLow = false; } else { setLow = retHighest ? computed <= value : computed < value; } if (setLow) { low = mid + 1; } else { high = mid; } } return nativeMin(high, MAX_ARRAY_INDEX); } __name(baseSortedIndexBy, "baseSortedIndexBy"); function baseSortedUniq(array, iteratee2) { var index2 = -1, length = array.length, resIndex = 0, result2 = []; while (++index2 < length) { var value = array[index2], computed = iteratee2 ? iteratee2(value) : value; if (!index2 || !eq(computed, seen)) { var seen = computed; result2[resIndex++] = value === 0 ? 0 : value; } } return result2; } __name(baseSortedUniq, "baseSortedUniq"); function baseToNumber(value) { if (typeof value == "number") { return value; } if (isSymbol(value)) { return NAN; } return +value; } __name(baseToNumber, "baseToNumber"); function baseToString(value) { if (typeof value == "string") { return value; } if (isArray(value)) { return arrayMap(value, baseToString) + ""; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ""; } var result2 = value + ""; return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2; } __name(baseToString, "baseToString"); function baseUniq(array, iteratee2, comparator) { var index2 = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2; if (comparator) { isCommon = false; includes2 = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set2 = iteratee2 ? null : createSet(array); if (set2) { return setToArray(set2); } isCommon = false; includes2 = cacheHas; seen = new SetCache(); } else { seen = iteratee2 ? [] : result2; } outer: while (++index2 < length) { var value = array[index2], computed = iteratee2 ? iteratee2(value) : value; value = comparator || value !== 0 ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee2) { seen.push(computed); } result2.push(value); } else if (!includes2(seen, computed, comparator)) { if (seen !== result2) { seen.push(computed); } result2.push(value); } } return result2; } __name(baseUniq, "baseUniq"); function baseUnset(object, path2) { path2 = castPath(path2, object); object = parent2(object, path2); return object == null || delete object[toKey(last(path2))]; } __name(baseUnset, "baseUnset"); function baseUpdate(object, path2, updater, customizer) { return baseSet(object, path2, updater(baseGet(object, path2)), customizer); } __name(baseUpdate, "baseUpdate"); function baseWhile(array, predicate, isDrop, fromRight) { var length = array.length, index2 = fromRight ? length : -1; while ((fromRight ? index2-- : ++index2 < length) && predicate(array[index2], index2, array)) { } return isDrop ? baseSlice(array, fromRight ? 0 : index2, fromRight ? index2 + 1 : length) : baseSlice(array, fromRight ? index2 + 1 : 0, fromRight ? length : index2); } __name(baseWhile, "baseWhile"); function baseWrapperValue(value, actions) { var result2 = value; if (result2 instanceof LazyWrapper) { result2 = result2.value(); } return arrayReduce(actions, function(result3, action) { return action.func.apply(action.thisArg, arrayPush([result3], action.args)); }, result2); } __name(baseWrapperValue, "baseWrapperValue"); function baseXor(arrays, iteratee2, comparator) { var length = arrays.length; if (length < 2) { return length ? baseUniq(arrays[0]) : []; } var index2 = -1, result2 = Array2(length); while (++index2 < length) { var array = arrays[index2], othIndex = -1; while (++othIndex < length) { if (othIndex != index2) { result2[index2] = baseDifference(result2[index2] || array, arrays[othIndex], iteratee2, comparator); } } } return baseUniq(baseFlatten(result2, 1), iteratee2, comparator); } __name(baseXor, "baseXor"); function baseZipObject(props, values2, assignFunc) { var index2 = -1, length = props.length, valsLength = values2.length, result2 = {}; while (++index2 < length) { var value = index2 < valsLength ? values2[index2] : undefined2; assignFunc(result2, props[index2], value); } return result2; } __name(baseZipObject, "baseZipObject"); function castArrayLikeObject(value) { return isArrayLikeObject(value) ? value : []; } __name(castArrayLikeObject, "castArrayLikeObject"); function castFunction(value) { return typeof value == "function" ? value : identity; } __name(castFunction, "castFunction"); function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } __name(castPath, "castPath"); var castRest = baseRest; function castSlice(array, start, end) { var length = array.length; end = end === undefined2 ? length : end; return !start && end >= length ? array : baseSlice(array, start, end); } __name(castSlice, "castSlice"); var clearTimeout3 = ctxClearTimeout || function(id) { return root.clearTimeout(id); }; function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result2); return result2; } __name(cloneBuffer, "cloneBuffer"); function cloneArrayBuffer(arrayBuffer) { var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer)); return result2; } __name(cloneArrayBuffer, "cloneArrayBuffer"); function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } __name(cloneDataView, "cloneDataView"); function cloneRegExp(regexp) { var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result2.lastIndex = regexp.lastIndex; return result2; } __name(cloneRegExp, "cloneRegExp"); function cloneSymbol(symbol) { return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {}; } __name(cloneSymbol, "cloneSymbol"); function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } __name(cloneTypedArray, "cloneTypedArray"); function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined2, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined2, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { return 1; } if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { return -1; } } return 0; } __name(compareAscending, "compareAscending"); function compareMultiple(object, other, orders) { var index2 = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index2 < length) { var result2 = compareAscending(objCriteria[index2], othCriteria[index2]); if (result2) { if (index2 >= ordersLength) { return result2; } var order = orders[index2]; return result2 * (order == "desc" ? -1 : 1); } } return object.index - other.index; } __name(compareMultiple, "compareMultiple"); function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result2[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result2[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result2[leftIndex++] = args[argsIndex++]; } return result2; } __name(composeArgs, "composeArgs"); function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result2[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result2[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result2[offset + holders[holdersIndex]] = args[argsIndex++]; } } return result2; } __name(composeArgsRight, "composeArgsRight"); function copyArray(source, array) { var index2 = -1, length = source.length; array || (array = Array2(length)); while (++index2 < length) { array[index2] = source[index2]; } return array; } __name(copyArray, "copyArray"); function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index2 = -1, length = props.length; while (++index2 < length) { var key = props[index2]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined2; if (newValue === undefined2) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } __name(copyObject, "copyObject"); function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } __name(copySymbols, "copySymbols"); function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } __name(copySymbolsIn, "copySymbolsIn"); function createAggregator(setter, initializer) { return function(collection, iteratee2) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, getIteratee(iteratee2, 2), accumulator); }; } __name(createAggregator, "createAggregator"); function createAssigner(assigner) { return baseRest(function(object, sources) { var index2 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined2, guard = length > 2 ? sources[2] : undefined2; customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined2; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined2 : customizer; length = 1; } object = Object2(object); while (++index2 < length) { var source = sources[index2]; if (source) { assigner(object, source, index2, customizer); } } return object; }); } __name(createAssigner, "createAssigner"); function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee2) { if (collection == null) { return collection; } if (!isArrayLike2(collection)) { return eachFunc(collection, iteratee2); } var length = collection.length, index2 = fromRight ? length : -1, iterable = Object2(collection); while (fromRight ? index2-- : ++index2 < length) { if (iteratee2(iterable[index2], index2, iterable) === false) { break; } } return collection; }; } __name(createBaseEach, "createBaseEach"); function createBaseFor(fromRight) { return function(object, iteratee2, keysFunc) { var index2 = -1, iterable = Object2(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index2]; if (iteratee2(iterable[key], key, iterable) === false) { break; } } return object; }; } __name(createBaseFor, "createBaseFor"); function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var fn = this && this !== root && this instanceof wrapper ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } __name(wrapper, "wrapper"); return wrapper; } __name(createBind, "createBind"); function createCaseFirst(methodName) { return function(string) { string = toString(string); var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined2; var chr = strSymbols ? strSymbols[0] : string.charAt(0); var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1); return chr[methodName]() + trailing; }; } __name(createCaseFirst, "createCaseFirst"); function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, "")), callback, ""); }; } __name(createCompounder, "createCompounder"); function createCtor(Ctor) { return function() { var args = arguments; switch (args.length) { case 0: return new Ctor(); case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args); return isObject(result2) ? result2 : thisBinding; }; } __name(createCtor, "createCtor"); function createCurry(func, bitmask, arity) { var Ctor = createCtor(func); function wrapper() { var length = arguments.length, args = Array2(length), index2 = length, placeholder = getHolder(wrapper); while (index2--) { args[index2] = arguments[index2]; } var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, undefined2, args, holders, undefined2, undefined2, arity - length); } var fn = this && this !== root && this instanceof wrapper ? Ctor : func; return apply2(fn, this, args); } __name(wrapper, "wrapper"); return wrapper; } __name(createCurry, "createCurry"); function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object2(collection); if (!isArrayLike2(collection)) { var iteratee2 = getIteratee(predicate, 3); collection = keys(collection); predicate = /* @__PURE__ */ __name(function(key) { return iteratee2(iterable[key], key, iterable); }, "predicate"); } var index2 = findIndexFunc(collection, predicate, fromIndex); return index2 > -1 ? iterable[iteratee2 ? collection[index2] : index2] : undefined2; }; } __name(createFind, "createFind"); function createFlow(fromRight) { return flatRest(function(funcs) { var length = funcs.length, index2 = length, prereq = LodashWrapper.prototype.thru; if (fromRight) { funcs.reverse(); } while (index2--) { var func = funcs[index2]; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } if (prereq && !wrapper && getFuncName(func) == "wrapper") { var wrapper = new LodashWrapper([], true); } } index2 = wrapper ? index2 : length; while (++index2 < length) { func = funcs[index2]; var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined2; if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) { wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); } else { wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; if (wrapper && args.length == 1 && isArray(value)) { return wrapper.plant(value).value(); } var index3 = 0, result2 = length ? funcs[index3].apply(this, args) : value; while (++index3 < length) { result2 = funcs[index3].call(this, result2); } return result2; }; }); } __name(createFlow, "createFlow"); function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) { var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined2 : createCtor(func); function wrapper() { var length = arguments.length, args = Array2(length), index2 = length; while (index2--) { args[index2] = arguments[index2]; } if (isCurried) { var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary2, arity - length); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary2 < length) { args.length = ary2; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } __name(wrapper, "wrapper"); return wrapper; } __name(createHybrid, "createHybrid"); function createInverter(setter, toIteratee) { return function(object, iteratee2) { return baseInverter(object, setter, toIteratee(iteratee2), {}); }; } __name(createInverter, "createInverter"); function createMathOperation(operator, defaultValue) { return function(value, other) { var result2; if (value === undefined2 && other === undefined2) { return defaultValue; } if (value !== undefined2) { result2 = value; } if (other !== undefined2) { if (result2 === undefined2) { return other; } if (typeof value == "string" || typeof other == "string") { value = baseToString(value); other = baseToString(other); } else { value = baseToNumber(value); other = baseToNumber(other); } result2 = operator(value, other); } return result2; }; } __name(createMathOperation, "createMathOperation"); function createOver(arrayFunc) { return flatRest(function(iteratees) { iteratees = arrayMap(iteratees, baseUnary(getIteratee())); return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee2) { return apply2(iteratee2, thisArg, args); }); }); }); } __name(createOver, "createOver"); function createPadding(length, chars) { chars = chars === undefined2 ? " " : baseToString(chars); var charsLength = chars.length; if (charsLength < 2) { return charsLength ? baseRepeat(chars, length) : chars; } var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars))); return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length); } __name(createPadding, "createPadding"); function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply2(fn, isBind ? thisArg : this, args); } __name(wrapper, "wrapper"); return wrapper; } __name(createPartial, "createPartial"); function createRange(fromRight) { return function(start, end, step) { if (step && typeof step != "number" && isIterateeCall(start, end, step)) { end = step = undefined2; } start = toFinite(start); if (end === undefined2) { end = start; start = 0; } else { end = toFinite(end); } step = step === undefined2 ? start < end ? 1 : -1 : toFinite(step); return baseRange(start, end, step, fromRight); }; } __name(createRange, "createRange"); function createRelationalOperation(operator) { return function(value, other) { if (!(typeof value == "string" && typeof other == "string")) { value = toNumber(value); other = toNumber(other); } return operator(value, other); }; } __name(createRelationalOperation, "createRelationalOperation"); function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined2, newHoldersRight = isCurry ? undefined2 : holders, newPartials = isCurry ? partials : undefined2, newPartialsRight = isCurry ? undefined2 : partials; bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG; bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary2, arity ]; var result2 = wrapFunc.apply(undefined2, newData); if (isLaziable(func)) { setData(result2, newData); } result2.placeholder = placeholder; return setWrapToString(result2, func, bitmask); } __name(createRecurry, "createRecurry"); function createRound(methodName) { var func = Math2[methodName]; return function(number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); if (precision && nativeIsFinite(number)) { var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision)); pair = (toString(value) + "e").split("e"); return +(pair[0] + "e" + (+pair[1] - precision)); } return func(number); }; } __name(createRound, "createRound"); var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values2) { return new Set2(values2); }; function createToPairs(keysFunc) { return function(object) { var tag = getTag(object); if (tag == mapTag) { return mapToArray(object); } if (tag == setTag) { return setToPairs(object); } return baseToPairs(object, keysFunc(object)); }; } __name(createToPairs, "createToPairs"); function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; if (!isBindKey && typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); partials = holders = undefined2; } ary2 = ary2 === undefined2 ? ary2 : nativeMax(toInteger(ary2), 0); arity = arity === undefined2 ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined2; } var data = isBindKey ? undefined2 : getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity ]; if (data) { mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined2 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == WRAP_BIND_FLAG) { var result2 = createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { result2 = createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { result2 = createPartial(func, bitmask, thisArg, partials); } else { result2 = createHybrid.apply(undefined2, newData); } var setter = data ? baseSetData : setData; return setWrapToString(setter(result2, newData), func, bitmask); } __name(createWrap, "createWrap"); function customDefaultsAssignIn(objValue, srcValue, key, object) { if (objValue === undefined2 || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) { return srcValue; } return objValue; } __name(customDefaultsAssignIn, "customDefaultsAssignIn"); function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { stack.set(srcValue, objValue); baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack); stack["delete"](srcValue); } return objValue; } __name(customDefaultsMerge, "customDefaultsMerge"); function customOmitClone(value) { return isPlainObject(value) ? undefined2 : value; } __name(customOmitClone, "customOmitClone"); function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } var arrStacked = stack.get(array); var othStacked = stack.get(other); if (arrStacked && othStacked) { return arrStacked == other && othStacked == array; } var index2 = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined2; stack.set(array, other); stack.set(other, array); while (++index2 < arrLength) { var arrValue = array[index2], othValue = other[index2]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack) : customizer(arrValue, othValue, index2, array, other, stack); } if (compared !== undefined2) { if (compared) { continue; } result2 = false; break; } if (seen) { if (!arraySome(other, function(othValue2, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result2 = false; break; } } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { result2 = false; break; } } stack["delete"](array); stack["delete"](other); return result2; } __name(equalArrays, "equalArrays"); function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: return object == other + ""; case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; stack.set(object, other); var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack["delete"](object); return result2; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } __name(equalByTag, "equalByTag"); function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index2 = objLength; while (index2--) { var key = objProps[index2]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } var objStacked = stack.get(object); var othStacked = stack.get(other); if (objStacked && othStacked) { return objStacked == other && othStacked == object; } var result2 = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index2 < objLength) { key = objProps[index2]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } if (!(compared === undefined2 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { result2 = false; break; } skipCtor || (skipCtor = key == "constructor"); } if (result2 && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { result2 = false; } } stack["delete"](object); stack["delete"](other); return result2; } __name(equalObjects, "equalObjects"); function flatRest(func) { return setToString(overRest(func, undefined2, flatten), func + ""); } __name(flatRest, "flatRest"); function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } __name(getAllKeys, "getAllKeys"); function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } __name(getAllKeysIn, "getAllKeysIn"); var getData = !metaMap ? noop : function(func) { return metaMap.get(func); }; function getFuncName(func) { var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty.call(realNames, result2) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result2; } __name(getFuncName, "getFuncName"); function getHolder(func) { var object = hasOwnProperty.call(lodash, "placeholder") ? lodash : func; return object.placeholder; } __name(getHolder, "getHolder"); function getIteratee() { var result2 = lodash.iteratee || iteratee; result2 = result2 === iteratee ? baseIteratee : result2; return arguments.length ? result2(arguments[0], arguments[1]) : result2; } __name(getIteratee, "getIteratee"); function getMapData(map3, key) { var data = map3.__data__; return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; } __name(getMapData, "getMapData"); function getMatchData(object) { var result2 = keys(object), length = result2.length; while (length--) { var key = result2[length], value = object[key]; result2[length] = [key, value, isStrictComparable(value)]; } return result2; } __name(getMatchData, "getMatchData"); function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined2; } __name(getNative, "getNative"); function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined2; var unmasked = true; } catch (e) { } var result2 = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result2; } __name(getRawTag, "getRawTag"); var getSymbols = !nativeGetSymbols ? stubArray : function(object) { if (object == null) { return []; } object = Object2(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result2 = []; while (object) { arrayPush(result2, getSymbols(object)); object = getPrototype(object); } return result2; }; var getTag = baseGetTag; if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) { getTag = /* @__PURE__ */ __name(function(value) { var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined2, ctorString = Ctor ? toSource(Ctor) : ""; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result2; }, "getTag"); } function getView(start, end, transforms) { var index2 = -1, length = transforms.length; while (++index2 < length) { var data = transforms[index2], size2 = data.size; switch (data.type) { case "drop": start += size2; break; case "dropRight": end -= size2; break; case "take": end = nativeMin(end, start + size2); break; case "takeRight": start = nativeMax(start, end - size2); break; } } return { "start": start, "end": end }; } __name(getView, "getView"); function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } __name(getWrapDetails, "getWrapDetails"); function hasPath(object, path2, hasFunc) { path2 = castPath(path2, object); var index2 = -1, length = path2.length, result2 = false; while (++index2 < length) { var key = toKey(path2[index2]); if (!(result2 = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result2 || ++index2 != length) { return result2; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } __name(hasPath, "hasPath"); function initCloneArray(array) { var length = array.length, result2 = new array.constructor(length); if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) { result2.index = array.index; result2.input = array.input; } return result2; } __name(initCloneArray, "initCloneArray"); function initCloneObject(object) { return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; } __name(initCloneObject, "initCloneObject"); function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return cloneArrayBuffer(object); case boolTag: case dateTag: return new Ctor(+object); case dataViewTag: return cloneDataView(object, isDeep); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: return new Ctor(); case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return new Ctor(); case symbolTag: return cloneSymbol(object); } } __name(initCloneByTag, "initCloneByTag"); function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex]; details = details.join(length > 2 ? ", " : " "); return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n"); } __name(insertWrapDetails, "insertWrapDetails"); function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } __name(isFlattenable, "isFlattenable"); function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); } __name(isIndex, "isIndex"); function isIterateeCall(value, index2, object) { if (!isObject(object)) { return false; } var type = typeof index2; if (type == "number" ? isArrayLike2(object) && isIndex(index2, object.length) : type == "string" && index2 in object) { return eq(object[index2], value); } return false; } __name(isIterateeCall, "isIterateeCall"); function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object); } __name(isKey, "isKey"); function isKeyable(value) { var type = typeof value; return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; } __name(isKeyable, "isKeyable"); function isLaziable(func) { var funcName = getFuncName(func), other = lodash[funcName]; if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } __name(isLaziable, "isLaziable"); function isMasked(func) { return !!maskSrcKey && maskSrcKey in func; } __name(isMasked, "isMasked"); var isMaskable = coreJsData ? isFunction : stubFalse; function isPrototype(value) { var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; return value === proto; } __name(isPrototype, "isPrototype"); function isStrictComparable(value) { return value === value && !isObject(value); } __name(isStrictComparable, "isStrictComparable"); function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined2 || key in Object2(object)); }; } __name(matchesStrictComparable, "matchesStrictComparable"); function memoizeCapped(func) { var result2 = memoize2(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result2.cache; return result2; } __name(memoizeCapped, "memoizeCapped"); function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG; if (!(isCommon || isCombo)) { return data; } if (srcBitmask & WRAP_BIND_FLAG) { data[2] = source[2]; newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; } var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : value; data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } value = source[7]; if (value) { data[7] = value; } if (srcBitmask & WRAP_ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } if (data[9] == null) { data[9] = source[9]; } data[0] = source[0]; data[1] = newBitmask; return data; } __name(mergeData, "mergeData"); function nativeKeysIn(object) { var result2 = []; if (object != null) { for (var key in Object2(object)) { result2.push(key); } } return result2; } __name(nativeKeysIn, "nativeKeysIn"); function objectToString(value) { return nativeObjectToString.call(value); } __name(objectToString, "objectToString"); function overRest(func, start, transform3) { start = nativeMax(start === undefined2 ? func.length - 1 : start, 0); return function() { var args = arguments, index2 = -1, length = nativeMax(args.length - start, 0), array = Array2(length); while (++index2 < length) { array[index2] = args[start + index2]; } index2 = -1; var otherArgs = Array2(start + 1); while (++index2 < start) { otherArgs[index2] = args[index2]; } otherArgs[start] = transform3(array); return apply2(func, this, otherArgs); }; } __name(overRest, "overRest"); function parent2(object, path2) { return path2.length < 2 ? object : baseGet(object, baseSlice(path2, 0, -1)); } __name(parent2, "parent"); function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index2 = indexes[length]; array[length] = isIndex(index2, arrLength) ? oldArray[index2] : undefined2; } return array; } __name(reorder, "reorder"); function safeGet(object, key) { if (key === "constructor" && typeof object[key] === "function") { return; } if (key == "__proto__") { return; } return object[key]; } __name(safeGet, "safeGet"); var setData = shortOut(baseSetData); var setTimeout3 = ctxSetTimeout || function(func, wait) { return root.setTimeout(func, wait); }; var setToString = shortOut(baseSetToString); function setWrapToString(wrapper, reference, bitmask) { var source = reference + ""; return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } __name(setWrapToString, "setWrapToString"); function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined2, arguments); }; } __name(shortOut, "shortOut"); function shuffleSelf(array, size2) { var index2 = -1, length = array.length, lastIndex = length - 1; size2 = size2 === undefined2 ? length : size2; while (++index2 < size2) { var rand = baseRandom(index2, lastIndex), value = array[rand]; array[rand] = array[index2]; array[index2] = value; } array.length = size2; return array; } __name(shuffleSelf, "shuffleSelf"); var stringToPath = memoizeCapped(function(string) { var result2 = []; if (string.charCodeAt(0) === 46) { result2.push(""); } string.replace(rePropName, function(match, number, quote, subString) { result2.push(quote ? subString.replace(reEscapeChar, "$1") : number || match); }); return result2; }); function toKey(value) { if (typeof value == "string" || isSymbol(value)) { return value; } var result2 = value + ""; return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2; } __name(toKey, "toKey"); function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) { } try { return func + ""; } catch (e) { } } return ""; } __name(toSource, "toSource"); function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = "_." + pair[0]; if (bitmask & pair[1] && !arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } __name(updateWrapDetails, "updateWrapDetails"); function wrapperClone(wrapper) { if (wrapper instanceof LazyWrapper) { return wrapper.clone(); } var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result2.__actions__ = copyArray(wrapper.__actions__); result2.__index__ = wrapper.__index__; result2.__values__ = wrapper.__values__; return result2; } __name(wrapperClone, "wrapperClone"); function chunk(array, size2, guard) { if (guard ? isIterateeCall(array, size2, guard) : size2 === undefined2) { size2 = 1; } else { size2 = nativeMax(toInteger(size2), 0); } var length = array == null ? 0 : array.length; if (!length || size2 < 1) { return []; } var index2 = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2)); while (index2 < length) { result2[resIndex++] = baseSlice(array, index2, index2 += size2); } return result2; } __name(chunk, "chunk"); function compact(array) { var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = []; while (++index2 < length) { var value = array[index2]; if (value) { result2[resIndex++] = value; } } return result2; } __name(compact, "compact"); function concat2() { var length = arguments.length; if (!length) { return []; } var args = Array2(length - 1), array = arguments[0], index2 = length; while (index2--) { args[index2 - 1] = arguments[index2]; } return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } __name(concat2, "concat"); var difference = baseRest(function(array, values2) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : []; }); var differenceBy = baseRest(function(array, values2) { var iteratee2 = last(values2); if (isArrayLikeObject(iteratee2)) { iteratee2 = undefined2; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : []; }); var differenceWith = baseRest(function(array, values2) { var comparator = last(values2); if (isArrayLikeObject(comparator)) { comparator = undefined2; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined2, comparator) : []; }); function drop(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = guard || n === undefined2 ? 1 : toInteger(n); return baseSlice(array, n < 0 ? 0 : n, length); } __name(drop, "drop"); function dropRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = guard || n === undefined2 ? 1 : toInteger(n); n = length - n; return baseSlice(array, 0, n < 0 ? 0 : n); } __name(dropRight, "dropRight"); function dropRightWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; } __name(dropRightWhile, "dropRightWhile"); function dropWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : []; } __name(dropWhile, "dropWhile"); function fill(array, value, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (start && typeof start != "number" && isIterateeCall(array, value, start)) { start = 0; end = length; } return baseFill(array, value, start, end); } __name(fill, "fill"); function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index2 = fromIndex == null ? 0 : toInteger(fromIndex); if (index2 < 0) { index2 = nativeMax(length + index2, 0); } return baseFindIndex(array, getIteratee(predicate, 3), index2); } __name(findIndex, "findIndex"); function findLastIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index2 = length - 1; if (fromIndex !== undefined2) { index2 = toInteger(fromIndex); index2 = fromIndex < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1); } return baseFindIndex(array, getIteratee(predicate, 3), index2, true); } __name(findLastIndex, "findLastIndex"); function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } __name(flatten, "flatten"); function flattenDeep(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, INFINITY) : []; } __name(flattenDeep, "flattenDeep"); function flattenDepth(array, depth) { var length = array == null ? 0 : array.length; if (!length) { return []; } depth = depth === undefined2 ? 1 : toInteger(depth); return baseFlatten(array, depth); } __name(flattenDepth, "flattenDepth"); function fromPairs(pairs) { var index2 = -1, length = pairs == null ? 0 : pairs.length, result2 = {}; while (++index2 < length) { var pair = pairs[index2]; result2[pair[0]] = pair[1]; } return result2; } __name(fromPairs, "fromPairs"); function head(array) { return array && array.length ? array[0] : undefined2; } __name(head, "head"); function indexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index2 = fromIndex == null ? 0 : toInteger(fromIndex); if (index2 < 0) { index2 = nativeMax(length + index2, 0); } return baseIndexOf(array, value, index2); } __name(indexOf, "indexOf"); function initial(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 0, -1) : []; } __name(initial, "initial"); var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : []; }); var intersectionBy = baseRest(function(arrays) { var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee2 === last(mapped)) { iteratee2 = undefined2; } else { mapped.pop(); } return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : []; }); var intersectionWith = baseRest(function(arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); comparator = typeof comparator == "function" ? comparator : undefined2; if (comparator) { mapped.pop(); } return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : []; }); function join4(array, separator) { return array == null ? "" : nativeJoin.call(array, separator); } __name(join4, "join"); function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined2; } __name(last, "last"); function lastIndexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index2 = length; if (fromIndex !== undefined2) { index2 = toInteger(fromIndex); index2 = index2 < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1); } return value === value ? strictLastIndexOf(array, value, index2) : baseFindIndex(array, baseIsNaN, index2, true); } __name(lastIndexOf, "lastIndexOf"); function nth(array, n) { return array && array.length ? baseNth(array, toInteger(n)) : undefined2; } __name(nth, "nth"); var pull = baseRest(pullAll); function pullAll(array, values2) { return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array; } __name(pullAll, "pullAll"); function pullAllBy(array, values2, iteratee2) { return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array; } __name(pullAllBy, "pullAllBy"); function pullAllWith(array, values2, comparator) { return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined2, comparator) : array; } __name(pullAllWith, "pullAllWith"); var pullAt = flatRest(function(array, indexes) { var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes); basePullAt(array, arrayMap(indexes, function(index2) { return isIndex(index2, length) ? +index2 : index2; }).sort(compareAscending)); return result2; }); function remove(array, predicate) { var result2 = []; if (!(array && array.length)) { return result2; } var index2 = -1, indexes = [], length = array.length; predicate = getIteratee(predicate, 3); while (++index2 < length) { var value = array[index2]; if (predicate(value, index2, array)) { result2.push(value); indexes.push(index2); } } basePullAt(array, indexes); return result2; } __name(remove, "remove"); function reverse(array) { return array == null ? array : nativeReverse.call(array); } __name(reverse, "reverse"); function slice(array, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (end && typeof end != "number" && isIterateeCall(array, start, end)) { start = 0; end = length; } else { start = start == null ? 0 : toInteger(start); end = end === undefined2 ? length : toInteger(end); } return baseSlice(array, start, end); } __name(slice, "slice"); function sortedIndex(array, value) { return baseSortedIndex(array, value); } __name(sortedIndex, "sortedIndex"); function sortedIndexBy(array, value, iteratee2) { return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2)); } __name(sortedIndexBy, "sortedIndexBy"); function sortedIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index2 = baseSortedIndex(array, value); if (index2 < length && eq(array[index2], value)) { return index2; } } return -1; } __name(sortedIndexOf, "sortedIndexOf"); function sortedLastIndex(array, value) { return baseSortedIndex(array, value, true); } __name(sortedLastIndex, "sortedLastIndex"); function sortedLastIndexBy(array, value, iteratee2) { return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true); } __name(sortedLastIndexBy, "sortedLastIndexBy"); function sortedLastIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index2 = baseSortedIndex(array, value, true) - 1; if (eq(array[index2], value)) { return index2; } } return -1; } __name(sortedLastIndexOf, "sortedLastIndexOf"); function sortedUniq(array) { return array && array.length ? baseSortedUniq(array) : []; } __name(sortedUniq, "sortedUniq"); function sortedUniqBy(array, iteratee2) { return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : []; } __name(sortedUniqBy, "sortedUniqBy"); function tail(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 1, length) : []; } __name(tail, "tail"); function take(array, n, guard) { if (!(array && array.length)) { return []; } n = guard || n === undefined2 ? 1 : toInteger(n); return baseSlice(array, 0, n < 0 ? 0 : n); } __name(take, "take"); function takeRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = guard || n === undefined2 ? 1 : toInteger(n); n = length - n; return baseSlice(array, n < 0 ? 0 : n, length); } __name(takeRight, "takeRight"); function takeRightWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; } __name(takeRightWhile, "takeRightWhile"); function takeWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : []; } __name(takeWhile, "takeWhile"); var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); var unionBy = baseRest(function(arrays) { var iteratee2 = last(arrays); if (isArrayLikeObject(iteratee2)) { iteratee2 = undefined2; } return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)); }); var unionWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == "function" ? comparator : undefined2; return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined2, comparator); }); function uniq(array) { return array && array.length ? baseUniq(array) : []; } __name(uniq, "uniq"); function uniqBy(array, iteratee2) { return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : []; } __name(uniqBy, "uniqBy"); function uniqWith(array, comparator) { comparator = typeof comparator == "function" ? comparator : undefined2; return array && array.length ? baseUniq(array, undefined2, comparator) : []; } __name(uniqWith, "uniqWith"); function unzip(array) { if (!(array && array.length)) { return []; } var length = 0; array = arrayFilter(array, function(group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length); return true; } }); return baseTimes(length, function(index2) { return arrayMap(array, baseProperty(index2)); }); } __name(unzip, "unzip"); function unzipWith(array, iteratee2) { if (!(array && array.length)) { return []; } var result2 = unzip(array); if (iteratee2 == null) { return result2; } return arrayMap(result2, function(group) { return apply2(iteratee2, undefined2, group); }); } __name(unzipWith, "unzipWith"); var without = baseRest(function(array, values2) { return isArrayLikeObject(array) ? baseDifference(array, values2) : []; }); var xor = baseRest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); var xorBy = baseRest(function(arrays) { var iteratee2 = last(arrays); if (isArrayLikeObject(iteratee2)) { iteratee2 = undefined2; } return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2)); }); var xorWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == "function" ? comparator : undefined2; return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined2, comparator); }); var zip = baseRest(unzip); function zipObject(props, values2) { return baseZipObject(props || [], values2 || [], assignValue); } __name(zipObject, "zipObject"); function zipObjectDeep(props, values2) { return baseZipObject(props || [], values2 || [], baseSet); } __name(zipObjectDeep, "zipObjectDeep"); var zipWith = baseRest(function(arrays) { var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined2; iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined2; return unzipWith(arrays, iteratee2); }); function chain(value) { var result2 = lodash(value); result2.__chain__ = true; return result2; } __name(chain, "chain"); function tap(value, interceptor) { interceptor(value); return value; } __name(tap, "tap"); function thru(value, interceptor) { return interceptor(value); } __name(thru, "thru"); var wrapperAt = flatRest(function(paths) { var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = /* @__PURE__ */ __name(function(object) { return baseAt(object, paths); }, "interceptor"); if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { return this.thru(interceptor); } value = value.slice(start, +start + (length ? 1 : 0)); value.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined2 }); return new LodashWrapper(value, this.__chain__).thru(function(array) { if (length && !array.length) { array.push(undefined2); } return array; }); }); function wrapperChain() { return chain(this); } __name(wrapperChain, "wrapperChain"); function wrapperCommit() { return new LodashWrapper(this.value(), this.__chain__); } __name(wrapperCommit, "wrapperCommit"); function wrapperNext() { if (this.__values__ === undefined2) { this.__values__ = toArray(this.value()); } var done = this.__index__ >= this.__values__.length, value = done ? undefined2 : this.__values__[this.__index__++]; return { "done": done, "value": value }; } __name(wrapperNext, "wrapperNext"); function wrapperToIterator() { return this; } __name(wrapperToIterator, "wrapperToIterator"); function wrapperPlant(value) { var result2, parent3 = this; while (parent3 instanceof baseLodash) { var clone2 = wrapperClone(parent3); clone2.__index__ = 0; clone2.__values__ = undefined2; if (result2) { previous.__wrapped__ = clone2; } else { result2 = clone2; } var previous = clone2; parent3 = parent3.__wrapped__; } previous.__wrapped__ = value; return result2; } __name(wrapperPlant, "wrapperPlant"); function wrapperReverse() { var value = this.__wrapped__; if (value instanceof LazyWrapper) { var wrapped = value; if (this.__actions__.length) { wrapped = new LazyWrapper(this); } wrapped = wrapped.reverse(); wrapped.__actions__.push({ "func": thru, "args": [reverse], "thisArg": undefined2 }); return new LodashWrapper(wrapped, this.__chain__); } return this.thru(reverse); } __name(wrapperReverse, "wrapperReverse"); function wrapperValue() { return baseWrapperValue(this.__wrapped__, this.__actions__); } __name(wrapperValue, "wrapperValue"); var countBy = createAggregator(function(result2, value, key) { if (hasOwnProperty.call(result2, key)) { ++result2[key]; } else { baseAssignValue(result2, key, 1); } }); function every2(collection, predicate, guard) { var func = isArray(collection) ? arrayEvery : baseEvery; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined2; } return func(collection, getIteratee(predicate, 3)); } __name(every2, "every"); function filter2(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, getIteratee(predicate, 3)); } __name(filter2, "filter"); var find2 = createFind(findIndex); var findLast = createFind(findLastIndex); function flatMap(collection, iteratee2) { return baseFlatten(map2(collection, iteratee2), 1); } __name(flatMap, "flatMap"); function flatMapDeep(collection, iteratee2) { return baseFlatten(map2(collection, iteratee2), INFINITY); } __name(flatMapDeep, "flatMapDeep"); function flatMapDepth(collection, iteratee2, depth) { depth = depth === undefined2 ? 1 : toInteger(depth); return baseFlatten(map2(collection, iteratee2), depth); } __name(flatMapDepth, "flatMapDepth"); function forEach(collection, iteratee2) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, getIteratee(iteratee2, 3)); } __name(forEach, "forEach"); function forEachRight(collection, iteratee2) { var func = isArray(collection) ? arrayEachRight : baseEachRight; return func(collection, getIteratee(iteratee2, 3)); } __name(forEachRight, "forEachRight"); var groupBy2 = createAggregator(function(result2, value, key) { if (hasOwnProperty.call(result2, key)) { result2[key].push(value); } else { baseAssignValue(result2, key, [value]); } }); function includes(collection, value, fromIndex, guard) { collection = isArrayLike2(collection) ? collection : values(collection); fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; } __name(includes, "includes"); var invokeMap = baseRest(function(collection, path2, args) { var index2 = -1, isFunc = typeof path2 == "function", result2 = isArrayLike2(collection) ? Array2(collection.length) : []; baseEach(collection, function(value) { result2[++index2] = isFunc ? apply2(path2, value, args) : baseInvoke(value, path2, args); }); return result2; }); var keyBy = createAggregator(function(result2, value, key) { baseAssignValue(result2, key, value); }); function map2(collection, iteratee2) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, getIteratee(iteratee2, 3)); } __name(map2, "map"); function orderBy(collection, iteratees, orders, guard) { if (collection == null) { return []; } if (!isArray(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined2 : orders; if (!isArray(orders)) { orders = orders == null ? [] : [orders]; } return baseOrderBy(collection, iteratees, orders); } __name(orderBy, "orderBy"); var partition = createAggregator(function(result2, value, key) { result2[key ? 0 : 1].push(value); }, function() { return [[], []]; }); function reduce2(collection, iteratee2, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach); } __name(reduce2, "reduce"); function reduceRight2(collection, iteratee2, accumulator) { var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight); } __name(reduceRight2, "reduceRight"); function reject2(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, negate(getIteratee(predicate, 3))); } __name(reject2, "reject"); function sample(collection) { var func = isArray(collection) ? arraySample : baseSample; return func(collection); } __name(sample, "sample"); function sampleSize(collection, n, guard) { if (guard ? isIterateeCall(collection, n, guard) : n === undefined2) { n = 1; } else { n = toInteger(n); } var func = isArray(collection) ? arraySampleSize : baseSampleSize; return func(collection, n); } __name(sampleSize, "sampleSize"); function shuffle(collection) { var func = isArray(collection) ? arrayShuffle : baseShuffle; return func(collection); } __name(shuffle, "shuffle"); function size(collection) { if (collection == null) { return 0; } if (isArrayLike2(collection)) { return isString(collection) ? stringSize(collection) : collection.length; } var tag = getTag(collection); if (tag == mapTag || tag == setTag) { return collection.size; } return baseKeys(collection).length; } __name(size, "size"); function some2(collection, predicate, guard) { var func = isArray(collection) ? arraySome : baseSome; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined2; } return func(collection, getIteratee(predicate, 3)); } __name(some2, "some"); var sortBy2 = baseRest(function(collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); var now = ctxNow || function() { return root.Date.now(); }; function after(n, func) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n < 1) { return func.apply(this, arguments); } }; } __name(after, "after"); function ary(func, n, guard) { n = guard ? undefined2 : n; n = func && n == null ? func.length : n; return createWrap(func, WRAP_ARY_FLAG, undefined2, undefined2, undefined2, undefined2, n); } __name(ary, "ary"); function before(n, func) { var result2; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n > 0) { result2 = func.apply(this, arguments); } if (n <= 1) { func = undefined2; } return result2; }; } __name(before, "before"); var bind = baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(func, bitmask, thisArg, partials, holders); }); var bindKey = baseRest(function(object, key, partials) { var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(key, bitmask, object, partials, holders); }); function curry(func, arity, guard) { arity = guard ? undefined2 : arity; var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity); result2.placeholder = curry.placeholder; return result2; } __name(curry, "curry"); function curryRight(func, arity, guard) { arity = guard ? undefined2 : arity; var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity); result2.placeholder = curryRight.placeholder; return result2; } __name(curryRight, "curryRight"); function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; maxing = "maxWait" in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = "trailing" in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined2; lastInvokeTime = time; result2 = func.apply(thisArg, args); return result2; } __name(invokeFunc, "invokeFunc"); function leadingEdge(time) { lastInvokeTime = time; timerId = setTimeout3(timerExpired, wait); return leading ? invokeFunc(time) : result2; } __name(leadingEdge, "leadingEdge"); function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } __name(remainingWait, "remainingWait"); function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; return lastCallTime === undefined2 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; } __name(shouldInvoke, "shouldInvoke"); function timerExpired() { var time = now(); if (shouldInvoke(time)) { return trailingEdge(time); } timerId = setTimeout3(timerExpired, remainingWait(time)); } __name(timerExpired, "timerExpired"); function trailingEdge(time) { timerId = undefined2; if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined2; return result2; } __name(trailingEdge, "trailingEdge"); function cancel() { if (timerId !== undefined2) { clearTimeout3(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined2; } __name(cancel, "cancel"); function flush() { return timerId === undefined2 ? result2 : trailingEdge(now()); } __name(flush, "flush"); function debounced() { var time = now(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined2) { return leadingEdge(lastCallTime); } if (maxing) { clearTimeout3(timerId); timerId = setTimeout3(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined2) { timerId = setTimeout3(timerExpired, wait); } return result2; } __name(debounced, "debounced"); debounced.cancel = cancel; debounced.flush = flush; return debounced; } __name(debounce, "debounce"); var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); function flip(func) { return createWrap(func, WRAP_FLIP_FLAG); } __name(flip, "flip"); function memoize2(func, resolver) { if (typeof func != "function" || resolver != null && typeof resolver != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } var memoized = /* @__PURE__ */ __name(function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result2 = func.apply(this, args); memoized.cache = cache.set(key, result2) || cache; return result2; }, "memoized"); memoized.cache = new (memoize2.Cache || MapCache)(); return memoized; } __name(memoize2, "memoize"); memoize2.Cache = MapCache; function negate(predicate) { if (typeof predicate != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } return function() { var args = arguments; switch (args.length) { case 0: return !predicate.call(this); case 1: return !predicate.call(this, args[0]); case 2: return !predicate.call(this, args[0], args[1]); case 3: return !predicate.call(this, args[0], args[1], args[2]); } return !predicate.apply(this, args); }; } __name(negate, "negate"); function once2(func) { return before(2, func); } __name(once2, "once"); var overArgs = castRest(function(func, transforms) { transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); var funcsLength = transforms.length; return baseRest(function(args) { var index2 = -1, length = nativeMin(args.length, funcsLength); while (++index2 < length) { args[index2] = transforms[index2].call(this, args[index2]); } return apply2(func, this, args); }); }); var partial = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partial)); return createWrap(func, WRAP_PARTIAL_FLAG, undefined2, partials, holders); }); var partialRight = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined2, partials, holders); }); var rearg = flatRest(function(func, indexes) { return createWrap(func, WRAP_REARG_FLAG, undefined2, undefined2, undefined2, indexes); }); function rest(func, start) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } start = start === undefined2 ? start : toInteger(start); return baseRest(func, start); } __name(rest, "rest"); function spread(func, start) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } start = start == null ? 0 : nativeMax(toInteger(start), 0); return baseRest(function(args) { var array = args[start], otherArgs = castSlice(args, 0, start); if (array) { arrayPush(otherArgs, array); } return apply2(func, this, otherArgs); }); } __name(spread, "spread"); function throttle(func, wait, options) { var leading = true, trailing = true; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } if (isObject(options)) { leading = "leading" in options ? !!options.leading : leading; trailing = "trailing" in options ? !!options.trailing : trailing; } return debounce(func, wait, { "leading": leading, "maxWait": wait, "trailing": trailing }); } __name(throttle, "throttle"); function unary(func) { return ary(func, 1); } __name(unary, "unary"); function wrap2(value, wrapper) { return partial(castFunction(wrapper), value); } __name(wrap2, "wrap"); function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray(value) ? value : [value]; } __name(castArray, "castArray"); function clone(value) { return baseClone(value, CLONE_SYMBOLS_FLAG); } __name(clone, "clone"); function cloneWith(value, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } __name(cloneWith, "cloneWith"); function cloneDeep2(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } __name(cloneDeep2, "cloneDeep"); function cloneDeepWith(value, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } __name(cloneDeepWith, "cloneDeepWith"); function conformsTo(object, source) { return source == null || baseConformsTo(object, source, keys(source)); } __name(conformsTo, "conformsTo"); function eq(value, other) { return value === other || value !== value && other !== other; } __name(eq, "eq"); var gt = createRelationalOperation(baseGt); var gte = createRelationalOperation(function(value, other) { return value >= other; }); var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); }; var isArray = Array2.isArray; var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; function isArrayLike2(value) { return value != null && isLength(value.length) && !isFunction(value); } __name(isArrayLike2, "isArrayLike"); function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike2(value); } __name(isArrayLikeObject, "isArrayLikeObject"); function isBoolean(value) { return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag; } __name(isBoolean, "isBoolean"); var isBuffer = nativeIsBuffer || stubFalse; var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; function isElement(value) { return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); } __name(isElement, "isElement"); function isEmpty(value) { if (value == null) { return true; } if (isArrayLike2(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } return true; } __name(isEmpty, "isEmpty"); function isEqual2(value, other) { return baseIsEqual(value, other); } __name(isEqual2, "isEqual"); function isEqualWith(value, other, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; var result2 = customizer ? customizer(value, other) : undefined2; return result2 === undefined2 ? baseIsEqual(value, other, undefined2, customizer) : !!result2; } __name(isEqualWith, "isEqualWith"); function isError(value) { if (!isObjectLike(value)) { return false; } var tag = baseGetTag(value); return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value); } __name(isError, "isError"); function isFinite2(value) { return typeof value == "number" && nativeIsFinite(value); } __name(isFinite2, "isFinite"); function isFunction(value) { if (!isObject(value)) { return false; } var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } __name(isFunction, "isFunction"); function isInteger(value) { return typeof value == "number" && value == toInteger(value); } __name(isInteger, "isInteger"); function isLength(value) { return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } __name(isLength, "isLength"); function isObject(value) { var type = typeof value; return value != null && (type == "object" || type == "function"); } __name(isObject, "isObject"); function isObjectLike(value) { return value != null && typeof value == "object"; } __name(isObjectLike, "isObjectLike"); var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; function isMatch(object, source) { return object === source || baseIsMatch(object, source, getMatchData(source)); } __name(isMatch, "isMatch"); function isMatchWith(object, source, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return baseIsMatch(object, source, getMatchData(source), customizer); } __name(isMatchWith, "isMatchWith"); function isNaN2(value) { return isNumber(value) && value != +value; } __name(isNaN2, "isNaN"); function isNative(value) { if (isMaskable(value)) { throw new Error2(CORE_ERROR_TEXT); } return baseIsNative(value); } __name(isNative, "isNative"); function isNull(value) { return value === null; } __name(isNull, "isNull"); function isNil(value) { return value == null; } __name(isNil, "isNil"); function isNumber(value) { return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag; } __name(isNumber, "isNumber"); function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } __name(isPlainObject, "isPlainObject"); var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; function isSafeInteger(value) { return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } __name(isSafeInteger, "isSafeInteger"); var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; function isString(value) { return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag; } __name(isString, "isString"); function isSymbol(value) { return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag; } __name(isSymbol, "isSymbol"); var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; function isUndefined(value) { return value === undefined2; } __name(isUndefined, "isUndefined"); function isWeakMap(value) { return isObjectLike(value) && getTag(value) == weakMapTag; } __name(isWeakMap, "isWeakMap"); function isWeakSet(value) { return isObjectLike(value) && baseGetTag(value) == weakSetTag; } __name(isWeakSet, "isWeakSet"); var lt = createRelationalOperation(baseLt); var lte = createRelationalOperation(function(value, other) { return value <= other; }); function toArray(value) { if (!value) { return []; } if (isArrayLike2(value)) { return isString(value) ? stringToArray(value) : copyArray(value); } if (symIterator && value[symIterator]) { return iteratorToArray(value[symIterator]()); } var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values; return func(value); } __name(toArray, "toArray"); function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = value < 0 ? -1 : 1; return sign * MAX_INTEGER; } return value === value ? value : 0; } __name(toFinite, "toFinite"); function toInteger(value) { var result2 = toFinite(value), remainder = result2 % 1; return result2 === result2 ? remainder ? result2 - remainder : result2 : 0; } __name(toInteger, "toInteger"); function toLength(value) { return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; } __name(toLength, "toLength"); function toNumber(value) { if (typeof value == "number") { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == "function" ? value.valueOf() : value; value = isObject(other) ? other + "" : other; } if (typeof value != "string") { return value === 0 ? value : +value; } value = baseTrim(value); var isBinary = reIsBinary.test(value); return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; } __name(toNumber, "toNumber"); function toPlainObject(value) { return copyObject(value, keysIn(value)); } __name(toPlainObject, "toPlainObject"); function toSafeInteger(value) { return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0; } __name(toSafeInteger, "toSafeInteger"); function toString(value) { return value == null ? "" : baseToString(value); } __name(toString, "toString"); var assign = createAssigner(function(object, source) { if (isPrototype(source) || isArrayLike2(source)) { copyObject(source, keys(source), object); return; } for (var key in source) { if (hasOwnProperty.call(source, key)) { assignValue(object, key, source[key]); } } }); var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); }); var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); var assignWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keys(source), object, customizer); }); var at = flatRest(baseAt); function create(prototype, properties) { var result2 = baseCreate(prototype); return properties == null ? result2 : baseAssign(result2, properties); } __name(create, "create"); var defaults = baseRest(function(object, sources) { object = Object2(object); var index2 = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined2; if (guard && isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index2 < length) { var source = sources[index2]; var props = keysIn(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === undefined2 || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) { object[key] = source[key]; } } } return object; }); var defaultsDeep = baseRest(function(args) { args.push(undefined2, customDefaultsMerge); return apply2(mergeWith, undefined2, args); }); function findKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); } __name(findKey, "findKey"); function findLastKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); } __name(findLastKey, "findLastKey"); function forIn(object, iteratee2) { return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn); } __name(forIn, "forIn"); function forInRight(object, iteratee2) { return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn); } __name(forInRight, "forInRight"); function forOwn(object, iteratee2) { return object && baseForOwn(object, getIteratee(iteratee2, 3)); } __name(forOwn, "forOwn"); function forOwnRight(object, iteratee2) { return object && baseForOwnRight(object, getIteratee(iteratee2, 3)); } __name(forOwnRight, "forOwnRight"); function functions(object) { return object == null ? [] : baseFunctions(object, keys(object)); } __name(functions, "functions"); function functionsIn(object) { return object == null ? [] : baseFunctions(object, keysIn(object)); } __name(functionsIn, "functionsIn"); function get(object, path2, defaultValue) { var result2 = object == null ? undefined2 : baseGet(object, path2); return result2 === undefined2 ? defaultValue : result2; } __name(get, "get"); function has(object, path2) { return object != null && hasPath(object, path2, baseHas); } __name(has, "has"); function hasIn(object, path2) { return object != null && hasPath(object, path2, baseHasIn); } __name(hasIn, "hasIn"); var invert = createInverter(function(result2, value, key) { if (value != null && typeof value.toString != "function") { value = nativeObjectToString.call(value); } result2[value] = key; }, constant2(identity)); var invertBy = createInverter(function(result2, value, key) { if (value != null && typeof value.toString != "function") { value = nativeObjectToString.call(value); } if (hasOwnProperty.call(result2, value)) { result2[value].push(key); } else { result2[value] = [key]; } }, getIteratee); var invoke = baseRest(baseInvoke); function keys(object) { return isArrayLike2(object) ? arrayLikeKeys(object) : baseKeys(object); } __name(keys, "keys"); function keysIn(object) { return isArrayLike2(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } __name(keysIn, "keysIn"); function mapKeys(object, iteratee2) { var result2 = {}; iteratee2 = getIteratee(iteratee2, 3); baseForOwn(object, function(value, key, object2) { baseAssignValue(result2, iteratee2(value, key, object2), value); }); return result2; } __name(mapKeys, "mapKeys"); function mapValues2(object, iteratee2) { var result2 = {}; iteratee2 = getIteratee(iteratee2, 3); baseForOwn(object, function(value, key, object2) { baseAssignValue(result2, key, iteratee2(value, key, object2)); }); return result2; } __name(mapValues2, "mapValues"); var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); var omit = flatRest(function(object, paths) { var result2 = {}; if (object == null) { return result2; } var isDeep = false; paths = arrayMap(paths, function(path2) { path2 = castPath(path2, object); isDeep || (isDeep = path2.length > 1); return path2; }); copyObject(object, getAllKeysIn(object), result2); if (isDeep) { result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } var length = paths.length; while (length--) { baseUnset(result2, paths[length]); } return result2; }); function omitBy(object, predicate) { return pickBy(object, negate(getIteratee(predicate))); } __name(omitBy, "omitBy"); var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); function pickBy(object, predicate) { if (object == null) { return {}; } var props = arrayMap(getAllKeysIn(object), function(prop) { return [prop]; }); predicate = getIteratee(predicate); return basePickBy(object, props, function(value, path2) { return predicate(value, path2[0]); }); } __name(pickBy, "pickBy"); function result(object, path2, defaultValue) { path2 = castPath(path2, object); var index2 = -1, length = path2.length; if (!length) { length = 1; object = undefined2; } while (++index2 < length) { var value = object == null ? undefined2 : object[toKey(path2[index2])]; if (value === undefined2) { index2 = length; value = defaultValue; } object = isFunction(value) ? value.call(object) : value; } return object; } __name(result, "result"); function set(object, path2, value) { return object == null ? object : baseSet(object, path2, value); } __name(set, "set"); function setWith(object, path2, value, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return object == null ? object : baseSet(object, path2, value, customizer); } __name(setWith, "setWith"); var toPairs = createToPairs(keys); var toPairsIn = createToPairs(keysIn); function transform2(object, iteratee2, accumulator) { var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee2 = getIteratee(iteratee2, 4); if (accumulator == null) { var Ctor = object && object.constructor; if (isArrLike) { accumulator = isArr ? new Ctor() : []; } else if (isObject(object)) { accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } else { accumulator = {}; } } (isArrLike ? arrayEach : baseForOwn)(object, function(value, index2, object2) { return iteratee2(accumulator, value, index2, object2); }); return accumulator; } __name(transform2, "transform"); function unset(object, path2) { return object == null ? true : baseUnset(object, path2); } __name(unset, "unset"); function update(object, path2, updater) { return object == null ? object : baseUpdate(object, path2, castFunction(updater)); } __name(update, "update"); function updateWith(object, path2, updater, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return object == null ? object : baseUpdate(object, path2, castFunction(updater), customizer); } __name(updateWith, "updateWith"); function values(object) { return object == null ? [] : baseValues(object, keys(object)); } __name(values, "values"); function valuesIn(object) { return object == null ? [] : baseValues(object, keysIn(object)); } __name(valuesIn, "valuesIn"); function clamp(number, lower, upper) { if (upper === undefined2) { upper = lower; lower = undefined2; } if (upper !== undefined2) { upper = toNumber(upper); upper = upper === upper ? upper : 0; } if (lower !== undefined2) { lower = toNumber(lower); lower = lower === lower ? lower : 0; } return baseClamp(toNumber(number), lower, upper); } __name(clamp, "clamp"); function inRange(number, start, end) { start = toFinite(start); if (end === undefined2) { end = start; start = 0; } else { end = toFinite(end); } number = toNumber(number); return baseInRange(number, start, end); } __name(inRange, "inRange"); function random(lower, upper, floating) { if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) { upper = floating = undefined2; } if (floating === undefined2) { if (typeof upper == "boolean") { floating = upper; upper = undefined2; } else if (typeof lower == "boolean") { floating = lower; lower = undefined2; } } if (lower === undefined2 && upper === undefined2) { lower = 0; upper = 1; } else { lower = toFinite(lower); if (upper === undefined2) { upper = lower; lower = 0; } else { upper = toFinite(upper); } } if (lower > upper) { var temp = lower; lower = upper; upper = temp; } if (floating || lower % 1 || upper % 1) { var rand = nativeRandom(); return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper); } return baseRandom(lower, upper); } __name(random, "random"); var camelCase = createCompounder(function(result2, word, index2) { word = word.toLowerCase(); return result2 + (index2 ? capitalize(word) : word); }); function capitalize(string) { return upperFirst(toString(string).toLowerCase()); } __name(capitalize, "capitalize"); function deburr(string) { string = toString(string); return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ""); } __name(deburr, "deburr"); function endsWith(string, target, position) { string = toString(string); target = baseToString(target); var length = string.length; position = position === undefined2 ? length : baseClamp(toInteger(position), 0, length); var end = position; position -= target.length; return position >= 0 && string.slice(position, end) == target; } __name(endsWith, "endsWith"); function escape(string) { string = toString(string); return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } __name(escape, "escape"); function escapeRegExp(string) { string = toString(string); return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string; } __name(escapeRegExp, "escapeRegExp"); var kebabCase = createCompounder(function(result2, word, index2) { return result2 + (index2 ? "-" : "") + word.toLowerCase(); }); var lowerCase = createCompounder(function(result2, word, index2) { return result2 + (index2 ? " " : "") + word.toLowerCase(); }); var lowerFirst = createCaseFirst("toLowerCase"); function pad(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; if (!length || strLength >= length) { return string; } var mid = (length - strLength) / 2; return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars); } __name(pad, "pad"); function padEnd(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return length && strLength < length ? string + createPadding(length - strLength, chars) : string; } __name(padEnd, "padEnd"); function padStart(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return length && strLength < length ? createPadding(length - strLength, chars) + string : string; } __name(padStart, "padStart"); function parseInt2(string, radix, guard) { if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0); } __name(parseInt2, "parseInt"); function repeat(string, n, guard) { if (guard ? isIterateeCall(string, n, guard) : n === undefined2) { n = 1; } else { n = toInteger(n); } return baseRepeat(toString(string), n); } __name(repeat, "repeat"); function replace() { var args = arguments, string = toString(args[0]); return args.length < 3 ? string : string.replace(args[1], args[2]); } __name(replace, "replace"); var snakeCase = createCompounder(function(result2, word, index2) { return result2 + (index2 ? "_" : "") + word.toLowerCase(); }); function split(string, separator, limit) { if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) { separator = limit = undefined2; } limit = limit === undefined2 ? MAX_ARRAY_LENGTH : limit >>> 0; if (!limit) { return []; } string = toString(string); if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) { separator = baseToString(separator); if (!separator && hasUnicode(string)) { return castSlice(stringToArray(string), 0, limit); } } return string.split(separator, limit); } __name(split, "split"); var startCase = createCompounder(function(result2, word, index2) { return result2 + (index2 ? " " : "") + upperFirst(word); }); function startsWith(string, target, position) { string = toString(string); position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); target = baseToString(target); return string.slice(position, position + target.length) == target; } __name(startsWith, "startsWith"); function template(string, options, guard) { var settings2 = lodash.templateSettings; if (guard && isIterateeCall(string, options, guard)) { options = undefined2; } string = toString(string); options = assignInWith({}, options, settings2, customDefaultsAssignIn); var imports = assignInWith({}, options.imports, settings2.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys); var isEscaping, isEvaluating, index2 = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '"; var reDelimiters = RegExp2((options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$", "g"); var sourceURL = "//# sourceURL=" + (hasOwnProperty.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n"; string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { interpolateValue || (interpolateValue = esTemplateValue); source += string.slice(index2, offset).replace(reUnescapedString, escapeStringChar); if (escapeValue) { isEscaping = true; source += "' +\n__e(" + escapeValue + ") +\n'"; } if (evaluateValue) { isEvaluating = true; source += "';\n" + evaluateValue + ";\n__p += '"; } if (interpolateValue) { source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; } index2 = offset + match.length; return match; }); source += "';\n"; var variable = hasOwnProperty.call(options, "variable") && options.variable; if (!variable) { source = "with (obj) {\n" + source + "\n}\n"; } else if (reForbiddenIdentifierChars.test(variable)) { throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT); } source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;"); source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}"; var result2 = attempt(function() { return Function2(importsKeys, sourceURL + "return " + source).apply(undefined2, importsValues); }); result2.source = source; if (isError(result2)) { throw result2; } return result2; } __name(template, "template"); function toLower(value) { return toString(value).toLowerCase(); } __name(toLower, "toLower"); function toUpper(value) { return toString(value).toUpperCase(); } __name(toUpper, "toUpper"); function trim(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined2)) { return baseTrim(string); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1; return castSlice(strSymbols, start, end).join(""); } __name(trim, "trim"); function trimEnd(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined2)) { return string.slice(0, trimmedEndIndex(string) + 1); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; return castSlice(strSymbols, 0, end).join(""); } __name(trimEnd, "trimEnd"); function trimStart(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined2)) { return string.replace(reTrimStart, ""); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars)); return castSlice(strSymbols, start).join(""); } __name(trimStart, "trimStart"); function truncate(string, options) { var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION; if (isObject(options)) { var separator = "separator" in options ? options.separator : separator; length = "length" in options ? toInteger(options.length) : length; omission = "omission" in options ? baseToString(options.omission) : omission; } string = toString(string); var strLength = string.length; if (hasUnicode(string)) { var strSymbols = stringToArray(string); strLength = strSymbols.length; } if (length >= strLength) { return string; } var end = length - stringSize(omission); if (end < 1) { return omission; } var result2 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end); if (separator === undefined2) { return result2 + omission; } if (strSymbols) { end += result2.length - end; } if (isRegExp(separator)) { if (string.slice(end).search(separator)) { var match, substring = result2; if (!separator.global) { separator = RegExp2(separator.source, toString(reFlags.exec(separator)) + "g"); } separator.lastIndex = 0; while (match = separator.exec(substring)) { var newEnd = match.index; } result2 = result2.slice(0, newEnd === undefined2 ? end : newEnd); } } else if (string.indexOf(baseToString(separator), end) != end) { var index2 = result2.lastIndexOf(separator); if (index2 > -1) { result2 = result2.slice(0, index2); } } return result2 + omission; } __name(truncate, "truncate"); function unescape(string) { string = toString(string); return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string; } __name(unescape, "unescape"); var upperCase = createCompounder(function(result2, word, index2) { return result2 + (index2 ? " " : "") + word.toUpperCase(); }); var upperFirst = createCaseFirst("toUpperCase"); function words(string, pattern, guard) { string = toString(string); pattern = guard ? undefined2 : pattern; if (pattern === undefined2) { return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); } return string.match(pattern) || []; } __name(words, "words"); var attempt = baseRest(function(func, args) { try { return apply2(func, undefined2, args); } catch (e) { return isError(e) ? e : new Error2(e); } }); var bindAll = flatRest(function(object, methodNames) { arrayEach(methodNames, function(key) { key = toKey(key); baseAssignValue(object, key, bind(object[key], object)); }); return object; }); function cond(pairs) { var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee(); pairs = !length ? [] : arrayMap(pairs, function(pair) { if (typeof pair[1] != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } return [toIteratee(pair[0]), pair[1]]; }); return baseRest(function(args) { var index2 = -1; while (++index2 < length) { var pair = pairs[index2]; if (apply2(pair[0], this, args)) { return apply2(pair[1], this, args); } } }); } __name(cond, "cond"); function conforms(source) { return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); } __name(conforms, "conforms"); function constant2(value) { return function() { return value; }; } __name(constant2, "constant"); function defaultTo(value, defaultValue) { return value == null || value !== value ? defaultValue : value; } __name(defaultTo, "defaultTo"); var flow = createFlow(); var flowRight = createFlow(true); function identity(value) { return value; } __name(identity, "identity"); function iteratee(func) { return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG)); } __name(iteratee, "iteratee"); function matches(source) { return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); } __name(matches, "matches"); function matchesProperty(path2, srcValue) { return baseMatchesProperty(path2, baseClone(srcValue, CLONE_DEEP_FLAG)); } __name(matchesProperty, "matchesProperty"); var method = baseRest(function(path2, args) { return function(object) { return baseInvoke(object, path2, args); }; }); var methodOf = baseRest(function(object, args) { return function(path2) { return baseInvoke(object, path2, args); }; }); function mixin(object, source, options) { var props = keys(source), methodNames = baseFunctions(source, props); if (options == null && !(isObject(source) && (methodNames.length || !props.length))) { options = source; source = object; object = this; methodNames = baseFunctions(source, keys(source)); } var chain2 = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object); arrayEach(methodNames, function(methodName) { var func = source[methodName]; object[methodName] = func; if (isFunc) { object.prototype[methodName] = function() { var chainAll = this.__chain__; if (chain2 || chainAll) { var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__); actions.push({ "func": func, "args": arguments, "thisArg": object }); result2.__chain__ = chainAll; return result2; } return func.apply(object, arrayPush([this.value()], arguments)); }; } }); return object; } __name(mixin, "mixin"); function noConflict() { if (root._ === this) { root._ = oldDash; } return this; } __name(noConflict, "noConflict"); function noop() { } __name(noop, "noop"); function nthArg(n) { n = toInteger(n); return baseRest(function(args) { return baseNth(args, n); }); } __name(nthArg, "nthArg"); var over = createOver(arrayMap); var overEvery = createOver(arrayEvery); var overSome = createOver(arraySome); function property(path2) { return isKey(path2) ? baseProperty(toKey(path2)) : basePropertyDeep(path2); } __name(property, "property"); function propertyOf(object) { return function(path2) { return object == null ? undefined2 : baseGet(object, path2); }; } __name(propertyOf, "propertyOf"); var range2 = createRange(); var rangeRight = createRange(true); function stubArray() { return []; } __name(stubArray, "stubArray"); function stubFalse() { return false; } __name(stubFalse, "stubFalse"); function stubObject() { return {}; } __name(stubObject, "stubObject"); function stubString() { return ""; } __name(stubString, "stubString"); function stubTrue() { return true; } __name(stubTrue, "stubTrue"); function times2(n, iteratee2) { n = toInteger(n); if (n < 1 || n > MAX_SAFE_INTEGER) { return []; } var index2 = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH); iteratee2 = getIteratee(iteratee2); n -= MAX_ARRAY_LENGTH; var result2 = baseTimes(length, iteratee2); while (++index2 < n) { iteratee2(index2); } return result2; } __name(times2, "times"); function toPath2(value) { if (isArray(value)) { return arrayMap(value, toKey); } return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); } __name(toPath2, "toPath"); function uniqueId(prefix) { var id = ++idCounter; return toString(prefix) + id; } __name(uniqueId, "uniqueId"); var add = createMathOperation(function(augend, addend) { return augend + addend; }, 0); var ceil = createRound("ceil"); var divide = createMathOperation(function(dividend, divisor) { return dividend / divisor; }, 1); var floor = createRound("floor"); function max(array) { return array && array.length ? baseExtremum(array, identity, baseGt) : undefined2; } __name(max, "max"); function maxBy(array, iteratee2) { return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined2; } __name(maxBy, "maxBy"); function mean(array) { return baseMean(array, identity); } __name(mean, "mean"); function meanBy(array, iteratee2) { return baseMean(array, getIteratee(iteratee2, 2)); } __name(meanBy, "meanBy"); function min(array) { return array && array.length ? baseExtremum(array, identity, baseLt) : undefined2; } __name(min, "min"); function minBy(array, iteratee2) { return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined2; } __name(minBy, "minBy"); var multiply = createMathOperation(function(multiplier, multiplicand) { return multiplier * multiplicand; }, 1); var round = createRound("round"); var subtract = createMathOperation(function(minuend, subtrahend) { return minuend - subtrahend; }, 0); function sum(array) { return array && array.length ? baseSum(array, identity) : 0; } __name(sum, "sum"); function sumBy(array, iteratee2) { return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0; } __name(sumBy, "sumBy"); lodash.after = after; lodash.ary = ary; lodash.assign = assign; lodash.assignIn = assignIn; lodash.assignInWith = assignInWith; lodash.assignWith = assignWith; lodash.at = at; lodash.before = before; lodash.bind = bind; lodash.bindAll = bindAll; lodash.bindKey = bindKey; lodash.castArray = castArray; lodash.chain = chain; lodash.chunk = chunk; lodash.compact = compact; lodash.concat = concat2; lodash.cond = cond; lodash.conforms = conforms; lodash.constant = constant2; lodash.countBy = countBy; lodash.create = create; lodash.curry = curry; lodash.curryRight = curryRight; lodash.debounce = debounce; lodash.defaults = defaults; lodash.defaultsDeep = defaultsDeep; lodash.defer = defer; lodash.delay = delay; lodash.difference = difference; lodash.differenceBy = differenceBy; lodash.differenceWith = differenceWith; lodash.drop = drop; lodash.dropRight = dropRight; lodash.dropRightWhile = dropRightWhile; lodash.dropWhile = dropWhile; lodash.fill = fill; lodash.filter = filter2; lodash.flatMap = flatMap; lodash.flatMapDeep = flatMapDeep; lodash.flatMapDepth = flatMapDepth; lodash.flatten = flatten; lodash.flattenDeep = flattenDeep; lodash.flattenDepth = flattenDepth; lodash.flip = flip; lodash.flow = flow; lodash.flowRight = flowRight; lodash.fromPairs = fromPairs; lodash.functions = functions; lodash.functionsIn = functionsIn; lodash.groupBy = groupBy2; lodash.initial = initial; lodash.intersection = intersection; lodash.intersectionBy = intersectionBy; lodash.intersectionWith = intersectionWith; lodash.invert = invert; lodash.invertBy = invertBy; lodash.invokeMap = invokeMap; lodash.iteratee = iteratee; lodash.keyBy = keyBy; lodash.keys = keys; lodash.keysIn = keysIn; lodash.map = map2; lodash.mapKeys = mapKeys; lodash.mapValues = mapValues2; lodash.matches = matches; lodash.matchesProperty = matchesProperty; lodash.memoize = memoize2; lodash.merge = merge; lodash.mergeWith = mergeWith; lodash.method = method; lodash.methodOf = methodOf; lodash.mixin = mixin; lodash.negate = negate; lodash.nthArg = nthArg; lodash.omit = omit; lodash.omitBy = omitBy; lodash.once = once2; lodash.orderBy = orderBy; lodash.over = over; lodash.overArgs = overArgs; lodash.overEvery = overEvery; lodash.overSome = overSome; lodash.partial = partial; lodash.partialRight = partialRight; lodash.partition = partition; lodash.pick = pick; lodash.pickBy = pickBy; lodash.property = property; lodash.propertyOf = propertyOf; lodash.pull = pull; lodash.pullAll = pullAll; lodash.pullAllBy = pullAllBy; lodash.pullAllWith = pullAllWith; lodash.pullAt = pullAt; lodash.range = range2; lodash.rangeRight = rangeRight; lodash.rearg = rearg; lodash.reject = reject2; lodash.remove = remove; lodash.rest = rest; lodash.reverse = reverse; lodash.sampleSize = sampleSize; lodash.set = set; lodash.setWith = setWith; lodash.shuffle = shuffle; lodash.slice = slice; lodash.sortBy = sortBy2; lodash.sortedUniq = sortedUniq; lodash.sortedUniqBy = sortedUniqBy; lodash.split = split; lodash.spread = spread; lodash.tail = tail; lodash.take = take; lodash.takeRight = takeRight; lodash.takeRightWhile = takeRightWhile; lodash.takeWhile = takeWhile; lodash.tap = tap; lodash.throttle = throttle; lodash.thru = thru; lodash.toArray = toArray; lodash.toPairs = toPairs; lodash.toPairsIn = toPairsIn; lodash.toPath = toPath2; lodash.toPlainObject = toPlainObject; lodash.transform = transform2; lodash.unary = unary; lodash.union = union; lodash.unionBy = unionBy; lodash.unionWith = unionWith; lodash.uniq = uniq; lodash.uniqBy = uniqBy; lodash.uniqWith = uniqWith; lodash.unset = unset; lodash.unzip = unzip; lodash.unzipWith = unzipWith; lodash.update = update; lodash.updateWith = updateWith; lodash.values = values; lodash.valuesIn = valuesIn; lodash.without = without; lodash.words = words; lodash.wrap = wrap2; lodash.xor = xor; lodash.xorBy = xorBy; lodash.xorWith = xorWith; lodash.zip = zip; lodash.zipObject = zipObject; lodash.zipObjectDeep = zipObjectDeep; lodash.zipWith = zipWith; lodash.entries = toPairs; lodash.entriesIn = toPairsIn; lodash.extend = assignIn; lodash.extendWith = assignInWith; mixin(lodash, lodash); lodash.add = add; lodash.attempt = attempt; lodash.camelCase = camelCase; lodash.capitalize = capitalize; lodash.ceil = ceil; lodash.clamp = clamp; lodash.clone = clone; lodash.cloneDeep = cloneDeep2; lodash.cloneDeepWith = cloneDeepWith; lodash.cloneWith = cloneWith; lodash.conformsTo = conformsTo; lodash.deburr = deburr; lodash.defaultTo = defaultTo; lodash.divide = divide; lodash.endsWith = endsWith; lodash.eq = eq; lodash.escape = escape; lodash.escapeRegExp = escapeRegExp; lodash.every = every2; lodash.find = find2; lodash.findIndex = findIndex; lodash.findKey = findKey; lodash.findLast = findLast; lodash.findLastIndex = findLastIndex; lodash.findLastKey = findLastKey; lodash.floor = floor; lodash.forEach = forEach; lodash.forEachRight = forEachRight; lodash.forIn = forIn; lodash.forInRight = forInRight; lodash.forOwn = forOwn; lodash.forOwnRight = forOwnRight; lodash.get = get; lodash.gt = gt; lodash.gte = gte; lodash.has = has; lodash.hasIn = hasIn; lodash.head = head; lodash.identity = identity; lodash.includes = includes; lodash.indexOf = indexOf; lodash.inRange = inRange; lodash.invoke = invoke; lodash.isArguments = isArguments; lodash.isArray = isArray; lodash.isArrayBuffer = isArrayBuffer; lodash.isArrayLike = isArrayLike2; lodash.isArrayLikeObject = isArrayLikeObject; lodash.isBoolean = isBoolean; lodash.isBuffer = isBuffer; lodash.isDate = isDate; lodash.isElement = isElement; lodash.isEmpty = isEmpty; lodash.isEqual = isEqual2; lodash.isEqualWith = isEqualWith; lodash.isError = isError; lodash.isFinite = isFinite2; lodash.isFunction = isFunction; lodash.isInteger = isInteger; lodash.isLength = isLength; lodash.isMap = isMap; lodash.isMatch = isMatch; lodash.isMatchWith = isMatchWith; lodash.isNaN = isNaN2; lodash.isNative = isNative; lodash.isNil = isNil; lodash.isNull = isNull; lodash.isNumber = isNumber; lodash.isObject = isObject; lodash.isObjectLike = isObjectLike; lodash.isPlainObject = isPlainObject; lodash.isRegExp = isRegExp; lodash.isSafeInteger = isSafeInteger; lodash.isSet = isSet; lodash.isString = isString; lodash.isSymbol = isSymbol; lodash.isTypedArray = isTypedArray; lodash.isUndefined = isUndefined; lodash.isWeakMap = isWeakMap; lodash.isWeakSet = isWeakSet; lodash.join = join4; lodash.kebabCase = kebabCase; lodash.last = last; lodash.lastIndexOf = lastIndexOf; lodash.lowerCase = lowerCase; lodash.lowerFirst = lowerFirst; lodash.lt = lt; lodash.lte = lte; lodash.max = max; lodash.maxBy = maxBy; lodash.mean = mean; lodash.meanBy = meanBy; lodash.min = min; lodash.minBy = minBy; lodash.stubArray = stubArray; lodash.stubFalse = stubFalse; lodash.stubObject = stubObject; lodash.stubString = stubString; lodash.stubTrue = stubTrue; lodash.multiply = multiply; lodash.nth = nth; lodash.noConflict = noConflict; lodash.noop = noop; lodash.now = now; lodash.pad = pad; lodash.padEnd = padEnd; lodash.padStart = padStart; lodash.parseInt = parseInt2; lodash.random = random; lodash.reduce = reduce2; lodash.reduceRight = reduceRight2; lodash.repeat = repeat; lodash.replace = replace; lodash.result = result; lodash.round = round; lodash.runInContext = runInContext2; lodash.sample = sample; lodash.size = size; lodash.snakeCase = snakeCase; lodash.some = some2; lodash.sortedIndex = sortedIndex; lodash.sortedIndexBy = sortedIndexBy; lodash.sortedIndexOf = sortedIndexOf; lodash.sortedLastIndex = sortedLastIndex; lodash.sortedLastIndexBy = sortedLastIndexBy; lodash.sortedLastIndexOf = sortedLastIndexOf; lodash.startCase = startCase; lodash.startsWith = startsWith; lodash.subtract = subtract; lodash.sum = sum; lodash.sumBy = sumBy; lodash.template = template; lodash.times = times2; lodash.toFinite = toFinite; lodash.toInteger = toInteger; lodash.toLength = toLength; lodash.toLower = toLower; lodash.toNumber = toNumber; lodash.toSafeInteger = toSafeInteger; lodash.toString = toString; lodash.toUpper = toUpper; lodash.trim = trim; lodash.trimEnd = trimEnd; lodash.trimStart = trimStart; lodash.truncate = truncate; lodash.unescape = unescape; lodash.uniqueId = uniqueId; lodash.upperCase = upperCase; lodash.upperFirst = upperFirst; lodash.each = forEach; lodash.eachRight = forEachRight; lodash.first = head; mixin(lodash, function() { var source = {}; baseForOwn(lodash, function(func, methodName) { if (!hasOwnProperty.call(lodash.prototype, methodName)) { source[methodName] = func; } }); return source; }(), { "chain": false }); lodash.VERSION = VERSION; arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) { lodash[methodName].placeholder = lodash; }); arrayEach(["drop", "take"], function(methodName, index2) { LazyWrapper.prototype[methodName] = function(n) { n = n === undefined2 ? 1 : nativeMax(toInteger(n), 0); var result2 = this.__filtered__ && !index2 ? new LazyWrapper(this) : this.clone(); if (result2.__filtered__) { result2.__takeCount__ = nativeMin(n, result2.__takeCount__); } else { result2.__views__.push({ "size": nativeMin(n, MAX_ARRAY_LENGTH), "type": methodName + (result2.__dir__ < 0 ? "Right" : "") }); } return result2; }; LazyWrapper.prototype[methodName + "Right"] = function(n) { return this.reverse()[methodName](n).reverse(); }; }); arrayEach(["filter", "map", "takeWhile"], function(methodName, index2) { var type = index2 + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; LazyWrapper.prototype[methodName] = function(iteratee2) { var result2 = this.clone(); result2.__iteratees__.push({ "iteratee": getIteratee(iteratee2, 3), "type": type }); result2.__filtered__ = result2.__filtered__ || isFilter; return result2; }; }); arrayEach(["head", "last"], function(methodName, index2) { var takeName = "take" + (index2 ? "Right" : ""); LazyWrapper.prototype[methodName] = function() { return this[takeName](1).value()[0]; }; }); arrayEach(["initial", "tail"], function(methodName, index2) { var dropName = "drop" + (index2 ? "" : "Right"); LazyWrapper.prototype[methodName] = function() { return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); }; }); LazyWrapper.prototype.compact = function() { return this.filter(identity); }; LazyWrapper.prototype.find = function(predicate) { return this.filter(predicate).head(); }; LazyWrapper.prototype.findLast = function(predicate) { return this.reverse().find(predicate); }; LazyWrapper.prototype.invokeMap = baseRest(function(path2, args) { if (typeof path2 == "function") { return new LazyWrapper(this); } return this.map(function(value) { return baseInvoke(value, path2, args); }); }); LazyWrapper.prototype.reject = function(predicate) { return this.filter(negate(getIteratee(predicate))); }; LazyWrapper.prototype.slice = function(start, end) { start = toInteger(start); var result2 = this; if (result2.__filtered__ && (start > 0 || end < 0)) { return new LazyWrapper(result2); } if (start < 0) { result2 = result2.takeRight(-start); } else if (start) { result2 = result2.drop(start); } if (end !== undefined2) { end = toInteger(end); result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start); } return result2; }; LazyWrapper.prototype.takeRightWhile = function(predicate) { return this.reverse().takeWhile(predicate).reverse(); }; LazyWrapper.prototype.toArray = function() { return this.take(MAX_ARRAY_LENGTH); }; baseForOwn(LazyWrapper.prototype, function(func, methodName) { var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName); if (!lodashFunc) { return; } lodash.prototype[methodName] = function() { var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray(value); var interceptor = /* @__PURE__ */ __name(function(value2) { var result3 = lodashFunc.apply(lodash, arrayPush([value2], args)); return isTaker && chainAll ? result3[0] : result3; }, "interceptor"); if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) { isLazy = useLazy = false; } var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid; if (!retUnwrapped && useLazy) { value = onlyLazy ? value : new LazyWrapper(this); var result2 = func.apply(value, args); result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined2 }); return new LodashWrapper(result2, chainAll); } if (isUnwrapped && onlyLazy) { return func.apply(this, args); } result2 = this.thru(interceptor); return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2; }; }); arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) { var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName); lodash.prototype[methodName] = function() { var args = arguments; if (retUnwrapped && !this.__chain__) { var value = this.value(); return func.apply(isArray(value) ? value : [], args); } return this[chainName](function(value2) { return func.apply(isArray(value2) ? value2 : [], args); }); }; }); baseForOwn(LazyWrapper.prototype, function(func, methodName) { var lodashFunc = lodash[methodName]; if (lodashFunc) { var key = lodashFunc.name + ""; if (!hasOwnProperty.call(realNames, key)) { realNames[key] = []; } realNames[key].push({ "name": methodName, "func": lodashFunc }); } }); realNames[createHybrid(undefined2, WRAP_BIND_KEY_FLAG).name] = [{ "name": "wrapper", "func": undefined2 }]; LazyWrapper.prototype.clone = lazyClone; LazyWrapper.prototype.reverse = lazyReverse; LazyWrapper.prototype.value = lazyValue; lodash.prototype.at = wrapperAt; lodash.prototype.chain = wrapperChain; lodash.prototype.commit = wrapperCommit; lodash.prototype.next = wrapperNext; lodash.prototype.plant = wrapperPlant; lodash.prototype.reverse = wrapperReverse; lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; lodash.prototype.first = lodash.prototype.head; if (symIterator) { lodash.prototype[symIterator] = wrapperToIterator; } return lodash; }, "runInContext"); var _ = runInContext(); if (typeof define == "function" && typeof define.amd == "object" && define.amd) { root._ = _; define(function() { return _; }); } else if (freeModule) { (freeModule.exports = _)._ = _; freeExports._ = _; } else { root._ = _; } }).call(exports); } }); // node_modules/json-complete/dist/json_complete.cjs.min.js var require_json_complete_cjs_min = __commonJS({ "node_modules/json-complete/dist/json_complete.cjs.min.js"(exports, module2) { var n = "0123456789abcdefghijklmnopqrstuvwxyz!#%&'()*+-./:;<=>?@[]^_`{|}~"; var r = /* @__PURE__ */ __name(function(n2) { return n2.split(/([A-Z$]+)/); }, "r"); var e = /* @__PURE__ */ __name(function(n2) { var e2 = r(n2); return { t: e2[1], o: Number(e2[2]) }; }, "e"); var t = " 1234567890.-e+,"; var o = /* @__PURE__ */ __name(function(n2, r2) { var e2 = "", t2 = r2.length; do { e2 = r2[n2 % t2] + e2, n2 = Math.floor(n2 / t2); } while (n2); return e2; }, "o"); var u = /* @__PURE__ */ __name(function(r2, u2, i2) { if (!i2[r2] || i2[r2].u === 0) return u2; if (i2[r2].u === 1) { for (var f2 = u2.join(",").replace(/E/g, "e").split(""), c2 = 0, a2 = [], y2 = 0; y2 < f2.length; y2 += 1) { var _2 = t.indexOf(f2[y2]); y2 % 3 == 0 ? c2 = _2 << 2 : y2 % 3 == 1 ? (c2 |= _2 >>> 2, a2.push(o(c2, n)), c2 = (3 & _2) << 4) : (c2 |= _2, a2.push(o(c2, n))); } return f2.length % 3 != 0 && a2.push(o(c2, n)), a2.join(""); } return u2.map(function(r3) { return r3.map(function(r4) { return r4.map(function(r5) { var t2 = e(r5); return t2.t + o(t2.o, n); }).join(""); }).join(" "); }).join(","); }, "u"); var i = /* @__PURE__ */ __name(function(n2) { return Object.prototype.toString.call(n2).slice(8, -1); }, "i"); var f = /* @__PURE__ */ __name(function(n2, r2) { for (var e2 = 0; e2 < n2.i.length; e2 += 1) if (n2.i[e2][0](r2)) return n2.i[e2][1]; if (typeof Set == "function" && r2 instanceof Set) return "U"; if (typeof Map == "function" && r2 instanceof Map) return "V"; var t2 = i(r2), o2 = n2._[t2]; return o2 && typeof r2 == "object" && (t2 = o2), n2.p[t2]; }, "f"); var c = /* @__PURE__ */ __name(function(n2) { if (typeof Map != "function" || i(/* @__PURE__ */ new Map()) !== "Map") return false; if (typeof BigInt == "function" && i(BigInt(1)) === "BigInt") { for (var r2 = /* @__PURE__ */ new Map(), e2 = 0; e2 < 10; e2 += 1) r2.set(BigInt(1), e2); if (r2.size !== 1) return false; } if (n2 && typeof Symbol == "function" && i(Symbol()) === "Symbol") { var t2 = {}; t2[Symbol()] = 1; for (var o2 = /* @__PURE__ */ new Map(), u2 = 0; u2 < 50; u2 += 1) o2.set(Object.getOwnPropertySymbols(t2)[0], {}); if (o2.size !== 1) return false; } return true; }, "c"); var a = /* @__PURE__ */ __name(function(n2) { if (c(n2)) { var r2 = /* @__PURE__ */ new Map(); return { l: function(n3) { return r2.get(n3); }, v: function(n3, e3) { r2.set(n3, e3); }, m: function(n3, e3) { e3 = e3 || 0; var t3 = 0; return r2.forEach(function(r3) { t3 >= e3 && n3(r3), t3 += 1; }), t3; } }; } var e2 = [], t2 = []; return { l: function(n3) { for (var r3 = 0; r3 < e2.length; r3 += 1) if (e2[r3] === n3) return t2[r3]; }, v: function(n3, r3) { e2.push(n3), t2.push(r3); }, m: function(n3, r3) { var e3; for (e3 = r3 || 0; e3 < t2.length; e3 += 1) n3(t2[e3]); return e3; } }; }, "a"); var y = /* @__PURE__ */ __name(function(n2, r2) { var e2 = [], t2 = {}; Array.prototype.forEach.call(n2, function(n3, r3) { t2[String(r3)] = 1, e2.push(r3); }); var o2 = Object.keys(n2).filter(function(n3) { return !t2[n3]; }); r2 && typeof Symbol == "function" && (o2 = o2.concat(Object.getOwnPropertySymbols(n2).filter(function(n3) { return Symbol[String(n3).slice(14, -1)] !== n3; }))); var u2 = 0; return e2.concat(o2).reduce(function(r3, e3) { return e3 === u2 ? (u2 += 1, r3.g.push(n2[e3])) : (r3.h.push(e3), r3.T.push(n2[e3])), r3; }, { g: [], h: [], T: [] }); }, "y"); var _ = /* @__PURE__ */ __name(function(n2, r2) { if (n2.M[r2]) return n2.M[r2].F; var t2 = e(r2); return n2.M[t2.t] ? n2.C[r2].j : r2; }, "_"); var p = /* @__PURE__ */ __name(function(n2, r2, t2, o2) { for (var u2 = 0; u2 < (r2.k[t2] || []).length; u2 += 1) { var i2 = r2.k[t2][u2]; n2.q && typeof Symbol != "function" && e(i2).t === "P" || (r2.j[_(n2, i2)] = _(n2, r2.k[o2][u2])); } }, "p"); var s = /* @__PURE__ */ __name(function(n2, r2) { if (n2.M[r2]) return n2.M[r2].F; var t2 = e(r2); return n2.M[t2.t].J(n2, n2.K[t2.t][t2.o]); }, "s"); var d = /* @__PURE__ */ __name(function(n2, r2) { return r2.h.length === 0 ? n2 : n2.concat([r2.h, r2.T]); }, "d"); var l = /* @__PURE__ */ __name(function(n2) { return { $: i(new n2()), u: 2, L: function(n3, r2) { return d([Array.prototype.slice.call(new Uint8Array(n3))], r2); }, J: function(r2, e2) { var t2 = e2[0], o2 = new n2(t2.length), u2 = new Uint8Array(o2); return t2.forEach(function(n3, e3) { u2[e3] = s(r2, n3); }), o2; }, nn: function(n3, r2) { p(n3, r2, 1, 2); } }; }, "l"); var v = /* @__PURE__ */ __name(function(n2) { return typeof ArrayBuffer == "function" && (n2.W = l(ArrayBuffer)), typeof SharedArrayBuffer == "function" && (n2.X = l(SharedArrayBuffer)), n2; }, "v"); var m = /* @__PURE__ */ __name(function(n2, r2) { for (var e2 = 0; e2 < r2.k[0].length; e2 += 1) r2.j[e2] = _(n2, r2.k[0][e2]); }, "m"); var g = /* @__PURE__ */ __name(function(n2) { return n2.A = { $: "Array", u: 2, L: function(n3, r2) { return d([r2.g], r2); }, J: function() { return []; }, nn: function(n3, r2) { m(n3, r2), p(n3, r2, 1, 2); } }, n2.Q = { $: "Arguments", u: 2, L: function(n3, r2) { return d([r2.g], r2); }, J: function(n3, r2) { return function() { return arguments; }.apply(null, Array(r2[0].length)); }, nn: function(n3, r2) { m(n3, r2), p(n3, r2, 1, 2); } }, n2; }, "g"); var b = /* @__PURE__ */ __name(function(n2, r2) { return { $: i(n2("")), u: r2 || 0, rn: 1, L: function(n3) { return String(n3); }, J: function(r3, e2) { return n2(e2); }, nn: function() { } }; }, "b"); var A = /* @__PURE__ */ __name(function(n2) { return n2.S = b(String), n2.N = b(Number, 1), n2; }, "A"); var w = /* @__PURE__ */ __name(function(n2) { return { $: i(new n2()), u: 2, L: function(n3, r2) { return d([r2.g], r2); }, J: function(r2, e2) { return new n2(e2[0].length); }, nn: function(n3, r2) { m(n3, r2), p(n3, r2, 1, 2); } }; }, "w"); var S = /* @__PURE__ */ __name(function(n2) { return typeof BigInt == "function" && (n2.I = b(BigInt, 1)), typeof BigInt64Array == "function" && (n2.BI = w(BigInt64Array)), typeof BigUint64Array == "function" && (n2.BU = w(BigUint64Array)), n2; }, "S"); var E = /* @__PURE__ */ __name(function(n2, r2, t2) { return { $: n2, u: 2, L: function(n3, e2) { return d([[void 0].concat(r2.map(function(r3) { return n3[r3]; }))], e2); }, en: function(n3, r3, e2, t3) { var o2 = new FileReader(); o2.addEventListener("loadend", function() { r3[0][0] = e2(new Uint8Array(o2.result)), t3(); }), o2.readAsArrayBuffer(n3); }, J: function(n3, r3) { var o2 = e(r3[0][0]), u2 = o2.t === "K" ? [] : n3.K[o2.t][o2.o][0]; return t2(n3, [new Uint8Array(u2.map(function(r4) { return s(n3, r4); }))], r3[0]); }, nn: function(n3, r3) { p(n3, r3, 1, 2); } }; }, "E"); var R = /* @__PURE__ */ __name(function(n2) { return typeof Blob == "function" && (n2.Y = E("Blob", ["type"], function(n3, r2, e2) { return new Blob(r2, { type: s(n3, e2[1]) }); }), n2.Z = E("File", ["type", "name", "lastModified"], function(n3, r2, e2) { try { return new File(r2, s(n3, e2[2]), { type: s(n3, e2[1]), lastModified: s(n3, e2[3]) }); } catch (o2) { if (n3.q) { var t2 = new Blob(r2, { type: s(n3, e2[1]) }); return t2.name = s(n3, e2[2]), t2.lastModified = s(n3, e2[3]), t2; } throw o2; } })), n2; }, "R"); var N = /* @__PURE__ */ __name(function(n2) { return n2.D = { $: "Date", u: 2, L: function(n3, r2) { return d([[n3.valueOf()]], r2); }, J: function(n3, r2) { return new Date(s(n3, r2[0][0])); }, nn: function(n3, r2) { p(n3, r2, 1, 2); } }, n2; }, "N"); var h = { EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError }; var B = /* @__PURE__ */ __name(function(n2) { return n2.E = { $: "Error", u: 2, L: function(n3, r2) { return d([[h[n3.name] ? n3.name : "Error", n3.message, n3.stack]], r2); }, J: function(n3, r2) { var e2 = r2[0], t2 = new (h[s(n3, e2[0])] || Error)(s(n3, e2[1])); return t2.stack = s(n3, e2[2]), t2; }, nn: function(n3, r2) { p(n3, r2, 1, 2); } }, n2; }, "B"); var T = /* @__PURE__ */ __name(function(n2) { return typeof Set == "function" && (n2.U = { $: "Set", u: 2, L: function(n3, r2) { var e2 = []; return n3.forEach(function(n4) { e2.push(n4); }), d([e2], r2); }, J: function() { return /* @__PURE__ */ new Set(); }, nn: function(n3, r2) { r2.k[0].forEach(function(e2) { r2.j.add(_(n3, e2)); }), p(n3, r2, 1, 2); } }), typeof Map == "function" && (n2.V = { $: "Map", u: 2, L: function(n3, r2) { var e2 = [], t2 = []; return n3.forEach(function(n4, r3) { e2.push(r3), t2.push(n4); }), d([e2, t2], r2); }, J: function() { return /* @__PURE__ */ new Map(); }, nn: function(n3, r2) { for (var e2 = 0; e2 < r2.k[0].length; e2 += 1) r2.j.set(_(n3, r2.k[0][e2]), _(n3, r2.k[1][e2])); p(n3, r2, 2, 3); } }), n2; }, "T"); var U = /* @__PURE__ */ __name(function(n2) { return n2.O = { $: "Object", u: 2, L: function(n3, r2) { return d([], r2); }, J: function() { return {}; }, nn: function(n3, r2) { p(n3, r2, 0, 1); } }, n2; }, "U"); var I = /* @__PURE__ */ __name(function(n2) { try { var r2 = new RegExp(" ", n2); return i(r2) === "RegExp"; } catch (n3) { return false; } }, "I"); var M = I("y"); var V = I("u"); var x = /* @__PURE__ */ __name(function(n2) { return n2.R = { $: "RegExp", u: 2, L: function(n3, r2) { var e2 = n3.flags; return e2 === void 0 && (e2 = n3.options), d([[n3.source, e2, n3.lastIndex]], r2); }, J: function(n3, r2) { var e2 = r2[0], t2 = s(n3, e2[1]); n3.q && (M || (t2 = t2.replace(/y/g, "")), V || (t2 = t2.replace(/u/g, ""))); var o2 = new RegExp(s(n3, e2[0]), t2); return o2.lastIndex = s(n3, e2[2]), o2; }, nn: function(n3, r2) { p(n3, r2, 1, 2); } }, n2; }, "x"); var F = /* @__PURE__ */ __name(function(n2) { return { tn: function(r2) { return n2 === r2; }, F: n2 }; }, "F"); var O = /* @__PURE__ */ __name(function(n2) { return n2.$0 = F(void 0), n2.$1 = F(null), n2.$2 = F(true), n2.$3 = F(false), n2.$4 = F(1 / 0), n2.$5 = F(-1 / 0), n2.$6 = { tn: function(n3) { return n3 != n3; }, F: NaN }, n2.$7 = { tn: function(n3) { return n3 === 0 && 1 / n3 == -1 / 0; }, F: -0 }, n2; }, "O"); var j = /* @__PURE__ */ __name(function(n2) { return typeof Symbol == "function" && (n2.P = { $: "Symbol", u: 0, rn: 1, L: function(n3) { var r2 = Symbol.keyFor(n3); return r2 !== void 0 ? "r" + r2 : "s" + String(n3).slice(7, -1); }, J: function(n3, r2) { return r2[0] === "r" ? Symbol.for(r2.slice(1)) : Symbol(r2.slice(1)); }, nn: function() { } }), n2; }, "j"); var C = /* @__PURE__ */ __name(function(n2) { return typeof Int8Array == "function" && (n2.IE = w(Int8Array)), typeof Int16Array == "function" && (n2.IS = w(Int16Array)), typeof Int32Array == "function" && (n2.IT = w(Int32Array)), typeof Uint8Array == "function" && (n2.UE = w(Uint8Array)), typeof Uint8ClampedArray == "function" && (n2.UC = w(Uint8ClampedArray)), typeof Uint16Array == "function" && (n2.US = w(Uint16Array)), typeof Uint32Array == "function" && (n2.UT = w(Uint32Array)), typeof Float32Array == "function" && (n2.FT = w(Float32Array)), typeof Float64Array == "function" && (n2.FS = w(Float64Array)), n2; }, "C"); var k = /* @__PURE__ */ __name(function(n2) { return { $: "_" + i(new n2("")), u: 2, L: function(n3, r2) { return d([[n3.valueOf()]], r2); }, J: function(r2, e2) { return new n2(s(r2, e2[0][0])); }, nn: function(n3, r2) { p(n3, r2, 1, 2); } }; }, "k"); var z = /* @__PURE__ */ __name(function(n2) { return n2.B = k(Boolean), n2.G = k(String), n2.H = k(Number), n2; }, "z"); var D = {}; var q = D = S(D = R(D = v(D = C(D = T(D = j(D = B(D = x(D = N(D = U(D = g(D = z(D = A(D = O(D)))))))))))))); var J = /* @__PURE__ */ __name(function(n2, r2) { var e2 = f(n2, r2); if (!e2 && !n2.q) { var t2 = i(r2); throw new Error('Cannot encode unsupported type "' + t2 + '".'); } return e2 || "O"; }, "J"); var K = /* @__PURE__ */ __name(function(n2, r2) { var e2 = J(n2, r2); if (!n2.M[e2].nn) return e2; var t2 = n2.on.l(r2, e2); if (t2 !== void 0) return t2.un; n2.fn[e2] = n2.fn[e2] || [], n2.fn[e2].push(0); var o2 = n2.fn[e2].length - 1, u2 = { t: e2, o: o2, un: e2 + o2, j: r2 }; return n2.on.v(r2, u2), n2.M[e2].en && n2.cn.push(u2), u2.un; }, "K"); var $ = /* @__PURE__ */ __name(function(n2, r2) { return n2.on.m(function(r3) { var e2 = []; q[r3.t].rn || (e2 = y(r3.j, n2.an)); var t2 = q[r3.t].L(r3.j, e2); i(t2) !== "String" && (t2 = t2.map(function(r4) { return r4.map(function(r5) { return K(n2, r5); }); })), n2.fn[r3.t][r3.o] = t2; }, r2); }, "$"); var P = /* @__PURE__ */ __name(function(n2, r2) { var e2 = JSON.stringify([r2 + ",2"].concat(Object.keys(n2.fn).map(function(r3) { return [r3, u(r3, n2.fn[r3], n2.M)]; }))); if (typeof n2.yn != "function") return e2; n2.yn(e2); }, "P"); var Z = /* @__PURE__ */ __name(function(n2, r2) { r2 = r2 || {}; var e2 = [], t2 = {}, o2 = {}; Object.keys(q).forEach(function(n3) { if (n3[0] !== "$") { var r3 = q[n3].$; t2[r3] = n3, r3[0] === "_" && (o2[r3.slice(1)] = r3); } else e2.push([q[n3].tn, n3]); }); var u2 = { q: r2.compat, an: r2.encodeSymbolKeys, yn: r2.onFinish, i: e2, M: q, p: t2, _: o2, on: a(r2.encodeSymbolKeys), cn: [], fn: {} }, i2 = K(u2, n2), f2 = $(u2); if (!(u2.cn.length > 0)) return P(u2, i2); if (typeof r2.onFinish != "function") { if (u2.q) return P(u2, i2); throw new Error("Deferred Types require onFinish option."); } var c2 = u2.cn.length, y2 = /* @__PURE__ */ __name(function() { if ((c2 -= 1) === 0) return $(u2, f2), P(u2, i2); }, "y"); u2.cn.forEach(function(n3) { q[n3.t].en(n3.j, u2.fn[n3.t][n3.o], function(n4) { return K(u2, n4); }, y2); }); }, "Z"); var G = /* @__PURE__ */ __name(function(n2, r2) { var e2 = r2.length; return n2.split("").reduce(function(n3, t2) { return n3 * e2 + r2.indexOf(t2); }, 0); }, "G"); var H = /* @__PURE__ */ __name(function(e2, o2, u2) { if (!u2[e2] || u2[e2].u === 0) return o2; if (u2[e2].u === 1) { for (var i2 = [], f2 = o2.length, c2 = 0; c2 < f2 - 1; c2 += 2) i2 = i2.concat([t[(60 & G(o2[c2], n)) >>> 2], t[(3 & G(o2[c2], n)) << 2 | (48 & G(o2[c2 + 1], n)) >> 4], t[15 & G(o2[c2 + 1], n)]]); return f2 % 2 != 0 && (i2 = i2.concat([t[G(o2[f2 - 1], n) >>> 2]])), i2.length && i2[i2.length - 1] === " " && (i2 = i2.slice(0, -1)), i2.join("").split(","); } return o2.split(",").map(function(e3) { return e3.split(" ").map(function(e4) { for (var t2 = r(e4).slice(1), o3 = [], u3 = 0; u3 < t2.length; u3 += 2) o3.push(t2[u3] + G(t2[u3 + 1], n)); return o3; }); }); }, "H"); var L = /* @__PURE__ */ __name(function n2(r2, e2) { i(e2) === "Array" ? e2.forEach(function(e3) { n2(r2, e3); }) : r2._n.push(e2); }, "n"); var Q = /* @__PURE__ */ __name(function(n2, r2) { if (!q[r2] && n2.C[r2] === void 0) { var t2 = e(r2); if (!q[t2.t]) { if (n2.q) return; throw new Error('Cannot decode unrecognized pointer type "' + t2.t + '".'); } n2.C[r2] = { t: t2.t, o: t2.o, un: r2, j: void 0, k: n2.K[t2.t][t2.o] }; try { n2.C[r2].j = q[t2.t].J(n2, n2.K[t2.t][t2.o]); } catch (r3) { if (!n2.q) throw new Error('Cannot decode recognized pointer type "' + t2.t + '".'); } i(n2.C[r2].k) === "Array" && L(n2, n2.C[r2].k); } }, "Q"); var W = /* @__PURE__ */ __name(function(n2, r2) { r2 = r2 || {}; var t2 = JSON.parse(n2), o2 = t2.slice(1).reduce(function(n3, r3) { return n3[r3[0]] = H(r3[0], r3[1], q), n3; }, {}), u2 = t2[0].split(",")[0], i2 = { q: r2.compat, M: q, K: o2, C: {}, _n: [] }; if (q[u2]) return q[u2].F; var f2 = e(u2); if (!q[f2.t]) { if (i2.q) return u2; throw new Error('Cannot decode unrecognized pointer type "' + f2.t + '".'); } for (i2._n.push(u2); i2._n.length; ) Q(i2, i2._n.shift()); return Object.keys(i2.C).forEach(function(n3) { var r3 = i2.C[n3]; q[r3.t].nn(i2, r3); }), i2.C[u2].j; }, "W"); var X = { encode: Z, decode: W }; module2.exports = X; } }); // node_modules/sql.js/dist/sql-wasm.js var require_sql_wasm = __commonJS({ "node_modules/sql.js/dist/sql-wasm.js"(exports, module2) { var initSqlJsPromise = void 0; var initSqlJs2 = /* @__PURE__ */ __name(function(moduleConfig) { if (initSqlJsPromise) { return initSqlJsPromise; } initSqlJsPromise = new Promise(function(resolveModule, reject2) { var Module = typeof moduleConfig !== "undefined" ? moduleConfig : {}; var originalOnAbortFunction = Module["onAbort"]; Module["onAbort"] = function(errorThatCausedAbort) { reject2(new Error(errorThatCausedAbort)); if (originalOnAbortFunction) { originalOnAbortFunction(errorThatCausedAbort); } }; Module["postRun"] = Module["postRun"] || []; Module["postRun"].push(function() { resolveModule(Module); }); module2 = void 0; var e; e || (e = typeof Module !== "undefined" ? Module : {}); null; e.onRuntimeInitialized = function() { function a(g, m) { switch (typeof m) { case "boolean": gc(g, m ? 1 : 0); break; case "number": hc(g, m); break; case "string": ic(g, m, -1, -1); break; case "object": if (m === null) kb(g); else if (m.length != null) { var n = aa(m); jc(g, n, m.length, -1); ba(n); } else xa(g, "Wrong API use : tried to return a value of an unknown type (" + m + ").", -1); break; default: kb(g); } } __name(a, "a"); function b(g, m) { for (var n = [], p = 0; p < g; p += 1) { var v = l(m + 4 * p, "i32"), y = kc(v); if (y === 1 || y === 2) v = lc(v); else if (y === 3) v = mc(v); else if (y === 4) { y = v; v = nc(y); y = oc(y); for (var L = new Uint8Array(v), G = 0; G < v; G += 1) L[G] = r[y + G]; v = L; } else v = null; n.push(v); } return n; } __name(b, "b"); function c(g, m) { this.La = g; this.db = m; this.Ja = 1; this.fb = []; } __name(c, "c"); function d(g, m) { this.db = m; m = ca(g) + 1; this.Ya = da(m); if (this.Ya === null) throw Error("Unable to allocate memory for the SQL string"); t(g, u, this.Ya, m); this.eb = this.Ya; this.Ua = this.ib = null; } __name(d, "d"); function f(g) { this.filename = "dbfile_" + (4294967295 * Math.random() >>> 0); if (g != null) { var m = this.filename, n = "/", p = m; n && (n = typeof n == "string" ? n : ea(n), p = m ? z(n + "/" + m) : n); m = fa(true, true); p = ha(p, (m !== void 0 ? m : 438) & 4095 | 32768, 0); if (g) { if (typeof g == "string") { n = Array(g.length); for (var v = 0, y = g.length; v < y; ++v) n[v] = g.charCodeAt(v); g = n; } ia(p, m | 146); n = ja(p, 577); ka(n, g, 0, g.length, 0); la(n); ia(p, m); } } this.handleError(q(this.filename, h)); this.db = l(h, "i32"); pc(this.db); this.Za = {}; this.Na = {}; } __name(f, "f"); var h = B(4), k = e.cwrap, q = k("sqlite3_open", "number", ["string", "number"]), x = k("sqlite3_close_v2", "number", ["number"]), w = k("sqlite3_exec", "number", ["number", "string", "number", "number", "number"]), A = k("sqlite3_changes", "number", ["number"]), S = k("sqlite3_prepare_v2", "number", ["number", "string", "number", "number", "number"]), nb = k("sqlite3_sql", "string", ["number"]), qc = k("sqlite3_normalized_sql", "string", ["number"]), ob = k("sqlite3_prepare_v2", "number", ["number", "number", "number", "number", "number"]), rc = k("sqlite3_bind_text", "number", ["number", "number", "number", "number", "number"]), pb = k("sqlite3_bind_blob", "number", ["number", "number", "number", "number", "number"]), sc = k("sqlite3_bind_double", "number", ["number", "number", "number"]), tc = k("sqlite3_bind_int", "number", ["number", "number", "number"]), uc = k("sqlite3_bind_parameter_index", "number", ["number", "string"]), vc = k("sqlite3_step", "number", ["number"]), wc = k("sqlite3_errmsg", "string", ["number"]), xc = k("sqlite3_column_count", "number", ["number"]), yc = k("sqlite3_data_count", "number", ["number"]), zc = k("sqlite3_column_double", "number", ["number", "number"]), qb = k("sqlite3_column_text", "string", ["number", "number"]), Ac = k("sqlite3_column_blob", "number", ["number", "number"]), Bc = k("sqlite3_column_bytes", "number", ["number", "number"]), Cc = k("sqlite3_column_type", "number", ["number", "number"]), Dc = k("sqlite3_column_name", "string", ["number", "number"]), Ec = k("sqlite3_reset", "number", ["number"]), Fc = k("sqlite3_clear_bindings", "number", ["number"]), Gc = k("sqlite3_finalize", "number", ["number"]), rb = k("sqlite3_create_function_v2", "number", "number string number number number number number number number".split(" ")), kc = k("sqlite3_value_type", "number", ["number"]), nc = k("sqlite3_value_bytes", "number", ["number"]), mc = k("sqlite3_value_text", "string", ["number"]), oc = k("sqlite3_value_blob", "number", ["number"]), lc = k("sqlite3_value_double", "number", ["number"]), hc = k("sqlite3_result_double", "", ["number", "number"]), kb = k("sqlite3_result_null", "", ["number"]), ic = k("sqlite3_result_text", "", ["number", "string", "number", "number"]), jc = k("sqlite3_result_blob", "", ["number", "number", "number", "number"]), gc = k("sqlite3_result_int", "", ["number", "number"]), xa = k("sqlite3_result_error", "", ["number", "string", "number"]), sb = k("sqlite3_aggregate_context", "number", ["number", "number"]), pc = k("RegisterExtensionFunctions", "number", ["number"]); c.prototype.bind = function(g) { if (!this.La) throw "Statement closed"; this.reset(); return Array.isArray(g) ? this.xb(g) : g != null && typeof g === "object" ? this.yb(g) : true; }; c.prototype.step = function() { if (!this.La) throw "Statement closed"; this.Ja = 1; var g = vc(this.La); switch (g) { case 100: return true; case 101: return false; default: throw this.db.handleError(g); } }; c.prototype.sb = function(g) { g == null && (g = this.Ja, this.Ja += 1); return zc(this.La, g); }; c.prototype.Cb = function(g) { g == null && (g = this.Ja, this.Ja += 1); g = qb(this.La, g); if (typeof BigInt !== "function") throw Error("BigInt is not supported"); return BigInt(g); }; c.prototype.Db = function(g) { g == null && (g = this.Ja, this.Ja += 1); return qb(this.La, g); }; c.prototype.getBlob = function(g) { g == null && (g = this.Ja, this.Ja += 1); var m = Bc(this.La, g); g = Ac(this.La, g); for (var n = new Uint8Array(m), p = 0; p < m; p += 1) n[p] = r[g + p]; return n; }; c.prototype.get = function(g, m) { m = m || {}; g != null && this.bind(g) && this.step(); g = []; for (var n = yc(this.La), p = 0; p < n; p += 1) switch (Cc(this.La, p)) { case 1: var v = m.useBigInt ? this.Cb(p) : this.sb(p); g.push(v); break; case 2: g.push(this.sb(p)); break; case 3: g.push(this.Db(p)); break; case 4: g.push(this.getBlob(p)); break; default: g.push(null); } return g; }; c.prototype.getColumnNames = function() { for (var g = [], m = xc(this.La), n = 0; n < m; n += 1) g.push(Dc(this.La, n)); return g; }; c.prototype.getAsObject = function(g, m) { g = this.get(g, m); m = this.getColumnNames(); for (var n = {}, p = 0; p < m.length; p += 1) n[m[p]] = g[p]; return n; }; c.prototype.getSQL = function() { return nb(this.La); }; c.prototype.getNormalizedSQL = function() { return qc(this.La); }; c.prototype.run = function(g) { g != null && this.bind(g); this.step(); return this.reset(); }; c.prototype.nb = function(g, m) { m == null && (m = this.Ja, this.Ja += 1); g = ma(g); var n = aa(g); this.fb.push(n); this.db.handleError(rc(this.La, m, n, g.length - 1, 0)); }; c.prototype.wb = function(g, m) { m == null && (m = this.Ja, this.Ja += 1); var n = aa(g); this.fb.push(n); this.db.handleError(pb(this.La, m, n, g.length, 0)); }; c.prototype.mb = function(g, m) { m == null && (m = this.Ja, this.Ja += 1); this.db.handleError((g === (g | 0) ? tc : sc)(this.La, m, g)); }; c.prototype.zb = function(g) { g == null && (g = this.Ja, this.Ja += 1); pb(this.La, g, 0, 0, 0); }; c.prototype.ob = function(g, m) { m == null && (m = this.Ja, this.Ja += 1); switch (typeof g) { case "string": this.nb(g, m); return; case "number": this.mb(g, m); return; case "bigint": this.nb(g.toString(), m); return; case "boolean": this.mb(g + 0, m); return; case "object": if (g === null) { this.zb(m); return; } if (g.length != null) { this.wb(g, m); return; } } throw "Wrong API use : tried to bind a value of an unknown type (" + g + ")."; }; c.prototype.yb = function(g) { var m = this; Object.keys(g).forEach(function(n) { var p = uc(m.La, n); p !== 0 && m.ob(g[n], p); }); return true; }; c.prototype.xb = function(g) { for (var m = 0; m < g.length; m += 1) this.ob(g[m], m + 1); return true; }; c.prototype.reset = function() { this.freemem(); return Fc(this.La) === 0 && Ec(this.La) === 0; }; c.prototype.freemem = function() { for (var g; (g = this.fb.pop()) !== void 0; ) ba(g); }; c.prototype.free = function() { this.freemem(); var g = Gc(this.La) === 0; delete this.db.Za[this.La]; this.La = 0; return g; }; d.prototype.next = function() { if (this.Ya === null) return { done: true }; this.Ua !== null && (this.Ua.free(), this.Ua = null); if (!this.db.db) throw this.gb(), Error("Database closed"); var g = oa(), m = B(4); pa(h); pa(m); try { this.db.handleError(ob(this.db.db, this.eb, -1, h, m)); this.eb = l(m, "i32"); var n = l(h, "i32"); if (n === 0) return this.gb(), { done: true }; this.Ua = new c(n, this.db); this.db.Za[n] = this.Ua; return { value: this.Ua, done: false }; } catch (p) { throw this.ib = C(this.eb), this.gb(), p; } finally { qa(g); } }; d.prototype.gb = function() { ba(this.Ya); this.Ya = null; }; d.prototype.getRemainingSQL = function() { return this.ib !== null ? this.ib : C(this.eb); }; typeof Symbol === "function" && typeof Symbol.iterator === "symbol" && (d.prototype[Symbol.iterator] = function() { return this; }); f.prototype.run = function(g, m) { if (!this.db) throw "Database closed"; if (m) { g = this.prepare(g, m); try { g.step(); } finally { g.free(); } } else this.handleError(w(this.db, g, 0, 0, h)); return this; }; f.prototype.exec = function(g, m, n) { if (!this.db) throw "Database closed"; var p = oa(), v = null; try { var y = ca(g) + 1, L = B(y); t(g, r, L, y); var G = L; var H = B(4); for (g = []; l(G, "i8") !== 0; ) { pa(h); pa(H); this.handleError(ob(this.db, G, -1, h, H)); var I = l(h, "i32"); G = l(H, "i32"); if (I !== 0) { y = null; v = new c(I, this); for (m != null && v.bind(m); v.step(); ) y === null && (y = { columns: v.getColumnNames(), values: [] }, g.push(y)), y.values.push(v.get(null, n)); v.free(); } } return g; } catch (na) { throw v && v.free(), na; } finally { qa(p); } }; f.prototype.each = function(g, m, n, p, v) { typeof m === "function" && (p = n, n = m, m = void 0); g = this.prepare(g, m); try { for (; g.step(); ) n(g.getAsObject(null, v)); } finally { g.free(); } if (typeof p === "function") return p(); }; f.prototype.prepare = function(g, m) { pa(h); this.handleError(S(this.db, g, -1, h, 0)); g = l(h, "i32"); if (g === 0) throw "Nothing to prepare"; var n = new c(g, this); m != null && n.bind(m); return this.Za[g] = n; }; f.prototype.iterateStatements = function(g) { return new d(g, this); }; f.prototype["export"] = function() { Object.values(this.Za).forEach(function(m) { m.free(); }); Object.values(this.Na).forEach(ra); this.Na = {}; this.handleError(x(this.db)); var g = sa(this.filename); this.handleError(q(this.filename, h)); this.db = l(h, "i32"); return g; }; f.prototype.close = function() { this.db !== null && (Object.values(this.Za).forEach(function(g) { g.free(); }), Object.values(this.Na).forEach(ra), this.Na = {}, this.handleError(x(this.db)), ta("/" + this.filename), this.db = null); }; f.prototype.handleError = function(g) { if (g === 0) return null; g = wc(this.db); throw Error(g); }; f.prototype.getRowsModified = function() { return A(this.db); }; f.prototype.create_function = function(g, m) { Object.prototype.hasOwnProperty.call(this.Na, g) && (ra(this.Na[g]), delete this.Na[g]); var n = ua(function(p, v, y) { v = b(v, y); try { var L = m.apply(null, v); } catch (G) { xa(p, G, -1); return; } a(p, L); }, "viii"); this.Na[g] = n; this.handleError(rb(this.db, g, m.length, 1, 0, n, 0, 0, 0)); return this; }; f.prototype.create_aggregate = function(g, m) { var n = m.init || function() { return null; }, p = m.finalize || function(H) { return H; }, v = m.step; if (!v) throw "An aggregate function must have a step function in " + g; var y = {}; Object.hasOwnProperty.call(this.Na, g) && (ra(this.Na[g]), delete this.Na[g]); m = g + "__finalize"; Object.hasOwnProperty.call(this.Na, m) && (ra(this.Na[m]), delete this.Na[m]); var L = ua(function(H, I, na) { var Z = sb(H, 1); Object.hasOwnProperty.call(y, Z) || (y[Z] = n()); I = b(I, na); I = [y[Z]].concat(I); try { y[Z] = v.apply(null, I); } catch (Ic) { delete y[Z], xa(H, Ic, -1); } }, "viii"), G = ua(function(H) { var I = sb(H, 1); try { var na = p(y[I]); } catch (Z) { delete y[I]; xa(H, Z, -1); return; } a(H, na); delete y[I]; }, "vi"); this.Na[g] = L; this.Na[m] = G; this.handleError(rb(this.db, g, v.length - 1, 1, 0, 0, L, G, 0)); return this; }; e.Database = f; }; var va = Object.assign({}, e), wa = "./this.program", ya = typeof window == "object", za = typeof importScripts == "function", Aa = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", D = "", Ba, Ca, Da, fs3, Ea, Fa; if (Aa) D = za ? require("path").dirname(D) + "/" : __dirname + "/", Fa = /* @__PURE__ */ __name(() => { Ea || (fs3 = require("fs"), Ea = require("path")); }, "Fa"), Ba = /* @__PURE__ */ __name(function(a, b) { Fa(); a = Ea.normalize(a); return fs3.readFileSync(a, b ? void 0 : "utf8"); }, "Ba"), Da = /* @__PURE__ */ __name((a) => { a = Ba(a, true); a.buffer || (a = new Uint8Array(a)); return a; }, "Da"), Ca = /* @__PURE__ */ __name((a, b, c) => { Fa(); a = Ea.normalize(a); fs3.readFile(a, function(d, f) { d ? c(d) : b(f.buffer); }); }, "Ca"), 1 < process.argv.length && (wa = process.argv[1].replace(/\\/g, "/")), process.argv.slice(2), typeof module2 != "undefined" && (module2.exports = e), e.inspect = function() { return "[Emscripten Module object]"; }; else if (ya || za) za ? D = self.location.href : typeof document != "undefined" && document.currentScript && (D = document.currentScript.src), D = D.indexOf("blob:") !== 0 ? D.substr(0, D.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", Ba = /* @__PURE__ */ __name((a) => { var b = new XMLHttpRequest(); b.open("GET", a, false); b.send(null); return b.responseText; }, "Ba"), za && (Da = /* @__PURE__ */ __name((a) => { var b = new XMLHttpRequest(); b.open("GET", a, false); b.responseType = "arraybuffer"; b.send(null); return new Uint8Array(b.response); }, "Da")), Ca = /* @__PURE__ */ __name((a, b, c) => { var d = new XMLHttpRequest(); d.open("GET", a, true); d.responseType = "arraybuffer"; d.onload = () => { d.status == 200 || d.status == 0 && d.response ? b(d.response) : c(); }; d.onerror = c; d.send(null); }, "Ca"); var Ga = e.print || console.log.bind(console), Ha = e.printErr || console.warn.bind(console); Object.assign(e, va); va = null; e.thisProgram && (wa = e.thisProgram); var Ia; e.wasmBinary && (Ia = e.wasmBinary); var noExitRuntime = e.noExitRuntime || true; typeof WebAssembly != "object" && E("no native wasm support detected"); var Ja, Ka = false, La = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : void 0; function Ma(a, b, c) { var d = b + c; for (c = b; a[c] && !(c >= d); ) ++c; if (16 < c - b && a.buffer && La) return La.decode(a.subarray(b, c)); for (d = ""; b < c; ) { var f = a[b++]; if (f & 128) { var h = a[b++] & 63; if ((f & 224) == 192) d += String.fromCharCode((f & 31) << 6 | h); else { var k = a[b++] & 63; f = (f & 240) == 224 ? (f & 15) << 12 | h << 6 | k : (f & 7) << 18 | h << 12 | k << 6 | a[b++] & 63; 65536 > f ? d += String.fromCharCode(f) : (f -= 65536, d += String.fromCharCode(55296 | f >> 10, 56320 | f & 1023)); } } else d += String.fromCharCode(f); } return d; } __name(Ma, "Ma"); function C(a, b) { return a ? Ma(u, a, b) : ""; } __name(C, "C"); function t(a, b, c, d) { if (!(0 < d)) return 0; var f = c; d = c + d - 1; for (var h = 0; h < a.length; ++h) { var k = a.charCodeAt(h); if (55296 <= k && 57343 >= k) { var q = a.charCodeAt(++h); k = 65536 + ((k & 1023) << 10) | q & 1023; } if (127 >= k) { if (c >= d) break; b[c++] = k; } else { if (2047 >= k) { if (c + 1 >= d) break; b[c++] = 192 | k >> 6; } else { if (65535 >= k) { if (c + 2 >= d) break; b[c++] = 224 | k >> 12; } else { if (c + 3 >= d) break; b[c++] = 240 | k >> 18; b[c++] = 128 | k >> 12 & 63; } b[c++] = 128 | k >> 6 & 63; } b[c++] = 128 | k & 63; } } b[c] = 0; return c - f; } __name(t, "t"); function ca(a) { for (var b = 0, c = 0; c < a.length; ++c) { var d = a.charCodeAt(c); 127 >= d ? b++ : 2047 >= d ? b += 2 : 55296 <= d && 57343 >= d ? (b += 4, ++c) : b += 3; } return b; } __name(ca, "ca"); var Na, r, u, Oa, F, J, Pa, Qa; function Ra() { var a = Ja.buffer; Na = a; e.HEAP8 = r = new Int8Array(a); e.HEAP16 = Oa = new Int16Array(a); e.HEAP32 = F = new Int32Array(a); e.HEAPU8 = u = new Uint8Array(a); e.HEAPU16 = new Uint16Array(a); e.HEAPU32 = J = new Uint32Array(a); e.HEAPF32 = Pa = new Float32Array(a); e.HEAPF64 = Qa = new Float64Array(a); } __name(Ra, "Ra"); var K, Sa = [], Ta = [], Ua = []; function Va() { var a = e.preRun.shift(); Sa.unshift(a); } __name(Va, "Va"); var Wa = 0, Xa = null, Ya = null; function E(a) { if (e.onAbort) e.onAbort(a); a = "Aborted(" + a + ")"; Ha(a); Ka = true; throw new WebAssembly.RuntimeError(a + ". Build with -sASSERTIONS for more info."); } __name(E, "E"); function Za() { return M.startsWith("data:application/octet-stream;base64,"); } __name(Za, "Za"); var M; M = "sql-wasm.wasm"; if (!Za()) { var $a = M; M = e.locateFile ? e.locateFile($a, D) : D + $a; } function ab() { var a = M; try { if (a == M && Ia) return new Uint8Array(Ia); if (Da) return Da(a); throw "both async and sync fetching of the wasm failed"; } catch (b) { E(b); } } __name(ab, "ab"); function bb() { if (!Ia && (ya || za)) { if (typeof fetch == "function" && !M.startsWith("file://")) return fetch(M, { credentials: "same-origin" }).then(function(a) { if (!a.ok) throw "failed to load wasm binary file at '" + M + "'"; return a.arrayBuffer(); }).catch(function() { return ab(); }); if (Ca) return new Promise(function(a, b) { Ca(M, function(c) { a(new Uint8Array(c)); }, b); }); } return Promise.resolve().then(function() { return ab(); }); } __name(bb, "bb"); var N, O; function cb(a) { for (; 0 < a.length; ) a.shift()(e); } __name(cb, "cb"); function l(a, b = "i8") { b.endsWith("*") && (b = "*"); switch (b) { case "i1": return r[a >> 0]; case "i8": return r[a >> 0]; case "i16": return Oa[a >> 1]; case "i32": return F[a >> 2]; case "i64": return F[a >> 2]; case "float": return Pa[a >> 2]; case "double": return Qa[a >> 3]; case "*": return J[a >> 2]; default: E("invalid type for getValue: " + b); } return null; } __name(l, "l"); function pa(a) { var b = "i32"; b.endsWith("*") && (b = "*"); switch (b) { case "i1": r[a >> 0] = 0; break; case "i8": r[a >> 0] = 0; break; case "i16": Oa[a >> 1] = 0; break; case "i32": F[a >> 2] = 0; break; case "i64": O = [0, (N = 0, 1 <= +Math.abs(N) ? 0 < N ? (Math.min(+Math.floor(N / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N - +(~~N >>> 0)) / 4294967296) >>> 0 : 0)]; F[a >> 2] = O[0]; F[a + 4 >> 2] = O[1]; break; case "float": Pa[a >> 2] = 0; break; case "double": Qa[a >> 3] = 0; break; case "*": J[a >> 2] = 0; break; default: E("invalid type for setValue: " + b); } } __name(pa, "pa"); var db = /* @__PURE__ */ __name((a, b) => { for (var c = 0, d = a.length - 1; 0 <= d; d--) { var f = a[d]; f === "." ? a.splice(d, 1) : f === ".." ? (a.splice(d, 1), c++) : c && (a.splice(d, 1), c--); } if (b) for (; c; c--) a.unshift(".."); return a; }, "db"), z = /* @__PURE__ */ __name((a) => { var b = a.charAt(0) === "/", c = a.substr(-1) === "/"; (a = db(a.split("/").filter((d) => !!d), !b).join("/")) || b || (a = "."); a && c && (a += "/"); return (b ? "/" : "") + a; }, "z"), eb = /* @__PURE__ */ __name((a) => { var b = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1); a = b[0]; b = b[1]; if (!a && !b) return "."; b && (b = b.substr(0, b.length - 1)); return a + b; }, "eb"), fb = /* @__PURE__ */ __name((a) => { if (a === "/") return "/"; a = z(a); a = a.replace(/\/$/, ""); var b = a.lastIndexOf("/"); return b === -1 ? a : a.substr(b + 1); }, "fb"); function gb() { if (typeof crypto == "object" && typeof crypto.getRandomValues == "function") { var a = new Uint8Array(1); return () => { crypto.getRandomValues(a); return a[0]; }; } if (Aa) try { var b = require("crypto"); return () => b.randomBytes(1)[0]; } catch (c) { } return () => E("randomDevice"); } __name(gb, "gb"); function hb() { for (var a = "", b = false, c = arguments.length - 1; -1 <= c && !b; c--) { b = 0 <= c ? arguments[c] : "/"; if (typeof b != "string") throw new TypeError("Arguments to path.resolve must be strings"); if (!b) return ""; a = b + "/" + a; b = b.charAt(0) === "/"; } a = db(a.split("/").filter((d) => !!d), !b).join("/"); return (b ? "/" : "") + a || "."; } __name(hb, "hb"); function ma(a, b) { var c = Array(ca(a) + 1); a = t(a, c, 0, c.length); b && (c.length = a); return c; } __name(ma, "ma"); var ib = []; function jb(a, b) { ib[a] = { input: [], output: [], Xa: b }; lb(a, mb); } __name(jb, "jb"); var mb = { open: function(a) { var b = ib[a.node.rdev]; if (!b) throw new P(43); a.tty = b; a.seekable = false; }, close: function(a) { a.tty.Xa.fsync(a.tty); }, fsync: function(a) { a.tty.Xa.fsync(a.tty); }, read: function(a, b, c, d) { if (!a.tty || !a.tty.Xa.tb) throw new P(60); for (var f = 0, h = 0; h < d; h++) { try { var k = a.tty.Xa.tb(a.tty); } catch (q) { throw new P(29); } if (k === void 0 && f === 0) throw new P(6); if (k === null || k === void 0) break; f++; b[c + h] = k; } f && (a.node.timestamp = Date.now()); return f; }, write: function(a, b, c, d) { if (!a.tty || !a.tty.Xa.jb) throw new P(60); try { for (var f = 0; f < d; f++) a.tty.Xa.jb(a.tty, b[c + f]); } catch (h) { throw new P(29); } d && (a.node.timestamp = Date.now()); return f; } }, tb = { tb: function(a) { if (!a.input.length) { var b = null; if (Aa) { var c = Buffer.alloc(256), d = 0; try { d = fs3.readSync(process.stdin.fd, c, 0, 256, -1); } catch (f) { if (f.toString().includes("EOF")) d = 0; else throw f; } 0 < d ? b = c.slice(0, d).toString("utf-8") : b = null; } else typeof window != "undefined" && typeof window.prompt == "function" ? (b = window.prompt("Input: "), b !== null && (b += "\n")) : typeof readline == "function" && (b = readline(), b !== null && (b += "\n")); if (!b) return null; a.input = ma(b, true); } return a.input.shift(); }, jb: function(a, b) { b === null || b === 10 ? (Ga(Ma(a.output, 0)), a.output = []) : b != 0 && a.output.push(b); }, fsync: function(a) { a.output && 0 < a.output.length && (Ga(Ma(a.output, 0)), a.output = []); } }, ub = { jb: function(a, b) { b === null || b === 10 ? (Ha(Ma(a.output, 0)), a.output = []) : b != 0 && a.output.push(b); }, fsync: function(a) { a.output && 0 < a.output.length && (Ha(Ma(a.output, 0)), a.output = []); } }, Q = { Qa: null, Ra: function() { return Q.createNode(null, "/", 16895, 0); }, createNode: function(a, b, c, d) { if ((c & 61440) === 24576 || (c & 61440) === 4096) throw new P(63); Q.Qa || (Q.Qa = { dir: { node: { Pa: Q.Ga.Pa, Oa: Q.Ga.Oa, lookup: Q.Ga.lookup, ab: Q.Ga.ab, rename: Q.Ga.rename, unlink: Q.Ga.unlink, rmdir: Q.Ga.rmdir, readdir: Q.Ga.readdir, symlink: Q.Ga.symlink }, stream: { Ta: Q.Ha.Ta } }, file: { node: { Pa: Q.Ga.Pa, Oa: Q.Ga.Oa }, stream: { Ta: Q.Ha.Ta, read: Q.Ha.read, write: Q.Ha.write, lb: Q.Ha.lb, bb: Q.Ha.bb, cb: Q.Ha.cb } }, link: { node: { Pa: Q.Ga.Pa, Oa: Q.Ga.Oa, readlink: Q.Ga.readlink }, stream: {} }, pb: { node: { Pa: Q.Ga.Pa, Oa: Q.Ga.Oa }, stream: vb } }); c = wb(a, b, c, d); (c.mode & 61440) === 16384 ? (c.Ga = Q.Qa.dir.node, c.Ha = Q.Qa.dir.stream, c.Ia = {}) : (c.mode & 61440) === 32768 ? (c.Ga = Q.Qa.file.node, c.Ha = Q.Qa.file.stream, c.Ma = 0, c.Ia = null) : (c.mode & 61440) === 40960 ? (c.Ga = Q.Qa.link.node, c.Ha = Q.Qa.link.stream) : (c.mode & 61440) === 8192 && (c.Ga = Q.Qa.pb.node, c.Ha = Q.Qa.pb.stream); c.timestamp = Date.now(); a && (a.Ia[b] = c, a.timestamp = c.timestamp); return c; }, Jb: function(a) { return a.Ia ? a.Ia.subarray ? a.Ia.subarray(0, a.Ma) : new Uint8Array(a.Ia) : new Uint8Array(0); }, qb: function(a, b) { var c = a.Ia ? a.Ia.length : 0; c >= b || (b = Math.max(b, c * (1048576 > c ? 2 : 1.125) >>> 0), c != 0 && (b = Math.max(b, 256)), c = a.Ia, a.Ia = new Uint8Array(b), 0 < a.Ma && a.Ia.set(c.subarray(0, a.Ma), 0)); }, Gb: function(a, b) { if (a.Ma != b) if (b == 0) a.Ia = null, a.Ma = 0; else { var c = a.Ia; a.Ia = new Uint8Array(b); c && a.Ia.set(c.subarray(0, Math.min(b, a.Ma))); a.Ma = b; } }, Ga: { Pa: function(a) { var b = {}; b.dev = (a.mode & 61440) === 8192 ? a.id : 1; b.ino = a.id; b.mode = a.mode; b.nlink = 1; b.uid = 0; b.gid = 0; b.rdev = a.rdev; (a.mode & 61440) === 16384 ? b.size = 4096 : (a.mode & 61440) === 32768 ? b.size = a.Ma : (a.mode & 61440) === 40960 ? b.size = a.link.length : b.size = 0; b.atime = new Date(a.timestamp); b.mtime = new Date(a.timestamp); b.ctime = new Date(a.timestamp); b.Ab = 4096; b.blocks = Math.ceil(b.size / b.Ab); return b; }, Oa: function(a, b) { b.mode !== void 0 && (a.mode = b.mode); b.timestamp !== void 0 && (a.timestamp = b.timestamp); b.size !== void 0 && Q.Gb(a, b.size); }, lookup: function() { throw xb[44]; }, ab: function(a, b, c, d) { return Q.createNode(a, b, c, d); }, rename: function(a, b, c) { if ((a.mode & 61440) === 16384) { try { var d = yb(b, c); } catch (h) { } if (d) for (var f in d.Ia) throw new P(55); } delete a.parent.Ia[a.name]; a.parent.timestamp = Date.now(); a.name = c; b.Ia[c] = a; b.timestamp = a.parent.timestamp; a.parent = b; }, unlink: function(a, b) { delete a.Ia[b]; a.timestamp = Date.now(); }, rmdir: function(a, b) { var c = yb(a, b), d; for (d in c.Ia) throw new P(55); delete a.Ia[b]; a.timestamp = Date.now(); }, readdir: function(a) { var b = [".", ".."], c; for (c in a.Ia) a.Ia.hasOwnProperty(c) && b.push(c); return b; }, symlink: function(a, b, c) { a = Q.createNode(a, b, 41471, 0); a.link = c; return a; }, readlink: function(a) { if ((a.mode & 61440) !== 40960) throw new P(28); return a.link; } }, Ha: { read: function(a, b, c, d, f) { var h = a.node.Ia; if (f >= a.node.Ma) return 0; a = Math.min(a.node.Ma - f, d); if (8 < a && h.subarray) b.set(h.subarray(f, f + a), c); else for (d = 0; d < a; d++) b[c + d] = h[f + d]; return a; }, write: function(a, b, c, d, f, h) { b.buffer === r.buffer && (h = false); if (!d) return 0; a = a.node; a.timestamp = Date.now(); if (b.subarray && (!a.Ia || a.Ia.subarray)) { if (h) return a.Ia = b.subarray(c, c + d), a.Ma = d; if (a.Ma === 0 && f === 0) return a.Ia = b.slice(c, c + d), a.Ma = d; if (f + d <= a.Ma) return a.Ia.set(b.subarray(c, c + d), f), d; } Q.qb(a, f + d); if (a.Ia.subarray && b.subarray) a.Ia.set(b.subarray(c, c + d), f); else for (h = 0; h < d; h++) a.Ia[f + h] = b[c + h]; a.Ma = Math.max(a.Ma, f + d); return d; }, Ta: function(a, b, c) { c === 1 ? b += a.position : c === 2 && (a.node.mode & 61440) === 32768 && (b += a.node.Ma); if (0 > b) throw new P(28); return b; }, lb: function(a, b, c) { Q.qb(a.node, b + c); a.node.Ma = Math.max(a.node.Ma, b + c); }, bb: function(a, b, c, d, f) { if ((a.node.mode & 61440) !== 32768) throw new P(43); a = a.node.Ia; if (f & 2 || a.buffer !== Na) { if (0 < c || c + b < a.length) a.subarray ? a = a.subarray(c, c + b) : a = Array.prototype.slice.call(a, c, c + b); c = true; b = 65536 * Math.ceil(b / 65536); (f = zb(65536, b)) ? (u.fill(0, f, f + b), b = f) : b = 0; if (!b) throw new P(48); r.set(a, b); } else c = false, b = a.byteOffset; return { Fb: b, vb: c }; }, cb: function(a, b, c, d, f) { if ((a.node.mode & 61440) !== 32768) throw new P(43); if (f & 2) return 0; Q.Ha.write(a, b, 0, d, c, false); return 0; } } }, Ab = null, Bb = {}, R = [], Cb = 1, T = null, Db = true, P = null, xb = {}, U = /* @__PURE__ */ __name((a, b = {}) => { a = hb("/", a); if (!a) return { path: "", node: null }; b = Object.assign({ rb: true, kb: 0 }, b); if (8 < b.kb) throw new P(32); a = db(a.split("/").filter((k) => !!k), false); for (var c = Ab, d = "/", f = 0; f < a.length; f++) { var h = f === a.length - 1; if (h && b.parent) break; c = yb(c, a[f]); d = z(d + "/" + a[f]); c.Va && (!h || h && b.rb) && (c = c.Va.root); if (!h || b.Sa) { for (h = 0; (c.mode & 61440) === 40960; ) if (c = Eb(d), d = hb(eb(d), c), c = U(d, { kb: b.kb + 1 }).node, 40 < h++) throw new P(32); } } return { path: d, node: c }; }, "U"), ea = /* @__PURE__ */ __name((a) => { for (var b; ; ) { if (a === a.parent) return a = a.Ra.ub, b ? a[a.length - 1] !== "/" ? a + "/" + b : a + b : a; b = b ? a.name + "/" + b : a.name; a = a.parent; } }, "ea"), Fb = /* @__PURE__ */ __name((a, b) => { for (var c = 0, d = 0; d < b.length; d++) c = (c << 5) - c + b.charCodeAt(d) | 0; return (a + c >>> 0) % T.length; }, "Fb"), Gb = /* @__PURE__ */ __name((a) => { var b = Fb(a.parent.id, a.name); if (T[b] === a) T[b] = a.Wa; else for (b = T[b]; b; ) { if (b.Wa === a) { b.Wa = a.Wa; break; } b = b.Wa; } }, "Gb"), yb = /* @__PURE__ */ __name((a, b) => { var c; if (c = (c = Hb(a, "x")) ? c : a.Ga.lookup ? 0 : 2) throw new P(c, a); for (c = T[Fb(a.id, b)]; c; c = c.Wa) { var d = c.name; if (c.parent.id === a.id && d === b) return c; } return a.Ga.lookup(a, b); }, "yb"), wb = /* @__PURE__ */ __name((a, b, c, d) => { a = new Ib(a, b, c, d); b = Fb(a.parent.id, a.name); a.Wa = T[b]; return T[b] = a; }, "wb"), Jb = { r: 0, "r+": 2, w: 577, "w+": 578, a: 1089, "a+": 1090 }, Kb = /* @__PURE__ */ __name((a) => { var b = ["r", "w", "rw"][a & 3]; a & 512 && (b += "w"); return b; }, "Kb"), Hb = /* @__PURE__ */ __name((a, b) => { if (Db) return 0; if (!b.includes("r") || a.mode & 292) { if (b.includes("w") && !(a.mode & 146) || b.includes("x") && !(a.mode & 73)) return 2; } else return 2; return 0; }, "Hb"), Lb = /* @__PURE__ */ __name((a, b) => { try { return yb(a, b), 20; } catch (c) { } return Hb(a, "wx"); }, "Lb"), Mb = /* @__PURE__ */ __name((a, b, c) => { try { var d = yb(a, b); } catch (f) { return f.Ka; } if (a = Hb(a, "wx")) return a; if (c) { if ((d.mode & 61440) !== 16384) return 54; if (d === d.parent || ea(d) === "/") return 10; } else if ((d.mode & 61440) === 16384) return 31; return 0; }, "Mb"), Nb = /* @__PURE__ */ __name((a = 0) => { for (; 4096 >= a; a++) if (!R[a]) return a; throw new P(33); }, "Nb"), Pb = /* @__PURE__ */ __name((a, b) => { Ob || (Ob = /* @__PURE__ */ __name(function() { this.$a = {}; }, "Ob"), Ob.prototype = {}, Object.defineProperties(Ob.prototype, { object: { get: function() { return this.node; }, set: function(c) { this.node = c; } }, flags: { get: function() { return this.$a.flags; }, set: function(c) { this.$a.flags = c; } }, position: { get: function() { return this.$a.position; }, set: function(c) { this.$a.position = c; } } })); a = Object.assign(new Ob(), a); b = Nb(b); a.fd = b; return R[b] = a; }, "Pb"), vb = { open: (a) => { a.Ha = Bb[a.node.rdev].Ha; a.Ha.open && a.Ha.open(a); }, Ta: () => { throw new P(70); } }, lb = /* @__PURE__ */ __name((a, b) => { Bb[a] = { Ha: b }; }, "lb"), Qb = /* @__PURE__ */ __name((a, b) => { var c = b === "/", d = !b; if (c && Ab) throw new P(10); if (!c && !d) { var f = U(b, { rb: false }); b = f.path; f = f.node; if (f.Va) throw new P(10); if ((f.mode & 61440) !== 16384) throw new P(54); } b = { type: a, Kb: {}, ub: b, Eb: [] }; a = a.Ra(b); a.Ra = b; b.root = a; c ? Ab = a : f && (f.Va = b, f.Ra && f.Ra.Eb.push(b)); }, "Qb"), ha = /* @__PURE__ */ __name((a, b, c) => { var d = U(a, { parent: true }).node; a = fb(a); if (!a || a === "." || a === "..") throw new P(28); var f = Lb(d, a); if (f) throw new P(f); if (!d.Ga.ab) throw new P(63); return d.Ga.ab(d, a, b, c); }, "ha"), V = /* @__PURE__ */ __name((a, b) => ha(a, (b !== void 0 ? b : 511) & 1023 | 16384, 0), "V"), Rb = /* @__PURE__ */ __name((a, b, c) => { typeof c == "undefined" && (c = b, b = 438); ha(a, b | 8192, c); }, "Rb"), Sb = /* @__PURE__ */ __name((a, b) => { if (!hb(a)) throw new P(44); var c = U(b, { parent: true }).node; if (!c) throw new P(44); b = fb(b); var d = Lb(c, b); if (d) throw new P(d); if (!c.Ga.symlink) throw new P(63); c.Ga.symlink(c, b, a); }, "Sb"), Tb = /* @__PURE__ */ __name((a) => { var b = U(a, { parent: true }).node; a = fb(a); var c = yb(b, a), d = Mb(b, a, true); if (d) throw new P(d); if (!b.Ga.rmdir) throw new P(63); if (c.Va) throw new P(10); b.Ga.rmdir(b, a); Gb(c); }, "Tb"), ta = /* @__PURE__ */ __name((a) => { var b = U(a, { parent: true }).node; if (!b) throw new P(44); a = fb(a); var c = yb(b, a), d = Mb(b, a, false); if (d) throw new P(d); if (!b.Ga.unlink) throw new P(63); if (c.Va) throw new P(10); b.Ga.unlink(b, a); Gb(c); }, "ta"), Eb = /* @__PURE__ */ __name((a) => { a = U(a).node; if (!a) throw new P(44); if (!a.Ga.readlink) throw new P(28); return hb(ea(a.parent), a.Ga.readlink(a)); }, "Eb"), Ub = /* @__PURE__ */ __name((a, b) => { a = U(a, { Sa: !b }).node; if (!a) throw new P(44); if (!a.Ga.Pa) throw new P(63); return a.Ga.Pa(a); }, "Ub"), Vb = /* @__PURE__ */ __name((a) => Ub(a, true), "Vb"), ia = /* @__PURE__ */ __name((a, b) => { a = typeof a == "string" ? U(a, { Sa: true }).node : a; if (!a.Ga.Oa) throw new P(63); a.Ga.Oa(a, { mode: b & 4095 | a.mode & -4096, timestamp: Date.now() }); }, "ia"), Wb = /* @__PURE__ */ __name((a, b) => { if (0 > b) throw new P(28); a = typeof a == "string" ? U(a, { Sa: true }).node : a; if (!a.Ga.Oa) throw new P(63); if ((a.mode & 61440) === 16384) throw new P(31); if ((a.mode & 61440) !== 32768) throw new P(28); var c = Hb(a, "w"); if (c) throw new P(c); a.Ga.Oa(a, { size: b, timestamp: Date.now() }); }, "Wb"), ja = /* @__PURE__ */ __name((a, b, c) => { if (a === "") throw new P(44); if (typeof b == "string") { var d = Jb[b]; if (typeof d == "undefined") throw Error("Unknown file open mode: " + b); b = d; } c = b & 64 ? (typeof c == "undefined" ? 438 : c) & 4095 | 32768 : 0; if (typeof a == "object") var f = a; else { a = z(a); try { f = U(a, { Sa: !(b & 131072) }).node; } catch (h) { } } d = false; if (b & 64) if (f) { if (b & 128) throw new P(20); } else f = ha(a, c, 0), d = true; if (!f) throw new P(44); (f.mode & 61440) === 8192 && (b &= -513); if (b & 65536 && (f.mode & 61440) !== 16384) throw new P(54); if (!d && (c = f ? (f.mode & 61440) === 40960 ? 32 : (f.mode & 61440) === 16384 && (Kb(b) !== "r" || b & 512) ? 31 : Hb(f, Kb(b)) : 44)) throw new P(c); b & 512 && !d && Wb(f, 0); b &= -131713; f = Pb({ node: f, path: ea(f), flags: b, seekable: true, position: 0, Ha: f.Ha, Ib: [], error: false }); f.Ha.open && f.Ha.open(f); !e.logReadFiles || b & 1 || (Xb || (Xb = {}), a in Xb || (Xb[a] = 1)); return f; }, "ja"), la = /* @__PURE__ */ __name((a) => { if (a.fd === null) throw new P(8); a.hb && (a.hb = null); try { a.Ha.close && a.Ha.close(a); } catch (b) { throw b; } finally { R[a.fd] = null; } a.fd = null; }, "la"), Yb = /* @__PURE__ */ __name((a, b, c) => { if (a.fd === null) throw new P(8); if (!a.seekable || !a.Ha.Ta) throw new P(70); if (c != 0 && c != 1 && c != 2) throw new P(28); a.position = a.Ha.Ta(a, b, c); a.Ib = []; }, "Yb"), Zb = /* @__PURE__ */ __name((a, b, c, d, f) => { if (0 > d || 0 > f) throw new P(28); if (a.fd === null) throw new P(8); if ((a.flags & 2097155) === 1) throw new P(8); if ((a.node.mode & 61440) === 16384) throw new P(31); if (!a.Ha.read) throw new P(28); var h = typeof f != "undefined"; if (!h) f = a.position; else if (!a.seekable) throw new P(70); b = a.Ha.read(a, b, c, d, f); h || (a.position += b); return b; }, "Zb"), ka = /* @__PURE__ */ __name((a, b, c, d, f) => { if (0 > d || 0 > f) throw new P(28); if (a.fd === null) throw new P(8); if ((a.flags & 2097155) === 0) throw new P(8); if ((a.node.mode & 61440) === 16384) throw new P(31); if (!a.Ha.write) throw new P(28); a.seekable && a.flags & 1024 && Yb(a, 0, 2); var h = typeof f != "undefined"; if (!h) f = a.position; else if (!a.seekable) throw new P(70); b = a.Ha.write(a, b, c, d, f, void 0); h || (a.position += b); return b; }, "ka"), sa = /* @__PURE__ */ __name((a) => { var b = "binary"; if (b !== "utf8" && b !== "binary") throw Error('Invalid encoding type "' + b + '"'); var c; var d = ja(a, d || 0); a = Ub(a).size; var f = new Uint8Array(a); Zb(d, f, 0, a, 0); b === "utf8" ? c = Ma(f, 0) : b === "binary" && (c = f); la(d); return c; }, "sa"), $b = /* @__PURE__ */ __name(() => { P || (P = /* @__PURE__ */ __name(function(a, b) { this.node = b; this.Hb = function(c) { this.Ka = c; }; this.Hb(a); this.message = "FS error"; }, "P"), P.prototype = Error(), P.prototype.constructor = P, [44].forEach((a) => { xb[a] = new P(a); xb[a].stack = ""; })); }, "$b"), ac, fa = /* @__PURE__ */ __name((a, b) => { var c = 0; a && (c |= 365); b && (c |= 146); return c; }, "fa"), cc = /* @__PURE__ */ __name((a, b, c) => { a = z("/dev/" + a); var d = fa(!!b, !!c); bc || (bc = 64); var f = bc++ << 8 | 0; lb(f, { open: (h) => { h.seekable = false; }, close: () => { c && c.buffer && c.buffer.length && c(10); }, read: (h, k, q, x) => { for (var w = 0, A = 0; A < x; A++) { try { var S = b(); } catch (nb) { throw new P(29); } if (S === void 0 && w === 0) throw new P(6); if (S === null || S === void 0) break; w++; k[q + A] = S; } w && (h.node.timestamp = Date.now()); return w; }, write: (h, k, q, x) => { for (var w = 0; w < x; w++) try { c(k[q + w]); } catch (A) { throw new P(29); } x && (h.node.timestamp = Date.now()); return w; } }); Rb(a, d, f); }, "cc"), bc, W = {}, Ob, Xb; function dc(a, b, c) { if (b.charAt(0) === "/") return b; a = a === -100 ? "/" : X(a).path; if (b.length == 0) { if (!c) throw new P(44); return a; } return z(a + "/" + b); } __name(dc, "dc"); function ec(a, b, c) { try { var d = a(b); } catch (f) { if (f && f.node && z(b) !== z(ea(f.node))) return -54; throw f; } F[c >> 2] = d.dev; F[c + 8 >> 2] = d.ino; F[c + 12 >> 2] = d.mode; J[c + 16 >> 2] = d.nlink; F[c + 20 >> 2] = d.uid; F[c + 24 >> 2] = d.gid; F[c + 28 >> 2] = d.rdev; O = [d.size >>> 0, (N = d.size, 1 <= +Math.abs(N) ? 0 < N ? (Math.min(+Math.floor(N / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N - +(~~N >>> 0)) / 4294967296) >>> 0 : 0)]; F[c + 40 >> 2] = O[0]; F[c + 44 >> 2] = O[1]; F[c + 48 >> 2] = 4096; F[c + 52 >> 2] = d.blocks; O = [Math.floor(d.atime.getTime() / 1e3) >>> 0, (N = Math.floor(d.atime.getTime() / 1e3), 1 <= +Math.abs(N) ? 0 < N ? (Math.min(+Math.floor(N / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N - +(~~N >>> 0)) / 4294967296) >>> 0 : 0)]; F[c + 56 >> 2] = O[0]; F[c + 60 >> 2] = O[1]; J[c + 64 >> 2] = 0; O = [Math.floor(d.mtime.getTime() / 1e3) >>> 0, (N = Math.floor(d.mtime.getTime() / 1e3), 1 <= +Math.abs(N) ? 0 < N ? (Math.min(+Math.floor(N / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N - +(~~N >>> 0)) / 4294967296) >>> 0 : 0)]; F[c + 72 >> 2] = O[0]; F[c + 76 >> 2] = O[1]; J[c + 80 >> 2] = 0; O = [Math.floor(d.ctime.getTime() / 1e3) >>> 0, (N = Math.floor(d.ctime.getTime() / 1e3), 1 <= +Math.abs(N) ? 0 < N ? (Math.min(+Math.floor(N / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N - +(~~N >>> 0)) / 4294967296) >>> 0 : 0)]; F[c + 88 >> 2] = O[0]; F[c + 92 >> 2] = O[1]; J[c + 96 >> 2] = 0; O = [d.ino >>> 0, (N = d.ino, 1 <= +Math.abs(N) ? 0 < N ? (Math.min(+Math.floor(N / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N - +(~~N >>> 0)) / 4294967296) >>> 0 : 0)]; F[c + 104 >> 2] = O[0]; F[c + 108 >> 2] = O[1]; return 0; } __name(ec, "ec"); var fc = void 0; function Hc() { fc += 4; return F[fc - 4 >> 2]; } __name(Hc, "Hc"); function X(a) { a = R[a]; if (!a) throw new P(8); return a; } __name(X, "X"); function Jc(a) { return J[a >> 2] + 4294967296 * F[a + 4 >> 2]; } __name(Jc, "Jc"); function Kc(a) { var b = ca(a) + 1, c = da(b); c && t(a, r, c, b); return c; } __name(Kc, "Kc"); function Lc(a, b, c) { function d(x) { return (x = x.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? x[1] : "GMT"; } __name(d, "d"); var f = new Date().getFullYear(), h = new Date(f, 0, 1), k = new Date(f, 6, 1); f = h.getTimezoneOffset(); var q = k.getTimezoneOffset(); F[a >> 2] = 60 * Math.max(f, q); F[b >> 2] = Number(f != q); a = d(h); b = d(k); a = Kc(a); b = Kc(b); q < f ? (J[c >> 2] = a, J[c + 4 >> 2] = b) : (J[c >> 2] = b, J[c + 4 >> 2] = a); } __name(Lc, "Lc"); function Mc(a, b, c) { Mc.Bb || (Mc.Bb = true, Lc(a, b, c)); } __name(Mc, "Mc"); var Nc; Nc = Aa ? () => { var a = process.hrtime(); return 1e3 * a[0] + a[1] / 1e6; } : () => performance.now(); var Oc = {}; function Pc() { if (!Qc) { var a = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: wa || "./this.program" }, b; for (b in Oc) Oc[b] === void 0 ? delete a[b] : a[b] = Oc[b]; var c = []; for (b in a) c.push(b + "=" + a[b]); Qc = c; } return Qc; } __name(Pc, "Pc"); var Qc, Y = void 0, Rc = []; function ua(a, b) { if (!Y) { Y = /* @__PURE__ */ new WeakMap(); var c = K.length; if (Y) for (var d = 0; d < 0 + c; d++) { var f = K.get(d); f && Y.set(f, d); } } if (Y.has(a)) return Y.get(a); if (Rc.length) c = Rc.pop(); else { try { K.grow(1); } catch (q) { if (!(q instanceof RangeError)) throw q; throw "Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."; } c = K.length - 1; } try { K.set(c, a); } catch (q) { if (!(q instanceof TypeError)) throw q; if (typeof WebAssembly.Function == "function") { d = WebAssembly.Function; f = { i: "i32", j: "i64", f: "f32", d: "f64", p: "i32" }; for (var h = { parameters: [], results: b[0] == "v" ? [] : [f[b[0]]] }, k = 1; k < b.length; ++k) h.parameters.push(f[b[k]]); b = new d(h, a); } else { d = [1, 96]; f = b.slice(0, 1); b = b.slice(1); h = { i: 127, p: 127, j: 126, f: 125, d: 124 }; k = b.length; 128 > k ? d.push(k) : d.push(k % 128 | 128, k >> 7); for (k = 0; k < b.length; ++k) d.push(h[b[k]]); f == "v" ? d.push(0) : d.push(1, h[f]); b = [0, 97, 115, 109, 1, 0, 0, 0, 1]; f = d.length; 128 > f ? b.push(f) : b.push(f % 128 | 128, f >> 7); b.push.apply(b, d); b.push(2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0); b = new WebAssembly.Module(new Uint8Array(b)); b = new WebAssembly.Instance(b, { e: { f: a } }).exports.f; } K.set(c, b); } Y.set(a, c); return c; } __name(ua, "ua"); function ra(a) { Y.delete(K.get(a)); Rc.push(a); } __name(ra, "ra"); var Sc = 0, Tc = 1; function aa(a) { var b = Sc == Tc ? B(a.length) : da(a.length); a.subarray || a.slice || (a = new Uint8Array(a)); u.set(a, b); return b; } __name(aa, "aa"); function Uc(a, b, c, d) { var f = { string: (w) => { var A = 0; if (w !== null && w !== void 0 && w !== 0) { var S = (w.length << 2) + 1; A = B(S); t(w, u, A, S); } return A; }, array: (w) => { var A = B(w.length); r.set(w, A); return A; } }; a = e["_" + a]; var h = [], k = 0; if (d) for (var q = 0; q < d.length; q++) { var x = f[c[q]]; x ? (k === 0 && (k = oa()), h[q] = x(d[q])) : h[q] = d[q]; } c = a.apply(null, h); return c = function(w) { k !== 0 && qa(k); return b === "string" ? C(w) : b === "boolean" ? !!w : w; }(c); } __name(Uc, "Uc"); function Ib(a, b, c, d) { a || (a = this); this.parent = a; this.Ra = a.Ra; this.Va = null; this.id = Cb++; this.name = b; this.mode = c; this.Ga = {}; this.Ha = {}; this.rdev = d; } __name(Ib, "Ib"); Object.defineProperties(Ib.prototype, { read: { get: function() { return (this.mode & 365) === 365; }, set: function(a) { a ? this.mode |= 365 : this.mode &= -366; } }, write: { get: function() { return (this.mode & 146) === 146; }, set: function(a) { a ? this.mode |= 146 : this.mode &= -147; } } }); $b(); T = Array(4096); Qb(Q, "/"); V("/tmp"); V("/home"); V("/home/web_user"); (() => { V("/dev"); lb(259, { read: () => 0, write: (b, c, d, f) => f }); Rb("/dev/null", 259); jb(1280, tb); jb(1536, ub); Rb("/dev/tty", 1280); Rb("/dev/tty1", 1536); var a = gb(); cc("random", a); cc("urandom", a); V("/dev/shm"); V("/dev/shm/tmp"); })(); (() => { V("/proc"); var a = V("/proc/self"); V("/proc/self/fd"); Qb({ Ra: () => { var b = wb(a, "fd", 16895, 73); b.Ga = { lookup: (c, d) => { var f = R[+d]; if (!f) throw new P(8); c = { parent: null, Ra: { ub: "fake" }, Ga: { readlink: () => f.path } }; return c.parent = c; } }; return b; } }, "/proc/self/fd"); })(); var Wc = { a: function(a, b, c, d) { E("Assertion failed: " + C(a) + ", at: " + [b ? C(b) : "unknown filename", c, d ? C(d) : "unknown function"]); }, h: function(a, b) { try { return a = C(a), ia(a, b), 0; } catch (c) { if (typeof W == "undefined" || !(c instanceof P)) throw c; return -c.Ka; } }, H: function(a, b, c) { try { b = C(b); b = dc(a, b); if (c & -8) return -28; var d = U(b, { Sa: true }).node; if (!d) return -44; a = ""; c & 4 && (a += "r"); c & 2 && (a += "w"); c & 1 && (a += "x"); return a && Hb(d, a) ? -2 : 0; } catch (f) { if (typeof W == "undefined" || !(f instanceof P)) throw f; return -f.Ka; } }, i: function(a, b) { try { var c = R[a]; if (!c) throw new P(8); ia(c.node, b); return 0; } catch (d) { if (typeof W == "undefined" || !(d instanceof P)) throw d; return -d.Ka; } }, g: function(a) { try { var b = R[a]; if (!b) throw new P(8); var c = b.node; var d = typeof c == "string" ? U(c, { Sa: true }).node : c; if (!d.Ga.Oa) throw new P(63); d.Ga.Oa(d, { timestamp: Date.now() }); return 0; } catch (f) { if (typeof W == "undefined" || !(f instanceof P)) throw f; return -f.Ka; } }, b: function(a, b, c) { fc = c; try { var d = X(a); switch (b) { case 0: var f = Hc(); return 0 > f ? -28 : Pb(d, f).fd; case 1: case 2: return 0; case 3: return d.flags; case 4: return f = Hc(), d.flags |= f, 0; case 5: return f = Hc(), Oa[f + 0 >> 1] = 2, 0; case 6: case 7: return 0; case 16: case 8: return -28; case 9: return F[Vc() >> 2] = 28, -1; default: return -28; } } catch (h) { if (typeof W == "undefined" || !(h instanceof P)) throw h; return -h.Ka; } }, G: function(a, b) { try { var c = X(a); return ec(Ub, c.path, b); } catch (d) { if (typeof W == "undefined" || !(d instanceof P)) throw d; return -d.Ka; } }, l: function(a, b, c) { try { b = c + 2097152 >>> 0 < 4194305 - !!b ? (b >>> 0) + 4294967296 * c : NaN; if (isNaN(b)) return -61; var d = R[a]; if (!d) throw new P(8); if ((d.flags & 2097155) === 0) throw new P(28); Wb(d.node, b); return 0; } catch (f) { if (typeof W == "undefined" || !(f instanceof P)) throw f; return -f.Ka; } }, B: function(a, b) { try { if (b === 0) return -28; var c = ca("/") + 1; if (b < c) return -68; t("/", u, a, b); return c; } catch (d) { if (typeof W == "undefined" || !(d instanceof P)) throw d; return -d.Ka; } }, E: function(a, b) { try { return a = C(a), ec(Vb, a, b); } catch (c) { if (typeof W == "undefined" || !(c instanceof P)) throw c; return -c.Ka; } }, y: function(a, b, c) { try { return b = C(b), b = dc(a, b), b = z(b), b[b.length - 1] === "/" && (b = b.substr(0, b.length - 1)), V(b, c), 0; } catch (d) { if (typeof W == "undefined" || !(d instanceof P)) throw d; return -d.Ka; } }, D: function(a, b, c, d) { try { b = C(b); var f = d & 256; b = dc(a, b, d & 4096); return ec(f ? Vb : Ub, b, c); } catch (h) { if (typeof W == "undefined" || !(h instanceof P)) throw h; return -h.Ka; } }, v: function(a, b, c, d) { fc = d; try { b = C(b); b = dc(a, b); var f = d ? Hc() : 0; return ja(b, c, f).fd; } catch (h) { if (typeof W == "undefined" || !(h instanceof P)) throw h; return -h.Ka; } }, t: function(a, b, c, d) { try { b = C(b); b = dc(a, b); if (0 >= d) return -28; var f = Eb(b), h = Math.min(d, ca(f)), k = r[c + h]; t(f, u, c, d + 1); r[c + h] = k; return h; } catch (q) { if (typeof W == "undefined" || !(q instanceof P)) throw q; return -q.Ka; } }, s: function(a) { try { return a = C(a), Tb(a), 0; } catch (b) { if (typeof W == "undefined" || !(b instanceof P)) throw b; return -b.Ka; } }, F: function(a, b) { try { return a = C(a), ec(Ub, a, b); } catch (c) { if (typeof W == "undefined" || !(c instanceof P)) throw c; return -c.Ka; } }, p: function(a, b, c) { try { return b = C(b), b = dc(a, b), c === 0 ? ta(b) : c === 512 ? Tb(b) : E("Invalid flags passed to unlinkat"), 0; } catch (d) { if (typeof W == "undefined" || !(d instanceof P)) throw d; return -d.Ka; } }, o: function(a, b, c) { try { b = C(b); b = dc(a, b, true); if (c) { var d = Jc(c), f = F[c + 8 >> 2]; h = 1e3 * d + f / 1e6; c += 16; d = Jc(c); f = F[c + 8 >> 2]; k = 1e3 * d + f / 1e6; } else var h = Date.now(), k = h; a = h; var q = U(b, { Sa: true }).node; q.Ga.Oa(q, { timestamp: Math.max(a, k) }); return 0; } catch (x) { if (typeof W == "undefined" || !(x instanceof P)) throw x; return -x.Ka; } }, e: function() { return Date.now(); }, j: function(a, b) { a = new Date(1e3 * Jc(a)); F[b >> 2] = a.getSeconds(); F[b + 4 >> 2] = a.getMinutes(); F[b + 8 >> 2] = a.getHours(); F[b + 12 >> 2] = a.getDate(); F[b + 16 >> 2] = a.getMonth(); F[b + 20 >> 2] = a.getFullYear() - 1900; F[b + 24 >> 2] = a.getDay(); var c = new Date(a.getFullYear(), 0, 1); F[b + 28 >> 2] = (a.getTime() - c.getTime()) / 864e5 | 0; F[b + 36 >> 2] = -(60 * a.getTimezoneOffset()); var d = new Date(a.getFullYear(), 6, 1).getTimezoneOffset(); c = c.getTimezoneOffset(); F[b + 32 >> 2] = (d != c && a.getTimezoneOffset() == Math.min(c, d)) | 0; }, w: function(a, b, c, d, f, h) { try { var k = X(d); if ((b & 2) !== 0 && (c & 2) === 0 && (k.flags & 2097155) !== 2) throw new P(2); if ((k.flags & 2097155) === 1) throw new P(2); if (!k.Ha.bb) throw new P(43); var q = k.Ha.bb(k, a, f, b, c); var x = q.Fb; F[h >> 2] = q.vb; return x; } catch (w) { if (typeof W == "undefined" || !(w instanceof P)) throw w; return -w.Ka; } }, x: function(a, b, c, d, f, h) { try { var k = X(f); if (c & 2) { var q = u.slice(a, a + b); k && k.Ha.cb && k.Ha.cb(k, q, h, b, d); } } catch (x) { if (typeof W == "undefined" || !(x instanceof P)) throw x; return -x.Ka; } }, n: Mc, q: function() { return 2147483648; }, d: Nc, c: function(a) { var b = u.length; a >>>= 0; if (2147483648 < a) return false; for (var c = 1; 4 >= c; c *= 2) { var d = b * (1 + 0.2 / c); d = Math.min(d, a + 100663296); var f = Math; d = Math.max(a, d); f = f.min.call(f, 2147483648, d + (65536 - d % 65536) % 65536); a: { try { Ja.grow(f - Na.byteLength + 65535 >>> 16); Ra(); var h = 1; break a; } catch (k) { } h = void 0; } if (h) return true; } return false; }, z: function(a, b) { var c = 0; Pc().forEach(function(d, f) { var h = b + c; f = J[a + 4 * f >> 2] = h; for (h = 0; h < d.length; ++h) r[f++ >> 0] = d.charCodeAt(h); r[f >> 0] = 0; c += d.length + 1; }); return 0; }, A: function(a, b) { var c = Pc(); J[a >> 2] = c.length; var d = 0; c.forEach(function(f) { d += f.length + 1; }); J[b >> 2] = d; return 0; }, f: function(a) { try { var b = X(a); la(b); return 0; } catch (c) { if (typeof W == "undefined" || !(c instanceof P)) throw c; return c.Ka; } }, m: function(a, b) { try { var c = X(a); r[b >> 0] = c.tty ? 2 : (c.mode & 61440) === 16384 ? 3 : (c.mode & 61440) === 40960 ? 7 : 4; return 0; } catch (d) { if (typeof W == "undefined" || !(d instanceof P)) throw d; return d.Ka; } }, u: function(a, b, c, d) { try { a: { var f = X(a); a = b; for (var h = b = 0; h < c; h++) { var k = J[a >> 2], q = J[a + 4 >> 2]; a += 8; var x = Zb(f, r, k, q); if (0 > x) { var w = -1; break a; } b += x; if (x < q) break; } w = b; } J[d >> 2] = w; return 0; } catch (A) { if (typeof W == "undefined" || !(A instanceof P)) throw A; return A.Ka; } }, k: function(a, b, c, d, f) { try { b = c + 2097152 >>> 0 < 4194305 - !!b ? (b >>> 0) + 4294967296 * c : NaN; if (isNaN(b)) return 61; var h = X(a); Yb(h, b, d); O = [h.position >>> 0, (N = h.position, 1 <= +Math.abs(N) ? 0 < N ? (Math.min(+Math.floor(N / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N - +(~~N >>> 0)) / 4294967296) >>> 0 : 0)]; F[f >> 2] = O[0]; F[f + 4 >> 2] = O[1]; h.hb && b === 0 && d === 0 && (h.hb = null); return 0; } catch (k) { if (typeof W == "undefined" || !(k instanceof P)) throw k; return k.Ka; } }, C: function(a) { try { var b = X(a); return b.Ha && b.Ha.fsync ? b.Ha.fsync(b) : 0; } catch (c) { if (typeof W == "undefined" || !(c instanceof P)) throw c; return c.Ka; } }, r: function(a, b, c, d) { try { a: { var f = X(a); a = b; for (var h = b = 0; h < c; h++) { var k = J[a >> 2], q = J[a + 4 >> 2]; a += 8; var x = ka(f, r, k, q); if (0 > x) { var w = -1; break a; } b += x; } w = b; } J[d >> 2] = w; return 0; } catch (A) { if (typeof W == "undefined" || !(A instanceof P)) throw A; return A.Ka; } } }; (function() { function a(f) { e.asm = f.exports; Ja = e.asm.I; Ra(); K = e.asm.Aa; Ta.unshift(e.asm.J); Wa--; e.monitorRunDependencies && e.monitorRunDependencies(Wa); Wa == 0 && (Xa !== null && (clearInterval(Xa), Xa = null), Ya && (f = Ya, Ya = null, f())); } __name(a, "a"); function b(f) { a(f.instance); } __name(b, "b"); function c(f) { return bb().then(function(h) { return WebAssembly.instantiate(h, d); }).then(function(h) { return h; }).then(f, function(h) { Ha("failed to asynchronously prepare wasm: " + h); E(h); }); } __name(c, "c"); var d = { a: Wc }; Wa++; e.monitorRunDependencies && e.monitorRunDependencies(Wa); if (e.instantiateWasm) try { return e.instantiateWasm(d, a); } catch (f) { return Ha("Module.instantiateWasm callback failed with error: " + f), false; } (function() { return Ia || typeof WebAssembly.instantiateStreaming != "function" || Za() || M.startsWith("file://") || Aa || typeof fetch != "function" ? c(b) : fetch(M, { credentials: "same-origin" }).then(function(f) { return WebAssembly.instantiateStreaming(f, d).then(b, function(h) { Ha("wasm streaming compile failed: " + h); Ha("falling back to ArrayBuffer instantiation"); return c(b); }); }); })(); return {}; })(); e.___wasm_call_ctors = function() { return (e.___wasm_call_ctors = e.asm.J).apply(null, arguments); }; e._sqlite3_free = function() { return (e._sqlite3_free = e.asm.K).apply(null, arguments); }; e._sqlite3_value_double = function() { return (e._sqlite3_value_double = e.asm.L).apply(null, arguments); }; e._sqlite3_value_text = function() { return (e._sqlite3_value_text = e.asm.M).apply(null, arguments); }; var Vc = e.___errno_location = function() { return (Vc = e.___errno_location = e.asm.N).apply(null, arguments); }; e._sqlite3_prepare_v2 = function() { return (e._sqlite3_prepare_v2 = e.asm.O).apply(null, arguments); }; e._sqlite3_step = function() { return (e._sqlite3_step = e.asm.P).apply(null, arguments); }; e._sqlite3_finalize = function() { return (e._sqlite3_finalize = e.asm.Q).apply(null, arguments); }; e._sqlite3_reset = function() { return (e._sqlite3_reset = e.asm.R).apply(null, arguments); }; e._sqlite3_value_int = function() { return (e._sqlite3_value_int = e.asm.S).apply(null, arguments); }; e._sqlite3_clear_bindings = function() { return (e._sqlite3_clear_bindings = e.asm.T).apply(null, arguments); }; e._sqlite3_value_blob = function() { return (e._sqlite3_value_blob = e.asm.U).apply(null, arguments); }; e._sqlite3_value_bytes = function() { return (e._sqlite3_value_bytes = e.asm.V).apply(null, arguments); }; e._sqlite3_value_type = function() { return (e._sqlite3_value_type = e.asm.W).apply(null, arguments); }; e._sqlite3_result_blob = function() { return (e._sqlite3_result_blob = e.asm.X).apply(null, arguments); }; e._sqlite3_result_double = function() { return (e._sqlite3_result_double = e.asm.Y).apply(null, arguments); }; e._sqlite3_result_error = function() { return (e._sqlite3_result_error = e.asm.Z).apply(null, arguments); }; e._sqlite3_result_int = function() { return (e._sqlite3_result_int = e.asm._).apply(null, arguments); }; e._sqlite3_result_int64 = function() { return (e._sqlite3_result_int64 = e.asm.$).apply(null, arguments); }; e._sqlite3_result_null = function() { return (e._sqlite3_result_null = e.asm.aa).apply(null, arguments); }; e._sqlite3_result_text = function() { return (e._sqlite3_result_text = e.asm.ba).apply(null, arguments); }; e._sqlite3_sql = function() { return (e._sqlite3_sql = e.asm.ca).apply(null, arguments); }; e._sqlite3_aggregate_context = function() { return (e._sqlite3_aggregate_context = e.asm.da).apply(null, arguments); }; e._sqlite3_column_count = function() { return (e._sqlite3_column_count = e.asm.ea).apply(null, arguments); }; e._sqlite3_data_count = function() { return (e._sqlite3_data_count = e.asm.fa).apply(null, arguments); }; e._sqlite3_column_blob = function() { return (e._sqlite3_column_blob = e.asm.ga).apply(null, arguments); }; e._sqlite3_column_bytes = function() { return (e._sqlite3_column_bytes = e.asm.ha).apply(null, arguments); }; e._sqlite3_column_double = function() { return (e._sqlite3_column_double = e.asm.ia).apply(null, arguments); }; e._sqlite3_column_text = function() { return (e._sqlite3_column_text = e.asm.ja).apply(null, arguments); }; e._sqlite3_column_type = function() { return (e._sqlite3_column_type = e.asm.ka).apply(null, arguments); }; e._sqlite3_column_name = function() { return (e._sqlite3_column_name = e.asm.la).apply(null, arguments); }; e._sqlite3_bind_blob = function() { return (e._sqlite3_bind_blob = e.asm.ma).apply(null, arguments); }; e._sqlite3_bind_double = function() { return (e._sqlite3_bind_double = e.asm.na).apply(null, arguments); }; e._sqlite3_bind_int = function() { return (e._sqlite3_bind_int = e.asm.oa).apply(null, arguments); }; e._sqlite3_bind_text = function() { return (e._sqlite3_bind_text = e.asm.pa).apply(null, arguments); }; e._sqlite3_bind_parameter_index = function() { return (e._sqlite3_bind_parameter_index = e.asm.qa).apply(null, arguments); }; e._sqlite3_normalized_sql = function() { return (e._sqlite3_normalized_sql = e.asm.ra).apply(null, arguments); }; e._sqlite3_errmsg = function() { return (e._sqlite3_errmsg = e.asm.sa).apply(null, arguments); }; e._sqlite3_exec = function() { return (e._sqlite3_exec = e.asm.ta).apply(null, arguments); }; e._sqlite3_changes = function() { return (e._sqlite3_changes = e.asm.ua).apply(null, arguments); }; e._sqlite3_close_v2 = function() { return (e._sqlite3_close_v2 = e.asm.va).apply(null, arguments); }; e._sqlite3_create_function_v2 = function() { return (e._sqlite3_create_function_v2 = e.asm.wa).apply(null, arguments); }; e._sqlite3_open = function() { return (e._sqlite3_open = e.asm.xa).apply(null, arguments); }; var da = e._malloc = function() { return (da = e._malloc = e.asm.ya).apply(null, arguments); }, ba = e._free = function() { return (ba = e._free = e.asm.za).apply(null, arguments); }; e._RegisterExtensionFunctions = function() { return (e._RegisterExtensionFunctions = e.asm.Ba).apply(null, arguments); }; var zb = e._emscripten_builtin_memalign = function() { return (zb = e._emscripten_builtin_memalign = e.asm.Ca).apply(null, arguments); }, oa = e.stackSave = function() { return (oa = e.stackSave = e.asm.Da).apply(null, arguments); }, qa = e.stackRestore = function() { return (qa = e.stackRestore = e.asm.Ea).apply(null, arguments); }, B = e.stackAlloc = function() { return (B = e.stackAlloc = e.asm.Fa).apply(null, arguments); }; e.UTF8ToString = C; e.stackAlloc = B; e.stackSave = oa; e.stackRestore = qa; e.cwrap = function(a, b, c, d) { c = c || []; var f = c.every((h) => h === "number" || h === "boolean"); return b !== "string" && f && !d ? e["_" + a] : function() { return Uc(a, b, c, arguments); }; }; var Xc; Ya = /* @__PURE__ */ __name(function Yc() { Xc || Zc(); Xc || (Ya = Yc); }, "Yc"); function Zc() { function a() { if (!Xc && (Xc = true, e.calledRun = true, !Ka)) { e.noFSInit || ac || (ac = true, $b(), e.stdin = e.stdin, e.stdout = e.stdout, e.stderr = e.stderr, e.stdin ? cc("stdin", e.stdin) : Sb("/dev/tty", "/dev/stdin"), e.stdout ? cc("stdout", null, e.stdout) : Sb("/dev/tty", "/dev/stdout"), e.stderr ? cc("stderr", null, e.stderr) : Sb("/dev/tty1", "/dev/stderr"), ja("/dev/stdin", 0), ja("/dev/stdout", 1), ja("/dev/stderr", 1)); Db = false; cb(Ta); if (e.onRuntimeInitialized) e.onRuntimeInitialized(); if (e.postRun) for (typeof e.postRun == "function" && (e.postRun = [e.postRun]); e.postRun.length; ) { var b = e.postRun.shift(); Ua.unshift(b); } cb(Ua); } } __name(a, "a"); if (!(0 < Wa)) { if (e.preRun) for (typeof e.preRun == "function" && (e.preRun = [e.preRun]); e.preRun.length; ) Va(); cb(Sa); 0 < Wa || (e.setStatus ? (e.setStatus("Running..."), setTimeout(function() { setTimeout(function() { e.setStatus(""); }, 1); a(); }, 1)) : a()); } } __name(Zc, "Zc"); if (e.preInit) for (typeof e.preInit == "function" && (e.preInit = [e.preInit]); 0 < e.preInit.length; ) e.preInit.pop()(); Zc(); return Module; }); return initSqlJsPromise; }, "initSqlJs"); if (typeof exports === "object" && typeof module2 === "object") { module2.exports = initSqlJs2; module2.exports.default = initSqlJs2; } else if (typeof define === "function" && define["amd"]) { define([], function() { return initSqlJs2; }); } else if (typeof exports === "object") { exports["Module"] = initSqlJs2; } } }); // node_modules/xterm/lib/xterm.js var require_xterm = __commonJS({ "node_modules/xterm/lib/xterm.js"(exports, module2) { !function(e, t) { if (typeof exports == "object" && typeof module2 == "object") module2.exports = t(); else if (typeof define == "function" && define.amd) define([], t); else { var i = t(); for (var s in i) (typeof exports == "object" ? exports : e)[s] = i[s]; } }(self, function() { return (() => { "use strict"; var e = { 4567: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.AccessibilityManager = void 0; const s2 = i2(9042), r = i2(6114), n = i2(9924), o = i2(3656), a = i2(844), h = i2(5596), c = i2(9631); class l extends a.Disposable { constructor(e3, t3) { super(), this._terminal = e3, this._renderService = t3, this._liveRegionLineCount = 0, this._charsToConsume = [], this._charsToAnnounce = "", this._accessibilityTreeRoot = document.createElement("div"), this._accessibilityTreeRoot.classList.add("xterm-accessibility"), this._accessibilityTreeRoot.tabIndex = 0, this._rowContainer = document.createElement("div"), this._rowContainer.setAttribute("role", "list"), this._rowContainer.classList.add("xterm-accessibility-tree"), this._rowElements = []; for (let e4 = 0; e4 < this._terminal.rows; e4++) this._rowElements[e4] = this._createAccessibilityTreeNode(), this._rowContainer.appendChild(this._rowElements[e4]); if (this._topBoundaryFocusListener = (e4) => this._onBoundaryFocus(e4, 0), this._bottomBoundaryFocusListener = (e4) => this._onBoundaryFocus(e4, 1), this._rowElements[0].addEventListener("focus", this._topBoundaryFocusListener), this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._refreshRowsDimensions(), this._accessibilityTreeRoot.appendChild(this._rowContainer), this._renderRowsDebouncer = new n.TimeBasedDebouncer(this._renderRows.bind(this)), this._refreshRows(), this._liveRegion = document.createElement("div"), this._liveRegion.classList.add("live-region"), this._liveRegion.setAttribute("aria-live", "assertive"), this._accessibilityTreeRoot.appendChild(this._liveRegion), !this._terminal.element) throw new Error("Cannot enable accessibility before Terminal.open"); this._terminal.element.insertAdjacentElement("afterbegin", this._accessibilityTreeRoot), this.register(this._renderRowsDebouncer), this.register(this._terminal.onResize((e4) => this._onResize(e4.rows))), this.register(this._terminal.onRender((e4) => this._refreshRows(e4.start, e4.end))), this.register(this._terminal.onScroll(() => this._refreshRows())), this.register(this._terminal.onA11yChar((e4) => this._onChar(e4))), this.register(this._terminal.onLineFeed(() => this._onChar("\n"))), this.register(this._terminal.onA11yTab((e4) => this._onTab(e4))), this.register(this._terminal.onKey((e4) => this._onKey(e4.key))), this.register(this._terminal.onBlur(() => this._clearLiveRegion())), this.register(this._renderService.onDimensionsChange(() => this._refreshRowsDimensions())), this._screenDprMonitor = new h.ScreenDprMonitor(window), this.register(this._screenDprMonitor), this._screenDprMonitor.setListener(() => this._refreshRowsDimensions()), this.register((0, o.addDisposableDomListener)(window, "resize", () => this._refreshRowsDimensions())); } dispose() { super.dispose(), (0, c.removeElementFromParent)(this._accessibilityTreeRoot), this._rowElements.length = 0; } _onBoundaryFocus(e3, t3) { const i3 = e3.target, s3 = this._rowElements[t3 === 0 ? 1 : this._rowElements.length - 2]; if (i3.getAttribute("aria-posinset") === (t3 === 0 ? "1" : `${this._terminal.buffer.lines.length}`)) return; if (e3.relatedTarget !== s3) return; let r2, n2; if (t3 === 0 ? (r2 = i3, n2 = this._rowElements.pop(), this._rowContainer.removeChild(n2)) : (r2 = this._rowElements.shift(), n2 = i3, this._rowContainer.removeChild(r2)), r2.removeEventListener("focus", this._topBoundaryFocusListener), n2.removeEventListener("focus", this._bottomBoundaryFocusListener), t3 === 0) { const e4 = this._createAccessibilityTreeNode(); this._rowElements.unshift(e4), this._rowContainer.insertAdjacentElement("afterbegin", e4); } else { const e4 = this._createAccessibilityTreeNode(); this._rowElements.push(e4), this._rowContainer.appendChild(e4); } this._rowElements[0].addEventListener("focus", this._topBoundaryFocusListener), this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._terminal.scrollLines(t3 === 0 ? -1 : 1), this._rowElements[t3 === 0 ? 1 : this._rowElements.length - 2].focus(), e3.preventDefault(), e3.stopImmediatePropagation(); } _onResize(e3) { this._rowElements[this._rowElements.length - 1].removeEventListener("focus", this._bottomBoundaryFocusListener); for (let e4 = this._rowContainer.children.length; e4 < this._terminal.rows; e4++) this._rowElements[e4] = this._createAccessibilityTreeNode(), this._rowContainer.appendChild(this._rowElements[e4]); for (; this._rowElements.length > e3; ) this._rowContainer.removeChild(this._rowElements.pop()); this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._refreshRowsDimensions(); } _createAccessibilityTreeNode() { const e3 = document.createElement("div"); return e3.setAttribute("role", "listitem"), e3.tabIndex = -1, this._refreshRowDimensions(e3), e3; } _onTab(e3) { for (let t3 = 0; t3 < e3; t3++) this._onChar(" "); } _onChar(e3) { this._liveRegionLineCount < 21 && (this._charsToConsume.length > 0 ? this._charsToConsume.shift() !== e3 && (this._charsToAnnounce += e3) : this._charsToAnnounce += e3, e3 === "\n" && (this._liveRegionLineCount++, this._liveRegionLineCount === 21 && (this._liveRegion.textContent += s2.tooMuchOutput)), r.isMac && this._liveRegion.textContent && this._liveRegion.textContent.length > 0 && !this._liveRegion.parentNode && setTimeout(() => { this._accessibilityTreeRoot.appendChild(this._liveRegion); }, 0)); } _clearLiveRegion() { this._liveRegion.textContent = "", this._liveRegionLineCount = 0, r.isMac && (0, c.removeElementFromParent)(this._liveRegion); } _onKey(e3) { this._clearLiveRegion(), this._charsToConsume.push(e3); } _refreshRows(e3, t3) { this._renderRowsDebouncer.refresh(e3, t3, this._terminal.rows); } _renderRows(e3, t3) { const i3 = this._terminal.buffer, s3 = i3.lines.length.toString(); for (let r2 = e3; r2 <= t3; r2++) { const e4 = i3.translateBufferLineToString(i3.ydisp + r2, true), t4 = (i3.ydisp + r2 + 1).toString(), n2 = this._rowElements[r2]; n2 && (e4.length === 0 ? n2.innerText = "\xA0" : n2.textContent = e4, n2.setAttribute("aria-posinset", t4), n2.setAttribute("aria-setsize", s3)); } this._announceCharacters(); } _refreshRowsDimensions() { if (this._renderService.dimensions.actualCellHeight) { this._rowElements.length !== this._terminal.rows && this._onResize(this._terminal.rows); for (let e3 = 0; e3 < this._terminal.rows; e3++) this._refreshRowDimensions(this._rowElements[e3]); } } _refreshRowDimensions(e3) { e3.style.height = `${this._renderService.dimensions.actualCellHeight}px`; } _announceCharacters() { this._charsToAnnounce.length !== 0 && (this._liveRegion.textContent += this._charsToAnnounce, this._charsToAnnounce = ""); } } __name(l, "l"); t2.AccessibilityManager = l; }, 3614: (e2, t2) => { function i2(e3) { return e3.replace(/\r?\n/g, "\r"); } __name(i2, "i"); function s2(e3, t3) { return t3 ? "\x1B[200~" + e3 + "\x1B[201~" : e3; } __name(s2, "s"); function r(e3, t3, r2) { e3 = s2(e3 = i2(e3), r2.decPrivateModes.bracketedPasteMode), r2.triggerDataEvent(e3, true), t3.value = ""; } __name(r, "r"); function n(e3, t3, i3) { const s3 = i3.getBoundingClientRect(), r2 = e3.clientX - s3.left - 10, n2 = e3.clientY - s3.top - 10; t3.style.width = "20px", t3.style.height = "20px", t3.style.left = `${r2}px`, t3.style.top = `${n2}px`, t3.style.zIndex = "1000", t3.focus(); } __name(n, "n"); Object.defineProperty(t2, "__esModule", { value: true }), t2.rightClickHandler = t2.moveTextAreaUnderMouseCursor = t2.paste = t2.handlePasteEvent = t2.copyHandler = t2.bracketTextForPaste = t2.prepareTextForTerminal = void 0, t2.prepareTextForTerminal = i2, t2.bracketTextForPaste = s2, t2.copyHandler = function(e3, t3) { e3.clipboardData && e3.clipboardData.setData("text/plain", t3.selectionText), e3.preventDefault(); }, t2.handlePasteEvent = function(e3, t3, i3) { e3.stopPropagation(), e3.clipboardData && r(e3.clipboardData.getData("text/plain"), t3, i3); }, t2.paste = r, t2.moveTextAreaUnderMouseCursor = n, t2.rightClickHandler = function(e3, t3, i3, s3, r2) { n(e3, t3, i3), r2 && s3.rightClickSelect(e3), t3.value = s3.selectionText, t3.select(); }; }, 7239: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.ColorContrastCache = void 0; const s2 = i2(1505); t2.ColorContrastCache = class { constructor() { this._color = new s2.TwoKeyMap(), this._css = new s2.TwoKeyMap(); } setCss(e3, t3, i3) { this._css.set(e3, t3, i3); } getCss(e3, t3) { return this._css.get(e3, t3); } setColor(e3, t3, i3) { this._color.set(e3, t3, i3); } getColor(e3, t3) { return this._color.get(e3, t3); } clear() { this._color.clear(), this._css.clear(); } }; }, 5680: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.ColorManager = t2.DEFAULT_ANSI_COLORS = void 0; const s2 = i2(8055), r = i2(7239), n = s2.css.toColor("#ffffff"), o = s2.css.toColor("#000000"), a = s2.css.toColor("#ffffff"), h = s2.css.toColor("#000000"), c = { css: "rgba(255, 255, 255, 0.3)", rgba: 4294967117 }; t2.DEFAULT_ANSI_COLORS = Object.freeze((() => { const e3 = [s2.css.toColor("#2e3436"), s2.css.toColor("#cc0000"), s2.css.toColor("#4e9a06"), s2.css.toColor("#c4a000"), s2.css.toColor("#3465a4"), s2.css.toColor("#75507b"), s2.css.toColor("#06989a"), s2.css.toColor("#d3d7cf"), s2.css.toColor("#555753"), s2.css.toColor("#ef2929"), s2.css.toColor("#8ae234"), s2.css.toColor("#fce94f"), s2.css.toColor("#729fcf"), s2.css.toColor("#ad7fa8"), s2.css.toColor("#34e2e2"), s2.css.toColor("#eeeeec")], t3 = [0, 95, 135, 175, 215, 255]; for (let i3 = 0; i3 < 216; i3++) { const r2 = t3[i3 / 36 % 6 | 0], n2 = t3[i3 / 6 % 6 | 0], o2 = t3[i3 % 6]; e3.push({ css: s2.channels.toCss(r2, n2, o2), rgba: s2.channels.toRgba(r2, n2, o2) }); } for (let t4 = 0; t4 < 24; t4++) { const i3 = 8 + 10 * t4; e3.push({ css: s2.channels.toCss(i3, i3, i3), rgba: s2.channels.toRgba(i3, i3, i3) }); } return e3; })()), t2.ColorManager = class { constructor(e3, i3) { this.allowTransparency = i3; const l = e3.createElement("canvas"); l.width = 1, l.height = 1; const d = l.getContext("2d"); if (!d) throw new Error("Could not get rendering context"); this._ctx = d, this._ctx.globalCompositeOperation = "copy", this._litmusColor = this._ctx.createLinearGradient(0, 0, 1, 1), this._contrastCache = new r.ColorContrastCache(), this.colors = { foreground: n, background: o, cursor: a, cursorAccent: h, selectionForeground: void 0, selectionBackgroundTransparent: c, selectionBackgroundOpaque: s2.color.blend(o, c), selectionInactiveBackgroundTransparent: c, selectionInactiveBackgroundOpaque: s2.color.blend(o, c), ansi: t2.DEFAULT_ANSI_COLORS.slice(), contrastCache: this._contrastCache }, this._updateRestoreColors(); } onOptionsChange(e3, t3) { switch (e3) { case "minimumContrastRatio": this._contrastCache.clear(); break; case "allowTransparency": this.allowTransparency = t3; } } setTheme(e3 = {}) { this.colors.foreground = this._parseColor(e3.foreground, n), this.colors.background = this._parseColor(e3.background, o), this.colors.cursor = this._parseColor(e3.cursor, a, true), this.colors.cursorAccent = this._parseColor(e3.cursorAccent, h, true), this.colors.selectionBackgroundTransparent = this._parseColor(e3.selectionBackground, c, true), this.colors.selectionBackgroundOpaque = s2.color.blend(this.colors.background, this.colors.selectionBackgroundTransparent), this.colors.selectionInactiveBackgroundTransparent = this._parseColor(e3.selectionInactiveBackground, this.colors.selectionBackgroundTransparent, true), this.colors.selectionInactiveBackgroundOpaque = s2.color.blend(this.colors.background, this.colors.selectionInactiveBackgroundTransparent); const i3 = { css: "", rgba: 0 }; if (this.colors.selectionForeground = e3.selectionForeground ? this._parseColor(e3.selectionForeground, i3) : void 0, this.colors.selectionForeground === i3 && (this.colors.selectionForeground = void 0), s2.color.isOpaque(this.colors.selectionBackgroundTransparent)) { const e4 = 0.3; this.colors.selectionBackgroundTransparent = s2.color.opacity(this.colors.selectionBackgroundTransparent, e4); } if (s2.color.isOpaque(this.colors.selectionInactiveBackgroundTransparent)) { const e4 = 0.3; this.colors.selectionInactiveBackgroundTransparent = s2.color.opacity(this.colors.selectionInactiveBackgroundTransparent, e4); } if (this.colors.ansi = t2.DEFAULT_ANSI_COLORS.slice(), this.colors.ansi[0] = this._parseColor(e3.black, t2.DEFAULT_ANSI_COLORS[0]), this.colors.ansi[1] = this._parseColor(e3.red, t2.DEFAULT_ANSI_COLORS[1]), this.colors.ansi[2] = this._parseColor(e3.green, t2.DEFAULT_ANSI_COLORS[2]), this.colors.ansi[3] = this._parseColor(e3.yellow, t2.DEFAULT_ANSI_COLORS[3]), this.colors.ansi[4] = this._parseColor(e3.blue, t2.DEFAULT_ANSI_COLORS[4]), this.colors.ansi[5] = this._parseColor(e3.magenta, t2.DEFAULT_ANSI_COLORS[5]), this.colors.ansi[6] = this._parseColor(e3.cyan, t2.DEFAULT_ANSI_COLORS[6]), this.colors.ansi[7] = this._parseColor(e3.white, t2.DEFAULT_ANSI_COLORS[7]), this.colors.ansi[8] = this._parseColor(e3.brightBlack, t2.DEFAULT_ANSI_COLORS[8]), this.colors.ansi[9] = this._parseColor(e3.brightRed, t2.DEFAULT_ANSI_COLORS[9]), this.colors.ansi[10] = this._parseColor(e3.brightGreen, t2.DEFAULT_ANSI_COLORS[10]), this.colors.ansi[11] = this._parseColor(e3.brightYellow, t2.DEFAULT_ANSI_COLORS[11]), this.colors.ansi[12] = this._parseColor(e3.brightBlue, t2.DEFAULT_ANSI_COLORS[12]), this.colors.ansi[13] = this._parseColor(e3.brightMagenta, t2.DEFAULT_ANSI_COLORS[13]), this.colors.ansi[14] = this._parseColor(e3.brightCyan, t2.DEFAULT_ANSI_COLORS[14]), this.colors.ansi[15] = this._parseColor(e3.brightWhite, t2.DEFAULT_ANSI_COLORS[15]), e3.extendedAnsi) { const i4 = Math.min(this.colors.ansi.length - 16, e3.extendedAnsi.length); for (let s3 = 0; s3 < i4; s3++) this.colors.ansi[s3 + 16] = this._parseColor(e3.extendedAnsi[s3], t2.DEFAULT_ANSI_COLORS[s3 + 16]); } this._contrastCache.clear(), this._updateRestoreColors(); } restoreColor(e3) { if (e3 !== void 0) switch (e3) { case 256: this.colors.foreground = this._restoreColors.foreground; break; case 257: this.colors.background = this._restoreColors.background; break; case 258: this.colors.cursor = this._restoreColors.cursor; break; default: this.colors.ansi[e3] = this._restoreColors.ansi[e3]; } else for (let e4 = 0; e4 < this._restoreColors.ansi.length; ++e4) this.colors.ansi[e4] = this._restoreColors.ansi[e4]; } _updateRestoreColors() { this._restoreColors = { foreground: this.colors.foreground, background: this.colors.background, cursor: this.colors.cursor, ansi: this.colors.ansi.slice() }; } _parseColor(e3, t3, i3 = this.allowTransparency) { if (e3 === void 0) return t3; if (this._ctx.fillStyle = this._litmusColor, this._ctx.fillStyle = e3, typeof this._ctx.fillStyle != "string") return console.warn(`Color: ${e3} is invalid using fallback ${t3.css}`), t3; this._ctx.fillRect(0, 0, 1, 1); const r2 = this._ctx.getImageData(0, 0, 1, 1).data; if (r2[3] !== 255) { if (!i3) return console.warn(`Color: ${e3} is using transparency, but allowTransparency is false. Using fallback ${t3.css}.`), t3; const [r3, n2, o2, a2] = this._ctx.fillStyle.substring(5, this._ctx.fillStyle.length - 1).split(",").map((e4) => Number(e4)), h2 = Math.round(255 * a2); return { rgba: s2.channels.toRgba(r3, n2, o2, h2), css: e3 }; } return { css: this._ctx.fillStyle, rgba: s2.channels.toRgba(r2[0], r2[1], r2[2], r2[3]) }; } }; }, 9631: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.removeElementFromParent = void 0, t2.removeElementFromParent = function(...e3) { var t3; for (const i2 of e3) (t3 = i2 == null ? void 0 : i2.parentElement) === null || t3 === void 0 || t3.removeChild(i2); }; }, 3656: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.addDisposableDomListener = void 0, t2.addDisposableDomListener = function(e3, t3, i2, s2) { e3.addEventListener(t3, i2, s2); let r = false; return { dispose: () => { r || (r = true, e3.removeEventListener(t3, i2, s2)); } }; }; }, 6465: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.Linkifier2 = void 0; const n = i2(2585), o = i2(8460), a = i2(844), h = i2(3656); let c = /* @__PURE__ */ __name(class extends a.Disposable { constructor(e3) { super(), this._bufferService = e3, this._linkProviders = [], this._linkCacheDisposables = [], this._isMouseOut = true, this._activeLine = -1, this._onShowLinkUnderline = this.register(new o.EventEmitter()), this._onHideLinkUnderline = this.register(new o.EventEmitter()), this.register((0, a.getDisposeArrayDisposable)(this._linkCacheDisposables)); } get currentLink() { return this._currentLink; } get onShowLinkUnderline() { return this._onShowLinkUnderline.event; } get onHideLinkUnderline() { return this._onHideLinkUnderline.event; } dispose() { super.dispose(), this._lastMouseEvent = void 0; } registerLinkProvider(e3) { return this._linkProviders.push(e3), { dispose: () => { const t3 = this._linkProviders.indexOf(e3); t3 !== -1 && this._linkProviders.splice(t3, 1); } }; } attachToDom(e3, t3, i3) { this._element = e3, this._mouseService = t3, this._renderService = i3, this.register((0, h.addDisposableDomListener)(this._element, "mouseleave", () => { this._isMouseOut = true, this._clearCurrentLink(); })), this.register((0, h.addDisposableDomListener)(this._element, "mousemove", this._onMouseMove.bind(this))), this.register((0, h.addDisposableDomListener)(this._element, "mousedown", this._handleMouseDown.bind(this))), this.register((0, h.addDisposableDomListener)(this._element, "mouseup", this._handleMouseUp.bind(this))); } _onMouseMove(e3) { if (this._lastMouseEvent = e3, !this._element || !this._mouseService) return; const t3 = this._positionFromMouseEvent(e3, this._element, this._mouseService); if (!t3) return; this._isMouseOut = false; const i3 = e3.composedPath(); for (let e4 = 0; e4 < i3.length; e4++) { const t4 = i3[e4]; if (t4.classList.contains("xterm")) break; if (t4.classList.contains("xterm-hover")) return; } this._lastBufferCell && t3.x === this._lastBufferCell.x && t3.y === this._lastBufferCell.y || (this._onHover(t3), this._lastBufferCell = t3); } _onHover(e3) { if (this._activeLine !== e3.y) return this._clearCurrentLink(), void this._askForLink(e3, false); this._currentLink && this._linkAtPosition(this._currentLink.link, e3) || (this._clearCurrentLink(), this._askForLink(e3, true)); } _askForLink(e3, t3) { var i3, s3; this._activeProviderReplies && t3 || ((i3 = this._activeProviderReplies) === null || i3 === void 0 || i3.forEach((e4) => { e4 == null || e4.forEach((e5) => { e5.link.dispose && e5.link.dispose(); }); }), this._activeProviderReplies = /* @__PURE__ */ new Map(), this._activeLine = e3.y); let r2 = false; for (const [i4, n2] of this._linkProviders.entries()) t3 ? ((s3 = this._activeProviderReplies) === null || s3 === void 0 ? void 0 : s3.get(i4)) && (r2 = this._checkLinkProviderResult(i4, e3, r2)) : n2.provideLinks(e3.y, (t4) => { var s4, n3; if (this._isMouseOut) return; const o2 = t4 == null ? void 0 : t4.map((e4) => ({ link: e4 })); (s4 = this._activeProviderReplies) === null || s4 === void 0 || s4.set(i4, o2), r2 = this._checkLinkProviderResult(i4, e3, r2), ((n3 = this._activeProviderReplies) === null || n3 === void 0 ? void 0 : n3.size) === this._linkProviders.length && this._removeIntersectingLinks(e3.y, this._activeProviderReplies); }); } _removeIntersectingLinks(e3, t3) { const i3 = /* @__PURE__ */ new Set(); for (let s3 = 0; s3 < t3.size; s3++) { const r2 = t3.get(s3); if (r2) for (let t4 = 0; t4 < r2.length; t4++) { const s4 = r2[t4], n2 = s4.link.range.start.y < e3 ? 0 : s4.link.range.start.x, o2 = s4.link.range.end.y > e3 ? this._bufferService.cols : s4.link.range.end.x; for (let e4 = n2; e4 <= o2; e4++) { if (i3.has(e4)) { r2.splice(t4--, 1); break; } i3.add(e4); } } } } _checkLinkProviderResult(e3, t3, i3) { var s3; if (!this._activeProviderReplies) return i3; const r2 = this._activeProviderReplies.get(e3); let n2 = false; for (let t4 = 0; t4 < e3; t4++) this._activeProviderReplies.has(t4) && !this._activeProviderReplies.get(t4) || (n2 = true); if (!n2 && r2) { const e4 = r2.find((e5) => this._linkAtPosition(e5.link, t3)); e4 && (i3 = true, this._handleNewLink(e4)); } if (this._activeProviderReplies.size === this._linkProviders.length && !i3) for (let e4 = 0; e4 < this._activeProviderReplies.size; e4++) { const r3 = (s3 = this._activeProviderReplies.get(e4)) === null || s3 === void 0 ? void 0 : s3.find((e5) => this._linkAtPosition(e5.link, t3)); if (r3) { i3 = true, this._handleNewLink(r3); break; } } return i3; } _handleMouseDown() { this._mouseDownLink = this._currentLink; } _handleMouseUp(e3) { if (!this._element || !this._mouseService || !this._currentLink) return; const t3 = this._positionFromMouseEvent(e3, this._element, this._mouseService); t3 && this._mouseDownLink === this._currentLink && this._linkAtPosition(this._currentLink.link, t3) && this._currentLink.link.activate(e3, this._currentLink.link.text); } _clearCurrentLink(e3, t3) { this._element && this._currentLink && this._lastMouseEvent && (!e3 || !t3 || this._currentLink.link.range.start.y >= e3 && this._currentLink.link.range.end.y <= t3) && (this._linkLeave(this._element, this._currentLink.link, this._lastMouseEvent), this._currentLink = void 0, (0, a.disposeArray)(this._linkCacheDisposables)); } _handleNewLink(e3) { if (!this._element || !this._lastMouseEvent || !this._mouseService) return; const t3 = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService); t3 && this._linkAtPosition(e3.link, t3) && (this._currentLink = e3, this._currentLink.state = { decorations: { underline: e3.link.decorations === void 0 || e3.link.decorations.underline, pointerCursor: e3.link.decorations === void 0 || e3.link.decorations.pointerCursor }, isHovered: true }, this._linkHover(this._element, e3.link, this._lastMouseEvent), e3.link.decorations = {}, Object.defineProperties(e3.link.decorations, { pointerCursor: { get: () => { var e4, t4; return (t4 = (e4 = this._currentLink) === null || e4 === void 0 ? void 0 : e4.state) === null || t4 === void 0 ? void 0 : t4.decorations.pointerCursor; }, set: (e4) => { var t4, i3; ((t4 = this._currentLink) === null || t4 === void 0 ? void 0 : t4.state) && this._currentLink.state.decorations.pointerCursor !== e4 && (this._currentLink.state.decorations.pointerCursor = e4, this._currentLink.state.isHovered && ((i3 = this._element) === null || i3 === void 0 || i3.classList.toggle("xterm-cursor-pointer", e4))); } }, underline: { get: () => { var e4, t4; return (t4 = (e4 = this._currentLink) === null || e4 === void 0 ? void 0 : e4.state) === null || t4 === void 0 ? void 0 : t4.decorations.underline; }, set: (t4) => { var i3, s3, r2; ((i3 = this._currentLink) === null || i3 === void 0 ? void 0 : i3.state) && ((r2 = (s3 = this._currentLink) === null || s3 === void 0 ? void 0 : s3.state) === null || r2 === void 0 ? void 0 : r2.decorations.underline) !== t4 && (this._currentLink.state.decorations.underline = t4, this._currentLink.state.isHovered && this._fireUnderlineEvent(e3.link, t4)); } } }), this._renderService && this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e4) => { const t4 = e4.start === 0 ? 0 : e4.start + 1 + this._bufferService.buffer.ydisp; this._clearCurrentLink(t4, e4.end + 1 + this._bufferService.buffer.ydisp); }))); } _linkHover(e3, t3, i3) { var s3; ((s3 = this._currentLink) === null || s3 === void 0 ? void 0 : s3.state) && (this._currentLink.state.isHovered = true, this._currentLink.state.decorations.underline && this._fireUnderlineEvent(t3, true), this._currentLink.state.decorations.pointerCursor && e3.classList.add("xterm-cursor-pointer")), t3.hover && t3.hover(i3, t3.text); } _fireUnderlineEvent(e3, t3) { const i3 = e3.range, s3 = this._bufferService.buffer.ydisp, r2 = this._createLinkUnderlineEvent(i3.start.x - 1, i3.start.y - s3 - 1, i3.end.x, i3.end.y - s3 - 1, void 0); (t3 ? this._onShowLinkUnderline : this._onHideLinkUnderline).fire(r2); } _linkLeave(e3, t3, i3) { var s3; ((s3 = this._currentLink) === null || s3 === void 0 ? void 0 : s3.state) && (this._currentLink.state.isHovered = false, this._currentLink.state.decorations.underline && this._fireUnderlineEvent(t3, false), this._currentLink.state.decorations.pointerCursor && e3.classList.remove("xterm-cursor-pointer")), t3.leave && t3.leave(i3, t3.text); } _linkAtPosition(e3, t3) { const i3 = e3.range.start.y === e3.range.end.y, s3 = e3.range.start.y < t3.y, r2 = e3.range.end.y > t3.y; return (i3 && e3.range.start.x <= t3.x && e3.range.end.x >= t3.x || s3 && e3.range.end.x >= t3.x || r2 && e3.range.start.x <= t3.x || s3 && r2) && e3.range.start.y <= t3.y && e3.range.end.y >= t3.y; } _positionFromMouseEvent(e3, t3, i3) { const s3 = i3.getCoords(e3, t3, this._bufferService.cols, this._bufferService.rows); if (s3) return { x: s3[0], y: s3[1] + this._bufferService.buffer.ydisp }; } _createLinkUnderlineEvent(e3, t3, i3, s3, r2) { return { x1: e3, y1: t3, x2: i3, y2: s3, cols: this._bufferService.cols, fg: r2 }; } }, "c"); c = s2([r(0, n.IBufferService)], c), t2.Linkifier2 = c; }, 9042: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.tooMuchOutput = t2.promptLabel = void 0, t2.promptLabel = "Terminal input", t2.tooMuchOutput = "Too much output to announce, navigate to rows manually to read"; }, 2962: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.OscLinkProvider = void 0; const n = i2(511), o = i2(2585); let a = /* @__PURE__ */ __name(class { constructor(e3, t3, i3) { this._bufferService = e3, this._optionsService = t3, this._oscLinkService = i3; } provideLinks(e3, t3) { var i3; const s3 = this._bufferService.buffer.lines.get(e3 - 1); if (!s3) return void t3(void 0); const r2 = [], o2 = this._optionsService.rawOptions.linkHandler, a2 = new n.CellData(), c = s3.getTrimmedLength(); let l = -1, d = -1, _ = false; for (let t4 = 0; t4 < c; t4++) if (d !== -1 || s3.hasContent(t4)) { if (s3.loadCell(t4, a2), a2.hasExtendedAttrs() && a2.extended.urlId) { if (d === -1) { d = t4, l = a2.extended.urlId; continue; } _ = a2.extended.urlId !== l; } else d !== -1 && (_ = true); if (_ || d !== -1 && t4 === c - 1) { const s4 = (i3 = this._oscLinkService.getLinkData(l)) === null || i3 === void 0 ? void 0 : i3.uri; if (s4) { const i4 = { start: { x: d + 1, y: e3 }, end: { x: t4 + (_ || t4 !== c - 1 ? 0 : 1), y: e3 } }; r2.push({ text: s4, range: i4, activate: (e4, t5) => o2 ? o2.activate(e4, t5, i4) : h(0, t5), hover: (e4, t5) => { var s5; return (s5 = o2 == null ? void 0 : o2.hover) === null || s5 === void 0 ? void 0 : s5.call(o2, e4, t5, i4); }, leave: (e4, t5) => { var s5; return (s5 = o2 == null ? void 0 : o2.leave) === null || s5 === void 0 ? void 0 : s5.call(o2, e4, t5, i4); } }); } _ = false, a2.hasExtendedAttrs() && a2.extended.urlId ? (d = t4, l = a2.extended.urlId) : (d = -1, l = -1); } } t3(r2); } }, "a"); function h(e3, t3) { if (confirm(`Do you want to navigate to ${t3}?`)) { const e4 = window.open(); if (e4) { try { e4.opener = null; } catch (e5) { } e4.location.href = t3; } else console.warn("Opening link blocked as opener could not be cleared"); } } __name(h, "h"); a = s2([r(0, o.IBufferService), r(1, o.IOptionsService), r(2, o.IOscLinkService)], a), t2.OscLinkProvider = a; }, 6193: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.RenderDebouncer = void 0, t2.RenderDebouncer = class { constructor(e3, t3) { this._parentWindow = e3, this._renderCallback = t3, this._refreshCallbacks = []; } dispose() { this._animationFrame && (this._parentWindow.cancelAnimationFrame(this._animationFrame), this._animationFrame = void 0); } addRefreshCallback(e3) { return this._refreshCallbacks.push(e3), this._animationFrame || (this._animationFrame = this._parentWindow.requestAnimationFrame(() => this._innerRefresh())), this._animationFrame; } refresh(e3, t3, i2) { this._rowCount = i2, e3 = e3 !== void 0 ? e3 : 0, t3 = t3 !== void 0 ? t3 : this._rowCount - 1, this._rowStart = this._rowStart !== void 0 ? Math.min(this._rowStart, e3) : e3, this._rowEnd = this._rowEnd !== void 0 ? Math.max(this._rowEnd, t3) : t3, this._animationFrame || (this._animationFrame = this._parentWindow.requestAnimationFrame(() => this._innerRefresh())); } _innerRefresh() { if (this._animationFrame = void 0, this._rowStart === void 0 || this._rowEnd === void 0 || this._rowCount === void 0) return void this._runRefreshCallbacks(); const e3 = Math.max(this._rowStart, 0), t3 = Math.min(this._rowEnd, this._rowCount - 1); this._rowStart = void 0, this._rowEnd = void 0, this._renderCallback(e3, t3), this._runRefreshCallbacks(); } _runRefreshCallbacks() { for (const e3 of this._refreshCallbacks) e3(0); this._refreshCallbacks = []; } }; }, 5596: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.ScreenDprMonitor = void 0; const s2 = i2(844); class r extends s2.Disposable { constructor(e3) { super(), this._parentWindow = e3, this._currentDevicePixelRatio = this._parentWindow.devicePixelRatio; } setListener(e3) { this._listener && this.clearListener(), this._listener = e3, this._outerListener = () => { this._listener && (this._listener(this._parentWindow.devicePixelRatio, this._currentDevicePixelRatio), this._updateDpr()); }, this._updateDpr(); } dispose() { super.dispose(), this.clearListener(); } _updateDpr() { var e3; this._outerListener && ((e3 = this._resolutionMediaMatchList) === null || e3 === void 0 || e3.removeListener(this._outerListener), this._currentDevicePixelRatio = this._parentWindow.devicePixelRatio, this._resolutionMediaMatchList = this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`), this._resolutionMediaMatchList.addListener(this._outerListener)); } clearListener() { this._resolutionMediaMatchList && this._listener && this._outerListener && (this._resolutionMediaMatchList.removeListener(this._outerListener), this._resolutionMediaMatchList = void 0, this._listener = void 0, this._outerListener = void 0); } } __name(r, "r"); t2.ScreenDprMonitor = r; }, 3236: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.Terminal = void 0; const s2 = i2(2950), r = i2(1680), n = i2(3614), o = i2(2584), a = i2(5435), h = i2(9312), c = i2(6114), l = i2(3656), d = i2(9042), _ = i2(4567), u = i2(1296), f = i2(7399), v = i2(8460), g = i2(8437), p = i2(5680), S = i2(3230), m = i2(4725), C = i2(428), b = i2(8934), y = i2(6465), w = i2(5114), E = i2(8969), L = i2(8055), R = i2(4269), k = i2(5941), D = i2(3107), A = i2(5744), x = i2(9074), B = i2(2585), T = i2(2962), M = typeof window != "undefined" ? window.document : null; class O extends E.CoreTerminal { constructor(e3 = {}) { super(e3), this.browser = c, this._keyDownHandled = false, this._keyDownSeen = false, this._keyPressHandled = false, this._unprocessedDeadKey = false, this._onCursorMove = new v.EventEmitter(), this._onKey = new v.EventEmitter(), this._onRender = new v.EventEmitter(), this._onSelectionChange = new v.EventEmitter(), this._onTitleChange = new v.EventEmitter(), this._onBell = new v.EventEmitter(), this._onFocus = new v.EventEmitter(), this._onBlur = new v.EventEmitter(), this._onA11yCharEmitter = new v.EventEmitter(), this._onA11yTabEmitter = new v.EventEmitter(), this._setup(), this.linkifier2 = this.register(this._instantiationService.createInstance(y.Linkifier2)), this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(T.OscLinkProvider)), this._decorationService = this._instantiationService.createInstance(x.DecorationService), this._instantiationService.setService(B.IDecorationService, this._decorationService), this.register(this._inputHandler.onRequestBell(() => this._onBell.fire())), this.register(this._inputHandler.onRequestRefreshRows((e4, t3) => this.refresh(e4, t3))), this.register(this._inputHandler.onRequestSendFocus(() => this._reportFocus())), this.register(this._inputHandler.onRequestReset(() => this.reset())), this.register(this._inputHandler.onRequestWindowsOptionsReport((e4) => this._reportWindowsOptions(e4))), this.register(this._inputHandler.onColor((e4) => this._handleColorEvent(e4))), this.register((0, v.forwardEvent)(this._inputHandler.onCursorMove, this._onCursorMove)), this.register((0, v.forwardEvent)(this._inputHandler.onTitleChange, this._onTitleChange)), this.register((0, v.forwardEvent)(this._inputHandler.onA11yChar, this._onA11yCharEmitter)), this.register((0, v.forwardEvent)(this._inputHandler.onA11yTab, this._onA11yTabEmitter)), this.register(this._bufferService.onResize((e4) => this._afterResize(e4.cols, e4.rows))); } get onCursorMove() { return this._onCursorMove.event; } get onKey() { return this._onKey.event; } get onRender() { return this._onRender.event; } get onSelectionChange() { return this._onSelectionChange.event; } get onTitleChange() { return this._onTitleChange.event; } get onBell() { return this._onBell.event; } get onFocus() { return this._onFocus.event; } get onBlur() { return this._onBlur.event; } get onA11yChar() { return this._onA11yCharEmitter.event; } get onA11yTab() { return this._onA11yTabEmitter.event; } _handleColorEvent(e3) { var t3, i3; if (this._colorManager) { for (const t4 of e3) { let e4, i4 = ""; switch (t4.index) { case 256: e4 = "foreground", i4 = "10"; break; case 257: e4 = "background", i4 = "11"; break; case 258: e4 = "cursor", i4 = "12"; break; default: e4 = "ansi", i4 = "4;" + t4.index; } switch (t4.type) { case 0: const s3 = L.color.toColorRGB(e4 === "ansi" ? this._colorManager.colors.ansi[t4.index] : this._colorManager.colors[e4]); this.coreService.triggerDataEvent(`${o.C0.ESC}]${i4};${(0, k.toRgbString)(s3)}${o.C1_ESCAPED.ST}`); break; case 1: e4 === "ansi" ? this._colorManager.colors.ansi[t4.index] = L.rgba.toColor(...t4.color) : this._colorManager.colors[e4] = L.rgba.toColor(...t4.color); break; case 2: this._colorManager.restoreColor(t4.index); } } (t3 = this._renderService) === null || t3 === void 0 || t3.setColors(this._colorManager.colors), (i3 = this.viewport) === null || i3 === void 0 || i3.onThemeChange(this._colorManager.colors); } } dispose() { var e3, t3, i3; this._isDisposed || (super.dispose(), (e3 = this._renderService) === null || e3 === void 0 || e3.dispose(), this._customKeyEventHandler = void 0, this.write = () => { }, (i3 = (t3 = this.element) === null || t3 === void 0 ? void 0 : t3.parentNode) === null || i3 === void 0 || i3.removeChild(this.element)); } _setup() { super._setup(), this._customKeyEventHandler = void 0; } get buffer() { return this.buffers.active; } focus() { this.textarea && this.textarea.focus({ preventScroll: true }); } _updateOptions(e3) { var t3, i3, s3, r2; switch (super._updateOptions(e3), e3) { case "fontFamily": case "fontSize": (t3 = this._renderService) === null || t3 === void 0 || t3.clear(), (i3 = this._charSizeService) === null || i3 === void 0 || i3.measure(); break; case "cursorBlink": case "cursorStyle": this.refresh(this.buffer.y, this.buffer.y); break; case "customGlyphs": case "drawBoldTextInBrightColors": case "letterSpacing": case "lineHeight": case "fontWeight": case "fontWeightBold": case "minimumContrastRatio": this._renderService && (this._renderService.clear(), this._renderService.onResize(this.cols, this.rows), this.refresh(0, this.rows - 1)); break; case "scrollback": (s3 = this.viewport) === null || s3 === void 0 || s3.syncScrollArea(); break; case "screenReaderMode": this.optionsService.rawOptions.screenReaderMode ? !this._accessibilityManager && this._renderService && (this._accessibilityManager = new _.AccessibilityManager(this, this._renderService)) : ((r2 = this._accessibilityManager) === null || r2 === void 0 || r2.dispose(), this._accessibilityManager = void 0); break; case "tabStopWidth": this.buffers.setupTabStops(); break; case "theme": this._setTheme(this.optionsService.rawOptions.theme); } } _onTextAreaFocus(e3) { this.coreService.decPrivateModes.sendFocus && this.coreService.triggerDataEvent(o.C0.ESC + "[I"), this.updateCursorStyle(e3), this.element.classList.add("focus"), this._showCursor(), this._onFocus.fire(); } blur() { var e3; return (e3 = this.textarea) === null || e3 === void 0 ? void 0 : e3.blur(); } _onTextAreaBlur() { this.textarea.value = "", this.refresh(this.buffer.y, this.buffer.y), this.coreService.decPrivateModes.sendFocus && this.coreService.triggerDataEvent(o.C0.ESC + "[O"), this.element.classList.remove("focus"), this._onBlur.fire(); } _syncTextArea() { if (!this.textarea || !this.buffer.isCursorInViewport || this._compositionHelper.isComposing || !this._renderService) return; const e3 = this.buffer.ybase + this.buffer.y, t3 = this.buffer.lines.get(e3); if (!t3) return; const i3 = Math.min(this.buffer.x, this.cols - 1), s3 = this._renderService.dimensions.actualCellHeight, r2 = t3.getWidth(i3), n2 = this._renderService.dimensions.actualCellWidth * r2, o2 = this.buffer.y * this._renderService.dimensions.actualCellHeight, a2 = i3 * this._renderService.dimensions.actualCellWidth; this.textarea.style.left = a2 + "px", this.textarea.style.top = o2 + "px", this.textarea.style.width = n2 + "px", this.textarea.style.height = s3 + "px", this.textarea.style.lineHeight = s3 + "px", this.textarea.style.zIndex = "-5"; } _initGlobal() { this._bindKeys(), this.register((0, l.addDisposableDomListener)(this.element, "copy", (e4) => { this.hasSelection() && (0, n.copyHandler)(e4, this._selectionService); })); const e3 = /* @__PURE__ */ __name((e4) => (0, n.handlePasteEvent)(e4, this.textarea, this.coreService), "e"); this.register((0, l.addDisposableDomListener)(this.textarea, "paste", e3)), this.register((0, l.addDisposableDomListener)(this.element, "paste", e3)), c.isFirefox ? this.register((0, l.addDisposableDomListener)(this.element, "mousedown", (e4) => { e4.button === 2 && (0, n.rightClickHandler)(e4, this.textarea, this.screenElement, this._selectionService, this.options.rightClickSelectsWord); })) : this.register((0, l.addDisposableDomListener)(this.element, "contextmenu", (e4) => { (0, n.rightClickHandler)(e4, this.textarea, this.screenElement, this._selectionService, this.options.rightClickSelectsWord); })), c.isLinux && this.register((0, l.addDisposableDomListener)(this.element, "auxclick", (e4) => { e4.button === 1 && (0, n.moveTextAreaUnderMouseCursor)(e4, this.textarea, this.screenElement); })); } _bindKeys() { this.register((0, l.addDisposableDomListener)(this.textarea, "keyup", (e3) => this._keyUp(e3), true)), this.register((0, l.addDisposableDomListener)(this.textarea, "keydown", (e3) => this._keyDown(e3), true)), this.register((0, l.addDisposableDomListener)(this.textarea, "keypress", (e3) => this._keyPress(e3), true)), this.register((0, l.addDisposableDomListener)(this.textarea, "compositionstart", () => this._compositionHelper.compositionstart())), this.register((0, l.addDisposableDomListener)(this.textarea, "compositionupdate", (e3) => this._compositionHelper.compositionupdate(e3))), this.register((0, l.addDisposableDomListener)(this.textarea, "compositionend", () => this._compositionHelper.compositionend())), this.register((0, l.addDisposableDomListener)(this.textarea, "input", (e3) => this._inputEvent(e3), true)), this.register(this.onRender(() => this._compositionHelper.updateCompositionElements())); } open(e3) { var t3; if (!e3) throw new Error("Terminal requires a parent element."); e3.isConnected || this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"), this._document = e3.ownerDocument, this.element = this._document.createElement("div"), this.element.dir = "ltr", this.element.classList.add("terminal"), this.element.classList.add("xterm"), this.element.setAttribute("tabindex", "0"), e3.appendChild(this.element); const i3 = M.createDocumentFragment(); this._viewportElement = M.createElement("div"), this._viewportElement.classList.add("xterm-viewport"), i3.appendChild(this._viewportElement), this._viewportScrollArea = M.createElement("div"), this._viewportScrollArea.classList.add("xterm-scroll-area"), this._viewportElement.appendChild(this._viewportScrollArea), this.screenElement = M.createElement("div"), this.screenElement.classList.add("xterm-screen"), this._helperContainer = M.createElement("div"), this._helperContainer.classList.add("xterm-helpers"), this.screenElement.appendChild(this._helperContainer), i3.appendChild(this.screenElement), this.textarea = M.createElement("textarea"), this.textarea.classList.add("xterm-helper-textarea"), this.textarea.setAttribute("aria-label", d.promptLabel), this.textarea.setAttribute("aria-multiline", "false"), this.textarea.setAttribute("autocorrect", "off"), this.textarea.setAttribute("autocapitalize", "off"), this.textarea.setAttribute("spellcheck", "false"), this.textarea.tabIndex = 0, this.register((0, l.addDisposableDomListener)(this.textarea, "focus", (e4) => this._onTextAreaFocus(e4))), this.register((0, l.addDisposableDomListener)(this.textarea, "blur", () => this._onTextAreaBlur())), this._helperContainer.appendChild(this.textarea), this._coreBrowserService = this._instantiationService.createInstance(w.CoreBrowserService, this.textarea, (t3 = this._document.defaultView) !== null && t3 !== void 0 ? t3 : window), this._instantiationService.setService(m.ICoreBrowserService, this._coreBrowserService), this._charSizeService = this._instantiationService.createInstance(C.CharSizeService, this._document, this._helperContainer), this._instantiationService.setService(m.ICharSizeService, this._charSizeService), this._theme = this.options.theme || this._theme, this._colorManager = new p.ColorManager(M, this.options.allowTransparency), this.register(this.optionsService.onOptionChange((e4) => this._colorManager.onOptionsChange(e4, this.optionsService.rawOptions[e4]))), this._colorManager.setTheme(this._theme), this._characterJoinerService = this._instantiationService.createInstance(R.CharacterJoinerService), this._instantiationService.setService(m.ICharacterJoinerService, this._characterJoinerService); const n2 = this._createRenderer(); this._renderService = this.register(this._instantiationService.createInstance(S.RenderService, n2, this.rows, this.screenElement)), this._instantiationService.setService(m.IRenderService, this._renderService), this.register(this._renderService.onRenderedViewportChange((e4) => this._onRender.fire(e4))), this.onResize((e4) => this._renderService.resize(e4.cols, e4.rows)), this._compositionView = M.createElement("div"), this._compositionView.classList.add("composition-view"), this._compositionHelper = this._instantiationService.createInstance(s2.CompositionHelper, this.textarea, this._compositionView), this._helperContainer.appendChild(this._compositionView), this.element.appendChild(i3), this._mouseService = this._instantiationService.createInstance(b.MouseService), this._instantiationService.setService(m.IMouseService, this._mouseService), this.viewport = this._instantiationService.createInstance(r.Viewport, (e4) => this.scrollLines(e4, true, 1), this._viewportElement, this._viewportScrollArea, this.element), this.viewport.onThemeChange(this._colorManager.colors), this.register(this._inputHandler.onRequestSyncScrollBar(() => this.viewport.syncScrollArea())), this.register(this.viewport), this.register(this.onCursorMove(() => { this._renderService.onCursorMove(), this._syncTextArea(); })), this.register(this.onResize(() => this._renderService.onResize(this.cols, this.rows))), this.register(this.onBlur(() => this._renderService.onBlur())), this.register(this.onFocus(() => this._renderService.onFocus())), this.register(this._renderService.onDimensionsChange(() => this.viewport.syncScrollArea())), this._selectionService = this.register(this._instantiationService.createInstance(h.SelectionService, this.element, this.screenElement, this.linkifier2)), this._instantiationService.setService(m.ISelectionService, this._selectionService), this.register(this._selectionService.onRequestScrollLines((e4) => this.scrollLines(e4.amount, e4.suppressScrollEvent))), this.register(this._selectionService.onSelectionChange(() => this._onSelectionChange.fire())), this.register(this._selectionService.onRequestRedraw((e4) => this._renderService.onSelectionChanged(e4.start, e4.end, e4.columnSelectMode))), this.register(this._selectionService.onLinuxMouseSelection((e4) => { this.textarea.value = e4, this.textarea.focus(), this.textarea.select(); })), this.register(this._onScroll.event((e4) => { this.viewport.syncScrollArea(), this._selectionService.refresh(); })), this.register((0, l.addDisposableDomListener)(this._viewportElement, "scroll", () => this._selectionService.refresh())), this.linkifier2.attachToDom(this.screenElement, this._mouseService, this._renderService), this.register(this._instantiationService.createInstance(D.BufferDecorationRenderer, this.screenElement)), this.register((0, l.addDisposableDomListener)(this.element, "mousedown", (e4) => this._selectionService.onMouseDown(e4))), this.coreMouseService.areMouseEventsActive ? (this._selectionService.disable(), this.element.classList.add("enable-mouse-events")) : this._selectionService.enable(), this.options.screenReaderMode && (this._accessibilityManager = new _.AccessibilityManager(this, this._renderService)), this.options.overviewRulerWidth && (this._overviewRulerRenderer = this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer, this._viewportElement, this.screenElement))), this.optionsService.onOptionChange(() => { !this._overviewRulerRenderer && this.options.overviewRulerWidth && this._viewportElement && this.screenElement && (this._overviewRulerRenderer = this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer, this._viewportElement, this.screenElement))); }), this._charSizeService.measure(), this.refresh(0, this.rows - 1), this._initGlobal(), this.bindMouse(); } _createRenderer() { return this._instantiationService.createInstance(u.DomRenderer, this._colorManager.colors, this.element, this.screenElement, this._viewportElement, this.linkifier2); } _setTheme(e3) { var t3, i3, s3; this._theme = e3, (t3 = this._colorManager) === null || t3 === void 0 || t3.setTheme(e3), (i3 = this._renderService) === null || i3 === void 0 || i3.setColors(this._colorManager.colors), (s3 = this.viewport) === null || s3 === void 0 || s3.onThemeChange(this._colorManager.colors); } bindMouse() { const e3 = this, t3 = this.element; function i3(t4) { const i4 = e3._mouseService.getMouseReportCoords(t4, e3.screenElement); if (!i4) return false; let s4, r3; switch (t4.overrideType || t4.type) { case "mousemove": r3 = 32, t4.buttons === void 0 ? (s4 = 3, t4.button !== void 0 && (s4 = t4.button < 3 ? t4.button : 3)) : s4 = 1 & t4.buttons ? 0 : 4 & t4.buttons ? 1 : 2 & t4.buttons ? 2 : 3; break; case "mouseup": r3 = 0, s4 = t4.button < 3 ? t4.button : 3; break; case "mousedown": r3 = 1, s4 = t4.button < 3 ? t4.button : 3; break; case "wheel": if (e3.viewport.getLinesScrolled(t4) === 0) return false; r3 = t4.deltaY < 0 ? 0 : 1, s4 = 4; break; default: return false; } return !(r3 === void 0 || s4 === void 0 || s4 > 4) && e3.coreMouseService.triggerMouseEvent({ col: i4.col, row: i4.row, x: i4.x, y: i4.y, button: s4, action: r3, ctrl: t4.ctrlKey, alt: t4.altKey, shift: t4.shiftKey }); } __name(i3, "i"); const s3 = { mouseup: null, wheel: null, mousedrag: null, mousemove: null }, r2 = { mouseup: (e4) => (i3(e4), e4.buttons || (this._document.removeEventListener("mouseup", s3.mouseup), s3.mousedrag && this._document.removeEventListener("mousemove", s3.mousedrag)), this.cancel(e4)), wheel: (e4) => (i3(e4), this.cancel(e4, true)), mousedrag: (e4) => { e4.buttons && i3(e4); }, mousemove: (e4) => { e4.buttons || i3(e4); } }; this.register(this.coreMouseService.onProtocolChange((e4) => { e4 ? (this.optionsService.rawOptions.logLevel === "debug" && this._logService.debug("Binding to mouse events:", this.coreMouseService.explainEvents(e4)), this.element.classList.add("enable-mouse-events"), this._selectionService.disable()) : (this._logService.debug("Unbinding from mouse events."), this.element.classList.remove("enable-mouse-events"), this._selectionService.enable()), 8 & e4 ? s3.mousemove || (t3.addEventListener("mousemove", r2.mousemove), s3.mousemove = r2.mousemove) : (t3.removeEventListener("mousemove", s3.mousemove), s3.mousemove = null), 16 & e4 ? s3.wheel || (t3.addEventListener("wheel", r2.wheel, { passive: false }), s3.wheel = r2.wheel) : (t3.removeEventListener("wheel", s3.wheel), s3.wheel = null), 2 & e4 ? s3.mouseup || (s3.mouseup = r2.mouseup) : (this._document.removeEventListener("mouseup", s3.mouseup), s3.mouseup = null), 4 & e4 ? s3.mousedrag || (s3.mousedrag = r2.mousedrag) : (this._document.removeEventListener("mousemove", s3.mousedrag), s3.mousedrag = null); })), this.coreMouseService.activeProtocol = this.coreMouseService.activeProtocol, this.register((0, l.addDisposableDomListener)(t3, "mousedown", (e4) => { if (e4.preventDefault(), this.focus(), this.coreMouseService.areMouseEventsActive && !this._selectionService.shouldForceSelection(e4)) return i3(e4), s3.mouseup && this._document.addEventListener("mouseup", s3.mouseup), s3.mousedrag && this._document.addEventListener("mousemove", s3.mousedrag), this.cancel(e4); })), this.register((0, l.addDisposableDomListener)(t3, "wheel", (e4) => { if (!s3.wheel) { if (!this.buffer.hasScrollback) { const t4 = this.viewport.getLinesScrolled(e4); if (t4 === 0) return; const i4 = o.C0.ESC + (this.coreService.decPrivateModes.applicationCursorKeys ? "O" : "[") + (e4.deltaY < 0 ? "A" : "B"); let s4 = ""; for (let e5 = 0; e5 < Math.abs(t4); e5++) s4 += i4; return this.coreService.triggerDataEvent(s4, true), this.cancel(e4, true); } return this.viewport.onWheel(e4) ? this.cancel(e4) : void 0; } }, { passive: false })), this.register((0, l.addDisposableDomListener)(t3, "touchstart", (e4) => { if (!this.coreMouseService.areMouseEventsActive) return this.viewport.onTouchStart(e4), this.cancel(e4); }, { passive: true })), this.register((0, l.addDisposableDomListener)(t3, "touchmove", (e4) => { if (!this.coreMouseService.areMouseEventsActive) return this.viewport.onTouchMove(e4) ? void 0 : this.cancel(e4); }, { passive: false })); } refresh(e3, t3) { var i3; (i3 = this._renderService) === null || i3 === void 0 || i3.refreshRows(e3, t3); } updateCursorStyle(e3) { var t3; ((t3 = this._selectionService) === null || t3 === void 0 ? void 0 : t3.shouldColumnSelect(e3)) ? this.element.classList.add("column-select") : this.element.classList.remove("column-select"); } _showCursor() { this.coreService.isCursorInitialized || (this.coreService.isCursorInitialized = true, this.refresh(this.buffer.y, this.buffer.y)); } scrollLines(e3, t3, i3 = 0) { super.scrollLines(e3, t3, i3), this.refresh(0, this.rows - 1); } paste(e3) { (0, n.paste)(e3, this.textarea, this.coreService); } attachCustomKeyEventHandler(e3) { this._customKeyEventHandler = e3; } registerLinkProvider(e3) { return this.linkifier2.registerLinkProvider(e3); } registerCharacterJoiner(e3) { if (!this._characterJoinerService) throw new Error("Terminal must be opened first"); const t3 = this._characterJoinerService.register(e3); return this.refresh(0, this.rows - 1), t3; } deregisterCharacterJoiner(e3) { if (!this._characterJoinerService) throw new Error("Terminal must be opened first"); this._characterJoinerService.deregister(e3) && this.refresh(0, this.rows - 1); } get markers() { return this.buffer.markers; } addMarker(e3) { return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + e3); } registerDecoration(e3) { return this._decorationService.registerDecoration(e3); } hasSelection() { return !!this._selectionService && this._selectionService.hasSelection; } select(e3, t3, i3) { this._selectionService.setSelection(e3, t3, i3); } getSelection() { return this._selectionService ? this._selectionService.selectionText : ""; } getSelectionPosition() { if (this._selectionService && this._selectionService.hasSelection) return { start: { x: this._selectionService.selectionStart[0], y: this._selectionService.selectionStart[1] }, end: { x: this._selectionService.selectionEnd[0], y: this._selectionService.selectionEnd[1] } }; } clearSelection() { var e3; (e3 = this._selectionService) === null || e3 === void 0 || e3.clearSelection(); } selectAll() { var e3; (e3 = this._selectionService) === null || e3 === void 0 || e3.selectAll(); } selectLines(e3, t3) { var i3; (i3 = this._selectionService) === null || i3 === void 0 || i3.selectLines(e3, t3); } _keyDown(e3) { if (this._keyDownHandled = false, this._keyDownSeen = true, this._customKeyEventHandler && this._customKeyEventHandler(e3) === false) return false; const t3 = this.browser.isMac && this.options.macOptionIsMeta && e3.altKey; if (!t3 && !this._compositionHelper.keydown(e3)) return this.buffer.ybase !== this.buffer.ydisp && this._bufferService.scrollToBottom(), false; t3 || e3.key !== "Dead" && e3.key !== "AltGraph" || (this._unprocessedDeadKey = true); const i3 = (0, f.evaluateKeyboardEvent)(e3, this.coreService.decPrivateModes.applicationCursorKeys, this.browser.isMac, this.options.macOptionIsMeta); if (this.updateCursorStyle(e3), i3.type === 3 || i3.type === 2) { const t4 = this.rows - 1; return this.scrollLines(i3.type === 2 ? -t4 : t4), this.cancel(e3, true); } return i3.type === 1 && this.selectAll(), !!this._isThirdLevelShift(this.browser, e3) || (i3.cancel && this.cancel(e3, true), !i3.key || !!(e3.key && !e3.ctrlKey && !e3.altKey && !e3.metaKey && e3.key.length === 1 && e3.key.charCodeAt(0) >= 65 && e3.key.charCodeAt(0) <= 90) || (this._unprocessedDeadKey ? (this._unprocessedDeadKey = false, true) : (i3.key !== o.C0.ETX && i3.key !== o.C0.CR || (this.textarea.value = ""), this._onKey.fire({ key: i3.key, domEvent: e3 }), this._showCursor(), this.coreService.triggerDataEvent(i3.key, true), this.optionsService.rawOptions.screenReaderMode ? void (this._keyDownHandled = true) : this.cancel(e3, true)))); } _isThirdLevelShift(e3, t3) { const i3 = e3.isMac && !this.options.macOptionIsMeta && t3.altKey && !t3.ctrlKey && !t3.metaKey || e3.isWindows && t3.altKey && t3.ctrlKey && !t3.metaKey || e3.isWindows && t3.getModifierState("AltGraph"); return t3.type === "keypress" ? i3 : i3 && (!t3.keyCode || t3.keyCode > 47); } _keyUp(e3) { this._keyDownSeen = false, this._customKeyEventHandler && this._customKeyEventHandler(e3) === false || (function(e4) { return e4.keyCode === 16 || e4.keyCode === 17 || e4.keyCode === 18; }(e3) || this.focus(), this.updateCursorStyle(e3), this._keyPressHandled = false); } _keyPress(e3) { let t3; if (this._keyPressHandled = false, this._keyDownHandled) return false; if (this._customKeyEventHandler && this._customKeyEventHandler(e3) === false) return false; if (this.cancel(e3), e3.charCode) t3 = e3.charCode; else if (e3.which === null || e3.which === void 0) t3 = e3.keyCode; else { if (e3.which === 0 || e3.charCode === 0) return false; t3 = e3.which; } return !(!t3 || (e3.altKey || e3.ctrlKey || e3.metaKey) && !this._isThirdLevelShift(this.browser, e3) || (t3 = String.fromCharCode(t3), this._onKey.fire({ key: t3, domEvent: e3 }), this._showCursor(), this.coreService.triggerDataEvent(t3, true), this._keyPressHandled = true, this._unprocessedDeadKey = false, 0)); } _inputEvent(e3) { if (e3.data && e3.inputType === "insertText" && (!e3.composed || !this._keyDownSeen) && !this.optionsService.rawOptions.screenReaderMode) { if (this._keyPressHandled) return false; this._unprocessedDeadKey = false; const t3 = e3.data; return this.coreService.triggerDataEvent(t3, true), this.cancel(e3), true; } return false; } resize(e3, t3) { e3 !== this.cols || t3 !== this.rows ? super.resize(e3, t3) : this._charSizeService && !this._charSizeService.hasValidSize && this._charSizeService.measure(); } _afterResize(e3, t3) { var i3, s3; (i3 = this._charSizeService) === null || i3 === void 0 || i3.measure(), (s3 = this.viewport) === null || s3 === void 0 || s3.syncScrollArea(true); } clear() { if (this.buffer.ybase !== 0 || this.buffer.y !== 0) { this.buffer.clearAllMarkers(), this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)), this.buffer.lines.length = 1, this.buffer.ydisp = 0, this.buffer.ybase = 0, this.buffer.y = 0; for (let e3 = 1; e3 < this.rows; e3++) this.buffer.lines.push(this.buffer.getBlankLine(g.DEFAULT_ATTR_DATA)); this.refresh(0, this.rows - 1), this._onScroll.fire({ position: this.buffer.ydisp, source: 0 }); } } reset() { var e3, t3; this.options.rows = this.rows, this.options.cols = this.cols; const i3 = this._customKeyEventHandler; this._setup(), super.reset(), (e3 = this._selectionService) === null || e3 === void 0 || e3.reset(), this._decorationService.reset(), this._customKeyEventHandler = i3, this.refresh(0, this.rows - 1), (t3 = this.viewport) === null || t3 === void 0 || t3.syncScrollArea(); } clearTextureAtlas() { var e3; (e3 = this._renderService) === null || e3 === void 0 || e3.clearTextureAtlas(); } _reportFocus() { var e3; ((e3 = this.element) === null || e3 === void 0 ? void 0 : e3.classList.contains("focus")) ? this.coreService.triggerDataEvent(o.C0.ESC + "[I") : this.coreService.triggerDataEvent(o.C0.ESC + "[O"); } _reportWindowsOptions(e3) { if (this._renderService) switch (e3) { case a.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS: const e4 = this._renderService.dimensions.canvasWidth.toFixed(0), t3 = this._renderService.dimensions.canvasHeight.toFixed(0); this.coreService.triggerDataEvent(`${o.C0.ESC}[4;${t3};${e4}t`); break; case a.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS: const i3 = this._renderService.dimensions.actualCellWidth.toFixed(0), s3 = this._renderService.dimensions.actualCellHeight.toFixed(0); this.coreService.triggerDataEvent(`${o.C0.ESC}[6;${s3};${i3}t`); } } cancel(e3, t3) { if (this.options.cancelEvents || t3) return e3.preventDefault(), e3.stopPropagation(), false; } } __name(O, "O"); t2.Terminal = O; }, 9924: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.TimeBasedDebouncer = void 0, t2.TimeBasedDebouncer = class { constructor(e3, t3 = 1e3) { this._renderCallback = e3, this._debounceThresholdMS = t3, this._lastRefreshMs = 0, this._additionalRefreshRequested = false; } dispose() { this._refreshTimeoutID && clearTimeout(this._refreshTimeoutID); } refresh(e3, t3, i2) { this._rowCount = i2, e3 = e3 !== void 0 ? e3 : 0, t3 = t3 !== void 0 ? t3 : this._rowCount - 1, this._rowStart = this._rowStart !== void 0 ? Math.min(this._rowStart, e3) : e3, this._rowEnd = this._rowEnd !== void 0 ? Math.max(this._rowEnd, t3) : t3; const s2 = Date.now(); if (s2 - this._lastRefreshMs >= this._debounceThresholdMS) this._lastRefreshMs = s2, this._innerRefresh(); else if (!this._additionalRefreshRequested) { const e4 = s2 - this._lastRefreshMs, t4 = this._debounceThresholdMS - e4; this._additionalRefreshRequested = true, this._refreshTimeoutID = window.setTimeout(() => { this._lastRefreshMs = Date.now(), this._innerRefresh(), this._additionalRefreshRequested = false, this._refreshTimeoutID = void 0; }, t4); } } _innerRefresh() { if (this._rowStart === void 0 || this._rowEnd === void 0 || this._rowCount === void 0) return; const e3 = Math.max(this._rowStart, 0), t3 = Math.min(this._rowEnd, this._rowCount - 1); this._rowStart = void 0, this._rowEnd = void 0, this._renderCallback(e3, t3); } }; }, 1680: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.Viewport = void 0; const n = i2(844), o = i2(3656), a = i2(4725), h = i2(2585); let c = /* @__PURE__ */ __name(class extends n.Disposable { constructor(e3, t3, i3, s3, r2, n2, a2, h2, c2) { super(), this._scrollLines = e3, this._viewportElement = t3, this._scrollArea = i3, this._element = s3, this._bufferService = r2, this._optionsService = n2, this._charSizeService = a2, this._renderService = h2, this._coreBrowserService = c2, this.scrollBarWidth = 0, this._currentRowHeight = 0, this._currentScaledCellHeight = 0, this._lastRecordedBufferLength = 0, this._lastRecordedViewportHeight = 0, this._lastRecordedBufferHeight = 0, this._lastTouchY = 0, this._lastScrollTop = 0, this._wheelPartialScroll = 0, this._refreshAnimationFrame = null, this._ignoreNextScrollEvent = false, this._smoothScrollState = { startTime: 0, origin: -1, target: -1 }, this.scrollBarWidth = this._viewportElement.offsetWidth - this._scrollArea.offsetWidth || 15, this.register((0, o.addDisposableDomListener)(this._viewportElement, "scroll", this._onScroll.bind(this))), this._activeBuffer = this._bufferService.buffer, this.register(this._bufferService.buffers.onBufferActivate((e4) => this._activeBuffer = e4.activeBuffer)), this._renderDimensions = this._renderService.dimensions, this.register(this._renderService.onDimensionsChange((e4) => this._renderDimensions = e4)), setTimeout(() => this.syncScrollArea(), 0); } onThemeChange(e3) { this._viewportElement.style.backgroundColor = e3.background.css; } _refresh(e3) { if (e3) return this._innerRefresh(), void (this._refreshAnimationFrame !== null && this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame)); this._refreshAnimationFrame === null && (this._refreshAnimationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh())); } _innerRefresh() { if (this._charSizeService.height > 0) { this._currentRowHeight = this._renderService.dimensions.scaledCellHeight / this._coreBrowserService.dpr, this._currentScaledCellHeight = this._renderService.dimensions.scaledCellHeight, this._lastRecordedViewportHeight = this._viewportElement.offsetHeight; const e4 = Math.round(this._currentRowHeight * this._lastRecordedBufferLength) + (this._lastRecordedViewportHeight - this._renderService.dimensions.canvasHeight); this._lastRecordedBufferHeight !== e4 && (this._lastRecordedBufferHeight = e4, this._scrollArea.style.height = this._lastRecordedBufferHeight + "px"); } const e3 = this._bufferService.buffer.ydisp * this._currentRowHeight; this._viewportElement.scrollTop !== e3 && (this._ignoreNextScrollEvent = true, this._viewportElement.scrollTop = e3), this._refreshAnimationFrame = null; } syncScrollArea(e3 = false) { if (this._lastRecordedBufferLength !== this._bufferService.buffer.lines.length) return this._lastRecordedBufferLength = this._bufferService.buffer.lines.length, void this._refresh(e3); this._lastRecordedViewportHeight === this._renderService.dimensions.canvasHeight && this._lastScrollTop === this._activeBuffer.ydisp * this._currentRowHeight && this._renderDimensions.scaledCellHeight === this._currentScaledCellHeight || this._refresh(e3); } _onScroll(e3) { if (this._lastScrollTop = this._viewportElement.scrollTop, !this._viewportElement.offsetParent) return; if (this._ignoreNextScrollEvent) return this._ignoreNextScrollEvent = false, void this._scrollLines(0); const t3 = Math.round(this._lastScrollTop / this._currentRowHeight) - this._bufferService.buffer.ydisp; this._scrollLines(t3); } _smoothScroll() { if (this._isDisposed || this._smoothScrollState.origin === -1 || this._smoothScrollState.target === -1) return; const e3 = this._smoothScrollPercent(); this._viewportElement.scrollTop = this._smoothScrollState.origin + Math.round(e3 * (this._smoothScrollState.target - this._smoothScrollState.origin)), e3 < 1 ? this._coreBrowserService.window.requestAnimationFrame(() => this._smoothScroll()) : this._clearSmoothScrollState(); } _smoothScrollPercent() { return this._optionsService.rawOptions.smoothScrollDuration && this._smoothScrollState.startTime ? Math.max(Math.min((Date.now() - this._smoothScrollState.startTime) / this._optionsService.rawOptions.smoothScrollDuration, 1), 0) : 1; } _clearSmoothScrollState() { this._smoothScrollState.startTime = 0, this._smoothScrollState.origin = -1, this._smoothScrollState.target = -1; } _bubbleScroll(e3, t3) { const i3 = this._viewportElement.scrollTop + this._lastRecordedViewportHeight; return !(t3 < 0 && this._viewportElement.scrollTop !== 0 || t3 > 0 && i3 < this._lastRecordedBufferHeight) || (e3.cancelable && e3.preventDefault(), false); } onWheel(e3) { const t3 = this._getPixelsScrolled(e3); return t3 !== 0 && (this._optionsService.rawOptions.smoothScrollDuration ? (this._smoothScrollState.startTime = Date.now(), this._smoothScrollPercent() < 1 ? (this._smoothScrollState.origin = this._viewportElement.scrollTop, this._smoothScrollState.target === -1 ? this._smoothScrollState.target = this._viewportElement.scrollTop + t3 : this._smoothScrollState.target += t3, this._smoothScrollState.target = Math.max(Math.min(this._smoothScrollState.target, this._viewportElement.scrollHeight), 0), this._smoothScroll()) : this._clearSmoothScrollState()) : this._viewportElement.scrollTop += t3, this._bubbleScroll(e3, t3)); } _getPixelsScrolled(e3) { if (e3.deltaY === 0 || e3.shiftKey) return 0; let t3 = this._applyScrollModifier(e3.deltaY, e3); return e3.deltaMode === WheelEvent.DOM_DELTA_LINE ? t3 *= this._currentRowHeight : e3.deltaMode === WheelEvent.DOM_DELTA_PAGE && (t3 *= this._currentRowHeight * this._bufferService.rows), t3; } getLinesScrolled(e3) { if (e3.deltaY === 0 || e3.shiftKey) return 0; let t3 = this._applyScrollModifier(e3.deltaY, e3); return e3.deltaMode === WheelEvent.DOM_DELTA_PIXEL ? (t3 /= this._currentRowHeight + 0, this._wheelPartialScroll += t3, t3 = Math.floor(Math.abs(this._wheelPartialScroll)) * (this._wheelPartialScroll > 0 ? 1 : -1), this._wheelPartialScroll %= 1) : e3.deltaMode === WheelEvent.DOM_DELTA_PAGE && (t3 *= this._bufferService.rows), t3; } _applyScrollModifier(e3, t3) { const i3 = this._optionsService.rawOptions.fastScrollModifier; return i3 === "alt" && t3.altKey || i3 === "ctrl" && t3.ctrlKey || i3 === "shift" && t3.shiftKey ? e3 * this._optionsService.rawOptions.fastScrollSensitivity * this._optionsService.rawOptions.scrollSensitivity : e3 * this._optionsService.rawOptions.scrollSensitivity; } onTouchStart(e3) { this._lastTouchY = e3.touches[0].pageY; } onTouchMove(e3) { const t3 = this._lastTouchY - e3.touches[0].pageY; return this._lastTouchY = e3.touches[0].pageY, t3 !== 0 && (this._viewportElement.scrollTop += t3, this._bubbleScroll(e3, t3)); } }, "c"); c = s2([r(4, h.IBufferService), r(5, h.IOptionsService), r(6, a.ICharSizeService), r(7, a.IRenderService), r(8, a.ICoreBrowserService)], c), t2.Viewport = c; }, 3107: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.BufferDecorationRenderer = void 0; const n = i2(3656), o = i2(4725), a = i2(844), h = i2(2585); let c = /* @__PURE__ */ __name(class extends a.Disposable { constructor(e3, t3, i3, s3) { super(), this._screenElement = e3, this._bufferService = t3, this._decorationService = i3, this._renderService = s3, this._decorationElements = /* @__PURE__ */ new Map(), this._altBufferIsActive = false, this._dimensionsChanged = false, this._container = document.createElement("div"), this._container.classList.add("xterm-decoration-container"), this._screenElement.appendChild(this._container), this.register(this._renderService.onRenderedViewportChange(() => this._queueRefresh())), this.register(this._renderService.onDimensionsChange(() => { this._dimensionsChanged = true, this._queueRefresh(); })), this.register((0, n.addDisposableDomListener)(window, "resize", () => this._queueRefresh())), this.register(this._bufferService.buffers.onBufferActivate(() => { this._altBufferIsActive = this._bufferService.buffer === this._bufferService.buffers.alt; })), this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh())), this.register(this._decorationService.onDecorationRemoved((e4) => this._removeDecoration(e4))); } dispose() { this._container.remove(), this._decorationElements.clear(), super.dispose(); } _queueRefresh() { this._animationFrame === void 0 && (this._animationFrame = this._renderService.addRefreshCallback(() => { this.refreshDecorations(), this._animationFrame = void 0; })); } refreshDecorations() { for (const e3 of this._decorationService.decorations) this._renderDecoration(e3); this._dimensionsChanged = false; } _renderDecoration(e3) { this._refreshStyle(e3), this._dimensionsChanged && this._refreshXPosition(e3); } _createElement(e3) { var t3; const i3 = document.createElement("div"); i3.classList.add("xterm-decoration"), i3.style.width = `${Math.round((e3.options.width || 1) * this._renderService.dimensions.actualCellWidth)}px`, i3.style.height = (e3.options.height || 1) * this._renderService.dimensions.actualCellHeight + "px", i3.style.top = (e3.marker.line - this._bufferService.buffers.active.ydisp) * this._renderService.dimensions.actualCellHeight + "px", i3.style.lineHeight = `${this._renderService.dimensions.actualCellHeight}px`; const s3 = (t3 = e3.options.x) !== null && t3 !== void 0 ? t3 : 0; return s3 && s3 > this._bufferService.cols && (i3.style.display = "none"), this._refreshXPosition(e3, i3), i3; } _refreshStyle(e3) { const t3 = e3.marker.line - this._bufferService.buffers.active.ydisp; if (t3 < 0 || t3 >= this._bufferService.rows) e3.element && (e3.element.style.display = "none", e3.onRenderEmitter.fire(e3.element)); else { let i3 = this._decorationElements.get(e3); i3 || (e3.onDispose(() => this._removeDecoration(e3)), i3 = this._createElement(e3), e3.element = i3, this._decorationElements.set(e3, i3), this._container.appendChild(i3)), i3.style.top = t3 * this._renderService.dimensions.actualCellHeight + "px", i3.style.display = this._altBufferIsActive ? "none" : "block", e3.onRenderEmitter.fire(i3); } } _refreshXPosition(e3, t3 = e3.element) { var i3; if (!t3) return; const s3 = (i3 = e3.options.x) !== null && i3 !== void 0 ? i3 : 0; (e3.options.anchor || "left") === "right" ? t3.style.right = s3 ? s3 * this._renderService.dimensions.actualCellWidth + "px" : "" : t3.style.left = s3 ? s3 * this._renderService.dimensions.actualCellWidth + "px" : ""; } _removeDecoration(e3) { var t3; (t3 = this._decorationElements.get(e3)) === null || t3 === void 0 || t3.remove(), this._decorationElements.delete(e3); } }, "c"); c = s2([r(1, h.IBufferService), r(2, h.IDecorationService), r(3, o.IRenderService)], c), t2.BufferDecorationRenderer = c; }, 5871: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.ColorZoneStore = void 0, t2.ColorZoneStore = class { constructor() { this._zones = [], this._zonePool = [], this._zonePoolIndex = 0, this._linePadding = { full: 0, left: 0, center: 0, right: 0 }; } get zones() { return this._zonePool.length = Math.min(this._zonePool.length, this._zones.length), this._zones; } clear() { this._zones.length = 0, this._zonePoolIndex = 0; } addDecoration(e3) { if (e3.options.overviewRulerOptions) { for (const t3 of this._zones) if (t3.color === e3.options.overviewRulerOptions.color && t3.position === e3.options.overviewRulerOptions.position) { if (this._lineIntersectsZone(t3, e3.marker.line)) return; if (this._lineAdjacentToZone(t3, e3.marker.line, e3.options.overviewRulerOptions.position)) return void this._addLineToZone(t3, e3.marker.line); } if (this._zonePoolIndex < this._zonePool.length) return this._zonePool[this._zonePoolIndex].color = e3.options.overviewRulerOptions.color, this._zonePool[this._zonePoolIndex].position = e3.options.overviewRulerOptions.position, this._zonePool[this._zonePoolIndex].startBufferLine = e3.marker.line, this._zonePool[this._zonePoolIndex].endBufferLine = e3.marker.line, void this._zones.push(this._zonePool[this._zonePoolIndex++]); this._zones.push({ color: e3.options.overviewRulerOptions.color, position: e3.options.overviewRulerOptions.position, startBufferLine: e3.marker.line, endBufferLine: e3.marker.line }), this._zonePool.push(this._zones[this._zones.length - 1]), this._zonePoolIndex++; } } setPadding(e3) { this._linePadding = e3; } _lineIntersectsZone(e3, t3) { return t3 >= e3.startBufferLine && t3 <= e3.endBufferLine; } _lineAdjacentToZone(e3, t3, i2) { return t3 >= e3.startBufferLine - this._linePadding[i2 || "full"] && t3 <= e3.endBufferLine + this._linePadding[i2 || "full"]; } _addLineToZone(e3, t3) { e3.startBufferLine = Math.min(e3.startBufferLine, t3), e3.endBufferLine = Math.max(e3.endBufferLine, t3); } }; }, 5744: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.OverviewRulerRenderer = void 0; const n = i2(5871), o = i2(3656), a = i2(4725), h = i2(844), c = i2(2585), l = { full: 0, left: 0, center: 0, right: 0 }, d = { full: 0, left: 0, center: 0, right: 0 }, _ = { full: 0, left: 0, center: 0, right: 0 }; let u = /* @__PURE__ */ __name(class extends h.Disposable { constructor(e3, t3, i3, s3, r2, o2, a2) { var h2; super(), this._viewportElement = e3, this._screenElement = t3, this._bufferService = i3, this._decorationService = s3, this._renderService = r2, this._optionsService = o2, this._coreBrowseService = a2, this._colorZoneStore = new n.ColorZoneStore(), this._shouldUpdateDimensions = true, this._shouldUpdateAnchor = true, this._lastKnownBufferLength = 0, this._canvas = document.createElement("canvas"), this._canvas.classList.add("xterm-decoration-overview-ruler"), this._refreshCanvasDimensions(), (h2 = this._viewportElement.parentElement) === null || h2 === void 0 || h2.insertBefore(this._canvas, this._viewportElement); const c2 = this._canvas.getContext("2d"); if (!c2) throw new Error("Ctx cannot be null"); this._ctx = c2, this._registerDecorationListeners(), this._registerBufferChangeListeners(), this._registerDimensionChangeListeners(); } get _width() { return this._optionsService.options.overviewRulerWidth || 0; } _registerDecorationListeners() { this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh(void 0, true))), this.register(this._decorationService.onDecorationRemoved(() => this._queueRefresh(void 0, true))); } _registerBufferChangeListeners() { this.register(this._renderService.onRenderedViewportChange(() => this._queueRefresh())), this.register(this._bufferService.buffers.onBufferActivate(() => { this._canvas.style.display = this._bufferService.buffer === this._bufferService.buffers.alt ? "none" : "block"; })), this.register(this._bufferService.onScroll(() => { this._lastKnownBufferLength !== this._bufferService.buffers.normal.lines.length && (this._refreshDrawHeightConstants(), this._refreshColorZonePadding()); })); } _registerDimensionChangeListeners() { this.register(this._renderService.onRender(() => { this._containerHeight && this._containerHeight === this._screenElement.clientHeight || (this._queueRefresh(true), this._containerHeight = this._screenElement.clientHeight); })), this.register(this._optionsService.onOptionChange((e3) => { e3 === "overviewRulerWidth" && this._queueRefresh(true); })), this.register((0, o.addDisposableDomListener)(this._coreBrowseService.window, "resize", () => { this._queueRefresh(true); })), this._queueRefresh(true); } dispose() { var e3; (e3 = this._canvas) === null || e3 === void 0 || e3.remove(), super.dispose(); } _refreshDrawConstants() { const e3 = Math.floor(this._canvas.width / 3), t3 = Math.ceil(this._canvas.width / 3); d.full = this._canvas.width, d.left = e3, d.center = t3, d.right = e3, this._refreshDrawHeightConstants(), _.full = 0, _.left = 0, _.center = d.left, _.right = d.left + d.center; } _refreshDrawHeightConstants() { l.full = Math.round(2 * this._coreBrowseService.dpr); const e3 = this._canvas.height / this._bufferService.buffer.lines.length, t3 = Math.round(Math.max(Math.min(e3, 12), 6) * this._coreBrowseService.dpr); l.left = t3, l.center = t3, l.right = t3; } _refreshColorZonePadding() { this._colorZoneStore.setPadding({ full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * l.full), left: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * l.left), center: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * l.center), right: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * l.right) }), this._lastKnownBufferLength = this._bufferService.buffers.normal.lines.length; } _refreshCanvasDimensions() { this._canvas.style.width = `${this._width}px`, this._canvas.width = Math.round(this._width * this._coreBrowseService.dpr), this._canvas.style.height = `${this._screenElement.clientHeight}px`, this._canvas.height = Math.round(this._screenElement.clientHeight * this._coreBrowseService.dpr), this._refreshDrawConstants(), this._refreshColorZonePadding(); } _refreshDecorations() { this._shouldUpdateDimensions && this._refreshCanvasDimensions(), this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height), this._colorZoneStore.clear(); for (const e4 of this._decorationService.decorations) this._colorZoneStore.addDecoration(e4); this._ctx.lineWidth = 1; const e3 = this._colorZoneStore.zones; for (const t3 of e3) t3.position !== "full" && this._renderColorZone(t3); for (const t3 of e3) t3.position === "full" && this._renderColorZone(t3); this._shouldUpdateDimensions = false, this._shouldUpdateAnchor = false; } _renderColorZone(e3) { this._ctx.fillStyle = e3.color, this._ctx.fillRect(_[e3.position || "full"], Math.round((this._canvas.height - 1) * (e3.startBufferLine / this._bufferService.buffers.active.lines.length) - l[e3.position || "full"] / 2), d[e3.position || "full"], Math.round((this._canvas.height - 1) * ((e3.endBufferLine - e3.startBufferLine) / this._bufferService.buffers.active.lines.length) + l[e3.position || "full"])); } _queueRefresh(e3, t3) { this._shouldUpdateDimensions = e3 || this._shouldUpdateDimensions, this._shouldUpdateAnchor = t3 || this._shouldUpdateAnchor, this._animationFrame === void 0 && (this._animationFrame = this._coreBrowseService.window.requestAnimationFrame(() => { this._refreshDecorations(), this._animationFrame = void 0; })); } }, "u"); u = s2([r(2, c.IBufferService), r(3, c.IDecorationService), r(4, a.IRenderService), r(5, c.IOptionsService), r(6, a.ICoreBrowserService)], u), t2.OverviewRulerRenderer = u; }, 2950: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.CompositionHelper = void 0; const n = i2(4725), o = i2(2585), a = i2(2584); let h = /* @__PURE__ */ __name(class { constructor(e3, t3, i3, s3, r2, n2) { this._textarea = e3, this._compositionView = t3, this._bufferService = i3, this._optionsService = s3, this._coreService = r2, this._renderService = n2, this._isComposing = false, this._isSendingComposition = false, this._compositionPosition = { start: 0, end: 0 }, this._dataAlreadySent = ""; } get isComposing() { return this._isComposing; } compositionstart() { this._isComposing = true, this._compositionPosition.start = this._textarea.value.length, this._compositionView.textContent = "", this._dataAlreadySent = "", this._compositionView.classList.add("active"); } compositionupdate(e3) { this._compositionView.textContent = e3.data, this.updateCompositionElements(), setTimeout(() => { this._compositionPosition.end = this._textarea.value.length; }, 0); } compositionend() { this._finalizeComposition(true); } keydown(e3) { if (this._isComposing || this._isSendingComposition) { if (e3.keyCode === 229) return false; if (e3.keyCode === 16 || e3.keyCode === 17 || e3.keyCode === 18) return false; this._finalizeComposition(false); } return e3.keyCode !== 229 || (this._handleAnyTextareaChanges(), false); } _finalizeComposition(e3) { if (this._compositionView.classList.remove("active"), this._isComposing = false, e3) { const e4 = { start: this._compositionPosition.start, end: this._compositionPosition.end }; this._isSendingComposition = true, setTimeout(() => { if (this._isSendingComposition) { let t3; this._isSendingComposition = false, e4.start += this._dataAlreadySent.length, t3 = this._isComposing ? this._textarea.value.substring(e4.start, e4.end) : this._textarea.value.substring(e4.start), t3.length > 0 && this._coreService.triggerDataEvent(t3, true); } }, 0); } else { this._isSendingComposition = false; const e4 = this._textarea.value.substring(this._compositionPosition.start, this._compositionPosition.end); this._coreService.triggerDataEvent(e4, true); } } _handleAnyTextareaChanges() { const e3 = this._textarea.value; setTimeout(() => { if (!this._isComposing) { const t3 = this._textarea.value, i3 = t3.replace(e3, ""); this._dataAlreadySent = i3, t3.length > e3.length ? this._coreService.triggerDataEvent(i3, true) : t3.length < e3.length ? this._coreService.triggerDataEvent(`${a.C0.DEL}`, true) : t3.length === e3.length && t3 !== e3 && this._coreService.triggerDataEvent(t3, true); } }, 0); } updateCompositionElements(e3) { if (this._isComposing) { if (this._bufferService.buffer.isCursorInViewport) { const e4 = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1), t3 = this._renderService.dimensions.actualCellHeight, i3 = this._bufferService.buffer.y * this._renderService.dimensions.actualCellHeight, s3 = e4 * this._renderService.dimensions.actualCellWidth; this._compositionView.style.left = s3 + "px", this._compositionView.style.top = i3 + "px", this._compositionView.style.height = t3 + "px", this._compositionView.style.lineHeight = t3 + "px", this._compositionView.style.fontFamily = this._optionsService.rawOptions.fontFamily, this._compositionView.style.fontSize = this._optionsService.rawOptions.fontSize + "px"; const r2 = this._compositionView.getBoundingClientRect(); this._textarea.style.left = s3 + "px", this._textarea.style.top = i3 + "px", this._textarea.style.width = Math.max(r2.width, 1) + "px", this._textarea.style.height = Math.max(r2.height, 1) + "px", this._textarea.style.lineHeight = r2.height + "px"; } e3 || setTimeout(() => this.updateCompositionElements(true), 0); } } }, "h"); h = s2([r(2, o.IBufferService), r(3, o.IOptionsService), r(4, o.ICoreService), r(5, n.IRenderService)], h), t2.CompositionHelper = h; }, 9806: (e2, t2) => { function i2(e3, t3, i3) { const s2 = i3.getBoundingClientRect(), r = e3.getComputedStyle(i3), n = parseInt(r.getPropertyValue("padding-left")), o = parseInt(r.getPropertyValue("padding-top")); return [t3.clientX - s2.left - n, t3.clientY - s2.top - o]; } __name(i2, "i"); Object.defineProperty(t2, "__esModule", { value: true }), t2.getCoords = t2.getCoordsRelativeToElement = void 0, t2.getCoordsRelativeToElement = i2, t2.getCoords = function(e3, t3, s2, r, n, o, a, h, c) { if (!o) return; const l = i2(e3, t3, s2); return l ? (l[0] = Math.ceil((l[0] + (c ? a / 2 : 0)) / a), l[1] = Math.ceil(l[1] / h), l[0] = Math.min(Math.max(l[0], 1), r + (c ? 1 : 0)), l[1] = Math.min(Math.max(l[1], 1), n), l) : void 0; }; }, 9504: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.moveToCellSequence = void 0; const s2 = i2(2584); function r(e3, t3, i3, s3) { const r2 = e3 - n(i3, e3), a2 = t3 - n(i3, t3), l = Math.abs(r2 - a2) - function(e4, t4, i4) { let s4 = 0; const r3 = e4 - n(i4, e4), a3 = t4 - n(i4, t4); for (let n2 = 0; n2 < Math.abs(r3 - a3); n2++) { const a4 = o(e4, t4) === "A" ? -1 : 1, h2 = i4.buffer.lines.get(r3 + a4 * n2); (h2 == null ? void 0 : h2.isWrapped) && s4++; } return s4; }(e3, t3, i3); return c(l, h(o(e3, t3), s3)); } __name(r, "r"); function n(e3, t3) { let i3 = 0, s3 = e3.buffer.lines.get(t3), r2 = s3 == null ? void 0 : s3.isWrapped; for (; r2 && t3 >= 0 && t3 < e3.rows; ) i3++, s3 = e3.buffer.lines.get(--t3), r2 = s3 == null ? void 0 : s3.isWrapped; return i3; } __name(n, "n"); function o(e3, t3) { return e3 > t3 ? "A" : "B"; } __name(o, "o"); function a(e3, t3, i3, s3, r2, n2) { let o2 = e3, a2 = t3, h2 = ""; for (; o2 !== i3 || a2 !== s3; ) o2 += r2 ? 1 : -1, r2 && o2 > n2.cols - 1 ? (h2 += n2.buffer.translateBufferLineToString(a2, false, e3, o2), o2 = 0, e3 = 0, a2++) : !r2 && o2 < 0 && (h2 += n2.buffer.translateBufferLineToString(a2, false, 0, e3 + 1), o2 = n2.cols - 1, e3 = o2, a2--); return h2 + n2.buffer.translateBufferLineToString(a2, false, e3, o2); } __name(a, "a"); function h(e3, t3) { const i3 = t3 ? "O" : "["; return s2.C0.ESC + i3 + e3; } __name(h, "h"); function c(e3, t3) { e3 = Math.floor(e3); let i3 = ""; for (let s3 = 0; s3 < e3; s3++) i3 += t3; return i3; } __name(c, "c"); t2.moveToCellSequence = function(e3, t3, i3, s3) { const o2 = i3.buffer.x, l = i3.buffer.y; if (!i3.buffer.hasScrollback) return function(e4, t4, i4, s4, o3, l2) { return r(t4, s4, o3, l2).length === 0 ? "" : c(a(e4, t4, e4, t4 - n(o3, t4), false, o3).length, h("D", l2)); }(o2, l, 0, t3, i3, s3) + r(l, t3, i3, s3) + function(e4, t4, i4, s4, o3, l2) { let d2; d2 = r(t4, s4, o3, l2).length > 0 ? s4 - n(o3, s4) : t4; const _2 = s4, u = function(e5, t5, i5, s5, o4, a2) { let h2; return h2 = r(i5, s5, o4, a2).length > 0 ? s5 - n(o4, s5) : t5, e5 < i5 && h2 <= s5 || e5 >= i5 && h2 < s5 ? "C" : "D"; }(e4, t4, i4, s4, o3, l2); return c(a(e4, d2, i4, _2, u === "C", o3).length, h(u, l2)); }(o2, l, e3, t3, i3, s3); let d; if (l === t3) return d = o2 > e3 ? "D" : "C", c(Math.abs(o2 - e3), h(d, s3)); d = l > t3 ? "D" : "C"; const _ = Math.abs(l - t3); return c(function(e4, t4) { return t4.cols - e4; }(l > t3 ? e3 : o2, i3) + (_ - 1) * i3.cols + 1 + ((l > t3 ? o2 : e3) - 1), h(d, s3)); }; }, 8036: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.TEXT_BASELINE = t2.DIM_OPACITY = t2.INVERTED_DEFAULT_COLOR = void 0; const s2 = i2(6114); t2.INVERTED_DEFAULT_COLOR = 257, t2.DIM_OPACITY = 0.5, t2.TEXT_BASELINE = s2.isFirefox || s2.isLegacyEdge ? "bottom" : "ideographic"; }, 1752: (e2, t2) => { function i2(e3) { return 57508 <= e3 && e3 <= 57558; } __name(i2, "i"); Object.defineProperty(t2, "__esModule", { value: true }), t2.excludeFromContrastRatioDemands = t2.isRestrictedPowerlineGlyph = t2.isPowerlineGlyph = t2.throwIfFalsy = void 0, t2.throwIfFalsy = function(e3) { if (!e3) throw new Error("value must not be falsy"); return e3; }, t2.isPowerlineGlyph = i2, t2.isRestrictedPowerlineGlyph = function(e3) { return 57520 <= e3 && e3 <= 57527; }, t2.excludeFromContrastRatioDemands = function(e3) { return i2(e3) || function(e4) { return 9472 <= e4 && e4 <= 9631; }(e3); }; }, 1296: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.DomRenderer = void 0; const n = i2(3787), o = i2(8036), a = i2(844), h = i2(4725), c = i2(2585), l = i2(8460), d = i2(8055), _ = i2(9631), u = "xterm-dom-renderer-owner-", f = "xterm-focus"; let v = 1, g = /* @__PURE__ */ __name(class extends a.Disposable { constructor(e3, t3, i3, s3, r2, o2, a2, h2, c2, l2) { super(), this._colors = e3, this._element = t3, this._screenElement = i3, this._viewportElement = s3, this._linkifier2 = r2, this._charSizeService = a2, this._optionsService = h2, this._bufferService = c2, this._coreBrowserService = l2, this._terminalClass = v++, this._rowElements = [], this._rowContainer = document.createElement("div"), this._rowContainer.classList.add("xterm-rows"), this._rowContainer.style.lineHeight = "normal", this._rowContainer.setAttribute("aria-hidden", "true"), this._refreshRowElements(this._bufferService.cols, this._bufferService.rows), this._selectionContainer = document.createElement("div"), this._selectionContainer.classList.add("xterm-selection"), this._selectionContainer.setAttribute("aria-hidden", "true"), this.dimensions = { scaledCharWidth: 0, scaledCharHeight: 0, scaledCellWidth: 0, scaledCellHeight: 0, scaledCharLeft: 0, scaledCharTop: 0, scaledCanvasWidth: 0, scaledCanvasHeight: 0, canvasWidth: 0, canvasHeight: 0, actualCellWidth: 0, actualCellHeight: 0 }, this._updateDimensions(), this._injectCss(), this._rowFactory = o2.createInstance(n.DomRendererRowFactory, document, this._colors), this._element.classList.add(u + this._terminalClass), this._screenElement.appendChild(this._rowContainer), this._screenElement.appendChild(this._selectionContainer), this.register(this._linkifier2.onShowLinkUnderline((e4) => this._onLinkHover(e4))), this.register(this._linkifier2.onHideLinkUnderline((e4) => this._onLinkLeave(e4))); } get onRequestRedraw() { return new l.EventEmitter().event; } dispose() { this._element.classList.remove(u + this._terminalClass), (0, _.removeElementFromParent)(this._rowContainer, this._selectionContainer, this._themeStyleElement, this._dimensionsStyleElement), super.dispose(); } _updateDimensions() { const e3 = this._coreBrowserService.dpr; this.dimensions.scaledCharWidth = this._charSizeService.width * e3, this.dimensions.scaledCharHeight = Math.ceil(this._charSizeService.height * e3), this.dimensions.scaledCellWidth = this.dimensions.scaledCharWidth + Math.round(this._optionsService.rawOptions.letterSpacing), this.dimensions.scaledCellHeight = Math.floor(this.dimensions.scaledCharHeight * this._optionsService.rawOptions.lineHeight), this.dimensions.scaledCharLeft = 0, this.dimensions.scaledCharTop = 0, this.dimensions.scaledCanvasWidth = this.dimensions.scaledCellWidth * this._bufferService.cols, this.dimensions.scaledCanvasHeight = this.dimensions.scaledCellHeight * this._bufferService.rows, this.dimensions.canvasWidth = Math.round(this.dimensions.scaledCanvasWidth / e3), this.dimensions.canvasHeight = Math.round(this.dimensions.scaledCanvasHeight / e3), this.dimensions.actualCellWidth = this.dimensions.canvasWidth / this._bufferService.cols, this.dimensions.actualCellHeight = this.dimensions.canvasHeight / this._bufferService.rows; for (const e4 of this._rowElements) e4.style.width = `${this.dimensions.canvasWidth}px`, e4.style.height = `${this.dimensions.actualCellHeight}px`, e4.style.lineHeight = `${this.dimensions.actualCellHeight}px`, e4.style.overflow = "hidden"; this._dimensionsStyleElement || (this._dimensionsStyleElement = document.createElement("style"), this._screenElement.appendChild(this._dimensionsStyleElement)); const t3 = `${this._terminalSelector} .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: ${this.dimensions.actualCellWidth}px}`; this._dimensionsStyleElement.textContent = t3, this._selectionContainer.style.height = this._viewportElement.style.height, this._screenElement.style.width = `${this.dimensions.canvasWidth}px`, this._screenElement.style.height = `${this.dimensions.canvasHeight}px`; } setColors(e3) { this._colors = e3, this._injectCss(); } _injectCss() { this._themeStyleElement || (this._themeStyleElement = document.createElement("style"), this._screenElement.appendChild(this._themeStyleElement)); let e3 = `${this._terminalSelector} .xterm-rows { color: ${this._colors.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`; e3 += `${this._terminalSelector} span:not(.${n.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${n.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${n.ITALIC_CLASS} { font-style: italic;}`, e3 += "@keyframes blink_box_shadow_" + this._terminalClass + " { 50% { box-shadow: none; }}", e3 += "@keyframes blink_block_" + this._terminalClass + ` { 0% { background-color: ${this._colors.cursor.css}; color: ${this._colors.cursorAccent.css}; } 50% { background-color: ${this._colors.cursorAccent.css}; color: ${this._colors.cursor.css}; }}`, e3 += `${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${n.CURSOR_CLASS}.${n.CURSOR_STYLE_BLOCK_CLASS} { outline: 1px solid ${this._colors.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .xterm-rows.xterm-focus .${n.CURSOR_CLASS}.${n.CURSOR_BLINK_CLASS}:not(.${n.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_` + this._terminalClass + ` 1s step-end infinite;}${this._terminalSelector} .xterm-rows.xterm-focus .${n.CURSOR_CLASS}.${n.CURSOR_BLINK_CLASS}.${n.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_` + this._terminalClass + ` 1s step-end infinite;}${this._terminalSelector} .xterm-rows.xterm-focus .${n.CURSOR_CLASS}.${n.CURSOR_STYLE_BLOCK_CLASS} { background-color: ${this._colors.cursor.css}; color: ${this._colors.cursorAccent.css};}${this._terminalSelector} .xterm-rows .${n.CURSOR_CLASS}.${n.CURSOR_STYLE_BAR_CLASS} { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${this._colors.cursor.css} inset;}${this._terminalSelector} .xterm-rows .${n.CURSOR_CLASS}.${n.CURSOR_STYLE_UNDERLINE_CLASS} { box-shadow: 0 -1px 0 ${this._colors.cursor.css} inset;}`, e3 += `${this._terminalSelector} .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .xterm-selection div { position: absolute; background-color: ${this._colors.selectionBackgroundOpaque.css};}${this._terminalSelector} .xterm-selection div { position: absolute; background-color: ${this._colors.selectionInactiveBackgroundOpaque.css};}`, this._colors.ansi.forEach((t3, i3) => { e3 += `${this._terminalSelector} .xterm-fg-${i3} { color: ${t3.css}; }${this._terminalSelector} .xterm-bg-${i3} { background-color: ${t3.css}; }`; }), e3 += `${this._terminalSelector} .xterm-fg-${o.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(this._colors.background).css}; }${this._terminalSelector} .xterm-bg-${o.INVERTED_DEFAULT_COLOR} { background-color: ${this._colors.foreground.css}; }`, this._themeStyleElement.textContent = e3; } onDevicePixelRatioChange() { this._updateDimensions(); } _refreshRowElements(e3, t3) { for (let e4 = this._rowElements.length; e4 <= t3; e4++) { const e5 = document.createElement("div"); this._rowContainer.appendChild(e5), this._rowElements.push(e5); } for (; this._rowElements.length > t3; ) this._rowContainer.removeChild(this._rowElements.pop()); } onResize(e3, t3) { this._refreshRowElements(e3, t3), this._updateDimensions(); } onCharSizeChanged() { this._updateDimensions(); } onBlur() { this._rowContainer.classList.remove(f); } onFocus() { this._rowContainer.classList.add(f); } onSelectionChanged(e3, t3, i3) { for (; this._selectionContainer.children.length; ) this._selectionContainer.removeChild(this._selectionContainer.children[0]); if (this._rowFactory.onSelectionChanged(e3, t3, i3), this.renderRows(0, this._bufferService.rows - 1), !e3 || !t3) return; const s3 = e3[1] - this._bufferService.buffer.ydisp, r2 = t3[1] - this._bufferService.buffer.ydisp, n2 = Math.max(s3, 0), o2 = Math.min(r2, this._bufferService.rows - 1); if (n2 >= this._bufferService.rows || o2 < 0) return; const a2 = document.createDocumentFragment(); if (i3) { const i4 = e3[0] > t3[0]; a2.appendChild(this._createSelectionElement(n2, i4 ? t3[0] : e3[0], i4 ? e3[0] : t3[0], o2 - n2 + 1)); } else { const i4 = s3 === n2 ? e3[0] : 0, h2 = n2 === r2 ? t3[0] : this._bufferService.cols; a2.appendChild(this._createSelectionElement(n2, i4, h2)); const c2 = o2 - n2 - 1; if (a2.appendChild(this._createSelectionElement(n2 + 1, 0, this._bufferService.cols, c2)), n2 !== o2) { const e4 = r2 === o2 ? t3[0] : this._bufferService.cols; a2.appendChild(this._createSelectionElement(o2, 0, e4)); } } this._selectionContainer.appendChild(a2); } _createSelectionElement(e3, t3, i3, s3 = 1) { const r2 = document.createElement("div"); return r2.style.height = s3 * this.dimensions.actualCellHeight + "px", r2.style.top = e3 * this.dimensions.actualCellHeight + "px", r2.style.left = t3 * this.dimensions.actualCellWidth + "px", r2.style.width = this.dimensions.actualCellWidth * (i3 - t3) + "px", r2; } onCursorMove() { } onOptionsChanged() { this._updateDimensions(), this._injectCss(); } clear() { for (const e3 of this._rowElements) e3.innerText = ""; } renderRows(e3, t3) { const i3 = this._bufferService.buffer.ybase + this._bufferService.buffer.y, s3 = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1), r2 = this._optionsService.rawOptions.cursorBlink; for (let n2 = e3; n2 <= t3; n2++) { const e4 = this._rowElements[n2]; e4.innerText = ""; const t4 = n2 + this._bufferService.buffer.ydisp, o2 = this._bufferService.buffer.lines.get(t4), a2 = this._optionsService.rawOptions.cursorStyle; e4.appendChild(this._rowFactory.createRow(o2, t4, t4 === i3, a2, s3, r2, this.dimensions.actualCellWidth, this._bufferService.cols)); } } get _terminalSelector() { return `.${u}${this._terminalClass}`; } _onLinkHover(e3) { this._setCellUnderline(e3.x1, e3.x2, e3.y1, e3.y2, e3.cols, true); } _onLinkLeave(e3) { this._setCellUnderline(e3.x1, e3.x2, e3.y1, e3.y2, e3.cols, false); } _setCellUnderline(e3, t3, i3, s3, r2, n2) { for (; e3 !== t3 || i3 !== s3; ) { const t4 = this._rowElements[i3]; if (!t4) return; const s4 = t4.children[e3]; s4 && (s4.style.textDecoration = n2 ? "underline" : "none"), ++e3 >= r2 && (e3 = 0, i3++); } } }, "g"); g = s2([r(5, c.IInstantiationService), r(6, h.ICharSizeService), r(7, c.IOptionsService), r(8, c.IBufferService), r(9, h.ICoreBrowserService)], g), t2.DomRenderer = g; }, 3787: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.DomRendererRowFactory = t2.CURSOR_STYLE_UNDERLINE_CLASS = t2.CURSOR_STYLE_BAR_CLASS = t2.CURSOR_STYLE_BLOCK_CLASS = t2.CURSOR_BLINK_CLASS = t2.CURSOR_CLASS = t2.STRIKETHROUGH_CLASS = t2.UNDERLINE_CLASS = t2.ITALIC_CLASS = t2.DIM_CLASS = t2.BOLD_CLASS = void 0; const n = i2(8036), o = i2(643), a = i2(511), h = i2(2585), c = i2(8055), l = i2(4725), d = i2(4269), _ = i2(1752), u = i2(3734); t2.BOLD_CLASS = "xterm-bold", t2.DIM_CLASS = "xterm-dim", t2.ITALIC_CLASS = "xterm-italic", t2.UNDERLINE_CLASS = "xterm-underline", t2.STRIKETHROUGH_CLASS = "xterm-strikethrough", t2.CURSOR_CLASS = "xterm-cursor", t2.CURSOR_BLINK_CLASS = "xterm-cursor-blink", t2.CURSOR_STYLE_BLOCK_CLASS = "xterm-cursor-block", t2.CURSOR_STYLE_BAR_CLASS = "xterm-cursor-bar", t2.CURSOR_STYLE_UNDERLINE_CLASS = "xterm-cursor-underline"; let f = /* @__PURE__ */ __name(class { constructor(e3, t3, i3, s3, r2, n2, o2) { this._document = e3, this._colors = t3, this._characterJoinerService = i3, this._optionsService = s3, this._coreBrowserService = r2, this._coreService = n2, this._decorationService = o2, this._workCell = new a.CellData(), this._columnSelectMode = false; } setColors(e3) { this._colors = e3; } onSelectionChanged(e3, t3, i3) { this._selectionStart = e3, this._selectionEnd = t3, this._columnSelectMode = i3; } createRow(e3, i3, s3, r2, a2, h2, l2, _2) { const f2 = this._document.createDocumentFragment(), g = this._characterJoinerService.getJoinedCharacters(i3); let p = 0; for (let t3 = Math.min(e3.length, _2) - 1; t3 >= 0; t3--) if (e3.loadCell(t3, this._workCell).getCode() !== o.NULL_CELL_CODE || s3 && t3 === a2) { p = t3 + 1; break; } for (let _3 = 0; _3 < p; _3++) { e3.loadCell(_3, this._workCell); let p2 = this._workCell.getWidth(); if (p2 === 0) continue; let S = false, m = _3, C = this._workCell; if (g.length > 0 && _3 === g[0][0]) { S = true; const t3 = g.shift(); C = new d.JoinedCellData(this._workCell, e3.translateToString(true, t3[0], t3[1]), t3[1] - t3[0]), m = t3[1] - 1, p2 = C.getWidth(); } const b = this._document.createElement("span"); if (p2 > 1 && (b.style.width = l2 * p2 + "px"), S && (b.style.display = "inline", a2 >= _3 && a2 <= m && (a2 = _3)), !this._coreService.isCursorHidden && s3 && _3 === a2) switch (b.classList.add(t2.CURSOR_CLASS), h2 && b.classList.add(t2.CURSOR_BLINK_CLASS), r2) { case "bar": b.classList.add(t2.CURSOR_STYLE_BAR_CLASS); break; case "underline": b.classList.add(t2.CURSOR_STYLE_UNDERLINE_CLASS); break; default: b.classList.add(t2.CURSOR_STYLE_BLOCK_CLASS); } if (C.isBold() && b.classList.add(t2.BOLD_CLASS), C.isItalic() && b.classList.add(t2.ITALIC_CLASS), C.isDim() && b.classList.add(t2.DIM_CLASS), C.isInvisible() ? b.textContent = o.WHITESPACE_CELL_CHAR : b.textContent = C.getChars() || o.WHITESPACE_CELL_CHAR, C.isUnderline() && (b.classList.add(`${t2.UNDERLINE_CLASS}-${C.extended.underlineStyle}`), b.textContent === " " && (b.innerHTML = " "), !C.isUnderlineColorDefault())) if (C.isUnderlineColorRGB()) b.style.textDecorationColor = `rgb(${u.AttributeData.toColorRGB(C.getUnderlineColor()).join(",")})`; else { let e4 = C.getUnderlineColor(); this._optionsService.rawOptions.drawBoldTextInBrightColors && C.isBold() && e4 < 8 && (e4 += 8), b.style.textDecorationColor = this._colors.ansi[e4].css; } C.isStrikethrough() && b.classList.add(t2.STRIKETHROUGH_CLASS); let y = C.getFgColor(), w = C.getFgColorMode(), E = C.getBgColor(), L = C.getBgColorMode(); const R = !!C.isInverse(); if (R) { const e4 = y; y = E, E = e4; const t3 = w; w = L, L = t3; } let k, D, A = false; this._decorationService.forEachDecorationAtCell(_3, i3, void 0, (e4) => { e4.options.layer !== "top" && A || (e4.backgroundColorRGB && (L = 50331648, E = e4.backgroundColorRGB.rgba >> 8 & 16777215, k = e4.backgroundColorRGB), e4.foregroundColorRGB && (w = 50331648, y = e4.foregroundColorRGB.rgba >> 8 & 16777215, D = e4.foregroundColorRGB), A = e4.options.layer === "top"); }); const x = this._isCellInSelection(_3, i3); let B; switch (A || this._colors.selectionForeground && x && (w = 50331648, y = this._colors.selectionForeground.rgba >> 8 & 16777215, D = this._colors.selectionForeground), x && (k = this._coreBrowserService.isFocused ? this._colors.selectionBackgroundOpaque : this._colors.selectionInactiveBackgroundOpaque, A = true), A && b.classList.add("xterm-decoration-top"), L) { case 16777216: case 33554432: B = this._colors.ansi[E], b.classList.add(`xterm-bg-${E}`); break; case 50331648: B = c.rgba.toColor(E >> 16, E >> 8 & 255, 255 & E), this._addStyle(b, `background-color:#${v((E >>> 0).toString(16), "0", 6)}`); break; default: R ? (B = this._colors.foreground, b.classList.add(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)) : B = this._colors.background; } switch (k || C.isDim() && (k = c.color.multiplyOpacity(B, 0.5)), w) { case 16777216: case 33554432: C.isBold() && y < 8 && this._optionsService.rawOptions.drawBoldTextInBrightColors && (y += 8), this._applyMinimumContrast(b, B, this._colors.ansi[y], C, k, void 0) || b.classList.add(`xterm-fg-${y}`); break; case 50331648: const e4 = c.rgba.toColor(y >> 16 & 255, y >> 8 & 255, 255 & y); this._applyMinimumContrast(b, B, e4, C, k, D) || this._addStyle(b, `color:#${v(y.toString(16), "0", 6)}`); break; default: this._applyMinimumContrast(b, B, this._colors.foreground, C, k, void 0) || R && b.classList.add(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`); } f2.appendChild(b), _3 = m; } return f2; } _applyMinimumContrast(e3, t3, i3, s3, r2, n2) { if (this._optionsService.rawOptions.minimumContrastRatio === 1 || (0, _.excludeFromContrastRatioDemands)(s3.getCode())) return false; let o2; return r2 || n2 || (o2 = this._colors.contrastCache.getColor(t3.rgba, i3.rgba)), o2 === void 0 && (o2 = c.color.ensureContrastRatio(r2 || t3, n2 || i3, this._optionsService.rawOptions.minimumContrastRatio), this._colors.contrastCache.setColor((r2 || t3).rgba, (n2 || i3).rgba, o2 != null ? o2 : null)), !!o2 && (this._addStyle(e3, `color:${o2.css}`), true); } _addStyle(e3, t3) { e3.setAttribute("style", `${e3.getAttribute("style") || ""}${t3};`); } _isCellInSelection(e3, t3) { const i3 = this._selectionStart, s3 = this._selectionEnd; return !(!i3 || !s3) && (this._columnSelectMode ? i3[0] <= s3[0] ? e3 >= i3[0] && t3 >= i3[1] && e3 < s3[0] && t3 <= s3[1] : e3 < i3[0] && t3 >= i3[1] && e3 >= s3[0] && t3 <= s3[1] : t3 > i3[1] && t3 < s3[1] || i3[1] === s3[1] && t3 === i3[1] && e3 >= i3[0] && e3 < s3[0] || i3[1] < s3[1] && t3 === s3[1] && e3 < s3[0] || i3[1] < s3[1] && t3 === i3[1] && e3 >= i3[0]); } }, "f"); function v(e3, t3, i3) { for (; e3.length < i3; ) e3 = t3 + e3; return e3; } __name(v, "v"); f = s2([r(2, l.ICharacterJoinerService), r(3, h.IOptionsService), r(4, l.ICoreBrowserService), r(5, h.ICoreService), r(6, h.IDecorationService)], f), t2.DomRendererRowFactory = f; }, 456: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.SelectionModel = void 0, t2.SelectionModel = class { constructor(e3) { this._bufferService = e3, this.isSelectAllActive = false, this.selectionStartLength = 0; } clearSelection() { this.selectionStart = void 0, this.selectionEnd = void 0, this.isSelectAllActive = false, this.selectionStartLength = 0; } get finalSelectionStart() { return this.isSelectAllActive ? [0, 0] : this.selectionEnd && this.selectionStart && this.areSelectionValuesReversed() ? this.selectionEnd : this.selectionStart; } get finalSelectionEnd() { if (this.isSelectAllActive) return [this._bufferService.cols, this._bufferService.buffer.ybase + this._bufferService.rows - 1]; if (this.selectionStart) { if (!this.selectionEnd || this.areSelectionValuesReversed()) { const e3 = this.selectionStart[0] + this.selectionStartLength; return e3 > this._bufferService.cols ? e3 % this._bufferService.cols == 0 ? [this._bufferService.cols, this.selectionStart[1] + Math.floor(e3 / this._bufferService.cols) - 1] : [e3 % this._bufferService.cols, this.selectionStart[1] + Math.floor(e3 / this._bufferService.cols)] : [e3, this.selectionStart[1]]; } if (this.selectionStartLength && this.selectionEnd[1] === this.selectionStart[1]) { const e3 = this.selectionStart[0] + this.selectionStartLength; return e3 > this._bufferService.cols ? [e3 % this._bufferService.cols, this.selectionStart[1] + Math.floor(e3 / this._bufferService.cols)] : [Math.max(e3, this.selectionEnd[0]), this.selectionEnd[1]]; } return this.selectionEnd; } } areSelectionValuesReversed() { const e3 = this.selectionStart, t3 = this.selectionEnd; return !(!e3 || !t3) && (e3[1] > t3[1] || e3[1] === t3[1] && e3[0] > t3[0]); } onTrim(e3) { return this.selectionStart && (this.selectionStart[1] -= e3), this.selectionEnd && (this.selectionEnd[1] -= e3), this.selectionEnd && this.selectionEnd[1] < 0 ? (this.clearSelection(), true) : (this.selectionStart && this.selectionStart[1] < 0 && (this.selectionStart[1] = 0), false); } }; }, 428: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.CharSizeService = void 0; const n = i2(2585), o = i2(8460); let a = /* @__PURE__ */ __name(class { constructor(e3, t3, i3) { this._optionsService = i3, this.width = 0, this.height = 0, this._onCharSizeChange = new o.EventEmitter(), this._measureStrategy = new h(e3, t3, this._optionsService); } get hasValidSize() { return this.width > 0 && this.height > 0; } get onCharSizeChange() { return this._onCharSizeChange.event; } measure() { const e3 = this._measureStrategy.measure(); e3.width === this.width && e3.height === this.height || (this.width = e3.width, this.height = e3.height, this._onCharSizeChange.fire()); } }, "a"); a = s2([r(2, n.IOptionsService)], a), t2.CharSizeService = a; class h { constructor(e3, t3, i3) { this._document = e3, this._parentElement = t3, this._optionsService = i3, this._result = { width: 0, height: 0 }, this._measureElement = this._document.createElement("span"), this._measureElement.classList.add("xterm-char-measure-element"), this._measureElement.textContent = "W", this._measureElement.setAttribute("aria-hidden", "true"), this._parentElement.appendChild(this._measureElement); } measure() { this._measureElement.style.fontFamily = this._optionsService.rawOptions.fontFamily, this._measureElement.style.fontSize = `${this._optionsService.rawOptions.fontSize}px`; const e3 = this._measureElement.getBoundingClientRect(); return e3.width !== 0 && e3.height !== 0 && (this._result.width = e3.width, this._result.height = Math.ceil(e3.height)), this._result; } } __name(h, "h"); }, 4269: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.CharacterJoinerService = t2.JoinedCellData = void 0; const n = i2(3734), o = i2(643), a = i2(511), h = i2(2585); class c extends n.AttributeData { constructor(e3, t3, i3) { super(), this.content = 0, this.combinedData = "", this.fg = e3.fg, this.bg = e3.bg, this.combinedData = t3, this._width = i3; } isCombined() { return 2097152; } getWidth() { return this._width; } getChars() { return this.combinedData; } getCode() { return 2097151; } setFromCharData(e3) { throw new Error("not implemented"); } getAsCharData() { return [this.fg, this.getChars(), this.getWidth(), this.getCode()]; } } __name(c, "c"); t2.JoinedCellData = c; let l = /* @__PURE__ */ __name(class e3 { constructor(e4) { this._bufferService = e4, this._characterJoiners = [], this._nextCharacterJoinerId = 0, this._workCell = new a.CellData(); } register(e4) { const t3 = { id: this._nextCharacterJoinerId++, handler: e4 }; return this._characterJoiners.push(t3), t3.id; } deregister(e4) { for (let t3 = 0; t3 < this._characterJoiners.length; t3++) if (this._characterJoiners[t3].id === e4) return this._characterJoiners.splice(t3, 1), true; return false; } getJoinedCharacters(e4) { if (this._characterJoiners.length === 0) return []; const t3 = this._bufferService.buffer.lines.get(e4); if (!t3 || t3.length === 0) return []; const i3 = [], s3 = t3.translateToString(true); let r2 = 0, n2 = 0, a2 = 0, h2 = t3.getFg(0), c2 = t3.getBg(0); for (let e5 = 0; e5 < t3.getTrimmedLength(); e5++) if (t3.loadCell(e5, this._workCell), this._workCell.getWidth() !== 0) { if (this._workCell.fg !== h2 || this._workCell.bg !== c2) { if (e5 - r2 > 1) { const e6 = this._getJoinedRanges(s3, a2, n2, t3, r2); for (let t4 = 0; t4 < e6.length; t4++) i3.push(e6[t4]); } r2 = e5, a2 = n2, h2 = this._workCell.fg, c2 = this._workCell.bg; } n2 += this._workCell.getChars().length || o.WHITESPACE_CELL_CHAR.length; } if (this._bufferService.cols - r2 > 1) { const e5 = this._getJoinedRanges(s3, a2, n2, t3, r2); for (let t4 = 0; t4 < e5.length; t4++) i3.push(e5[t4]); } return i3; } _getJoinedRanges(t3, i3, s3, r2, n2) { const o2 = t3.substring(i3, s3); let a2 = []; try { a2 = this._characterJoiners[0].handler(o2); } catch (e4) { console.error(e4); } for (let t4 = 1; t4 < this._characterJoiners.length; t4++) try { const i4 = this._characterJoiners[t4].handler(o2); for (let t5 = 0; t5 < i4.length; t5++) e3._mergeRanges(a2, i4[t5]); } catch (e4) { console.error(e4); } return this._stringRangesToCellRanges(a2, r2, n2), a2; } _stringRangesToCellRanges(e4, t3, i3) { let s3 = 0, r2 = false, n2 = 0, a2 = e4[s3]; if (a2) { for (let h2 = i3; h2 < this._bufferService.cols; h2++) { const i4 = t3.getWidth(h2), c2 = t3.getString(h2).length || o.WHITESPACE_CELL_CHAR.length; if (i4 !== 0) { if (!r2 && a2[0] <= n2 && (a2[0] = h2, r2 = true), a2[1] <= n2) { if (a2[1] = h2, a2 = e4[++s3], !a2) break; a2[0] <= n2 ? (a2[0] = h2, r2 = true) : r2 = false; } n2 += c2; } } a2 && (a2[1] = this._bufferService.cols); } } static _mergeRanges(e4, t3) { let i3 = false; for (let s3 = 0; s3 < e4.length; s3++) { const r2 = e4[s3]; if (i3) { if (t3[1] <= r2[0]) return e4[s3 - 1][1] = t3[1], e4; if (t3[1] <= r2[1]) return e4[s3 - 1][1] = Math.max(t3[1], r2[1]), e4.splice(s3, 1), e4; e4.splice(s3, 1), s3--; } else { if (t3[1] <= r2[0]) return e4.splice(s3, 0, t3), e4; if (t3[1] <= r2[1]) return r2[0] = Math.min(t3[0], r2[0]), e4; t3[0] < r2[1] && (r2[0] = Math.min(t3[0], r2[0]), i3 = true); } } return i3 ? e4[e4.length - 1][1] = t3[1] : e4.push(t3), e4; } }, "e"); l = s2([r(0, h.IBufferService)], l), t2.CharacterJoinerService = l; }, 5114: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.CoreBrowserService = void 0, t2.CoreBrowserService = class { constructor(e3, t3) { this._textarea = e3, this.window = t3; } get dpr() { return this.window.devicePixelRatio; } get isFocused() { return (this._textarea.getRootNode ? this._textarea.getRootNode() : this._textarea.ownerDocument).activeElement === this._textarea && this._textarea.ownerDocument.hasFocus(); } }; }, 8934: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.MouseService = void 0; const n = i2(4725), o = i2(9806); let a = /* @__PURE__ */ __name(class { constructor(e3, t3) { this._renderService = e3, this._charSizeService = t3; } getCoords(e3, t3, i3, s3, r2) { return (0, o.getCoords)(window, e3, t3, i3, s3, this._charSizeService.hasValidSize, this._renderService.dimensions.actualCellWidth, this._renderService.dimensions.actualCellHeight, r2); } getMouseReportCoords(e3, t3) { const i3 = (0, o.getCoordsRelativeToElement)(window, e3, t3); if (!(!this._charSizeService.hasValidSize || i3[0] < 0 || i3[1] < 0 || i3[0] >= this._renderService.dimensions.canvasWidth || i3[1] >= this._renderService.dimensions.canvasHeight)) return { col: Math.floor(i3[0] / this._renderService.dimensions.actualCellWidth), row: Math.floor(i3[1] / this._renderService.dimensions.actualCellHeight), x: Math.floor(i3[0]), y: Math.floor(i3[1]) }; } }, "a"); a = s2([r(0, n.IRenderService), r(1, n.ICharSizeService)], a), t2.MouseService = a; }, 3230: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.RenderService = void 0; const n = i2(6193), o = i2(8460), a = i2(844), h = i2(5596), c = i2(3656), l = i2(2585), d = i2(4725); let _ = /* @__PURE__ */ __name(class extends a.Disposable { constructor(e3, t3, i3, s3, r2, a2, l2, d2) { if (super(), this._renderer = e3, this._rowCount = t3, this._charSizeService = r2, this._isPaused = false, this._needsFullRefresh = false, this._isNextRenderRedrawOnly = true, this._needsSelectionRefresh = false, this._canvasWidth = 0, this._canvasHeight = 0, this._selectionState = { start: void 0, end: void 0, columnSelectMode: false }, this._onDimensionsChange = new o.EventEmitter(), this._onRenderedViewportChange = new o.EventEmitter(), this._onRender = new o.EventEmitter(), this._onRefreshRequest = new o.EventEmitter(), this.register({ dispose: () => this._renderer.dispose() }), this._renderDebouncer = new n.RenderDebouncer(d2.window, (e4, t4) => this._renderRows(e4, t4)), this.register(this._renderDebouncer), this._screenDprMonitor = new h.ScreenDprMonitor(d2.window), this._screenDprMonitor.setListener(() => this.onDevicePixelRatioChange()), this.register(this._screenDprMonitor), this.register(l2.onResize(() => this._fullRefresh())), this.register(l2.buffers.onBufferActivate(() => { var e4; return (e4 = this._renderer) === null || e4 === void 0 ? void 0 : e4.clear(); })), this.register(s3.onOptionChange(() => this._handleOptionsChanged())), this.register(this._charSizeService.onCharSizeChange(() => this.onCharSizeChanged())), this.register(a2.onDecorationRegistered(() => this._fullRefresh())), this.register(a2.onDecorationRemoved(() => this._fullRefresh())), this._renderer.onRequestRedraw((e4) => this.refreshRows(e4.start, e4.end, true)), this.register((0, c.addDisposableDomListener)(d2.window, "resize", () => this.onDevicePixelRatioChange())), "IntersectionObserver" in d2.window) { const e4 = new d2.window.IntersectionObserver((e5) => this._onIntersectionChange(e5[e5.length - 1]), { threshold: 0 }); e4.observe(i3), this.register({ dispose: () => e4.disconnect() }); } } get onDimensionsChange() { return this._onDimensionsChange.event; } get onRenderedViewportChange() { return this._onRenderedViewportChange.event; } get onRender() { return this._onRender.event; } get onRefreshRequest() { return this._onRefreshRequest.event; } get dimensions() { return this._renderer.dimensions; } _onIntersectionChange(e3) { this._isPaused = e3.isIntersecting === void 0 ? e3.intersectionRatio === 0 : !e3.isIntersecting, this._isPaused || this._charSizeService.hasValidSize || this._charSizeService.measure(), !this._isPaused && this._needsFullRefresh && (this.refreshRows(0, this._rowCount - 1), this._needsFullRefresh = false); } refreshRows(e3, t3, i3 = false) { this._isPaused ? this._needsFullRefresh = true : (i3 || (this._isNextRenderRedrawOnly = false), this._renderDebouncer.refresh(e3, t3, this._rowCount)); } _renderRows(e3, t3) { this._renderer.renderRows(e3, t3), this._needsSelectionRefresh && (this._renderer.onSelectionChanged(this._selectionState.start, this._selectionState.end, this._selectionState.columnSelectMode), this._needsSelectionRefresh = false), this._isNextRenderRedrawOnly || this._onRenderedViewportChange.fire({ start: e3, end: t3 }), this._onRender.fire({ start: e3, end: t3 }), this._isNextRenderRedrawOnly = true; } resize(e3, t3) { this._rowCount = t3, this._fireOnCanvasResize(); } _handleOptionsChanged() { this._renderer.onOptionsChanged(), this.refreshRows(0, this._rowCount - 1), this._fireOnCanvasResize(); } _fireOnCanvasResize() { this._renderer.dimensions.canvasWidth === this._canvasWidth && this._renderer.dimensions.canvasHeight === this._canvasHeight || this._onDimensionsChange.fire(this._renderer.dimensions); } dispose() { super.dispose(); } setRenderer(e3) { this._renderer.dispose(), this._renderer = e3, this._renderer.onRequestRedraw((e4) => this.refreshRows(e4.start, e4.end, true)), this._needsSelectionRefresh = true, this._fullRefresh(); } addRefreshCallback(e3) { return this._renderDebouncer.addRefreshCallback(e3); } _fullRefresh() { this._isPaused ? this._needsFullRefresh = true : this.refreshRows(0, this._rowCount - 1); } clearTextureAtlas() { var e3, t3; (t3 = (e3 = this._renderer) === null || e3 === void 0 ? void 0 : e3.clearTextureAtlas) === null || t3 === void 0 || t3.call(e3), this._fullRefresh(); } setColors(e3) { this._renderer.setColors(e3), this._fullRefresh(); } onDevicePixelRatioChange() { this._charSizeService.measure(), this._renderer.onDevicePixelRatioChange(), this.refreshRows(0, this._rowCount - 1); } onResize(e3, t3) { this._renderer.onResize(e3, t3), this._fullRefresh(); } onCharSizeChanged() { this._renderer.onCharSizeChanged(); } onBlur() { this._renderer.onBlur(); } onFocus() { this._renderer.onFocus(); } onSelectionChanged(e3, t3, i3) { this._selectionState.start = e3, this._selectionState.end = t3, this._selectionState.columnSelectMode = i3, this._renderer.onSelectionChanged(e3, t3, i3); } onCursorMove() { this._renderer.onCursorMove(); } clear() { this._renderer.clear(); } }, "_"); _ = s2([r(3, l.IOptionsService), r(4, d.ICharSizeService), r(5, l.IDecorationService), r(6, l.IBufferService), r(7, d.ICoreBrowserService)], _), t2.RenderService = _; }, 9312: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.SelectionService = void 0; const n = i2(6114), o = i2(456), a = i2(511), h = i2(8460), c = i2(4725), l = i2(2585), d = i2(9806), _ = i2(9504), u = i2(844), f = i2(4841), v = String.fromCharCode(160), g = new RegExp(v, "g"); let p = /* @__PURE__ */ __name(class extends u.Disposable { constructor(e3, t3, i3, s3, r2, n2, c2, l2, d2) { super(), this._element = e3, this._screenElement = t3, this._linkifier = i3, this._bufferService = s3, this._coreService = r2, this._mouseService = n2, this._optionsService = c2, this._renderService = l2, this._coreBrowserService = d2, this._dragScrollAmount = 0, this._enabled = true, this._workCell = new a.CellData(), this._mouseDownTimeStamp = 0, this._oldHasSelection = false, this._oldSelectionStart = void 0, this._oldSelectionEnd = void 0, this._onLinuxMouseSelection = this.register(new h.EventEmitter()), this._onRedrawRequest = this.register(new h.EventEmitter()), this._onSelectionChange = this.register(new h.EventEmitter()), this._onRequestScrollLines = this.register(new h.EventEmitter()), this._mouseMoveListener = (e4) => this._onMouseMove(e4), this._mouseUpListener = (e4) => this._onMouseUp(e4), this._coreService.onUserInput(() => { this.hasSelection && this.clearSelection(); }), this._trimListener = this._bufferService.buffer.lines.onTrim((e4) => this._onTrim(e4)), this.register(this._bufferService.buffers.onBufferActivate((e4) => this._onBufferActivate(e4))), this.enable(), this._model = new o.SelectionModel(this._bufferService), this._activeSelectionMode = 0; } get onLinuxMouseSelection() { return this._onLinuxMouseSelection.event; } get onRequestRedraw() { return this._onRedrawRequest.event; } get onSelectionChange() { return this._onSelectionChange.event; } get onRequestScrollLines() { return this._onRequestScrollLines.event; } dispose() { this._removeMouseDownListeners(); } reset() { this.clearSelection(); } disable() { this.clearSelection(), this._enabled = false; } enable() { this._enabled = true; } get selectionStart() { return this._model.finalSelectionStart; } get selectionEnd() { return this._model.finalSelectionEnd; } get hasSelection() { const e3 = this._model.finalSelectionStart, t3 = this._model.finalSelectionEnd; return !(!e3 || !t3 || e3[0] === t3[0] && e3[1] === t3[1]); } get selectionText() { const e3 = this._model.finalSelectionStart, t3 = this._model.finalSelectionEnd; if (!e3 || !t3) return ""; const i3 = this._bufferService.buffer, s3 = []; if (this._activeSelectionMode === 3) { if (e3[0] === t3[0]) return ""; const r2 = e3[0] < t3[0] ? e3[0] : t3[0], n2 = e3[0] < t3[0] ? t3[0] : e3[0]; for (let o2 = e3[1]; o2 <= t3[1]; o2++) { const e4 = i3.translateBufferLineToString(o2, true, r2, n2); s3.push(e4); } } else { const r2 = e3[1] === t3[1] ? t3[0] : void 0; s3.push(i3.translateBufferLineToString(e3[1], true, e3[0], r2)); for (let r3 = e3[1] + 1; r3 <= t3[1] - 1; r3++) { const e4 = i3.lines.get(r3), t4 = i3.translateBufferLineToString(r3, true); (e4 == null ? void 0 : e4.isWrapped) ? s3[s3.length - 1] += t4 : s3.push(t4); } if (e3[1] !== t3[1]) { const e4 = i3.lines.get(t3[1]), r3 = i3.translateBufferLineToString(t3[1], true, 0, t3[0]); e4 && e4.isWrapped ? s3[s3.length - 1] += r3 : s3.push(r3); } } return s3.map((e4) => e4.replace(g, " ")).join(n.isWindows ? "\r\n" : "\n"); } clearSelection() { this._model.clearSelection(), this._removeMouseDownListeners(), this.refresh(), this._onSelectionChange.fire(); } refresh(e3) { this._refreshAnimationFrame || (this._refreshAnimationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._refresh())), n.isLinux && e3 && this.selectionText.length && this._onLinuxMouseSelection.fire(this.selectionText); } _refresh() { this._refreshAnimationFrame = void 0, this._onRedrawRequest.fire({ start: this._model.finalSelectionStart, end: this._model.finalSelectionEnd, columnSelectMode: this._activeSelectionMode === 3 }); } _isClickInSelection(e3) { const t3 = this._getMouseBufferCoords(e3), i3 = this._model.finalSelectionStart, s3 = this._model.finalSelectionEnd; return !!(i3 && s3 && t3) && this._areCoordsInSelection(t3, i3, s3); } isCellInSelection(e3, t3) { const i3 = this._model.finalSelectionStart, s3 = this._model.finalSelectionEnd; return !(!i3 || !s3) && this._areCoordsInSelection([e3, t3], i3, s3); } _areCoordsInSelection(e3, t3, i3) { return e3[1] > t3[1] && e3[1] < i3[1] || t3[1] === i3[1] && e3[1] === t3[1] && e3[0] >= t3[0] && e3[0] < i3[0] || t3[1] < i3[1] && e3[1] === i3[1] && e3[0] < i3[0] || t3[1] < i3[1] && e3[1] === t3[1] && e3[0] >= t3[0]; } _selectWordAtCursor(e3, t3) { var i3, s3; const r2 = (s3 = (i3 = this._linkifier.currentLink) === null || i3 === void 0 ? void 0 : i3.link) === null || s3 === void 0 ? void 0 : s3.range; if (r2) return this._model.selectionStart = [r2.start.x - 1, r2.start.y - 1], this._model.selectionStartLength = (0, f.getRangeLength)(r2, this._bufferService.cols), this._model.selectionEnd = void 0, true; const n2 = this._getMouseBufferCoords(e3); return !!n2 && (this._selectWordAt(n2, t3), this._model.selectionEnd = void 0, true); } selectAll() { this._model.isSelectAllActive = true, this.refresh(), this._onSelectionChange.fire(); } selectLines(e3, t3) { this._model.clearSelection(), e3 = Math.max(e3, 0), t3 = Math.min(t3, this._bufferService.buffer.lines.length - 1), this._model.selectionStart = [0, e3], this._model.selectionEnd = [this._bufferService.cols, t3], this.refresh(), this._onSelectionChange.fire(); } _onTrim(e3) { this._model.onTrim(e3) && this.refresh(); } _getMouseBufferCoords(e3) { const t3 = this._mouseService.getCoords(e3, this._screenElement, this._bufferService.cols, this._bufferService.rows, true); if (t3) return t3[0]--, t3[1]--, t3[1] += this._bufferService.buffer.ydisp, t3; } _getMouseEventScrollAmount(e3) { let t3 = (0, d.getCoordsRelativeToElement)(this._coreBrowserService.window, e3, this._screenElement)[1]; const i3 = this._renderService.dimensions.canvasHeight; return t3 >= 0 && t3 <= i3 ? 0 : (t3 > i3 && (t3 -= i3), t3 = Math.min(Math.max(t3, -50), 50), t3 /= 50, t3 / Math.abs(t3) + Math.round(14 * t3)); } shouldForceSelection(e3) { return n.isMac ? e3.altKey && this._optionsService.rawOptions.macOptionClickForcesSelection : e3.shiftKey; } onMouseDown(e3) { if (this._mouseDownTimeStamp = e3.timeStamp, (e3.button !== 2 || !this.hasSelection) && e3.button === 0) { if (!this._enabled) { if (!this.shouldForceSelection(e3)) return; e3.stopPropagation(); } e3.preventDefault(), this._dragScrollAmount = 0, this._enabled && e3.shiftKey ? this._onIncrementalClick(e3) : e3.detail === 1 ? this._onSingleClick(e3) : e3.detail === 2 ? this._onDoubleClick(e3) : e3.detail === 3 && this._onTripleClick(e3), this._addMouseDownListeners(), this.refresh(true); } } _addMouseDownListeners() { this._screenElement.ownerDocument && (this._screenElement.ownerDocument.addEventListener("mousemove", this._mouseMoveListener), this._screenElement.ownerDocument.addEventListener("mouseup", this._mouseUpListener)), this._dragScrollIntervalTimer = this._coreBrowserService.window.setInterval(() => this._dragScroll(), 50); } _removeMouseDownListeners() { this._screenElement.ownerDocument && (this._screenElement.ownerDocument.removeEventListener("mousemove", this._mouseMoveListener), this._screenElement.ownerDocument.removeEventListener("mouseup", this._mouseUpListener)), this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer), this._dragScrollIntervalTimer = void 0; } _onIncrementalClick(e3) { this._model.selectionStart && (this._model.selectionEnd = this._getMouseBufferCoords(e3)); } _onSingleClick(e3) { if (this._model.selectionStartLength = 0, this._model.isSelectAllActive = false, this._activeSelectionMode = this.shouldColumnSelect(e3) ? 3 : 0, this._model.selectionStart = this._getMouseBufferCoords(e3), !this._model.selectionStart) return; this._model.selectionEnd = void 0; const t3 = this._bufferService.buffer.lines.get(this._model.selectionStart[1]); t3 && t3.length !== this._model.selectionStart[0] && t3.hasWidth(this._model.selectionStart[0]) === 0 && this._model.selectionStart[0]++; } _onDoubleClick(e3) { this._selectWordAtCursor(e3, true) && (this._activeSelectionMode = 1); } _onTripleClick(e3) { const t3 = this._getMouseBufferCoords(e3); t3 && (this._activeSelectionMode = 2, this._selectLineAt(t3[1])); } shouldColumnSelect(e3) { return e3.altKey && !(n.isMac && this._optionsService.rawOptions.macOptionClickForcesSelection); } _onMouseMove(e3) { if (e3.stopImmediatePropagation(), !this._model.selectionStart) return; const t3 = this._model.selectionEnd ? [this._model.selectionEnd[0], this._model.selectionEnd[1]] : null; if (this._model.selectionEnd = this._getMouseBufferCoords(e3), !this._model.selectionEnd) return void this.refresh(true); this._activeSelectionMode === 2 ? this._model.selectionEnd[1] < this._model.selectionStart[1] ? this._model.selectionEnd[0] = 0 : this._model.selectionEnd[0] = this._bufferService.cols : this._activeSelectionMode === 1 && this._selectToWordAt(this._model.selectionEnd), this._dragScrollAmount = this._getMouseEventScrollAmount(e3), this._activeSelectionMode !== 3 && (this._dragScrollAmount > 0 ? this._model.selectionEnd[0] = this._bufferService.cols : this._dragScrollAmount < 0 && (this._model.selectionEnd[0] = 0)); const i3 = this._bufferService.buffer; if (this._model.selectionEnd[1] < i3.lines.length) { const e4 = i3.lines.get(this._model.selectionEnd[1]); e4 && e4.hasWidth(this._model.selectionEnd[0]) === 0 && this._model.selectionEnd[0]++; } t3 && t3[0] === this._model.selectionEnd[0] && t3[1] === this._model.selectionEnd[1] || this.refresh(true); } _dragScroll() { if (this._model.selectionEnd && this._model.selectionStart && this._dragScrollAmount) { this._onRequestScrollLines.fire({ amount: this._dragScrollAmount, suppressScrollEvent: false }); const e3 = this._bufferService.buffer; this._dragScrollAmount > 0 ? (this._activeSelectionMode !== 3 && (this._model.selectionEnd[0] = this._bufferService.cols), this._model.selectionEnd[1] = Math.min(e3.ydisp + this._bufferService.rows, e3.lines.length - 1)) : (this._activeSelectionMode !== 3 && (this._model.selectionEnd[0] = 0), this._model.selectionEnd[1] = e3.ydisp), this.refresh(); } } _onMouseUp(e3) { const t3 = e3.timeStamp - this._mouseDownTimeStamp; if (this._removeMouseDownListeners(), this.selectionText.length <= 1 && t3 < 500 && e3.altKey && this._optionsService.rawOptions.altClickMovesCursor) { if (this._bufferService.buffer.ybase === this._bufferService.buffer.ydisp) { const t4 = this._mouseService.getCoords(e3, this._element, this._bufferService.cols, this._bufferService.rows, false); if (t4 && t4[0] !== void 0 && t4[1] !== void 0) { const e4 = (0, _.moveToCellSequence)(t4[0] - 1, t4[1] - 1, this._bufferService, this._coreService.decPrivateModes.applicationCursorKeys); this._coreService.triggerDataEvent(e4, true); } } } else this._fireEventIfSelectionChanged(); } _fireEventIfSelectionChanged() { const e3 = this._model.finalSelectionStart, t3 = this._model.finalSelectionEnd, i3 = !(!e3 || !t3 || e3[0] === t3[0] && e3[1] === t3[1]); i3 ? e3 && t3 && (this._oldSelectionStart && this._oldSelectionEnd && e3[0] === this._oldSelectionStart[0] && e3[1] === this._oldSelectionStart[1] && t3[0] === this._oldSelectionEnd[0] && t3[1] === this._oldSelectionEnd[1] || this._fireOnSelectionChange(e3, t3, i3)) : this._oldHasSelection && this._fireOnSelectionChange(e3, t3, i3); } _fireOnSelectionChange(e3, t3, i3) { this._oldSelectionStart = e3, this._oldSelectionEnd = t3, this._oldHasSelection = i3, this._onSelectionChange.fire(); } _onBufferActivate(e3) { this.clearSelection(), this._trimListener.dispose(), this._trimListener = e3.activeBuffer.lines.onTrim((e4) => this._onTrim(e4)); } _convertViewportColToCharacterIndex(e3, t3) { let i3 = t3[0]; for (let s3 = 0; t3[0] >= s3; s3++) { const r2 = e3.loadCell(s3, this._workCell).getChars().length; this._workCell.getWidth() === 0 ? i3-- : r2 > 1 && t3[0] !== s3 && (i3 += r2 - 1); } return i3; } setSelection(e3, t3, i3) { this._model.clearSelection(), this._removeMouseDownListeners(), this._model.selectionStart = [e3, t3], this._model.selectionStartLength = i3, this.refresh(), this._fireEventIfSelectionChanged(); } rightClickSelect(e3) { this._isClickInSelection(e3) || (this._selectWordAtCursor(e3, false) && this.refresh(true), this._fireEventIfSelectionChanged()); } _getWordAt(e3, t3, i3 = true, s3 = true) { if (e3[0] >= this._bufferService.cols) return; const r2 = this._bufferService.buffer, n2 = r2.lines.get(e3[1]); if (!n2) return; const o2 = r2.translateBufferLineToString(e3[1], false); let a2 = this._convertViewportColToCharacterIndex(n2, e3), h2 = a2; const c2 = e3[0] - a2; let l2 = 0, d2 = 0, _2 = 0, u2 = 0; if (o2.charAt(a2) === " ") { for (; a2 > 0 && o2.charAt(a2 - 1) === " "; ) a2--; for (; h2 < o2.length && o2.charAt(h2 + 1) === " "; ) h2++; } else { let t4 = e3[0], i4 = e3[0]; n2.getWidth(t4) === 0 && (l2++, t4--), n2.getWidth(i4) === 2 && (d2++, i4++); const s4 = n2.getString(i4).length; for (s4 > 1 && (u2 += s4 - 1, h2 += s4 - 1); t4 > 0 && a2 > 0 && !this._isCharWordSeparator(n2.loadCell(t4 - 1, this._workCell)); ) { n2.loadCell(t4 - 1, this._workCell); const e4 = this._workCell.getChars().length; this._workCell.getWidth() === 0 ? (l2++, t4--) : e4 > 1 && (_2 += e4 - 1, a2 -= e4 - 1), a2--, t4--; } for (; i4 < n2.length && h2 + 1 < o2.length && !this._isCharWordSeparator(n2.loadCell(i4 + 1, this._workCell)); ) { n2.loadCell(i4 + 1, this._workCell); const e4 = this._workCell.getChars().length; this._workCell.getWidth() === 2 ? (d2++, i4++) : e4 > 1 && (u2 += e4 - 1, h2 += e4 - 1), h2++, i4++; } } h2++; let f2 = a2 + c2 - l2 + _2, v2 = Math.min(this._bufferService.cols, h2 - a2 + l2 + d2 - _2 - u2); if (t3 || o2.slice(a2, h2).trim() !== "") { if (i3 && f2 === 0 && n2.getCodePoint(0) !== 32) { const t4 = r2.lines.get(e3[1] - 1); if (t4 && n2.isWrapped && t4.getCodePoint(this._bufferService.cols - 1) !== 32) { const t5 = this._getWordAt([this._bufferService.cols - 1, e3[1] - 1], false, true, false); if (t5) { const e4 = this._bufferService.cols - t5.start; f2 -= e4, v2 += e4; } } } if (s3 && f2 + v2 === this._bufferService.cols && n2.getCodePoint(this._bufferService.cols - 1) !== 32) { const t4 = r2.lines.get(e3[1] + 1); if ((t4 == null ? void 0 : t4.isWrapped) && t4.getCodePoint(0) !== 32) { const t5 = this._getWordAt([0, e3[1] + 1], false, false, true); t5 && (v2 += t5.length); } } return { start: f2, length: v2 }; } } _selectWordAt(e3, t3) { const i3 = this._getWordAt(e3, t3); if (i3) { for (; i3.start < 0; ) i3.start += this._bufferService.cols, e3[1]--; this._model.selectionStart = [i3.start, e3[1]], this._model.selectionStartLength = i3.length; } } _selectToWordAt(e3) { const t3 = this._getWordAt(e3, true); if (t3) { let i3 = e3[1]; for (; t3.start < 0; ) t3.start += this._bufferService.cols, i3--; if (!this._model.areSelectionValuesReversed()) for (; t3.start + t3.length > this._bufferService.cols; ) t3.length -= this._bufferService.cols, i3++; this._model.selectionEnd = [this._model.areSelectionValuesReversed() ? t3.start : t3.start + t3.length, i3]; } } _isCharWordSeparator(e3) { return e3.getWidth() !== 0 && this._optionsService.rawOptions.wordSeparator.indexOf(e3.getChars()) >= 0; } _selectLineAt(e3) { const t3 = this._bufferService.buffer.getWrappedRangeForLine(e3), i3 = { start: { x: 0, y: t3.first }, end: { x: this._bufferService.cols - 1, y: t3.last } }; this._model.selectionStart = [0, t3.first], this._model.selectionEnd = void 0, this._model.selectionStartLength = (0, f.getRangeLength)(i3, this._bufferService.cols); } }, "p"); p = s2([r(3, l.IBufferService), r(4, l.ICoreService), r(5, c.IMouseService), r(6, l.IOptionsService), r(7, c.IRenderService), r(8, c.ICoreBrowserService)], p), t2.SelectionService = p; }, 4725: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.ICharacterJoinerService = t2.ISelectionService = t2.IRenderService = t2.IMouseService = t2.ICoreBrowserService = t2.ICharSizeService = void 0; const s2 = i2(8343); t2.ICharSizeService = (0, s2.createDecorator)("CharSizeService"), t2.ICoreBrowserService = (0, s2.createDecorator)("CoreBrowserService"), t2.IMouseService = (0, s2.createDecorator)("MouseService"), t2.IRenderService = (0, s2.createDecorator)("RenderService"), t2.ISelectionService = (0, s2.createDecorator)("SelectionService"), t2.ICharacterJoinerService = (0, s2.createDecorator)("CharacterJoinerService"); }, 6349: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.CircularList = void 0; const s2 = i2(8460); t2.CircularList = class { constructor(e3) { this._maxLength = e3, this.onDeleteEmitter = new s2.EventEmitter(), this.onInsertEmitter = new s2.EventEmitter(), this.onTrimEmitter = new s2.EventEmitter(), this._array = new Array(this._maxLength), this._startIndex = 0, this._length = 0; } get onDelete() { return this.onDeleteEmitter.event; } get onInsert() { return this.onInsertEmitter.event; } get onTrim() { return this.onTrimEmitter.event; } get maxLength() { return this._maxLength; } set maxLength(e3) { if (this._maxLength === e3) return; const t3 = new Array(e3); for (let i3 = 0; i3 < Math.min(e3, this.length); i3++) t3[i3] = this._array[this._getCyclicIndex(i3)]; this._array = t3, this._maxLength = e3, this._startIndex = 0; } get length() { return this._length; } set length(e3) { if (e3 > this._length) for (let t3 = this._length; t3 < e3; t3++) this._array[t3] = void 0; this._length = e3; } get(e3) { return this._array[this._getCyclicIndex(e3)]; } set(e3, t3) { this._array[this._getCyclicIndex(e3)] = t3; } push(e3) { this._array[this._getCyclicIndex(this._length)] = e3, this._length === this._maxLength ? (this._startIndex = ++this._startIndex % this._maxLength, this.onTrimEmitter.fire(1)) : this._length++; } recycle() { if (this._length !== this._maxLength) throw new Error("Can only recycle when the buffer is full"); return this._startIndex = ++this._startIndex % this._maxLength, this.onTrimEmitter.fire(1), this._array[this._getCyclicIndex(this._length - 1)]; } get isFull() { return this._length === this._maxLength; } pop() { return this._array[this._getCyclicIndex(this._length-- - 1)]; } splice(e3, t3, ...i3) { if (t3) { for (let i4 = e3; i4 < this._length - t3; i4++) this._array[this._getCyclicIndex(i4)] = this._array[this._getCyclicIndex(i4 + t3)]; this._length -= t3, this.onDeleteEmitter.fire({ index: e3, amount: t3 }); } for (let t4 = this._length - 1; t4 >= e3; t4--) this._array[this._getCyclicIndex(t4 + i3.length)] = this._array[this._getCyclicIndex(t4)]; for (let t4 = 0; t4 < i3.length; t4++) this._array[this._getCyclicIndex(e3 + t4)] = i3[t4]; if (i3.length && this.onInsertEmitter.fire({ index: e3, amount: i3.length }), this._length + i3.length > this._maxLength) { const e4 = this._length + i3.length - this._maxLength; this._startIndex += e4, this._length = this._maxLength, this.onTrimEmitter.fire(e4); } else this._length += i3.length; } trimStart(e3) { e3 > this._length && (e3 = this._length), this._startIndex += e3, this._length -= e3, this.onTrimEmitter.fire(e3); } shiftElements(e3, t3, i3) { if (!(t3 <= 0)) { if (e3 < 0 || e3 >= this._length) throw new Error("start argument out of range"); if (e3 + i3 < 0) throw new Error("Cannot shift elements in list beyond index 0"); if (i3 > 0) { for (let s4 = t3 - 1; s4 >= 0; s4--) this.set(e3 + s4 + i3, this.get(e3 + s4)); const s3 = e3 + t3 + i3 - this._length; if (s3 > 0) for (this._length += s3; this._length > this._maxLength; ) this._length--, this._startIndex++, this.onTrimEmitter.fire(1); } else for (let s3 = 0; s3 < t3; s3++) this.set(e3 + s3 + i3, this.get(e3 + s3)); } } _getCyclicIndex(e3) { return (this._startIndex + e3) % this._maxLength; } }; }, 1439: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.clone = void 0, t2.clone = /* @__PURE__ */ __name(function e3(t3, i2 = 5) { if (typeof t3 != "object") return t3; const s2 = Array.isArray(t3) ? [] : {}; for (const r in t3) s2[r] = i2 <= 1 ? t3[r] : t3[r] && e3(t3[r], i2 - 1); return s2; }, "e"); }, 8055: (e2, t2) => { var i2, s2, r; function n(e3) { const t3 = e3.toString(16); return t3.length < 2 ? "0" + t3 : t3; } __name(n, "n"); function o(e3, t3) { return e3 < t3 ? (t3 + 0.05) / (e3 + 0.05) : (e3 + 0.05) / (t3 + 0.05); } __name(o, "o"); Object.defineProperty(t2, "__esModule", { value: true }), t2.contrastRatio = t2.toPaddedHex = t2.rgba = t2.rgb = t2.css = t2.color = t2.channels = void 0, function(e3) { e3.toCss = function(e4, t3, i3, s3) { return s3 !== void 0 ? `#${n(e4)}${n(t3)}${n(i3)}${n(s3)}` : `#${n(e4)}${n(t3)}${n(i3)}`; }, e3.toRgba = function(e4, t3, i3, s3 = 255) { return (e4 << 24 | t3 << 16 | i3 << 8 | s3) >>> 0; }; }(i2 = t2.channels || (t2.channels = {})), function(e3) { function t3(e4, t4) { const s3 = Math.round(255 * t4), [n2, o2, a] = r.toChannels(e4.rgba); return { css: i2.toCss(n2, o2, a, s3), rgba: i2.toRgba(n2, o2, a, s3) }; } __name(t3, "t"); e3.blend = function(e4, t4) { const s3 = (255 & t4.rgba) / 255; if (s3 === 1) return { css: t4.css, rgba: t4.rgba }; const r2 = t4.rgba >> 24 & 255, n2 = t4.rgba >> 16 & 255, o2 = t4.rgba >> 8 & 255, a = e4.rgba >> 24 & 255, h = e4.rgba >> 16 & 255, c = e4.rgba >> 8 & 255, l = a + Math.round((r2 - a) * s3), d = h + Math.round((n2 - h) * s3), _ = c + Math.round((o2 - c) * s3); return { css: i2.toCss(l, d, _), rgba: i2.toRgba(l, d, _) }; }, e3.isOpaque = function(e4) { return (255 & e4.rgba) == 255; }, e3.ensureContrastRatio = function(e4, t4, i3) { const s3 = r.ensureContrastRatio(e4.rgba, t4.rgba, i3); if (s3) return r.toColor(s3 >> 24 & 255, s3 >> 16 & 255, s3 >> 8 & 255); }, e3.opaque = function(e4) { const t4 = (255 | e4.rgba) >>> 0, [s3, n2, o2] = r.toChannels(t4); return { css: i2.toCss(s3, n2, o2), rgba: t4 }; }, e3.opacity = t3, e3.multiplyOpacity = function(e4, i3) { return t3(e4, (255 & e4.rgba) * i3 / 255); }, e3.toColorRGB = function(e4) { return [e4.rgba >> 24 & 255, e4.rgba >> 16 & 255, e4.rgba >> 8 & 255]; }; }(t2.color || (t2.color = {})), (t2.css || (t2.css = {})).toColor = function(e3) { if (e3.match(/#[0-9a-f]{3,8}/i)) switch (e3.length) { case 4: { const t4 = parseInt(e3.slice(1, 2).repeat(2), 16), i3 = parseInt(e3.slice(2, 3).repeat(2), 16), s3 = parseInt(e3.slice(3, 4).repeat(2), 16); return r.toColor(t4, i3, s3); } case 5: { const t4 = parseInt(e3.slice(1, 2).repeat(2), 16), i3 = parseInt(e3.slice(2, 3).repeat(2), 16), s3 = parseInt(e3.slice(3, 4).repeat(2), 16), n2 = parseInt(e3.slice(4, 5).repeat(2), 16); return r.toColor(t4, i3, s3, n2); } case 7: return { css: e3, rgba: (parseInt(e3.slice(1), 16) << 8 | 255) >>> 0 }; case 9: return { css: e3, rgba: parseInt(e3.slice(1), 16) >>> 0 }; } const t3 = e3.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/); if (t3) { const e4 = parseInt(t3[1]), i3 = parseInt(t3[2]), s3 = parseInt(t3[3]), n2 = Math.round(255 * (t3[5] === void 0 ? 1 : parseFloat(t3[5]))); return r.toColor(e4, i3, s3, n2); } throw new Error("css.toColor: Unsupported css format"); }, function(e3) { function t3(e4, t4, i3) { const s3 = e4 / 255, r2 = t4 / 255, n2 = i3 / 255; return 0.2126 * (s3 <= 0.03928 ? s3 / 12.92 : Math.pow((s3 + 0.055) / 1.055, 2.4)) + 0.7152 * (r2 <= 0.03928 ? r2 / 12.92 : Math.pow((r2 + 0.055) / 1.055, 2.4)) + 0.0722 * (n2 <= 0.03928 ? n2 / 12.92 : Math.pow((n2 + 0.055) / 1.055, 2.4)); } __name(t3, "t"); e3.relativeLuminance = function(e4) { return t3(e4 >> 16 & 255, e4 >> 8 & 255, 255 & e4); }, e3.relativeLuminance2 = t3; }(s2 = t2.rgb || (t2.rgb = {})), function(e3) { function t3(e4, t4, i3) { const r3 = e4 >> 24 & 255, n2 = e4 >> 16 & 255, a = e4 >> 8 & 255; let h = t4 >> 24 & 255, c = t4 >> 16 & 255, l = t4 >> 8 & 255, d = o(s2.relativeLuminance2(h, c, l), s2.relativeLuminance2(r3, n2, a)); for (; d < i3 && (h > 0 || c > 0 || l > 0); ) h -= Math.max(0, Math.ceil(0.1 * h)), c -= Math.max(0, Math.ceil(0.1 * c)), l -= Math.max(0, Math.ceil(0.1 * l)), d = o(s2.relativeLuminance2(h, c, l), s2.relativeLuminance2(r3, n2, a)); return (h << 24 | c << 16 | l << 8 | 255) >>> 0; } __name(t3, "t"); function r2(e4, t4, i3) { const r3 = e4 >> 24 & 255, n2 = e4 >> 16 & 255, a = e4 >> 8 & 255; let h = t4 >> 24 & 255, c = t4 >> 16 & 255, l = t4 >> 8 & 255, d = o(s2.relativeLuminance2(h, c, l), s2.relativeLuminance2(r3, n2, a)); for (; d < i3 && (h < 255 || c < 255 || l < 255); ) h = Math.min(255, h + Math.ceil(0.1 * (255 - h))), c = Math.min(255, c + Math.ceil(0.1 * (255 - c))), l = Math.min(255, l + Math.ceil(0.1 * (255 - l))), d = o(s2.relativeLuminance2(h, c, l), s2.relativeLuminance2(r3, n2, a)); return (h << 24 | c << 16 | l << 8 | 255) >>> 0; } __name(r2, "r"); e3.ensureContrastRatio = function(e4, i3, n2) { const a = s2.relativeLuminance(e4 >> 8), h = s2.relativeLuminance(i3 >> 8); if (o(a, h) < n2) { if (h < a) { const h2 = t3(e4, i3, n2), c2 = o(a, s2.relativeLuminance(h2 >> 8)); if (c2 < n2) { const t4 = r2(e4, i3, n2); return c2 > o(a, s2.relativeLuminance(t4 >> 8)) ? h2 : t4; } return h2; } const c = r2(e4, i3, n2), l = o(a, s2.relativeLuminance(c >> 8)); if (l < n2) { const r3 = t3(e4, i3, n2); return l > o(a, s2.relativeLuminance(r3 >> 8)) ? c : r3; } return c; } }, e3.reduceLuminance = t3, e3.increaseLuminance = r2, e3.toChannels = function(e4) { return [e4 >> 24 & 255, e4 >> 16 & 255, e4 >> 8 & 255, 255 & e4]; }, e3.toColor = function(e4, t4, s3, r3) { return { css: i2.toCss(e4, t4, s3, r3), rgba: i2.toRgba(e4, t4, s3, r3) }; }; }(r = t2.rgba || (t2.rgba = {})), t2.toPaddedHex = n, t2.contrastRatio = o; }, 8969: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.CoreTerminal = void 0; const s2 = i2(844), r = i2(2585), n = i2(4348), o = i2(7866), a = i2(744), h = i2(7302), c = i2(6975), l = i2(8460), d = i2(1753), _ = i2(3730), u = i2(1480), f = i2(7994), v = i2(9282), g = i2(5435), p = i2(5981), S = i2(2660); let m = false; class C extends s2.Disposable { constructor(e3) { super(), this._onBinary = new l.EventEmitter(), this._onData = new l.EventEmitter(), this._onLineFeed = new l.EventEmitter(), this._onResize = new l.EventEmitter(), this._onScroll = new l.EventEmitter(), this._onWriteParsed = new l.EventEmitter(), this._instantiationService = new n.InstantiationService(), this.optionsService = new h.OptionsService(e3), this._instantiationService.setService(r.IOptionsService, this.optionsService), this._bufferService = this.register(this._instantiationService.createInstance(a.BufferService)), this._instantiationService.setService(r.IBufferService, this._bufferService), this._logService = this._instantiationService.createInstance(o.LogService), this._instantiationService.setService(r.ILogService, this._logService), this.coreService = this.register(this._instantiationService.createInstance(c.CoreService, () => this.scrollToBottom())), this._instantiationService.setService(r.ICoreService, this.coreService), this.coreMouseService = this._instantiationService.createInstance(d.CoreMouseService), this._instantiationService.setService(r.ICoreMouseService, this.coreMouseService), this._dirtyRowService = this._instantiationService.createInstance(_.DirtyRowService), this._instantiationService.setService(r.IDirtyRowService, this._dirtyRowService), this.unicodeService = this._instantiationService.createInstance(u.UnicodeService), this._instantiationService.setService(r.IUnicodeService, this.unicodeService), this._charsetService = this._instantiationService.createInstance(f.CharsetService), this._instantiationService.setService(r.ICharsetService, this._charsetService), this._oscLinkService = this._instantiationService.createInstance(S.OscLinkService), this._instantiationService.setService(r.IOscLinkService, this._oscLinkService), this._inputHandler = new g.InputHandler(this._bufferService, this._charsetService, this.coreService, this._dirtyRowService, this._logService, this.optionsService, this._oscLinkService, this.coreMouseService, this.unicodeService), this.register((0, l.forwardEvent)(this._inputHandler.onLineFeed, this._onLineFeed)), this.register(this._inputHandler), this.register((0, l.forwardEvent)(this._bufferService.onResize, this._onResize)), this.register((0, l.forwardEvent)(this.coreService.onData, this._onData)), this.register((0, l.forwardEvent)(this.coreService.onBinary, this._onBinary)), this.register(this.optionsService.onOptionChange((e4) => this._updateOptions(e4))), this.register(this._bufferService.onScroll((e4) => { this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: 0 }), this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom); })), this.register(this._inputHandler.onScroll((e4) => { this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: 0 }), this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom); })), this._writeBuffer = new p.WriteBuffer((e4, t3) => this._inputHandler.parse(e4, t3)), this.register((0, l.forwardEvent)(this._writeBuffer.onWriteParsed, this._onWriteParsed)); } get onBinary() { return this._onBinary.event; } get onData() { return this._onData.event; } get onLineFeed() { return this._onLineFeed.event; } get onResize() { return this._onResize.event; } get onWriteParsed() { return this._onWriteParsed.event; } get onScroll() { return this._onScrollApi || (this._onScrollApi = new l.EventEmitter(), this.register(this._onScroll.event((e3) => { var t3; (t3 = this._onScrollApi) === null || t3 === void 0 || t3.fire(e3.position); }))), this._onScrollApi.event; } get cols() { return this._bufferService.cols; } get rows() { return this._bufferService.rows; } get buffers() { return this._bufferService.buffers; } get options() { return this.optionsService.options; } set options(e3) { for (const t3 in e3) this.optionsService.options[t3] = e3[t3]; } dispose() { var e3; this._isDisposed || (super.dispose(), (e3 = this._windowsMode) === null || e3 === void 0 || e3.dispose(), this._windowsMode = void 0); } write(e3, t3) { this._writeBuffer.write(e3, t3); } writeSync(e3, t3) { this._logService.logLevel <= r.LogLevelEnum.WARN && !m && (this._logService.warn("writeSync is unreliable and will be removed soon."), m = true), this._writeBuffer.writeSync(e3, t3); } resize(e3, t3) { isNaN(e3) || isNaN(t3) || (e3 = Math.max(e3, a.MINIMUM_COLS), t3 = Math.max(t3, a.MINIMUM_ROWS), this._bufferService.resize(e3, t3)); } scroll(e3, t3 = false) { this._bufferService.scroll(e3, t3); } scrollLines(e3, t3, i3) { this._bufferService.scrollLines(e3, t3, i3); } scrollPages(e3) { this._bufferService.scrollPages(e3); } scrollToTop() { this._bufferService.scrollToTop(); } scrollToBottom() { this._bufferService.scrollToBottom(); } scrollToLine(e3) { this._bufferService.scrollToLine(e3); } registerEscHandler(e3, t3) { return this._inputHandler.registerEscHandler(e3, t3); } registerDcsHandler(e3, t3) { return this._inputHandler.registerDcsHandler(e3, t3); } registerCsiHandler(e3, t3) { return this._inputHandler.registerCsiHandler(e3, t3); } registerOscHandler(e3, t3) { return this._inputHandler.registerOscHandler(e3, t3); } _setup() { this.optionsService.rawOptions.windowsMode && this._enableWindowsMode(); } reset() { this._inputHandler.reset(), this._bufferService.reset(), this._charsetService.reset(), this.coreService.reset(), this.coreMouseService.reset(); } _updateOptions(e3) { var t3; switch (e3) { case "scrollback": this.buffers.resize(this.cols, this.rows); break; case "windowsMode": this.optionsService.rawOptions.windowsMode ? this._enableWindowsMode() : ((t3 = this._windowsMode) === null || t3 === void 0 || t3.dispose(), this._windowsMode = void 0); } } _enableWindowsMode() { if (!this._windowsMode) { const e3 = []; e3.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null, this._bufferService))), e3.push(this.registerCsiHandler({ final: "H" }, () => ((0, v.updateWindowsModeWrappedState)(this._bufferService), false))), this._windowsMode = { dispose: () => { for (const t3 of e3) t3.dispose(); } }; } } } __name(C, "C"); t2.CoreTerminal = C; }, 8460: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.forwardEvent = t2.EventEmitter = void 0, t2.EventEmitter = class { constructor() { this._listeners = [], this._disposed = false; } get event() { return this._event || (this._event = (e3) => (this._listeners.push(e3), { dispose: () => { if (!this._disposed) { for (let t3 = 0; t3 < this._listeners.length; t3++) if (this._listeners[t3] === e3) return void this._listeners.splice(t3, 1); } } })), this._event; } fire(e3, t3) { const i2 = []; for (let e4 = 0; e4 < this._listeners.length; e4++) i2.push(this._listeners[e4]); for (let s2 = 0; s2 < i2.length; s2++) i2[s2].call(void 0, e3, t3); } dispose() { this._listeners && (this._listeners.length = 0), this._disposed = true; } }, t2.forwardEvent = function(e3, t3) { return e3((e4) => t3.fire(e4)); }; }, 5435: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.InputHandler = t2.WindowsOptionsReportType = void 0; const s2 = i2(2584), r = i2(7116), n = i2(2015), o = i2(844), a = i2(482), h = i2(8437), c = i2(8460), l = i2(643), d = i2(511), _ = i2(3734), u = i2(2585), f = i2(6242), v = i2(6351), g = i2(5941), p = { "(": 0, ")": 1, "*": 2, "+": 3, "-": 1, ".": 2 }, S = 131072; function m(e3, t3) { if (e3 > 24) return t3.setWinLines || false; switch (e3) { case 1: return !!t3.restoreWin; case 2: return !!t3.minimizeWin; case 3: return !!t3.setWinPosition; case 4: return !!t3.setWinSizePixels; case 5: return !!t3.raiseWin; case 6: return !!t3.lowerWin; case 7: return !!t3.refreshWin; case 8: return !!t3.setWinSizeChars; case 9: return !!t3.maximizeWin; case 10: return !!t3.fullscreenWin; case 11: return !!t3.getWinState; case 13: return !!t3.getWinPosition; case 14: return !!t3.getWinSizePixels; case 15: return !!t3.getScreenSizePixels; case 16: return !!t3.getCellSizePixels; case 18: return !!t3.getWinSizeChars; case 19: return !!t3.getScreenSizeChars; case 20: return !!t3.getIconTitle; case 21: return !!t3.getWinTitle; case 22: return !!t3.pushTitle; case 23: return !!t3.popTitle; case 24: return !!t3.setWinLines; } return false; } __name(m, "m"); var C; !function(e3) { e3[e3.GET_WIN_SIZE_PIXELS = 0] = "GET_WIN_SIZE_PIXELS", e3[e3.GET_CELL_SIZE_PIXELS = 1] = "GET_CELL_SIZE_PIXELS"; }(C = t2.WindowsOptionsReportType || (t2.WindowsOptionsReportType = {})); class b extends o.Disposable { constructor(e3, t3, i3, o2, l2, _2, u2, g2, p2, S2 = new n.EscapeSequenceParser()) { super(), this._bufferService = e3, this._charsetService = t3, this._coreService = i3, this._dirtyRowService = o2, this._logService = l2, this._optionsService = _2, this._oscLinkService = u2, this._coreMouseService = g2, this._unicodeService = p2, this._parser = S2, this._parseBuffer = new Uint32Array(4096), this._stringDecoder = new a.StringToUtf32(), this._utf8Decoder = new a.Utf8ToUtf32(), this._workCell = new d.CellData(), this._windowTitle = "", this._iconName = "", this._windowTitleStack = [], this._iconNameStack = [], this._curAttrData = h.DEFAULT_ATTR_DATA.clone(), this._eraseAttrDataInternal = h.DEFAULT_ATTR_DATA.clone(), this._onRequestBell = new c.EventEmitter(), this._onRequestRefreshRows = new c.EventEmitter(), this._onRequestReset = new c.EventEmitter(), this._onRequestSendFocus = new c.EventEmitter(), this._onRequestSyncScrollBar = new c.EventEmitter(), this._onRequestWindowsOptionsReport = new c.EventEmitter(), this._onA11yChar = new c.EventEmitter(), this._onA11yTab = new c.EventEmitter(), this._onCursorMove = new c.EventEmitter(), this._onLineFeed = new c.EventEmitter(), this._onScroll = new c.EventEmitter(), this._onTitleChange = new c.EventEmitter(), this._onColor = new c.EventEmitter(), this._parseStack = { paused: false, cursorStartX: 0, cursorStartY: 0, decodedLength: 0, position: 0 }, this._specialColors = [256, 257, 258], this.register(this._parser), this._activeBuffer = this._bufferService.buffer, this.register(this._bufferService.buffers.onBufferActivate((e4) => this._activeBuffer = e4.activeBuffer)), this._parser.setCsiHandlerFallback((e4, t4) => { this._logService.debug("Unknown CSI code: ", { identifier: this._parser.identToString(e4), params: t4.toArray() }); }), this._parser.setEscHandlerFallback((e4) => { this._logService.debug("Unknown ESC code: ", { identifier: this._parser.identToString(e4) }); }), this._parser.setExecuteHandlerFallback((e4) => { this._logService.debug("Unknown EXECUTE code: ", { code: e4 }); }), this._parser.setOscHandlerFallback((e4, t4, i4) => { this._logService.debug("Unknown OSC code: ", { identifier: e4, action: t4, data: i4 }); }), this._parser.setDcsHandlerFallback((e4, t4, i4) => { t4 === "HOOK" && (i4 = i4.toArray()), this._logService.debug("Unknown DCS code: ", { identifier: this._parser.identToString(e4), action: t4, payload: i4 }); }), this._parser.setPrintHandler((e4, t4, i4) => this.print(e4, t4, i4)), this._parser.registerCsiHandler({ final: "@" }, (e4) => this.insertChars(e4)), this._parser.registerCsiHandler({ intermediates: " ", final: "@" }, (e4) => this.scrollLeft(e4)), this._parser.registerCsiHandler({ final: "A" }, (e4) => this.cursorUp(e4)), this._parser.registerCsiHandler({ intermediates: " ", final: "A" }, (e4) => this.scrollRight(e4)), this._parser.registerCsiHandler({ final: "B" }, (e4) => this.cursorDown(e4)), this._parser.registerCsiHandler({ final: "C" }, (e4) => this.cursorForward(e4)), this._parser.registerCsiHandler({ final: "D" }, (e4) => this.cursorBackward(e4)), this._parser.registerCsiHandler({ final: "E" }, (e4) => this.cursorNextLine(e4)), this._parser.registerCsiHandler({ final: "F" }, (e4) => this.cursorPrecedingLine(e4)), this._parser.registerCsiHandler({ final: "G" }, (e4) => this.cursorCharAbsolute(e4)), this._parser.registerCsiHandler({ final: "H" }, (e4) => this.cursorPosition(e4)), this._parser.registerCsiHandler({ final: "I" }, (e4) => this.cursorForwardTab(e4)), this._parser.registerCsiHandler({ final: "J" }, (e4) => this.eraseInDisplay(e4, false)), this._parser.registerCsiHandler({ prefix: "?", final: "J" }, (e4) => this.eraseInDisplay(e4, true)), this._parser.registerCsiHandler({ final: "K" }, (e4) => this.eraseInLine(e4, false)), this._parser.registerCsiHandler({ prefix: "?", final: "K" }, (e4) => this.eraseInLine(e4, true)), this._parser.registerCsiHandler({ final: "L" }, (e4) => this.insertLines(e4)), this._parser.registerCsiHandler({ final: "M" }, (e4) => this.deleteLines(e4)), this._parser.registerCsiHandler({ final: "P" }, (e4) => this.deleteChars(e4)), this._parser.registerCsiHandler({ final: "S" }, (e4) => this.scrollUp(e4)), this._parser.registerCsiHandler({ final: "T" }, (e4) => this.scrollDown(e4)), this._parser.registerCsiHandler({ final: "X" }, (e4) => this.eraseChars(e4)), this._parser.registerCsiHandler({ final: "Z" }, (e4) => this.cursorBackwardTab(e4)), this._parser.registerCsiHandler({ final: "`" }, (e4) => this.charPosAbsolute(e4)), this._parser.registerCsiHandler({ final: "a" }, (e4) => this.hPositionRelative(e4)), this._parser.registerCsiHandler({ final: "b" }, (e4) => this.repeatPrecedingCharacter(e4)), this._parser.registerCsiHandler({ final: "c" }, (e4) => this.sendDeviceAttributesPrimary(e4)), this._parser.registerCsiHandler({ prefix: ">", final: "c" }, (e4) => this.sendDeviceAttributesSecondary(e4)), this._parser.registerCsiHandler({ final: "d" }, (e4) => this.linePosAbsolute(e4)), this._parser.registerCsiHandler({ final: "e" }, (e4) => this.vPositionRelative(e4)), this._parser.registerCsiHandler({ final: "f" }, (e4) => this.hVPosition(e4)), this._parser.registerCsiHandler({ final: "g" }, (e4) => this.tabClear(e4)), this._parser.registerCsiHandler({ final: "h" }, (e4) => this.setMode(e4)), this._parser.registerCsiHandler({ prefix: "?", final: "h" }, (e4) => this.setModePrivate(e4)), this._parser.registerCsiHandler({ final: "l" }, (e4) => this.resetMode(e4)), this._parser.registerCsiHandler({ prefix: "?", final: "l" }, (e4) => this.resetModePrivate(e4)), this._parser.registerCsiHandler({ final: "m" }, (e4) => this.charAttributes(e4)), this._parser.registerCsiHandler({ final: "n" }, (e4) => this.deviceStatus(e4)), this._parser.registerCsiHandler({ prefix: "?", final: "n" }, (e4) => this.deviceStatusPrivate(e4)), this._parser.registerCsiHandler({ intermediates: "!", final: "p" }, (e4) => this.softReset(e4)), this._parser.registerCsiHandler({ intermediates: " ", final: "q" }, (e4) => this.setCursorStyle(e4)), this._parser.registerCsiHandler({ final: "r" }, (e4) => this.setScrollRegion(e4)), this._parser.registerCsiHandler({ final: "s" }, (e4) => this.saveCursor(e4)), this._parser.registerCsiHandler({ final: "t" }, (e4) => this.windowOptions(e4)), this._parser.registerCsiHandler({ final: "u" }, (e4) => this.restoreCursor(e4)), this._parser.registerCsiHandler({ intermediates: "'", final: "}" }, (e4) => this.insertColumns(e4)), this._parser.registerCsiHandler({ intermediates: "'", final: "~" }, (e4) => this.deleteColumns(e4)), this._parser.registerCsiHandler({ intermediates: '"', final: "q" }, (e4) => this.selectProtected(e4)), this._parser.registerCsiHandler({ intermediates: "$", final: "p" }, (e4) => this.requestMode(e4, true)), this._parser.registerCsiHandler({ prefix: "?", intermediates: "$", final: "p" }, (e4) => this.requestMode(e4, false)), this._parser.setExecuteHandler(s2.C0.BEL, () => this.bell()), this._parser.setExecuteHandler(s2.C0.LF, () => this.lineFeed()), this._parser.setExecuteHandler(s2.C0.VT, () => this.lineFeed()), this._parser.setExecuteHandler(s2.C0.FF, () => this.lineFeed()), this._parser.setExecuteHandler(s2.C0.CR, () => this.carriageReturn()), this._parser.setExecuteHandler(s2.C0.BS, () => this.backspace()), this._parser.setExecuteHandler(s2.C0.HT, () => this.tab()), this._parser.setExecuteHandler(s2.C0.SO, () => this.shiftOut()), this._parser.setExecuteHandler(s2.C0.SI, () => this.shiftIn()), this._parser.setExecuteHandler(s2.C1.IND, () => this.index()), this._parser.setExecuteHandler(s2.C1.NEL, () => this.nextLine()), this._parser.setExecuteHandler(s2.C1.HTS, () => this.tabSet()), this._parser.registerOscHandler(0, new f.OscHandler((e4) => (this.setTitle(e4), this.setIconName(e4), true))), this._parser.registerOscHandler(1, new f.OscHandler((e4) => this.setIconName(e4))), this._parser.registerOscHandler(2, new f.OscHandler((e4) => this.setTitle(e4))), this._parser.registerOscHandler(4, new f.OscHandler((e4) => this.setOrReportIndexedColor(e4))), this._parser.registerOscHandler(8, new f.OscHandler((e4) => this.setHyperlink(e4))), this._parser.registerOscHandler(10, new f.OscHandler((e4) => this.setOrReportFgColor(e4))), this._parser.registerOscHandler(11, new f.OscHandler((e4) => this.setOrReportBgColor(e4))), this._parser.registerOscHandler(12, new f.OscHandler((e4) => this.setOrReportCursorColor(e4))), this._parser.registerOscHandler(104, new f.OscHandler((e4) => this.restoreIndexedColor(e4))), this._parser.registerOscHandler(110, new f.OscHandler((e4) => this.restoreFgColor(e4))), this._parser.registerOscHandler(111, new f.OscHandler((e4) => this.restoreBgColor(e4))), this._parser.registerOscHandler(112, new f.OscHandler((e4) => this.restoreCursorColor(e4))), this._parser.registerEscHandler({ final: "7" }, () => this.saveCursor()), this._parser.registerEscHandler({ final: "8" }, () => this.restoreCursor()), this._parser.registerEscHandler({ final: "D" }, () => this.index()), this._parser.registerEscHandler({ final: "E" }, () => this.nextLine()), this._parser.registerEscHandler({ final: "H" }, () => this.tabSet()), this._parser.registerEscHandler({ final: "M" }, () => this.reverseIndex()), this._parser.registerEscHandler({ final: "=" }, () => this.keypadApplicationMode()), this._parser.registerEscHandler({ final: ">" }, () => this.keypadNumericMode()), this._parser.registerEscHandler({ final: "c" }, () => this.fullReset()), this._parser.registerEscHandler({ final: "n" }, () => this.setgLevel(2)), this._parser.registerEscHandler({ final: "o" }, () => this.setgLevel(3)), this._parser.registerEscHandler({ final: "|" }, () => this.setgLevel(3)), this._parser.registerEscHandler({ final: "}" }, () => this.setgLevel(2)), this._parser.registerEscHandler({ final: "~" }, () => this.setgLevel(1)), this._parser.registerEscHandler({ intermediates: "%", final: "@" }, () => this.selectDefaultCharset()), this._parser.registerEscHandler({ intermediates: "%", final: "G" }, () => this.selectDefaultCharset()); for (const e4 in r.CHARSETS) this._parser.registerEscHandler({ intermediates: "(", final: e4 }, () => this.selectCharset("(" + e4)), this._parser.registerEscHandler({ intermediates: ")", final: e4 }, () => this.selectCharset(")" + e4)), this._parser.registerEscHandler({ intermediates: "*", final: e4 }, () => this.selectCharset("*" + e4)), this._parser.registerEscHandler({ intermediates: "+", final: e4 }, () => this.selectCharset("+" + e4)), this._parser.registerEscHandler({ intermediates: "-", final: e4 }, () => this.selectCharset("-" + e4)), this._parser.registerEscHandler({ intermediates: ".", final: e4 }, () => this.selectCharset("." + e4)), this._parser.registerEscHandler({ intermediates: "/", final: e4 }, () => this.selectCharset("/" + e4)); this._parser.registerEscHandler({ intermediates: "#", final: "8" }, () => this.screenAlignmentPattern()), this._parser.setErrorHandler((e4) => (this._logService.error("Parsing error: ", e4), e4)), this._parser.registerDcsHandler({ intermediates: "$", final: "q" }, new v.DcsHandler((e4, t4) => this.requestStatusString(e4, t4))); } getAttrData() { return this._curAttrData; } get onRequestBell() { return this._onRequestBell.event; } get onRequestRefreshRows() { return this._onRequestRefreshRows.event; } get onRequestReset() { return this._onRequestReset.event; } get onRequestSendFocus() { return this._onRequestSendFocus.event; } get onRequestSyncScrollBar() { return this._onRequestSyncScrollBar.event; } get onRequestWindowsOptionsReport() { return this._onRequestWindowsOptionsReport.event; } get onA11yChar() { return this._onA11yChar.event; } get onA11yTab() { return this._onA11yTab.event; } get onCursorMove() { return this._onCursorMove.event; } get onLineFeed() { return this._onLineFeed.event; } get onScroll() { return this._onScroll.event; } get onTitleChange() { return this._onTitleChange.event; } get onColor() { return this._onColor.event; } dispose() { super.dispose(); } _preserveStack(e3, t3, i3, s3) { this._parseStack.paused = true, this._parseStack.cursorStartX = e3, this._parseStack.cursorStartY = t3, this._parseStack.decodedLength = i3, this._parseStack.position = s3; } _logSlowResolvingAsync(e3) { this._logService.logLevel <= u.LogLevelEnum.WARN && Promise.race([e3, new Promise((e4, t3) => setTimeout(() => t3("#SLOW_TIMEOUT"), 5e3))]).catch((e4) => { if (e4 !== "#SLOW_TIMEOUT") throw e4; console.warn("async parser handler taking longer than 5000 ms"); }); } parse(e3, t3) { let i3, s3 = this._activeBuffer.x, r2 = this._activeBuffer.y, n2 = 0; const o2 = this._parseStack.paused; if (o2) { if (i3 = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, t3)) return this._logSlowResolvingAsync(i3), i3; s3 = this._parseStack.cursorStartX, r2 = this._parseStack.cursorStartY, this._parseStack.paused = false, e3.length > S && (n2 = this._parseStack.position + S); } if (this._logService.logLevel <= u.LogLevelEnum.DEBUG && this._logService.debug("parsing data" + (typeof e3 == "string" ? ` "${e3}"` : ` "${Array.prototype.map.call(e3, (e4) => String.fromCharCode(e4)).join("")}"`), typeof e3 == "string" ? e3.split("").map((e4) => e4.charCodeAt(0)) : e3), this._parseBuffer.length < e3.length && this._parseBuffer.length < S && (this._parseBuffer = new Uint32Array(Math.min(e3.length, S))), o2 || this._dirtyRowService.clearRange(), e3.length > S) for (let t4 = n2; t4 < e3.length; t4 += S) { const n3 = t4 + S < e3.length ? t4 + S : e3.length, o3 = typeof e3 == "string" ? this._stringDecoder.decode(e3.substring(t4, n3), this._parseBuffer) : this._utf8Decoder.decode(e3.subarray(t4, n3), this._parseBuffer); if (i3 = this._parser.parse(this._parseBuffer, o3)) return this._preserveStack(s3, r2, o3, t4), this._logSlowResolvingAsync(i3), i3; } else if (!o2) { const t4 = typeof e3 == "string" ? this._stringDecoder.decode(e3, this._parseBuffer) : this._utf8Decoder.decode(e3, this._parseBuffer); if (i3 = this._parser.parse(this._parseBuffer, t4)) return this._preserveStack(s3, r2, t4, 0), this._logSlowResolvingAsync(i3), i3; } this._activeBuffer.x === s3 && this._activeBuffer.y === r2 || this._onCursorMove.fire(), this._onRequestRefreshRows.fire(this._dirtyRowService.start, this._dirtyRowService.end); } print(e3, t3, i3) { let s3, r2; const n2 = this._charsetService.charset, o2 = this._optionsService.rawOptions.screenReaderMode, h2 = this._bufferService.cols, c2 = this._coreService.decPrivateModes.wraparound, d2 = this._coreService.modes.insertMode, _2 = this._curAttrData; let u2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); this._dirtyRowService.markDirty(this._activeBuffer.y), this._activeBuffer.x && i3 - t3 > 0 && u2.getWidth(this._activeBuffer.x - 1) === 2 && u2.setCellFromCodePoint(this._activeBuffer.x - 1, 0, 1, _2.fg, _2.bg, _2.extended); for (let f2 = t3; f2 < i3; ++f2) { if (s3 = e3[f2], r2 = this._unicodeService.wcwidth(s3), s3 < 127 && n2) { const e4 = n2[String.fromCharCode(s3)]; e4 && (s3 = e4.charCodeAt(0)); } if (o2 && this._onA11yChar.fire((0, a.stringFromCodePoint)(s3)), this._currentLinkId !== void 0 && this._oscLinkService.addLineToLink(this._currentLinkId, this._activeBuffer.ybase + this._activeBuffer.y), r2 || !this._activeBuffer.x) { if (this._activeBuffer.x + r2 - 1 >= h2) { if (c2) { for (; this._activeBuffer.x < h2; ) u2.setCellFromCodePoint(this._activeBuffer.x++, 0, 1, _2.fg, _2.bg, _2.extended); this._activeBuffer.x = 0, this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData(), true)) : (this._activeBuffer.y >= this._bufferService.rows && (this._activeBuffer.y = this._bufferService.rows - 1), this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = true), u2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); } else if (this._activeBuffer.x = h2 - 1, r2 === 2) continue; } if (d2 && (u2.insertCells(this._activeBuffer.x, r2, this._activeBuffer.getNullCell(_2), _2), u2.getWidth(h2 - 1) === 2 && u2.setCellFromCodePoint(h2 - 1, l.NULL_CELL_CODE, l.NULL_CELL_WIDTH, _2.fg, _2.bg, _2.extended)), u2.setCellFromCodePoint(this._activeBuffer.x++, s3, r2, _2.fg, _2.bg, _2.extended), r2 > 0) for (; --r2; ) u2.setCellFromCodePoint(this._activeBuffer.x++, 0, 0, _2.fg, _2.bg, _2.extended); } else u2.getWidth(this._activeBuffer.x - 1) ? u2.addCodepointToCell(this._activeBuffer.x - 1, s3) : u2.addCodepointToCell(this._activeBuffer.x - 2, s3); } i3 - t3 > 0 && (u2.loadCell(this._activeBuffer.x - 1, this._workCell), this._workCell.getWidth() === 2 || this._workCell.getCode() > 65535 ? this._parser.precedingCodepoint = 0 : this._workCell.isCombined() ? this._parser.precedingCodepoint = this._workCell.getChars().charCodeAt(0) : this._parser.precedingCodepoint = this._workCell.content), this._activeBuffer.x < h2 && i3 - t3 > 0 && u2.getWidth(this._activeBuffer.x) === 0 && !u2.hasContent(this._activeBuffer.x) && u2.setCellFromCodePoint(this._activeBuffer.x, 0, 1, _2.fg, _2.bg, _2.extended), this._dirtyRowService.markDirty(this._activeBuffer.y); } registerCsiHandler(e3, t3) { return e3.final !== "t" || e3.prefix || e3.intermediates ? this._parser.registerCsiHandler(e3, t3) : this._parser.registerCsiHandler(e3, (e4) => !m(e4.params[0], this._optionsService.rawOptions.windowOptions) || t3(e4)); } registerDcsHandler(e3, t3) { return this._parser.registerDcsHandler(e3, new v.DcsHandler(t3)); } registerEscHandler(e3, t3) { return this._parser.registerEscHandler(e3, t3); } registerOscHandler(e3, t3) { return this._parser.registerOscHandler(e3, new f.OscHandler(t3)); } bell() { return this._onRequestBell.fire(), true; } lineFeed() { return this._dirtyRowService.markDirty(this._activeBuffer.y), this._optionsService.rawOptions.convertEol && (this._activeBuffer.x = 0), this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData())) : this._activeBuffer.y >= this._bufferService.rows && (this._activeBuffer.y = this._bufferService.rows - 1), this._activeBuffer.x >= this._bufferService.cols && this._activeBuffer.x--, this._dirtyRowService.markDirty(this._activeBuffer.y), this._onLineFeed.fire(), true; } carriageReturn() { return this._activeBuffer.x = 0, true; } backspace() { var e3; if (!this._coreService.decPrivateModes.reverseWraparound) return this._restrictCursor(), this._activeBuffer.x > 0 && this._activeBuffer.x--, true; if (this._restrictCursor(this._bufferService.cols), this._activeBuffer.x > 0) this._activeBuffer.x--; else if (this._activeBuffer.x === 0 && this._activeBuffer.y > this._activeBuffer.scrollTop && this._activeBuffer.y <= this._activeBuffer.scrollBottom && ((e3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)) === null || e3 === void 0 ? void 0 : e3.isWrapped)) { this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = false, this._activeBuffer.y--, this._activeBuffer.x = this._bufferService.cols - 1; const e4 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); e4.hasWidth(this._activeBuffer.x) && !e4.hasContent(this._activeBuffer.x) && this._activeBuffer.x--; } return this._restrictCursor(), true; } tab() { if (this._activeBuffer.x >= this._bufferService.cols) return true; const e3 = this._activeBuffer.x; return this._activeBuffer.x = this._activeBuffer.nextStop(), this._optionsService.rawOptions.screenReaderMode && this._onA11yTab.fire(this._activeBuffer.x - e3), true; } shiftOut() { return this._charsetService.setgLevel(1), true; } shiftIn() { return this._charsetService.setgLevel(0), true; } _restrictCursor(e3 = this._bufferService.cols - 1) { this._activeBuffer.x = Math.min(e3, Math.max(0, this._activeBuffer.x)), this._activeBuffer.y = this._coreService.decPrivateModes.origin ? Math.min(this._activeBuffer.scrollBottom, Math.max(this._activeBuffer.scrollTop, this._activeBuffer.y)) : Math.min(this._bufferService.rows - 1, Math.max(0, this._activeBuffer.y)), this._dirtyRowService.markDirty(this._activeBuffer.y); } _setCursor(e3, t3) { this._dirtyRowService.markDirty(this._activeBuffer.y), this._coreService.decPrivateModes.origin ? (this._activeBuffer.x = e3, this._activeBuffer.y = this._activeBuffer.scrollTop + t3) : (this._activeBuffer.x = e3, this._activeBuffer.y = t3), this._restrictCursor(), this._dirtyRowService.markDirty(this._activeBuffer.y); } _moveCursor(e3, t3) { this._restrictCursor(), this._setCursor(this._activeBuffer.x + e3, this._activeBuffer.y + t3); } cursorUp(e3) { const t3 = this._activeBuffer.y - this._activeBuffer.scrollTop; return t3 >= 0 ? this._moveCursor(0, -Math.min(t3, e3.params[0] || 1)) : this._moveCursor(0, -(e3.params[0] || 1)), true; } cursorDown(e3) { const t3 = this._activeBuffer.scrollBottom - this._activeBuffer.y; return t3 >= 0 ? this._moveCursor(0, Math.min(t3, e3.params[0] || 1)) : this._moveCursor(0, e3.params[0] || 1), true; } cursorForward(e3) { return this._moveCursor(e3.params[0] || 1, 0), true; } cursorBackward(e3) { return this._moveCursor(-(e3.params[0] || 1), 0), true; } cursorNextLine(e3) { return this.cursorDown(e3), this._activeBuffer.x = 0, true; } cursorPrecedingLine(e3) { return this.cursorUp(e3), this._activeBuffer.x = 0, true; } cursorCharAbsolute(e3) { return this._setCursor((e3.params[0] || 1) - 1, this._activeBuffer.y), true; } cursorPosition(e3) { return this._setCursor(e3.length >= 2 ? (e3.params[1] || 1) - 1 : 0, (e3.params[0] || 1) - 1), true; } charPosAbsolute(e3) { return this._setCursor((e3.params[0] || 1) - 1, this._activeBuffer.y), true; } hPositionRelative(e3) { return this._moveCursor(e3.params[0] || 1, 0), true; } linePosAbsolute(e3) { return this._setCursor(this._activeBuffer.x, (e3.params[0] || 1) - 1), true; } vPositionRelative(e3) { return this._moveCursor(0, e3.params[0] || 1), true; } hVPosition(e3) { return this.cursorPosition(e3), true; } tabClear(e3) { const t3 = e3.params[0]; return t3 === 0 ? delete this._activeBuffer.tabs[this._activeBuffer.x] : t3 === 3 && (this._activeBuffer.tabs = {}), true; } cursorForwardTab(e3) { if (this._activeBuffer.x >= this._bufferService.cols) return true; let t3 = e3.params[0] || 1; for (; t3--; ) this._activeBuffer.x = this._activeBuffer.nextStop(); return true; } cursorBackwardTab(e3) { if (this._activeBuffer.x >= this._bufferService.cols) return true; let t3 = e3.params[0] || 1; for (; t3--; ) this._activeBuffer.x = this._activeBuffer.prevStop(); return true; } selectProtected(e3) { const t3 = e3.params[0]; return t3 === 1 && (this._curAttrData.bg |= 536870912), t3 !== 2 && t3 !== 0 || (this._curAttrData.bg &= -536870913), true; } _eraseInBufferLine(e3, t3, i3, s3 = false, r2 = false) { const n2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e3); n2.replaceCells(t3, i3, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData(), r2), s3 && (n2.isWrapped = false); } _resetBufferLine(e3, t3 = false) { const i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e3); i3.fill(this._activeBuffer.getNullCell(this._eraseAttrData()), t3), this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + e3), i3.isWrapped = false; } eraseInDisplay(e3, t3 = false) { let i3; switch (this._restrictCursor(this._bufferService.cols), e3.params[0]) { case 0: for (i3 = this._activeBuffer.y, this._dirtyRowService.markDirty(i3), this._eraseInBufferLine(i3++, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, t3); i3 < this._bufferService.rows; i3++) this._resetBufferLine(i3, t3); this._dirtyRowService.markDirty(i3); break; case 1: for (i3 = this._activeBuffer.y, this._dirtyRowService.markDirty(i3), this._eraseInBufferLine(i3, 0, this._activeBuffer.x + 1, true, t3), this._activeBuffer.x + 1 >= this._bufferService.cols && (this._activeBuffer.lines.get(i3 + 1).isWrapped = false); i3--; ) this._resetBufferLine(i3, t3); this._dirtyRowService.markDirty(0); break; case 2: for (i3 = this._bufferService.rows, this._dirtyRowService.markDirty(i3 - 1); i3--; ) this._resetBufferLine(i3, t3); this._dirtyRowService.markDirty(0); break; case 3: const e4 = this._activeBuffer.lines.length - this._bufferService.rows; e4 > 0 && (this._activeBuffer.lines.trimStart(e4), this._activeBuffer.ybase = Math.max(this._activeBuffer.ybase - e4, 0), this._activeBuffer.ydisp = Math.max(this._activeBuffer.ydisp - e4, 0), this._onScroll.fire(0)); } return true; } eraseInLine(e3, t3 = false) { switch (this._restrictCursor(this._bufferService.cols), e3.params[0]) { case 0: this._eraseInBufferLine(this._activeBuffer.y, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, t3); break; case 1: this._eraseInBufferLine(this._activeBuffer.y, 0, this._activeBuffer.x + 1, false, t3); break; case 2: this._eraseInBufferLine(this._activeBuffer.y, 0, this._bufferService.cols, true, t3); } return this._dirtyRowService.markDirty(this._activeBuffer.y), true; } insertLines(e3) { this._restrictCursor(); let t3 = e3.params[0] || 1; if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return true; const i3 = this._activeBuffer.ybase + this._activeBuffer.y, s3 = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom, r2 = this._bufferService.rows - 1 + this._activeBuffer.ybase - s3 + 1; for (; t3--; ) this._activeBuffer.lines.splice(r2 - 1, 1), this._activeBuffer.lines.splice(i3, 0, this._activeBuffer.getBlankLine(this._eraseAttrData())); return this._dirtyRowService.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, true; } deleteLines(e3) { this._restrictCursor(); let t3 = e3.params[0] || 1; if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return true; const i3 = this._activeBuffer.ybase + this._activeBuffer.y; let s3; for (s3 = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom, s3 = this._bufferService.rows - 1 + this._activeBuffer.ybase - s3; t3--; ) this._activeBuffer.lines.splice(i3, 1), this._activeBuffer.lines.splice(s3, 0, this._activeBuffer.getBlankLine(this._eraseAttrData())); return this._dirtyRowService.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, true; } insertChars(e3) { this._restrictCursor(); const t3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); return t3 && (t3.insertCells(this._activeBuffer.x, e3.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), this._dirtyRowService.markDirty(this._activeBuffer.y)), true; } deleteChars(e3) { this._restrictCursor(); const t3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); return t3 && (t3.deleteCells(this._activeBuffer.x, e3.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), this._dirtyRowService.markDirty(this._activeBuffer.y)), true; } scrollUp(e3) { let t3 = e3.params[0] || 1; for (; t3--; ) this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 1), this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 0, this._activeBuffer.getBlankLine(this._eraseAttrData())); return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), true; } scrollDown(e3) { let t3 = e3.params[0] || 1; for (; t3--; ) this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 1), this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 0, this._activeBuffer.getBlankLine(h.DEFAULT_ATTR_DATA)); return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), true; } scrollLeft(e3) { if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return true; const t3 = e3.params[0] || 1; for (let e4 = this._activeBuffer.scrollTop; e4 <= this._activeBuffer.scrollBottom; ++e4) { const i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4); i3.deleteCells(0, t3, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), i3.isWrapped = false; } return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), true; } scrollRight(e3) { if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return true; const t3 = e3.params[0] || 1; for (let e4 = this._activeBuffer.scrollTop; e4 <= this._activeBuffer.scrollBottom; ++e4) { const i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4); i3.insertCells(0, t3, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), i3.isWrapped = false; } return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), true; } insertColumns(e3) { if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return true; const t3 = e3.params[0] || 1; for (let e4 = this._activeBuffer.scrollTop; e4 <= this._activeBuffer.scrollBottom; ++e4) { const i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4); i3.insertCells(this._activeBuffer.x, t3, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), i3.isWrapped = false; } return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), true; } deleteColumns(e3) { if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return true; const t3 = e3.params[0] || 1; for (let e4 = this._activeBuffer.scrollTop; e4 <= this._activeBuffer.scrollBottom; ++e4) { const i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4); i3.deleteCells(this._activeBuffer.x, t3, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), i3.isWrapped = false; } return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), true; } eraseChars(e3) { this._restrictCursor(); const t3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); return t3 && (t3.replaceCells(this._activeBuffer.x, this._activeBuffer.x + (e3.params[0] || 1), this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), this._dirtyRowService.markDirty(this._activeBuffer.y)), true; } repeatPrecedingCharacter(e3) { if (!this._parser.precedingCodepoint) return true; const t3 = e3.params[0] || 1, i3 = new Uint32Array(t3); for (let e4 = 0; e4 < t3; ++e4) i3[e4] = this._parser.precedingCodepoint; return this.print(i3, 0, i3.length), true; } sendDeviceAttributesPrimary(e3) { return e3.params[0] > 0 || (this._is("xterm") || this._is("rxvt-unicode") || this._is("screen") ? this._coreService.triggerDataEvent(s2.C0.ESC + "[?1;2c") : this._is("linux") && this._coreService.triggerDataEvent(s2.C0.ESC + "[?6c")), true; } sendDeviceAttributesSecondary(e3) { return e3.params[0] > 0 || (this._is("xterm") ? this._coreService.triggerDataEvent(s2.C0.ESC + "[>0;276;0c") : this._is("rxvt-unicode") ? this._coreService.triggerDataEvent(s2.C0.ESC + "[>85;95;0c") : this._is("linux") ? this._coreService.triggerDataEvent(e3.params[0] + "c") : this._is("screen") && this._coreService.triggerDataEvent(s2.C0.ESC + "[>83;40003;0c")), true; } _is(e3) { return (this._optionsService.rawOptions.termName + "").indexOf(e3) === 0; } setMode(e3) { for (let t3 = 0; t3 < e3.length; t3++) switch (e3.params[t3]) { case 4: this._coreService.modes.insertMode = true; break; case 20: this._optionsService.options.convertEol = true; } return true; } setModePrivate(e3) { for (let t3 = 0; t3 < e3.length; t3++) switch (e3.params[t3]) { case 1: this._coreService.decPrivateModes.applicationCursorKeys = true; break; case 2: this._charsetService.setgCharset(0, r.DEFAULT_CHARSET), this._charsetService.setgCharset(1, r.DEFAULT_CHARSET), this._charsetService.setgCharset(2, r.DEFAULT_CHARSET), this._charsetService.setgCharset(3, r.DEFAULT_CHARSET); break; case 3: this._optionsService.rawOptions.windowOptions.setWinLines && (this._bufferService.resize(132, this._bufferService.rows), this._onRequestReset.fire()); break; case 6: this._coreService.decPrivateModes.origin = true, this._setCursor(0, 0); break; case 7: this._coreService.decPrivateModes.wraparound = true; break; case 12: this._optionsService.options.cursorBlink = true; break; case 45: this._coreService.decPrivateModes.reverseWraparound = true; break; case 66: this._logService.debug("Serial port requested application keypad."), this._coreService.decPrivateModes.applicationKeypad = true, this._onRequestSyncScrollBar.fire(); break; case 9: this._coreMouseService.activeProtocol = "X10"; break; case 1e3: this._coreMouseService.activeProtocol = "VT200"; break; case 1002: this._coreMouseService.activeProtocol = "DRAG"; break; case 1003: this._coreMouseService.activeProtocol = "ANY"; break; case 1004: this._coreService.decPrivateModes.sendFocus = true, this._onRequestSendFocus.fire(); break; case 1005: this._logService.debug("DECSET 1005 not supported (see #2507)"); break; case 1006: this._coreMouseService.activeEncoding = "SGR"; break; case 1015: this._logService.debug("DECSET 1015 not supported (see #2507)"); break; case 1016: this._coreMouseService.activeEncoding = "SGR_PIXELS"; break; case 25: this._coreService.isCursorHidden = false; break; case 1048: this.saveCursor(); break; case 1049: this.saveCursor(); case 47: case 1047: this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()), this._coreService.isCursorInitialized = true, this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1), this._onRequestSyncScrollBar.fire(); break; case 2004: this._coreService.decPrivateModes.bracketedPasteMode = true; } return true; } resetMode(e3) { for (let t3 = 0; t3 < e3.length; t3++) switch (e3.params[t3]) { case 4: this._coreService.modes.insertMode = false; break; case 20: this._optionsService.options.convertEol = false; } return true; } resetModePrivate(e3) { for (let t3 = 0; t3 < e3.length; t3++) switch (e3.params[t3]) { case 1: this._coreService.decPrivateModes.applicationCursorKeys = false; break; case 3: this._optionsService.rawOptions.windowOptions.setWinLines && (this._bufferService.resize(80, this._bufferService.rows), this._onRequestReset.fire()); break; case 6: this._coreService.decPrivateModes.origin = false, this._setCursor(0, 0); break; case 7: this._coreService.decPrivateModes.wraparound = false; break; case 12: this._optionsService.options.cursorBlink = false; break; case 45: this._coreService.decPrivateModes.reverseWraparound = false; break; case 66: this._logService.debug("Switching back to normal keypad."), this._coreService.decPrivateModes.applicationKeypad = false, this._onRequestSyncScrollBar.fire(); break; case 9: case 1e3: case 1002: case 1003: this._coreMouseService.activeProtocol = "NONE"; break; case 1004: this._coreService.decPrivateModes.sendFocus = false; break; case 1005: this._logService.debug("DECRST 1005 not supported (see #2507)"); break; case 1006: case 1016: this._coreMouseService.activeEncoding = "DEFAULT"; break; case 1015: this._logService.debug("DECRST 1015 not supported (see #2507)"); break; case 25: this._coreService.isCursorHidden = true; break; case 1048: this.restoreCursor(); break; case 1049: case 47: case 1047: this._bufferService.buffers.activateNormalBuffer(), e3.params[t3] === 1049 && this.restoreCursor(), this._coreService.isCursorInitialized = true, this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1), this._onRequestSyncScrollBar.fire(); break; case 2004: this._coreService.decPrivateModes.bracketedPasteMode = false; } return true; } requestMode(e3, t3) { const i3 = this._coreService.decPrivateModes, { activeProtocol: r2, activeEncoding: n2 } = this._coreMouseService, o2 = this._coreService, { buffers: a2, cols: h2 } = this._bufferService, { active: c2, alt: l2 } = a2, d2 = this._optionsService.rawOptions, _2 = /* @__PURE__ */ __name((e4) => e4 ? 1 : 2, "_"), u2 = e3.params[0]; return f2 = u2, v2 = t3 ? u2 === 2 ? 3 : u2 === 4 ? _2(o2.modes.insertMode) : u2 === 12 ? 4 : u2 === 20 ? _2(d2.convertEol) : 0 : u2 === 1 ? _2(i3.applicationCursorKeys) : u2 === 3 ? d2.windowOptions.setWinLines ? h2 === 80 ? 2 : h2 === 132 ? 1 : 0 : 0 : u2 === 6 ? _2(i3.origin) : u2 === 7 ? _2(i3.wraparound) : u2 === 8 ? 3 : u2 === 9 ? _2(r2 === "X10") : u2 === 12 ? _2(d2.cursorBlink) : u2 === 25 ? _2(!o2.isCursorHidden) : u2 === 45 ? _2(i3.reverseWraparound) : u2 === 66 ? _2(i3.applicationKeypad) : u2 === 1e3 ? _2(r2 === "VT200") : u2 === 1002 ? _2(r2 === "DRAG") : u2 === 1003 ? _2(r2 === "ANY") : u2 === 1004 ? _2(i3.sendFocus) : u2 === 1005 ? 4 : u2 === 1006 ? _2(n2 === "SGR") : u2 === 1015 ? 4 : u2 === 1016 ? _2(n2 === "SGR_PIXELS") : u2 === 1048 ? 1 : u2 === 47 || u2 === 1047 || u2 === 1049 ? _2(c2 === l2) : u2 === 2004 ? _2(i3.bracketedPasteMode) : 0, o2.triggerDataEvent(`${s2.C0.ESC}[${t3 ? "" : "?"}${f2};${v2}$y`), true; var f2, v2; } _updateAttrColor(e3, t3, i3, s3, r2) { return t3 === 2 ? (e3 |= 50331648, e3 &= -16777216, e3 |= _.AttributeData.fromColorRGB([i3, s3, r2])) : t3 === 5 && (e3 &= -50331904, e3 |= 33554432 | 255 & i3), e3; } _extractColor(e3, t3, i3) { const s3 = [0, 0, -1, 0, 0, 0]; let r2 = 0, n2 = 0; do { if (s3[n2 + r2] = e3.params[t3 + n2], e3.hasSubParams(t3 + n2)) { const i4 = e3.getSubParams(t3 + n2); let o2 = 0; do { s3[1] === 5 && (r2 = 1), s3[n2 + o2 + 1 + r2] = i4[o2]; } while (++o2 < i4.length && o2 + n2 + 1 + r2 < s3.length); break; } if (s3[1] === 5 && n2 + r2 >= 2 || s3[1] === 2 && n2 + r2 >= 5) break; s3[1] && (r2 = 1); } while (++n2 + t3 < e3.length && n2 + r2 < s3.length); for (let e4 = 2; e4 < s3.length; ++e4) s3[e4] === -1 && (s3[e4] = 0); switch (s3[0]) { case 38: i3.fg = this._updateAttrColor(i3.fg, s3[1], s3[3], s3[4], s3[5]); break; case 48: i3.bg = this._updateAttrColor(i3.bg, s3[1], s3[3], s3[4], s3[5]); break; case 58: i3.extended = i3.extended.clone(), i3.extended.underlineColor = this._updateAttrColor(i3.extended.underlineColor, s3[1], s3[3], s3[4], s3[5]); } return n2; } _processUnderline(e3, t3) { t3.extended = t3.extended.clone(), (!~e3 || e3 > 5) && (e3 = 1), t3.extended.underlineStyle = e3, t3.fg |= 268435456, e3 === 0 && (t3.fg &= -268435457), t3.updateExtended(); } charAttributes(e3) { if (e3.length === 1 && e3.params[0] === 0) return this._curAttrData.fg = h.DEFAULT_ATTR_DATA.fg, this._curAttrData.bg = h.DEFAULT_ATTR_DATA.bg, true; const t3 = e3.length; let i3; const s3 = this._curAttrData; for (let r2 = 0; r2 < t3; r2++) i3 = e3.params[r2], i3 >= 30 && i3 <= 37 ? (s3.fg &= -50331904, s3.fg |= 16777216 | i3 - 30) : i3 >= 40 && i3 <= 47 ? (s3.bg &= -50331904, s3.bg |= 16777216 | i3 - 40) : i3 >= 90 && i3 <= 97 ? (s3.fg &= -50331904, s3.fg |= 16777224 | i3 - 90) : i3 >= 100 && i3 <= 107 ? (s3.bg &= -50331904, s3.bg |= 16777224 | i3 - 100) : i3 === 0 ? (s3.fg = h.DEFAULT_ATTR_DATA.fg, s3.bg = h.DEFAULT_ATTR_DATA.bg) : i3 === 1 ? s3.fg |= 134217728 : i3 === 3 ? s3.bg |= 67108864 : i3 === 4 ? (s3.fg |= 268435456, this._processUnderline(e3.hasSubParams(r2) ? e3.getSubParams(r2)[0] : 1, s3)) : i3 === 5 ? s3.fg |= 536870912 : i3 === 7 ? s3.fg |= 67108864 : i3 === 8 ? s3.fg |= 1073741824 : i3 === 9 ? s3.fg |= 2147483648 : i3 === 2 ? s3.bg |= 134217728 : i3 === 21 ? this._processUnderline(2, s3) : i3 === 22 ? (s3.fg &= -134217729, s3.bg &= -134217729) : i3 === 23 ? s3.bg &= -67108865 : i3 === 24 ? (s3.fg &= -268435457, this._processUnderline(0, s3)) : i3 === 25 ? s3.fg &= -536870913 : i3 === 27 ? s3.fg &= -67108865 : i3 === 28 ? s3.fg &= -1073741825 : i3 === 29 ? s3.fg &= 2147483647 : i3 === 39 ? (s3.fg &= -67108864, s3.fg |= 16777215 & h.DEFAULT_ATTR_DATA.fg) : i3 === 49 ? (s3.bg &= -67108864, s3.bg |= 16777215 & h.DEFAULT_ATTR_DATA.bg) : i3 === 38 || i3 === 48 || i3 === 58 ? r2 += this._extractColor(e3, r2, s3) : i3 === 59 ? (s3.extended = s3.extended.clone(), s3.extended.underlineColor = -1, s3.updateExtended()) : i3 === 100 ? (s3.fg &= -67108864, s3.fg |= 16777215 & h.DEFAULT_ATTR_DATA.fg, s3.bg &= -67108864, s3.bg |= 16777215 & h.DEFAULT_ATTR_DATA.bg) : this._logService.debug("Unknown SGR attribute: %d.", i3); return true; } deviceStatus(e3) { switch (e3.params[0]) { case 5: this._coreService.triggerDataEvent(`${s2.C0.ESC}[0n`); break; case 6: const e4 = this._activeBuffer.y + 1, t3 = this._activeBuffer.x + 1; this._coreService.triggerDataEvent(`${s2.C0.ESC}[${e4};${t3}R`); } return true; } deviceStatusPrivate(e3) { if (e3.params[0] === 6) { const e4 = this._activeBuffer.y + 1, t3 = this._activeBuffer.x + 1; this._coreService.triggerDataEvent(`${s2.C0.ESC}[?${e4};${t3}R`); } return true; } softReset(e3) { return this._coreService.isCursorHidden = false, this._onRequestSyncScrollBar.fire(), this._activeBuffer.scrollTop = 0, this._activeBuffer.scrollBottom = this._bufferService.rows - 1, this._curAttrData = h.DEFAULT_ATTR_DATA.clone(), this._coreService.reset(), this._charsetService.reset(), this._activeBuffer.savedX = 0, this._activeBuffer.savedY = this._activeBuffer.ybase, this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg, this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg, this._activeBuffer.savedCharset = this._charsetService.charset, this._coreService.decPrivateModes.origin = false, true; } setCursorStyle(e3) { const t3 = e3.params[0] || 1; switch (t3) { case 1: case 2: this._optionsService.options.cursorStyle = "block"; break; case 3: case 4: this._optionsService.options.cursorStyle = "underline"; break; case 5: case 6: this._optionsService.options.cursorStyle = "bar"; } const i3 = t3 % 2 == 1; return this._optionsService.options.cursorBlink = i3, true; } setScrollRegion(e3) { const t3 = e3.params[0] || 1; let i3; return (e3.length < 2 || (i3 = e3.params[1]) > this._bufferService.rows || i3 === 0) && (i3 = this._bufferService.rows), i3 > t3 && (this._activeBuffer.scrollTop = t3 - 1, this._activeBuffer.scrollBottom = i3 - 1, this._setCursor(0, 0)), true; } windowOptions(e3) { if (!m(e3.params[0], this._optionsService.rawOptions.windowOptions)) return true; const t3 = e3.length > 1 ? e3.params[1] : 0; switch (e3.params[0]) { case 14: t3 !== 2 && this._onRequestWindowsOptionsReport.fire(C.GET_WIN_SIZE_PIXELS); break; case 16: this._onRequestWindowsOptionsReport.fire(C.GET_CELL_SIZE_PIXELS); break; case 18: this._bufferService && this._coreService.triggerDataEvent(`${s2.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`); break; case 22: t3 !== 0 && t3 !== 2 || (this._windowTitleStack.push(this._windowTitle), this._windowTitleStack.length > 10 && this._windowTitleStack.shift()), t3 !== 0 && t3 !== 1 || (this._iconNameStack.push(this._iconName), this._iconNameStack.length > 10 && this._iconNameStack.shift()); break; case 23: t3 !== 0 && t3 !== 2 || this._windowTitleStack.length && this.setTitle(this._windowTitleStack.pop()), t3 !== 0 && t3 !== 1 || this._iconNameStack.length && this.setIconName(this._iconNameStack.pop()); } return true; } saveCursor(e3) { return this._activeBuffer.savedX = this._activeBuffer.x, this._activeBuffer.savedY = this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg, this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg, this._activeBuffer.savedCharset = this._charsetService.charset, true; } restoreCursor(e3) { return this._activeBuffer.x = this._activeBuffer.savedX || 0, this._activeBuffer.y = Math.max(this._activeBuffer.savedY - this._activeBuffer.ybase, 0), this._curAttrData.fg = this._activeBuffer.savedCurAttrData.fg, this._curAttrData.bg = this._activeBuffer.savedCurAttrData.bg, this._charsetService.charset = this._savedCharset, this._activeBuffer.savedCharset && (this._charsetService.charset = this._activeBuffer.savedCharset), this._restrictCursor(), true; } setTitle(e3) { return this._windowTitle = e3, this._onTitleChange.fire(e3), true; } setIconName(e3) { return this._iconName = e3, true; } setOrReportIndexedColor(e3) { const t3 = [], i3 = e3.split(";"); for (; i3.length > 1; ) { const e4 = i3.shift(), s3 = i3.shift(); if (/^\d+$/.exec(e4)) { const i4 = parseInt(e4); if (0 <= i4 && i4 < 256) if (s3 === "?") t3.push({ type: 0, index: i4 }); else { const e5 = (0, g.parseColor)(s3); e5 && t3.push({ type: 1, index: i4, color: e5 }); } } } return t3.length && this._onColor.fire(t3), true; } setHyperlink(e3) { const t3 = e3.split(";"); return !(t3.length < 2) && (t3[1] ? this._createHyperlink(t3[0], t3[1]) : !t3[0] && this._finishHyperlink()); } _createHyperlink(e3, t3) { this._currentLinkId !== void 0 && this._finishHyperlink(); const i3 = e3.split(":"); let s3; const r2 = i3.findIndex((e4) => e4.startsWith("id=")); return r2 !== -1 && (s3 = i3[r2].slice(3) || void 0), this._curAttrData.extended = this._curAttrData.extended.clone(), this._currentLinkId = this._oscLinkService.registerLink({ id: s3, uri: t3 }), this._curAttrData.extended.urlId = this._currentLinkId, this._curAttrData.updateExtended(), true; } _finishHyperlink() { return this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = 0, this._curAttrData.updateExtended(), this._currentLinkId = void 0, true; } _setOrReportSpecialColor(e3, t3) { const i3 = e3.split(";"); for (let e4 = 0; e4 < i3.length && !(t3 >= this._specialColors.length); ++e4, ++t3) if (i3[e4] === "?") this._onColor.fire([{ type: 0, index: this._specialColors[t3] }]); else { const s3 = (0, g.parseColor)(i3[e4]); s3 && this._onColor.fire([{ type: 1, index: this._specialColors[t3], color: s3 }]); } return true; } setOrReportFgColor(e3) { return this._setOrReportSpecialColor(e3, 0); } setOrReportBgColor(e3) { return this._setOrReportSpecialColor(e3, 1); } setOrReportCursorColor(e3) { return this._setOrReportSpecialColor(e3, 2); } restoreIndexedColor(e3) { if (!e3) return this._onColor.fire([{ type: 2 }]), true; const t3 = [], i3 = e3.split(";"); for (let e4 = 0; e4 < i3.length; ++e4) if (/^\d+$/.exec(i3[e4])) { const s3 = parseInt(i3[e4]); 0 <= s3 && s3 < 256 && t3.push({ type: 2, index: s3 }); } return t3.length && this._onColor.fire(t3), true; } restoreFgColor(e3) { return this._onColor.fire([{ type: 2, index: 256 }]), true; } restoreBgColor(e3) { return this._onColor.fire([{ type: 2, index: 257 }]), true; } restoreCursorColor(e3) { return this._onColor.fire([{ type: 2, index: 258 }]), true; } nextLine() { return this._activeBuffer.x = 0, this.index(), true; } keypadApplicationMode() { return this._logService.debug("Serial port requested application keypad."), this._coreService.decPrivateModes.applicationKeypad = true, this._onRequestSyncScrollBar.fire(), true; } keypadNumericMode() { return this._logService.debug("Switching back to normal keypad."), this._coreService.decPrivateModes.applicationKeypad = false, this._onRequestSyncScrollBar.fire(), true; } selectDefaultCharset() { return this._charsetService.setgLevel(0), this._charsetService.setgCharset(0, r.DEFAULT_CHARSET), true; } selectCharset(e3) { return e3.length !== 2 ? (this.selectDefaultCharset(), true) : (e3[0] === "/" || this._charsetService.setgCharset(p[e3[0]], r.CHARSETS[e3[1]] || r.DEFAULT_CHARSET), true); } index() { return this._restrictCursor(), this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData())) : this._activeBuffer.y >= this._bufferService.rows && (this._activeBuffer.y = this._bufferService.rows - 1), this._restrictCursor(), true; } tabSet() { return this._activeBuffer.tabs[this._activeBuffer.x] = true, true; } reverseIndex() { if (this._restrictCursor(), this._activeBuffer.y === this._activeBuffer.scrollTop) { const e3 = this._activeBuffer.scrollBottom - this._activeBuffer.scrollTop; this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase + this._activeBuffer.y, e3, 1), this._activeBuffer.lines.set(this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.getBlankLine(this._eraseAttrData())), this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom); } else this._activeBuffer.y--, this._restrictCursor(); return true; } fullReset() { return this._parser.reset(), this._onRequestReset.fire(), true; } reset() { this._curAttrData = h.DEFAULT_ATTR_DATA.clone(), this._eraseAttrDataInternal = h.DEFAULT_ATTR_DATA.clone(); } _eraseAttrData() { return this._eraseAttrDataInternal.bg &= -67108864, this._eraseAttrDataInternal.bg |= 67108863 & this._curAttrData.bg, this._eraseAttrDataInternal; } setgLevel(e3) { return this._charsetService.setgLevel(e3), true; } screenAlignmentPattern() { const e3 = new d.CellData(); e3.content = 1 << 22 | "E".charCodeAt(0), e3.fg = this._curAttrData.fg, e3.bg = this._curAttrData.bg, this._setCursor(0, 0); for (let t3 = 0; t3 < this._bufferService.rows; ++t3) { const i3 = this._activeBuffer.ybase + this._activeBuffer.y + t3, s3 = this._activeBuffer.lines.get(i3); s3 && (s3.fill(e3), s3.isWrapped = false); } return this._dirtyRowService.markAllDirty(), this._setCursor(0, 0), true; } requestStatusString(e3, t3) { const i3 = this._bufferService.buffer, r2 = this._optionsService.rawOptions; return ((e4) => (this._coreService.triggerDataEvent(`${s2.C0.ESC}${e4}${s2.C0.ESC}\\`), true))(e3 === '"q' ? `P1$r${this._curAttrData.isProtected() ? 1 : 0}"q` : e3 === '"p' ? 'P1$r61;1"p' : e3 === "r" ? `P1$r${i3.scrollTop + 1};${i3.scrollBottom + 1}r` : e3 === "m" ? "P1$r0m" : e3 === " q" ? `P1$r${{ block: 2, underline: 4, bar: 6 }[r2.cursorStyle] - (r2.cursorBlink ? 1 : 0)} q` : "P0$r"); } } __name(b, "b"); t2.InputHandler = b; }, 844: (e2, t2) => { function i2(e3) { for (const t3 of e3) t3.dispose(); e3.length = 0; } __name(i2, "i"); Object.defineProperty(t2, "__esModule", { value: true }), t2.getDisposeArrayDisposable = t2.disposeArray = t2.toDisposable = t2.Disposable = void 0, t2.Disposable = class { constructor() { this._disposables = [], this._isDisposed = false; } dispose() { this._isDisposed = true; for (const e3 of this._disposables) e3.dispose(); this._disposables.length = 0; } register(e3) { return this._disposables.push(e3), e3; } unregister(e3) { const t3 = this._disposables.indexOf(e3); t3 !== -1 && this._disposables.splice(t3, 1); } }, t2.toDisposable = function(e3) { return { dispose: e3 }; }, t2.disposeArray = i2, t2.getDisposeArrayDisposable = function(e3) { return { dispose: () => i2(e3) }; }; }, 1505: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.FourKeyMap = t2.TwoKeyMap = void 0; class i2 { constructor() { this._data = {}; } set(e3, t3, i3) { this._data[e3] || (this._data[e3] = {}), this._data[e3][t3] = i3; } get(e3, t3) { return this._data[e3] ? this._data[e3][t3] : void 0; } clear() { this._data = {}; } } __name(i2, "i"); t2.TwoKeyMap = i2, t2.FourKeyMap = class { constructor() { this._data = new i2(); } set(e3, t3, s2, r, n) { this._data.get(e3, t3) || this._data.set(e3, t3, new i2()), this._data.get(e3, t3).set(s2, r, n); } get(e3, t3, i3, s2) { var r; return (r = this._data.get(e3, t3)) === null || r === void 0 ? void 0 : r.get(i3, s2); } clear() { this._data.clear(); } }; }, 6114: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.isLinux = t2.isWindows = t2.isIphone = t2.isIpad = t2.isMac = t2.isSafari = t2.isLegacyEdge = t2.isFirefox = void 0; const i2 = typeof navigator == "undefined", s2 = i2 ? "node" : navigator.userAgent, r = i2 ? "node" : navigator.platform; t2.isFirefox = s2.includes("Firefox"), t2.isLegacyEdge = s2.includes("Edge"), t2.isSafari = /^((?!chrome|android).)*safari/i.test(s2), t2.isMac = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"].includes(r), t2.isIpad = r === "iPad", t2.isIphone = r === "iPhone", t2.isWindows = ["Windows", "Win16", "Win32", "WinCE"].includes(r), t2.isLinux = r.indexOf("Linux") >= 0; }, 6106: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.SortedList = void 0; let i2 = 0; t2.SortedList = class { constructor(e3) { this._getKey = e3, this._array = []; } clear() { this._array.length = 0; } insert(e3) { this._array.length !== 0 ? (i2 = this._search(this._getKey(e3), 0, this._array.length - 1), this._array.splice(i2, 0, e3)) : this._array.push(e3); } delete(e3) { if (this._array.length === 0) return false; const t3 = this._getKey(e3); if (t3 === void 0) return false; if (i2 = this._search(t3, 0, this._array.length - 1), i2 === -1) return false; if (this._getKey(this._array[i2]) !== t3) return false; do { if (this._array[i2] === e3) return this._array.splice(i2, 1), true; } while (++i2 < this._array.length && this._getKey(this._array[i2]) === t3); return false; } *getKeyIterator(e3) { if (this._array.length !== 0 && (i2 = this._search(e3, 0, this._array.length - 1), !(i2 < 0 || i2 >= this._array.length) && this._getKey(this._array[i2]) === e3)) do { yield this._array[i2]; } while (++i2 < this._array.length && this._getKey(this._array[i2]) === e3); } forEachByKey(e3, t3) { if (this._array.length !== 0 && (i2 = this._search(e3, 0, this._array.length - 1), !(i2 < 0 || i2 >= this._array.length) && this._getKey(this._array[i2]) === e3)) do { t3(this._array[i2]); } while (++i2 < this._array.length && this._getKey(this._array[i2]) === e3); } values() { return this._array.values(); } _search(e3, t3, i3) { if (i3 < t3) return t3; let s2 = Math.floor((t3 + i3) / 2); const r = this._getKey(this._array[s2]); if (r > e3) return this._search(e3, t3, s2 - 1); if (r < e3) return this._search(e3, s2 + 1, i3); for (; s2 > 0 && this._getKey(this._array[s2 - 1]) === e3; ) s2--; return s2; } }; }, 8273: (e2, t2) => { function i2(e3, t3, i3 = 0, s2 = e3.length) { if (i3 >= e3.length) return e3; i3 = (e3.length + i3) % e3.length, s2 = s2 >= e3.length ? e3.length : (e3.length + s2) % e3.length; for (let r = i3; r < s2; ++r) e3[r] = t3; return e3; } __name(i2, "i"); Object.defineProperty(t2, "__esModule", { value: true }), t2.concat = t2.fillFallback = t2.fill = void 0, t2.fill = function(e3, t3, s2, r) { return e3.fill ? e3.fill(t3, s2, r) : i2(e3, t3, s2, r); }, t2.fillFallback = i2, t2.concat = function(e3, t3) { const i3 = new e3.constructor(e3.length + t3.length); return i3.set(e3), i3.set(t3, e3.length), i3; }; }, 9282: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.updateWindowsModeWrappedState = void 0; const s2 = i2(643); t2.updateWindowsModeWrappedState = function(e3) { const t3 = e3.buffer.lines.get(e3.buffer.ybase + e3.buffer.y - 1), i3 = t3 == null ? void 0 : t3.get(e3.cols - 1), r = e3.buffer.lines.get(e3.buffer.ybase + e3.buffer.y); r && i3 && (r.isWrapped = i3[s2.CHAR_DATA_CODE_INDEX] !== s2.NULL_CELL_CODE && i3[s2.CHAR_DATA_CODE_INDEX] !== s2.WHITESPACE_CELL_CODE); }; }, 3734: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.ExtendedAttrs = t2.AttributeData = void 0; class i2 { constructor() { this.fg = 0, this.bg = 0, this.extended = new s2(); } static toColorRGB(e3) { return [e3 >>> 16 & 255, e3 >>> 8 & 255, 255 & e3]; } static fromColorRGB(e3) { return (255 & e3[0]) << 16 | (255 & e3[1]) << 8 | 255 & e3[2]; } clone() { const e3 = new i2(); return e3.fg = this.fg, e3.bg = this.bg, e3.extended = this.extended.clone(), e3; } isInverse() { return 67108864 & this.fg; } isBold() { return 134217728 & this.fg; } isUnderline() { return this.hasExtendedAttrs() && this.extended.underlineStyle !== 0 ? 1 : 268435456 & this.fg; } isBlink() { return 536870912 & this.fg; } isInvisible() { return 1073741824 & this.fg; } isItalic() { return 67108864 & this.bg; } isDim() { return 134217728 & this.bg; } isStrikethrough() { return 2147483648 & this.fg; } isProtected() { return 536870912 & this.bg; } getFgColorMode() { return 50331648 & this.fg; } getBgColorMode() { return 50331648 & this.bg; } isFgRGB() { return (50331648 & this.fg) == 50331648; } isBgRGB() { return (50331648 & this.bg) == 50331648; } isFgPalette() { return (50331648 & this.fg) == 16777216 || (50331648 & this.fg) == 33554432; } isBgPalette() { return (50331648 & this.bg) == 16777216 || (50331648 & this.bg) == 33554432; } isFgDefault() { return (50331648 & this.fg) == 0; } isBgDefault() { return (50331648 & this.bg) == 0; } isAttributeDefault() { return this.fg === 0 && this.bg === 0; } getFgColor() { switch (50331648 & this.fg) { case 16777216: case 33554432: return 255 & this.fg; case 50331648: return 16777215 & this.fg; default: return -1; } } getBgColor() { switch (50331648 & this.bg) { case 16777216: case 33554432: return 255 & this.bg; case 50331648: return 16777215 & this.bg; default: return -1; } } hasExtendedAttrs() { return 268435456 & this.bg; } updateExtended() { this.extended.isEmpty() ? this.bg &= -268435457 : this.bg |= 268435456; } getUnderlineColor() { if (268435456 & this.bg && ~this.extended.underlineColor) switch (50331648 & this.extended.underlineColor) { case 16777216: case 33554432: return 255 & this.extended.underlineColor; case 50331648: return 16777215 & this.extended.underlineColor; default: return this.getFgColor(); } return this.getFgColor(); } getUnderlineColorMode() { return 268435456 & this.bg && ~this.extended.underlineColor ? 50331648 & this.extended.underlineColor : this.getFgColorMode(); } isUnderlineColorRGB() { return 268435456 & this.bg && ~this.extended.underlineColor ? (50331648 & this.extended.underlineColor) == 50331648 : this.isFgRGB(); } isUnderlineColorPalette() { return 268435456 & this.bg && ~this.extended.underlineColor ? (50331648 & this.extended.underlineColor) == 16777216 || (50331648 & this.extended.underlineColor) == 33554432 : this.isFgPalette(); } isUnderlineColorDefault() { return 268435456 & this.bg && ~this.extended.underlineColor ? (50331648 & this.extended.underlineColor) == 0 : this.isFgDefault(); } getUnderlineStyle() { return 268435456 & this.fg ? 268435456 & this.bg ? this.extended.underlineStyle : 1 : 0; } } __name(i2, "i"); t2.AttributeData = i2; class s2 { constructor(e3 = 0, t3 = 0) { this._ext = 0, this._urlId = 0, this._ext = e3, this._urlId = t3; } get ext() { return this._urlId ? -469762049 & this._ext | this.underlineStyle << 26 : this._ext; } set ext(e3) { this._ext = e3; } get underlineStyle() { return this._urlId ? 5 : (469762048 & this._ext) >> 26; } set underlineStyle(e3) { this._ext &= -469762049, this._ext |= e3 << 26 & 469762048; } get underlineColor() { return 67108863 & this._ext; } set underlineColor(e3) { this._ext &= -67108864, this._ext |= 67108863 & e3; } get urlId() { return this._urlId; } set urlId(e3) { this._urlId = e3; } clone() { return new s2(this._ext, this._urlId); } isEmpty() { return this.underlineStyle === 0 && this._urlId === 0; } } __name(s2, "s"); t2.ExtendedAttrs = s2; }, 9092: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.BufferStringIterator = t2.Buffer = t2.MAX_BUFFER_SIZE = void 0; const s2 = i2(6349), r = i2(8437), n = i2(511), o = i2(643), a = i2(4634), h = i2(4863), c = i2(7116), l = i2(3734); t2.MAX_BUFFER_SIZE = 4294967295, t2.Buffer = class { constructor(e3, t3, i3) { this._hasScrollback = e3, this._optionsService = t3, this._bufferService = i3, this.ydisp = 0, this.ybase = 0, this.y = 0, this.x = 0, this.savedY = 0, this.savedX = 0, this.savedCurAttrData = r.DEFAULT_ATTR_DATA.clone(), this.savedCharset = c.DEFAULT_CHARSET, this.markers = [], this._nullCell = n.CellData.fromCharData([0, o.NULL_CELL_CHAR, o.NULL_CELL_WIDTH, o.NULL_CELL_CODE]), this._whitespaceCell = n.CellData.fromCharData([0, o.WHITESPACE_CELL_CHAR, o.WHITESPACE_CELL_WIDTH, o.WHITESPACE_CELL_CODE]), this._isClearing = false, this._cols = this._bufferService.cols, this._rows = this._bufferService.rows, this.lines = new s2.CircularList(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops(); } getNullCell(e3) { return e3 ? (this._nullCell.fg = e3.fg, this._nullCell.bg = e3.bg, this._nullCell.extended = e3.extended) : (this._nullCell.fg = 0, this._nullCell.bg = 0, this._nullCell.extended = new l.ExtendedAttrs()), this._nullCell; } getWhitespaceCell(e3) { return e3 ? (this._whitespaceCell.fg = e3.fg, this._whitespaceCell.bg = e3.bg, this._whitespaceCell.extended = e3.extended) : (this._whitespaceCell.fg = 0, this._whitespaceCell.bg = 0, this._whitespaceCell.extended = new l.ExtendedAttrs()), this._whitespaceCell; } getBlankLine(e3, t3) { return new r.BufferLine(this._bufferService.cols, this.getNullCell(e3), t3); } get hasScrollback() { return this._hasScrollback && this.lines.maxLength > this._rows; } get isCursorInViewport() { const e3 = this.ybase + this.y - this.ydisp; return e3 >= 0 && e3 < this._rows; } _getCorrectBufferLength(e3) { if (!this._hasScrollback) return e3; const i3 = e3 + this._optionsService.rawOptions.scrollback; return i3 > t2.MAX_BUFFER_SIZE ? t2.MAX_BUFFER_SIZE : i3; } fillViewportRows(e3) { if (this.lines.length === 0) { e3 === void 0 && (e3 = r.DEFAULT_ATTR_DATA); let t3 = this._rows; for (; t3--; ) this.lines.push(this.getBlankLine(e3)); } } clear() { this.ydisp = 0, this.ybase = 0, this.y = 0, this.x = 0, this.lines = new s2.CircularList(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops(); } resize(e3, t3) { const i3 = this.getNullCell(r.DEFAULT_ATTR_DATA), s3 = this._getCorrectBufferLength(t3); if (s3 > this.lines.maxLength && (this.lines.maxLength = s3), this.lines.length > 0) { if (this._cols < e3) for (let t4 = 0; t4 < this.lines.length; t4++) this.lines.get(t4).resize(e3, i3); let n2 = 0; if (this._rows < t3) for (let s4 = this._rows; s4 < t3; s4++) this.lines.length < t3 + this.ybase && (this._optionsService.rawOptions.windowsMode ? this.lines.push(new r.BufferLine(e3, i3)) : this.ybase > 0 && this.lines.length <= this.ybase + this.y + n2 + 1 ? (this.ybase--, n2++, this.ydisp > 0 && this.ydisp--) : this.lines.push(new r.BufferLine(e3, i3))); else for (let e4 = this._rows; e4 > t3; e4--) this.lines.length > t3 + this.ybase && (this.lines.length > this.ybase + this.y + 1 ? this.lines.pop() : (this.ybase++, this.ydisp++)); if (s3 < this.lines.maxLength) { const e4 = this.lines.length - s3; e4 > 0 && (this.lines.trimStart(e4), this.ybase = Math.max(this.ybase - e4, 0), this.ydisp = Math.max(this.ydisp - e4, 0), this.savedY = Math.max(this.savedY - e4, 0)), this.lines.maxLength = s3; } this.x = Math.min(this.x, e3 - 1), this.y = Math.min(this.y, t3 - 1), n2 && (this.y += n2), this.savedX = Math.min(this.savedX, e3 - 1), this.scrollTop = 0; } if (this.scrollBottom = t3 - 1, this._isReflowEnabled && (this._reflow(e3, t3), this._cols > e3)) for (let t4 = 0; t4 < this.lines.length; t4++) this.lines.get(t4).resize(e3, i3); this._cols = e3, this._rows = t3; } get _isReflowEnabled() { return this._hasScrollback && !this._optionsService.rawOptions.windowsMode; } _reflow(e3, t3) { this._cols !== e3 && (e3 > this._cols ? this._reflowLarger(e3, t3) : this._reflowSmaller(e3, t3)); } _reflowLarger(e3, t3) { const i3 = (0, a.reflowLargerGetLinesToRemove)(this.lines, this._cols, e3, this.ybase + this.y, this.getNullCell(r.DEFAULT_ATTR_DATA)); if (i3.length > 0) { const s3 = (0, a.reflowLargerCreateNewLayout)(this.lines, i3); (0, a.reflowLargerApplyNewLayout)(this.lines, s3.layout), this._reflowLargerAdjustViewport(e3, t3, s3.countRemoved); } } _reflowLargerAdjustViewport(e3, t3, i3) { const s3 = this.getNullCell(r.DEFAULT_ATTR_DATA); let n2 = i3; for (; n2-- > 0; ) this.ybase === 0 ? (this.y > 0 && this.y--, this.lines.length < t3 && this.lines.push(new r.BufferLine(e3, s3))) : (this.ydisp === this.ybase && this.ydisp--, this.ybase--); this.savedY = Math.max(this.savedY - i3, 0); } _reflowSmaller(e3, t3) { const i3 = this.getNullCell(r.DEFAULT_ATTR_DATA), s3 = []; let n2 = 0; for (let o2 = this.lines.length - 1; o2 >= 0; o2--) { let h2 = this.lines.get(o2); if (!h2 || !h2.isWrapped && h2.getTrimmedLength() <= e3) continue; const c2 = [h2]; for (; h2.isWrapped && o2 > 0; ) h2 = this.lines.get(--o2), c2.unshift(h2); const l2 = this.ybase + this.y; if (l2 >= o2 && l2 < o2 + c2.length) continue; const d2 = c2[c2.length - 1].getTrimmedLength(), _ = (0, a.reflowSmallerGetNewLineLengths)(c2, this._cols, e3), u = _.length - c2.length; let f; f = this.ybase === 0 && this.y !== this.lines.length - 1 ? Math.max(0, this.y - this.lines.maxLength + u) : Math.max(0, this.lines.length - this.lines.maxLength + u); const v = []; for (let e4 = 0; e4 < u; e4++) { const e5 = this.getBlankLine(r.DEFAULT_ATTR_DATA, true); v.push(e5); } v.length > 0 && (s3.push({ start: o2 + c2.length + n2, newLines: v }), n2 += v.length), c2.push(...v); let g = _.length - 1, p = _[g]; p === 0 && (g--, p = _[g]); let S = c2.length - u - 1, m = d2; for (; S >= 0; ) { const e4 = Math.min(m, p); if (c2[g] === void 0) break; if (c2[g].copyCellsFrom(c2[S], m - e4, p - e4, e4, true), p -= e4, p === 0 && (g--, p = _[g]), m -= e4, m === 0) { S--; const e5 = Math.max(S, 0); m = (0, a.getWrappedLineTrimmedLength)(c2, e5, this._cols); } } for (let t4 = 0; t4 < c2.length; t4++) _[t4] < e3 && c2[t4].setCell(_[t4], i3); let C = u - f; for (; C-- > 0; ) this.ybase === 0 ? this.y < t3 - 1 ? (this.y++, this.lines.pop()) : (this.ybase++, this.ydisp++) : this.ybase < Math.min(this.lines.maxLength, this.lines.length + n2) - t3 && (this.ybase === this.ydisp && this.ydisp++, this.ybase++); this.savedY = Math.min(this.savedY + u, this.ybase + t3 - 1); } if (s3.length > 0) { const e4 = [], t4 = []; for (let e5 = 0; e5 < this.lines.length; e5++) t4.push(this.lines.get(e5)); const i4 = this.lines.length; let r2 = i4 - 1, o2 = 0, a2 = s3[o2]; this.lines.length = Math.min(this.lines.maxLength, this.lines.length + n2); let h2 = 0; for (let c3 = Math.min(this.lines.maxLength - 1, i4 + n2 - 1); c3 >= 0; c3--) if (a2 && a2.start > r2 + h2) { for (let e5 = a2.newLines.length - 1; e5 >= 0; e5--) this.lines.set(c3--, a2.newLines[e5]); c3++, e4.push({ index: r2 + 1, amount: a2.newLines.length }), h2 += a2.newLines.length, a2 = s3[++o2]; } else this.lines.set(c3, t4[r2--]); let c2 = 0; for (let t5 = e4.length - 1; t5 >= 0; t5--) e4[t5].index += c2, this.lines.onInsertEmitter.fire(e4[t5]), c2 += e4[t5].amount; const l2 = Math.max(0, i4 + n2 - this.lines.maxLength); l2 > 0 && this.lines.onTrimEmitter.fire(l2); } } stringIndexToBufferIndex(e3, t3, i3 = false) { for (; t3; ) { const s3 = this.lines.get(e3); if (!s3) return [-1, -1]; const r2 = i3 ? s3.getTrimmedLength() : s3.length; for (let i4 = 0; i4 < r2; ++i4) if (s3.get(i4)[o.CHAR_DATA_WIDTH_INDEX] && (t3 -= s3.get(i4)[o.CHAR_DATA_CHAR_INDEX].length || 1), t3 < 0) return [e3, i4]; e3++; } return [e3, 0]; } translateBufferLineToString(e3, t3, i3 = 0, s3) { const r2 = this.lines.get(e3); return r2 ? r2.translateToString(t3, i3, s3) : ""; } getWrappedRangeForLine(e3) { let t3 = e3, i3 = e3; for (; t3 > 0 && this.lines.get(t3).isWrapped; ) t3--; for (; i3 + 1 < this.lines.length && this.lines.get(i3 + 1).isWrapped; ) i3++; return { first: t3, last: i3 }; } setupTabStops(e3) { for (e3 != null ? this.tabs[e3] || (e3 = this.prevStop(e3)) : (this.tabs = {}, e3 = 0); e3 < this._cols; e3 += this._optionsService.rawOptions.tabStopWidth) this.tabs[e3] = true; } prevStop(e3) { for (e3 == null && (e3 = this.x); !this.tabs[--e3] && e3 > 0; ) ; return e3 >= this._cols ? this._cols - 1 : e3 < 0 ? 0 : e3; } nextStop(e3) { for (e3 == null && (e3 = this.x); !this.tabs[++e3] && e3 < this._cols; ) ; return e3 >= this._cols ? this._cols - 1 : e3 < 0 ? 0 : e3; } clearMarkers(e3) { this._isClearing = true; for (let t3 = 0; t3 < this.markers.length; t3++) this.markers[t3].line === e3 && (this.markers[t3].dispose(), this.markers.splice(t3--, 1)); this._isClearing = false; } clearAllMarkers() { this._isClearing = true; for (let e3 = 0; e3 < this.markers.length; e3++) this.markers[e3].dispose(), this.markers.splice(e3--, 1); this._isClearing = false; } addMarker(e3) { const t3 = new h.Marker(e3); return this.markers.push(t3), t3.register(this.lines.onTrim((e4) => { t3.line -= e4, t3.line < 0 && t3.dispose(); })), t3.register(this.lines.onInsert((e4) => { t3.line >= e4.index && (t3.line += e4.amount); })), t3.register(this.lines.onDelete((e4) => { t3.line >= e4.index && t3.line < e4.index + e4.amount && t3.dispose(), t3.line > e4.index && (t3.line -= e4.amount); })), t3.register(t3.onDispose(() => this._removeMarker(t3))), t3; } _removeMarker(e3) { this._isClearing || this.markers.splice(this.markers.indexOf(e3), 1); } iterator(e3, t3, i3, s3, r2) { return new d(this, e3, t3, i3, s3, r2); } }; class d { constructor(e3, t3, i3 = 0, s3 = e3.lines.length, r2 = 0, n2 = 0) { this._buffer = e3, this._trimRight = t3, this._startIndex = i3, this._endIndex = s3, this._startOverscan = r2, this._endOverscan = n2, this._startIndex < 0 && (this._startIndex = 0), this._endIndex > this._buffer.lines.length && (this._endIndex = this._buffer.lines.length), this._current = this._startIndex; } hasNext() { return this._current < this._endIndex; } next() { const e3 = this._buffer.getWrappedRangeForLine(this._current); e3.first < this._startIndex - this._startOverscan && (e3.first = this._startIndex - this._startOverscan), e3.last > this._endIndex + this._endOverscan && (e3.last = this._endIndex + this._endOverscan), e3.first = Math.max(e3.first, 0), e3.last = Math.min(e3.last, this._buffer.lines.length); let t3 = ""; for (let i3 = e3.first; i3 <= e3.last; ++i3) t3 += this._buffer.translateBufferLineToString(i3, this._trimRight); return this._current = e3.last + 1, { range: e3, content: t3 }; } } __name(d, "d"); t2.BufferStringIterator = d; }, 8437: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.BufferLine = t2.DEFAULT_ATTR_DATA = void 0; const s2 = i2(482), r = i2(643), n = i2(511), o = i2(3734); t2.DEFAULT_ATTR_DATA = Object.freeze(new o.AttributeData()); const a = { startIndex: 0 }; class h { constructor(e3, t3, i3 = false) { this.isWrapped = i3, this._combined = {}, this._extendedAttrs = {}, this._data = new Uint32Array(3 * e3); const s3 = t3 || n.CellData.fromCharData([0, r.NULL_CELL_CHAR, r.NULL_CELL_WIDTH, r.NULL_CELL_CODE]); for (let t4 = 0; t4 < e3; ++t4) this.setCell(t4, s3); this.length = e3; } get(e3) { const t3 = this._data[3 * e3 + 0], i3 = 2097151 & t3; return [this._data[3 * e3 + 1], 2097152 & t3 ? this._combined[e3] : i3 ? (0, s2.stringFromCodePoint)(i3) : "", t3 >> 22, 2097152 & t3 ? this._combined[e3].charCodeAt(this._combined[e3].length - 1) : i3]; } set(e3, t3) { this._data[3 * e3 + 1] = t3[r.CHAR_DATA_ATTR_INDEX], t3[r.CHAR_DATA_CHAR_INDEX].length > 1 ? (this._combined[e3] = t3[1], this._data[3 * e3 + 0] = 2097152 | e3 | t3[r.CHAR_DATA_WIDTH_INDEX] << 22) : this._data[3 * e3 + 0] = t3[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | t3[r.CHAR_DATA_WIDTH_INDEX] << 22; } getWidth(e3) { return this._data[3 * e3 + 0] >> 22; } hasWidth(e3) { return 12582912 & this._data[3 * e3 + 0]; } getFg(e3) { return this._data[3 * e3 + 1]; } getBg(e3) { return this._data[3 * e3 + 2]; } hasContent(e3) { return 4194303 & this._data[3 * e3 + 0]; } getCodePoint(e3) { const t3 = this._data[3 * e3 + 0]; return 2097152 & t3 ? this._combined[e3].charCodeAt(this._combined[e3].length - 1) : 2097151 & t3; } isCombined(e3) { return 2097152 & this._data[3 * e3 + 0]; } getString(e3) { const t3 = this._data[3 * e3 + 0]; return 2097152 & t3 ? this._combined[e3] : 2097151 & t3 ? (0, s2.stringFromCodePoint)(2097151 & t3) : ""; } isProtected(e3) { return 536870912 & this._data[3 * e3 + 2]; } loadCell(e3, t3) { return a.startIndex = 3 * e3, t3.content = this._data[a.startIndex + 0], t3.fg = this._data[a.startIndex + 1], t3.bg = this._data[a.startIndex + 2], 2097152 & t3.content && (t3.combinedData = this._combined[e3]), 268435456 & t3.bg && (t3.extended = this._extendedAttrs[e3]), t3; } setCell(e3, t3) { 2097152 & t3.content && (this._combined[e3] = t3.combinedData), 268435456 & t3.bg && (this._extendedAttrs[e3] = t3.extended), this._data[3 * e3 + 0] = t3.content, this._data[3 * e3 + 1] = t3.fg, this._data[3 * e3 + 2] = t3.bg; } setCellFromCodePoint(e3, t3, i3, s3, r2, n2) { 268435456 & r2 && (this._extendedAttrs[e3] = n2), this._data[3 * e3 + 0] = t3 | i3 << 22, this._data[3 * e3 + 1] = s3, this._data[3 * e3 + 2] = r2; } addCodepointToCell(e3, t3) { let i3 = this._data[3 * e3 + 0]; 2097152 & i3 ? this._combined[e3] += (0, s2.stringFromCodePoint)(t3) : (2097151 & i3 ? (this._combined[e3] = (0, s2.stringFromCodePoint)(2097151 & i3) + (0, s2.stringFromCodePoint)(t3), i3 &= -2097152, i3 |= 2097152) : i3 = t3 | 1 << 22, this._data[3 * e3 + 0] = i3); } insertCells(e3, t3, i3, s3) { if ((e3 %= this.length) && this.getWidth(e3 - 1) === 2 && this.setCellFromCodePoint(e3 - 1, 0, 1, (s3 == null ? void 0 : s3.fg) || 0, (s3 == null ? void 0 : s3.bg) || 0, (s3 == null ? void 0 : s3.extended) || new o.ExtendedAttrs()), t3 < this.length - e3) { const s4 = new n.CellData(); for (let i4 = this.length - e3 - t3 - 1; i4 >= 0; --i4) this.setCell(e3 + t3 + i4, this.loadCell(e3 + i4, s4)); for (let s5 = 0; s5 < t3; ++s5) this.setCell(e3 + s5, i3); } else for (let t4 = e3; t4 < this.length; ++t4) this.setCell(t4, i3); this.getWidth(this.length - 1) === 2 && this.setCellFromCodePoint(this.length - 1, 0, 1, (s3 == null ? void 0 : s3.fg) || 0, (s3 == null ? void 0 : s3.bg) || 0, (s3 == null ? void 0 : s3.extended) || new o.ExtendedAttrs()); } deleteCells(e3, t3, i3, s3) { if (e3 %= this.length, t3 < this.length - e3) { const s4 = new n.CellData(); for (let i4 = 0; i4 < this.length - e3 - t3; ++i4) this.setCell(e3 + i4, this.loadCell(e3 + t3 + i4, s4)); for (let e4 = this.length - t3; e4 < this.length; ++e4) this.setCell(e4, i3); } else for (let t4 = e3; t4 < this.length; ++t4) this.setCell(t4, i3); e3 && this.getWidth(e3 - 1) === 2 && this.setCellFromCodePoint(e3 - 1, 0, 1, (s3 == null ? void 0 : s3.fg) || 0, (s3 == null ? void 0 : s3.bg) || 0, (s3 == null ? void 0 : s3.extended) || new o.ExtendedAttrs()), this.getWidth(e3) !== 0 || this.hasContent(e3) || this.setCellFromCodePoint(e3, 0, 1, (s3 == null ? void 0 : s3.fg) || 0, (s3 == null ? void 0 : s3.bg) || 0, (s3 == null ? void 0 : s3.extended) || new o.ExtendedAttrs()); } replaceCells(e3, t3, i3, s3, r2 = false) { if (r2) for (e3 && this.getWidth(e3 - 1) === 2 && !this.isProtected(e3 - 1) && this.setCellFromCodePoint(e3 - 1, 0, 1, (s3 == null ? void 0 : s3.fg) || 0, (s3 == null ? void 0 : s3.bg) || 0, (s3 == null ? void 0 : s3.extended) || new o.ExtendedAttrs()), t3 < this.length && this.getWidth(t3 - 1) === 2 && !this.isProtected(t3) && this.setCellFromCodePoint(t3, 0, 1, (s3 == null ? void 0 : s3.fg) || 0, (s3 == null ? void 0 : s3.bg) || 0, (s3 == null ? void 0 : s3.extended) || new o.ExtendedAttrs()); e3 < t3 && e3 < this.length; ) this.isProtected(e3) || this.setCell(e3, i3), e3++; else for (e3 && this.getWidth(e3 - 1) === 2 && this.setCellFromCodePoint(e3 - 1, 0, 1, (s3 == null ? void 0 : s3.fg) || 0, (s3 == null ? void 0 : s3.bg) || 0, (s3 == null ? void 0 : s3.extended) || new o.ExtendedAttrs()), t3 < this.length && this.getWidth(t3 - 1) === 2 && this.setCellFromCodePoint(t3, 0, 1, (s3 == null ? void 0 : s3.fg) || 0, (s3 == null ? void 0 : s3.bg) || 0, (s3 == null ? void 0 : s3.extended) || new o.ExtendedAttrs()); e3 < t3 && e3 < this.length; ) this.setCell(e3++, i3); } resize(e3, t3) { if (e3 !== this.length) { if (e3 > this.length) { const i3 = new Uint32Array(3 * e3); this.length && (3 * e3 < this._data.length ? i3.set(this._data.subarray(0, 3 * e3)) : i3.set(this._data)), this._data = i3; for (let i4 = this.length; i4 < e3; ++i4) this.setCell(i4, t3); } else if (e3) { const t4 = new Uint32Array(3 * e3); t4.set(this._data.subarray(0, 3 * e3)), this._data = t4; const i3 = Object.keys(this._combined); for (let t5 = 0; t5 < i3.length; t5++) { const s3 = parseInt(i3[t5], 10); s3 >= e3 && delete this._combined[s3]; } } else this._data = new Uint32Array(0), this._combined = {}; this.length = e3; } } fill(e3, t3 = false) { if (t3) for (let t4 = 0; t4 < this.length; ++t4) this.isProtected(t4) || this.setCell(t4, e3); else { this._combined = {}, this._extendedAttrs = {}; for (let t4 = 0; t4 < this.length; ++t4) this.setCell(t4, e3); } } copyFrom(e3) { this.length !== e3.length ? this._data = new Uint32Array(e3._data) : this._data.set(e3._data), this.length = e3.length, this._combined = {}; for (const t3 in e3._combined) this._combined[t3] = e3._combined[t3]; this._extendedAttrs = {}; for (const t3 in e3._extendedAttrs) this._extendedAttrs[t3] = e3._extendedAttrs[t3]; this.isWrapped = e3.isWrapped; } clone() { const e3 = new h(0); e3._data = new Uint32Array(this._data), e3.length = this.length; for (const t3 in this._combined) e3._combined[t3] = this._combined[t3]; for (const t3 in this._extendedAttrs) e3._extendedAttrs[t3] = this._extendedAttrs[t3]; return e3.isWrapped = this.isWrapped, e3; } getTrimmedLength() { for (let e3 = this.length - 1; e3 >= 0; --e3) if (4194303 & this._data[3 * e3 + 0]) return e3 + (this._data[3 * e3 + 0] >> 22); return 0; } copyCellsFrom(e3, t3, i3, s3, r2) { const n2 = e3._data; if (r2) for (let r3 = s3 - 1; r3 >= 0; r3--) { for (let e4 = 0; e4 < 3; e4++) this._data[3 * (i3 + r3) + e4] = n2[3 * (t3 + r3) + e4]; 268435456 & n2[3 * (t3 + r3) + 2] && (this._extendedAttrs[i3 + r3] = e3._extendedAttrs[t3 + r3]); } else for (let r3 = 0; r3 < s3; r3++) { for (let e4 = 0; e4 < 3; e4++) this._data[3 * (i3 + r3) + e4] = n2[3 * (t3 + r3) + e4]; 268435456 & n2[3 * (t3 + r3) + 2] && (this._extendedAttrs[i3 + r3] = e3._extendedAttrs[t3 + r3]); } const o2 = Object.keys(e3._combined); for (let s4 = 0; s4 < o2.length; s4++) { const r3 = parseInt(o2[s4], 10); r3 >= t3 && (this._combined[r3 - t3 + i3] = e3._combined[r3]); } } translateToString(e3 = false, t3 = 0, i3 = this.length) { e3 && (i3 = Math.min(i3, this.getTrimmedLength())); let n2 = ""; for (; t3 < i3; ) { const e4 = this._data[3 * t3 + 0], i4 = 2097151 & e4; n2 += 2097152 & e4 ? this._combined[t3] : i4 ? (0, s2.stringFromCodePoint)(i4) : r.WHITESPACE_CELL_CHAR, t3 += e4 >> 22 || 1; } return n2; } } __name(h, "h"); t2.BufferLine = h; }, 4841: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.getRangeLength = void 0, t2.getRangeLength = function(e3, t3) { if (e3.start.y > e3.end.y) throw new Error(`Buffer range end (${e3.end.x}, ${e3.end.y}) cannot be before start (${e3.start.x}, ${e3.start.y})`); return t3 * (e3.end.y - e3.start.y) + (e3.end.x - e3.start.x + 1); }; }, 4634: (e2, t2) => { function i2(e3, t3, i3) { if (t3 === e3.length - 1) return e3[t3].getTrimmedLength(); const s2 = !e3[t3].hasContent(i3 - 1) && e3[t3].getWidth(i3 - 1) === 1, r = e3[t3 + 1].getWidth(0) === 2; return s2 && r ? i3 - 1 : i3; } __name(i2, "i"); Object.defineProperty(t2, "__esModule", { value: true }), t2.getWrappedLineTrimmedLength = t2.reflowSmallerGetNewLineLengths = t2.reflowLargerApplyNewLayout = t2.reflowLargerCreateNewLayout = t2.reflowLargerGetLinesToRemove = void 0, t2.reflowLargerGetLinesToRemove = function(e3, t3, s2, r, n) { const o = []; for (let a = 0; a < e3.length - 1; a++) { let h = a, c = e3.get(++h); if (!c.isWrapped) continue; const l = [e3.get(a)]; for (; h < e3.length && c.isWrapped; ) l.push(c), c = e3.get(++h); if (r >= a && r < h) { a += l.length - 1; continue; } let d = 0, _ = i2(l, d, t3), u = 1, f = 0; for (; u < l.length; ) { const e4 = i2(l, u, t3), r2 = e4 - f, o2 = s2 - _, a2 = Math.min(r2, o2); l[d].copyCellsFrom(l[u], f, _, a2, false), _ += a2, _ === s2 && (d++, _ = 0), f += a2, f === e4 && (u++, f = 0), _ === 0 && d !== 0 && l[d - 1].getWidth(s2 - 1) === 2 && (l[d].copyCellsFrom(l[d - 1], s2 - 1, _++, 1, false), l[d - 1].setCell(s2 - 1, n)); } l[d].replaceCells(_, s2, n); let v = 0; for (let e4 = l.length - 1; e4 > 0 && (e4 > d || l[e4].getTrimmedLength() === 0); e4--) v++; v > 0 && (o.push(a + l.length - v), o.push(v)), a += l.length - 1; } return o; }, t2.reflowLargerCreateNewLayout = function(e3, t3) { const i3 = []; let s2 = 0, r = t3[s2], n = 0; for (let o = 0; o < e3.length; o++) if (r === o) { const i4 = t3[++s2]; e3.onDeleteEmitter.fire({ index: o - n, amount: i4 }), o += i4 - 1, n += i4, r = t3[++s2]; } else i3.push(o); return { layout: i3, countRemoved: n }; }, t2.reflowLargerApplyNewLayout = function(e3, t3) { const i3 = []; for (let s2 = 0; s2 < t3.length; s2++) i3.push(e3.get(t3[s2])); for (let t4 = 0; t4 < i3.length; t4++) e3.set(t4, i3[t4]); e3.length = t3.length; }, t2.reflowSmallerGetNewLineLengths = function(e3, t3, s2) { const r = [], n = e3.map((s3, r2) => i2(e3, r2, t3)).reduce((e4, t4) => e4 + t4); let o = 0, a = 0, h = 0; for (; h < n; ) { if (n - h < s2) { r.push(n - h); break; } o += s2; const c = i2(e3, a, t3); o > c && (o -= c, a++); const l = e3[a].getWidth(o - 1) === 2; l && o--; const d = l ? s2 - 1 : s2; r.push(d), h += d; } return r; }, t2.getWrappedLineTrimmedLength = i2; }, 5295: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.BufferSet = void 0; const s2 = i2(9092), r = i2(8460), n = i2(844); class o extends n.Disposable { constructor(e3, t3) { super(), this._optionsService = e3, this._bufferService = t3, this._onBufferActivate = this.register(new r.EventEmitter()), this.reset(); } get onBufferActivate() { return this._onBufferActivate.event; } reset() { this._normal = new s2.Buffer(true, this._optionsService, this._bufferService), this._normal.fillViewportRows(), this._alt = new s2.Buffer(false, this._optionsService, this._bufferService), this._activeBuffer = this._normal, this._onBufferActivate.fire({ activeBuffer: this._normal, inactiveBuffer: this._alt }), this.setupTabStops(); } get alt() { return this._alt; } get active() { return this._activeBuffer; } get normal() { return this._normal; } activateNormalBuffer() { this._activeBuffer !== this._normal && (this._normal.x = this._alt.x, this._normal.y = this._alt.y, this._alt.clearAllMarkers(), this._alt.clear(), this._activeBuffer = this._normal, this._onBufferActivate.fire({ activeBuffer: this._normal, inactiveBuffer: this._alt })); } activateAltBuffer(e3) { this._activeBuffer !== this._alt && (this._alt.fillViewportRows(e3), this._alt.x = this._normal.x, this._alt.y = this._normal.y, this._activeBuffer = this._alt, this._onBufferActivate.fire({ activeBuffer: this._alt, inactiveBuffer: this._normal })); } resize(e3, t3) { this._normal.resize(e3, t3), this._alt.resize(e3, t3); } setupTabStops(e3) { this._normal.setupTabStops(e3), this._alt.setupTabStops(e3); } } __name(o, "o"); t2.BufferSet = o; }, 511: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.CellData = void 0; const s2 = i2(482), r = i2(643), n = i2(3734); class o extends n.AttributeData { constructor() { super(...arguments), this.content = 0, this.fg = 0, this.bg = 0, this.extended = new n.ExtendedAttrs(), this.combinedData = ""; } static fromCharData(e3) { const t3 = new o(); return t3.setFromCharData(e3), t3; } isCombined() { return 2097152 & this.content; } getWidth() { return this.content >> 22; } getChars() { return 2097152 & this.content ? this.combinedData : 2097151 & this.content ? (0, s2.stringFromCodePoint)(2097151 & this.content) : ""; } getCode() { return this.isCombined() ? this.combinedData.charCodeAt(this.combinedData.length - 1) : 2097151 & this.content; } setFromCharData(e3) { this.fg = e3[r.CHAR_DATA_ATTR_INDEX], this.bg = 0; let t3 = false; if (e3[r.CHAR_DATA_CHAR_INDEX].length > 2) t3 = true; else if (e3[r.CHAR_DATA_CHAR_INDEX].length === 2) { const i3 = e3[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0); if (55296 <= i3 && i3 <= 56319) { const s3 = e3[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1); 56320 <= s3 && s3 <= 57343 ? this.content = 1024 * (i3 - 55296) + s3 - 56320 + 65536 | e3[r.CHAR_DATA_WIDTH_INDEX] << 22 : t3 = true; } else t3 = true; } else this.content = e3[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | e3[r.CHAR_DATA_WIDTH_INDEX] << 22; t3 && (this.combinedData = e3[r.CHAR_DATA_CHAR_INDEX], this.content = 2097152 | e3[r.CHAR_DATA_WIDTH_INDEX] << 22); } getAsCharData() { return [this.fg, this.getChars(), this.getWidth(), this.getCode()]; } } __name(o, "o"); t2.CellData = o; }, 643: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.WHITESPACE_CELL_CODE = t2.WHITESPACE_CELL_WIDTH = t2.WHITESPACE_CELL_CHAR = t2.NULL_CELL_CODE = t2.NULL_CELL_WIDTH = t2.NULL_CELL_CHAR = t2.CHAR_DATA_CODE_INDEX = t2.CHAR_DATA_WIDTH_INDEX = t2.CHAR_DATA_CHAR_INDEX = t2.CHAR_DATA_ATTR_INDEX = t2.DEFAULT_EXT = t2.DEFAULT_ATTR = t2.DEFAULT_COLOR = void 0, t2.DEFAULT_COLOR = 256, t2.DEFAULT_ATTR = 256 | t2.DEFAULT_COLOR << 9, t2.DEFAULT_EXT = 0, t2.CHAR_DATA_ATTR_INDEX = 0, t2.CHAR_DATA_CHAR_INDEX = 1, t2.CHAR_DATA_WIDTH_INDEX = 2, t2.CHAR_DATA_CODE_INDEX = 3, t2.NULL_CELL_CHAR = "", t2.NULL_CELL_WIDTH = 1, t2.NULL_CELL_CODE = 0, t2.WHITESPACE_CELL_CHAR = " ", t2.WHITESPACE_CELL_WIDTH = 1, t2.WHITESPACE_CELL_CODE = 32; }, 4863: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.Marker = void 0; const s2 = i2(8460), r = i2(844); class n extends r.Disposable { constructor(e3) { super(), this.line = e3, this._id = n._nextId++, this.isDisposed = false, this._onDispose = new s2.EventEmitter(); } get id() { return this._id; } get onDispose() { return this._onDispose.event; } dispose() { this.isDisposed || (this.isDisposed = true, this.line = -1, this._onDispose.fire(), super.dispose()); } } __name(n, "n"); t2.Marker = n, n._nextId = 1; }, 7116: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.DEFAULT_CHARSET = t2.CHARSETS = void 0, t2.CHARSETS = {}, t2.DEFAULT_CHARSET = t2.CHARSETS.B, t2.CHARSETS[0] = { "`": "\u25C6", a: "\u2592", b: "\u2409", c: "\u240C", d: "\u240D", e: "\u240A", f: "\xB0", g: "\xB1", h: "\u2424", i: "\u240B", j: "\u2518", k: "\u2510", l: "\u250C", m: "\u2514", n: "\u253C", o: "\u23BA", p: "\u23BB", q: "\u2500", r: "\u23BC", s: "\u23BD", t: "\u251C", u: "\u2524", v: "\u2534", w: "\u252C", x: "\u2502", y: "\u2264", z: "\u2265", "{": "\u03C0", "|": "\u2260", "}": "\xA3", "~": "\xB7" }, t2.CHARSETS.A = { "#": "\xA3" }, t2.CHARSETS.B = void 0, t2.CHARSETS[4] = { "#": "\xA3", "@": "\xBE", "[": "ij", "\\": "\xBD", "]": "|", "{": "\xA8", "|": "f", "}": "\xBC", "~": "\xB4" }, t2.CHARSETS.C = t2.CHARSETS[5] = { "[": "\xC4", "\\": "\xD6", "]": "\xC5", "^": "\xDC", "`": "\xE9", "{": "\xE4", "|": "\xF6", "}": "\xE5", "~": "\xFC" }, t2.CHARSETS.R = { "#": "\xA3", "@": "\xE0", "[": "\xB0", "\\": "\xE7", "]": "\xA7", "{": "\xE9", "|": "\xF9", "}": "\xE8", "~": "\xA8" }, t2.CHARSETS.Q = { "@": "\xE0", "[": "\xE2", "\\": "\xE7", "]": "\xEA", "^": "\xEE", "`": "\xF4", "{": "\xE9", "|": "\xF9", "}": "\xE8", "~": "\xFB" }, t2.CHARSETS.K = { "@": "\xA7", "[": "\xC4", "\\": "\xD6", "]": "\xDC", "{": "\xE4", "|": "\xF6", "}": "\xFC", "~": "\xDF" }, t2.CHARSETS.Y = { "#": "\xA3", "@": "\xA7", "[": "\xB0", "\\": "\xE7", "]": "\xE9", "`": "\xF9", "{": "\xE0", "|": "\xF2", "}": "\xE8", "~": "\xEC" }, t2.CHARSETS.E = t2.CHARSETS[6] = { "@": "\xC4", "[": "\xC6", "\\": "\xD8", "]": "\xC5", "^": "\xDC", "`": "\xE4", "{": "\xE6", "|": "\xF8", "}": "\xE5", "~": "\xFC" }, t2.CHARSETS.Z = { "#": "\xA3", "@": "\xA7", "[": "\xA1", "\\": "\xD1", "]": "\xBF", "{": "\xB0", "|": "\xF1", "}": "\xE7" }, t2.CHARSETS.H = t2.CHARSETS[7] = { "@": "\xC9", "[": "\xC4", "\\": "\xD6", "]": "\xC5", "^": "\xDC", "`": "\xE9", "{": "\xE4", "|": "\xF6", "}": "\xE5", "~": "\xFC" }, t2.CHARSETS["="] = { "#": "\xF9", "@": "\xE0", "[": "\xE9", "\\": "\xE7", "]": "\xEA", "^": "\xEE", _: "\xE8", "`": "\xF4", "{": "\xE4", "|": "\xF6", "}": "\xFC", "~": "\xFB" }; }, 2584: (e2, t2) => { var i2, s2; Object.defineProperty(t2, "__esModule", { value: true }), t2.C1_ESCAPED = t2.C1 = t2.C0 = void 0, function(e3) { e3.NUL = "\0", e3.SOH = "", e3.STX = "", e3.ETX = "", e3.EOT = "", e3.ENQ = "", e3.ACK = "", e3.BEL = "\x07", e3.BS = "\b", e3.HT = " ", e3.LF = "\n", e3.VT = "\v", e3.FF = "\f", e3.CR = "\r", e3.SO = "", e3.SI = "", e3.DLE = "", e3.DC1 = "", e3.DC2 = "", e3.DC3 = "", e3.DC4 = "", e3.NAK = "", e3.SYN = "", e3.ETB = "", e3.CAN = "", e3.EM = "", e3.SUB = "", e3.ESC = "\x1B", e3.FS = "", e3.GS = "", e3.RS = "", e3.US = "", e3.SP = " ", e3.DEL = "\x7F"; }(i2 = t2.C0 || (t2.C0 = {})), (s2 = t2.C1 || (t2.C1 = {})).PAD = "\x80", s2.HOP = "\x81", s2.BPH = "\x82", s2.NBH = "\x83", s2.IND = "\x84", s2.NEL = "\x85", s2.SSA = "\x86", s2.ESA = "\x87", s2.HTS = "\x88", s2.HTJ = "\x89", s2.VTS = "\x8A", s2.PLD = "\x8B", s2.PLU = "\x8C", s2.RI = "\x8D", s2.SS2 = "\x8E", s2.SS3 = "\x8F", s2.DCS = "\x90", s2.PU1 = "\x91", s2.PU2 = "\x92", s2.STS = "\x93", s2.CCH = "\x94", s2.MW = "\x95", s2.SPA = "\x96", s2.EPA = "\x97", s2.SOS = "\x98", s2.SGCI = "\x99", s2.SCI = "\x9A", s2.CSI = "\x9B", s2.ST = "\x9C", s2.OSC = "\x9D", s2.PM = "\x9E", s2.APC = "\x9F", (t2.C1_ESCAPED || (t2.C1_ESCAPED = {})).ST = `${i2.ESC}\\`; }, 7399: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.evaluateKeyboardEvent = void 0; const s2 = i2(2584), r = { 48: ["0", ")"], 49: ["1", "!"], 50: ["2", "@"], 51: ["3", "#"], 52: ["4", "$"], 53: ["5", "%"], 54: ["6", "^"], 55: ["7", "&"], 56: ["8", "*"], 57: ["9", "("], 186: [";", ":"], 187: ["=", "+"], 188: [",", "<"], 189: ["-", "_"], 190: [".", ">"], 191: ["/", "?"], 192: ["`", "~"], 219: ["[", "{"], 220: ["\\", "|"], 221: ["]", "}"], 222: ["'", '"'] }; t2.evaluateKeyboardEvent = function(e3, t3, i3, n) { const o = { type: 0, cancel: false, key: void 0 }, a = (e3.shiftKey ? 1 : 0) | (e3.altKey ? 2 : 0) | (e3.ctrlKey ? 4 : 0) | (e3.metaKey ? 8 : 0); switch (e3.keyCode) { case 0: e3.key === "UIKeyInputUpArrow" ? o.key = t3 ? s2.C0.ESC + "OA" : s2.C0.ESC + "[A" : e3.key === "UIKeyInputLeftArrow" ? o.key = t3 ? s2.C0.ESC + "OD" : s2.C0.ESC + "[D" : e3.key === "UIKeyInputRightArrow" ? o.key = t3 ? s2.C0.ESC + "OC" : s2.C0.ESC + "[C" : e3.key === "UIKeyInputDownArrow" && (o.key = t3 ? s2.C0.ESC + "OB" : s2.C0.ESC + "[B"); break; case 8: if (e3.altKey) { o.key = s2.C0.ESC + s2.C0.DEL; break; } o.key = s2.C0.DEL; break; case 9: if (e3.shiftKey) { o.key = s2.C0.ESC + "[Z"; break; } o.key = s2.C0.HT, o.cancel = true; break; case 13: o.key = e3.altKey ? s2.C0.ESC + s2.C0.CR : s2.C0.CR, o.cancel = true; break; case 27: o.key = s2.C0.ESC, e3.altKey && (o.key = s2.C0.ESC + s2.C0.ESC), o.cancel = true; break; case 37: if (e3.metaKey) break; a ? (o.key = s2.C0.ESC + "[1;" + (a + 1) + "D", o.key === s2.C0.ESC + "[1;3D" && (o.key = s2.C0.ESC + (i3 ? "b" : "[1;5D"))) : o.key = t3 ? s2.C0.ESC + "OD" : s2.C0.ESC + "[D"; break; case 39: if (e3.metaKey) break; a ? (o.key = s2.C0.ESC + "[1;" + (a + 1) + "C", o.key === s2.C0.ESC + "[1;3C" && (o.key = s2.C0.ESC + (i3 ? "f" : "[1;5C"))) : o.key = t3 ? s2.C0.ESC + "OC" : s2.C0.ESC + "[C"; break; case 38: if (e3.metaKey) break; a ? (o.key = s2.C0.ESC + "[1;" + (a + 1) + "A", i3 || o.key !== s2.C0.ESC + "[1;3A" || (o.key = s2.C0.ESC + "[1;5A")) : o.key = t3 ? s2.C0.ESC + "OA" : s2.C0.ESC + "[A"; break; case 40: if (e3.metaKey) break; a ? (o.key = s2.C0.ESC + "[1;" + (a + 1) + "B", i3 || o.key !== s2.C0.ESC + "[1;3B" || (o.key = s2.C0.ESC + "[1;5B")) : o.key = t3 ? s2.C0.ESC + "OB" : s2.C0.ESC + "[B"; break; case 45: e3.shiftKey || e3.ctrlKey || (o.key = s2.C0.ESC + "[2~"); break; case 46: o.key = a ? s2.C0.ESC + "[3;" + (a + 1) + "~" : s2.C0.ESC + "[3~"; break; case 36: o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "H" : t3 ? s2.C0.ESC + "OH" : s2.C0.ESC + "[H"; break; case 35: o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "F" : t3 ? s2.C0.ESC + "OF" : s2.C0.ESC + "[F"; break; case 33: e3.shiftKey ? o.type = 2 : e3.ctrlKey ? o.key = s2.C0.ESC + "[5;" + (a + 1) + "~" : o.key = s2.C0.ESC + "[5~"; break; case 34: e3.shiftKey ? o.type = 3 : e3.ctrlKey ? o.key = s2.C0.ESC + "[6;" + (a + 1) + "~" : o.key = s2.C0.ESC + "[6~"; break; case 112: o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "P" : s2.C0.ESC + "OP"; break; case 113: o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "Q" : s2.C0.ESC + "OQ"; break; case 114: o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "R" : s2.C0.ESC + "OR"; break; case 115: o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "S" : s2.C0.ESC + "OS"; break; case 116: o.key = a ? s2.C0.ESC + "[15;" + (a + 1) + "~" : s2.C0.ESC + "[15~"; break; case 117: o.key = a ? s2.C0.ESC + "[17;" + (a + 1) + "~" : s2.C0.ESC + "[17~"; break; case 118: o.key = a ? s2.C0.ESC + "[18;" + (a + 1) + "~" : s2.C0.ESC + "[18~"; break; case 119: o.key = a ? s2.C0.ESC + "[19;" + (a + 1) + "~" : s2.C0.ESC + "[19~"; break; case 120: o.key = a ? s2.C0.ESC + "[20;" + (a + 1) + "~" : s2.C0.ESC + "[20~"; break; case 121: o.key = a ? s2.C0.ESC + "[21;" + (a + 1) + "~" : s2.C0.ESC + "[21~"; break; case 122: o.key = a ? s2.C0.ESC + "[23;" + (a + 1) + "~" : s2.C0.ESC + "[23~"; break; case 123: o.key = a ? s2.C0.ESC + "[24;" + (a + 1) + "~" : s2.C0.ESC + "[24~"; break; default: if (!e3.ctrlKey || e3.shiftKey || e3.altKey || e3.metaKey) if (i3 && !n || !e3.altKey || e3.metaKey) !i3 || e3.altKey || e3.ctrlKey || e3.shiftKey || !e3.metaKey ? e3.key && !e3.ctrlKey && !e3.altKey && !e3.metaKey && e3.keyCode >= 48 && e3.key.length === 1 ? o.key = e3.key : e3.key && e3.ctrlKey && (e3.key === "_" && (o.key = s2.C0.US), e3.key === "@" && (o.key = s2.C0.NUL)) : e3.keyCode === 65 && (o.type = 1); else { const t4 = r[e3.keyCode], i4 = t4 == null ? void 0 : t4[e3.shiftKey ? 1 : 0]; if (i4) o.key = s2.C0.ESC + i4; else if (e3.keyCode >= 65 && e3.keyCode <= 90) { const t5 = e3.ctrlKey ? e3.keyCode - 64 : e3.keyCode + 32; let i5 = String.fromCharCode(t5); e3.shiftKey && (i5 = i5.toUpperCase()), o.key = s2.C0.ESC + i5; } else if (e3.key === "Dead" && e3.code.startsWith("Key")) { let t5 = e3.code.slice(3, 4); e3.shiftKey || (t5 = t5.toLowerCase()), o.key = s2.C0.ESC + t5, o.cancel = true; } } else e3.keyCode >= 65 && e3.keyCode <= 90 ? o.key = String.fromCharCode(e3.keyCode - 64) : e3.keyCode === 32 ? o.key = s2.C0.NUL : e3.keyCode >= 51 && e3.keyCode <= 55 ? o.key = String.fromCharCode(e3.keyCode - 51 + 27) : e3.keyCode === 56 ? o.key = s2.C0.DEL : e3.keyCode === 219 ? o.key = s2.C0.ESC : e3.keyCode === 220 ? o.key = s2.C0.FS : e3.keyCode === 221 && (o.key = s2.C0.GS); } return o; }; }, 482: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.Utf8ToUtf32 = t2.StringToUtf32 = t2.utf32ToString = t2.stringFromCodePoint = void 0, t2.stringFromCodePoint = function(e3) { return e3 > 65535 ? (e3 -= 65536, String.fromCharCode(55296 + (e3 >> 10)) + String.fromCharCode(e3 % 1024 + 56320)) : String.fromCharCode(e3); }, t2.utf32ToString = function(e3, t3 = 0, i2 = e3.length) { let s2 = ""; for (let r = t3; r < i2; ++r) { let t4 = e3[r]; t4 > 65535 ? (t4 -= 65536, s2 += String.fromCharCode(55296 + (t4 >> 10)) + String.fromCharCode(t4 % 1024 + 56320)) : s2 += String.fromCharCode(t4); } return s2; }, t2.StringToUtf32 = class { constructor() { this._interim = 0; } clear() { this._interim = 0; } decode(e3, t3) { const i2 = e3.length; if (!i2) return 0; let s2 = 0, r = 0; if (this._interim) { const i3 = e3.charCodeAt(r++); 56320 <= i3 && i3 <= 57343 ? t3[s2++] = 1024 * (this._interim - 55296) + i3 - 56320 + 65536 : (t3[s2++] = this._interim, t3[s2++] = i3), this._interim = 0; } for (let n = r; n < i2; ++n) { const r2 = e3.charCodeAt(n); if (55296 <= r2 && r2 <= 56319) { if (++n >= i2) return this._interim = r2, s2; const o = e3.charCodeAt(n); 56320 <= o && o <= 57343 ? t3[s2++] = 1024 * (r2 - 55296) + o - 56320 + 65536 : (t3[s2++] = r2, t3[s2++] = o); } else r2 !== 65279 && (t3[s2++] = r2); } return s2; } }, t2.Utf8ToUtf32 = class { constructor() { this.interim = new Uint8Array(3); } clear() { this.interim.fill(0); } decode(e3, t3) { const i2 = e3.length; if (!i2) return 0; let s2, r, n, o, a = 0, h = 0, c = 0; if (this.interim[0]) { let s3 = false, r2 = this.interim[0]; r2 &= (224 & r2) == 192 ? 31 : (240 & r2) == 224 ? 15 : 7; let n2, o2 = 0; for (; (n2 = 63 & this.interim[++o2]) && o2 < 4; ) r2 <<= 6, r2 |= n2; const h2 = (224 & this.interim[0]) == 192 ? 2 : (240 & this.interim[0]) == 224 ? 3 : 4, l2 = h2 - o2; for (; c < l2; ) { if (c >= i2) return 0; if (n2 = e3[c++], (192 & n2) != 128) { c--, s3 = true; break; } this.interim[o2++] = n2, r2 <<= 6, r2 |= 63 & n2; } s3 || (h2 === 2 ? r2 < 128 ? c-- : t3[a++] = r2 : h2 === 3 ? r2 < 2048 || r2 >= 55296 && r2 <= 57343 || r2 === 65279 || (t3[a++] = r2) : r2 < 65536 || r2 > 1114111 || (t3[a++] = r2)), this.interim.fill(0); } const l = i2 - 4; let d = c; for (; d < i2; ) { for (; !(!(d < l) || 128 & (s2 = e3[d]) || 128 & (r = e3[d + 1]) || 128 & (n = e3[d + 2]) || 128 & (o = e3[d + 3])); ) t3[a++] = s2, t3[a++] = r, t3[a++] = n, t3[a++] = o, d += 4; if (s2 = e3[d++], s2 < 128) t3[a++] = s2; else if ((224 & s2) == 192) { if (d >= i2) return this.interim[0] = s2, a; if (r = e3[d++], (192 & r) != 128) { d--; continue; } if (h = (31 & s2) << 6 | 63 & r, h < 128) { d--; continue; } t3[a++] = h; } else if ((240 & s2) == 224) { if (d >= i2) return this.interim[0] = s2, a; if (r = e3[d++], (192 & r) != 128) { d--; continue; } if (d >= i2) return this.interim[0] = s2, this.interim[1] = r, a; if (n = e3[d++], (192 & n) != 128) { d--; continue; } if (h = (15 & s2) << 12 | (63 & r) << 6 | 63 & n, h < 2048 || h >= 55296 && h <= 57343 || h === 65279) continue; t3[a++] = h; } else if ((248 & s2) == 240) { if (d >= i2) return this.interim[0] = s2, a; if (r = e3[d++], (192 & r) != 128) { d--; continue; } if (d >= i2) return this.interim[0] = s2, this.interim[1] = r, a; if (n = e3[d++], (192 & n) != 128) { d--; continue; } if (d >= i2) return this.interim[0] = s2, this.interim[1] = r, this.interim[2] = n, a; if (o = e3[d++], (192 & o) != 128) { d--; continue; } if (h = (7 & s2) << 18 | (63 & r) << 12 | (63 & n) << 6 | 63 & o, h < 65536 || h > 1114111) continue; t3[a++] = h; } } return a; } }; }, 225: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.UnicodeV6 = void 0; const s2 = i2(8273), r = [[768, 879], [1155, 1158], [1160, 1161], [1425, 1469], [1471, 1471], [1473, 1474], [1476, 1477], [1479, 1479], [1536, 1539], [1552, 1557], [1611, 1630], [1648, 1648], [1750, 1764], [1767, 1768], [1770, 1773], [1807, 1807], [1809, 1809], [1840, 1866], [1958, 1968], [2027, 2035], [2305, 2306], [2364, 2364], [2369, 2376], [2381, 2381], [2385, 2388], [2402, 2403], [2433, 2433], [2492, 2492], [2497, 2500], [2509, 2509], [2530, 2531], [2561, 2562], [2620, 2620], [2625, 2626], [2631, 2632], [2635, 2637], [2672, 2673], [2689, 2690], [2748, 2748], [2753, 2757], [2759, 2760], [2765, 2765], [2786, 2787], [2817, 2817], [2876, 2876], [2879, 2879], [2881, 2883], [2893, 2893], [2902, 2902], [2946, 2946], [3008, 3008], [3021, 3021], [3134, 3136], [3142, 3144], [3146, 3149], [3157, 3158], [3260, 3260], [3263, 3263], [3270, 3270], [3276, 3277], [3298, 3299], [3393, 3395], [3405, 3405], [3530, 3530], [3538, 3540], [3542, 3542], [3633, 3633], [3636, 3642], [3655, 3662], [3761, 3761], [3764, 3769], [3771, 3772], [3784, 3789], [3864, 3865], [3893, 3893], [3895, 3895], [3897, 3897], [3953, 3966], [3968, 3972], [3974, 3975], [3984, 3991], [3993, 4028], [4038, 4038], [4141, 4144], [4146, 4146], [4150, 4151], [4153, 4153], [4184, 4185], [4448, 4607], [4959, 4959], [5906, 5908], [5938, 5940], [5970, 5971], [6002, 6003], [6068, 6069], [6071, 6077], [6086, 6086], [6089, 6099], [6109, 6109], [6155, 6157], [6313, 6313], [6432, 6434], [6439, 6440], [6450, 6450], [6457, 6459], [6679, 6680], [6912, 6915], [6964, 6964], [6966, 6970], [6972, 6972], [6978, 6978], [7019, 7027], [7616, 7626], [7678, 7679], [8203, 8207], [8234, 8238], [8288, 8291], [8298, 8303], [8400, 8431], [12330, 12335], [12441, 12442], [43014, 43014], [43019, 43019], [43045, 43046], [64286, 64286], [65024, 65039], [65056, 65059], [65279, 65279], [65529, 65531]], n = [[68097, 68099], [68101, 68102], [68108, 68111], [68152, 68154], [68159, 68159], [119143, 119145], [119155, 119170], [119173, 119179], [119210, 119213], [119362, 119364], [917505, 917505], [917536, 917631], [917760, 917999]]; let o; t2.UnicodeV6 = class { constructor() { if (this.version = "6", !o) { o = new Uint8Array(65536), (0, s2.fill)(o, 1), o[0] = 0, (0, s2.fill)(o, 0, 1, 32), (0, s2.fill)(o, 0, 127, 160), (0, s2.fill)(o, 2, 4352, 4448), o[9001] = 2, o[9002] = 2, (0, s2.fill)(o, 2, 11904, 42192), o[12351] = 1, (0, s2.fill)(o, 2, 44032, 55204), (0, s2.fill)(o, 2, 63744, 64256), (0, s2.fill)(o, 2, 65040, 65050), (0, s2.fill)(o, 2, 65072, 65136), (0, s2.fill)(o, 2, 65280, 65377), (0, s2.fill)(o, 2, 65504, 65511); for (let e3 = 0; e3 < r.length; ++e3) (0, s2.fill)(o, 0, r[e3][0], r[e3][1] + 1); } } wcwidth(e3) { return e3 < 32 ? 0 : e3 < 127 ? 1 : e3 < 65536 ? o[e3] : function(e4, t3) { let i3, s3 = 0, r2 = t3.length - 1; if (e4 < t3[0][0] || e4 > t3[r2][1]) return false; for (; r2 >= s3; ) if (i3 = s3 + r2 >> 1, e4 > t3[i3][1]) s3 = i3 + 1; else { if (!(e4 < t3[i3][0])) return true; r2 = i3 - 1; } return false; }(e3, n) ? 0 : e3 >= 131072 && e3 <= 196605 || e3 >= 196608 && e3 <= 262141 ? 2 : 1; } }; }, 5981: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.WriteBuffer = void 0; const s2 = i2(8460), r = typeof queueMicrotask == "undefined" ? (e3) => { Promise.resolve().then(e3); } : queueMicrotask; t2.WriteBuffer = class { constructor(e3) { this._action = e3, this._writeBuffer = [], this._callbacks = [], this._pendingData = 0, this._bufferOffset = 0, this._isSyncWriting = false, this._syncCalls = 0, this._onWriteParsed = new s2.EventEmitter(); } get onWriteParsed() { return this._onWriteParsed.event; } writeSync(e3, t3) { if (t3 !== void 0 && this._syncCalls > t3) return void (this._syncCalls = 0); if (this._pendingData += e3.length, this._writeBuffer.push(e3), this._callbacks.push(void 0), this._syncCalls++, this._isSyncWriting) return; let i3; for (this._isSyncWriting = true; i3 = this._writeBuffer.shift(); ) { this._action(i3); const e4 = this._callbacks.shift(); e4 && e4(); } this._pendingData = 0, this._bufferOffset = 2147483647, this._isSyncWriting = false, this._syncCalls = 0; } write(e3, t3) { if (this._pendingData > 5e7) throw new Error("write data discarded, use flow control to avoid losing data"); this._writeBuffer.length || (this._bufferOffset = 0, setTimeout(() => this._innerWrite())), this._pendingData += e3.length, this._writeBuffer.push(e3), this._callbacks.push(t3); } _innerWrite(e3 = 0, t3 = true) { const i3 = e3 || Date.now(); for (; this._writeBuffer.length > this._bufferOffset; ) { const e4 = this._writeBuffer[this._bufferOffset], s3 = this._action(e4, t3); if (s3) { const e5 = /* @__PURE__ */ __name((e6) => Date.now() - i3 >= 12 ? setTimeout(() => this._innerWrite(0, e6)) : this._innerWrite(i3, e6), "e"); return void s3.catch((e6) => (r(() => { throw e6; }), Promise.resolve(false))).then(e5); } const n = this._callbacks[this._bufferOffset]; if (n && n(), this._bufferOffset++, this._pendingData -= e4.length, Date.now() - i3 >= 12) break; } this._writeBuffer.length > this._bufferOffset ? (this._bufferOffset > 50 && (this._writeBuffer = this._writeBuffer.slice(this._bufferOffset), this._callbacks = this._callbacks.slice(this._bufferOffset), this._bufferOffset = 0), setTimeout(() => this._innerWrite())) : (this._writeBuffer.length = 0, this._callbacks.length = 0, this._pendingData = 0, this._bufferOffset = 0), this._onWriteParsed.fire(); } }; }, 5941: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.toRgbString = t2.parseColor = void 0; const i2 = /^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/, s2 = /^[\da-f]+$/; function r(e3, t3) { const i3 = e3.toString(16), s3 = i3.length < 2 ? "0" + i3 : i3; switch (t3) { case 4: return i3[0]; case 8: return s3; case 12: return (s3 + s3).slice(0, 3); default: return s3 + s3; } } __name(r, "r"); t2.parseColor = function(e3) { if (!e3) return; let t3 = e3.toLowerCase(); if (t3.indexOf("rgb:") === 0) { t3 = t3.slice(4); const e4 = i2.exec(t3); if (e4) { const t4 = e4[1] ? 15 : e4[4] ? 255 : e4[7] ? 4095 : 65535; return [Math.round(parseInt(e4[1] || e4[4] || e4[7] || e4[10], 16) / t4 * 255), Math.round(parseInt(e4[2] || e4[5] || e4[8] || e4[11], 16) / t4 * 255), Math.round(parseInt(e4[3] || e4[6] || e4[9] || e4[12], 16) / t4 * 255)]; } } else if (t3.indexOf("#") === 0 && (t3 = t3.slice(1), s2.exec(t3) && [3, 6, 9, 12].includes(t3.length))) { const e4 = t3.length / 3, i3 = [0, 0, 0]; for (let s3 = 0; s3 < 3; ++s3) { const r2 = parseInt(t3.slice(e4 * s3, e4 * s3 + e4), 16); i3[s3] = e4 === 1 ? r2 << 4 : e4 === 2 ? r2 : e4 === 3 ? r2 >> 4 : r2 >> 8; } return i3; } }, t2.toRgbString = function(e3, t3 = 16) { const [i3, s3, n] = e3; return `rgb:${r(i3, t3)}/${r(s3, t3)}/${r(n, t3)}`; }; }, 5770: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.PAYLOAD_LIMIT = void 0, t2.PAYLOAD_LIMIT = 1e7; }, 6351: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.DcsHandler = t2.DcsParser = void 0; const s2 = i2(482), r = i2(8742), n = i2(5770), o = []; t2.DcsParser = class { constructor() { this._handlers = /* @__PURE__ */ Object.create(null), this._active = o, this._ident = 0, this._handlerFb = () => { }, this._stack = { paused: false, loopPosition: 0, fallThrough: false }; } dispose() { this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => { }, this._active = o; } registerHandler(e3, t3) { this._handlers[e3] === void 0 && (this._handlers[e3] = []); const i3 = this._handlers[e3]; return i3.push(t3), { dispose: () => { const e4 = i3.indexOf(t3); e4 !== -1 && i3.splice(e4, 1); } }; } clearHandler(e3) { this._handlers[e3] && delete this._handlers[e3]; } setHandlerFallback(e3) { this._handlerFb = e3; } reset() { if (this._active.length) for (let e3 = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; e3 >= 0; --e3) this._active[e3].unhook(false); this._stack.paused = false, this._active = o, this._ident = 0; } hook(e3, t3) { if (this.reset(), this._ident = e3, this._active = this._handlers[e3] || o, this._active.length) for (let e4 = this._active.length - 1; e4 >= 0; e4--) this._active[e4].hook(t3); else this._handlerFb(this._ident, "HOOK", t3); } put(e3, t3, i3) { if (this._active.length) for (let s3 = this._active.length - 1; s3 >= 0; s3--) this._active[s3].put(e3, t3, i3); else this._handlerFb(this._ident, "PUT", (0, s2.utf32ToString)(e3, t3, i3)); } unhook(e3, t3 = true) { if (this._active.length) { let i3 = false, s3 = this._active.length - 1, r2 = false; if (this._stack.paused && (s3 = this._stack.loopPosition - 1, i3 = t3, r2 = this._stack.fallThrough, this._stack.paused = false), !r2 && i3 === false) { for (; s3 >= 0 && (i3 = this._active[s3].unhook(e3), i3 !== true); s3--) if (i3 instanceof Promise) return this._stack.paused = true, this._stack.loopPosition = s3, this._stack.fallThrough = false, i3; s3--; } for (; s3 >= 0; s3--) if (i3 = this._active[s3].unhook(false), i3 instanceof Promise) return this._stack.paused = true, this._stack.loopPosition = s3, this._stack.fallThrough = true, i3; } else this._handlerFb(this._ident, "UNHOOK", e3); this._active = o, this._ident = 0; } }; const a = new r.Params(); a.addParam(0), t2.DcsHandler = class { constructor(e3) { this._handler = e3, this._data = "", this._params = a, this._hitLimit = false; } hook(e3) { this._params = e3.length > 1 || e3.params[0] ? e3.clone() : a, this._data = "", this._hitLimit = false; } put(e3, t3, i3) { this._hitLimit || (this._data += (0, s2.utf32ToString)(e3, t3, i3), this._data.length > n.PAYLOAD_LIMIT && (this._data = "", this._hitLimit = true)); } unhook(e3) { let t3 = false; if (this._hitLimit) t3 = false; else if (e3 && (t3 = this._handler(this._data, this._params), t3 instanceof Promise)) return t3.then((e4) => (this._params = a, this._data = "", this._hitLimit = false, e4)); return this._params = a, this._data = "", this._hitLimit = false, t3; } }; }, 2015: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.EscapeSequenceParser = t2.VT500_TRANSITION_TABLE = t2.TransitionTable = void 0; const s2 = i2(844), r = i2(8273), n = i2(8742), o = i2(6242), a = i2(6351); class h { constructor(e3) { this.table = new Uint8Array(e3); } setDefault(e3, t3) { (0, r.fill)(this.table, e3 << 4 | t3); } add(e3, t3, i3, s3) { this.table[t3 << 8 | e3] = i3 << 4 | s3; } addMany(e3, t3, i3, s3) { for (let r2 = 0; r2 < e3.length; r2++) this.table[t3 << 8 | e3[r2]] = i3 << 4 | s3; } } __name(h, "h"); t2.TransitionTable = h; const c = 160; t2.VT500_TRANSITION_TABLE = function() { const e3 = new h(4095), t3 = Array.apply(null, Array(256)).map((e4, t4) => t4), i3 = /* @__PURE__ */ __name((e4, i4) => t3.slice(e4, i4), "i"), s3 = i3(32, 127), r2 = i3(0, 24); r2.push(25), r2.push.apply(r2, i3(28, 32)); const n2 = i3(0, 14); let o2; for (o2 in e3.setDefault(1, 0), e3.addMany(s3, 0, 2, 0), n2) e3.addMany([24, 26, 153, 154], o2, 3, 0), e3.addMany(i3(128, 144), o2, 3, 0), e3.addMany(i3(144, 152), o2, 3, 0), e3.add(156, o2, 0, 0), e3.add(27, o2, 11, 1), e3.add(157, o2, 4, 8), e3.addMany([152, 158, 159], o2, 0, 7), e3.add(155, o2, 11, 3), e3.add(144, o2, 11, 9); return e3.addMany(r2, 0, 3, 0), e3.addMany(r2, 1, 3, 1), e3.add(127, 1, 0, 1), e3.addMany(r2, 8, 0, 8), e3.addMany(r2, 3, 3, 3), e3.add(127, 3, 0, 3), e3.addMany(r2, 4, 3, 4), e3.add(127, 4, 0, 4), e3.addMany(r2, 6, 3, 6), e3.addMany(r2, 5, 3, 5), e3.add(127, 5, 0, 5), e3.addMany(r2, 2, 3, 2), e3.add(127, 2, 0, 2), e3.add(93, 1, 4, 8), e3.addMany(s3, 8, 5, 8), e3.add(127, 8, 5, 8), e3.addMany([156, 27, 24, 26, 7], 8, 6, 0), e3.addMany(i3(28, 32), 8, 0, 8), e3.addMany([88, 94, 95], 1, 0, 7), e3.addMany(s3, 7, 0, 7), e3.addMany(r2, 7, 0, 7), e3.add(156, 7, 0, 0), e3.add(127, 7, 0, 7), e3.add(91, 1, 11, 3), e3.addMany(i3(64, 127), 3, 7, 0), e3.addMany(i3(48, 60), 3, 8, 4), e3.addMany([60, 61, 62, 63], 3, 9, 4), e3.addMany(i3(48, 60), 4, 8, 4), e3.addMany(i3(64, 127), 4, 7, 0), e3.addMany([60, 61, 62, 63], 4, 0, 6), e3.addMany(i3(32, 64), 6, 0, 6), e3.add(127, 6, 0, 6), e3.addMany(i3(64, 127), 6, 0, 0), e3.addMany(i3(32, 48), 3, 9, 5), e3.addMany(i3(32, 48), 5, 9, 5), e3.addMany(i3(48, 64), 5, 0, 6), e3.addMany(i3(64, 127), 5, 7, 0), e3.addMany(i3(32, 48), 4, 9, 5), e3.addMany(i3(32, 48), 1, 9, 2), e3.addMany(i3(32, 48), 2, 9, 2), e3.addMany(i3(48, 127), 2, 10, 0), e3.addMany(i3(48, 80), 1, 10, 0), e3.addMany(i3(81, 88), 1, 10, 0), e3.addMany([89, 90, 92], 1, 10, 0), e3.addMany(i3(96, 127), 1, 10, 0), e3.add(80, 1, 11, 9), e3.addMany(r2, 9, 0, 9), e3.add(127, 9, 0, 9), e3.addMany(i3(28, 32), 9, 0, 9), e3.addMany(i3(32, 48), 9, 9, 12), e3.addMany(i3(48, 60), 9, 8, 10), e3.addMany([60, 61, 62, 63], 9, 9, 10), e3.addMany(r2, 11, 0, 11), e3.addMany(i3(32, 128), 11, 0, 11), e3.addMany(i3(28, 32), 11, 0, 11), e3.addMany(r2, 10, 0, 10), e3.add(127, 10, 0, 10), e3.addMany(i3(28, 32), 10, 0, 10), e3.addMany(i3(48, 60), 10, 8, 10), e3.addMany([60, 61, 62, 63], 10, 0, 11), e3.addMany(i3(32, 48), 10, 9, 12), e3.addMany(r2, 12, 0, 12), e3.add(127, 12, 0, 12), e3.addMany(i3(28, 32), 12, 0, 12), e3.addMany(i3(32, 48), 12, 9, 12), e3.addMany(i3(48, 64), 12, 0, 11), e3.addMany(i3(64, 127), 12, 12, 13), e3.addMany(i3(64, 127), 10, 12, 13), e3.addMany(i3(64, 127), 9, 12, 13), e3.addMany(r2, 13, 13, 13), e3.addMany(s3, 13, 13, 13), e3.add(127, 13, 0, 13), e3.addMany([27, 156, 24, 26], 13, 14, 0), e3.add(c, 0, 2, 0), e3.add(c, 8, 5, 8), e3.add(c, 6, 0, 6), e3.add(c, 11, 0, 11), e3.add(c, 13, 13, 13), e3; }(); class l extends s2.Disposable { constructor(e3 = t2.VT500_TRANSITION_TABLE) { super(), this._transitions = e3, this._parseStack = { state: 0, handlers: [], handlerPos: 0, transition: 0, chunkPos: 0 }, this.initialState = 0, this.currentState = this.initialState, this._params = new n.Params(), this._params.addParam(0), this._collect = 0, this.precedingCodepoint = 0, this._printHandlerFb = (e4, t3, i3) => { }, this._executeHandlerFb = (e4) => { }, this._csiHandlerFb = (e4, t3) => { }, this._escHandlerFb = (e4) => { }, this._errorHandlerFb = (e4) => e4, this._printHandler = this._printHandlerFb, this._executeHandlers = /* @__PURE__ */ Object.create(null), this._csiHandlers = /* @__PURE__ */ Object.create(null), this._escHandlers = /* @__PURE__ */ Object.create(null), this._oscParser = new o.OscParser(), this._dcsParser = new a.DcsParser(), this._errorHandler = this._errorHandlerFb, this.registerEscHandler({ final: "\\" }, () => true); } _identifier(e3, t3 = [64, 126]) { let i3 = 0; if (e3.prefix) { if (e3.prefix.length > 1) throw new Error("only one byte as prefix supported"); if (i3 = e3.prefix.charCodeAt(0), i3 && 60 > i3 || i3 > 63) throw new Error("prefix must be in range 0x3c .. 0x3f"); } if (e3.intermediates) { if (e3.intermediates.length > 2) throw new Error("only two bytes as intermediates are supported"); for (let t4 = 0; t4 < e3.intermediates.length; ++t4) { const s4 = e3.intermediates.charCodeAt(t4); if (32 > s4 || s4 > 47) throw new Error("intermediate must be in range 0x20 .. 0x2f"); i3 <<= 8, i3 |= s4; } } if (e3.final.length !== 1) throw new Error("final must be a single byte"); const s3 = e3.final.charCodeAt(0); if (t3[0] > s3 || s3 > t3[1]) throw new Error(`final must be in range ${t3[0]} .. ${t3[1]}`); return i3 <<= 8, i3 |= s3, i3; } identToString(e3) { const t3 = []; for (; e3; ) t3.push(String.fromCharCode(255 & e3)), e3 >>= 8; return t3.reverse().join(""); } dispose() { this._csiHandlers = /* @__PURE__ */ Object.create(null), this._executeHandlers = /* @__PURE__ */ Object.create(null), this._escHandlers = /* @__PURE__ */ Object.create(null), this._oscParser.dispose(), this._dcsParser.dispose(); } setPrintHandler(e3) { this._printHandler = e3; } clearPrintHandler() { this._printHandler = this._printHandlerFb; } registerEscHandler(e3, t3) { const i3 = this._identifier(e3, [48, 126]); this._escHandlers[i3] === void 0 && (this._escHandlers[i3] = []); const s3 = this._escHandlers[i3]; return s3.push(t3), { dispose: () => { const e4 = s3.indexOf(t3); e4 !== -1 && s3.splice(e4, 1); } }; } clearEscHandler(e3) { this._escHandlers[this._identifier(e3, [48, 126])] && delete this._escHandlers[this._identifier(e3, [48, 126])]; } setEscHandlerFallback(e3) { this._escHandlerFb = e3; } setExecuteHandler(e3, t3) { this._executeHandlers[e3.charCodeAt(0)] = t3; } clearExecuteHandler(e3) { this._executeHandlers[e3.charCodeAt(0)] && delete this._executeHandlers[e3.charCodeAt(0)]; } setExecuteHandlerFallback(e3) { this._executeHandlerFb = e3; } registerCsiHandler(e3, t3) { const i3 = this._identifier(e3); this._csiHandlers[i3] === void 0 && (this._csiHandlers[i3] = []); const s3 = this._csiHandlers[i3]; return s3.push(t3), { dispose: () => { const e4 = s3.indexOf(t3); e4 !== -1 && s3.splice(e4, 1); } }; } clearCsiHandler(e3) { this._csiHandlers[this._identifier(e3)] && delete this._csiHandlers[this._identifier(e3)]; } setCsiHandlerFallback(e3) { this._csiHandlerFb = e3; } registerDcsHandler(e3, t3) { return this._dcsParser.registerHandler(this._identifier(e3), t3); } clearDcsHandler(e3) { this._dcsParser.clearHandler(this._identifier(e3)); } setDcsHandlerFallback(e3) { this._dcsParser.setHandlerFallback(e3); } registerOscHandler(e3, t3) { return this._oscParser.registerHandler(e3, t3); } clearOscHandler(e3) { this._oscParser.clearHandler(e3); } setOscHandlerFallback(e3) { this._oscParser.setHandlerFallback(e3); } setErrorHandler(e3) { this._errorHandler = e3; } clearErrorHandler() { this._errorHandler = this._errorHandlerFb; } reset() { this.currentState = this.initialState, this._oscParser.reset(), this._dcsParser.reset(), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingCodepoint = 0, this._parseStack.state !== 0 && (this._parseStack.state = 2, this._parseStack.handlers = []); } _preserveStack(e3, t3, i3, s3, r2) { this._parseStack.state = e3, this._parseStack.handlers = t3, this._parseStack.handlerPos = i3, this._parseStack.transition = s3, this._parseStack.chunkPos = r2; } parse(e3, t3, i3) { let s3, r2 = 0, n2 = 0, o2 = 0; if (this._parseStack.state) if (this._parseStack.state === 2) this._parseStack.state = 0, o2 = this._parseStack.chunkPos + 1; else { if (i3 === void 0 || this._parseStack.state === 1) throw this._parseStack.state = 1, new Error("improper continuation due to previous async handler, giving up parsing"); const t4 = this._parseStack.handlers; let n3 = this._parseStack.handlerPos - 1; switch (this._parseStack.state) { case 3: if (i3 === false && n3 > -1) { for (; n3 >= 0 && (s3 = t4[n3](this._params), s3 !== true); n3--) if (s3 instanceof Promise) return this._parseStack.handlerPos = n3, s3; } this._parseStack.handlers = []; break; case 4: if (i3 === false && n3 > -1) { for (; n3 >= 0 && (s3 = t4[n3](), s3 !== true); n3--) if (s3 instanceof Promise) return this._parseStack.handlerPos = n3, s3; } this._parseStack.handlers = []; break; case 6: if (r2 = e3[this._parseStack.chunkPos], s3 = this._dcsParser.unhook(r2 !== 24 && r2 !== 26, i3), s3) return s3; r2 === 27 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0; break; case 5: if (r2 = e3[this._parseStack.chunkPos], s3 = this._oscParser.end(r2 !== 24 && r2 !== 26, i3), s3) return s3; r2 === 27 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0; } this._parseStack.state = 0, o2 = this._parseStack.chunkPos + 1, this.precedingCodepoint = 0, this.currentState = 15 & this._parseStack.transition; } for (let i4 = o2; i4 < t3; ++i4) { switch (r2 = e3[i4], n2 = this._transitions.table[this.currentState << 8 | (r2 < 160 ? r2 : c)], n2 >> 4) { case 2: for (let s4 = i4 + 1; ; ++s4) { if (s4 >= t3 || (r2 = e3[s4]) < 32 || r2 > 126 && r2 < c) { this._printHandler(e3, i4, s4), i4 = s4 - 1; break; } if (++s4 >= t3 || (r2 = e3[s4]) < 32 || r2 > 126 && r2 < c) { this._printHandler(e3, i4, s4), i4 = s4 - 1; break; } if (++s4 >= t3 || (r2 = e3[s4]) < 32 || r2 > 126 && r2 < c) { this._printHandler(e3, i4, s4), i4 = s4 - 1; break; } if (++s4 >= t3 || (r2 = e3[s4]) < 32 || r2 > 126 && r2 < c) { this._printHandler(e3, i4, s4), i4 = s4 - 1; break; } } break; case 3: this._executeHandlers[r2] ? this._executeHandlers[r2]() : this._executeHandlerFb(r2), this.precedingCodepoint = 0; break; case 0: break; case 1: if (this._errorHandler({ position: i4, code: r2, currentState: this.currentState, collect: this._collect, params: this._params, abort: false }).abort) return; break; case 7: const o3 = this._csiHandlers[this._collect << 8 | r2]; let a2 = o3 ? o3.length - 1 : -1; for (; a2 >= 0 && (s3 = o3[a2](this._params), s3 !== true); a2--) if (s3 instanceof Promise) return this._preserveStack(3, o3, a2, n2, i4), s3; a2 < 0 && this._csiHandlerFb(this._collect << 8 | r2, this._params), this.precedingCodepoint = 0; break; case 8: do { switch (r2) { case 59: this._params.addParam(0); break; case 58: this._params.addSubParam(-1); break; default: this._params.addDigit(r2 - 48); } } while (++i4 < t3 && (r2 = e3[i4]) > 47 && r2 < 60); i4--; break; case 9: this._collect <<= 8, this._collect |= r2; break; case 10: const h2 = this._escHandlers[this._collect << 8 | r2]; let l2 = h2 ? h2.length - 1 : -1; for (; l2 >= 0 && (s3 = h2[l2](), s3 !== true); l2--) if (s3 instanceof Promise) return this._preserveStack(4, h2, l2, n2, i4), s3; l2 < 0 && this._escHandlerFb(this._collect << 8 | r2), this.precedingCodepoint = 0; break; case 11: this._params.reset(), this._params.addParam(0), this._collect = 0; break; case 12: this._dcsParser.hook(this._collect << 8 | r2, this._params); break; case 13: for (let s4 = i4 + 1; ; ++s4) if (s4 >= t3 || (r2 = e3[s4]) === 24 || r2 === 26 || r2 === 27 || r2 > 127 && r2 < c) { this._dcsParser.put(e3, i4, s4), i4 = s4 - 1; break; } break; case 14: if (s3 = this._dcsParser.unhook(r2 !== 24 && r2 !== 26), s3) return this._preserveStack(6, [], 0, n2, i4), s3; r2 === 27 && (n2 |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingCodepoint = 0; break; case 4: this._oscParser.start(); break; case 5: for (let s4 = i4 + 1; ; s4++) if (s4 >= t3 || (r2 = e3[s4]) < 32 || r2 > 127 && r2 < c) { this._oscParser.put(e3, i4, s4), i4 = s4 - 1; break; } break; case 6: if (s3 = this._oscParser.end(r2 !== 24 && r2 !== 26), s3) return this._preserveStack(5, [], 0, n2, i4), s3; r2 === 27 && (n2 |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingCodepoint = 0; } this.currentState = 15 & n2; } } } __name(l, "l"); t2.EscapeSequenceParser = l; }, 6242: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.OscHandler = t2.OscParser = void 0; const s2 = i2(5770), r = i2(482), n = []; t2.OscParser = class { constructor() { this._state = 0, this._active = n, this._id = -1, this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => { }, this._stack = { paused: false, loopPosition: 0, fallThrough: false }; } registerHandler(e3, t3) { this._handlers[e3] === void 0 && (this._handlers[e3] = []); const i3 = this._handlers[e3]; return i3.push(t3), { dispose: () => { const e4 = i3.indexOf(t3); e4 !== -1 && i3.splice(e4, 1); } }; } clearHandler(e3) { this._handlers[e3] && delete this._handlers[e3]; } setHandlerFallback(e3) { this._handlerFb = e3; } dispose() { this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => { }, this._active = n; } reset() { if (this._state === 2) for (let e3 = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; e3 >= 0; --e3) this._active[e3].end(false); this._stack.paused = false, this._active = n, this._id = -1, this._state = 0; } _start() { if (this._active = this._handlers[this._id] || n, this._active.length) for (let e3 = this._active.length - 1; e3 >= 0; e3--) this._active[e3].start(); else this._handlerFb(this._id, "START"); } _put(e3, t3, i3) { if (this._active.length) for (let s3 = this._active.length - 1; s3 >= 0; s3--) this._active[s3].put(e3, t3, i3); else this._handlerFb(this._id, "PUT", (0, r.utf32ToString)(e3, t3, i3)); } start() { this.reset(), this._state = 1; } put(e3, t3, i3) { if (this._state !== 3) { if (this._state === 1) for (; t3 < i3; ) { const i4 = e3[t3++]; if (i4 === 59) { this._state = 2, this._start(); break; } if (i4 < 48 || 57 < i4) return void (this._state = 3); this._id === -1 && (this._id = 0), this._id = 10 * this._id + i4 - 48; } this._state === 2 && i3 - t3 > 0 && this._put(e3, t3, i3); } } end(e3, t3 = true) { if (this._state !== 0) { if (this._state !== 3) if (this._state === 1 && this._start(), this._active.length) { let i3 = false, s3 = this._active.length - 1, r2 = false; if (this._stack.paused && (s3 = this._stack.loopPosition - 1, i3 = t3, r2 = this._stack.fallThrough, this._stack.paused = false), !r2 && i3 === false) { for (; s3 >= 0 && (i3 = this._active[s3].end(e3), i3 !== true); s3--) if (i3 instanceof Promise) return this._stack.paused = true, this._stack.loopPosition = s3, this._stack.fallThrough = false, i3; s3--; } for (; s3 >= 0; s3--) if (i3 = this._active[s3].end(false), i3 instanceof Promise) return this._stack.paused = true, this._stack.loopPosition = s3, this._stack.fallThrough = true, i3; } else this._handlerFb(this._id, "END", e3); this._active = n, this._id = -1, this._state = 0; } } }, t2.OscHandler = class { constructor(e3) { this._handler = e3, this._data = "", this._hitLimit = false; } start() { this._data = "", this._hitLimit = false; } put(e3, t3, i3) { this._hitLimit || (this._data += (0, r.utf32ToString)(e3, t3, i3), this._data.length > s2.PAYLOAD_LIMIT && (this._data = "", this._hitLimit = true)); } end(e3) { let t3 = false; if (this._hitLimit) t3 = false; else if (e3 && (t3 = this._handler(this._data), t3 instanceof Promise)) return t3.then((e4) => (this._data = "", this._hitLimit = false, e4)); return this._data = "", this._hitLimit = false, t3; } }; }, 8742: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.Params = void 0; const i2 = 2147483647; class s2 { constructor(e3 = 32, t3 = 32) { if (this.maxLength = e3, this.maxSubParamsLength = t3, t3 > 256) throw new Error("maxSubParamsLength must not be greater than 256"); this.params = new Int32Array(e3), this.length = 0, this._subParams = new Int32Array(t3), this._subParamsLength = 0, this._subParamsIdx = new Uint16Array(e3), this._rejectDigits = false, this._rejectSubDigits = false, this._digitIsSub = false; } static fromArray(e3) { const t3 = new s2(); if (!e3.length) return t3; for (let i3 = Array.isArray(e3[0]) ? 1 : 0; i3 < e3.length; ++i3) { const s3 = e3[i3]; if (Array.isArray(s3)) for (let e4 = 0; e4 < s3.length; ++e4) t3.addSubParam(s3[e4]); else t3.addParam(s3); } return t3; } clone() { const e3 = new s2(this.maxLength, this.maxSubParamsLength); return e3.params.set(this.params), e3.length = this.length, e3._subParams.set(this._subParams), e3._subParamsLength = this._subParamsLength, e3._subParamsIdx.set(this._subParamsIdx), e3._rejectDigits = this._rejectDigits, e3._rejectSubDigits = this._rejectSubDigits, e3._digitIsSub = this._digitIsSub, e3; } toArray() { const e3 = []; for (let t3 = 0; t3 < this.length; ++t3) { e3.push(this.params[t3]); const i3 = this._subParamsIdx[t3] >> 8, s3 = 255 & this._subParamsIdx[t3]; s3 - i3 > 0 && e3.push(Array.prototype.slice.call(this._subParams, i3, s3)); } return e3; } reset() { this.length = 0, this._subParamsLength = 0, this._rejectDigits = false, this._rejectSubDigits = false, this._digitIsSub = false; } addParam(e3) { if (this._digitIsSub = false, this.length >= this.maxLength) this._rejectDigits = true; else { if (e3 < -1) throw new Error("values lesser than -1 are not allowed"); this._subParamsIdx[this.length] = this._subParamsLength << 8 | this._subParamsLength, this.params[this.length++] = e3 > i2 ? i2 : e3; } } addSubParam(e3) { if (this._digitIsSub = true, this.length) if (this._rejectDigits || this._subParamsLength >= this.maxSubParamsLength) this._rejectSubDigits = true; else { if (e3 < -1) throw new Error("values lesser than -1 are not allowed"); this._subParams[this._subParamsLength++] = e3 > i2 ? i2 : e3, this._subParamsIdx[this.length - 1]++; } } hasSubParams(e3) { return (255 & this._subParamsIdx[e3]) - (this._subParamsIdx[e3] >> 8) > 0; } getSubParams(e3) { const t3 = this._subParamsIdx[e3] >> 8, i3 = 255 & this._subParamsIdx[e3]; return i3 - t3 > 0 ? this._subParams.subarray(t3, i3) : null; } getSubParamsAll() { const e3 = {}; for (let t3 = 0; t3 < this.length; ++t3) { const i3 = this._subParamsIdx[t3] >> 8, s3 = 255 & this._subParamsIdx[t3]; s3 - i3 > 0 && (e3[t3] = this._subParams.slice(i3, s3)); } return e3; } addDigit(e3) { let t3; if (this._rejectDigits || !(t3 = this._digitIsSub ? this._subParamsLength : this.length) || this._digitIsSub && this._rejectSubDigits) return; const s3 = this._digitIsSub ? this._subParams : this.params, r = s3[t3 - 1]; s3[t3 - 1] = ~r ? Math.min(10 * r + e3, i2) : e3; } } __name(s2, "s"); t2.Params = s2; }, 5741: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.AddonManager = void 0, t2.AddonManager = class { constructor() { this._addons = []; } dispose() { for (let e3 = this._addons.length - 1; e3 >= 0; e3--) this._addons[e3].instance.dispose(); } loadAddon(e3, t3) { const i2 = { instance: t3, dispose: t3.dispose, isDisposed: false }; this._addons.push(i2), t3.dispose = () => this._wrappedAddonDispose(i2), t3.activate(e3); } _wrappedAddonDispose(e3) { if (e3.isDisposed) return; let t3 = -1; for (let i2 = 0; i2 < this._addons.length; i2++) if (this._addons[i2] === e3) { t3 = i2; break; } if (t3 === -1) throw new Error("Could not dispose an addon that has not been loaded"); e3.isDisposed = true, e3.dispose.apply(e3.instance), this._addons.splice(t3, 1); } }; }, 8771: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.BufferApiView = void 0; const s2 = i2(3785), r = i2(511); t2.BufferApiView = class { constructor(e3, t3) { this._buffer = e3, this.type = t3; } init(e3) { return this._buffer = e3, this; } get cursorY() { return this._buffer.y; } get cursorX() { return this._buffer.x; } get viewportY() { return this._buffer.ydisp; } get baseY() { return this._buffer.ybase; } get length() { return this._buffer.lines.length; } getLine(e3) { const t3 = this._buffer.lines.get(e3); if (t3) return new s2.BufferLineApiView(t3); } getNullCell() { return new r.CellData(); } }; }, 3785: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.BufferLineApiView = void 0; const s2 = i2(511); t2.BufferLineApiView = class { constructor(e3) { this._line = e3; } get isWrapped() { return this._line.isWrapped; } get length() { return this._line.length; } getCell(e3, t3) { if (!(e3 < 0 || e3 >= this._line.length)) return t3 ? (this._line.loadCell(e3, t3), t3) : this._line.loadCell(e3, new s2.CellData()); } translateToString(e3, t3, i3) { return this._line.translateToString(e3, t3, i3); } }; }, 8285: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.BufferNamespaceApi = void 0; const s2 = i2(8771), r = i2(8460); t2.BufferNamespaceApi = class { constructor(e3) { this._core = e3, this._onBufferChange = new r.EventEmitter(), this._normal = new s2.BufferApiView(this._core.buffers.normal, "normal"), this._alternate = new s2.BufferApiView(this._core.buffers.alt, "alternate"), this._core.buffers.onBufferActivate(() => this._onBufferChange.fire(this.active)); } get onBufferChange() { return this._onBufferChange.event; } get active() { if (this._core.buffers.active === this._core.buffers.normal) return this.normal; if (this._core.buffers.active === this._core.buffers.alt) return this.alternate; throw new Error("Active buffer is neither normal nor alternate"); } get normal() { return this._normal.init(this._core.buffers.normal); } get alternate() { return this._alternate.init(this._core.buffers.alt); } }; }, 7975: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.ParserApi = void 0, t2.ParserApi = class { constructor(e3) { this._core = e3; } registerCsiHandler(e3, t3) { return this._core.registerCsiHandler(e3, (e4) => t3(e4.toArray())); } addCsiHandler(e3, t3) { return this.registerCsiHandler(e3, t3); } registerDcsHandler(e3, t3) { return this._core.registerDcsHandler(e3, (e4, i2) => t3(e4, i2.toArray())); } addDcsHandler(e3, t3) { return this.registerDcsHandler(e3, t3); } registerEscHandler(e3, t3) { return this._core.registerEscHandler(e3, t3); } addEscHandler(e3, t3) { return this.registerEscHandler(e3, t3); } registerOscHandler(e3, t3) { return this._core.registerOscHandler(e3, t3); } addOscHandler(e3, t3) { return this.registerOscHandler(e3, t3); } }; }, 7090: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.UnicodeApi = void 0, t2.UnicodeApi = class { constructor(e3) { this._core = e3; } register(e3) { this._core.unicodeService.register(e3); } get versions() { return this._core.unicodeService.versions; } get activeVersion() { return this._core.unicodeService.activeVersion; } set activeVersion(e3) { this._core.unicodeService.activeVersion = e3; } }; }, 744: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.BufferService = t2.MINIMUM_ROWS = t2.MINIMUM_COLS = void 0; const n = i2(2585), o = i2(5295), a = i2(8460), h = i2(844); t2.MINIMUM_COLS = 2, t2.MINIMUM_ROWS = 1; let c = /* @__PURE__ */ __name(class extends h.Disposable { constructor(e3) { super(), this.isUserScrolling = false, this._onResize = new a.EventEmitter(), this._onScroll = new a.EventEmitter(), this.cols = Math.max(e3.rawOptions.cols || 0, t2.MINIMUM_COLS), this.rows = Math.max(e3.rawOptions.rows || 0, t2.MINIMUM_ROWS), this.buffers = new o.BufferSet(e3, this); } get onResize() { return this._onResize.event; } get onScroll() { return this._onScroll.event; } get buffer() { return this.buffers.active; } dispose() { super.dispose(), this.buffers.dispose(); } resize(e3, t3) { this.cols = e3, this.rows = t3, this.buffers.resize(e3, t3), this.buffers.setupTabStops(this.cols), this._onResize.fire({ cols: e3, rows: t3 }); } reset() { this.buffers.reset(), this.isUserScrolling = false; } scroll(e3, t3 = false) { const i3 = this.buffer; let s3; s3 = this._cachedBlankLine, s3 && s3.length === this.cols && s3.getFg(0) === e3.fg && s3.getBg(0) === e3.bg || (s3 = i3.getBlankLine(e3, t3), this._cachedBlankLine = s3), s3.isWrapped = t3; const r2 = i3.ybase + i3.scrollTop, n2 = i3.ybase + i3.scrollBottom; if (i3.scrollTop === 0) { const e4 = i3.lines.isFull; n2 === i3.lines.length - 1 ? e4 ? i3.lines.recycle().copyFrom(s3) : i3.lines.push(s3.clone()) : i3.lines.splice(n2 + 1, 0, s3.clone()), e4 ? this.isUserScrolling && (i3.ydisp = Math.max(i3.ydisp - 1, 0)) : (i3.ybase++, this.isUserScrolling || i3.ydisp++); } else { const e4 = n2 - r2 + 1; i3.lines.shiftElements(r2 + 1, e4 - 1, -1), i3.lines.set(n2, s3.clone()); } this.isUserScrolling || (i3.ydisp = i3.ybase), this._onScroll.fire(i3.ydisp); } scrollLines(e3, t3, i3) { const s3 = this.buffer; if (e3 < 0) { if (s3.ydisp === 0) return; this.isUserScrolling = true; } else e3 + s3.ydisp >= s3.ybase && (this.isUserScrolling = false); const r2 = s3.ydisp; s3.ydisp = Math.max(Math.min(s3.ydisp + e3, s3.ybase), 0), r2 !== s3.ydisp && (t3 || this._onScroll.fire(s3.ydisp)); } scrollPages(e3) { this.scrollLines(e3 * (this.rows - 1)); } scrollToTop() { this.scrollLines(-this.buffer.ydisp); } scrollToBottom() { this.scrollLines(this.buffer.ybase - this.buffer.ydisp); } scrollToLine(e3) { const t3 = e3 - this.buffer.ydisp; t3 !== 0 && this.scrollLines(t3); } }, "c"); c = s2([r(0, n.IOptionsService)], c), t2.BufferService = c; }, 7994: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.CharsetService = void 0, t2.CharsetService = class { constructor() { this.glevel = 0, this._charsets = []; } reset() { this.charset = void 0, this._charsets = [], this.glevel = 0; } setgLevel(e3) { this.glevel = e3, this.charset = this._charsets[e3]; } setgCharset(e3, t3) { this._charsets[e3] = t3, this.glevel === e3 && (this.charset = t3); } }; }, 1753: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.CoreMouseService = void 0; const n = i2(2585), o = i2(8460), a = { NONE: { events: 0, restrict: () => false }, X10: { events: 1, restrict: (e3) => e3.button !== 4 && e3.action === 1 && (e3.ctrl = false, e3.alt = false, e3.shift = false, true) }, VT200: { events: 19, restrict: (e3) => e3.action !== 32 }, DRAG: { events: 23, restrict: (e3) => e3.action !== 32 || e3.button !== 3 }, ANY: { events: 31, restrict: (e3) => true } }; function h(e3, t3) { let i3 = (e3.ctrl ? 16 : 0) | (e3.shift ? 4 : 0) | (e3.alt ? 8 : 0); return e3.button === 4 ? (i3 |= 64, i3 |= e3.action) : (i3 |= 3 & e3.button, 4 & e3.button && (i3 |= 64), 8 & e3.button && (i3 |= 128), e3.action === 32 ? i3 |= 32 : e3.action !== 0 || t3 || (i3 |= 3)), i3; } __name(h, "h"); const c = String.fromCharCode, l = { DEFAULT: (e3) => { const t3 = [h(e3, false) + 32, e3.col + 32, e3.row + 32]; return t3[0] > 255 || t3[1] > 255 || t3[2] > 255 ? "" : `\x1B[M${c(t3[0])}${c(t3[1])}${c(t3[2])}`; }, SGR: (e3) => { const t3 = e3.action === 0 && e3.button !== 4 ? "m" : "M"; return `\x1B[<${h(e3, true)};${e3.col};${e3.row}${t3}`; }, SGR_PIXELS: (e3) => { const t3 = e3.action === 0 && e3.button !== 4 ? "m" : "M"; return `\x1B[<${h(e3, true)};${e3.x};${e3.y}${t3}`; } }; let d = /* @__PURE__ */ __name(class { constructor(e3, t3) { this._bufferService = e3, this._coreService = t3, this._protocols = {}, this._encodings = {}, this._activeProtocol = "", this._activeEncoding = "", this._onProtocolChange = new o.EventEmitter(), this._lastEvent = null; for (const e4 of Object.keys(a)) this.addProtocol(e4, a[e4]); for (const e4 of Object.keys(l)) this.addEncoding(e4, l[e4]); this.reset(); } addProtocol(e3, t3) { this._protocols[e3] = t3; } addEncoding(e3, t3) { this._encodings[e3] = t3; } get activeProtocol() { return this._activeProtocol; } get areMouseEventsActive() { return this._protocols[this._activeProtocol].events !== 0; } set activeProtocol(e3) { if (!this._protocols[e3]) throw new Error(`unknown protocol "${e3}"`); this._activeProtocol = e3, this._onProtocolChange.fire(this._protocols[e3].events); } get activeEncoding() { return this._activeEncoding; } set activeEncoding(e3) { if (!this._encodings[e3]) throw new Error(`unknown encoding "${e3}"`); this._activeEncoding = e3; } reset() { this.activeProtocol = "NONE", this.activeEncoding = "DEFAULT", this._lastEvent = null; } get onProtocolChange() { return this._onProtocolChange.event; } triggerMouseEvent(e3) { if (e3.col < 0 || e3.col >= this._bufferService.cols || e3.row < 0 || e3.row >= this._bufferService.rows) return false; if (e3.button === 4 && e3.action === 32) return false; if (e3.button === 3 && e3.action !== 32) return false; if (e3.button !== 4 && (e3.action === 2 || e3.action === 3)) return false; if (e3.col++, e3.row++, e3.action === 32 && this._lastEvent && this._equalEvents(this._lastEvent, e3, this._activeEncoding === "SGR_PIXELS")) return false; if (!this._protocols[this._activeProtocol].restrict(e3)) return false; const t3 = this._encodings[this._activeEncoding](e3); return t3 && (this._activeEncoding === "DEFAULT" ? this._coreService.triggerBinaryEvent(t3) : this._coreService.triggerDataEvent(t3, true)), this._lastEvent = e3, true; } explainEvents(e3) { return { down: !!(1 & e3), up: !!(2 & e3), drag: !!(4 & e3), move: !!(8 & e3), wheel: !!(16 & e3) }; } _equalEvents(e3, t3, i3) { if (i3) { if (e3.x !== t3.x) return false; if (e3.y !== t3.y) return false; } else { if (e3.col !== t3.col) return false; if (e3.row !== t3.row) return false; } return e3.button === t3.button && e3.action === t3.action && e3.ctrl === t3.ctrl && e3.alt === t3.alt && e3.shift === t3.shift; } }, "d"); d = s2([r(0, n.IBufferService), r(1, n.ICoreService)], d), t2.CoreMouseService = d; }, 6975: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.CoreService = void 0; const n = i2(2585), o = i2(8460), a = i2(1439), h = i2(844), c = Object.freeze({ insertMode: false }), l = Object.freeze({ applicationCursorKeys: false, applicationKeypad: false, bracketedPasteMode: false, origin: false, reverseWraparound: false, sendFocus: false, wraparound: true }); let d = /* @__PURE__ */ __name(class extends h.Disposable { constructor(e3, t3, i3, s3) { super(), this._bufferService = t3, this._logService = i3, this._optionsService = s3, this.isCursorInitialized = false, this.isCursorHidden = false, this._onData = this.register(new o.EventEmitter()), this._onUserInput = this.register(new o.EventEmitter()), this._onBinary = this.register(new o.EventEmitter()), this._scrollToBottom = e3, this.register({ dispose: () => this._scrollToBottom = void 0 }), this.modes = (0, a.clone)(c), this.decPrivateModes = (0, a.clone)(l); } get onData() { return this._onData.event; } get onUserInput() { return this._onUserInput.event; } get onBinary() { return this._onBinary.event; } reset() { this.modes = (0, a.clone)(c), this.decPrivateModes = (0, a.clone)(l); } triggerDataEvent(e3, t3 = false) { if (this._optionsService.rawOptions.disableStdin) return; const i3 = this._bufferService.buffer; i3.ybase !== i3.ydisp && this._scrollToBottom(), t3 && this._onUserInput.fire(), this._logService.debug(`sending data "${e3}"`, () => e3.split("").map((e4) => e4.charCodeAt(0))), this._onData.fire(e3); } triggerBinaryEvent(e3) { this._optionsService.rawOptions.disableStdin || (this._logService.debug(`sending binary "${e3}"`, () => e3.split("").map((e4) => e4.charCodeAt(0))), this._onBinary.fire(e3)); } }, "d"); d = s2([r(1, n.IBufferService), r(2, n.ILogService), r(3, n.IOptionsService)], d), t2.CoreService = d; }, 9074: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.DecorationService = void 0; const s2 = i2(8055), r = i2(8460), n = i2(844), o = i2(6106), a = { xmin: 0, xmax: 0 }; class h extends n.Disposable { constructor() { super(...arguments), this._decorations = new o.SortedList((e3) => e3 == null ? void 0 : e3.marker.line), this._onDecorationRegistered = this.register(new r.EventEmitter()), this._onDecorationRemoved = this.register(new r.EventEmitter()); } get onDecorationRegistered() { return this._onDecorationRegistered.event; } get onDecorationRemoved() { return this._onDecorationRemoved.event; } get decorations() { return this._decorations.values(); } registerDecoration(e3) { if (e3.marker.isDisposed) return; const t3 = new c(e3); if (t3) { const e4 = t3.marker.onDispose(() => t3.dispose()); t3.onDispose(() => { t3 && (this._decorations.delete(t3) && this._onDecorationRemoved.fire(t3), e4.dispose()); }), this._decorations.insert(t3), this._onDecorationRegistered.fire(t3); } return t3; } reset() { for (const e3 of this._decorations.values()) e3.dispose(); this._decorations.clear(); } *getDecorationsAtCell(e3, t3, i3) { var s3, r2, n2; let o2 = 0, a2 = 0; for (const h2 of this._decorations.getKeyIterator(t3)) o2 = (s3 = h2.options.x) !== null && s3 !== void 0 ? s3 : 0, a2 = o2 + ((r2 = h2.options.width) !== null && r2 !== void 0 ? r2 : 1), e3 >= o2 && e3 < a2 && (!i3 || ((n2 = h2.options.layer) !== null && n2 !== void 0 ? n2 : "bottom") === i3) && (yield h2); } forEachDecorationAtCell(e3, t3, i3, s3) { this._decorations.forEachByKey(t3, (t4) => { var r2, n2, o2; a.xmin = (r2 = t4.options.x) !== null && r2 !== void 0 ? r2 : 0, a.xmax = a.xmin + ((n2 = t4.options.width) !== null && n2 !== void 0 ? n2 : 1), e3 >= a.xmin && e3 < a.xmax && (!i3 || ((o2 = t4.options.layer) !== null && o2 !== void 0 ? o2 : "bottom") === i3) && s3(t4); }); } dispose() { for (const e3 of this._decorations.values()) this._onDecorationRemoved.fire(e3); this.reset(); } } __name(h, "h"); t2.DecorationService = h; class c extends n.Disposable { constructor(e3) { super(), this.options = e3, this.isDisposed = false, this.onRenderEmitter = this.register(new r.EventEmitter()), this.onRender = this.onRenderEmitter.event, this._onDispose = this.register(new r.EventEmitter()), this.onDispose = this._onDispose.event, this._cachedBg = null, this._cachedFg = null, this.marker = e3.marker, this.options.overviewRulerOptions && !this.options.overviewRulerOptions.position && (this.options.overviewRulerOptions.position = "full"); } get backgroundColorRGB() { return this._cachedBg === null && (this.options.backgroundColor ? this._cachedBg = s2.css.toColor(this.options.backgroundColor) : this._cachedBg = void 0), this._cachedBg; } get foregroundColorRGB() { return this._cachedFg === null && (this.options.foregroundColor ? this._cachedFg = s2.css.toColor(this.options.foregroundColor) : this._cachedFg = void 0), this._cachedFg; } dispose() { this._isDisposed || (this._isDisposed = true, this._onDispose.fire(), super.dispose()); } } __name(c, "c"); }, 3730: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a = e3.length - 1; a >= 0; a--) (r2 = e3[a]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.DirtyRowService = void 0; const n = i2(2585); let o = /* @__PURE__ */ __name(class { constructor(e3) { this._bufferService = e3, this.clearRange(); } get start() { return this._start; } get end() { return this._end; } clearRange() { this._start = this._bufferService.buffer.y, this._end = this._bufferService.buffer.y; } markDirty(e3) { e3 < this._start ? this._start = e3 : e3 > this._end && (this._end = e3); } markRangeDirty(e3, t3) { if (e3 > t3) { const i3 = e3; e3 = t3, t3 = i3; } e3 < this._start && (this._start = e3), t3 > this._end && (this._end = t3); } markAllDirty() { this.markRangeDirty(0, this._bufferService.rows - 1); } }, "o"); o = s2([r(0, n.IBufferService)], o), t2.DirtyRowService = o; }, 4348: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.InstantiationService = t2.ServiceCollection = void 0; const s2 = i2(2585), r = i2(8343); class n { constructor(...e3) { this._entries = /* @__PURE__ */ new Map(); for (const [t3, i3] of e3) this.set(t3, i3); } set(e3, t3) { const i3 = this._entries.get(e3); return this._entries.set(e3, t3), i3; } forEach(e3) { this._entries.forEach((t3, i3) => e3(i3, t3)); } has(e3) { return this._entries.has(e3); } get(e3) { return this._entries.get(e3); } } __name(n, "n"); t2.ServiceCollection = n, t2.InstantiationService = class { constructor() { this._services = new n(), this._services.set(s2.IInstantiationService, this); } setService(e3, t3) { this._services.set(e3, t3); } getService(e3) { return this._services.get(e3); } createInstance(e3, ...t3) { const i3 = (0, r.getServiceDependencies)(e3).sort((e4, t4) => e4.index - t4.index), s3 = []; for (const t4 of i3) { const i4 = this._services.get(t4.id); if (!i4) throw new Error(`[createInstance] ${e3.name} depends on UNKNOWN service ${t4.id}.`); s3.push(i4); } const n2 = i3.length > 0 ? i3[0].index : t3.length; if (t3.length !== n2) throw new Error(`[createInstance] First service dependency of ${e3.name} at position ${n2 + 1} conflicts with ${t3.length} static arguments`); return new e3(...[...t3, ...s3]); } }; }, 7866: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.LogService = void 0; const n = i2(2585), o = { debug: n.LogLevelEnum.DEBUG, info: n.LogLevelEnum.INFO, warn: n.LogLevelEnum.WARN, error: n.LogLevelEnum.ERROR, off: n.LogLevelEnum.OFF }; let a = /* @__PURE__ */ __name(class { constructor(e3) { this._optionsService = e3, this.logLevel = n.LogLevelEnum.OFF, this._updateLogLevel(), this._optionsService.onOptionChange((e4) => { e4 === "logLevel" && this._updateLogLevel(); }); } _updateLogLevel() { this.logLevel = o[this._optionsService.rawOptions.logLevel]; } _evalLazyOptionalParams(e3) { for (let t3 = 0; t3 < e3.length; t3++) typeof e3[t3] == "function" && (e3[t3] = e3[t3]()); } _log(e3, t3, i3) { this._evalLazyOptionalParams(i3), e3.call(console, "xterm.js: " + t3, ...i3); } debug(e3, ...t3) { this.logLevel <= n.LogLevelEnum.DEBUG && this._log(console.log, e3, t3); } info(e3, ...t3) { this.logLevel <= n.LogLevelEnum.INFO && this._log(console.info, e3, t3); } warn(e3, ...t3) { this.logLevel <= n.LogLevelEnum.WARN && this._log(console.warn, e3, t3); } error(e3, ...t3) { this.logLevel <= n.LogLevelEnum.ERROR && this._log(console.error, e3, t3); } }, "a"); a = s2([r(0, n.IOptionsService)], a), t2.LogService = a; }, 7302: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.OptionsService = t2.DEFAULT_OPTIONS = void 0; const s2 = i2(8460), r = i2(6114); t2.DEFAULT_OPTIONS = { cols: 80, rows: 24, cursorBlink: false, cursorStyle: "block", cursorWidth: 1, customGlyphs: true, drawBoldTextInBrightColors: true, fastScrollModifier: "alt", fastScrollSensitivity: 5, fontFamily: "courier-new, courier, monospace", fontSize: 15, fontWeight: "normal", fontWeightBold: "bold", lineHeight: 1, letterSpacing: 0, linkHandler: null, logLevel: "info", scrollback: 1e3, scrollSensitivity: 1, screenReaderMode: false, smoothScrollDuration: 0, macOptionIsMeta: false, macOptionClickForcesSelection: false, minimumContrastRatio: 1, disableStdin: false, allowProposedApi: false, allowTransparency: false, tabStopWidth: 8, theme: {}, rightClickSelectsWord: r.isMac, windowOptions: {}, windowsMode: false, wordSeparator: " ()[]{}',\"`", altClickMovesCursor: true, convertEol: false, termName: "xterm", cancelEvents: false, overviewRulerWidth: 0 }; const n = ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"]; t2.OptionsService = class { constructor(e3) { this._onOptionChange = new s2.EventEmitter(); const i3 = Object.assign({}, t2.DEFAULT_OPTIONS); for (const t3 in e3) if (t3 in i3) try { const s3 = e3[t3]; i3[t3] = this._sanitizeAndValidateOption(t3, s3); } catch (e4) { console.error(e4); } this.rawOptions = i3, this.options = Object.assign({}, i3), this._setupOptions(); } get onOptionChange() { return this._onOptionChange.event; } _setupOptions() { const e3 = /* @__PURE__ */ __name((e4) => { if (!(e4 in t2.DEFAULT_OPTIONS)) throw new Error(`No option with key "${e4}"`); return this.rawOptions[e4]; }, "e"), i3 = /* @__PURE__ */ __name((e4, i4) => { if (!(e4 in t2.DEFAULT_OPTIONS)) throw new Error(`No option with key "${e4}"`); i4 = this._sanitizeAndValidateOption(e4, i4), this.rawOptions[e4] !== i4 && (this.rawOptions[e4] = i4, this._onOptionChange.fire(e4)); }, "i"); for (const t3 in this.rawOptions) { const s3 = { get: e3.bind(this, t3), set: i3.bind(this, t3) }; Object.defineProperty(this.options, t3, s3); } } _sanitizeAndValidateOption(e3, i3) { switch (e3) { case "cursorStyle": if (i3 || (i3 = t2.DEFAULT_OPTIONS[e3]), !function(e4) { return e4 === "block" || e4 === "underline" || e4 === "bar"; }(i3)) throw new Error(`"${i3}" is not a valid value for ${e3}`); break; case "wordSeparator": i3 || (i3 = t2.DEFAULT_OPTIONS[e3]); break; case "fontWeight": case "fontWeightBold": if (typeof i3 == "number" && 1 <= i3 && i3 <= 1e3) break; i3 = n.includes(i3) ? i3 : t2.DEFAULT_OPTIONS[e3]; break; case "cursorWidth": i3 = Math.floor(i3); case "lineHeight": case "tabStopWidth": if (i3 < 1) throw new Error(`${e3} cannot be less than 1, value: ${i3}`); break; case "minimumContrastRatio": i3 = Math.max(1, Math.min(21, Math.round(10 * i3) / 10)); break; case "scrollback": if ((i3 = Math.min(i3, 4294967295)) < 0) throw new Error(`${e3} cannot be less than 0, value: ${i3}`); break; case "fastScrollSensitivity": case "scrollSensitivity": if (i3 <= 0) throw new Error(`${e3} cannot be less than or equal to 0, value: ${i3}`); case "rows": case "cols": if (!i3 && i3 !== 0) throw new Error(`${e3} must be numeric, value: ${i3}`); } return i3; } }; }, 2660: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a = e3.length - 1; a >= 0; a--) (r2 = e3[a]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: true }), t2.OscLinkService = void 0; const n = i2(2585); let o = /* @__PURE__ */ __name(class { constructor(e3) { this._bufferService = e3, this._nextId = 1, this._entriesWithId = /* @__PURE__ */ new Map(), this._dataByLinkId = /* @__PURE__ */ new Map(); } registerLink(e3) { const t3 = this._bufferService.buffer; if (e3.id === void 0) { const i4 = t3.addMarker(t3.ybase + t3.y), s4 = { data: e3, id: this._nextId++, lines: [i4] }; return i4.onDispose(() => this._removeMarkerFromLink(s4, i4)), this._dataByLinkId.set(s4.id, s4), s4.id; } const i3 = e3, s3 = this._getEntryIdKey(i3), r2 = this._entriesWithId.get(s3); if (r2) return this.addLineToLink(r2.id, t3.ybase + t3.y), r2.id; const n2 = t3.addMarker(t3.ybase + t3.y), o2 = { id: this._nextId++, key: this._getEntryIdKey(i3), data: i3, lines: [n2] }; return n2.onDispose(() => this._removeMarkerFromLink(o2, n2)), this._entriesWithId.set(o2.key, o2), this._dataByLinkId.set(o2.id, o2), o2.id; } addLineToLink(e3, t3) { const i3 = this._dataByLinkId.get(e3); if (i3 && i3.lines.every((e4) => e4.line !== t3)) { const e4 = this._bufferService.buffer.addMarker(t3); i3.lines.push(e4), e4.onDispose(() => this._removeMarkerFromLink(i3, e4)); } } getLinkData(e3) { var t3; return (t3 = this._dataByLinkId.get(e3)) === null || t3 === void 0 ? void 0 : t3.data; } _getEntryIdKey(e3) { return `${e3.id};;${e3.uri}`; } _removeMarkerFromLink(e3, t3) { const i3 = e3.lines.indexOf(t3); i3 !== -1 && (e3.lines.splice(i3, 1), e3.lines.length === 0 && (e3.data.id !== void 0 && this._entriesWithId.delete(e3.key), this._dataByLinkId.delete(e3.id))); } }, "o"); o = s2([r(0, n.IBufferService)], o), t2.OscLinkService = o; }, 8343: (e2, t2) => { function i2(e3, t3, i3) { t3.di$target === t3 ? t3.di$dependencies.push({ id: e3, index: i3 }) : (t3.di$dependencies = [{ id: e3, index: i3 }], t3.di$target = t3); } __name(i2, "i"); Object.defineProperty(t2, "__esModule", { value: true }), t2.createDecorator = t2.getServiceDependencies = t2.serviceRegistry = void 0, t2.serviceRegistry = /* @__PURE__ */ new Map(), t2.getServiceDependencies = function(e3) { return e3.di$dependencies || []; }, t2.createDecorator = function(e3) { if (t2.serviceRegistry.has(e3)) return t2.serviceRegistry.get(e3); const s2 = /* @__PURE__ */ __name(function(e4, t3, r) { if (arguments.length !== 3) throw new Error("@IServiceName-decorator can only be used to decorate a parameter"); i2(s2, e4, r); }, "s"); return s2.toString = () => e3, t2.serviceRegistry.set(e3, s2), s2; }; }, 2585: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.IDecorationService = t2.IUnicodeService = t2.IOscLinkService = t2.IOptionsService = t2.ILogService = t2.LogLevelEnum = t2.IInstantiationService = t2.IDirtyRowService = t2.ICharsetService = t2.ICoreService = t2.ICoreMouseService = t2.IBufferService = void 0; const s2 = i2(8343); var r; t2.IBufferService = (0, s2.createDecorator)("BufferService"), t2.ICoreMouseService = (0, s2.createDecorator)("CoreMouseService"), t2.ICoreService = (0, s2.createDecorator)("CoreService"), t2.ICharsetService = (0, s2.createDecorator)("CharsetService"), t2.IDirtyRowService = (0, s2.createDecorator)("DirtyRowService"), t2.IInstantiationService = (0, s2.createDecorator)("InstantiationService"), (r = t2.LogLevelEnum || (t2.LogLevelEnum = {}))[r.DEBUG = 0] = "DEBUG", r[r.INFO = 1] = "INFO", r[r.WARN = 2] = "WARN", r[r.ERROR = 3] = "ERROR", r[r.OFF = 4] = "OFF", t2.ILogService = (0, s2.createDecorator)("LogService"), t2.IOptionsService = (0, s2.createDecorator)("OptionsService"), t2.IOscLinkService = (0, s2.createDecorator)("OscLinkService"), t2.IUnicodeService = (0, s2.createDecorator)("UnicodeService"), t2.IDecorationService = (0, s2.createDecorator)("DecorationService"); }, 1480: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: true }), t2.UnicodeService = void 0; const s2 = i2(8460), r = i2(225); t2.UnicodeService = class { constructor() { this._providers = /* @__PURE__ */ Object.create(null), this._active = "", this._onChange = new s2.EventEmitter(); const e3 = new r.UnicodeV6(); this.register(e3), this._active = e3.version, this._activeProvider = e3; } get onChange() { return this._onChange.event; } get versions() { return Object.keys(this._providers); } get activeVersion() { return this._active; } set activeVersion(e3) { if (!this._providers[e3]) throw new Error(`unknown Unicode version "${e3}"`); this._active = e3, this._activeProvider = this._providers[e3], this._onChange.fire(e3); } register(e3) { this._providers[e3.version] = e3; } wcwidth(e3) { return this._activeProvider.wcwidth(e3); } getStringCellWidth(e3) { let t3 = 0; const i3 = e3.length; for (let s3 = 0; s3 < i3; ++s3) { let r2 = e3.charCodeAt(s3); if (55296 <= r2 && r2 <= 56319) { if (++s3 >= i3) return t3 + this.wcwidth(r2); const n = e3.charCodeAt(s3); 56320 <= n && n <= 57343 ? r2 = 1024 * (r2 - 55296) + n - 56320 + 65536 : t3 += this.wcwidth(n); } t3 += this.wcwidth(r2); } return t3; } }; } }, t = {}; function i(s2) { var r = t[s2]; if (r !== void 0) return r.exports; var n = t[s2] = { exports: {} }; return e[s2].call(n.exports, n, n.exports, i), n.exports; } __name(i, "i"); var s = {}; return (() => { var e2 = s; Object.defineProperty(e2, "__esModule", { value: true }), e2.Terminal = void 0; const t2 = i(3236), r = i(9042), n = i(7975), o = i(7090), a = i(5741), h = i(8285), c = ["cols", "rows"]; e2.Terminal = class { constructor(e3) { this._core = new t2.Terminal(e3), this._addonManager = new a.AddonManager(), this._publicOptions = Object.assign({}, this._core.options); const i2 = /* @__PURE__ */ __name((e4) => this._core.options[e4], "i"), s2 = /* @__PURE__ */ __name((e4, t3) => { this._checkReadonlyOptions(e4), this._core.options[e4] = t3; }, "s"); for (const e4 in this._core.options) { const t3 = { get: i2.bind(this, e4), set: s2.bind(this, e4) }; Object.defineProperty(this._publicOptions, e4, t3); } } _checkReadonlyOptions(e3) { if (c.includes(e3)) throw new Error(`Option "${e3}" can only be set in the constructor`); } _checkProposedApi() { if (!this._core.optionsService.rawOptions.allowProposedApi) throw new Error("You must set the allowProposedApi option to true to use proposed API"); } get onBell() { return this._core.onBell; } get onBinary() { return this._core.onBinary; } get onCursorMove() { return this._core.onCursorMove; } get onData() { return this._core.onData; } get onKey() { return this._core.onKey; } get onLineFeed() { return this._core.onLineFeed; } get onRender() { return this._core.onRender; } get onResize() { return this._core.onResize; } get onScroll() { return this._core.onScroll; } get onSelectionChange() { return this._core.onSelectionChange; } get onTitleChange() { return this._core.onTitleChange; } get onWriteParsed() { return this._core.onWriteParsed; } get element() { return this._core.element; } get parser() { return this._checkProposedApi(), this._parser || (this._parser = new n.ParserApi(this._core)), this._parser; } get unicode() { return this._checkProposedApi(), new o.UnicodeApi(this._core); } get textarea() { return this._core.textarea; } get rows() { return this._core.rows; } get cols() { return this._core.cols; } get buffer() { return this._checkProposedApi(), this._buffer || (this._buffer = new h.BufferNamespaceApi(this._core)), this._buffer; } get markers() { return this._checkProposedApi(), this._core.markers; } get modes() { const e3 = this._core.coreService.decPrivateModes; let t3 = "none"; switch (this._core.coreMouseService.activeProtocol) { case "X10": t3 = "x10"; break; case "VT200": t3 = "vt200"; break; case "DRAG": t3 = "drag"; break; case "ANY": t3 = "any"; } return { applicationCursorKeysMode: e3.applicationCursorKeys, applicationKeypadMode: e3.applicationKeypad, bracketedPasteMode: e3.bracketedPasteMode, insertMode: this._core.coreService.modes.insertMode, mouseTrackingMode: t3, originMode: e3.origin, reverseWraparoundMode: e3.reverseWraparound, sendFocusMode: e3.sendFocus, wraparoundMode: e3.wraparound }; } get options() { return this._publicOptions; } set options(e3) { for (const t3 in e3) this._publicOptions[t3] = e3[t3]; } blur() { this._core.blur(); } focus() { this._core.focus(); } resize(e3, t3) { this._verifyIntegers(e3, t3), this._core.resize(e3, t3); } open(e3) { this._core.open(e3); } attachCustomKeyEventHandler(e3) { this._core.attachCustomKeyEventHandler(e3); } registerLinkProvider(e3) { return this._checkProposedApi(), this._core.registerLinkProvider(e3); } registerCharacterJoiner(e3) { return this._checkProposedApi(), this._core.registerCharacterJoiner(e3); } deregisterCharacterJoiner(e3) { this._checkProposedApi(), this._core.deregisterCharacterJoiner(e3); } registerMarker(e3 = 0) { return this._verifyIntegers(e3), this._core.addMarker(e3); } registerDecoration(e3) { var t3, i2, s2; return this._checkProposedApi(), this._verifyPositiveIntegers((t3 = e3.x) !== null && t3 !== void 0 ? t3 : 0, (i2 = e3.width) !== null && i2 !== void 0 ? i2 : 0, (s2 = e3.height) !== null && s2 !== void 0 ? s2 : 0), this._core.registerDecoration(e3); } hasSelection() { return this._core.hasSelection(); } select(e3, t3, i2) { this._verifyIntegers(e3, t3, i2), this._core.select(e3, t3, i2); } getSelection() { return this._core.getSelection(); } getSelectionPosition() { return this._core.getSelectionPosition(); } clearSelection() { this._core.clearSelection(); } selectAll() { this._core.selectAll(); } selectLines(e3, t3) { this._verifyIntegers(e3, t3), this._core.selectLines(e3, t3); } dispose() { this._addonManager.dispose(), this._core.dispose(); } scrollLines(e3) { this._verifyIntegers(e3), this._core.scrollLines(e3); } scrollPages(e3) { this._verifyIntegers(e3), this._core.scrollPages(e3); } scrollToTop() { this._core.scrollToTop(); } scrollToBottom() { this._core.scrollToBottom(); } scrollToLine(e3) { this._verifyIntegers(e3), this._core.scrollToLine(e3); } clear() { this._core.clear(); } write(e3, t3) { this._core.write(e3, t3); } writeln(e3, t3) { this._core.write(e3), this._core.write("\r\n", t3); } paste(e3) { this._core.paste(e3); } refresh(e3, t3) { this._verifyIntegers(e3, t3), this._core.refresh(e3, t3); } reset() { this._core.reset(); } clearTextureAtlas() { this._core.clearTextureAtlas(); } loadAddon(e3) { return this._addonManager.loadAddon(this, e3); } static get strings() { return r; } _verifyIntegers(...e3) { for (const t3 of e3) if (t3 === 1 / 0 || isNaN(t3) || t3 % 1 != 0) throw new Error("This API only accepts integers"); } _verifyPositiveIntegers(...e3) { for (const t3 of e3) if (t3 && (t3 === 1 / 0 || isNaN(t3) || t3 % 1 != 0 || t3 < 0)) throw new Error("This API only accepts positive integers"); } }; })(), s; })(); }); } }); // node_modules/xterm-addon-fit/lib/xterm-addon-fit.js var require_xterm_addon_fit = __commonJS({ "node_modules/xterm-addon-fit/lib/xterm-addon-fit.js"(exports, module2) { !function(e, t) { typeof exports == "object" && typeof module2 == "object" ? module2.exports = t() : typeof define == "function" && define.amd ? define([], t) : typeof exports == "object" ? exports.FitAddon = t() : e.FitAddon = t(); }(self, function() { return (() => { "use strict"; var e = {}; return (() => { var t = e; Object.defineProperty(t, "__esModule", { value: true }), t.FitAddon = void 0, t.FitAddon = class { constructor() { } activate(e2) { this._terminal = e2; } dispose() { } fit() { const e2 = this.proposeDimensions(); if (!e2 || !this._terminal || isNaN(e2.cols) || isNaN(e2.rows)) return; const t2 = this._terminal._core; this._terminal.rows === e2.rows && this._terminal.cols === e2.cols || (t2._renderService.clear(), this._terminal.resize(e2.cols, e2.rows)); } proposeDimensions() { if (!this._terminal) return; if (!this._terminal.element || !this._terminal.element.parentElement) return; const e2 = this._terminal._core; if (e2._renderService.dimensions.actualCellWidth === 0 || e2._renderService.dimensions.actualCellHeight === 0) return; const t2 = this._terminal.options.scrollback === 0 ? 0 : e2.viewport.scrollBarWidth, r = window.getComputedStyle(this._terminal.element.parentElement), i = parseInt(r.getPropertyValue("height")), n = Math.max(0, parseInt(r.getPropertyValue("width"))), o = window.getComputedStyle(this._terminal.element), s = i - (parseInt(o.getPropertyValue("padding-top")) + parseInt(o.getPropertyValue("padding-bottom"))), a = n - (parseInt(o.getPropertyValue("padding-right")) + parseInt(o.getPropertyValue("padding-left"))) - t2; return { cols: Math.max(2, Math.floor(a / e2._renderService.dimensions.actualCellWidth)), rows: Math.max(1, Math.floor(s / e2._renderService.dimensions.actualCellHeight)) }; } }; })(), e; })(); }); } }); // node_modules/sudo-prompt/index.js var require_sudo_prompt = __commonJS({ "node_modules/sudo-prompt/index.js"(exports, module2) { var Node = { child: require("child_process"), crypto: require("crypto"), fs: require("fs"), os: require("os"), path: require("path"), process, util: require("util") }; function Attempt(instance, end) { var platform4 = Node.process.platform; if (platform4 === "darwin") return Mac(instance, end); if (platform4 === "linux") return Linux(instance, end); if (platform4 === "win32") return Windows(instance, end); end(new Error("Platform not yet supported.")); } __name(Attempt, "Attempt"); function EscapeDoubleQuotes(string) { if (typeof string !== "string") throw new Error("Expected a string."); return string.replace(/"/g, '\\"'); } __name(EscapeDoubleQuotes, "EscapeDoubleQuotes"); function Exec() { if (arguments.length < 1 || arguments.length > 3) { throw new Error("Wrong number of arguments."); } var command = arguments[0]; var options = {}; var end = /* @__PURE__ */ __name(function() { }, "end"); if (typeof command !== "string") { throw new Error("Command should be a string."); } if (arguments.length === 2) { if (Node.util.isObject(arguments[1])) { options = arguments[1]; } else if (Node.util.isFunction(arguments[1])) { end = arguments[1]; } else { throw new Error("Expected options or callback."); } } else if (arguments.length === 3) { if (Node.util.isObject(arguments[1])) { options = arguments[1]; } else { throw new Error("Expected options to be an object."); } if (Node.util.isFunction(arguments[2])) { end = arguments[2]; } else { throw new Error("Expected callback to be a function."); } } if (/^sudo/i.test(command)) { return end(new Error('Command should not be prefixed with "sudo".')); } if (typeof options.name === "undefined") { var title = Node.process.title; if (ValidName(title)) { options.name = title; } else { return end(new Error("process.title cannot be used as a valid name.")); } } else if (!ValidName(options.name)) { var error = ""; error += "options.name must be alphanumeric only "; error += "(spaces are allowed) and <= 70 characters."; return end(new Error(error)); } if (typeof options.icns !== "undefined") { if (typeof options.icns !== "string") { return end(new Error("options.icns must be a string if provided.")); } else if (options.icns.trim().length === 0) { return end(new Error("options.icns must not be empty if provided.")); } } if (typeof options.env !== "undefined") { if (typeof options.env !== "object") { return end(new Error("options.env must be an object if provided.")); } else if (Object.keys(options.env).length === 0) { return end(new Error("options.env must not be empty if provided.")); } else { for (var key in options.env) { var value = options.env[key]; if (typeof key !== "string" || typeof value !== "string") { return end(new Error("options.env environment variables must be strings.")); } if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key)) { return end(new Error("options.env has an invalid environment variable name: " + JSON.stringify(key))); } if (/[\r\n]/.test(value)) { return end(new Error("options.env has an invalid environment variable value: " + JSON.stringify(value))); } } } } var platform4 = Node.process.platform; if (platform4 !== "darwin" && platform4 !== "linux" && platform4 !== "win32") { return end(new Error("Platform not yet supported.")); } var instance = { command, options, uuid: void 0, path: void 0 }; Attempt(instance, end); } __name(Exec, "Exec"); function Linux(instance, end) { LinuxBinary(instance, function(error, binary) { if (error) return end(error); var command = []; command.push('cd "' + EscapeDoubleQuotes(Node.process.cwd()) + '";'); for (var key in instance.options.env) { var value = instance.options.env[key]; command.push("export " + key + '="' + EscapeDoubleQuotes(value) + '";'); } command.push('"' + EscapeDoubleQuotes(binary) + '"'); if (/kdesudo/i.test(binary)) { command.push("--comment", '"' + instance.options.name + ' wants to make changes. Enter your password to allow this."'); command.push("-d"); command.push("--"); } else if (/pkexec/i.test(binary)) { command.push("--disable-internal-agent"); } var magic = "SUDOPROMPT\n"; command.push('/bin/bash -c "echo ' + EscapeDoubleQuotes(magic.trim()) + "; " + EscapeDoubleQuotes(instance.command) + '"'); command = command.join(" "); Node.child.exec(command, { encoding: "utf-8", maxBuffer: MAX_BUFFER }, function(error2, stdout, stderr) { var elevated = stdout && stdout.slice(0, magic.length) === magic; if (elevated) stdout = stdout.slice(magic.length); if (error2 && !elevated) { if (/No authentication agent found/.test(stderr)) { error2.message = NO_POLKIT_AGENT; } else { error2.message = PERMISSION_DENIED; } } end(error2, stdout, stderr); }); }); } __name(Linux, "Linux"); function LinuxBinary(instance, end) { var index2 = 0; var paths = ["/usr/bin/kdesudo", "/usr/bin/pkexec"]; function test2() { if (index2 === paths.length) { return end(new Error("Unable to find pkexec or kdesudo.")); } var path2 = paths[index2++]; Node.fs.stat(path2, function(error) { if (error) { if (error.code === "ENOTDIR") return test2(); if (error.code === "ENOENT") return test2(); end(error); } else { end(void 0, path2); } }); } __name(test2, "test"); test2(); } __name(LinuxBinary, "LinuxBinary"); function Mac(instance, callback) { var temp = Node.os.tmpdir(); if (!temp) return callback(new Error("os.tmpdir() not defined.")); var user = Node.process.env.USER; if (!user) return callback(new Error("env['USER'] not defined.")); UUID(instance, function(error, uuid) { if (error) return callback(error); instance.uuid = uuid; instance.path = Node.path.join(temp, instance.uuid, instance.options.name + ".app"); function end(error2, stdout, stderr) { Remove(Node.path.dirname(instance.path), function(errorRemove) { if (error2) return callback(error2); if (errorRemove) return callback(errorRemove); callback(void 0, stdout, stderr); }); } __name(end, "end"); MacApplet(instance, function(error2, stdout, stderr) { if (error2) return end(error2, stdout, stderr); MacIcon(instance, function(error3) { if (error3) return end(error3); MacPropertyList(instance, function(error4, stdout2, stderr2) { if (error4) return end(error4, stdout2, stderr2); MacCommand(instance, function(error5) { if (error5) return end(error5); MacOpen(instance, function(error6, stdout3, stderr3) { if (error6) return end(error6, stdout3, stderr3); MacResult(instance, end); }); }); }); }); }); }); } __name(Mac, "Mac"); function MacApplet(instance, end) { var parent2 = Node.path.dirname(instance.path); Node.fs.mkdir(parent2, function(error) { if (error) return end(error); var zip = Node.path.join(parent2, "sudo-prompt-applet.zip"); Node.fs.writeFile(zip, APPLET, "base64", function(error2) { if (error2) return end(error2); var command = []; command.push("/usr/bin/unzip"); command.push("-o"); command.push('"' + EscapeDoubleQuotes(zip) + '"'); command.push('-d "' + EscapeDoubleQuotes(instance.path) + '"'); command = command.join(" "); Node.child.exec(command, { encoding: "utf-8" }, end); }); }); } __name(MacApplet, "MacApplet"); function MacCommand(instance, end) { var path2 = Node.path.join(instance.path, "Contents", "MacOS", "sudo-prompt-command"); var script = []; script.push('cd "' + EscapeDoubleQuotes(Node.process.cwd()) + '"'); for (var key in instance.options.env) { var value = instance.options.env[key]; script.push("export " + key + '="' + EscapeDoubleQuotes(value) + '"'); } script.push(instance.command); script = script.join("\n"); Node.fs.writeFile(path2, script, "utf-8", end); } __name(MacCommand, "MacCommand"); function MacIcon(instance, end) { if (!instance.options.icns) return end(); Node.fs.readFile(instance.options.icns, function(error, buffer) { if (error) return end(error); var icns = Node.path.join(instance.path, "Contents", "Resources", "applet.icns"); Node.fs.writeFile(icns, buffer, end); }); } __name(MacIcon, "MacIcon"); function MacOpen(instance, end) { var binary = Node.path.join(instance.path, "Contents", "MacOS", "applet"); var options = { cwd: Node.path.dirname(binary), encoding: "utf-8" }; Node.child.exec("./" + Node.path.basename(binary), options, end); } __name(MacOpen, "MacOpen"); function MacPropertyList(instance, end) { var plist = Node.path.join(instance.path, "Contents", "Info.plist"); var path2 = EscapeDoubleQuotes(plist); var key = EscapeDoubleQuotes("CFBundleName"); var value = instance.options.name + " Password Prompt"; if (/'/.test(value)) { return end(new Error("Value should not contain single quotes.")); } var command = []; command.push("/usr/bin/defaults"); command.push("write"); command.push('"' + path2 + '"'); command.push('"' + key + '"'); command.push("'" + value + "'"); command = command.join(" "); Node.child.exec(command, { encoding: "utf-8" }, end); } __name(MacPropertyList, "MacPropertyList"); function MacResult(instance, end) { var cwd = Node.path.join(instance.path, "Contents", "MacOS"); Node.fs.readFile(Node.path.join(cwd, "code"), "utf-8", function(error, code) { if (error) { if (error.code === "ENOENT") return end(new Error(PERMISSION_DENIED)); end(error); } else { Node.fs.readFile(Node.path.join(cwd, "stdout"), "utf-8", function(error2, stdout) { if (error2) return end(error2); Node.fs.readFile(Node.path.join(cwd, "stderr"), "utf-8", function(error3, stderr) { if (error3) return end(error3); code = parseInt(code.trim(), 10); if (code === 0) { end(void 0, stdout, stderr); } else { error3 = new Error("Command failed: " + instance.command + "\n" + stderr); error3.code = code; end(error3, stdout, stderr); } }); }); } }); } __name(MacResult, "MacResult"); function Remove(path2, end) { if (typeof path2 !== "string" || !path2.trim()) { return end(new Error("Argument path not defined.")); } var command = []; if (Node.process.platform === "win32") { if (/"/.test(path2)) { return end(new Error("Argument path cannot contain double-quotes.")); } command.push('rmdir /s /q "' + path2 + '"'); } else { command.push("/bin/rm"); command.push("-rf"); command.push('"' + EscapeDoubleQuotes(Node.path.normalize(path2)) + '"'); } command = command.join(" "); Node.child.exec(command, { encoding: "utf-8" }, end); } __name(Remove, "Remove"); function UUID(instance, end) { Node.crypto.randomBytes(256, function(error, random) { if (error) random = Date.now() + "" + Math.random(); var hash = Node.crypto.createHash("SHA256"); hash.update("sudo-prompt-3"); hash.update(instance.options.name); hash.update(instance.command); hash.update(random); var uuid = hash.digest("hex").slice(-32); if (!uuid || typeof uuid !== "string" || uuid.length !== 32) { return end(new Error("Expected a valid UUID.")); } end(void 0, uuid); }); } __name(UUID, "UUID"); function ValidName(string) { if (!/^[a-z0-9 ]+$/i.test(string)) return false; if (string.trim().length === 0) return false; if (string.length > 70) return false; return true; } __name(ValidName, "ValidName"); function Windows(instance, callback) { var temp = Node.os.tmpdir(); if (!temp) return callback(new Error("os.tmpdir() not defined.")); UUID(instance, function(error, uuid) { if (error) return callback(error); instance.uuid = uuid; instance.path = Node.path.join(temp, instance.uuid); if (/"/.test(instance.path)) { return callback(new Error("instance.path cannot contain double-quotes.")); } instance.pathElevate = Node.path.join(instance.path, "elevate.vbs"); instance.pathExecute = Node.path.join(instance.path, "execute.bat"); instance.pathCommand = Node.path.join(instance.path, "command.bat"); instance.pathStdout = Node.path.join(instance.path, "stdout"); instance.pathStderr = Node.path.join(instance.path, "stderr"); instance.pathStatus = Node.path.join(instance.path, "status"); Node.fs.mkdir(instance.path, function(error2) { if (error2) return callback(error2); function end(error3, stdout, stderr) { Remove(instance.path, function(errorRemove) { if (error3) return callback(error3); if (errorRemove) return callback(errorRemove); callback(void 0, stdout, stderr); }); } __name(end, "end"); WindowsWriteExecuteScript(instance, function(error3) { if (error3) return end(error3); WindowsWriteCommandScript(instance, function(error4) { if (error4) return end(error4); WindowsElevate(instance, function(error5, stdout, stderr) { if (error5) return end(error5, stdout, stderr); WindowsWaitForStatus(instance, function(error6) { if (error6) return end(error6); WindowsResult(instance, end); }); }); }); }); }); }); } __name(Windows, "Windows"); function WindowsElevate(instance, end) { var command = []; command.push("powershell.exe"); command.push("Start-Process"); command.push("-FilePath"); command.push(`"'` + instance.pathExecute.replace(/'/g, "`'") + `'"`); command.push("-WindowStyle hidden"); command.push("-Verb runAs"); command = command.join(" "); var child = Node.child.exec(command, { encoding: "utf-8" }, function(error, stdout, stderr) { if (error) return end(new Error(PERMISSION_DENIED), stdout, stderr); end(); }); child.stdin.end(); } __name(WindowsElevate, "WindowsElevate"); function WindowsResult(instance, end) { Node.fs.readFile(instance.pathStatus, "utf-8", function(error, code) { if (error) return end(error); Node.fs.readFile(instance.pathStdout, "utf-8", function(error2, stdout) { if (error2) return end(error2); Node.fs.readFile(instance.pathStderr, "utf-8", function(error3, stderr) { if (error3) return end(error3); code = parseInt(code.trim(), 10); if (code === 0) { end(void 0, stdout, stderr); } else { error3 = new Error("Command failed: " + instance.command + "\r\n" + stderr); error3.code = code; end(error3, stdout, stderr); } }); }); }); } __name(WindowsResult, "WindowsResult"); function WindowsWaitForStatus(instance, end) { Node.fs.stat(instance.pathStatus, function(error, stats) { if (error && error.code === "ENOENT" || stats.size < 2) { setTimeout(function() { Node.fs.stat(instance.pathStdout, function(error2) { if (error2) return end(new Error(PERMISSION_DENIED)); WindowsWaitForStatus(instance, end); }); }, 1e3); } else if (error) { end(error); } else { end(); } }); } __name(WindowsWaitForStatus, "WindowsWaitForStatus"); function WindowsWriteCommandScript(instance, end) { var cwd = Node.process.cwd(); if (/"/.test(cwd)) { return end(new Error("process.cwd() cannot contain double-quotes.")); } var script = []; script.push("@echo off"); script.push("chcp 65001>nul"); script.push('cd /d "' + cwd + '"'); for (var key in instance.options.env) { var value = instance.options.env[key]; script.push("set " + key + "=" + value.replace(/([<>\\|&^])/g, "^$1")); } script.push(instance.command); script = script.join("\r\n"); Node.fs.writeFile(instance.pathCommand, script, "utf-8", end); } __name(WindowsWriteCommandScript, "WindowsWriteCommandScript"); function WindowsWriteExecuteScript(instance, end) { var script = []; script.push("@echo off"); script.push('call "' + instance.pathCommand + '" > "' + instance.pathStdout + '" 2> "' + instance.pathStderr + '"'); script.push('(echo %ERRORLEVEL%) > "' + instance.pathStatus + '"'); script = script.join("\r\n"); Node.fs.writeFile(instance.pathExecute, script, "utf-8", end); } __name(WindowsWriteExecuteScript, "WindowsWriteExecuteScript"); module2.exports.exec = Exec; var APPLET = "UEsDBAoAAAAAAO1YcEcAAAAAAAAAAAAAAAAJABwAQ29udGVudHMvVVQJAAPNnElWLZEQV3V4CwABBPUBAAAEFAAAAFBLAwQUAAAACACgeXBHlHaGqKEBAAC+AwAAEwAcAENvbnRlbnRzL0luZm8ucGxpc3RVVAkAA1zWSVYtkRBXdXgLAAEE9QEAAAQUAAAAfZNRb5swFIWfl1/BeA9OpSmqJkqVBCJFop1VyKQ9Ta59S6wa27NNCfv1M0naJWTsEXO+c8+9vo7v97UI3sBYruRdeBPNwgAkVYzL6i7cluvpbXifTOLP6bdV+QNngRbcugBvl/lmFYRThBZaC0AoLdMA55uiDLwHQtljGIQ75/RXhNq2jUiviqiqe6FF2CgNxnW5N5t6IGKOhb7M0f0ijj9lnLpk8il+hS5ZrZeNZAIWQqj2ge+B5YoSwX8T5xEbo17ktc40gIZQCm8glK5BuieovP5Dbp3xHSeZrHyCXYxO3wM+2wNtHHkWMAQP/bkxbkOVXPMxKuK0Dz6CMh+Wv3AwQ9gPM7INU1NtVK3Ha8sXlfoB+m6J6b4fRzv0mkezMf6R1Fe5MbG2VYYF+L+lMaGvpIKy01cOC4zzMazYKeNOQYuDYkjfjMcteCWJa8w/Zi2ugubFA5e8buqisw7qU81ltzB0xx3QC5/TFh7J/e385/zL+7+/wWbR/LwIOl/dvHiCXw03YFfEPJ9dwsWu5sV2kwnod3QoeLeL0eGdJJM/UEsDBAoAAAAAAHSBjkgAAAAAAAAAAAAAAAAPABwAQ29udGVudHMvTWFjT1MvVVQJAAMbpQ9XLZEQV3V4CwABBPUBAAAEFAAAAFBLAwQUAAAACABVHBdH7Dk4KTIIAADIYQAAFQAcAENvbnRlbnRzL01hY09TL2FwcGxldFVUCQADMiPZVVOlD1d1eAsAAQT1AQAABBQAAADtnG9sHEcVwGfti7M1/rONLNVtXHqpzsipis+pHOSWFOzEm25at3XrJI2ozbK+W/suuds79vaSuCKSpaOIxRy1+NSPRPAhlWj7AVRaQCWpTRz+CEo+RSKCCho4K67kVhUyAeV4b3fWt17fXZqKFgHvp8zO3/dmdmfPmtl5L7+8/uPXGWMNELZCaGRMgmjHIlxaBCibdcoGsewCljGCIAiCIAiCIAiCIP7r+M21d67zjb/zEaAdwr1bGHuWMQH2/2wAgqqODj0kf0F+8nGfoFRbJ8p9U0C5g/KRgwEZqZLGfrfwwJx+LP2kVWkelD9zJ2NfBr1nWt2xrhNisxWZ3Ex6MpNSc1Z+soqOO+5i7JMYt7vj9BC5jiZXBwirCT2V1c0qOgZAxwMYt9cbRyxnmUljusa9mKBjGON2tgG/PlXNGyeSRlxNGlOZKjpeBR0KxsFx+MB7VJy5GB46OOSrCLPKfEjrH3/gFry+4zOpuH8sm+VF5srW6ltVjZQ3HVnL3KRDDLsflMSADpyDyjuR0urp6AAdHRgHdOD9iOs6Ypl0OmPUupeecOW19OsQAmn3tzBy4LFH5OED3jz0MbYouM8D460BOdTXCaEF6tsgLkF8GeJPQBj16Rb4PTf5xl2NH4J8a5Vy1N3F3OcZzefMaCo5GeVTuJ2P4cUf/aH5qbbP73/utpfeevdbLzwfYfy+Q80woGan/1E+ljo/703g77IaOJY479t5rqFLDag9OjaTs/R0dCQ5aWrmTHS/qaX1ExnzWC66L2PqY7p5PBnTc71TXnn0sG7mkhkjFx3a0IL30e/rQxB+EXL68J4BBLe73r298DySk5tlGPtJY1BmOhZTc727PBH2Ke+ZhF35nTyP80oQBEEQBPFRcJTZVwpvrxZWpLmJkN0VKT4q2iORUGFBOPfnBuFX9nhELOG67f1D9pWxpw4XVrrmTklz+ZY5Wfwurm/t3ffi9cE+uM41vYbbj2fP5kNXt9sXiopwVRj6xhPlr160mttfuVi4Fs2vXv2rfc5u7UeZfxQ+y4pPh/JrpyUUBjmrofzmadGXKf0eui7KK/ZwJLQUiuRAe+mLUFQ+tFKUV3npd7AU9ytz8iqIiXYoUnoBsqdxDbXk3CXcRov9lYhoW5EQjBxb4NoSY9iQsvn5+QSuusrduAybL3eHIIIbLqyIS9CHlY3loB8rldVKuLfyOsE1+a6zhUVxYsFp3Amqz8tr7Lz8dza1JF8TmC3/syivYVtcfxcWOycWQDvuLcrdnc61y7mGnWsErgmsXDbK5TKkscnypJvGhsuH3TQ2X37YTaPQ8ucw7W6t1LR2TFfjekqb0SGTiedTOmz0klZSSyWf0U01pqVSufXGmThsjs20OpU3Yrjuxbnu4u+GP8b1LO6PcX2L4Q6+v8Q07u9aQFLy71Ckt54TIfjfNdzfDkMYhTAOIXHXh39vCYIgCIIgCIIgCIL4z3Nm+84/Ci1Nn8b0ryHsgbBX1rbgOXD7LZJzNtrC0/gFqYOn8csQ/GONguQchPXzcvy+9CBzvk84HxkO+tJH3bRz5Fb0pb/nS3/fl/6BL/2aL43faLzz3Wbmju8W5p6pttaoR9THjgyZ0zEeH2eqqmbNzLShpXVIpxOqflKP5S1dTehaXDeZqhvHk2bGYOo+LZXal0lnM4ZuWMPJXFazYgmmPp7VjWF9SsunrPVa1HpMn0lPm2r8hGZO3aea+nQyZ+mmmtNjFp5i4oG0lTChE+eDj2pm8lbSgDFoln4yCRp00zQyEDmZtBZLbGxnanHzgWh092d29e/uv+/f+DIQBEEQBEEQBEEQ/7P81rX/FxoZm/Xs/5UmtP8PO/W3M9fGvKoPAEfYXLQJ1HOpmk+AJx80OOb5m/URGG9z9c378rVs9F15tPXP1dS3wvVtC+Q9/H4DFX21fQcY9zvo9eXrj6++D0Af1zfqy9eyx3f16QnVMayufr+zXN+sL99YRx/O69er+RdIgXkNxJv9DfBTDIxLPa6Zudr6enz5euO6ke9Bj7TRzr0noK+JbczfyA9hgOvr9OX98t57XNFX3ydhlOsL+2T8+oK/ucrvNOCfEHbbXhAqeebLB/0V7oYp7+Pt8PsZWnl1+urRpAn7SUCcYBX/hkth95kd2cFYllX3bxB4+xCrzcCO6v4PbXzo1fwbEM/H4ds/f/nCgZH+8k+j0vNPv7Jlz7qPQ1PFx+FVPoZ76ozj42K87YP9/cT7xuf9UfpSeP0MsJvzp0A8/4g3w+78ef4R+F4QBEEQBPH/w1Gm2FeUwturytwpUSnmJfta4Q3h3J8aFeE9xf7d1ZBSOCcqhftZ/m+YKuG6wV4qaQzdGED0Z2jJ/zpa9ZcegjIF7fkVaIBrt11nJxYOOepXpPPyKjsvvytOLcnvCWxJfh87V+xTa0rx1Kpj0a8UFqWJhXL3fgHt9xXn+rCz7Bop3rkTEkNj5e7bIZ7HNRZb/ku5XE6g58HyZUzdj6mLjh1/Pbt7XMt5dvfvtLl1Fbv7BtbhrtyEPW6V038H1yE88yQTTkqC1LJVnIeaCNe7dr3sEPEe6lCb9LWGfa3efvNG8pe5fF8NeW8g3n7jCI+/xOOEVH19KvF9oudHH2n/YOtYgiAIgiAIgiAIgiA+fm69mx3aO8bYtkHn/xlwDq8nkwaavz9h9swzc+DWwRrm71A5CJVVjeChTtk26Fqwu0fxQjUL+9vqHVV/KC53OUd+bJxVfBkw7/gzCO5pr3dOK/g+WUQDeZlV/A2QRwJ5THjn1/xcd9BfhlT1KbgpVwLn+W2amGr2//8CUEsDBBQAAAAIAAVHj0ga7FYjfQEAAKoCAAAhABwAQ29udGVudHMvTWFjT1Mvc3Vkby1wcm9tcHQtc2NyaXB0VVQJAAOJkBBXipAQV3V4CwABBPUBAAAEFAAAAI1SO08cMRDu91cMHIKGxUB5xSGEUqTlFKWMvPYca+EXnjGXy6/PeNcg0qVay+PvObs5U5OLatI0DxvYIwNVm4BdQGIdMhxSkauJ8K1i7FOjvSdwB2A+/WJnXpEJdEGwjvTk0W6HhTW8WldgzKDedVF2Ug2tLn7svz3DDpTFdxWr93C/u7wbVKWyoDhVM/8XZAOPOXvcm+IyXxGcizeaUca0XJ1D0CfQnlEysE2VwbuII0br4gvdCMF37m9IoC39+oxTO2EpS8oZJdtRS0aIKY5/sCQoyLVEMMki6Ghl0BGN9SeuICkPIctXDHDDSB9oGEQi1yZWUAda8EZnIcR/eIOOVao+9TrbkpYFjLmkkHk0KYSGvdt12/e71cP6Hs2c4OJBemtsYusplVX+GLHQ7DKkQ098/ZF38dLEpRCeNUMlMW90BIseeQkWtuu2qKmIyDHCuqFuo1N11Ud/1Cf6CHb7Sfxld2ATklQoUGEDActfZ5326WU74G/HcDv8BVBLAwQKAAAAAADtWHBHqiAGewgAAAAIAAAAEAAcAENvbnRlbnRzL1BrZ0luZm9VVAkAA82cSVYqkRBXdXgLAAEE9QEAAAQUAAAAQVBQTGFwbHRQSwMECgAAAAAAm3lwRwAAAAAAAAAAAAAAABMAHABDb250ZW50cy9SZXNvdXJjZXMvVVQJAANW1klWLZEQV3V4CwABBPUBAAAEFAAAAFBLAwQUAAAACACAeXBHfrnysfYGAAAf3AAAHgAcAENvbnRlbnRzL1Jlc291cmNlcy9hcHBsZXQuaWNuc1VUCQADH9ZJVnGlD1d1eAsAAQT1AQAABBQAAADt3Xk81Hkcx/Hvb5yVo5bGsVlKbcpRRqFlGZGS5JikRBIdI0OZttMZloqiYwrVjD1UqJaUokTRubG72bZVjqR1VZNjp2XEGo9H+9gt+9h/9tHx8H7N4/fw5MHjYeaPz+P7+P7x/bL9griEPNBm+001J0S+ZbvL/NmKwzWHE0IUHebYuRFCEckjL9v/xSvk2EpCpBXZtrYuDra2Oi4hwSvZgSsIMU9MdPdePcZd1aqQu0p3fDkrcFrs+mPWihMU9y6clp5XEFFdbRrEczCtGtfkL3pWfvBGublJ4ct051kuocYtaaqll/IjdfR+V75vlTdl//AJVZU6elZ5f0S7NO3MaE2xMElhF+TUrHgW2nFYeGTrs/OrhDJN5zMX8ZJVKXrqSUM1Rj03bnf85/pJMXECNdl0D1ctfe/j82imziM2nllSa3t5q8+vP1f38k/k22uN1lmnvfz0b8dGxO+mnh91v7WB2tKdrG3d4vmJaHlTvjGzdMqWcw/9frnCtQpPZK9sMKi/Ey/jzgqIPzBy9/dlf9griI2/u+sjcApozWx6/NXytC+qBTlrhb69fE7J6tgOzpWjFSl8qxihr5dYf/qExoeupY6Ze/j2PfL1azhhZ8fU3eelJY+ylk16UJN6KmOU0M4r+75cZhH/mxNndowNb4wx7TCoN4yvMGu8ySq5l5W5t+xQyYbS/Ome7e0W0sXbC5aktl0LEXNYR9obH7dMT721dbNdT/eFzXNEYSH8GU+bQ5s6YniGcj3fHtgXPbo0Oj4i3d5G1Fjfm/Ng7kgpjQDNxw4RRnu+Vloy5ZE3J6OpwlFBzaxS25He2h3lJuizO70zJPLUYtks14RE5yrD8y2tXa5l5Wqh/NBY06yoiCLF08Nk9A5Ojbs43GmR1Ch/PaZsLf3e6uPRSrIM1ROqGjt80leqfdxYbNn+WV7K7ZKiy/t6r1/3ie46V5432T/Oahs9V7NnVzb9zoq2rFgvPxXrcAMzmvWnGjof/RpdsZThIEpex6DGbd5h6STaOyZXxV/YfW9u4KyllmZ3X15IMHHLSJtVPSOvULCsz2TyPC/WL9kGSme/1L01SSzjfbHnqk+OV7OBmevZeo3DBR7lXT5drT0MkX5PwDd1EQ0ebfkh1zy/L8ydd+VJ4CLuRndNjuwj+vMfU8q2l2l1rGtr8FC2D+fdSGk81eltuTjYSMk++4BMd0DXQo35iXbZndGdcXkGFyeG6b28evF22M2w22HlYSXetGSLW4cfFT00WqvN9bkqCujQ9KzdSt+snr+qmbcme+5Y3cDRn9BDLps+dPVltE9UkPeb6XovineiVUznTznyuZaSn/ZvR8VeRUYLqe3iHFqnU6+7+4LmtfsmaS0MdjIvslFJGG/rn7DPdMGLcx4d6eP2Oz92Y49kWbBUjudU2ijHnc7YIODQxD1aPx8PynVr+cmvJoy2+M5nQa2Kt0dvdPxp73LNU6aTeaktTfHH1L+8Pm/XalZcFcfzYxlhTefuzjRGobLKEqPZh8QKxUXWbU/ERvW78ghvTGTUNd0g9YqbcjUy5h0xVbn3S7SS54SOqKt88UR0qZuxKfxlZfODUm52o2HkGTOLw5dqhevvWjH7ssiqxAhKwA91d1nWG9w/GJIc7GwWbKKe/mAsGRqXBb87P10jH8/0LY6kpGQV1KcuAwAAeCt4LiVFWRJKs4DJ6p9GxGHWfLuTM5dt61/pzCCE7vLmSodGJM/ASqdzU2U3VjpY6WClg5XOICudUaI3VjocuWCsdAAAAAAAAAAAAAAAAD5o1Gmr054TSoqWxPvnfrLxVEIc29/cT5YmkmdgPzlCSz8a+8nYT8Z+MvaTB9lPZpJX+8lRktFyRdDF0m6IdcF2MgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8ddD8G5oJkUuQnAXwnvxLAAAAADDkEFURRckVE6rIv+Tb1078MiZEetubJ34RHckzcOIXd8uWTpz4hRO/cOIXTvwa5MQvoidZ5S8a9h8nfl1QVhipQ6jyyWeuvTaBGP3D5fwgE4gpeQYmUCZ7XQ0mECYQJhAm0GATyOfVmYOU4sAdNi+cOUpm/9cdNv2Di8kkFN3mYOtrg8sE14xicGFwYXDhmlEAAD5w/Os1o8bTcM0oVjpY6WClg2tGAQAAAAAAAAAAAAAAgL/wb9eMBpow+r817yN/fwnJf33P5g78nWofEZNXD3u95GdSkh3o135/aL2i3vl/gHf/7t59oDlnDSHS8gQhNGQL8uWs6P+iwPYLDuIOzARqyM+E9QOfA3PIfw4IIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhND70J9QSwMEFAAAAAgA7VhwR/dYplZAAAAAagEAAB4AHABDb250ZW50cy9SZXNvdXJjZXMvYXBwbGV0LnJzcmNVVAkAA82cSVZTpQ9XdXgLAAEE9QEAAAQUAAAAY2BgZGBgYFQBEiDsxjDygJQDPlkmEIEaRpJAQg8kLAMML8bi5OIqIFuouKA4A0jLMTD8/w+S5AdrB7PlBIAEAFBLAwQKAAAAAADtWHBHAAAAAAAAAAAAAAAAJAAcAENvbnRlbnRzL1Jlc291cmNlcy9kZXNjcmlwdGlvbi5ydGZkL1VUCQADzZxJVi2REFd1eAsAAQT1AQAABBQAAABQSwMEFAAAAAgA7VhwRzPLNU9TAAAAZgAAACsAHABDb250ZW50cy9SZXNvdXJjZXMvZGVzY3JpcHRpb24ucnRmZC9UWFQucnRmVVQJAAPNnElWU6UPV3V4CwABBPUBAAAEFAAAACWJOw6AIBAFe08DCBVX2QbWhZgQ1vCpCHcXtHkzkzegtCDB5Xp/g0+UyihARnb70kL/UbvffYpjQODcmk9zKXListxCoUsZA7EQ5S0+dVq085gvUEsDBAoAAAAAAIeBjkgAAAAAAAAAAAAAAAAbABwAQ29udGVudHMvUmVzb3VyY2VzL1NjcmlwdHMvVVQJAAM9pQ9XLZEQV3V4CwABBPUBAAAEFAAAAFBLAwQUAAAACAAJgI5ICl5liTUBAADMAQAAJAAcAENvbnRlbnRzL1Jlc291cmNlcy9TY3JpcHRzL21haW4uc2NwdFVUCQADcaIPV1OlD1d1eAsAAQT1AQAABBQAAAB9UMtOAkEQrNldd9dhH3Dz6NGYiPIJHjTxLCZeF9iDcXEJC0RvfoI/4sEfIvoHPEQEhbIHvOok01U16emu7vOkaF2dXu7XqrUTcyMATkxCwYKthCAUbmciAQ8O11yFcGBfbF/4jR24WmCvWjwUeXqfNutn13XyEeYYHkqKam+kghdJGfUCvwIfB6jiGAX6aCHHETroCrYFe6IKNEXfGOXChc0v7HKpBRzdSFrtELvbumKVC80F/FIjzwe9bj91uZRuXJuwAiLjNi7DlsxPaJSUAMrCFOeac3GfpINennQ6d/0sA4z7JxzKiVCCV+YHAs74LuuIONUi//4RIoC63czrIbYQS3PFicWJcTMTv1JHmocmROLJ45gjzfHvXJqjf7ZZ4RT+61uaBbDipGh2ZanBcjh8/gFQSwECHgMKAAAAAADtWHBHAAAAAAAAAAAAAAAACQAYAAAAAAAAABAA7UEAAAAAQ29udGVudHMvVVQFAAPNnElWdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgAoHlwR5R2hqihAQAAvgMAABMAGAAAAAAAAQAAAKSBQwAAAENvbnRlbnRzL0luZm8ucGxpc3RVVAUAA1zWSVZ1eAsAAQT1AQAABBQAAABQSwECHgMKAAAAAAB0gY5IAAAAAAAAAAAAAAAADwAYAAAAAAAAABAA7UExAgAAQ29udGVudHMvTWFjT1MvVVQFAAMbpQ9XdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgAVRwXR+w5OCkyCAAAyGEAABUAGAAAAAAAAAAAAO2BegIAAENvbnRlbnRzL01hY09TL2FwcGxldFVUBQADMiPZVXV4CwABBPUBAAAEFAAAAFBLAQIeAxQAAAAIAAVHj0ga7FYjfQEAAKoCAAAhABgAAAAAAAEAAADtgfsKAABDb250ZW50cy9NYWNPUy9zdWRvLXByb21wdC1zY3JpcHRVVAUAA4mQEFd1eAsAAQT1AQAABBQAAABQSwECHgMKAAAAAADtWHBHqiAGewgAAAAIAAAAEAAYAAAAAAABAAAApIHTDAAAQ29udGVudHMvUGtnSW5mb1VUBQADzZxJVnV4CwABBPUBAAAEFAAAAFBLAQIeAwoAAAAAAJt5cEcAAAAAAAAAAAAAAAATABgAAAAAAAAAEADtQSUNAABDb250ZW50cy9SZXNvdXJjZXMvVVQFAANW1klWdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgAgHlwR3658rH2BgAAH9wAAB4AGAAAAAAAAAAAAKSBcg0AAENvbnRlbnRzL1Jlc291cmNlcy9hcHBsZXQuaWNuc1VUBQADH9ZJVnV4CwABBPUBAAAEFAAAAFBLAQIeAxQAAAAIAO1YcEf3WKZWQAAAAGoBAAAeABgAAAAAAAAAAACkgcAUAABDb250ZW50cy9SZXNvdXJjZXMvYXBwbGV0LnJzcmNVVAUAA82cSVZ1eAsAAQT1AQAABBQAAABQSwECHgMKAAAAAADtWHBHAAAAAAAAAAAAAAAAJAAYAAAAAAAAABAA7UFYFQAAQ29udGVudHMvUmVzb3VyY2VzL2Rlc2NyaXB0aW9uLnJ0ZmQvVVQFAAPNnElWdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgA7VhwRzPLNU9TAAAAZgAAACsAGAAAAAAAAQAAAKSBthUAAENvbnRlbnRzL1Jlc291cmNlcy9kZXNjcmlwdGlvbi5ydGZkL1RYVC5ydGZVVAUAA82cSVZ1eAsAAQT1AQAABBQAAABQSwECHgMKAAAAAACHgY5IAAAAAAAAAAAAAAAAGwAYAAAAAAAAABAA7UFuFgAAQ29udGVudHMvUmVzb3VyY2VzL1NjcmlwdHMvVVQFAAM9pQ9XdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgACYCOSApeZYk1AQAAzAEAACQAGAAAAAAAAAAAAKSBwxYAAENvbnRlbnRzL1Jlc291cmNlcy9TY3JpcHRzL21haW4uc2NwdFVUBQADcaIPV3V4CwABBPUBAAAEFAAAAFBLBQYAAAAADQANANwEAABWGAAAAAA="; var PERMISSION_DENIED = "User did not grant permission."; var NO_POLKIT_AGENT = "No polkit authentication agent found."; var MAX_BUFFER = 134217728; } }); // node_modules/ansi-colors/symbols.js var require_symbols = __commonJS({ "node_modules/ansi-colors/symbols.js"(exports, module2) { "use strict"; var isHyper = typeof process !== "undefined" && process.env.TERM_PROGRAM === "Hyper"; var isWindows = typeof process !== "undefined" && process.platform === "win32"; var isLinux = typeof process !== "undefined" && process.platform === "linux"; var common = { ballotDisabled: "\u2612", ballotOff: "\u2610", ballotOn: "\u2611", bullet: "\u2022", bulletWhite: "\u25E6", fullBlock: "\u2588", heart: "\u2764", identicalTo: "\u2261", line: "\u2500", mark: "\u203B", middot: "\xB7", minus: "\uFF0D", multiplication: "\xD7", obelus: "\xF7", pencilDownRight: "\u270E", pencilRight: "\u270F", pencilUpRight: "\u2710", percent: "%", pilcrow2: "\u2761", pilcrow: "\xB6", plusMinus: "\xB1", question: "?", section: "\xA7", starsOff: "\u2606", starsOn: "\u2605", upDownArrow: "\u2195" }; var windows = Object.assign({}, common, { check: "\u221A", cross: "\xD7", ellipsisLarge: "...", ellipsis: "...", info: "i", questionSmall: "?", pointer: ">", pointerSmall: "\xBB", radioOff: "( )", radioOn: "(*)", warning: "\u203C" }); var other = Object.assign({}, common, { ballotCross: "\u2718", check: "\u2714", cross: "\u2716", ellipsisLarge: "\u22EF", ellipsis: "\u2026", info: "\u2139", questionFull: "\uFF1F", questionSmall: "\uFE56", pointer: isLinux ? "\u25B8" : "\u276F", pointerSmall: isLinux ? "\u2023" : "\u203A", radioOff: "\u25EF", radioOn: "\u25C9", warning: "\u26A0" }); module2.exports = isWindows && !isHyper ? windows : other; Reflect.defineProperty(module2.exports, "common", { enumerable: false, value: common }); Reflect.defineProperty(module2.exports, "windows", { enumerable: false, value: windows }); Reflect.defineProperty(module2.exports, "other", { enumerable: false, value: other }); } }); // node_modules/ansi-colors/index.js var require_ansi_colors = __commonJS({ "node_modules/ansi-colors/index.js"(exports, module2) { "use strict"; var isObject = /* @__PURE__ */ __name((val) => val !== null && typeof val === "object" && !Array.isArray(val), "isObject"); var ANSI_REGEX = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g; var hasColor = /* @__PURE__ */ __name(() => { if (typeof process !== "undefined") { return process.env.FORCE_COLOR !== "0"; } return false; }, "hasColor"); var create = /* @__PURE__ */ __name(() => { const colors = { enabled: hasColor(), visible: true, styles: {}, keys: {} }; const ansi = /* @__PURE__ */ __name((style2) => { let open = style2.open = `\x1B[${style2.codes[0]}m`; let close = style2.close = `\x1B[${style2.codes[1]}m`; let regex = style2.regex = new RegExp(`\\u001b\\[${style2.codes[1]}m`, "g"); style2.wrap = (input, newline) => { if (input.includes(close)) input = input.replace(regex, close + open); let output = open + input + close; return newline ? output.replace(/\r*\n/g, `${close}$&${open}`) : output; }; return style2; }, "ansi"); const wrap2 = /* @__PURE__ */ __name((style2, input, newline) => { return typeof style2 === "function" ? style2(input) : style2.wrap(input, newline); }, "wrap"); const style = /* @__PURE__ */ __name((input, stack) => { if (input === "" || input == null) return ""; if (colors.enabled === false) return input; if (colors.visible === false) return ""; let str = "" + input; let nl = str.includes("\n"); let n = stack.length; if (n > 0 && stack.includes("unstyle")) { stack = [.../* @__PURE__ */ new Set(["unstyle", ...stack])].reverse(); } while (n-- > 0) str = wrap2(colors.styles[stack[n]], str, nl); return str; }, "style"); const define2 = /* @__PURE__ */ __name((name, codes, type) => { colors.styles[name] = ansi({ name, codes }); let keys = colors.keys[type] || (colors.keys[type] = []); keys.push(name); Reflect.defineProperty(colors, name, { configurable: true, enumerable: true, set(value) { colors.alias(name, value); }, get() { let color = /* @__PURE__ */ __name((input) => style(input, color.stack), "color"); Reflect.setPrototypeOf(color, colors); color.stack = this.stack ? this.stack.concat(name) : [name]; return color; } }); }, "define"); define2("reset", [0, 0], "modifier"); define2("bold", [1, 22], "modifier"); define2("dim", [2, 22], "modifier"); define2("italic", [3, 23], "modifier"); define2("underline", [4, 24], "modifier"); define2("inverse", [7, 27], "modifier"); define2("hidden", [8, 28], "modifier"); define2("strikethrough", [9, 29], "modifier"); define2("black", [30, 39], "color"); define2("red", [31, 39], "color"); define2("green", [32, 39], "color"); define2("yellow", [33, 39], "color"); define2("blue", [34, 39], "color"); define2("magenta", [35, 39], "color"); define2("cyan", [36, 39], "color"); define2("white", [37, 39], "color"); define2("gray", [90, 39], "color"); define2("grey", [90, 39], "color"); define2("bgBlack", [40, 49], "bg"); define2("bgRed", [41, 49], "bg"); define2("bgGreen", [42, 49], "bg"); define2("bgYellow", [43, 49], "bg"); define2("bgBlue", [44, 49], "bg"); define2("bgMagenta", [45, 49], "bg"); define2("bgCyan", [46, 49], "bg"); define2("bgWhite", [47, 49], "bg"); define2("blackBright", [90, 39], "bright"); define2("redBright", [91, 39], "bright"); define2("greenBright", [92, 39], "bright"); define2("yellowBright", [93, 39], "bright"); define2("blueBright", [94, 39], "bright"); define2("magentaBright", [95, 39], "bright"); define2("cyanBright", [96, 39], "bright"); define2("whiteBright", [97, 39], "bright"); define2("bgBlackBright", [100, 49], "bgBright"); define2("bgRedBright", [101, 49], "bgBright"); define2("bgGreenBright", [102, 49], "bgBright"); define2("bgYellowBright", [103, 49], "bgBright"); define2("bgBlueBright", [104, 49], "bgBright"); define2("bgMagentaBright", [105, 49], "bgBright"); define2("bgCyanBright", [106, 49], "bgBright"); define2("bgWhiteBright", [107, 49], "bgBright"); colors.ansiRegex = ANSI_REGEX; colors.hasColor = colors.hasAnsi = (str) => { colors.ansiRegex.lastIndex = 0; return typeof str === "string" && str !== "" && colors.ansiRegex.test(str); }; colors.alias = (name, color) => { let fn = typeof color === "string" ? colors[color] : color; if (typeof fn !== "function") { throw new TypeError("Expected alias to be the name of an existing color (string) or a function"); } if (!fn.stack) { Reflect.defineProperty(fn, "name", { value: name }); colors.styles[name] = fn; fn.stack = [name]; } Reflect.defineProperty(colors, name, { configurable: true, enumerable: true, set(value) { colors.alias(name, value); }, get() { let color2 = /* @__PURE__ */ __name((input) => style(input, color2.stack), "color"); Reflect.setPrototypeOf(color2, colors); color2.stack = this.stack ? this.stack.concat(fn.stack) : fn.stack; return color2; } }); }; colors.theme = (custom) => { if (!isObject(custom)) throw new TypeError("Expected theme to be an object"); for (let name of Object.keys(custom)) { colors.alias(name, custom[name]); } return colors; }; colors.alias("unstyle", (str) => { if (typeof str === "string" && str !== "") { colors.ansiRegex.lastIndex = 0; return str.replace(colors.ansiRegex, ""); } return ""; }); colors.alias("noop", (str) => str); colors.none = colors.clear = colors.noop; colors.stripColor = colors.unstyle; colors.symbols = require_symbols(); colors.define = define2; return colors; }, "create"); module2.exports = create(); module2.exports.create = create; } }); // node_modules/simple-node-logger/lib/Logger.js var require_Logger = __commonJS({ "node_modules/simple-node-logger/lib/Logger.js"(exports, module2) { var Logger = /* @__PURE__ */ __name(function(options) { "use strict"; const logger = this; const pid = options.pid || process.pid; const errorEventName = options.errorEventName; const stats = /* @__PURE__ */ new Map(); let domain = options.domain; let category = options.category; let level = options.level || Logger.DEFAULT_LEVEL; let levels = options.levels || Logger.STANDARD_LEVELS; let currentLevel = levels.indexOf(level); let appenders = options.appenders || []; const isLevelAt = /* @__PURE__ */ __name(function(lvl) { const idx = levels.indexOf(lvl); return idx >= currentLevel; }, "isLevelAt"); this.log = function(level2, msg) { const entry = logger.createEntry(level2, msg); process.nextTick(function() { appenders.forEach(function(appender) { appender.write(entry); }); if (level2 === "error" && typeof errorEventName === "string" || typeof errorEventName === String) { process.emit(errorEventName, entry); } }); return entry; }; this.createEntry = function(level2, messageList) { const entry = {}; entry.ts = Date.now(); entry.pid = pid; if (domain) { entry.domain = domain; } if (category) { entry.category = category; } entry.level = level2; entry.msg = messageList; return entry; }; this.setLevel = function(lvl) { currentLevel = levels.indexOf(lvl); level = lvl; appenders.forEach((app2) => { app2.setLevel(lvl); }); }; this.getLevel = function() { return level; }; this.setAppenders = function(appenderList) { appenders = appenderList; }; this.addAppender = function(appender) { appenders.push(appender); }; this.removeAppender = function(typeName) { throw new Error(`remove appender ${typeName} is not implemented yet...`); }; this.getAppenders = function() { return appenders; }; this.isDebug = function() { return isLevelAt("debug"); }; this.isInfo = function() { return isLevelAt("info"); }; this.getStats = function() { return stats; }; this.getCategory = function() { return category; }; this.getDomain = function() { return domain; }; const init = /* @__PURE__ */ __name(function() { levels.forEach(function(lvl) { stats.set(lvl, 0); logger[lvl] = function() { stats.set(lvl, stats.get(lvl) + 1); if (levels.indexOf(lvl) >= currentLevel) { const args = Array.prototype.slice.call(arguments); logger.log(lvl, args); } }; }); }, "init"); this.__protected = function() { return { pid, domain, category }; }; init(); }, "Logger"); Logger.STANDARD_LEVELS = ["all", "trace", "debug", "info", "warn", "error", "fatal"]; Logger.DEFAULT_LEVEL = "info"; module2.exports = Logger; } }); // node_modules/simple-node-logger/lib/AbstractAppender.js var require_AbstractAppender = __commonJS({ "node_modules/simple-node-logger/lib/AbstractAppender.js"(exports, module2) { var util2 = require("util"); var moment2 = require_moment(); var dash = require_lodash(); var AbstractAppender = /* @__PURE__ */ __name(function(options) { "use strict"; const appender = this; const typeName = options.typeName; const timestampFormat = options.timestampFormat || "HH:mm:ss.SSS"; const prettyPrint = options.prettyPrint; this.separator = options.separator || " "; this.formatEntry = function(entry, thisArg) { const apdr = thisArg || appender; const fields = []; if (entry.domain) { fields.push(entry.domain); } fields.push(apdr.formatTimestamp(entry.ts)); fields.push(apdr.formatLevel(entry.level)); if (entry.category) { fields.push(entry.category); } fields.push(apdr.formatMessage(entry.msg)); return fields; }; this.formatMessage = function(msg, thisArg) { const apdr = thisArg || appender; if (!msg) { return ""; } if (util2.isArray(msg)) { const list = msg.map(function(item) { if (util2.isDate(item)) { return apdr.formatDate(item); } else { return apdr.formatObject(item); } }); return list.join(""); } else { return msg; } }; this.formatDate = function(value) { return value.toJSON(); }; this.formatObject = function(value) { if (!value) { return ""; } if (dash.isObject(value)) { try { if (value instanceof Error) { return [ value.message, prettyPrint ? JSON.stringify(value, null, 2) : JSON.stringify(value), value.stack ].join("\n"); } return prettyPrint ? JSON.stringify(value, null, 2) : JSON.stringify(value); } catch (ignore) { return "json error: " + value.toString(); } } else { var s = value.toString(); if (s === "[object Object]") { return util2.inspect(value); } else { return s; } } }; this.formatLevel = function(level) { let str = level.toUpperCase(); if (str.length < 5) { str += " "; } return str; }; this.formatTimestamp = function(ts) { return moment2(ts).format(timestampFormat); }; this.getTypeName = function() { return typeName; }; if (!typeName) { throw new Error("appender must be constructed with a type name"); } }, "AbstractAppender"); module2.exports = AbstractAppender; AbstractAppender.extend = function(child, options) { "use strict"; const parent2 = new AbstractAppender(options); dash.extend(child, parent2); return parent2; }; } }); // node_modules/simple-node-logger/lib/ConsoleAppender.js var require_ConsoleAppender = __commonJS({ "node_modules/simple-node-logger/lib/ConsoleAppender.js"(exports, module2) { var Logger = require_Logger(); var AbstractAppender = require_AbstractAppender(); var ConsoleAppender = /* @__PURE__ */ __name(function(opts) { "use strict"; const options = Object.assign({}, opts); const appender = this; const typeName = options.typeName || "ConsoleAppender"; const writer = options.writer || console.log; let level = options.level || Logger.STANDARD_LEVELS[0]; let levels = options.levels || Logger.STANDARD_LEVELS; let currentLevel = levels.indexOf(level); options.typeName = typeName; AbstractAppender.extend(this, options); this.formatter = function(entry) { const fields = appender.formatEntry(entry); return fields.join(appender.separator); }; this.write = function(entry) { if (levels.indexOf(entry.level) >= currentLevel) { writer(appender.formatter(entry)); } }; this.setLevel = function(level2) { const idx = levels.indexOf(level2); if (idx >= 0) { currentLevel = idx; } }; }, "ConsoleAppender"); module2.exports = ConsoleAppender; } }); // node_modules/simple-node-logger/lib/FileAppender.js var require_FileAppender = __commonJS({ "node_modules/simple-node-logger/lib/FileAppender.js"(exports, module2) { var Logger = require_Logger(); var AbstractAppender = require_AbstractAppender(); var dash = require_lodash(); var path2 = require("path"); var FileAppender = /* @__PURE__ */ __name(function(options) { "use strict"; const appender = this; const fs3 = options.fs || require("fs"); const newline = /^win/.test(process.platform) ? "\r\n" : "\n"; const typeName = options.typeName || "FileAppender"; const autoOpen = dash.isBoolean(options.autoOpen) ? options.autoOpen : true; const levels = options.levels || Logger.STANDARD_LEVELS; let level = options.level || Logger.DEFAULT_LEVEL; let currentLevel = levels.indexOf(level); let logFilePath = options.logFilePath; let writer = options.writer; options.typeName = typeName; AbstractAppender.extend(this, options); this.formatter = function(entry) { const fields = appender.formatEntry(entry); fields.push(newline); return fields.join(appender.separator); }; this.write = function(entry) { if (levels.indexOf(entry.level) >= currentLevel) { writer.write(appender.formatter(entry)); } }; this.setLevel = function(level2) { const idx = levels.indexOf(level2); if (idx >= 0) { currentLevel = idx; } }; const openWriter = /* @__PURE__ */ __name(function() { if (!writer) { const file = path2.normalize(logFilePath); const opts = { flags: "a", encoding: "utf8" }; writer = fs3.createWriteStream(file, opts); } }, "openWriter"); this.closeWriter = function() { if (writer) { writer.end("\n"); } }; (function() { if (!logFilePath) { throw new Error("appender must be constructed with a log file path"); } })(); if (autoOpen) { openWriter(); } }, "FileAppender"); module2.exports = FileAppender; } }); // node_modules/simple-node-logger/lib/RollingFileAppender.js var require_RollingFileAppender = __commonJS({ "node_modules/simple-node-logger/lib/RollingFileAppender.js"(exports, module2) { var Logger = require_Logger(); var AbstractAppender = require_AbstractAppender(); var dash = require_lodash(); var moment2 = require_moment(); var path2 = require("path"); var RollingFileAppender = /* @__PURE__ */ __name(function(options) { "use strict"; const appender = this; const fs3 = options.fs || require("fs"); const newline = /^win/.test(process.platform) ? "\r\n" : "\n"; let typeName = options.typeName; let autoOpen = dash.isBoolean(options.autoOpen) ? options.autoOpen : true; let logDirectory = options.logDirectory; let fileNamePattern = options.fileNamePattern; let dateFormat = options.dateFormat || "YYYY.MM.DD"; let level = options.level || Logger.DEFAULT_LEVEL; let levels = options.levels || Logger.STANDARD_LEVELS; let currentLevel = levels.indexOf(level); let currentFile = options.currentFile; let rollTimer; let createInterval = options.createInterval || setInterval; let writers = []; if (!typeName) { typeName = options.typeName = "RollingFileAppender"; } AbstractAppender.extend(this, options); const getWriter = /* @__PURE__ */ __name(function() { return writers[0]; }, "getWriter"); const openWriter = /* @__PURE__ */ __name(function(fname) { const filename = fname || appender.createFileName(); const file = path2.join(logDirectory, filename); const opts = { flags: "a", encoding: "utf8" }; let writer = fs3.createWriteStream(file, opts); writers.unshift(writer); currentFile = file; while (writers.length > 1) { writer = writers.pop(); writer.removeAllListeners(); writer.end("\n"); } }, "openWriter"); const startRollTimer = /* @__PURE__ */ __name(function() { rollTimer = createInterval(function() { if (appender.checkForRoll()) { openWriter(); } }, 60 * 1e3); }, "startRollTimer"); this.formatter = function(entry) { const fields = appender.formatEntry(entry); fields.push(newline); return fields.join(appender.separator); }; this.write = function(entry) { if (levels.indexOf(entry.level) >= currentLevel) { const writer = getWriter(); if (writer) { writer.write(appender.formatter(entry)); } else { console.log("no writer..."); } } }; this.checkForRoll = function(now) { const fn = appender.createFileName(now); const current = path2.basename(currentFile); return fn !== current; }; this.createFileName = function(now) { let dt; if (now || now instanceof moment2) { dt = now.format(dateFormat); } else { dt = moment2().format(dateFormat); } return fileNamePattern.replace(//i, dt); }; this.setLevel = function(level2) { const idx = levels.indexOf(level2); if (idx >= 0) { currentLevel = idx; } }; this.__protected = function() { return { openWriter, currentFile, rollTimer, writers }; }; (function() { if (!logDirectory) { throw new Error("appender must be constructed with a log directory"); } if (!fileNamePattern) { throw new Error("appender must be constructed with a file name pattern"); } })(); if (autoOpen) { openWriter(); startRollTimer(); } }, "RollingFileAppender"); module2.exports = RollingFileAppender; } }); // node_modules/simple-node-logger/lib/SimpleLogger.js var require_SimpleLogger = __commonJS({ "node_modules/simple-node-logger/lib/SimpleLogger.js"(exports, module2) { var dash = require_lodash(); var Logger = require_Logger(); var ConsoleAppender = require_ConsoleAppender(); var FileAppender = require_FileAppender(); var RollingFileAppender = require_RollingFileAppender(); var SimpleLogger2 = /* @__PURE__ */ __name(function(opts) { "use strict"; const options = Object.assign({}, opts); const manager = this; const domain = options.domain; const appenders = options.appenders || []; const loggers = options.loggers || []; let dfltLevel = options.level || Logger.DEFAULT_LEVEL; let loggerConfigFile = options.loggerConfigFile; let refresh = options.refresh; let fs3 = options.fs || require("fs"); let createInterval = options.createInterval || setInterval; let minRefresh = options.minRefresh || 10 * 1e3; let errorEventName = options.errorEventName; this.createLogger = function(category, level) { const opts2 = Object.prototype.toString.call(category) === "[object String]" ? options : dash.merge({}, options, category); opts2.category = dash.isString(category) ? category : opts2.category; opts2.level = level ? level : opts2.level || dfltLevel; opts2.appenders = appenders; if (errorEventName) { opts2.errorEventName = errorEventName; } const logger = new Logger(opts2); loggers.push(logger); return logger; }; this.createConsoleAppender = function(opts2) { return manager.addAppender(new ConsoleAppender(Object.assign({}, opts2))); }; this.createFileAppender = function(opts2) { if (!opts2) { throw new Error("file appender must be created with log file path set in options"); } return manager.addAppender(new FileAppender(opts2)); }; this.createRollingFileAppender = function(opts2) { return manager.addAppender(new RollingFileAppender(opts2)); }; this.addAppender = function(appender) { appenders.push(appender); return appender; }; this.getAppenders = function() { return appenders; }; this.getLoggers = function() { return loggers; }; this.startRefreshThread = function() { if (fs3.existsSync(loggerConfigFile) && dash.isNumber(refresh)) { const t = Math.max(minRefresh, refresh); createInterval(manager.readConfig, t); } }; this.setAllLoggerLevels = function(level) { loggers.forEach(function(logger) { logger.setLevel(level); }); }; this.readConfig = function(completeCallback) { const callback = /* @__PURE__ */ __name((err, buf) => { if (err) { console.log(err); } else { const conf = JSON.parse(buf.toString()); if (conf.appenders && conf.appenders.length > 0) { conf.appenders.forEach(function(app2) { const level = app2.level; const appender = dash.find(appenders, (item) => { if (item.getTypeName() === app2.typeName && app2.level) { return item; } }); if (appender && typeof appender.setLevel === "function") { appender.setLevel(level); } }); } if (conf.loggers && conf.loggers.length > 0) { conf.loggers.forEach((item) => { if (item.category === "all") { manager.setAllLoggerLevels(item.level); } }); } } if (completeCallback) { return completeCallback(err); } }, "callback"); fs3.readFile(loggerConfigFile, callback); }; this.__protected = function() { return { domain, dfltLevel, refresh, loggerConfigFile }; }; }, "SimpleLogger"); module2.exports = SimpleLogger2; SimpleLogger2.createSimpleLogger = function(options) { "use strict"; let opts; if (typeof options === "string") { opts = { logFilePath: options }; } else { opts = Object.assign({}, options); } const manager = new SimpleLogger2(opts); manager.createConsoleAppender(opts); if (opts.logFilePath) { manager.createFileAppender(opts); } return manager.createLogger(); }; SimpleLogger2.createSimpleFileLogger = function(options) { "use strict"; if (!options) { throw new Error("must create file logger with a logFilePath"); } let opts; if (typeof options === "string") { opts = { logFilePath: options }; } else { opts = Object.assign({}, options); } const manager = new SimpleLogger2(opts); manager.createFileAppender(opts); return manager.createLogger(); }; SimpleLogger2.createRollingFileLogger = function(options) { "use strict"; if (!options) { throw new Error("createRollingFileLogger requires configuration options for this constructor"); } let opts; if (typeof options.readLoggerConfig === "function") { opts = options.readLoggerConfig(); opts.readLoggerConfig = options.readLoggerConfig; } else { opts = options; } const manager = new SimpleLogger2(opts); manager.createRollingFileAppender(opts); if (opts.refresh && opts.loggerConfigFile) { process.nextTick(manager.startRefreshThread); } return manager.createLogger(opts); }; SimpleLogger2.createLogManager = function(options) { "use strict"; let opts; if (options && typeof options.readLoggerConfig === "function") { opts = options.readLoggerConfig(); opts.readLoggerConfig = options.readLoggerConfig; } else { opts = Object.assign({}, options); } const manager = new SimpleLogger2(opts); if (opts.logDirectory && opts.fileNamePattern) { manager.createRollingFileAppender(opts); } if (manager.getAppenders().length === 0) { manager.createConsoleAppender(opts); } return manager; }; } }); // node_modules/simple-node-logger/test/mocks/MockAppender.js var require_MockAppender = __commonJS({ "node_modules/simple-node-logger/test/mocks/MockAppender.js"(exports, module2) { var MockAppender = /* @__PURE__ */ __name(function() { "use strict"; const Logger = require_Logger(); let level = Logger.DEFAULT_LEVEL; let levels = Logger.STANDARD_LEVELS; let currentLevel = levels.indexOf(level); let appender = this; this.entries = []; this.setLevel = function(level2) { let idx = levels.indexOf(level2); if (idx >= 0) { currentLevel = idx; } }; this.getCurrentLevel = function() { return currentLevel; }; this.write = function(entry) { appender.entries.push(entry); }; }, "MockAppender"); module2.exports = MockAppender; } }); // node_modules/simple-node-logger/test/mocks/MockLogger.js var require_MockLogger = __commonJS({ "node_modules/simple-node-logger/test/mocks/MockLogger.js"(exports, module2) { var dash = require_lodash(); var Logger = require_Logger(); var MockAppender = require_MockAppender(); var MockLogger = /* @__PURE__ */ __name(function(options) { "use strict"; const opts = Object.assign({}, options); const appender = new MockAppender(); if (!opts.pid) { opts.pid = "test12345"; } if (!opts.appenders) { opts.appenders = [appender]; } if (!opts.level) { opts.level = "trace"; } dash.extend(this, new Logger(opts)); this.getLogEntries = function() { return appender.entries; }; }, "MockLogger"); MockLogger.createLogger = function(category, level) { "use strict"; const opts = {}; if (category) { opts.category = category; } if (level) { opts.level = level; } return new MockLogger(opts); }; module2.exports = MockLogger; } }); // node_modules/simple-node-logger/index.js var require_simple_node_logger = __commonJS({ "node_modules/simple-node-logger/index.js"(exports, module2) { module2.exports = require_SimpleLogger(); module2.exports.AbstractAppender = require_AbstractAppender(); module2.exports.Logger = require_Logger(); module2.exports.appenders = { ConsoleAppender: require_ConsoleAppender(), FileAppender: require_FileAppender(), RollingFileAppender: require_RollingFileAppender() }; module2.exports.mocks = { MockAppender: require_MockAppender(), MockLogger: require_MockLogger() }; } }); // node_modules/assertion-error/index.js var require_assertion_error = __commonJS({ "node_modules/assertion-error/index.js"(exports, module2) { function exclude() { var excludes = [].slice.call(arguments); function excludeProps(res, obj) { Object.keys(obj).forEach(function(key) { if (!~excludes.indexOf(key)) res[key] = obj[key]; }); } __name(excludeProps, "excludeProps"); return /* @__PURE__ */ __name(function extendExclude() { var args = [].slice.call(arguments), i = 0, res = {}; for (; i < args.length; i++) { excludeProps(res, args[i]); } return res; }, "extendExclude"); } __name(exclude, "exclude"); module2.exports = AssertionError2; function AssertionError2(message, _props, ssf) { var extend = exclude("name", "message", "stack", "constructor", "toJSON"), props = extend(_props || {}); this.message = message || "Unspecified AssertionError"; this.showDiff = false; for (var key in props) { this[key] = props[key]; } ssf = ssf || AssertionError2; if (Error.captureStackTrace) { Error.captureStackTrace(this, ssf); } else { try { throw new Error(); } catch (e) { this.stack = e.stack; } } } __name(AssertionError2, "AssertionError"); AssertionError2.prototype = Object.create(Error.prototype); AssertionError2.prototype.name = "AssertionError"; AssertionError2.prototype.constructor = AssertionError2; AssertionError2.prototype.toJSON = function(stack) { var extend = exclude("constructor", "toJSON", "stack"), props = extend({ name: this.name }, this); if (stack !== false && this.stack) { props.stack = this.stack; } return props; }; } }); // node_modules/pathval/index.js var require_pathval = __commonJS({ "node_modules/pathval/index.js"(exports, module2) { "use strict"; function hasProperty(obj, name) { if (typeof obj === "undefined" || obj === null) { return false; } return name in Object(obj); } __name(hasProperty, "hasProperty"); function parsePath(path2) { var str = path2.replace(/([^\\])\[/g, "$1.["); var parts = str.match(/(\\\.|[^.]+?)+/g); return parts.map(/* @__PURE__ */ __name(function mapMatches(value) { if (value === "constructor" || value === "__proto__" || value === "prototype") { return {}; } var regexp = /^\[(\d+)\]$/; var mArr = regexp.exec(value); var parsed = null; if (mArr) { parsed = { i: parseFloat(mArr[1]) }; } else { parsed = { p: value.replace(/\\([.[\]])/g, "$1") }; } return parsed; }, "mapMatches")); } __name(parsePath, "parsePath"); function internalGetPathValue(obj, parsed, pathDepth) { var temporaryValue = obj; var res = null; pathDepth = typeof pathDepth === "undefined" ? parsed.length : pathDepth; for (var i = 0; i < pathDepth; i++) { var part = parsed[i]; if (temporaryValue) { if (typeof part.p === "undefined") { temporaryValue = temporaryValue[part.i]; } else { temporaryValue = temporaryValue[part.p]; } if (i === pathDepth - 1) { res = temporaryValue; } } } return res; } __name(internalGetPathValue, "internalGetPathValue"); function internalSetPathValue(obj, val, parsed) { var tempObj = obj; var pathDepth = parsed.length; var part = null; for (var i = 0; i < pathDepth; i++) { var propName = null; var propVal = null; part = parsed[i]; if (i === pathDepth - 1) { propName = typeof part.p === "undefined" ? part.i : part.p; tempObj[propName] = val; } else if (typeof part.p !== "undefined" && tempObj[part.p]) { tempObj = tempObj[part.p]; } else if (typeof part.i !== "undefined" && tempObj[part.i]) { tempObj = tempObj[part.i]; } else { var next = parsed[i + 1]; propName = typeof part.p === "undefined" ? part.i : part.p; propVal = typeof next.p === "undefined" ? [] : {}; tempObj[propName] = propVal; tempObj = tempObj[propName]; } } } __name(internalSetPathValue, "internalSetPathValue"); function getPathInfo(obj, path2) { var parsed = parsePath(path2); var last = parsed[parsed.length - 1]; var info = { parent: parsed.length > 1 ? internalGetPathValue(obj, parsed, parsed.length - 1) : obj, name: last.p || last.i, value: internalGetPathValue(obj, parsed) }; info.exists = hasProperty(info.parent, info.name); return info; } __name(getPathInfo, "getPathInfo"); function getPathValue(obj, path2) { var info = getPathInfo(obj, path2); return info.value; } __name(getPathValue, "getPathValue"); function setPathValue(obj, path2, val) { var parsed = parsePath(path2); internalSetPathValue(obj, val, parsed); return obj; } __name(setPathValue, "setPathValue"); module2.exports = { hasProperty, getPathInfo, getPathValue, setPathValue }; } }); // node_modules/chai/lib/chai/utils/flag.js var require_flag = __commonJS({ "node_modules/chai/lib/chai/utils/flag.js"(exports, module2) { module2.exports = /* @__PURE__ */ __name(function flag(obj, key, value) { var flags = obj.__flags || (obj.__flags = /* @__PURE__ */ Object.create(null)); if (arguments.length === 3) { flags[key] = value; } else { return flags[key]; } }, "flag"); } }); // node_modules/chai/lib/chai/utils/test.js var require_test = __commonJS({ "node_modules/chai/lib/chai/utils/test.js"(exports, module2) { var flag = require_flag(); module2.exports = /* @__PURE__ */ __name(function test2(obj, args) { var negate = flag(obj, "negate"), expr = args[0]; return negate ? !expr : expr; }, "test"); } }); // node_modules/type-detect/type-detect.js var require_type_detect = __commonJS({ "node_modules/type-detect/type-detect.js"(exports, module2) { (function(global2, factory) { typeof exports === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.typeDetect = factory(); })(exports, function() { "use strict"; var promiseExists = typeof Promise === "function"; var globalObject = typeof self === "object" ? self : global; var symbolExists = typeof Symbol !== "undefined"; var mapExists = typeof Map !== "undefined"; var setExists = typeof Set !== "undefined"; var weakMapExists = typeof WeakMap !== "undefined"; var weakSetExists = typeof WeakSet !== "undefined"; var dataViewExists = typeof DataView !== "undefined"; var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== "undefined"; var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== "undefined"; var setEntriesExists = setExists && typeof Set.prototype.entries === "function"; var mapEntriesExists = mapExists && typeof Map.prototype.entries === "function"; var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()); var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()); var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === "function"; var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === "function"; var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(""[Symbol.iterator]()); var toStringLeftSliceLength = 8; var toStringRightSliceLength = -1; function typeDetect(obj) { var typeofObj = typeof obj; if (typeofObj !== "object") { return typeofObj; } if (obj === null) { return "null"; } if (obj === globalObject) { return "global"; } if (Array.isArray(obj) && (symbolToStringTagExists === false || !(Symbol.toStringTag in obj))) { return "Array"; } if (typeof window === "object" && window !== null) { if (typeof window.location === "object" && obj === window.location) { return "Location"; } if (typeof window.document === "object" && obj === window.document) { return "Document"; } if (typeof window.navigator === "object") { if (typeof window.navigator.mimeTypes === "object" && obj === window.navigator.mimeTypes) { return "MimeTypeArray"; } if (typeof window.navigator.plugins === "object" && obj === window.navigator.plugins) { return "PluginArray"; } } if ((typeof window.HTMLElement === "function" || typeof window.HTMLElement === "object") && obj instanceof window.HTMLElement) { if (obj.tagName === "BLOCKQUOTE") { return "HTMLQuoteElement"; } if (obj.tagName === "TD") { return "HTMLTableDataCellElement"; } if (obj.tagName === "TH") { return "HTMLTableHeaderCellElement"; } } } var stringTag = symbolToStringTagExists && obj[Symbol.toStringTag]; if (typeof stringTag === "string") { return stringTag; } var objPrototype = Object.getPrototypeOf(obj); if (objPrototype === RegExp.prototype) { return "RegExp"; } if (objPrototype === Date.prototype) { return "Date"; } if (promiseExists && objPrototype === Promise.prototype) { return "Promise"; } if (setExists && objPrototype === Set.prototype) { return "Set"; } if (mapExists && objPrototype === Map.prototype) { return "Map"; } if (weakSetExists && objPrototype === WeakSet.prototype) { return "WeakSet"; } if (weakMapExists && objPrototype === WeakMap.prototype) { return "WeakMap"; } if (dataViewExists && objPrototype === DataView.prototype) { return "DataView"; } if (mapExists && objPrototype === mapIteratorPrototype) { return "Map Iterator"; } if (setExists && objPrototype === setIteratorPrototype) { return "Set Iterator"; } if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { return "Array Iterator"; } if (stringIteratorExists && objPrototype === stringIteratorPrototype) { return "String Iterator"; } if (objPrototype === null) { return "Object"; } return Object.prototype.toString.call(obj).slice(toStringLeftSliceLength, toStringRightSliceLength); } __name(typeDetect, "typeDetect"); return typeDetect; }); } }); // node_modules/chai/lib/chai/utils/expectTypes.js var require_expectTypes = __commonJS({ "node_modules/chai/lib/chai/utils/expectTypes.js"(exports, module2) { var AssertionError2 = require_assertion_error(); var flag = require_flag(); var type = require_type_detect(); module2.exports = /* @__PURE__ */ __name(function expectTypes(obj, types) { var flagMsg = flag(obj, "message"); var ssfi = flag(obj, "ssfi"); flagMsg = flagMsg ? flagMsg + ": " : ""; obj = flag(obj, "object"); types = types.map(function(t) { return t.toLowerCase(); }); types.sort(); var str = types.map(function(t, index2) { var art = ~["a", "e", "i", "o", "u"].indexOf(t.charAt(0)) ? "an" : "a"; var or = types.length > 1 && index2 === types.length - 1 ? "or " : ""; return or + art + " " + t; }).join(", "); var objType = type(obj).toLowerCase(); if (!types.some(function(expected) { return objType === expected; })) { throw new AssertionError2(flagMsg + "object tested must be " + str + ", but " + objType + " given", void 0, ssfi); } }, "expectTypes"); } }); // node_modules/chai/lib/chai/utils/getActual.js var require_getActual = __commonJS({ "node_modules/chai/lib/chai/utils/getActual.js"(exports, module2) { module2.exports = /* @__PURE__ */ __name(function getActual(obj, args) { return args.length > 4 ? args[4] : obj._obj; }, "getActual"); } }); // node_modules/get-func-name/index.js var require_get_func_name = __commonJS({ "node_modules/get-func-name/index.js"(exports, module2) { "use strict"; var toString = Function.prototype.toString; var functionNameMatch = /\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/; function getFuncName(aFunc) { if (typeof aFunc !== "function") { return null; } var name = ""; if (typeof Function.prototype.name === "undefined" && typeof aFunc.name === "undefined") { var match = toString.call(aFunc).match(functionNameMatch); if (match) { name = match[1]; } } else { name = aFunc.name; } return name; } __name(getFuncName, "getFuncName"); module2.exports = getFuncName; } }); // node_modules/loupe/loupe.js var require_loupe = __commonJS({ "node_modules/loupe/loupe.js"(exports, module2) { (function(global2, factory) { typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.loupe = {})); })(exports, function(exports2) { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = /* @__PURE__ */ __name(function(obj2) { return typeof obj2; }, "_typeof"); } else { _typeof = /* @__PURE__ */ __name(function(obj2) { return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; }, "_typeof"); } return _typeof(obj); } __name(_typeof, "_typeof"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } __name(_slicedToArray, "_slicedToArray"); function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } __name(_arrayWithHoles, "_arrayWithHoles"); function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = void 0; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } __name(_iterableToArrayLimit, "_iterableToArrayLimit"); function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } __name(_unsupportedIterableToArray, "_unsupportedIterableToArray"); function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } __name(_arrayLikeToArray, "_arrayLikeToArray"); function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } __name(_nonIterableRest, "_nonIterableRest"); var ansiColors4 = { bold: ["1", "22"], dim: ["2", "22"], italic: ["3", "23"], underline: ["4", "24"], inverse: ["7", "27"], hidden: ["8", "28"], strike: ["9", "29"], black: ["30", "39"], red: ["31", "39"], green: ["32", "39"], yellow: ["33", "39"], blue: ["34", "39"], magenta: ["35", "39"], cyan: ["36", "39"], white: ["37", "39"], brightblack: ["30;1", "39"], brightred: ["31;1", "39"], brightgreen: ["32;1", "39"], brightyellow: ["33;1", "39"], brightblue: ["34;1", "39"], brightmagenta: ["35;1", "39"], brightcyan: ["36;1", "39"], brightwhite: ["37;1", "39"], grey: ["90", "39"] }; var styles = { special: "cyan", number: "yellow", bigint: "yellow", boolean: "yellow", undefined: "grey", null: "bold", string: "green", symbol: "green", date: "magenta", regexp: "red" }; var truncator = "\u2026"; function colorise(value, styleType) { var color = ansiColors4[styles[styleType]] || ansiColors4[styleType]; if (!color) { return String(value); } return "\x1B[".concat(color[0], "m").concat(String(value), "\x1B[").concat(color[1], "m"); } __name(colorise, "colorise"); function normaliseOptions() { var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref$showHidden = _ref.showHidden, showHidden = _ref$showHidden === void 0 ? false : _ref$showHidden, _ref$depth = _ref.depth, depth = _ref$depth === void 0 ? 2 : _ref$depth, _ref$colors = _ref.colors, colors = _ref$colors === void 0 ? false : _ref$colors, _ref$customInspect = _ref.customInspect, customInspect = _ref$customInspect === void 0 ? true : _ref$customInspect, _ref$showProxy = _ref.showProxy, showProxy = _ref$showProxy === void 0 ? false : _ref$showProxy, _ref$maxArrayLength = _ref.maxArrayLength, maxArrayLength = _ref$maxArrayLength === void 0 ? Infinity : _ref$maxArrayLength, _ref$breakLength = _ref.breakLength, breakLength = _ref$breakLength === void 0 ? Infinity : _ref$breakLength, _ref$seen = _ref.seen, seen = _ref$seen === void 0 ? [] : _ref$seen, _ref$truncate = _ref.truncate, truncate2 = _ref$truncate === void 0 ? Infinity : _ref$truncate, _ref$stylize = _ref.stylize, stylize = _ref$stylize === void 0 ? String : _ref$stylize; var options = { showHidden: Boolean(showHidden), depth: Number(depth), colors: Boolean(colors), customInspect: Boolean(customInspect), showProxy: Boolean(showProxy), maxArrayLength: Number(maxArrayLength), breakLength: Number(breakLength), truncate: Number(truncate2), seen, stylize }; if (options.colors) { options.stylize = colorise; } return options; } __name(normaliseOptions, "normaliseOptions"); function truncate(string, length) { var tail = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : truncator; string = String(string); var tailLength = tail.length; var stringLength = string.length; if (tailLength > length && stringLength > tailLength) { return tail; } if (stringLength > length && stringLength > tailLength) { return "".concat(string.slice(0, length - tailLength)).concat(tail); } return string; } __name(truncate, "truncate"); function inspectList(list, options, inspectItem) { var separator = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ", "; inspectItem = inspectItem || options.inspect; var size = list.length; if (size === 0) return ""; var originalLength = options.truncate; var output = ""; var peek = ""; var truncated = ""; for (var i = 0; i < size; i += 1) { var last = i + 1 === list.length; var secondToLast = i + 2 === list.length; truncated = "".concat(truncator, "(").concat(list.length - i, ")"); var value = list[i]; options.truncate = originalLength - output.length - (last ? 0 : separator.length); var string = peek || inspectItem(value, options) + (last ? "" : separator); var nextLength = output.length + string.length; var truncatedLength = nextLength + truncated.length; if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) { break; } if (!last && !secondToLast && truncatedLength > originalLength) { break; } peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator); if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) { break; } output += string; if (!last && !secondToLast && nextLength + peek.length >= originalLength) { truncated = "".concat(truncator, "(").concat(list.length - i - 1, ")"); break; } truncated = ""; } return "".concat(output).concat(truncated); } __name(inspectList, "inspectList"); function quoteComplexKey(key) { if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) { return key; } return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); } __name(quoteComplexKey, "quoteComplexKey"); function inspectProperty(_ref2, options) { var _ref3 = _slicedToArray(_ref2, 2), key = _ref3[0], value = _ref3[1]; options.truncate -= 2; if (typeof key === "string") { key = quoteComplexKey(key); } else if (typeof key !== "number") { key = "[".concat(options.inspect(key, options), "]"); } options.truncate -= key.length; value = options.inspect(value, options); return "".concat(key, ": ").concat(value); } __name(inspectProperty, "inspectProperty"); function inspectArray(array, options) { var nonIndexProperties = Object.keys(array).slice(array.length); if (!array.length && !nonIndexProperties.length) return "[]"; options.truncate -= 4; var listContents = inspectList(array, options); options.truncate -= listContents.length; var propertyContents = ""; if (nonIndexProperties.length) { propertyContents = inspectList(nonIndexProperties.map(function(key) { return [key, array[key]]; }), options, inspectProperty); } return "[ ".concat(listContents).concat(propertyContents ? ", ".concat(propertyContents) : "", " ]"); } __name(inspectArray, "inspectArray"); var toString = Function.prototype.toString; var functionNameMatch = /\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/; function getFuncName(aFunc) { if (typeof aFunc !== "function") { return null; } var name = ""; if (typeof Function.prototype.name === "undefined" && typeof aFunc.name === "undefined") { var match = toString.call(aFunc).match(functionNameMatch); if (match) { name = match[1]; } } else { name = aFunc.name; } return name; } __name(getFuncName, "getFuncName"); var getFuncName_1 = getFuncName; var getArrayName = /* @__PURE__ */ __name(function getArrayName2(array) { if (typeof Buffer === "function" && array instanceof Buffer) { return "Buffer"; } if (array[Symbol.toStringTag]) { return array[Symbol.toStringTag]; } return getFuncName_1(array.constructor); }, "getArrayName"); function inspectTypedArray(array, options) { var name = getArrayName(array); options.truncate -= name.length + 4; var nonIndexProperties = Object.keys(array).slice(array.length); if (!array.length && !nonIndexProperties.length) return "".concat(name, "[]"); var output = ""; for (var i = 0; i < array.length; i++) { var string = "".concat(options.stylize(truncate(array[i], options.truncate), "number")).concat(i === array.length - 1 ? "" : ", "); options.truncate -= string.length; if (array[i] !== array.length && options.truncate <= 3) { output += "".concat(truncator, "(").concat(array.length - array[i] + 1, ")"); break; } output += string; } var propertyContents = ""; if (nonIndexProperties.length) { propertyContents = inspectList(nonIndexProperties.map(function(key) { return [key, array[key]]; }), options, inspectProperty); } return "".concat(name, "[ ").concat(output).concat(propertyContents ? ", ".concat(propertyContents) : "", " ]"); } __name(inspectTypedArray, "inspectTypedArray"); function inspectDate(dateObject, options) { var stringRepresentation = dateObject.toJSON(); if (stringRepresentation === null) { return "Invalid Date"; } var split = stringRepresentation.split("T"); var date = split[0]; return options.stylize("".concat(date, "T").concat(truncate(split[1], options.truncate - date.length - 1)), "date"); } __name(inspectDate, "inspectDate"); function inspectFunction(func, options) { var name = getFuncName_1(func); if (!name) { return options.stylize("[Function]", "special"); } return options.stylize("[Function ".concat(truncate(name, options.truncate - 11), "]"), "special"); } __name(inspectFunction, "inspectFunction"); function inspectMapEntry(_ref, options) { var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1]; options.truncate -= 4; key = options.inspect(key, options); options.truncate -= key.length; value = options.inspect(value, options); return "".concat(key, " => ").concat(value); } __name(inspectMapEntry, "inspectMapEntry"); function mapToEntries(map2) { var entries = []; map2.forEach(function(value, key) { entries.push([key, value]); }); return entries; } __name(mapToEntries, "mapToEntries"); function inspectMap(map2, options) { var size = map2.size - 1; if (size <= 0) { return "Map{}"; } options.truncate -= 7; return "Map{ ".concat(inspectList(mapToEntries(map2), options, inspectMapEntry), " }"); } __name(inspectMap, "inspectMap"); var isNaN2 = Number.isNaN || function(i) { return i !== i; }; function inspectNumber(number, options) { if (isNaN2(number)) { return options.stylize("NaN", "number"); } if (number === Infinity) { return options.stylize("Infinity", "number"); } if (number === -Infinity) { return options.stylize("-Infinity", "number"); } if (number === 0) { return options.stylize(1 / number === Infinity ? "+0" : "-0", "number"); } return options.stylize(truncate(number, options.truncate), "number"); } __name(inspectNumber, "inspectNumber"); function inspectBigInt(number, options) { var nums = truncate(number.toString(), options.truncate - 1); if (nums !== truncator) nums += "n"; return options.stylize(nums, "bigint"); } __name(inspectBigInt, "inspectBigInt"); function inspectRegExp(value, options) { var flags = value.toString().split("/")[2]; var sourceLength = options.truncate - (2 + flags.length); var source = value.source; return options.stylize("/".concat(truncate(source, sourceLength), "/").concat(flags), "regexp"); } __name(inspectRegExp, "inspectRegExp"); function arrayFromSet(set) { var values = []; set.forEach(function(value) { values.push(value); }); return values; } __name(arrayFromSet, "arrayFromSet"); function inspectSet(set, options) { if (set.size === 0) return "Set{}"; options.truncate -= 7; return "Set{ ".concat(inspectList(arrayFromSet(set), options), " }"); } __name(inspectSet, "inspectSet"); var stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g"); var escapeCharacters = { "\b": "\\b", " ": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", "'": "\\'", "\\": "\\\\" }; var hex = 16; var unicodeLength = 4; function escape(char) { return escapeCharacters[char] || "\\u".concat("0000".concat(char.charCodeAt(0).toString(hex)).slice(-unicodeLength)); } __name(escape, "escape"); function inspectString(string, options) { if (stringEscapeChars.test(string)) { string = string.replace(stringEscapeChars, escape); } return options.stylize("'".concat(truncate(string, options.truncate - 2), "'"), "string"); } __name(inspectString, "inspectString"); function inspectSymbol(value) { if ("description" in Symbol.prototype) { return value.description ? "Symbol(".concat(value.description, ")") : "Symbol()"; } return value.toString(); } __name(inspectSymbol, "inspectSymbol"); var getPromiseValue = /* @__PURE__ */ __name(function getPromiseValue2() { return "Promise{\u2026}"; }, "getPromiseValue"); try { var _process$binding = process.binding("util"), getPromiseDetails = _process$binding.getPromiseDetails, kPending = _process$binding.kPending, kRejected = _process$binding.kRejected; if (Array.isArray(getPromiseDetails(Promise.resolve()))) { getPromiseValue = /* @__PURE__ */ __name(function getPromiseValue2(value, options) { var _getPromiseDetails = getPromiseDetails(value), _getPromiseDetails2 = _slicedToArray(_getPromiseDetails, 2), state = _getPromiseDetails2[0], innerValue = _getPromiseDetails2[1]; if (state === kPending) { return "Promise{}"; } return "Promise".concat(state === kRejected ? "!" : "", "{").concat(options.inspect(innerValue, options), "}"); }, "getPromiseValue"); } } catch (notNode) { } var inspectPromise = getPromiseValue; function inspectObject(object, options) { var properties = Object.getOwnPropertyNames(object); var symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : []; if (properties.length === 0 && symbols.length === 0) { return "{}"; } options.truncate -= 4; options.seen = options.seen || []; if (options.seen.indexOf(object) >= 0) { return "[Circular]"; } options.seen.push(object); var propertyContents = inspectList(properties.map(function(key) { return [key, object[key]]; }), options, inspectProperty); var symbolContents = inspectList(symbols.map(function(key) { return [key, object[key]]; }), options, inspectProperty); options.seen.pop(); var sep = ""; if (propertyContents && symbolContents) { sep = ", "; } return "{ ".concat(propertyContents).concat(sep).concat(symbolContents, " }"); } __name(inspectObject, "inspectObject"); var toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag ? Symbol.toStringTag : false; function inspectClass(value, options) { var name = ""; if (toStringTag && toStringTag in value) { name = value[toStringTag]; } name = name || getFuncName_1(value.constructor); if (!name || name === "_class") { name = ""; } options.truncate -= name.length; return "".concat(name).concat(inspectObject(value, options)); } __name(inspectClass, "inspectClass"); function inspectArguments(args, options) { if (args.length === 0) return "Arguments[]"; options.truncate -= 13; return "Arguments[ ".concat(inspectList(args, options), " ]"); } __name(inspectArguments, "inspectArguments"); var errorKeys = ["stack", "line", "column", "name", "message", "fileName", "lineNumber", "columnNumber", "number", "description"]; function inspectObject$1(error, options) { var properties = Object.getOwnPropertyNames(error).filter(function(key) { return errorKeys.indexOf(key) === -1; }); var name = error.name; options.truncate -= name.length; var message = ""; if (typeof error.message === "string") { message = truncate(error.message, options.truncate); } else { properties.unshift("message"); } message = message ? ": ".concat(message) : ""; options.truncate -= message.length + 5; var propertyContents = inspectList(properties.map(function(key) { return [key, error[key]]; }), options, inspectProperty); return "".concat(name).concat(message).concat(propertyContents ? " { ".concat(propertyContents, " }") : ""); } __name(inspectObject$1, "inspectObject$1"); function inspectAttribute(_ref, options) { var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1]; options.truncate -= 3; if (!value) { return "".concat(options.stylize(key, "yellow")); } return "".concat(options.stylize(key, "yellow"), "=").concat(options.stylize('"'.concat(value, '"'), "string")); } __name(inspectAttribute, "inspectAttribute"); function inspectHTMLCollection(collection, options) { return inspectList(collection, options, inspectHTML, "\n"); } __name(inspectHTMLCollection, "inspectHTMLCollection"); function inspectHTML(element, options) { var properties = element.getAttributeNames(); var name = element.tagName.toLowerCase(); var head = options.stylize("<".concat(name), "special"); var headClose = options.stylize(">", "special"); var tail = options.stylize(""), "special"); options.truncate -= name.length * 2 + 5; var propertyContents = ""; if (properties.length > 0) { propertyContents += " "; propertyContents += inspectList(properties.map(function(key) { return [key, element.getAttribute(key)]; }), options, inspectAttribute, " "); } options.truncate -= propertyContents.length; var truncate2 = options.truncate; var children = inspectHTMLCollection(element.children, options); if (children && children.length > truncate2) { children = "".concat(truncator, "(").concat(element.children.length, ")"); } return "".concat(head).concat(propertyContents).concat(headClose).concat(children).concat(tail); } __name(inspectHTML, "inspectHTML"); var symbolsSupported = typeof Symbol === "function" && typeof Symbol.for === "function"; var chaiInspect = symbolsSupported ? Symbol.for("chai/inspect") : "@@chai/inspect"; var nodeInspect = false; try { var nodeUtil = require("util"); nodeInspect = nodeUtil.inspect ? nodeUtil.inspect.custom : false; } catch (noNodeInspect) { nodeInspect = false; } function FakeMap() { this.key = "chai/loupe__" + Math.random() + Date.now(); } __name(FakeMap, "FakeMap"); FakeMap.prototype = { get: /* @__PURE__ */ __name(function get(key) { return key[this.key]; }, "get"), has: /* @__PURE__ */ __name(function has(key) { return this.key in key; }, "has"), set: /* @__PURE__ */ __name(function set(key, value) { if (Object.isExtensible(key)) { Object.defineProperty(key, this.key, { value, configurable: true }); } }, "set") }; var constructorMap = new (typeof WeakMap === "function" ? WeakMap : FakeMap)(); var stringTagMap = {}; var baseTypesMap = { undefined: /* @__PURE__ */ __name(function undefined$1(value, options) { return options.stylize("undefined", "undefined"); }, "undefined$1"), null: /* @__PURE__ */ __name(function _null(value, options) { return options.stylize(null, "null"); }, "_null"), boolean: /* @__PURE__ */ __name(function boolean(value, options) { return options.stylize(value, "boolean"); }, "boolean"), Boolean: /* @__PURE__ */ __name(function Boolean2(value, options) { return options.stylize(value, "boolean"); }, "Boolean"), number: inspectNumber, Number: inspectNumber, bigint: inspectBigInt, BigInt: inspectBigInt, string: inspectString, String: inspectString, function: inspectFunction, Function: inspectFunction, symbol: inspectSymbol, Symbol: inspectSymbol, Array: inspectArray, Date: inspectDate, Map: inspectMap, Set: inspectSet, RegExp: inspectRegExp, Promise: inspectPromise, WeakSet: /* @__PURE__ */ __name(function WeakSet2(value, options) { return options.stylize("WeakSet{\u2026}", "special"); }, "WeakSet"), WeakMap: /* @__PURE__ */ __name(function WeakMap2(value, options) { return options.stylize("WeakMap{\u2026}", "special"); }, "WeakMap"), Arguments: inspectArguments, Int8Array: inspectTypedArray, Uint8Array: inspectTypedArray, Uint8ClampedArray: inspectTypedArray, Int16Array: inspectTypedArray, Uint16Array: inspectTypedArray, Int32Array: inspectTypedArray, Uint32Array: inspectTypedArray, Float32Array: inspectTypedArray, Float64Array: inspectTypedArray, Generator: /* @__PURE__ */ __name(function Generator() { return ""; }, "Generator"), DataView: /* @__PURE__ */ __name(function DataView2() { return ""; }, "DataView"), ArrayBuffer: /* @__PURE__ */ __name(function ArrayBuffer2() { return ""; }, "ArrayBuffer"), Error: inspectObject$1, HTMLCollection: inspectHTMLCollection, NodeList: inspectHTMLCollection }; var inspectCustom = /* @__PURE__ */ __name(function inspectCustom2(value, options, type) { if (chaiInspect in value && typeof value[chaiInspect] === "function") { return value[chaiInspect](options); } if (nodeInspect && nodeInspect in value && typeof value[nodeInspect] === "function") { return value[nodeInspect](options.depth, options); } if ("inspect" in value && typeof value.inspect === "function") { return value.inspect(options.depth, options); } if ("constructor" in value && constructorMap.has(value.constructor)) { return constructorMap.get(value.constructor)(value, options); } if (stringTagMap[type]) { return stringTagMap[type](value, options); } return ""; }, "inspectCustom"); var toString$1 = Object.prototype.toString; function inspect(value, options) { options = normaliseOptions(options); options.inspect = inspect; var _options = options, customInspect = _options.customInspect; var type = value === null ? "null" : _typeof(value); if (type === "object") { type = toString$1.call(value).slice(8, -1); } if (baseTypesMap[type]) { return baseTypesMap[type](value, options); } if (customInspect && value) { var output = inspectCustom(value, options, type); if (output) { if (typeof output === "string") return output; return inspect(output, options); } } var proto = value ? Object.getPrototypeOf(value) : false; if (proto === Object.prototype || proto === null) { return inspectObject(value, options); } if (value && typeof HTMLElement === "function" && value instanceof HTMLElement) { return inspectHTML(value, options); } if ("constructor" in value) { if (value.constructor !== Object) { return inspectClass(value, options); } return inspectObject(value, options); } if (value === Object(value)) { return inspectObject(value, options); } return options.stylize(String(value), type); } __name(inspect, "inspect"); function registerConstructor(constructor, inspector) { if (constructorMap.has(constructor)) { return false; } constructorMap.set(constructor, inspector); return true; } __name(registerConstructor, "registerConstructor"); function registerStringTag(stringTag, inspector) { if (stringTag in stringTagMap) { return false; } stringTagMap[stringTag] = inspector; return true; } __name(registerStringTag, "registerStringTag"); var custom = chaiInspect; exports2.custom = custom; exports2.default = inspect; exports2.inspect = inspect; exports2.registerConstructor = registerConstructor; exports2.registerStringTag = registerStringTag; Object.defineProperty(exports2, "__esModule", { value: true }); }); } }); // node_modules/chai/lib/chai/config.js var require_config = __commonJS({ "node_modules/chai/lib/chai/config.js"(exports, module2) { module2.exports = { includeStack: false, showDiff: true, truncateThreshold: 40, useProxy: true, proxyExcludedKeys: ["then", "catch", "inspect", "toJSON"] }; } }); // node_modules/chai/lib/chai/utils/inspect.js var require_inspect = __commonJS({ "node_modules/chai/lib/chai/utils/inspect.js"(exports, module2) { var getName = require_get_func_name(); var loupe = require_loupe(); var config2 = require_config(); module2.exports = inspect; function inspect(obj, showHidden, depth, colors) { var options = { colors, depth: typeof depth === "undefined" ? 2 : depth, showHidden, truncate: config2.truncateThreshold ? config2.truncateThreshold : Infinity }; return loupe.inspect(obj, options); } __name(inspect, "inspect"); } }); // node_modules/chai/lib/chai/utils/objDisplay.js var require_objDisplay = __commonJS({ "node_modules/chai/lib/chai/utils/objDisplay.js"(exports, module2) { var inspect = require_inspect(); var config2 = require_config(); module2.exports = /* @__PURE__ */ __name(function objDisplay(obj) { var str = inspect(obj), type = Object.prototype.toString.call(obj); if (config2.truncateThreshold && str.length >= config2.truncateThreshold) { if (type === "[object Function]") { return !obj.name || obj.name === "" ? "[Function]" : "[Function: " + obj.name + "]"; } else if (type === "[object Array]") { return "[ Array(" + obj.length + ") ]"; } else if (type === "[object Object]") { var keys = Object.keys(obj), kstr = keys.length > 2 ? keys.splice(0, 2).join(", ") + ", ..." : keys.join(", "); return "{ Object (" + kstr + ") }"; } else { return str; } } else { return str; } }, "objDisplay"); } }); // node_modules/chai/lib/chai/utils/getMessage.js var require_getMessage = __commonJS({ "node_modules/chai/lib/chai/utils/getMessage.js"(exports, module2) { var flag = require_flag(); var getActual = require_getActual(); var objDisplay = require_objDisplay(); module2.exports = /* @__PURE__ */ __name(function getMessage(obj, args) { var negate = flag(obj, "negate"), val = flag(obj, "object"), expected = args[3], actual = getActual(obj, args), msg = negate ? args[2] : args[1], flagMsg = flag(obj, "message"); if (typeof msg === "function") msg = msg(); msg = msg || ""; msg = msg.replace(/#\{this\}/g, function() { return objDisplay(val); }).replace(/#\{act\}/g, function() { return objDisplay(actual); }).replace(/#\{exp\}/g, function() { return objDisplay(expected); }); return flagMsg ? flagMsg + ": " + msg : msg; }, "getMessage"); } }); // node_modules/chai/lib/chai/utils/transferFlags.js var require_transferFlags = __commonJS({ "node_modules/chai/lib/chai/utils/transferFlags.js"(exports, module2) { module2.exports = /* @__PURE__ */ __name(function transferFlags(assertion, object, includeAll) { var flags = assertion.__flags || (assertion.__flags = /* @__PURE__ */ Object.create(null)); if (!object.__flags) { object.__flags = /* @__PURE__ */ Object.create(null); } includeAll = arguments.length === 3 ? includeAll : true; for (var flag in flags) { if (includeAll || flag !== "object" && flag !== "ssfi" && flag !== "lockSsfi" && flag != "message") { object.__flags[flag] = flags[flag]; } } }, "transferFlags"); } }); // node_modules/deep-eql/index.js var require_deep_eql = __commonJS({ "node_modules/deep-eql/index.js"(exports, module2) { "use strict"; var type = require_type_detect(); function FakeMap() { this._key = "chai/deep-eql__" + Math.random() + Date.now(); } __name(FakeMap, "FakeMap"); FakeMap.prototype = { get: /* @__PURE__ */ __name(function get(key) { return key[this._key]; }, "get"), set: /* @__PURE__ */ __name(function set(key, value) { if (Object.isExtensible(key)) { Object.defineProperty(key, this._key, { value, configurable: true }); } }, "set") }; var MemoizeMap = typeof WeakMap === "function" ? WeakMap : FakeMap; function memoizeCompare(leftHandOperand, rightHandOperand, memoizeMap) { if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) { return null; } var leftHandMap = memoizeMap.get(leftHandOperand); if (leftHandMap) { var result = leftHandMap.get(rightHandOperand); if (typeof result === "boolean") { return result; } } return null; } __name(memoizeCompare, "memoizeCompare"); function memoizeSet(leftHandOperand, rightHandOperand, memoizeMap, result) { if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) { return; } var leftHandMap = memoizeMap.get(leftHandOperand); if (leftHandMap) { leftHandMap.set(rightHandOperand, result); } else { leftHandMap = new MemoizeMap(); leftHandMap.set(rightHandOperand, result); memoizeMap.set(leftHandOperand, leftHandMap); } } __name(memoizeSet, "memoizeSet"); module2.exports = deepEqual; module2.exports.MemoizeMap = MemoizeMap; function deepEqual(leftHandOperand, rightHandOperand, options) { if (options && options.comparator) { return extensiveDeepEqual(leftHandOperand, rightHandOperand, options); } var simpleResult = simpleEqual(leftHandOperand, rightHandOperand); if (simpleResult !== null) { return simpleResult; } return extensiveDeepEqual(leftHandOperand, rightHandOperand, options); } __name(deepEqual, "deepEqual"); function simpleEqual(leftHandOperand, rightHandOperand) { if (leftHandOperand === rightHandOperand) { return leftHandOperand !== 0 || 1 / leftHandOperand === 1 / rightHandOperand; } if (leftHandOperand !== leftHandOperand && rightHandOperand !== rightHandOperand) { return true; } if (isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) { return false; } return null; } __name(simpleEqual, "simpleEqual"); function extensiveDeepEqual(leftHandOperand, rightHandOperand, options) { options = options || {}; options.memoize = options.memoize === false ? false : options.memoize || new MemoizeMap(); var comparator = options && options.comparator; var memoizeResultLeft = memoizeCompare(leftHandOperand, rightHandOperand, options.memoize); if (memoizeResultLeft !== null) { return memoizeResultLeft; } var memoizeResultRight = memoizeCompare(rightHandOperand, leftHandOperand, options.memoize); if (memoizeResultRight !== null) { return memoizeResultRight; } if (comparator) { var comparatorResult = comparator(leftHandOperand, rightHandOperand); if (comparatorResult === false || comparatorResult === true) { memoizeSet(leftHandOperand, rightHandOperand, options.memoize, comparatorResult); return comparatorResult; } var simpleResult = simpleEqual(leftHandOperand, rightHandOperand); if (simpleResult !== null) { return simpleResult; } } var leftHandType = type(leftHandOperand); if (leftHandType !== type(rightHandOperand)) { memoizeSet(leftHandOperand, rightHandOperand, options.memoize, false); return false; } memoizeSet(leftHandOperand, rightHandOperand, options.memoize, true); var result = extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options); memoizeSet(leftHandOperand, rightHandOperand, options.memoize, result); return result; } __name(extensiveDeepEqual, "extensiveDeepEqual"); function extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options) { switch (leftHandType) { case "String": case "Number": case "Boolean": case "Date": return deepEqual(leftHandOperand.valueOf(), rightHandOperand.valueOf()); case "Promise": case "Symbol": case "function": case "WeakMap": case "WeakSet": return leftHandOperand === rightHandOperand; case "Error": return keysEqual(leftHandOperand, rightHandOperand, ["name", "message", "code"], options); case "Arguments": case "Int8Array": case "Uint8Array": case "Uint8ClampedArray": case "Int16Array": case "Uint16Array": case "Int32Array": case "Uint32Array": case "Float32Array": case "Float64Array": case "Array": return iterableEqual(leftHandOperand, rightHandOperand, options); case "RegExp": return regexpEqual(leftHandOperand, rightHandOperand); case "Generator": return generatorEqual(leftHandOperand, rightHandOperand, options); case "DataView": return iterableEqual(new Uint8Array(leftHandOperand.buffer), new Uint8Array(rightHandOperand.buffer), options); case "ArrayBuffer": return iterableEqual(new Uint8Array(leftHandOperand), new Uint8Array(rightHandOperand), options); case "Set": return entriesEqual(leftHandOperand, rightHandOperand, options); case "Map": return entriesEqual(leftHandOperand, rightHandOperand, options); case "Temporal.PlainDate": case "Temporal.PlainTime": case "Temporal.PlainDateTime": case "Temporal.Instant": case "Temporal.ZonedDateTime": case "Temporal.PlainYearMonth": case "Temporal.PlainMonthDay": return leftHandOperand.equals(rightHandOperand); case "Temporal.Duration": return leftHandOperand.total("nanoseconds") === rightHandOperand.total("nanoseconds"); case "Temporal.TimeZone": case "Temporal.Calendar": return leftHandOperand.toString() === rightHandOperand.toString(); default: return objectEqual(leftHandOperand, rightHandOperand, options); } } __name(extensiveDeepEqualByType, "extensiveDeepEqualByType"); function regexpEqual(leftHandOperand, rightHandOperand) { return leftHandOperand.toString() === rightHandOperand.toString(); } __name(regexpEqual, "regexpEqual"); function entriesEqual(leftHandOperand, rightHandOperand, options) { if (leftHandOperand.size !== rightHandOperand.size) { return false; } if (leftHandOperand.size === 0) { return true; } var leftHandItems = []; var rightHandItems = []; leftHandOperand.forEach(/* @__PURE__ */ __name(function gatherEntries(key, value) { leftHandItems.push([key, value]); }, "gatherEntries")); rightHandOperand.forEach(/* @__PURE__ */ __name(function gatherEntries(key, value) { rightHandItems.push([key, value]); }, "gatherEntries")); return iterableEqual(leftHandItems.sort(), rightHandItems.sort(), options); } __name(entriesEqual, "entriesEqual"); function iterableEqual(leftHandOperand, rightHandOperand, options) { var length = leftHandOperand.length; if (length !== rightHandOperand.length) { return false; } if (length === 0) { return true; } var index2 = -1; while (++index2 < length) { if (deepEqual(leftHandOperand[index2], rightHandOperand[index2], options) === false) { return false; } } return true; } __name(iterableEqual, "iterableEqual"); function generatorEqual(leftHandOperand, rightHandOperand, options) { return iterableEqual(getGeneratorEntries(leftHandOperand), getGeneratorEntries(rightHandOperand), options); } __name(generatorEqual, "generatorEqual"); function hasIteratorFunction(target) { return typeof Symbol !== "undefined" && typeof target === "object" && typeof Symbol.iterator !== "undefined" && typeof target[Symbol.iterator] === "function"; } __name(hasIteratorFunction, "hasIteratorFunction"); function getIteratorEntries(target) { if (hasIteratorFunction(target)) { try { return getGeneratorEntries(target[Symbol.iterator]()); } catch (iteratorError) { return []; } } return []; } __name(getIteratorEntries, "getIteratorEntries"); function getGeneratorEntries(generator) { var generatorResult = generator.next(); var accumulator = [generatorResult.value]; while (generatorResult.done === false) { generatorResult = generator.next(); accumulator.push(generatorResult.value); } return accumulator; } __name(getGeneratorEntries, "getGeneratorEntries"); function getEnumerableKeys(target) { var keys = []; for (var key in target) { keys.push(key); } return keys; } __name(getEnumerableKeys, "getEnumerableKeys"); function getEnumerableSymbols(target) { var keys = []; var allKeys = Object.getOwnPropertySymbols(target); for (var i = 0; i < allKeys.length; i += 1) { var key = allKeys[i]; if (Object.getOwnPropertyDescriptor(target, key).enumerable) { keys.push(key); } } return keys; } __name(getEnumerableSymbols, "getEnumerableSymbols"); function keysEqual(leftHandOperand, rightHandOperand, keys, options) { var length = keys.length; if (length === 0) { return true; } for (var i = 0; i < length; i += 1) { if (deepEqual(leftHandOperand[keys[i]], rightHandOperand[keys[i]], options) === false) { return false; } } return true; } __name(keysEqual, "keysEqual"); function objectEqual(leftHandOperand, rightHandOperand, options) { var leftHandKeys = getEnumerableKeys(leftHandOperand); var rightHandKeys = getEnumerableKeys(rightHandOperand); var leftHandSymbols = getEnumerableSymbols(leftHandOperand); var rightHandSymbols = getEnumerableSymbols(rightHandOperand); leftHandKeys = leftHandKeys.concat(leftHandSymbols); rightHandKeys = rightHandKeys.concat(rightHandSymbols); if (leftHandKeys.length && leftHandKeys.length === rightHandKeys.length) { if (iterableEqual(mapSymbols(leftHandKeys).sort(), mapSymbols(rightHandKeys).sort()) === false) { return false; } return keysEqual(leftHandOperand, rightHandOperand, leftHandKeys, options); } var leftHandEntries = getIteratorEntries(leftHandOperand); var rightHandEntries = getIteratorEntries(rightHandOperand); if (leftHandEntries.length && leftHandEntries.length === rightHandEntries.length) { leftHandEntries.sort(); rightHandEntries.sort(); return iterableEqual(leftHandEntries, rightHandEntries, options); } if (leftHandKeys.length === 0 && leftHandEntries.length === 0 && rightHandKeys.length === 0 && rightHandEntries.length === 0) { return true; } return false; } __name(objectEqual, "objectEqual"); function isPrimitive(value) { return value === null || typeof value !== "object"; } __name(isPrimitive, "isPrimitive"); function mapSymbols(arr) { return arr.map(/* @__PURE__ */ __name(function mapSymbol(entry) { if (typeof entry === "symbol") { return entry.toString(); } return entry; }, "mapSymbol")); } __name(mapSymbols, "mapSymbols"); } }); // node_modules/chai/lib/chai/utils/isProxyEnabled.js var require_isProxyEnabled = __commonJS({ "node_modules/chai/lib/chai/utils/isProxyEnabled.js"(exports, module2) { var config2 = require_config(); module2.exports = /* @__PURE__ */ __name(function isProxyEnabled() { return config2.useProxy && typeof Proxy !== "undefined" && typeof Reflect !== "undefined"; }, "isProxyEnabled"); } }); // node_modules/chai/lib/chai/utils/addProperty.js var require_addProperty = __commonJS({ "node_modules/chai/lib/chai/utils/addProperty.js"(exports, module2) { var chai2 = require_chai(); var flag = require_flag(); var isProxyEnabled = require_isProxyEnabled(); var transferFlags = require_transferFlags(); module2.exports = /* @__PURE__ */ __name(function addProperty(ctx, name, getter) { getter = getter === void 0 ? function() { } : getter; Object.defineProperty(ctx, name, { get: /* @__PURE__ */ __name(function propertyGetter() { if (!isProxyEnabled() && !flag(this, "lockSsfi")) { flag(this, "ssfi", propertyGetter); } var result = getter.call(this); if (result !== void 0) return result; var newAssertion = new chai2.Assertion(); transferFlags(this, newAssertion); return newAssertion; }, "propertyGetter"), configurable: true }); }, "addProperty"); } }); // node_modules/chai/lib/chai/utils/addLengthGuard.js var require_addLengthGuard = __commonJS({ "node_modules/chai/lib/chai/utils/addLengthGuard.js"(exports, module2) { var fnLengthDesc = Object.getOwnPropertyDescriptor(function() { }, "length"); module2.exports = /* @__PURE__ */ __name(function addLengthGuard(fn, assertionName, isChainable) { if (!fnLengthDesc.configurable) return fn; Object.defineProperty(fn, "length", { get: function() { if (isChainable) { throw Error("Invalid Chai property: " + assertionName + '.length. Due to a compatibility issue, "length" cannot directly follow "' + assertionName + '". Use "' + assertionName + '.lengthOf" instead.'); } throw Error("Invalid Chai property: " + assertionName + '.length. See docs for proper usage of "' + assertionName + '".'); } }); return fn; }, "addLengthGuard"); } }); // node_modules/chai/lib/chai/utils/getProperties.js var require_getProperties = __commonJS({ "node_modules/chai/lib/chai/utils/getProperties.js"(exports, module2) { module2.exports = /* @__PURE__ */ __name(function getProperties(object) { var result = Object.getOwnPropertyNames(object); function addProperty(property) { if (result.indexOf(property) === -1) { result.push(property); } } __name(addProperty, "addProperty"); var proto = Object.getPrototypeOf(object); while (proto !== null) { Object.getOwnPropertyNames(proto).forEach(addProperty); proto = Object.getPrototypeOf(proto); } return result; }, "getProperties"); } }); // node_modules/chai/lib/chai/utils/proxify.js var require_proxify = __commonJS({ "node_modules/chai/lib/chai/utils/proxify.js"(exports, module2) { var config2 = require_config(); var flag = require_flag(); var getProperties = require_getProperties(); var isProxyEnabled = require_isProxyEnabled(); var builtins = ["__flags", "__methods", "_obj", "assert"]; module2.exports = /* @__PURE__ */ __name(function proxify(obj, nonChainableMethodName) { if (!isProxyEnabled()) return obj; return new Proxy(obj, { get: /* @__PURE__ */ __name(function proxyGetter(target, property) { if (typeof property === "string" && config2.proxyExcludedKeys.indexOf(property) === -1 && !Reflect.has(target, property)) { if (nonChainableMethodName) { throw Error("Invalid Chai property: " + nonChainableMethodName + "." + property + '. See docs for proper usage of "' + nonChainableMethodName + '".'); } var suggestion = null; var suggestionDistance = 4; getProperties(target).forEach(function(prop) { if (!Object.prototype.hasOwnProperty(prop) && builtins.indexOf(prop) === -1) { var dist = stringDistanceCapped(property, prop, suggestionDistance); if (dist < suggestionDistance) { suggestion = prop; suggestionDistance = dist; } } }); if (suggestion !== null) { throw Error("Invalid Chai property: " + property + '. Did you mean "' + suggestion + '"?'); } else { throw Error("Invalid Chai property: " + property); } } if (builtins.indexOf(property) === -1 && !flag(target, "lockSsfi")) { flag(target, "ssfi", proxyGetter); } return Reflect.get(target, property); }, "proxyGetter") }); }, "proxify"); function stringDistanceCapped(strA, strB, cap) { if (Math.abs(strA.length - strB.length) >= cap) { return cap; } var memo = []; for (var i = 0; i <= strA.length; i++) { memo[i] = Array(strB.length + 1).fill(0); memo[i][0] = i; } for (var j = 0; j < strB.length; j++) { memo[0][j] = j; } for (var i = 1; i <= strA.length; i++) { var ch = strA.charCodeAt(i - 1); for (var j = 1; j <= strB.length; j++) { if (Math.abs(i - j) >= cap) { memo[i][j] = cap; continue; } memo[i][j] = Math.min(memo[i - 1][j] + 1, memo[i][j - 1] + 1, memo[i - 1][j - 1] + (ch === strB.charCodeAt(j - 1) ? 0 : 1)); } } return memo[strA.length][strB.length]; } __name(stringDistanceCapped, "stringDistanceCapped"); } }); // node_modules/chai/lib/chai/utils/addMethod.js var require_addMethod = __commonJS({ "node_modules/chai/lib/chai/utils/addMethod.js"(exports, module2) { var addLengthGuard = require_addLengthGuard(); var chai2 = require_chai(); var flag = require_flag(); var proxify = require_proxify(); var transferFlags = require_transferFlags(); module2.exports = /* @__PURE__ */ __name(function addMethod(ctx, name, method) { var methodWrapper = /* @__PURE__ */ __name(function() { if (!flag(this, "lockSsfi")) { flag(this, "ssfi", methodWrapper); } var result = method.apply(this, arguments); if (result !== void 0) return result; var newAssertion = new chai2.Assertion(); transferFlags(this, newAssertion); return newAssertion; }, "methodWrapper"); addLengthGuard(methodWrapper, name, false); ctx[name] = proxify(methodWrapper, name); }, "addMethod"); } }); // node_modules/chai/lib/chai/utils/overwriteProperty.js var require_overwriteProperty = __commonJS({ "node_modules/chai/lib/chai/utils/overwriteProperty.js"(exports, module2) { var chai2 = require_chai(); var flag = require_flag(); var isProxyEnabled = require_isProxyEnabled(); var transferFlags = require_transferFlags(); module2.exports = /* @__PURE__ */ __name(function overwriteProperty(ctx, name, getter) { var _get = Object.getOwnPropertyDescriptor(ctx, name), _super = /* @__PURE__ */ __name(function() { }, "_super"); if (_get && typeof _get.get === "function") _super = _get.get; Object.defineProperty(ctx, name, { get: /* @__PURE__ */ __name(function overwritingPropertyGetter() { if (!isProxyEnabled() && !flag(this, "lockSsfi")) { flag(this, "ssfi", overwritingPropertyGetter); } var origLockSsfi = flag(this, "lockSsfi"); flag(this, "lockSsfi", true); var result = getter(_super).call(this); flag(this, "lockSsfi", origLockSsfi); if (result !== void 0) { return result; } var newAssertion = new chai2.Assertion(); transferFlags(this, newAssertion); return newAssertion; }, "overwritingPropertyGetter"), configurable: true }); }, "overwriteProperty"); } }); // node_modules/chai/lib/chai/utils/overwriteMethod.js var require_overwriteMethod = __commonJS({ "node_modules/chai/lib/chai/utils/overwriteMethod.js"(exports, module2) { var addLengthGuard = require_addLengthGuard(); var chai2 = require_chai(); var flag = require_flag(); var proxify = require_proxify(); var transferFlags = require_transferFlags(); module2.exports = /* @__PURE__ */ __name(function overwriteMethod(ctx, name, method) { var _method = ctx[name], _super = /* @__PURE__ */ __name(function() { throw new Error(name + " is not a function"); }, "_super"); if (_method && typeof _method === "function") _super = _method; var overwritingMethodWrapper = /* @__PURE__ */ __name(function() { if (!flag(this, "lockSsfi")) { flag(this, "ssfi", overwritingMethodWrapper); } var origLockSsfi = flag(this, "lockSsfi"); flag(this, "lockSsfi", true); var result = method(_super).apply(this, arguments); flag(this, "lockSsfi", origLockSsfi); if (result !== void 0) { return result; } var newAssertion = new chai2.Assertion(); transferFlags(this, newAssertion); return newAssertion; }, "overwritingMethodWrapper"); addLengthGuard(overwritingMethodWrapper, name, false); ctx[name] = proxify(overwritingMethodWrapper, name); }, "overwriteMethod"); } }); // node_modules/chai/lib/chai/utils/addChainableMethod.js var require_addChainableMethod = __commonJS({ "node_modules/chai/lib/chai/utils/addChainableMethod.js"(exports, module2) { var addLengthGuard = require_addLengthGuard(); var chai2 = require_chai(); var flag = require_flag(); var proxify = require_proxify(); var transferFlags = require_transferFlags(); var canSetPrototype = typeof Object.setPrototypeOf === "function"; var testFn = /* @__PURE__ */ __name(function() { }, "testFn"); var excludeNames = Object.getOwnPropertyNames(testFn).filter(function(name) { var propDesc = Object.getOwnPropertyDescriptor(testFn, name); if (typeof propDesc !== "object") return true; return !propDesc.configurable; }); var call = Function.prototype.call; var apply2 = Function.prototype.apply; module2.exports = /* @__PURE__ */ __name(function addChainableMethod(ctx, name, method, chainingBehavior) { if (typeof chainingBehavior !== "function") { chainingBehavior = /* @__PURE__ */ __name(function() { }, "chainingBehavior"); } var chainableBehavior = { method, chainingBehavior }; if (!ctx.__methods) { ctx.__methods = {}; } ctx.__methods[name] = chainableBehavior; Object.defineProperty(ctx, name, { get: /* @__PURE__ */ __name(function chainableMethodGetter() { chainableBehavior.chainingBehavior.call(this); var chainableMethodWrapper = /* @__PURE__ */ __name(function() { if (!flag(this, "lockSsfi")) { flag(this, "ssfi", chainableMethodWrapper); } var result = chainableBehavior.method.apply(this, arguments); if (result !== void 0) { return result; } var newAssertion = new chai2.Assertion(); transferFlags(this, newAssertion); return newAssertion; }, "chainableMethodWrapper"); addLengthGuard(chainableMethodWrapper, name, true); if (canSetPrototype) { var prototype = Object.create(this); prototype.call = call; prototype.apply = apply2; Object.setPrototypeOf(chainableMethodWrapper, prototype); } else { var asserterNames = Object.getOwnPropertyNames(ctx); asserterNames.forEach(function(asserterName) { if (excludeNames.indexOf(asserterName) !== -1) { return; } var pd = Object.getOwnPropertyDescriptor(ctx, asserterName); Object.defineProperty(chainableMethodWrapper, asserterName, pd); }); } transferFlags(this, chainableMethodWrapper); return proxify(chainableMethodWrapper); }, "chainableMethodGetter"), configurable: true }); }, "addChainableMethod"); } }); // node_modules/chai/lib/chai/utils/overwriteChainableMethod.js var require_overwriteChainableMethod = __commonJS({ "node_modules/chai/lib/chai/utils/overwriteChainableMethod.js"(exports, module2) { var chai2 = require_chai(); var transferFlags = require_transferFlags(); module2.exports = /* @__PURE__ */ __name(function overwriteChainableMethod(ctx, name, method, chainingBehavior) { var chainableBehavior = ctx.__methods[name]; var _chainingBehavior = chainableBehavior.chainingBehavior; chainableBehavior.chainingBehavior = /* @__PURE__ */ __name(function overwritingChainableMethodGetter() { var result = chainingBehavior(_chainingBehavior).call(this); if (result !== void 0) { return result; } var newAssertion = new chai2.Assertion(); transferFlags(this, newAssertion); return newAssertion; }, "overwritingChainableMethodGetter"); var _method = chainableBehavior.method; chainableBehavior.method = /* @__PURE__ */ __name(function overwritingChainableMethodWrapper() { var result = method(_method).apply(this, arguments); if (result !== void 0) { return result; } var newAssertion = new chai2.Assertion(); transferFlags(this, newAssertion); return newAssertion; }, "overwritingChainableMethodWrapper"); }, "overwriteChainableMethod"); } }); // node_modules/chai/lib/chai/utils/compareByInspect.js var require_compareByInspect = __commonJS({ "node_modules/chai/lib/chai/utils/compareByInspect.js"(exports, module2) { var inspect = require_inspect(); module2.exports = /* @__PURE__ */ __name(function compareByInspect(a, b) { return inspect(a) < inspect(b) ? -1 : 1; }, "compareByInspect"); } }); // node_modules/chai/lib/chai/utils/getOwnEnumerablePropertySymbols.js var require_getOwnEnumerablePropertySymbols = __commonJS({ "node_modules/chai/lib/chai/utils/getOwnEnumerablePropertySymbols.js"(exports, module2) { module2.exports = /* @__PURE__ */ __name(function getOwnEnumerablePropertySymbols(obj) { if (typeof Object.getOwnPropertySymbols !== "function") return []; return Object.getOwnPropertySymbols(obj).filter(function(sym) { return Object.getOwnPropertyDescriptor(obj, sym).enumerable; }); }, "getOwnEnumerablePropertySymbols"); } }); // node_modules/chai/lib/chai/utils/getOwnEnumerableProperties.js var require_getOwnEnumerableProperties = __commonJS({ "node_modules/chai/lib/chai/utils/getOwnEnumerableProperties.js"(exports, module2) { var getOwnEnumerablePropertySymbols = require_getOwnEnumerablePropertySymbols(); module2.exports = /* @__PURE__ */ __name(function getOwnEnumerableProperties(obj) { return Object.keys(obj).concat(getOwnEnumerablePropertySymbols(obj)); }, "getOwnEnumerableProperties"); } }); // node_modules/check-error/index.js var require_check_error = __commonJS({ "node_modules/check-error/index.js"(exports, module2) { "use strict"; function compatibleInstance(thrown, errorLike) { return errorLike instanceof Error && thrown === errorLike; } __name(compatibleInstance, "compatibleInstance"); function compatibleConstructor(thrown, errorLike) { if (errorLike instanceof Error) { return thrown.constructor === errorLike.constructor || thrown instanceof errorLike.constructor; } else if (errorLike.prototype instanceof Error || errorLike === Error) { return thrown.constructor === errorLike || thrown instanceof errorLike; } return false; } __name(compatibleConstructor, "compatibleConstructor"); function compatibleMessage(thrown, errMatcher) { var comparisonString = typeof thrown === "string" ? thrown : thrown.message; if (errMatcher instanceof RegExp) { return errMatcher.test(comparisonString); } else if (typeof errMatcher === "string") { return comparisonString.indexOf(errMatcher) !== -1; } return false; } __name(compatibleMessage, "compatibleMessage"); var functionNameMatch = /\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\(\/]+)/; function getFunctionName(constructorFn) { var name = ""; if (typeof constructorFn.name === "undefined") { var match = String(constructorFn).match(functionNameMatch); if (match) { name = match[1]; } } else { name = constructorFn.name; } return name; } __name(getFunctionName, "getFunctionName"); function getConstructorName(errorLike) { var constructorName = errorLike; if (errorLike instanceof Error) { constructorName = getFunctionName(errorLike.constructor); } else if (typeof errorLike === "function") { constructorName = getFunctionName(errorLike).trim() || getFunctionName(new errorLike()); } return constructorName; } __name(getConstructorName, "getConstructorName"); function getMessage(errorLike) { var msg = ""; if (errorLike && errorLike.message) { msg = errorLike.message; } else if (typeof errorLike === "string") { msg = errorLike; } return msg; } __name(getMessage, "getMessage"); module2.exports = { compatibleInstance, compatibleConstructor, compatibleMessage, getMessage, getConstructorName }; } }); // node_modules/chai/lib/chai/utils/isNaN.js var require_isNaN = __commonJS({ "node_modules/chai/lib/chai/utils/isNaN.js"(exports, module2) { function isNaN2(value) { return value !== value; } __name(isNaN2, "isNaN"); module2.exports = Number.isNaN || isNaN2; } }); // node_modules/chai/lib/chai/utils/getOperator.js var require_getOperator = __commonJS({ "node_modules/chai/lib/chai/utils/getOperator.js"(exports, module2) { var type = require_type_detect(); var flag = require_flag(); function isObjectType(obj) { var objectType = type(obj); var objectTypes = ["Array", "Object", "function"]; return objectTypes.indexOf(objectType) !== -1; } __name(isObjectType, "isObjectType"); module2.exports = /* @__PURE__ */ __name(function getOperator(obj, args) { var operator = flag(obj, "operator"); var negate = flag(obj, "negate"); var expected = args[3]; var msg = negate ? args[2] : args[1]; if (operator) { return operator; } if (typeof msg === "function") msg = msg(); msg = msg || ""; if (!msg) { return void 0; } if (/\shave\s/.test(msg)) { return void 0; } var isObject = isObjectType(expected); if (/\snot\s/.test(msg)) { return isObject ? "notDeepStrictEqual" : "notStrictEqual"; } return isObject ? "deepStrictEqual" : "strictEqual"; }, "getOperator"); } }); // node_modules/chai/lib/chai/utils/index.js var require_utils5 = __commonJS({ "node_modules/chai/lib/chai/utils/index.js"(exports) { var pathval = require_pathval(); exports.test = require_test(); exports.type = require_type_detect(); exports.expectTypes = require_expectTypes(); exports.getMessage = require_getMessage(); exports.getActual = require_getActual(); exports.inspect = require_inspect(); exports.objDisplay = require_objDisplay(); exports.flag = require_flag(); exports.transferFlags = require_transferFlags(); exports.eql = require_deep_eql(); exports.getPathInfo = pathval.getPathInfo; exports.hasProperty = pathval.hasProperty; exports.getName = require_get_func_name(); exports.addProperty = require_addProperty(); exports.addMethod = require_addMethod(); exports.overwriteProperty = require_overwriteProperty(); exports.overwriteMethod = require_overwriteMethod(); exports.addChainableMethod = require_addChainableMethod(); exports.overwriteChainableMethod = require_overwriteChainableMethod(); exports.compareByInspect = require_compareByInspect(); exports.getOwnEnumerablePropertySymbols = require_getOwnEnumerablePropertySymbols(); exports.getOwnEnumerableProperties = require_getOwnEnumerableProperties(); exports.checkError = require_check_error(); exports.proxify = require_proxify(); exports.addLengthGuard = require_addLengthGuard(); exports.isProxyEnabled = require_isProxyEnabled(); exports.isNaN = require_isNaN(); exports.getOperator = require_getOperator(); } }); // node_modules/chai/lib/chai/assertion.js var require_assertion = __commonJS({ "node_modules/chai/lib/chai/assertion.js"(exports, module2) { var config2 = require_config(); module2.exports = function(_chai, util2) { var AssertionError2 = _chai.AssertionError, flag = util2.flag; _chai.Assertion = Assertion2; function Assertion2(obj, msg, ssfi, lockSsfi) { flag(this, "ssfi", ssfi || Assertion2); flag(this, "lockSsfi", lockSsfi); flag(this, "object", obj); flag(this, "message", msg); return util2.proxify(this); } __name(Assertion2, "Assertion"); Object.defineProperty(Assertion2, "includeStack", { get: function() { console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."); return config2.includeStack; }, set: function(value) { console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."); config2.includeStack = value; } }); Object.defineProperty(Assertion2, "showDiff", { get: function() { console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."); return config2.showDiff; }, set: function(value) { console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."); config2.showDiff = value; } }); Assertion2.addProperty = function(name, fn) { util2.addProperty(this.prototype, name, fn); }; Assertion2.addMethod = function(name, fn) { util2.addMethod(this.prototype, name, fn); }; Assertion2.addChainableMethod = function(name, fn, chainingBehavior) { util2.addChainableMethod(this.prototype, name, fn, chainingBehavior); }; Assertion2.overwriteProperty = function(name, fn) { util2.overwriteProperty(this.prototype, name, fn); }; Assertion2.overwriteMethod = function(name, fn) { util2.overwriteMethod(this.prototype, name, fn); }; Assertion2.overwriteChainableMethod = function(name, fn, chainingBehavior) { util2.overwriteChainableMethod(this.prototype, name, fn, chainingBehavior); }; Assertion2.prototype.assert = function(expr, msg, negateMsg, expected, _actual, showDiff) { var ok = util2.test(this, arguments); if (showDiff !== false) showDiff = true; if (expected === void 0 && _actual === void 0) showDiff = false; if (config2.showDiff !== true) showDiff = false; if (!ok) { msg = util2.getMessage(this, arguments); var actual = util2.getActual(this, arguments); var assertionErrorObjectProperties = { actual, expected, showDiff }; var operator = util2.getOperator(this, arguments); if (operator) { assertionErrorObjectProperties.operator = operator; } throw new AssertionError2(msg, assertionErrorObjectProperties, config2.includeStack ? this.assert : flag(this, "ssfi")); } }; Object.defineProperty(Assertion2.prototype, "_obj", { get: function() { return flag(this, "object"); }, set: function(val) { flag(this, "object", val); } }); }; } }); // node_modules/chai/lib/chai/core/assertions.js var require_assertions = __commonJS({ "node_modules/chai/lib/chai/core/assertions.js"(exports, module2) { module2.exports = function(chai2, _) { var Assertion2 = chai2.Assertion, AssertionError2 = chai2.AssertionError, flag = _.flag; [ "to", "be", "been", "is", "and", "has", "have", "with", "that", "which", "at", "of", "same", "but", "does", "still", "also" ].forEach(function(chain) { Assertion2.addProperty(chain); }); Assertion2.addProperty("not", function() { flag(this, "negate", true); }); Assertion2.addProperty("deep", function() { flag(this, "deep", true); }); Assertion2.addProperty("nested", function() { flag(this, "nested", true); }); Assertion2.addProperty("own", function() { flag(this, "own", true); }); Assertion2.addProperty("ordered", function() { flag(this, "ordered", true); }); Assertion2.addProperty("any", function() { flag(this, "any", true); flag(this, "all", false); }); Assertion2.addProperty("all", function() { flag(this, "all", true); flag(this, "any", false); }); function an(type, msg) { if (msg) flag(this, "message", msg); type = type.toLowerCase(); var obj = flag(this, "object"), article = ~["a", "e", "i", "o", "u"].indexOf(type.charAt(0)) ? "an " : "a "; this.assert(type === _.type(obj).toLowerCase(), "expected #{this} to be " + article + type, "expected #{this} not to be " + article + type); } __name(an, "an"); Assertion2.addChainableMethod("an", an); Assertion2.addChainableMethod("a", an); function SameValueZero(a, b) { return _.isNaN(a) && _.isNaN(b) || a === b; } __name(SameValueZero, "SameValueZero"); function includeChainingBehavior() { flag(this, "contains", true); } __name(includeChainingBehavior, "includeChainingBehavior"); function include(val, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"), objType = _.type(obj).toLowerCase(), flagMsg = flag(this, "message"), negate = flag(this, "negate"), ssfi = flag(this, "ssfi"), isDeep = flag(this, "deep"), descriptor = isDeep ? "deep " : ""; flagMsg = flagMsg ? flagMsg + ": " : ""; var included = false; switch (objType) { case "string": included = obj.indexOf(val) !== -1; break; case "weakset": if (isDeep) { throw new AssertionError2(flagMsg + "unable to use .deep.include with WeakSet", void 0, ssfi); } included = obj.has(val); break; case "map": var isEql = isDeep ? _.eql : SameValueZero; obj.forEach(function(item) { included = included || isEql(item, val); }); break; case "set": if (isDeep) { obj.forEach(function(item) { included = included || _.eql(item, val); }); } else { included = obj.has(val); } break; case "array": if (isDeep) { included = obj.some(function(item) { return _.eql(item, val); }); } else { included = obj.indexOf(val) !== -1; } break; default: if (val !== Object(val)) { throw new AssertionError2(flagMsg + "the given combination of arguments (" + objType + " and " + _.type(val).toLowerCase() + ") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a " + _.type(val).toLowerCase(), void 0, ssfi); } var props = Object.keys(val), firstErr = null, numErrs = 0; props.forEach(function(prop) { var propAssertion = new Assertion2(obj); _.transferFlags(this, propAssertion, true); flag(propAssertion, "lockSsfi", true); if (!negate || props.length === 1) { propAssertion.property(prop, val[prop]); return; } try { propAssertion.property(prop, val[prop]); } catch (err) { if (!_.checkError.compatibleConstructor(err, AssertionError2)) { throw err; } if (firstErr === null) firstErr = err; numErrs++; } }, this); if (negate && props.length > 1 && numErrs === props.length) { throw firstErr; } return; } this.assert(included, "expected #{this} to " + descriptor + "include " + _.inspect(val), "expected #{this} to not " + descriptor + "include " + _.inspect(val)); } __name(include, "include"); Assertion2.addChainableMethod("include", include, includeChainingBehavior); Assertion2.addChainableMethod("contain", include, includeChainingBehavior); Assertion2.addChainableMethod("contains", include, includeChainingBehavior); Assertion2.addChainableMethod("includes", include, includeChainingBehavior); Assertion2.addProperty("ok", function() { this.assert(flag(this, "object"), "expected #{this} to be truthy", "expected #{this} to be falsy"); }); Assertion2.addProperty("true", function() { this.assert(flag(this, "object") === true, "expected #{this} to be true", "expected #{this} to be false", flag(this, "negate") ? false : true); }); Assertion2.addProperty("false", function() { this.assert(flag(this, "object") === false, "expected #{this} to be false", "expected #{this} to be true", flag(this, "negate") ? true : false); }); Assertion2.addProperty("null", function() { this.assert(flag(this, "object") === null, "expected #{this} to be null", "expected #{this} not to be null"); }); Assertion2.addProperty("undefined", function() { this.assert(flag(this, "object") === void 0, "expected #{this} to be undefined", "expected #{this} not to be undefined"); }); Assertion2.addProperty("NaN", function() { this.assert(_.isNaN(flag(this, "object")), "expected #{this} to be NaN", "expected #{this} not to be NaN"); }); function assertExist() { var val = flag(this, "object"); this.assert(val !== null && val !== void 0, "expected #{this} to exist", "expected #{this} to not exist"); } __name(assertExist, "assertExist"); Assertion2.addProperty("exist", assertExist); Assertion2.addProperty("exists", assertExist); Assertion2.addProperty("empty", function() { var val = flag(this, "object"), ssfi = flag(this, "ssfi"), flagMsg = flag(this, "message"), itemsCount; flagMsg = flagMsg ? flagMsg + ": " : ""; switch (_.type(val).toLowerCase()) { case "array": case "string": itemsCount = val.length; break; case "map": case "set": itemsCount = val.size; break; case "weakmap": case "weakset": throw new AssertionError2(flagMsg + ".empty was passed a weak collection", void 0, ssfi); case "function": var msg = flagMsg + ".empty was passed a function " + _.getName(val); throw new AssertionError2(msg.trim(), void 0, ssfi); default: if (val !== Object(val)) { throw new AssertionError2(flagMsg + ".empty was passed non-string primitive " + _.inspect(val), void 0, ssfi); } itemsCount = Object.keys(val).length; } this.assert(itemsCount === 0, "expected #{this} to be empty", "expected #{this} not to be empty"); }); function checkArguments() { var obj = flag(this, "object"), type = _.type(obj); this.assert(type === "Arguments", "expected #{this} to be arguments but got " + type, "expected #{this} to not be arguments"); } __name(checkArguments, "checkArguments"); Assertion2.addProperty("arguments", checkArguments); Assertion2.addProperty("Arguments", checkArguments); function assertEqual(val, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"); if (flag(this, "deep")) { var prevLockSsfi = flag(this, "lockSsfi"); flag(this, "lockSsfi", true); this.eql(val); flag(this, "lockSsfi", prevLockSsfi); } else { this.assert(val === obj, "expected #{this} to equal #{exp}", "expected #{this} to not equal #{exp}", val, this._obj, true); } } __name(assertEqual, "assertEqual"); Assertion2.addMethod("equal", assertEqual); Assertion2.addMethod("equals", assertEqual); Assertion2.addMethod("eq", assertEqual); function assertEql(obj, msg) { if (msg) flag(this, "message", msg); this.assert(_.eql(obj, flag(this, "object")), "expected #{this} to deeply equal #{exp}", "expected #{this} to not deeply equal #{exp}", obj, this._obj, true); } __name(assertEql, "assertEql"); Assertion2.addMethod("eql", assertEql); Assertion2.addMethod("eqls", assertEql); function assertAbove(n, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"), doLength = flag(this, "doLength"), flagMsg = flag(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag(this, "ssfi"), objType = _.type(obj).toLowerCase(), nType = _.type(n).toLowerCase(), errorMessage, shouldThrow = true; if (doLength && objType !== "map" && objType !== "set") { new Assertion2(obj, flagMsg, ssfi, true).to.have.property("length"); } if (!doLength && (objType === "date" && nType !== "date")) { errorMessage = msgPrefix + "the argument to above must be a date"; } else if (nType !== "number" && (doLength || objType === "number")) { errorMessage = msgPrefix + "the argument to above must be a number"; } else if (!doLength && (objType !== "date" && objType !== "number")) { var printObj = objType === "string" ? "'" + obj + "'" : obj; errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; } else { shouldThrow = false; } if (shouldThrow) { throw new AssertionError2(errorMessage, void 0, ssfi); } if (doLength) { var descriptor = "length", itemsCount; if (objType === "map" || objType === "set") { descriptor = "size"; itemsCount = obj.size; } else { itemsCount = obj.length; } this.assert(itemsCount > n, "expected #{this} to have a " + descriptor + " above #{exp} but got #{act}", "expected #{this} to not have a " + descriptor + " above #{exp}", n, itemsCount); } else { this.assert(obj > n, "expected #{this} to be above #{exp}", "expected #{this} to be at most #{exp}", n); } } __name(assertAbove, "assertAbove"); Assertion2.addMethod("above", assertAbove); Assertion2.addMethod("gt", assertAbove); Assertion2.addMethod("greaterThan", assertAbove); function assertLeast(n, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"), doLength = flag(this, "doLength"), flagMsg = flag(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag(this, "ssfi"), objType = _.type(obj).toLowerCase(), nType = _.type(n).toLowerCase(), errorMessage, shouldThrow = true; if (doLength && objType !== "map" && objType !== "set") { new Assertion2(obj, flagMsg, ssfi, true).to.have.property("length"); } if (!doLength && (objType === "date" && nType !== "date")) { errorMessage = msgPrefix + "the argument to least must be a date"; } else if (nType !== "number" && (doLength || objType === "number")) { errorMessage = msgPrefix + "the argument to least must be a number"; } else if (!doLength && (objType !== "date" && objType !== "number")) { var printObj = objType === "string" ? "'" + obj + "'" : obj; errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; } else { shouldThrow = false; } if (shouldThrow) { throw new AssertionError2(errorMessage, void 0, ssfi); } if (doLength) { var descriptor = "length", itemsCount; if (objType === "map" || objType === "set") { descriptor = "size"; itemsCount = obj.size; } else { itemsCount = obj.length; } this.assert(itemsCount >= n, "expected #{this} to have a " + descriptor + " at least #{exp} but got #{act}", "expected #{this} to have a " + descriptor + " below #{exp}", n, itemsCount); } else { this.assert(obj >= n, "expected #{this} to be at least #{exp}", "expected #{this} to be below #{exp}", n); } } __name(assertLeast, "assertLeast"); Assertion2.addMethod("least", assertLeast); Assertion2.addMethod("gte", assertLeast); Assertion2.addMethod("greaterThanOrEqual", assertLeast); function assertBelow(n, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"), doLength = flag(this, "doLength"), flagMsg = flag(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag(this, "ssfi"), objType = _.type(obj).toLowerCase(), nType = _.type(n).toLowerCase(), errorMessage, shouldThrow = true; if (doLength && objType !== "map" && objType !== "set") { new Assertion2(obj, flagMsg, ssfi, true).to.have.property("length"); } if (!doLength && (objType === "date" && nType !== "date")) { errorMessage = msgPrefix + "the argument to below must be a date"; } else if (nType !== "number" && (doLength || objType === "number")) { errorMessage = msgPrefix + "the argument to below must be a number"; } else if (!doLength && (objType !== "date" && objType !== "number")) { var printObj = objType === "string" ? "'" + obj + "'" : obj; errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; } else { shouldThrow = false; } if (shouldThrow) { throw new AssertionError2(errorMessage, void 0, ssfi); } if (doLength) { var descriptor = "length", itemsCount; if (objType === "map" || objType === "set") { descriptor = "size"; itemsCount = obj.size; } else { itemsCount = obj.length; } this.assert(itemsCount < n, "expected #{this} to have a " + descriptor + " below #{exp} but got #{act}", "expected #{this} to not have a " + descriptor + " below #{exp}", n, itemsCount); } else { this.assert(obj < n, "expected #{this} to be below #{exp}", "expected #{this} to be at least #{exp}", n); } } __name(assertBelow, "assertBelow"); Assertion2.addMethod("below", assertBelow); Assertion2.addMethod("lt", assertBelow); Assertion2.addMethod("lessThan", assertBelow); function assertMost(n, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"), doLength = flag(this, "doLength"), flagMsg = flag(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag(this, "ssfi"), objType = _.type(obj).toLowerCase(), nType = _.type(n).toLowerCase(), errorMessage, shouldThrow = true; if (doLength && objType !== "map" && objType !== "set") { new Assertion2(obj, flagMsg, ssfi, true).to.have.property("length"); } if (!doLength && (objType === "date" && nType !== "date")) { errorMessage = msgPrefix + "the argument to most must be a date"; } else if (nType !== "number" && (doLength || objType === "number")) { errorMessage = msgPrefix + "the argument to most must be a number"; } else if (!doLength && (objType !== "date" && objType !== "number")) { var printObj = objType === "string" ? "'" + obj + "'" : obj; errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; } else { shouldThrow = false; } if (shouldThrow) { throw new AssertionError2(errorMessage, void 0, ssfi); } if (doLength) { var descriptor = "length", itemsCount; if (objType === "map" || objType === "set") { descriptor = "size"; itemsCount = obj.size; } else { itemsCount = obj.length; } this.assert(itemsCount <= n, "expected #{this} to have a " + descriptor + " at most #{exp} but got #{act}", "expected #{this} to have a " + descriptor + " above #{exp}", n, itemsCount); } else { this.assert(obj <= n, "expected #{this} to be at most #{exp}", "expected #{this} to be above #{exp}", n); } } __name(assertMost, "assertMost"); Assertion2.addMethod("most", assertMost); Assertion2.addMethod("lte", assertMost); Assertion2.addMethod("lessThanOrEqual", assertMost); Assertion2.addMethod("within", function(start, finish, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"), doLength = flag(this, "doLength"), flagMsg = flag(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag(this, "ssfi"), objType = _.type(obj).toLowerCase(), startType = _.type(start).toLowerCase(), finishType = _.type(finish).toLowerCase(), errorMessage, shouldThrow = true, range2 = startType === "date" && finishType === "date" ? start.toISOString() + ".." + finish.toISOString() : start + ".." + finish; if (doLength && objType !== "map" && objType !== "set") { new Assertion2(obj, flagMsg, ssfi, true).to.have.property("length"); } if (!doLength && (objType === "date" && (startType !== "date" || finishType !== "date"))) { errorMessage = msgPrefix + "the arguments to within must be dates"; } else if ((startType !== "number" || finishType !== "number") && (doLength || objType === "number")) { errorMessage = msgPrefix + "the arguments to within must be numbers"; } else if (!doLength && (objType !== "date" && objType !== "number")) { var printObj = objType === "string" ? "'" + obj + "'" : obj; errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; } else { shouldThrow = false; } if (shouldThrow) { throw new AssertionError2(errorMessage, void 0, ssfi); } if (doLength) { var descriptor = "length", itemsCount; if (objType === "map" || objType === "set") { descriptor = "size"; itemsCount = obj.size; } else { itemsCount = obj.length; } this.assert(itemsCount >= start && itemsCount <= finish, "expected #{this} to have a " + descriptor + " within " + range2, "expected #{this} to not have a " + descriptor + " within " + range2); } else { this.assert(obj >= start && obj <= finish, "expected #{this} to be within " + range2, "expected #{this} to not be within " + range2); } }); function assertInstanceOf(constructor, msg) { if (msg) flag(this, "message", msg); var target = flag(this, "object"); var ssfi = flag(this, "ssfi"); var flagMsg = flag(this, "message"); try { var isInstanceOf = target instanceof constructor; } catch (err) { if (err instanceof TypeError) { flagMsg = flagMsg ? flagMsg + ": " : ""; throw new AssertionError2(flagMsg + "The instanceof assertion needs a constructor but " + _.type(constructor) + " was given.", void 0, ssfi); } throw err; } var name = _.getName(constructor); if (name === null) { name = "an unnamed constructor"; } this.assert(isInstanceOf, "expected #{this} to be an instance of " + name, "expected #{this} to not be an instance of " + name); } __name(assertInstanceOf, "assertInstanceOf"); ; Assertion2.addMethod("instanceof", assertInstanceOf); Assertion2.addMethod("instanceOf", assertInstanceOf); function assertProperty(name, val, msg) { if (msg) flag(this, "message", msg); var isNested = flag(this, "nested"), isOwn = flag(this, "own"), flagMsg = flag(this, "message"), obj = flag(this, "object"), ssfi = flag(this, "ssfi"), nameType = typeof name; flagMsg = flagMsg ? flagMsg + ": " : ""; if (isNested) { if (nameType !== "string") { throw new AssertionError2(flagMsg + "the argument to property must be a string when using nested syntax", void 0, ssfi); } } else { if (nameType !== "string" && nameType !== "number" && nameType !== "symbol") { throw new AssertionError2(flagMsg + "the argument to property must be a string, number, or symbol", void 0, ssfi); } } if (isNested && isOwn) { throw new AssertionError2(flagMsg + 'The "nested" and "own" flags cannot be combined.', void 0, ssfi); } if (obj === null || obj === void 0) { throw new AssertionError2(flagMsg + "Target cannot be null or undefined.", void 0, ssfi); } var isDeep = flag(this, "deep"), negate = flag(this, "negate"), pathInfo = isNested ? _.getPathInfo(obj, name) : null, value = isNested ? pathInfo.value : obj[name]; var descriptor = ""; if (isDeep) descriptor += "deep "; if (isOwn) descriptor += "own "; if (isNested) descriptor += "nested "; descriptor += "property "; var hasProperty; if (isOwn) hasProperty = Object.prototype.hasOwnProperty.call(obj, name); else if (isNested) hasProperty = pathInfo.exists; else hasProperty = _.hasProperty(obj, name); if (!negate || arguments.length === 1) { this.assert(hasProperty, "expected #{this} to have " + descriptor + _.inspect(name), "expected #{this} to not have " + descriptor + _.inspect(name)); } if (arguments.length > 1) { this.assert(hasProperty && (isDeep ? _.eql(val, value) : val === value), "expected #{this} to have " + descriptor + _.inspect(name) + " of #{exp}, but got #{act}", "expected #{this} to not have " + descriptor + _.inspect(name) + " of #{act}", val, value); } flag(this, "object", value); } __name(assertProperty, "assertProperty"); Assertion2.addMethod("property", assertProperty); function assertOwnProperty(name, value, msg) { flag(this, "own", true); assertProperty.apply(this, arguments); } __name(assertOwnProperty, "assertOwnProperty"); Assertion2.addMethod("ownProperty", assertOwnProperty); Assertion2.addMethod("haveOwnProperty", assertOwnProperty); function assertOwnPropertyDescriptor(name, descriptor, msg) { if (typeof descriptor === "string") { msg = descriptor; descriptor = null; } if (msg) flag(this, "message", msg); var obj = flag(this, "object"); var actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name); if (actualDescriptor && descriptor) { this.assert(_.eql(descriptor, actualDescriptor), "expected the own property descriptor for " + _.inspect(name) + " on #{this} to match " + _.inspect(descriptor) + ", got " + _.inspect(actualDescriptor), "expected the own property descriptor for " + _.inspect(name) + " on #{this} to not match " + _.inspect(descriptor), descriptor, actualDescriptor, true); } else { this.assert(actualDescriptor, "expected #{this} to have an own property descriptor for " + _.inspect(name), "expected #{this} to not have an own property descriptor for " + _.inspect(name)); } flag(this, "object", actualDescriptor); } __name(assertOwnPropertyDescriptor, "assertOwnPropertyDescriptor"); Assertion2.addMethod("ownPropertyDescriptor", assertOwnPropertyDescriptor); Assertion2.addMethod("haveOwnPropertyDescriptor", assertOwnPropertyDescriptor); function assertLengthChain() { flag(this, "doLength", true); } __name(assertLengthChain, "assertLengthChain"); function assertLength(n, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"), objType = _.type(obj).toLowerCase(), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"), descriptor = "length", itemsCount; switch (objType) { case "map": case "set": descriptor = "size"; itemsCount = obj.size; break; default: new Assertion2(obj, flagMsg, ssfi, true).to.have.property("length"); itemsCount = obj.length; } this.assert(itemsCount == n, "expected #{this} to have a " + descriptor + " of #{exp} but got #{act}", "expected #{this} to not have a " + descriptor + " of #{act}", n, itemsCount); } __name(assertLength, "assertLength"); Assertion2.addChainableMethod("length", assertLength, assertLengthChain); Assertion2.addChainableMethod("lengthOf", assertLength, assertLengthChain); function assertMatch(re, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"); this.assert(re.exec(obj), "expected #{this} to match " + re, "expected #{this} not to match " + re); } __name(assertMatch, "assertMatch"); Assertion2.addMethod("match", assertMatch); Assertion2.addMethod("matches", assertMatch); Assertion2.addMethod("string", function(str, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"); new Assertion2(obj, flagMsg, ssfi, true).is.a("string"); this.assert(~obj.indexOf(str), "expected #{this} to contain " + _.inspect(str), "expected #{this} to not contain " + _.inspect(str)); }); function assertKeys(keys) { var obj = flag(this, "object"), objType = _.type(obj), keysType = _.type(keys), ssfi = flag(this, "ssfi"), isDeep = flag(this, "deep"), str, deepStr = "", actual, ok = true, flagMsg = flag(this, "message"); flagMsg = flagMsg ? flagMsg + ": " : ""; var mixedArgsMsg = flagMsg + "when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments"; if (objType === "Map" || objType === "Set") { deepStr = isDeep ? "deeply " : ""; actual = []; obj.forEach(function(val, key) { actual.push(key); }); if (keysType !== "Array") { keys = Array.prototype.slice.call(arguments); } } else { actual = _.getOwnEnumerableProperties(obj); switch (keysType) { case "Array": if (arguments.length > 1) { throw new AssertionError2(mixedArgsMsg, void 0, ssfi); } break; case "Object": if (arguments.length > 1) { throw new AssertionError2(mixedArgsMsg, void 0, ssfi); } keys = Object.keys(keys); break; default: keys = Array.prototype.slice.call(arguments); } keys = keys.map(function(val) { return typeof val === "symbol" ? val : String(val); }); } if (!keys.length) { throw new AssertionError2(flagMsg + "keys required", void 0, ssfi); } var len = keys.length, any = flag(this, "any"), all = flag(this, "all"), expected = keys; if (!any && !all) { all = true; } if (any) { ok = expected.some(function(expectedKey) { return actual.some(function(actualKey) { if (isDeep) { return _.eql(expectedKey, actualKey); } else { return expectedKey === actualKey; } }); }); } if (all) { ok = expected.every(function(expectedKey) { return actual.some(function(actualKey) { if (isDeep) { return _.eql(expectedKey, actualKey); } else { return expectedKey === actualKey; } }); }); if (!flag(this, "contains")) { ok = ok && keys.length == actual.length; } } if (len > 1) { keys = keys.map(function(key) { return _.inspect(key); }); var last = keys.pop(); if (all) { str = keys.join(", ") + ", and " + last; } if (any) { str = keys.join(", ") + ", or " + last; } } else { str = _.inspect(keys[0]); } str = (len > 1 ? "keys " : "key ") + str; str = (flag(this, "contains") ? "contain " : "have ") + str; this.assert(ok, "expected #{this} to " + deepStr + str, "expected #{this} to not " + deepStr + str, expected.slice(0).sort(_.compareByInspect), actual.sort(_.compareByInspect), true); } __name(assertKeys, "assertKeys"); Assertion2.addMethod("keys", assertKeys); Assertion2.addMethod("key", assertKeys); function assertThrows(errorLike, errMsgMatcher, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"), ssfi = flag(this, "ssfi"), flagMsg = flag(this, "message"), negate = flag(this, "negate") || false; new Assertion2(obj, flagMsg, ssfi, true).is.a("function"); if (errorLike instanceof RegExp || typeof errorLike === "string") { errMsgMatcher = errorLike; errorLike = null; } var caughtErr; try { obj(); } catch (err) { caughtErr = err; } var everyArgIsUndefined = errorLike === void 0 && errMsgMatcher === void 0; var everyArgIsDefined = Boolean(errorLike && errMsgMatcher); var errorLikeFail = false; var errMsgMatcherFail = false; if (everyArgIsUndefined || !everyArgIsUndefined && !negate) { var errorLikeString = "an error"; if (errorLike instanceof Error) { errorLikeString = "#{exp}"; } else if (errorLike) { errorLikeString = _.checkError.getConstructorName(errorLike); } this.assert(caughtErr, "expected #{this} to throw " + errorLikeString, "expected #{this} to not throw an error but #{act} was thrown", errorLike && errorLike.toString(), caughtErr instanceof Error ? caughtErr.toString() : typeof caughtErr === "string" ? caughtErr : caughtErr && _.checkError.getConstructorName(caughtErr)); } if (errorLike && caughtErr) { if (errorLike instanceof Error) { var isCompatibleInstance = _.checkError.compatibleInstance(caughtErr, errorLike); if (isCompatibleInstance === negate) { if (everyArgIsDefined && negate) { errorLikeFail = true; } else { this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr && !negate ? " but #{act} was thrown" : ""), errorLike.toString(), caughtErr.toString()); } } } var isCompatibleConstructor = _.checkError.compatibleConstructor(caughtErr, errorLike); if (isCompatibleConstructor === negate) { if (everyArgIsDefined && negate) { errorLikeFail = true; } else { this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), errorLike instanceof Error ? errorLike.toString() : errorLike && _.checkError.getConstructorName(errorLike), caughtErr instanceof Error ? caughtErr.toString() : caughtErr && _.checkError.getConstructorName(caughtErr)); } } } if (caughtErr && errMsgMatcher !== void 0 && errMsgMatcher !== null) { var placeholder = "including"; if (errMsgMatcher instanceof RegExp) { placeholder = "matching"; } var isCompatibleMessage = _.checkError.compatibleMessage(caughtErr, errMsgMatcher); if (isCompatibleMessage === negate) { if (everyArgIsDefined && negate) { errMsgMatcherFail = true; } else { this.assert(negate, "expected #{this} to throw error " + placeholder + " #{exp} but got #{act}", "expected #{this} to throw error not " + placeholder + " #{exp}", errMsgMatcher, _.checkError.getMessage(caughtErr)); } } } if (errorLikeFail && errMsgMatcherFail) { this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), errorLike instanceof Error ? errorLike.toString() : errorLike && _.checkError.getConstructorName(errorLike), caughtErr instanceof Error ? caughtErr.toString() : caughtErr && _.checkError.getConstructorName(caughtErr)); } flag(this, "object", caughtErr); } __name(assertThrows, "assertThrows"); ; Assertion2.addMethod("throw", assertThrows); Assertion2.addMethod("throws", assertThrows); Assertion2.addMethod("Throw", assertThrows); function respondTo(method, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"), itself = flag(this, "itself"), context = typeof obj === "function" && !itself ? obj.prototype[method] : obj[method]; this.assert(typeof context === "function", "expected #{this} to respond to " + _.inspect(method), "expected #{this} to not respond to " + _.inspect(method)); } __name(respondTo, "respondTo"); Assertion2.addMethod("respondTo", respondTo); Assertion2.addMethod("respondsTo", respondTo); Assertion2.addProperty("itself", function() { flag(this, "itself", true); }); function satisfy(matcher, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"); var result = matcher(obj); this.assert(result, "expected #{this} to satisfy " + _.objDisplay(matcher), "expected #{this} to not satisfy" + _.objDisplay(matcher), flag(this, "negate") ? false : true, result); } __name(satisfy, "satisfy"); Assertion2.addMethod("satisfy", satisfy); Assertion2.addMethod("satisfies", satisfy); function closeTo(expected, delta, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"); new Assertion2(obj, flagMsg, ssfi, true).is.a("number"); if (typeof expected !== "number" || typeof delta !== "number") { flagMsg = flagMsg ? flagMsg + ": " : ""; var deltaMessage = delta === void 0 ? ", and a delta is required" : ""; throw new AssertionError2(flagMsg + "the arguments to closeTo or approximately must be numbers" + deltaMessage, void 0, ssfi); } this.assert(Math.abs(obj - expected) <= delta, "expected #{this} to be close to " + expected + " +/- " + delta, "expected #{this} not to be close to " + expected + " +/- " + delta); } __name(closeTo, "closeTo"); Assertion2.addMethod("closeTo", closeTo); Assertion2.addMethod("approximately", closeTo); function isSubsetOf(subset, superset, cmp, contains, ordered) { if (!contains) { if (subset.length !== superset.length) return false; superset = superset.slice(); } return subset.every(function(elem, idx) { if (ordered) return cmp ? cmp(elem, superset[idx]) : elem === superset[idx]; if (!cmp) { var matchIdx = superset.indexOf(elem); if (matchIdx === -1) return false; if (!contains) superset.splice(matchIdx, 1); return true; } return superset.some(function(elem2, matchIdx2) { if (!cmp(elem, elem2)) return false; if (!contains) superset.splice(matchIdx2, 1); return true; }); }); } __name(isSubsetOf, "isSubsetOf"); Assertion2.addMethod("members", function(subset, msg) { if (msg) flag(this, "message", msg); var obj = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"); new Assertion2(obj, flagMsg, ssfi, true).to.be.an("array"); new Assertion2(subset, flagMsg, ssfi, true).to.be.an("array"); var contains = flag(this, "contains"); var ordered = flag(this, "ordered"); var subject, failMsg, failNegateMsg; if (contains) { subject = ordered ? "an ordered superset" : "a superset"; failMsg = "expected #{this} to be " + subject + " of #{exp}"; failNegateMsg = "expected #{this} to not be " + subject + " of #{exp}"; } else { subject = ordered ? "ordered members" : "members"; failMsg = "expected #{this} to have the same " + subject + " as #{exp}"; failNegateMsg = "expected #{this} to not have the same " + subject + " as #{exp}"; } var cmp = flag(this, "deep") ? _.eql : void 0; this.assert(isSubsetOf(subset, obj, cmp, contains, ordered), failMsg, failNegateMsg, subset, obj, true); }); function oneOf(list, msg) { if (msg) flag(this, "message", msg); var expected = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"), contains = flag(this, "contains"), isDeep = flag(this, "deep"); new Assertion2(list, flagMsg, ssfi, true).to.be.an("array"); if (contains) { this.assert(list.some(function(possibility) { return expected.indexOf(possibility) > -1; }), "expected #{this} to contain one of #{exp}", "expected #{this} to not contain one of #{exp}", list, expected); } else { if (isDeep) { this.assert(list.some(function(possibility) { return _.eql(expected, possibility); }), "expected #{this} to deeply equal one of #{exp}", "expected #{this} to deeply equal one of #{exp}", list, expected); } else { this.assert(list.indexOf(expected) > -1, "expected #{this} to be one of #{exp}", "expected #{this} to not be one of #{exp}", list, expected); } } } __name(oneOf, "oneOf"); Assertion2.addMethod("oneOf", oneOf); function assertChanges(subject, prop, msg) { if (msg) flag(this, "message", msg); var fn = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"); new Assertion2(fn, flagMsg, ssfi, true).is.a("function"); var initial; if (!prop) { new Assertion2(subject, flagMsg, ssfi, true).is.a("function"); initial = subject(); } else { new Assertion2(subject, flagMsg, ssfi, true).to.have.property(prop); initial = subject[prop]; } fn(); var final = prop === void 0 || prop === null ? subject() : subject[prop]; var msgObj = prop === void 0 || prop === null ? initial : "." + prop; flag(this, "deltaMsgObj", msgObj); flag(this, "initialDeltaValue", initial); flag(this, "finalDeltaValue", final); flag(this, "deltaBehavior", "change"); flag(this, "realDelta", final !== initial); this.assert(initial !== final, "expected " + msgObj + " to change", "expected " + msgObj + " to not change"); } __name(assertChanges, "assertChanges"); Assertion2.addMethod("change", assertChanges); Assertion2.addMethod("changes", assertChanges); function assertIncreases(subject, prop, msg) { if (msg) flag(this, "message", msg); var fn = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"); new Assertion2(fn, flagMsg, ssfi, true).is.a("function"); var initial; if (!prop) { new Assertion2(subject, flagMsg, ssfi, true).is.a("function"); initial = subject(); } else { new Assertion2(subject, flagMsg, ssfi, true).to.have.property(prop); initial = subject[prop]; } new Assertion2(initial, flagMsg, ssfi, true).is.a("number"); fn(); var final = prop === void 0 || prop === null ? subject() : subject[prop]; var msgObj = prop === void 0 || prop === null ? initial : "." + prop; flag(this, "deltaMsgObj", msgObj); flag(this, "initialDeltaValue", initial); flag(this, "finalDeltaValue", final); flag(this, "deltaBehavior", "increase"); flag(this, "realDelta", final - initial); this.assert(final - initial > 0, "expected " + msgObj + " to increase", "expected " + msgObj + " to not increase"); } __name(assertIncreases, "assertIncreases"); Assertion2.addMethod("increase", assertIncreases); Assertion2.addMethod("increases", assertIncreases); function assertDecreases(subject, prop, msg) { if (msg) flag(this, "message", msg); var fn = flag(this, "object"), flagMsg = flag(this, "message"), ssfi = flag(this, "ssfi"); new Assertion2(fn, flagMsg, ssfi, true).is.a("function"); var initial; if (!prop) { new Assertion2(subject, flagMsg, ssfi, true).is.a("function"); initial = subject(); } else { new Assertion2(subject, flagMsg, ssfi, true).to.have.property(prop); initial = subject[prop]; } new Assertion2(initial, flagMsg, ssfi, true).is.a("number"); fn(); var final = prop === void 0 || prop === null ? subject() : subject[prop]; var msgObj = prop === void 0 || prop === null ? initial : "." + prop; flag(this, "deltaMsgObj", msgObj); flag(this, "initialDeltaValue", initial); flag(this, "finalDeltaValue", final); flag(this, "deltaBehavior", "decrease"); flag(this, "realDelta", initial - final); this.assert(final - initial < 0, "expected " + msgObj + " to decrease", "expected " + msgObj + " to not decrease"); } __name(assertDecreases, "assertDecreases"); Assertion2.addMethod("decrease", assertDecreases); Assertion2.addMethod("decreases", assertDecreases); function assertDelta(delta, msg) { if (msg) flag(this, "message", msg); var msgObj = flag(this, "deltaMsgObj"); var initial = flag(this, "initialDeltaValue"); var final = flag(this, "finalDeltaValue"); var behavior = flag(this, "deltaBehavior"); var realDelta = flag(this, "realDelta"); var expression; if (behavior === "change") { expression = Math.abs(final - initial) === Math.abs(delta); } else { expression = realDelta === Math.abs(delta); } this.assert(expression, "expected " + msgObj + " to " + behavior + " by " + delta, "expected " + msgObj + " to not " + behavior + " by " + delta); } __name(assertDelta, "assertDelta"); Assertion2.addMethod("by", assertDelta); Assertion2.addProperty("extensible", function() { var obj = flag(this, "object"); var isExtensible = obj === Object(obj) && Object.isExtensible(obj); this.assert(isExtensible, "expected #{this} to be extensible", "expected #{this} to not be extensible"); }); Assertion2.addProperty("sealed", function() { var obj = flag(this, "object"); var isSealed = obj === Object(obj) ? Object.isSealed(obj) : true; this.assert(isSealed, "expected #{this} to be sealed", "expected #{this} to not be sealed"); }); Assertion2.addProperty("frozen", function() { var obj = flag(this, "object"); var isFrozen = obj === Object(obj) ? Object.isFrozen(obj) : true; this.assert(isFrozen, "expected #{this} to be frozen", "expected #{this} to not be frozen"); }); Assertion2.addProperty("finite", function(msg) { var obj = flag(this, "object"); this.assert(typeof obj === "number" && isFinite(obj), "expected #{this} to be a finite number", "expected #{this} to not be a finite number"); }); }; } }); // node_modules/chai/lib/chai/interface/expect.js var require_expect = __commonJS({ "node_modules/chai/lib/chai/interface/expect.js"(exports, module2) { module2.exports = function(chai2, util2) { chai2.expect = function(val, message) { return new chai2.Assertion(val, message); }; chai2.expect.fail = function(actual, expected, message, operator) { if (arguments.length < 2) { message = actual; actual = void 0; } message = message || "expect.fail()"; throw new chai2.AssertionError(message, { actual, expected, operator }, chai2.expect.fail); }; }; } }); // node_modules/chai/lib/chai/interface/should.js var require_should = __commonJS({ "node_modules/chai/lib/chai/interface/should.js"(exports, module2) { module2.exports = function(chai2, util2) { var Assertion2 = chai2.Assertion; function loadShould() { function shouldGetter() { if (this instanceof String || this instanceof Number || this instanceof Boolean || typeof Symbol === "function" && this instanceof Symbol || typeof BigInt === "function" && this instanceof BigInt) { return new Assertion2(this.valueOf(), null, shouldGetter); } return new Assertion2(this, null, shouldGetter); } __name(shouldGetter, "shouldGetter"); function shouldSetter(value) { Object.defineProperty(this, "should", { value, enumerable: true, configurable: true, writable: true }); } __name(shouldSetter, "shouldSetter"); Object.defineProperty(Object.prototype, "should", { set: shouldSetter, get: shouldGetter, configurable: true }); var should2 = {}; should2.fail = function(actual, expected, message, operator) { if (arguments.length < 2) { message = actual; actual = void 0; } message = message || "should.fail()"; throw new chai2.AssertionError(message, { actual, expected, operator }, should2.fail); }; should2.equal = function(val1, val2, msg) { new Assertion2(val1, msg).to.equal(val2); }; should2.Throw = function(fn, errt, errs, msg) { new Assertion2(fn, msg).to.Throw(errt, errs); }; should2.exist = function(val, msg) { new Assertion2(val, msg).to.exist; }; should2.not = {}; should2.not.equal = function(val1, val2, msg) { new Assertion2(val1, msg).to.not.equal(val2); }; should2.not.Throw = function(fn, errt, errs, msg) { new Assertion2(fn, msg).to.not.Throw(errt, errs); }; should2.not.exist = function(val, msg) { new Assertion2(val, msg).to.not.exist; }; should2["throw"] = should2["Throw"]; should2.not["throw"] = should2.not["Throw"]; return should2; } __name(loadShould, "loadShould"); ; chai2.should = loadShould; chai2.Should = loadShould; }; } }); // node_modules/chai/lib/chai/interface/assert.js var require_assert = __commonJS({ "node_modules/chai/lib/chai/interface/assert.js"(exports, module2) { module2.exports = function(chai2, util2) { var Assertion2 = chai2.Assertion, flag = util2.flag; var assert2 = chai2.assert = function(express, errmsg) { var test2 = new Assertion2(null, null, chai2.assert, true); test2.assert(express, errmsg, "[ negation message unavailable ]"); }; assert2.fail = function(actual, expected, message, operator) { if (arguments.length < 2) { message = actual; actual = void 0; } message = message || "assert.fail()"; throw new chai2.AssertionError(message, { actual, expected, operator }, assert2.fail); }; assert2.isOk = function(val, msg) { new Assertion2(val, msg, assert2.isOk, true).is.ok; }; assert2.isNotOk = function(val, msg) { new Assertion2(val, msg, assert2.isNotOk, true).is.not.ok; }; assert2.equal = function(act, exp, msg) { var test2 = new Assertion2(act, msg, assert2.equal, true); test2.assert(exp == flag(test2, "object"), "expected #{this} to equal #{exp}", "expected #{this} to not equal #{act}", exp, act, true); }; assert2.notEqual = function(act, exp, msg) { var test2 = new Assertion2(act, msg, assert2.notEqual, true); test2.assert(exp != flag(test2, "object"), "expected #{this} to not equal #{exp}", "expected #{this} to equal #{act}", exp, act, true); }; assert2.strictEqual = function(act, exp, msg) { new Assertion2(act, msg, assert2.strictEqual, true).to.equal(exp); }; assert2.notStrictEqual = function(act, exp, msg) { new Assertion2(act, msg, assert2.notStrictEqual, true).to.not.equal(exp); }; assert2.deepEqual = assert2.deepStrictEqual = function(act, exp, msg) { new Assertion2(act, msg, assert2.deepEqual, true).to.eql(exp); }; assert2.notDeepEqual = function(act, exp, msg) { new Assertion2(act, msg, assert2.notDeepEqual, true).to.not.eql(exp); }; assert2.isAbove = function(val, abv, msg) { new Assertion2(val, msg, assert2.isAbove, true).to.be.above(abv); }; assert2.isAtLeast = function(val, atlst, msg) { new Assertion2(val, msg, assert2.isAtLeast, true).to.be.least(atlst); }; assert2.isBelow = function(val, blw, msg) { new Assertion2(val, msg, assert2.isBelow, true).to.be.below(blw); }; assert2.isAtMost = function(val, atmst, msg) { new Assertion2(val, msg, assert2.isAtMost, true).to.be.most(atmst); }; assert2.isTrue = function(val, msg) { new Assertion2(val, msg, assert2.isTrue, true).is["true"]; }; assert2.isNotTrue = function(val, msg) { new Assertion2(val, msg, assert2.isNotTrue, true).to.not.equal(true); }; assert2.isFalse = function(val, msg) { new Assertion2(val, msg, assert2.isFalse, true).is["false"]; }; assert2.isNotFalse = function(val, msg) { new Assertion2(val, msg, assert2.isNotFalse, true).to.not.equal(false); }; assert2.isNull = function(val, msg) { new Assertion2(val, msg, assert2.isNull, true).to.equal(null); }; assert2.isNotNull = function(val, msg) { new Assertion2(val, msg, assert2.isNotNull, true).to.not.equal(null); }; assert2.isNaN = function(val, msg) { new Assertion2(val, msg, assert2.isNaN, true).to.be.NaN; }; assert2.isNotNaN = function(val, msg) { new Assertion2(val, msg, assert2.isNotNaN, true).not.to.be.NaN; }; assert2.exists = function(val, msg) { new Assertion2(val, msg, assert2.exists, true).to.exist; }; assert2.notExists = function(val, msg) { new Assertion2(val, msg, assert2.notExists, true).to.not.exist; }; assert2.isUndefined = function(val, msg) { new Assertion2(val, msg, assert2.isUndefined, true).to.equal(void 0); }; assert2.isDefined = function(val, msg) { new Assertion2(val, msg, assert2.isDefined, true).to.not.equal(void 0); }; assert2.isFunction = function(val, msg) { new Assertion2(val, msg, assert2.isFunction, true).to.be.a("function"); }; assert2.isNotFunction = function(val, msg) { new Assertion2(val, msg, assert2.isNotFunction, true).to.not.be.a("function"); }; assert2.isObject = function(val, msg) { new Assertion2(val, msg, assert2.isObject, true).to.be.a("object"); }; assert2.isNotObject = function(val, msg) { new Assertion2(val, msg, assert2.isNotObject, true).to.not.be.a("object"); }; assert2.isArray = function(val, msg) { new Assertion2(val, msg, assert2.isArray, true).to.be.an("array"); }; assert2.isNotArray = function(val, msg) { new Assertion2(val, msg, assert2.isNotArray, true).to.not.be.an("array"); }; assert2.isString = function(val, msg) { new Assertion2(val, msg, assert2.isString, true).to.be.a("string"); }; assert2.isNotString = function(val, msg) { new Assertion2(val, msg, assert2.isNotString, true).to.not.be.a("string"); }; assert2.isNumber = function(val, msg) { new Assertion2(val, msg, assert2.isNumber, true).to.be.a("number"); }; assert2.isNotNumber = function(val, msg) { new Assertion2(val, msg, assert2.isNotNumber, true).to.not.be.a("number"); }; assert2.isFinite = function(val, msg) { new Assertion2(val, msg, assert2.isFinite, true).to.be.finite; }; assert2.isBoolean = function(val, msg) { new Assertion2(val, msg, assert2.isBoolean, true).to.be.a("boolean"); }; assert2.isNotBoolean = function(val, msg) { new Assertion2(val, msg, assert2.isNotBoolean, true).to.not.be.a("boolean"); }; assert2.typeOf = function(val, type, msg) { new Assertion2(val, msg, assert2.typeOf, true).to.be.a(type); }; assert2.notTypeOf = function(val, type, msg) { new Assertion2(val, msg, assert2.notTypeOf, true).to.not.be.a(type); }; assert2.instanceOf = function(val, type, msg) { new Assertion2(val, msg, assert2.instanceOf, true).to.be.instanceOf(type); }; assert2.notInstanceOf = function(val, type, msg) { new Assertion2(val, msg, assert2.notInstanceOf, true).to.not.be.instanceOf(type); }; assert2.include = function(exp, inc, msg) { new Assertion2(exp, msg, assert2.include, true).include(inc); }; assert2.notInclude = function(exp, inc, msg) { new Assertion2(exp, msg, assert2.notInclude, true).not.include(inc); }; assert2.deepInclude = function(exp, inc, msg) { new Assertion2(exp, msg, assert2.deepInclude, true).deep.include(inc); }; assert2.notDeepInclude = function(exp, inc, msg) { new Assertion2(exp, msg, assert2.notDeepInclude, true).not.deep.include(inc); }; assert2.nestedInclude = function(exp, inc, msg) { new Assertion2(exp, msg, assert2.nestedInclude, true).nested.include(inc); }; assert2.notNestedInclude = function(exp, inc, msg) { new Assertion2(exp, msg, assert2.notNestedInclude, true).not.nested.include(inc); }; assert2.deepNestedInclude = function(exp, inc, msg) { new Assertion2(exp, msg, assert2.deepNestedInclude, true).deep.nested.include(inc); }; assert2.notDeepNestedInclude = function(exp, inc, msg) { new Assertion2(exp, msg, assert2.notDeepNestedInclude, true).not.deep.nested.include(inc); }; assert2.ownInclude = function(exp, inc, msg) { new Assertion2(exp, msg, assert2.ownInclude, true).own.include(inc); }; assert2.notOwnInclude = function(exp, inc, msg) { new Assertion2(exp, msg, assert2.notOwnInclude, true).not.own.include(inc); }; assert2.deepOwnInclude = function(exp, inc, msg) { new Assertion2(exp, msg, assert2.deepOwnInclude, true).deep.own.include(inc); }; assert2.notDeepOwnInclude = function(exp, inc, msg) { new Assertion2(exp, msg, assert2.notDeepOwnInclude, true).not.deep.own.include(inc); }; assert2.match = function(exp, re, msg) { new Assertion2(exp, msg, assert2.match, true).to.match(re); }; assert2.notMatch = function(exp, re, msg) { new Assertion2(exp, msg, assert2.notMatch, true).to.not.match(re); }; assert2.property = function(obj, prop, msg) { new Assertion2(obj, msg, assert2.property, true).to.have.property(prop); }; assert2.notProperty = function(obj, prop, msg) { new Assertion2(obj, msg, assert2.notProperty, true).to.not.have.property(prop); }; assert2.propertyVal = function(obj, prop, val, msg) { new Assertion2(obj, msg, assert2.propertyVal, true).to.have.property(prop, val); }; assert2.notPropertyVal = function(obj, prop, val, msg) { new Assertion2(obj, msg, assert2.notPropertyVal, true).to.not.have.property(prop, val); }; assert2.deepPropertyVal = function(obj, prop, val, msg) { new Assertion2(obj, msg, assert2.deepPropertyVal, true).to.have.deep.property(prop, val); }; assert2.notDeepPropertyVal = function(obj, prop, val, msg) { new Assertion2(obj, msg, assert2.notDeepPropertyVal, true).to.not.have.deep.property(prop, val); }; assert2.ownProperty = function(obj, prop, msg) { new Assertion2(obj, msg, assert2.ownProperty, true).to.have.own.property(prop); }; assert2.notOwnProperty = function(obj, prop, msg) { new Assertion2(obj, msg, assert2.notOwnProperty, true).to.not.have.own.property(prop); }; assert2.ownPropertyVal = function(obj, prop, value, msg) { new Assertion2(obj, msg, assert2.ownPropertyVal, true).to.have.own.property(prop, value); }; assert2.notOwnPropertyVal = function(obj, prop, value, msg) { new Assertion2(obj, msg, assert2.notOwnPropertyVal, true).to.not.have.own.property(prop, value); }; assert2.deepOwnPropertyVal = function(obj, prop, value, msg) { new Assertion2(obj, msg, assert2.deepOwnPropertyVal, true).to.have.deep.own.property(prop, value); }; assert2.notDeepOwnPropertyVal = function(obj, prop, value, msg) { new Assertion2(obj, msg, assert2.notDeepOwnPropertyVal, true).to.not.have.deep.own.property(prop, value); }; assert2.nestedProperty = function(obj, prop, msg) { new Assertion2(obj, msg, assert2.nestedProperty, true).to.have.nested.property(prop); }; assert2.notNestedProperty = function(obj, prop, msg) { new Assertion2(obj, msg, assert2.notNestedProperty, true).to.not.have.nested.property(prop); }; assert2.nestedPropertyVal = function(obj, prop, val, msg) { new Assertion2(obj, msg, assert2.nestedPropertyVal, true).to.have.nested.property(prop, val); }; assert2.notNestedPropertyVal = function(obj, prop, val, msg) { new Assertion2(obj, msg, assert2.notNestedPropertyVal, true).to.not.have.nested.property(prop, val); }; assert2.deepNestedPropertyVal = function(obj, prop, val, msg) { new Assertion2(obj, msg, assert2.deepNestedPropertyVal, true).to.have.deep.nested.property(prop, val); }; assert2.notDeepNestedPropertyVal = function(obj, prop, val, msg) { new Assertion2(obj, msg, assert2.notDeepNestedPropertyVal, true).to.not.have.deep.nested.property(prop, val); }; assert2.lengthOf = function(exp, len, msg) { new Assertion2(exp, msg, assert2.lengthOf, true).to.have.lengthOf(len); }; assert2.hasAnyKeys = function(obj, keys, msg) { new Assertion2(obj, msg, assert2.hasAnyKeys, true).to.have.any.keys(keys); }; assert2.hasAllKeys = function(obj, keys, msg) { new Assertion2(obj, msg, assert2.hasAllKeys, true).to.have.all.keys(keys); }; assert2.containsAllKeys = function(obj, keys, msg) { new Assertion2(obj, msg, assert2.containsAllKeys, true).to.contain.all.keys(keys); }; assert2.doesNotHaveAnyKeys = function(obj, keys, msg) { new Assertion2(obj, msg, assert2.doesNotHaveAnyKeys, true).to.not.have.any.keys(keys); }; assert2.doesNotHaveAllKeys = function(obj, keys, msg) { new Assertion2(obj, msg, assert2.doesNotHaveAllKeys, true).to.not.have.all.keys(keys); }; assert2.hasAnyDeepKeys = function(obj, keys, msg) { new Assertion2(obj, msg, assert2.hasAnyDeepKeys, true).to.have.any.deep.keys(keys); }; assert2.hasAllDeepKeys = function(obj, keys, msg) { new Assertion2(obj, msg, assert2.hasAllDeepKeys, true).to.have.all.deep.keys(keys); }; assert2.containsAllDeepKeys = function(obj, keys, msg) { new Assertion2(obj, msg, assert2.containsAllDeepKeys, true).to.contain.all.deep.keys(keys); }; assert2.doesNotHaveAnyDeepKeys = function(obj, keys, msg) { new Assertion2(obj, msg, assert2.doesNotHaveAnyDeepKeys, true).to.not.have.any.deep.keys(keys); }; assert2.doesNotHaveAllDeepKeys = function(obj, keys, msg) { new Assertion2(obj, msg, assert2.doesNotHaveAllDeepKeys, true).to.not.have.all.deep.keys(keys); }; assert2.throws = function(fn, errorLike, errMsgMatcher, msg) { if (typeof errorLike === "string" || errorLike instanceof RegExp) { errMsgMatcher = errorLike; errorLike = null; } var assertErr = new Assertion2(fn, msg, assert2.throws, true).to.throw(errorLike, errMsgMatcher); return flag(assertErr, "object"); }; assert2.doesNotThrow = function(fn, errorLike, errMsgMatcher, msg) { if (typeof errorLike === "string" || errorLike instanceof RegExp) { errMsgMatcher = errorLike; errorLike = null; } new Assertion2(fn, msg, assert2.doesNotThrow, true).to.not.throw(errorLike, errMsgMatcher); }; assert2.operator = function(val, operator, val2, msg) { var ok; switch (operator) { case "==": ok = val == val2; break; case "===": ok = val === val2; break; case ">": ok = val > val2; break; case ">=": ok = val >= val2; break; case "<": ok = val < val2; break; case "<=": ok = val <= val2; break; case "!=": ok = val != val2; break; case "!==": ok = val !== val2; break; default: msg = msg ? msg + ": " : msg; throw new chai2.AssertionError(msg + 'Invalid operator "' + operator + '"', void 0, assert2.operator); } var test2 = new Assertion2(ok, msg, assert2.operator, true); test2.assert(flag(test2, "object") === true, "expected " + util2.inspect(val) + " to be " + operator + " " + util2.inspect(val2), "expected " + util2.inspect(val) + " to not be " + operator + " " + util2.inspect(val2)); }; assert2.closeTo = function(act, exp, delta, msg) { new Assertion2(act, msg, assert2.closeTo, true).to.be.closeTo(exp, delta); }; assert2.approximately = function(act, exp, delta, msg) { new Assertion2(act, msg, assert2.approximately, true).to.be.approximately(exp, delta); }; assert2.sameMembers = function(set1, set2, msg) { new Assertion2(set1, msg, assert2.sameMembers, true).to.have.same.members(set2); }; assert2.notSameMembers = function(set1, set2, msg) { new Assertion2(set1, msg, assert2.notSameMembers, true).to.not.have.same.members(set2); }; assert2.sameDeepMembers = function(set1, set2, msg) { new Assertion2(set1, msg, assert2.sameDeepMembers, true).to.have.same.deep.members(set2); }; assert2.notSameDeepMembers = function(set1, set2, msg) { new Assertion2(set1, msg, assert2.notSameDeepMembers, true).to.not.have.same.deep.members(set2); }; assert2.sameOrderedMembers = function(set1, set2, msg) { new Assertion2(set1, msg, assert2.sameOrderedMembers, true).to.have.same.ordered.members(set2); }; assert2.notSameOrderedMembers = function(set1, set2, msg) { new Assertion2(set1, msg, assert2.notSameOrderedMembers, true).to.not.have.same.ordered.members(set2); }; assert2.sameDeepOrderedMembers = function(set1, set2, msg) { new Assertion2(set1, msg, assert2.sameDeepOrderedMembers, true).to.have.same.deep.ordered.members(set2); }; assert2.notSameDeepOrderedMembers = function(set1, set2, msg) { new Assertion2(set1, msg, assert2.notSameDeepOrderedMembers, true).to.not.have.same.deep.ordered.members(set2); }; assert2.includeMembers = function(superset, subset, msg) { new Assertion2(superset, msg, assert2.includeMembers, true).to.include.members(subset); }; assert2.notIncludeMembers = function(superset, subset, msg) { new Assertion2(superset, msg, assert2.notIncludeMembers, true).to.not.include.members(subset); }; assert2.includeDeepMembers = function(superset, subset, msg) { new Assertion2(superset, msg, assert2.includeDeepMembers, true).to.include.deep.members(subset); }; assert2.notIncludeDeepMembers = function(superset, subset, msg) { new Assertion2(superset, msg, assert2.notIncludeDeepMembers, true).to.not.include.deep.members(subset); }; assert2.includeOrderedMembers = function(superset, subset, msg) { new Assertion2(superset, msg, assert2.includeOrderedMembers, true).to.include.ordered.members(subset); }; assert2.notIncludeOrderedMembers = function(superset, subset, msg) { new Assertion2(superset, msg, assert2.notIncludeOrderedMembers, true).to.not.include.ordered.members(subset); }; assert2.includeDeepOrderedMembers = function(superset, subset, msg) { new Assertion2(superset, msg, assert2.includeDeepOrderedMembers, true).to.include.deep.ordered.members(subset); }; assert2.notIncludeDeepOrderedMembers = function(superset, subset, msg) { new Assertion2(superset, msg, assert2.notIncludeDeepOrderedMembers, true).to.not.include.deep.ordered.members(subset); }; assert2.oneOf = function(inList, list, msg) { new Assertion2(inList, msg, assert2.oneOf, true).to.be.oneOf(list); }; assert2.changes = function(fn, obj, prop, msg) { if (arguments.length === 3 && typeof obj === "function") { msg = prop; prop = null; } new Assertion2(fn, msg, assert2.changes, true).to.change(obj, prop); }; assert2.changesBy = function(fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === "function") { var tmpMsg = delta; delta = prop; msg = tmpMsg; } else if (arguments.length === 3) { delta = prop; prop = null; } new Assertion2(fn, msg, assert2.changesBy, true).to.change(obj, prop).by(delta); }; assert2.doesNotChange = function(fn, obj, prop, msg) { if (arguments.length === 3 && typeof obj === "function") { msg = prop; prop = null; } return new Assertion2(fn, msg, assert2.doesNotChange, true).to.not.change(obj, prop); }; assert2.changesButNotBy = function(fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === "function") { var tmpMsg = delta; delta = prop; msg = tmpMsg; } else if (arguments.length === 3) { delta = prop; prop = null; } new Assertion2(fn, msg, assert2.changesButNotBy, true).to.change(obj, prop).but.not.by(delta); }; assert2.increases = function(fn, obj, prop, msg) { if (arguments.length === 3 && typeof obj === "function") { msg = prop; prop = null; } return new Assertion2(fn, msg, assert2.increases, true).to.increase(obj, prop); }; assert2.increasesBy = function(fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === "function") { var tmpMsg = delta; delta = prop; msg = tmpMsg; } else if (arguments.length === 3) { delta = prop; prop = null; } new Assertion2(fn, msg, assert2.increasesBy, true).to.increase(obj, prop).by(delta); }; assert2.doesNotIncrease = function(fn, obj, prop, msg) { if (arguments.length === 3 && typeof obj === "function") { msg = prop; prop = null; } return new Assertion2(fn, msg, assert2.doesNotIncrease, true).to.not.increase(obj, prop); }; assert2.increasesButNotBy = function(fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === "function") { var tmpMsg = delta; delta = prop; msg = tmpMsg; } else if (arguments.length === 3) { delta = prop; prop = null; } new Assertion2(fn, msg, assert2.increasesButNotBy, true).to.increase(obj, prop).but.not.by(delta); }; assert2.decreases = function(fn, obj, prop, msg) { if (arguments.length === 3 && typeof obj === "function") { msg = prop; prop = null; } return new Assertion2(fn, msg, assert2.decreases, true).to.decrease(obj, prop); }; assert2.decreasesBy = function(fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === "function") { var tmpMsg = delta; delta = prop; msg = tmpMsg; } else if (arguments.length === 3) { delta = prop; prop = null; } new Assertion2(fn, msg, assert2.decreasesBy, true).to.decrease(obj, prop).by(delta); }; assert2.doesNotDecrease = function(fn, obj, prop, msg) { if (arguments.length === 3 && typeof obj === "function") { msg = prop; prop = null; } return new Assertion2(fn, msg, assert2.doesNotDecrease, true).to.not.decrease(obj, prop); }; assert2.doesNotDecreaseBy = function(fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === "function") { var tmpMsg = delta; delta = prop; msg = tmpMsg; } else if (arguments.length === 3) { delta = prop; prop = null; } return new Assertion2(fn, msg, assert2.doesNotDecreaseBy, true).to.not.decrease(obj, prop).by(delta); }; assert2.decreasesButNotBy = function(fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === "function") { var tmpMsg = delta; delta = prop; msg = tmpMsg; } else if (arguments.length === 3) { delta = prop; prop = null; } new Assertion2(fn, msg, assert2.decreasesButNotBy, true).to.decrease(obj, prop).but.not.by(delta); }; assert2.ifError = function(val) { if (val) { throw val; } }; assert2.isExtensible = function(obj, msg) { new Assertion2(obj, msg, assert2.isExtensible, true).to.be.extensible; }; assert2.isNotExtensible = function(obj, msg) { new Assertion2(obj, msg, assert2.isNotExtensible, true).to.not.be.extensible; }; assert2.isSealed = function(obj, msg) { new Assertion2(obj, msg, assert2.isSealed, true).to.be.sealed; }; assert2.isNotSealed = function(obj, msg) { new Assertion2(obj, msg, assert2.isNotSealed, true).to.not.be.sealed; }; assert2.isFrozen = function(obj, msg) { new Assertion2(obj, msg, assert2.isFrozen, true).to.be.frozen; }; assert2.isNotFrozen = function(obj, msg) { new Assertion2(obj, msg, assert2.isNotFrozen, true).to.not.be.frozen; }; assert2.isEmpty = function(val, msg) { new Assertion2(val, msg, assert2.isEmpty, true).to.be.empty; }; assert2.isNotEmpty = function(val, msg) { new Assertion2(val, msg, assert2.isNotEmpty, true).to.not.be.empty; }; (/* @__PURE__ */ __name(function alias(name, as) { assert2[as] = assert2[name]; return alias; }, "alias"))("isOk", "ok")("isNotOk", "notOk")("throws", "throw")("throws", "Throw")("isExtensible", "extensible")("isNotExtensible", "notExtensible")("isSealed", "sealed")("isNotSealed", "notSealed")("isFrozen", "frozen")("isNotFrozen", "notFrozen")("isEmpty", "empty")("isNotEmpty", "notEmpty"); }; } }); // node_modules/chai/lib/chai.js var require_chai = __commonJS({ "node_modules/chai/lib/chai.js"(exports) { var used = []; exports.version = "4.3.3"; exports.AssertionError = require_assertion_error(); var util2 = require_utils5(); exports.use = function(fn) { if (!~used.indexOf(fn)) { fn(exports, util2); used.push(fn); } return exports; }; exports.util = util2; var config2 = require_config(); exports.config = config2; var assertion = require_assertion(); exports.use(assertion); var core2 = require_assertions(); exports.use(core2); var expect2 = require_expect(); exports.use(expect2); var should2 = require_should(); exports.use(should2); var assert2 = require_assert(); exports.use(assert2); } }); // node_modules/chai/index.js var require_chai2 = __commonJS({ "node_modules/chai/index.js"(exports, module2) { module2.exports = require_chai(); } }); // src/Main.ts var Main_exports = {}; __export(Main_exports, { default: () => ObsidianOCRPlugin }); module.exports = __toCommonJS(Main_exports); var import_obsidian9 = require("obsidian"); // node_modules/async/dist/async.mjs function apply(fn, ...args) { return (...callArgs) => fn(...args, ...callArgs); } __name(apply, "apply"); function initialParams(fn) { return function(...args) { var callback = args.pop(); return fn.call(this, args, callback); }; } __name(initialParams, "initialParams"); var hasQueueMicrotask = typeof queueMicrotask === "function" && queueMicrotask; var hasSetImmediate = typeof setImmediate === "function" && setImmediate; var hasNextTick = typeof process === "object" && typeof process.nextTick === "function"; function fallback(fn) { setTimeout(fn, 0); } __name(fallback, "fallback"); function wrap(defer) { return (fn, ...args) => defer(() => fn(...args)); } __name(wrap, "wrap"); var _defer; if (hasQueueMicrotask) { _defer = queueMicrotask; } else if (hasSetImmediate) { _defer = setImmediate; } else if (hasNextTick) { _defer = process.nextTick; } else { _defer = fallback; } var setImmediate$1 = wrap(_defer); function asyncify(func) { if (isAsync(func)) { return function(...args) { const callback = args.pop(); const promise = func.apply(this, args); return handlePromise(promise, callback); }; } return initialParams(function(args, callback) { var result; try { result = func.apply(this, args); } catch (e) { return callback(e); } if (result && typeof result.then === "function") { return handlePromise(result, callback); } else { callback(null, result); } }); } __name(asyncify, "asyncify"); function handlePromise(promise, callback) { return promise.then((value) => { invokeCallback(callback, null, value); }, (err) => { invokeCallback(callback, err && err.message ? err : new Error(err)); }); } __name(handlePromise, "handlePromise"); function invokeCallback(callback, error, value) { try { callback(error, value); } catch (err) { setImmediate$1((e) => { throw e; }, err); } } __name(invokeCallback, "invokeCallback"); function isAsync(fn) { return fn[Symbol.toStringTag] === "AsyncFunction"; } __name(isAsync, "isAsync"); function isAsyncGenerator(fn) { return fn[Symbol.toStringTag] === "AsyncGenerator"; } __name(isAsyncGenerator, "isAsyncGenerator"); function isAsyncIterable(obj) { return typeof obj[Symbol.asyncIterator] === "function"; } __name(isAsyncIterable, "isAsyncIterable"); function wrapAsync(asyncFn) { if (typeof asyncFn !== "function") throw new Error("expected a function"); return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; } __name(wrapAsync, "wrapAsync"); function awaitify(asyncFn, arity = asyncFn.length) { if (!arity) throw new Error("arity is undefined"); function awaitable(...args) { if (typeof args[arity - 1] === "function") { return asyncFn.apply(this, args); } return new Promise((resolve, reject2) => { args[arity - 1] = (err, ...cbArgs) => { if (err) return reject2(err); resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); }; asyncFn.apply(this, args); }); } __name(awaitable, "awaitable"); return awaitable; } __name(awaitify, "awaitify"); function applyEach(eachfn) { return /* @__PURE__ */ __name(function applyEach2(fns, ...callArgs) { const go = awaitify(function(callback) { var that = this; return eachfn(fns, (fn, cb) => { wrapAsync(fn).apply(that, callArgs.concat(cb)); }, callback); }); return go; }, "applyEach"); } __name(applyEach, "applyEach"); function _asyncMap(eachfn, arr, iteratee, callback) { arr = arr || []; var results = []; var counter = 0; var _iteratee = wrapAsync(iteratee); return eachfn(arr, (value, _, iterCb) => { var index2 = counter++; _iteratee(value, (err, v) => { results[index2] = v; iterCb(err); }); }, (err) => { callback(err, results); }); } __name(_asyncMap, "_asyncMap"); function isArrayLike(value) { return value && typeof value.length === "number" && value.length >= 0 && value.length % 1 === 0; } __name(isArrayLike, "isArrayLike"); var breakLoop = {}; function once(fn) { function wrapper(...args) { if (fn === null) return; var callFn = fn; fn = null; callFn.apply(this, args); } __name(wrapper, "wrapper"); Object.assign(wrapper, fn); return wrapper; } __name(once, "once"); function getIterator(coll) { return coll[Symbol.iterator] && coll[Symbol.iterator](); } __name(getIterator, "getIterator"); function createArrayIterator(coll) { var i = -1; var len = coll.length; return /* @__PURE__ */ __name(function next() { return ++i < len ? { value: coll[i], key: i } : null; }, "next"); } __name(createArrayIterator, "createArrayIterator"); function createES2015Iterator(iterator) { var i = -1; return /* @__PURE__ */ __name(function next() { var item = iterator.next(); if (item.done) return null; i++; return { value: item.value, key: i }; }, "next"); } __name(createES2015Iterator, "createES2015Iterator"); function createObjectIterator(obj) { var okeys = obj ? Object.keys(obj) : []; var i = -1; var len = okeys.length; return /* @__PURE__ */ __name(function next() { var key = okeys[++i]; if (key === "__proto__") { return next(); } return i < len ? { value: obj[key], key } : null; }, "next"); } __name(createObjectIterator, "createObjectIterator"); function createIterator(coll) { if (isArrayLike(coll)) { return createArrayIterator(coll); } var iterator = getIterator(coll); return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); } __name(createIterator, "createIterator"); function onlyOnce(fn) { return function(...args) { if (fn === null) throw new Error("Callback was already called."); var callFn = fn; fn = null; callFn.apply(this, args); }; } __name(onlyOnce, "onlyOnce"); function asyncEachOfLimit(generator, limit, iteratee, callback) { let done = false; let canceled = false; let awaiting = false; let running = 0; let idx = 0; function replenish() { if (running >= limit || awaiting || done) return; awaiting = true; generator.next().then(({ value, done: iterDone }) => { if (canceled || done) return; awaiting = false; if (iterDone) { done = true; if (running <= 0) { callback(null); } return; } running++; iteratee(value, idx, iterateeCallback); idx++; replenish(); }).catch(handleError); } __name(replenish, "replenish"); function iterateeCallback(err, result) { running -= 1; if (canceled) return; if (err) return handleError(err); if (err === false) { done = true; canceled = true; return; } if (result === breakLoop || done && running <= 0) { done = true; return callback(null); } replenish(); } __name(iterateeCallback, "iterateeCallback"); function handleError(err) { if (canceled) return; awaiting = false; done = true; callback(err); } __name(handleError, "handleError"); replenish(); } __name(asyncEachOfLimit, "asyncEachOfLimit"); var eachOfLimit = /* @__PURE__ */ __name((limit) => { return (obj, iteratee, callback) => { callback = once(callback); if (limit <= 0) { throw new RangeError("concurrency limit cannot be less than 1"); } if (!obj) { return callback(null); } if (isAsyncGenerator(obj)) { return asyncEachOfLimit(obj, limit, iteratee, callback); } if (isAsyncIterable(obj)) { return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback); } var nextElem = createIterator(obj); var done = false; var canceled = false; var running = 0; var looping = false; function iterateeCallback(err, value) { if (canceled) return; running -= 1; if (err) { done = true; callback(err); } else if (err === false) { done = true; canceled = true; } else if (value === breakLoop || done && running <= 0) { done = true; return callback(null); } else if (!looping) { replenish(); } } __name(iterateeCallback, "iterateeCallback"); function replenish() { looping = true; while (running < limit && !done) { var elem = nextElem(); if (elem === null) { done = true; if (running <= 0) { callback(null); } return; } running += 1; iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); } looping = false; } __name(replenish, "replenish"); replenish(); }; }, "eachOfLimit"); function eachOfLimit$1(coll, limit, iteratee, callback) { return eachOfLimit(limit)(coll, wrapAsync(iteratee), callback); } __name(eachOfLimit$1, "eachOfLimit$1"); var eachOfLimit$2 = awaitify(eachOfLimit$1, 4); function eachOfArrayLike(coll, iteratee, callback) { callback = once(callback); var index2 = 0, completed = 0, { length } = coll, canceled = false; if (length === 0) { callback(null); } function iteratorCallback(err, value) { if (err === false) { canceled = true; } if (canceled === true) return; if (err) { callback(err); } else if (++completed === length || value === breakLoop) { callback(null); } } __name(iteratorCallback, "iteratorCallback"); for (; index2 < length; index2++) { iteratee(coll[index2], index2, onlyOnce(iteratorCallback)); } } __name(eachOfArrayLike, "eachOfArrayLike"); function eachOfGeneric(coll, iteratee, callback) { return eachOfLimit$2(coll, Infinity, iteratee, callback); } __name(eachOfGeneric, "eachOfGeneric"); function eachOf(coll, iteratee, callback) { var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; return eachOfImplementation(coll, wrapAsync(iteratee), callback); } __name(eachOf, "eachOf"); var eachOf$1 = awaitify(eachOf, 3); function map(coll, iteratee, callback) { return _asyncMap(eachOf$1, coll, iteratee, callback); } __name(map, "map"); var map$1 = awaitify(map, 3); var applyEach$1 = applyEach(map$1); function eachOfSeries(coll, iteratee, callback) { return eachOfLimit$2(coll, 1, iteratee, callback); } __name(eachOfSeries, "eachOfSeries"); var eachOfSeries$1 = awaitify(eachOfSeries, 3); function mapSeries(coll, iteratee, callback) { return _asyncMap(eachOfSeries$1, coll, iteratee, callback); } __name(mapSeries, "mapSeries"); var mapSeries$1 = awaitify(mapSeries, 3); var applyEachSeries = applyEach(mapSeries$1); var PROMISE_SYMBOL = Symbol("promiseCallback"); function promiseCallback() { let resolve, reject2; function callback(err, ...args) { if (err) return reject2(err); resolve(args.length > 1 ? args : args[0]); } __name(callback, "callback"); callback[PROMISE_SYMBOL] = new Promise((res, rej) => { resolve = res, reject2 = rej; }); return callback; } __name(promiseCallback, "promiseCallback"); function auto(tasks, concurrency, callback) { if (typeof concurrency !== "number") { callback = concurrency; concurrency = null; } callback = once(callback || promiseCallback()); var numTasks = Object.keys(tasks).length; if (!numTasks) { return callback(null); } if (!concurrency) { concurrency = numTasks; } var results = {}; var runningTasks = 0; var canceled = false; var hasError = false; var listeners = /* @__PURE__ */ Object.create(null); var readyTasks = []; var readyToCheck = []; var uncheckedDependencies = {}; Object.keys(tasks).forEach((key) => { var task = tasks[key]; if (!Array.isArray(task)) { enqueueTask(key, [task]); readyToCheck.push(key); return; } var dependencies = task.slice(0, task.length - 1); var remainingDependencies = dependencies.length; if (remainingDependencies === 0) { enqueueTask(key, task); readyToCheck.push(key); return; } uncheckedDependencies[key] = remainingDependencies; dependencies.forEach((dependencyName) => { if (!tasks[dependencyName]) { throw new Error("async.auto task `" + key + "` has a non-existent dependency `" + dependencyName + "` in " + dependencies.join(", ")); } addListener(dependencyName, () => { remainingDependencies--; if (remainingDependencies === 0) { enqueueTask(key, task); } }); }); }); checkForDeadlocks(); processQueue(); function enqueueTask(key, task) { readyTasks.push(() => runTask(key, task)); } __name(enqueueTask, "enqueueTask"); function processQueue() { if (canceled) return; if (readyTasks.length === 0 && runningTasks === 0) { return callback(null, results); } while (readyTasks.length && runningTasks < concurrency) { var run = readyTasks.shift(); run(); } } __name(processQueue, "processQueue"); function addListener(taskName, fn) { var taskListeners = listeners[taskName]; if (!taskListeners) { taskListeners = listeners[taskName] = []; } taskListeners.push(fn); } __name(addListener, "addListener"); function taskComplete(taskName) { var taskListeners = listeners[taskName] || []; taskListeners.forEach((fn) => fn()); processQueue(); } __name(taskComplete, "taskComplete"); function runTask(key, task) { if (hasError) return; var taskCallback = onlyOnce((err, ...result) => { runningTasks--; if (err === false) { canceled = true; return; } if (result.length < 2) { [result] = result; } if (err) { var safeResults = {}; Object.keys(results).forEach((rkey) => { safeResults[rkey] = results[rkey]; }); safeResults[key] = result; hasError = true; listeners = /* @__PURE__ */ Object.create(null); if (canceled) return; callback(err, safeResults); } else { results[key] = result; taskComplete(key); } }); runningTasks++; var taskFn = wrapAsync(task[task.length - 1]); if (task.length > 1) { taskFn(results, taskCallback); } else { taskFn(taskCallback); } } __name(runTask, "runTask"); function checkForDeadlocks() { var currentTask; var counter = 0; while (readyToCheck.length) { currentTask = readyToCheck.pop(); counter++; getDependents(currentTask).forEach((dependent) => { if (--uncheckedDependencies[dependent] === 0) { readyToCheck.push(dependent); } }); } if (counter !== numTasks) { throw new Error("async.auto cannot execute tasks due to a recursive dependency"); } } __name(checkForDeadlocks, "checkForDeadlocks"); function getDependents(taskName) { var result = []; Object.keys(tasks).forEach((key) => { const task = tasks[key]; if (Array.isArray(task) && task.indexOf(taskName) >= 0) { result.push(key); } }); return result; } __name(getDependents, "getDependents"); return callback[PROMISE_SYMBOL]; } __name(auto, "auto"); var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/; var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/; var FN_ARG_SPLIT = /,/; var FN_ARG = /(=.+)?(\s*)$/; function stripComments(string) { let stripped = ""; let index2 = 0; let endBlockComment = string.indexOf("*/"); while (index2 < string.length) { if (string[index2] === "/" && string[index2 + 1] === "/") { let endIndex = string.indexOf("\n", index2); index2 = endIndex === -1 ? string.length : endIndex; } else if (endBlockComment !== -1 && string[index2] === "/" && string[index2 + 1] === "*") { let endIndex = string.indexOf("*/", index2); if (endIndex !== -1) { index2 = endIndex + 2; endBlockComment = string.indexOf("*/", index2); } else { stripped += string[index2]; index2++; } } else { stripped += string[index2]; index2++; } } return stripped; } __name(stripComments, "stripComments"); function parseParams(func) { const src = stripComments(func.toString()); let match = src.match(FN_ARGS); if (!match) { match = src.match(ARROW_FN_ARGS); } if (!match) throw new Error("could not parse args in autoInject\nSource:\n" + src); let [, args] = match; return args.replace(/\s/g, "").split(FN_ARG_SPLIT).map((arg) => arg.replace(FN_ARG, "").trim()); } __name(parseParams, "parseParams"); function autoInject(tasks, callback) { var newTasks = {}; Object.keys(tasks).forEach((key) => { var taskFn = tasks[key]; var params; var fnIsAsync = isAsync(taskFn); var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0; if (Array.isArray(taskFn)) { params = [...taskFn]; taskFn = params.pop(); newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); } else if (hasNoDeps) { newTasks[key] = taskFn; } else { params = parseParams(taskFn); if (taskFn.length === 0 && !fnIsAsync && params.length === 0) { throw new Error("autoInject task functions require explicit parameters."); } if (!fnIsAsync) params.pop(); newTasks[key] = params.concat(newTask); } function newTask(results, taskCb) { var newArgs = params.map((name) => results[name]); newArgs.push(taskCb); wrapAsync(taskFn)(...newArgs); } __name(newTask, "newTask"); }); return auto(newTasks, callback); } __name(autoInject, "autoInject"); var DLL = class { constructor() { this.head = this.tail = null; this.length = 0; } removeLink(node) { if (node.prev) node.prev.next = node.next; else this.head = node.next; if (node.next) node.next.prev = node.prev; else this.tail = node.prev; node.prev = node.next = null; this.length -= 1; return node; } empty() { while (this.head) this.shift(); return this; } insertAfter(node, newNode) { newNode.prev = node; newNode.next = node.next; if (node.next) node.next.prev = newNode; else this.tail = newNode; node.next = newNode; this.length += 1; } insertBefore(node, newNode) { newNode.prev = node.prev; newNode.next = node; if (node.prev) node.prev.next = newNode; else this.head = newNode; node.prev = newNode; this.length += 1; } unshift(node) { if (this.head) this.insertBefore(this.head, node); else setInitial(this, node); } push(node) { if (this.tail) this.insertAfter(this.tail, node); else setInitial(this, node); } shift() { return this.head && this.removeLink(this.head); } pop() { return this.tail && this.removeLink(this.tail); } toArray() { return [...this]; } *[Symbol.iterator]() { var cur = this.head; while (cur) { yield cur.data; cur = cur.next; } } remove(testFn) { var curr = this.head; while (curr) { var { next } = curr; if (testFn(curr)) { this.removeLink(curr); } curr = next; } return this; } }; __name(DLL, "DLL"); function setInitial(dll, node) { dll.length = 1; dll.head = dll.tail = node; } __name(setInitial, "setInitial"); function queue(worker, concurrency, payload) { if (concurrency == null) { concurrency = 1; } else if (concurrency === 0) { throw new RangeError("Concurrency must not be zero"); } var _worker = wrapAsync(worker); var numRunning = 0; var workersList = []; const events = { error: [], drain: [], saturated: [], unsaturated: [], empty: [] }; function on(event, handler) { events[event].push(handler); } __name(on, "on"); function once2(event, handler) { const handleAndRemove = /* @__PURE__ */ __name((...args) => { off(event, handleAndRemove); handler(...args); }, "handleAndRemove"); events[event].push(handleAndRemove); } __name(once2, "once"); function off(event, handler) { if (!event) return Object.keys(events).forEach((ev) => events[ev] = []); if (!handler) return events[event] = []; events[event] = events[event].filter((ev) => ev !== handler); } __name(off, "off"); function trigger(event, ...args) { events[event].forEach((handler) => handler(...args)); } __name(trigger, "trigger"); var processingScheduled = false; function _insert(data, insertAtFront, rejectOnError, callback) { if (callback != null && typeof callback !== "function") { throw new Error("task callback must be a function"); } q.started = true; var res, rej; function promiseCallback2(err, ...args) { if (err) return rejectOnError ? rej(err) : res(); if (args.length <= 1) return res(args[0]); res(args); } __name(promiseCallback2, "promiseCallback"); var item = q._createTaskItem(data, rejectOnError ? promiseCallback2 : callback || promiseCallback2); if (insertAtFront) { q._tasks.unshift(item); } else { q._tasks.push(item); } if (!processingScheduled) { processingScheduled = true; setImmediate$1(() => { processingScheduled = false; q.process(); }); } if (rejectOnError || !callback) { return new Promise((resolve, reject2) => { res = resolve; rej = reject2; }); } } __name(_insert, "_insert"); function _createCB(tasks) { return function(err, ...args) { numRunning -= 1; for (var i = 0, l = tasks.length; i < l; i++) { var task = tasks[i]; var index2 = workersList.indexOf(task); if (index2 === 0) { workersList.shift(); } else if (index2 > 0) { workersList.splice(index2, 1); } task.callback(err, ...args); if (err != null) { trigger("error", err, task.data); } } if (numRunning <= q.concurrency - q.buffer) { trigger("unsaturated"); } if (q.idle()) { trigger("drain"); } q.process(); }; } __name(_createCB, "_createCB"); function _maybeDrain(data) { if (data.length === 0 && q.idle()) { setImmediate$1(() => trigger("drain")); return true; } return false; } __name(_maybeDrain, "_maybeDrain"); const eventMethod = /* @__PURE__ */ __name((name) => (handler) => { if (!handler) { return new Promise((resolve, reject2) => { once2(name, (err, data) => { if (err) return reject2(err); resolve(data); }); }); } off(name); on(name, handler); }, "eventMethod"); var isProcessing = false; var q = { _tasks: new DLL(), _createTaskItem(data, callback) { return { data, callback }; }, *[Symbol.iterator]() { yield* q._tasks[Symbol.iterator](); }, concurrency, payload, buffer: concurrency / 4, started: false, paused: false, push(data, callback) { if (Array.isArray(data)) { if (_maybeDrain(data)) return; return data.map((datum) => _insert(datum, false, false, callback)); } return _insert(data, false, false, callback); }, pushAsync(data, callback) { if (Array.isArray(data)) { if (_maybeDrain(data)) return; return data.map((datum) => _insert(datum, false, true, callback)); } return _insert(data, false, true, callback); }, kill() { off(); q._tasks.empty(); }, unshift(data, callback) { if (Array.isArray(data)) { if (_maybeDrain(data)) return; return data.map((datum) => _insert(datum, true, false, callback)); } return _insert(data, true, false, callback); }, unshiftAsync(data, callback) { if (Array.isArray(data)) { if (_maybeDrain(data)) return; return data.map((datum) => _insert(datum, true, true, callback)); } return _insert(data, true, true, callback); }, remove(testFn) { q._tasks.remove(testFn); }, process() { if (isProcessing) { return; } isProcessing = true; while (!q.paused && numRunning < q.concurrency && q._tasks.length) { var tasks = [], data = []; var l = q._tasks.length; if (q.payload) l = Math.min(l, q.payload); for (var i = 0; i < l; i++) { var node = q._tasks.shift(); tasks.push(node); workersList.push(node); data.push(node.data); } numRunning += 1; if (q._tasks.length === 0) { trigger("empty"); } if (numRunning === q.concurrency) { trigger("saturated"); } var cb = onlyOnce(_createCB(tasks)); _worker(data, cb); } isProcessing = false; }, length() { return q._tasks.length; }, running() { return numRunning; }, workersList() { return workersList; }, idle() { return q._tasks.length + numRunning === 0; }, pause() { q.paused = true; }, resume() { if (q.paused === false) { return; } q.paused = false; setImmediate$1(q.process); } }; Object.defineProperties(q, { saturated: { writable: false, value: eventMethod("saturated") }, unsaturated: { writable: false, value: eventMethod("unsaturated") }, empty: { writable: false, value: eventMethod("empty") }, drain: { writable: false, value: eventMethod("drain") }, error: { writable: false, value: eventMethod("error") } }); return q; } __name(queue, "queue"); function cargo(worker, payload) { return queue(worker, 1, payload); } __name(cargo, "cargo"); function cargo$1(worker, concurrency, payload) { return queue(worker, concurrency, payload); } __name(cargo$1, "cargo$1"); function reduce(coll, memo, iteratee, callback) { callback = once(callback); var _iteratee = wrapAsync(iteratee); return eachOfSeries$1(coll, (x, i, iterCb) => { _iteratee(memo, x, (err, v) => { memo = v; iterCb(err); }); }, (err) => callback(err, memo)); } __name(reduce, "reduce"); var reduce$1 = awaitify(reduce, 4); function seq(...functions) { var _functions = functions.map(wrapAsync); return function(...args) { var that = this; var cb = args[args.length - 1]; if (typeof cb == "function") { args.pop(); } else { cb = promiseCallback(); } reduce$1(_functions, args, (newargs, fn, iterCb) => { fn.apply(that, newargs.concat((err, ...nextargs) => { iterCb(err, nextargs); })); }, (err, results) => cb(err, ...results)); return cb[PROMISE_SYMBOL]; }; } __name(seq, "seq"); function compose(...args) { return seq(...args.reverse()); } __name(compose, "compose"); function mapLimit(coll, limit, iteratee, callback) { return _asyncMap(eachOfLimit(limit), coll, iteratee, callback); } __name(mapLimit, "mapLimit"); var mapLimit$1 = awaitify(mapLimit, 4); function concatLimit(coll, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); return mapLimit$1(coll, limit, (val, iterCb) => { _iteratee(val, (err, ...args) => { if (err) return iterCb(err); return iterCb(err, args); }); }, (err, mapResults) => { var result = []; for (var i = 0; i < mapResults.length; i++) { if (mapResults[i]) { result = result.concat(...mapResults[i]); } } return callback(err, result); }); } __name(concatLimit, "concatLimit"); var concatLimit$1 = awaitify(concatLimit, 4); function concat(coll, iteratee, callback) { return concatLimit$1(coll, Infinity, iteratee, callback); } __name(concat, "concat"); var concat$1 = awaitify(concat, 3); function concatSeries(coll, iteratee, callback) { return concatLimit$1(coll, 1, iteratee, callback); } __name(concatSeries, "concatSeries"); var concatSeries$1 = awaitify(concatSeries, 3); function constant(...args) { return function(...ignoredArgs) { var callback = ignoredArgs.pop(); return callback(null, ...args); }; } __name(constant, "constant"); function _createTester(check, getResult) { return (eachfn, arr, _iteratee, cb) => { var testPassed = false; var testResult; const iteratee = wrapAsync(_iteratee); eachfn(arr, (value, _, callback) => { iteratee(value, (err, result) => { if (err || err === false) return callback(err); if (check(result) && !testResult) { testPassed = true; testResult = getResult(true, value); return callback(null, breakLoop); } callback(); }); }, (err) => { if (err) return cb(err); cb(null, testPassed ? testResult : getResult(false)); }); }; } __name(_createTester, "_createTester"); function detect(coll, iteratee, callback) { return _createTester((bool) => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback); } __name(detect, "detect"); var detect$1 = awaitify(detect, 3); function detectLimit(coll, limit, iteratee, callback) { return _createTester((bool) => bool, (res, item) => item)(eachOfLimit(limit), coll, iteratee, callback); } __name(detectLimit, "detectLimit"); var detectLimit$1 = awaitify(detectLimit, 4); function detectSeries(coll, iteratee, callback) { return _createTester((bool) => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback); } __name(detectSeries, "detectSeries"); var detectSeries$1 = awaitify(detectSeries, 3); function consoleFunc(name) { return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => { if (typeof console === "object") { if (err) { if (console.error) { console.error(err); } } else if (console[name]) { resultArgs.forEach((x) => console[name](x)); } } }); } __name(consoleFunc, "consoleFunc"); var dir = consoleFunc("dir"); function doWhilst(iteratee, test2, callback) { callback = onlyOnce(callback); var _fn = wrapAsync(iteratee); var _test = wrapAsync(test2); var results; function next(err, ...args) { if (err) return callback(err); if (err === false) return; results = args; _test(...args, check); } __name(next, "next"); function check(err, truth) { if (err) return callback(err); if (err === false) return; if (!truth) return callback(null, ...results); _fn(next); } __name(check, "check"); return check(null, true); } __name(doWhilst, "doWhilst"); var doWhilst$1 = awaitify(doWhilst, 3); function doUntil(iteratee, test2, callback) { const _test = wrapAsync(test2); return doWhilst$1(iteratee, (...args) => { const cb = args.pop(); _test(...args, (err, truth) => cb(err, !truth)); }, callback); } __name(doUntil, "doUntil"); function _withoutIndex(iteratee) { return (value, index2, callback) => iteratee(value, callback); } __name(_withoutIndex, "_withoutIndex"); function eachLimit(coll, iteratee, callback) { return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); } __name(eachLimit, "eachLimit"); var each = awaitify(eachLimit, 3); function eachLimit$1(coll, limit, iteratee, callback) { return eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); } __name(eachLimit$1, "eachLimit$1"); var eachLimit$2 = awaitify(eachLimit$1, 4); function eachSeries(coll, iteratee, callback) { return eachLimit$2(coll, 1, iteratee, callback); } __name(eachSeries, "eachSeries"); var eachSeries$1 = awaitify(eachSeries, 3); function ensureAsync(fn) { if (isAsync(fn)) return fn; return function(...args) { var callback = args.pop(); var sync = true; args.push((...innerArgs) => { if (sync) { setImmediate$1(() => callback(...innerArgs)); } else { callback(...innerArgs); } }); fn.apply(this, args); sync = false; }; } __name(ensureAsync, "ensureAsync"); function every(coll, iteratee, callback) { return _createTester((bool) => !bool, (res) => !res)(eachOf$1, coll, iteratee, callback); } __name(every, "every"); var every$1 = awaitify(every, 3); function everyLimit(coll, limit, iteratee, callback) { return _createTester((bool) => !bool, (res) => !res)(eachOfLimit(limit), coll, iteratee, callback); } __name(everyLimit, "everyLimit"); var everyLimit$1 = awaitify(everyLimit, 4); function everySeries(coll, iteratee, callback) { return _createTester((bool) => !bool, (res) => !res)(eachOfSeries$1, coll, iteratee, callback); } __name(everySeries, "everySeries"); var everySeries$1 = awaitify(everySeries, 3); function filterArray(eachfn, arr, iteratee, callback) { var truthValues = new Array(arr.length); eachfn(arr, (x, index2, iterCb) => { iteratee(x, (err, v) => { truthValues[index2] = !!v; iterCb(err); }); }, (err) => { if (err) return callback(err); var results = []; for (var i = 0; i < arr.length; i++) { if (truthValues[i]) results.push(arr[i]); } callback(null, results); }); } __name(filterArray, "filterArray"); function filterGeneric(eachfn, coll, iteratee, callback) { var results = []; eachfn(coll, (x, index2, iterCb) => { iteratee(x, (err, v) => { if (err) return iterCb(err); if (v) { results.push({ index: index2, value: x }); } iterCb(err); }); }, (err) => { if (err) return callback(err); callback(null, results.sort((a, b) => a.index - b.index).map((v) => v.value)); }); } __name(filterGeneric, "filterGeneric"); function _filter(eachfn, coll, iteratee, callback) { var filter2 = isArrayLike(coll) ? filterArray : filterGeneric; return filter2(eachfn, coll, wrapAsync(iteratee), callback); } __name(_filter, "_filter"); function filter(coll, iteratee, callback) { return _filter(eachOf$1, coll, iteratee, callback); } __name(filter, "filter"); var filter$1 = awaitify(filter, 3); function filterLimit(coll, limit, iteratee, callback) { return _filter(eachOfLimit(limit), coll, iteratee, callback); } __name(filterLimit, "filterLimit"); var filterLimit$1 = awaitify(filterLimit, 4); function filterSeries(coll, iteratee, callback) { return _filter(eachOfSeries$1, coll, iteratee, callback); } __name(filterSeries, "filterSeries"); var filterSeries$1 = awaitify(filterSeries, 3); function forever(fn, errback) { var done = onlyOnce(errback); var task = wrapAsync(ensureAsync(fn)); function next(err) { if (err) return done(err); if (err === false) return; task(next); } __name(next, "next"); return next(); } __name(forever, "forever"); var forever$1 = awaitify(forever, 2); function groupByLimit(coll, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); return mapLimit$1(coll, limit, (val, iterCb) => { _iteratee(val, (err, key) => { if (err) return iterCb(err); return iterCb(err, { key, val }); }); }, (err, mapResults) => { var result = {}; var { hasOwnProperty } = Object.prototype; for (var i = 0; i < mapResults.length; i++) { if (mapResults[i]) { var { key } = mapResults[i]; var { val } = mapResults[i]; if (hasOwnProperty.call(result, key)) { result[key].push(val); } else { result[key] = [val]; } } } return callback(err, result); }); } __name(groupByLimit, "groupByLimit"); var groupByLimit$1 = awaitify(groupByLimit, 4); function groupBy(coll, iteratee, callback) { return groupByLimit$1(coll, Infinity, iteratee, callback); } __name(groupBy, "groupBy"); function groupBySeries(coll, iteratee, callback) { return groupByLimit$1(coll, 1, iteratee, callback); } __name(groupBySeries, "groupBySeries"); var log = consoleFunc("log"); function mapValuesLimit(obj, limit, iteratee, callback) { callback = once(callback); var newObj = {}; var _iteratee = wrapAsync(iteratee); return eachOfLimit(limit)(obj, (val, key, next) => { _iteratee(val, key, (err, result) => { if (err) return next(err); newObj[key] = result; next(err); }); }, (err) => callback(err, newObj)); } __name(mapValuesLimit, "mapValuesLimit"); var mapValuesLimit$1 = awaitify(mapValuesLimit, 4); function mapValues(obj, iteratee, callback) { return mapValuesLimit$1(obj, Infinity, iteratee, callback); } __name(mapValues, "mapValues"); function mapValuesSeries(obj, iteratee, callback) { return mapValuesLimit$1(obj, 1, iteratee, callback); } __name(mapValuesSeries, "mapValuesSeries"); function memoize(fn, hasher = (v) => v) { var memo = /* @__PURE__ */ Object.create(null); var queues = /* @__PURE__ */ Object.create(null); var _fn = wrapAsync(fn); var memoized = initialParams((args, callback) => { var key = hasher(...args); if (key in memo) { setImmediate$1(() => callback(null, ...memo[key])); } else if (key in queues) { queues[key].push(callback); } else { queues[key] = [callback]; _fn(...args, (err, ...resultArgs) => { if (!err) { memo[key] = resultArgs; } var q = queues[key]; delete queues[key]; for (var i = 0, l = q.length; i < l; i++) { q[i](err, ...resultArgs); } }); } }); memoized.memo = memo; memoized.unmemoized = fn; return memoized; } __name(memoize, "memoize"); var _defer$1; if (hasNextTick) { _defer$1 = process.nextTick; } else if (hasSetImmediate) { _defer$1 = setImmediate; } else { _defer$1 = fallback; } var nextTick = wrap(_defer$1); var parallel = awaitify((eachfn, tasks, callback) => { var results = isArrayLike(tasks) ? [] : {}; eachfn(tasks, (task, key, taskCb) => { wrapAsync(task)((err, ...result) => { if (result.length < 2) { [result] = result; } results[key] = result; taskCb(err); }); }, (err) => callback(err, results)); }, 3); function parallel$1(tasks, callback) { return parallel(eachOf$1, tasks, callback); } __name(parallel$1, "parallel$1"); function parallelLimit(tasks, limit, callback) { return parallel(eachOfLimit(limit), tasks, callback); } __name(parallelLimit, "parallelLimit"); function queue$1(worker, concurrency) { var _worker = wrapAsync(worker); return queue((items, cb) => { _worker(items[0], cb); }, concurrency, 1); } __name(queue$1, "queue$1"); var Heap = class { constructor() { this.heap = []; this.pushCount = Number.MIN_SAFE_INTEGER; } get length() { return this.heap.length; } empty() { this.heap = []; return this; } percUp(index2) { let p; while (index2 > 0 && smaller(this.heap[index2], this.heap[p = parent(index2)])) { let t = this.heap[index2]; this.heap[index2] = this.heap[p]; this.heap[p] = t; index2 = p; } } percDown(index2) { let l; while ((l = leftChi(index2)) < this.heap.length) { if (l + 1 < this.heap.length && smaller(this.heap[l + 1], this.heap[l])) { l = l + 1; } if (smaller(this.heap[index2], this.heap[l])) { break; } let t = this.heap[index2]; this.heap[index2] = this.heap[l]; this.heap[l] = t; index2 = l; } } push(node) { node.pushCount = ++this.pushCount; this.heap.push(node); this.percUp(this.heap.length - 1); } unshift(node) { return this.heap.push(node); } shift() { let [top] = this.heap; this.heap[0] = this.heap[this.heap.length - 1]; this.heap.pop(); this.percDown(0); return top; } toArray() { return [...this]; } *[Symbol.iterator]() { for (let i = 0; i < this.heap.length; i++) { yield this.heap[i].data; } } remove(testFn) { let j = 0; for (let i = 0; i < this.heap.length; i++) { if (!testFn(this.heap[i])) { this.heap[j] = this.heap[i]; j++; } } this.heap.splice(j); for (let i = parent(this.heap.length - 1); i >= 0; i--) { this.percDown(i); } return this; } }; __name(Heap, "Heap"); function leftChi(i) { return (i << 1) + 1; } __name(leftChi, "leftChi"); function parent(i) { return (i + 1 >> 1) - 1; } __name(parent, "parent"); function smaller(x, y) { if (x.priority !== y.priority) { return x.priority < y.priority; } else { return x.pushCount < y.pushCount; } } __name(smaller, "smaller"); function priorityQueue(worker, concurrency) { var q = queue$1(worker, concurrency); var { push, pushAsync } = q; q._tasks = new Heap(); q._createTaskItem = ({ data, priority }, callback) => { return { data, priority, callback }; }; function createDataItems(tasks, priority) { if (!Array.isArray(tasks)) { return { data: tasks, priority }; } return tasks.map((data) => { return { data, priority }; }); } __name(createDataItems, "createDataItems"); q.push = function(data, priority = 0, callback) { return push(createDataItems(data, priority), callback); }; q.pushAsync = function(data, priority = 0, callback) { return pushAsync(createDataItems(data, priority), callback); }; delete q.unshift; delete q.unshiftAsync; return q; } __name(priorityQueue, "priorityQueue"); function race(tasks, callback) { callback = once(callback); if (!Array.isArray(tasks)) return callback(new TypeError("First argument to race must be an array of functions")); if (!tasks.length) return callback(); for (var i = 0, l = tasks.length; i < l; i++) { wrapAsync(tasks[i])(callback); } } __name(race, "race"); var race$1 = awaitify(race, 2); function reduceRight(array, memo, iteratee, callback) { var reversed = [...array].reverse(); return reduce$1(reversed, memo, iteratee, callback); } __name(reduceRight, "reduceRight"); function reflect(fn) { var _fn = wrapAsync(fn); return initialParams(/* @__PURE__ */ __name(function reflectOn(args, reflectCallback) { args.push((error, ...cbArgs) => { let retVal = {}; if (error) { retVal.error = error; } if (cbArgs.length > 0) { var value = cbArgs; if (cbArgs.length <= 1) { [value] = cbArgs; } retVal.value = value; } reflectCallback(null, retVal); }); return _fn.apply(this, args); }, "reflectOn")); } __name(reflect, "reflect"); function reflectAll(tasks) { var results; if (Array.isArray(tasks)) { results = tasks.map(reflect); } else { results = {}; Object.keys(tasks).forEach((key) => { results[key] = reflect.call(this, tasks[key]); }); } return results; } __name(reflectAll, "reflectAll"); function reject(eachfn, arr, _iteratee, callback) { const iteratee = wrapAsync(_iteratee); return _filter(eachfn, arr, (value, cb) => { iteratee(value, (err, v) => { cb(err, !v); }); }, callback); } __name(reject, "reject"); function reject$1(coll, iteratee, callback) { return reject(eachOf$1, coll, iteratee, callback); } __name(reject$1, "reject$1"); var reject$2 = awaitify(reject$1, 3); function rejectLimit(coll, limit, iteratee, callback) { return reject(eachOfLimit(limit), coll, iteratee, callback); } __name(rejectLimit, "rejectLimit"); var rejectLimit$1 = awaitify(rejectLimit, 4); function rejectSeries(coll, iteratee, callback) { return reject(eachOfSeries$1, coll, iteratee, callback); } __name(rejectSeries, "rejectSeries"); var rejectSeries$1 = awaitify(rejectSeries, 3); function constant$1(value) { return function() { return value; }; } __name(constant$1, "constant$1"); var DEFAULT_TIMES = 5; var DEFAULT_INTERVAL = 0; function retry(opts, task, callback) { var options = { times: DEFAULT_TIMES, intervalFunc: constant$1(DEFAULT_INTERVAL) }; if (arguments.length < 3 && typeof opts === "function") { callback = task || promiseCallback(); task = opts; } else { parseTimes(options, opts); callback = callback || promiseCallback(); } if (typeof task !== "function") { throw new Error("Invalid arguments for async.retry"); } var _task = wrapAsync(task); var attempt = 1; function retryAttempt() { _task((err, ...args) => { if (err === false) return; if (err && attempt++ < options.times && (typeof options.errorFilter != "function" || options.errorFilter(err))) { setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); } else { callback(err, ...args); } }); } __name(retryAttempt, "retryAttempt"); retryAttempt(); return callback[PROMISE_SYMBOL]; } __name(retry, "retry"); function parseTimes(acc, t) { if (typeof t === "object") { acc.times = +t.times || DEFAULT_TIMES; acc.intervalFunc = typeof t.interval === "function" ? t.interval : constant$1(+t.interval || DEFAULT_INTERVAL); acc.errorFilter = t.errorFilter; } else if (typeof t === "number" || typeof t === "string") { acc.times = +t || DEFAULT_TIMES; } else { throw new Error("Invalid arguments for async.retry"); } } __name(parseTimes, "parseTimes"); function retryable(opts, task) { if (!task) { task = opts; opts = null; } let arity = opts && opts.arity || task.length; if (isAsync(task)) { arity += 1; } var _task = wrapAsync(task); return initialParams((args, callback) => { if (args.length < arity - 1 || callback == null) { args.push(callback); callback = promiseCallback(); } function taskFn(cb) { _task(...args, cb); } __name(taskFn, "taskFn"); if (opts) retry(opts, taskFn, callback); else retry(taskFn, callback); return callback[PROMISE_SYMBOL]; }); } __name(retryable, "retryable"); function series(tasks, callback) { return parallel(eachOfSeries$1, tasks, callback); } __name(series, "series"); function some(coll, iteratee, callback) { return _createTester(Boolean, (res) => res)(eachOf$1, coll, iteratee, callback); } __name(some, "some"); var some$1 = awaitify(some, 3); function someLimit(coll, limit, iteratee, callback) { return _createTester(Boolean, (res) => res)(eachOfLimit(limit), coll, iteratee, callback); } __name(someLimit, "someLimit"); var someLimit$1 = awaitify(someLimit, 4); function someSeries(coll, iteratee, callback) { return _createTester(Boolean, (res) => res)(eachOfSeries$1, coll, iteratee, callback); } __name(someSeries, "someSeries"); var someSeries$1 = awaitify(someSeries, 3); function sortBy(coll, iteratee, callback) { var _iteratee = wrapAsync(iteratee); return map$1(coll, (x, iterCb) => { _iteratee(x, (err, criteria) => { if (err) return iterCb(err); iterCb(err, { value: x, criteria }); }); }, (err, results) => { if (err) return callback(err); callback(null, results.sort(comparator).map((v) => v.value)); }); function comparator(left, right) { var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; } __name(comparator, "comparator"); } __name(sortBy, "sortBy"); var sortBy$1 = awaitify(sortBy, 3); function timeout(asyncFn, milliseconds, info) { var fn = wrapAsync(asyncFn); return initialParams((args, callback) => { var timedOut = false; var timer; function timeoutCallback() { var name = asyncFn.name || "anonymous"; var error = new Error('Callback function "' + name + '" timed out.'); error.code = "ETIMEDOUT"; if (info) { error.info = info; } timedOut = true; callback(error); } __name(timeoutCallback, "timeoutCallback"); args.push((...cbArgs) => { if (!timedOut) { callback(...cbArgs); clearTimeout(timer); } }); timer = setTimeout(timeoutCallback, milliseconds); fn(...args); }); } __name(timeout, "timeout"); function range(size) { var result = Array(size); while (size--) { result[size] = size; } return result; } __name(range, "range"); function timesLimit(count, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); return mapLimit$1(range(count), limit, _iteratee, callback); } __name(timesLimit, "timesLimit"); function times(n, iteratee, callback) { return timesLimit(n, Infinity, iteratee, callback); } __name(times, "times"); function timesSeries(n, iteratee, callback) { return timesLimit(n, 1, iteratee, callback); } __name(timesSeries, "timesSeries"); function transform(coll, accumulator, iteratee, callback) { if (arguments.length <= 3 && typeof accumulator === "function") { callback = iteratee; iteratee = accumulator; accumulator = Array.isArray(coll) ? [] : {}; } callback = once(callback || promiseCallback()); var _iteratee = wrapAsync(iteratee); eachOf$1(coll, (v, k, cb) => { _iteratee(accumulator, v, k, cb); }, (err) => callback(err, accumulator)); return callback[PROMISE_SYMBOL]; } __name(transform, "transform"); function tryEach(tasks, callback) { var error = null; var result; return eachSeries$1(tasks, (task, taskCb) => { wrapAsync(task)((err, ...args) => { if (err === false) return taskCb(err); if (args.length < 2) { [result] = args; } else { result = args; } error = err; taskCb(err ? null : {}); }); }, () => callback(error, result)); } __name(tryEach, "tryEach"); var tryEach$1 = awaitify(tryEach); function unmemoize(fn) { return (...args) => { return (fn.unmemoized || fn)(...args); }; } __name(unmemoize, "unmemoize"); function whilst(test2, iteratee, callback) { callback = onlyOnce(callback); var _fn = wrapAsync(iteratee); var _test = wrapAsync(test2); var results = []; function next(err, ...rest) { if (err) return callback(err); results = rest; if (err === false) return; _test(check); } __name(next, "next"); function check(err, truth) { if (err) return callback(err); if (err === false) return; if (!truth) return callback(null, ...results); _fn(next); } __name(check, "check"); return _test(check); } __name(whilst, "whilst"); var whilst$1 = awaitify(whilst, 3); function until(test2, iteratee, callback) { const _test = wrapAsync(test2); return whilst$1((cb) => _test((err, truth) => cb(err, !truth)), iteratee, callback); } __name(until, "until"); function waterfall(tasks, callback) { callback = once(callback); if (!Array.isArray(tasks)) return callback(new Error("First argument to waterfall must be an array of functions")); if (!tasks.length) return callback(); var taskIndex = 0; function nextTask(args) { var task = wrapAsync(tasks[taskIndex++]); task(...args, onlyOnce(next)); } __name(nextTask, "nextTask"); function next(err, ...args) { if (err === false) return; if (err || taskIndex === tasks.length) { return callback(err, ...args); } nextTask(args); } __name(next, "next"); nextTask([]); } __name(waterfall, "waterfall"); var waterfall$1 = awaitify(waterfall); var index = { apply, applyEach: applyEach$1, applyEachSeries, asyncify, auto, autoInject, cargo, cargoQueue: cargo$1, compose, concat: concat$1, concatLimit: concatLimit$1, concatSeries: concatSeries$1, constant, detect: detect$1, detectLimit: detectLimit$1, detectSeries: detectSeries$1, dir, doUntil, doWhilst: doWhilst$1, each, eachLimit: eachLimit$2, eachOf: eachOf$1, eachOfLimit: eachOfLimit$2, eachOfSeries: eachOfSeries$1, eachSeries: eachSeries$1, ensureAsync, every: every$1, everyLimit: everyLimit$1, everySeries: everySeries$1, filter: filter$1, filterLimit: filterLimit$1, filterSeries: filterSeries$1, forever: forever$1, groupBy, groupByLimit: groupByLimit$1, groupBySeries, log, map: map$1, mapLimit: mapLimit$1, mapSeries: mapSeries$1, mapValues, mapValuesLimit: mapValuesLimit$1, mapValuesSeries, memoize, nextTick, parallel: parallel$1, parallelLimit, priorityQueue, queue: queue$1, race: race$1, reduce: reduce$1, reduceRight, reflect, reflectAll, reject: reject$2, rejectLimit: rejectLimit$1, rejectSeries: rejectSeries$1, retry, retryable, seq, series, setImmediate: setImmediate$1, some: some$1, someLimit: someLimit$1, someSeries: someSeries$1, sortBy: sortBy$1, timeout, times, timesLimit, timesSeries, transform, tryEach: tryEach$1, unmemoize, until, waterfall: waterfall$1, whilst: whilst$1, all: every$1, allLimit: everyLimit$1, allSeries: everySeries$1, any: some$1, anyLimit: someLimit$1, anySeries: someSeries$1, find: detect$1, findLimit: detectLimit$1, findSeries: detectSeries$1, flatMap: concat$1, flatMapLimit: concatLimit$1, flatMapSeries: concatSeries$1, forEach: each, forEachSeries: eachSeries$1, forEachLimit: eachLimit$2, forEachOf: eachOf$1, forEachOfSeries: eachOfSeries$1, forEachOfLimit: eachOfLimit$2, inject: reduce$1, foldl: reduce$1, foldr: reduceRight, select: filter$1, selectLimit: filterLimit$1, selectSeries: filterSeries$1, wrapSync: asyncify, during: whilst$1, doDuring: doWhilst$1 }; var async_default = index; // src/Convert.ts var import_os = require("os"); // src/utils/Utils.ts var import_which = __toESM(require_lib()); function doesProgramExist(name) { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Checking if program ${name} exists`); return (yield (0, import_which.default)(name, { nothrow: true })) != null; }); } __name(doesProgramExist, "doesProgramExist"); // src/Convert.ts var import_promises = require("fs/promises"); var import_randomstring = __toESM(require_randomstring2()); var import_path = require("path"); var import_exec = __toESM(require_exec()); // node_modules/globby/index.js var import_node_fs2 = __toESM(require("node:fs"), 1); var import_node_path2 = __toESM(require("node:path"), 1); var import_merge2 = __toESM(require_merge2(), 1); var import_fast_glob2 = __toESM(require_out4(), 1); var import_dir_glob = __toESM(require_dir_glob(), 1); // node_modules/globby/ignore.js var import_node_process = __toESM(require("node:process"), 1); var import_node_fs = __toESM(require("node:fs"), 1); var import_node_path = __toESM(require("node:path"), 1); var import_fast_glob = __toESM(require_out4(), 1); var import_ignore = __toESM(require_ignore(), 1); // node_modules/slash/index.js function slash(path2) { const isExtendedLengthPath = /^\\\\\?\\/.test(path2); const hasNonAscii = /[^\u0000-\u0080]+/.test(path2); if (isExtendedLengthPath || hasNonAscii) { return path2; } return path2.replace(/\\/g, "/"); } __name(slash, "slash"); // node_modules/globby/utilities.js var import_node_url = require("node:url"); var import_node_stream = require("node:stream"); var toPath = /* @__PURE__ */ __name((urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath, "toPath"); var FilterStream = class extends import_node_stream.Transform { constructor(filter2) { super({ objectMode: true, transform(data, encoding, callback) { callback(void 0, filter2(data) ? data : void 0); } }); } }; __name(FilterStream, "FilterStream"); var isNegativePattern = /* @__PURE__ */ __name((pattern) => pattern[0] === "!", "isNegativePattern"); // node_modules/globby/ignore.js var ignoreFilesGlobOptions = { ignore: [ "**/node_modules", "**/flow-typed", "**/coverage", "**/.git" ], absolute: true, dot: true }; var GITIGNORE_FILES_PATTERN = "**/.gitignore"; var applyBaseToPattern = /* @__PURE__ */ __name((pattern, base) => isNegativePattern(pattern) ? "!" + import_node_path.default.posix.join(base, pattern.slice(1)) : import_node_path.default.posix.join(base, pattern), "applyBaseToPattern"); var parseIgnoreFile = /* @__PURE__ */ __name((file, cwd) => { const base = slash(import_node_path.default.relative(cwd, import_node_path.default.dirname(file.filePath))); return file.content.split(/\r?\n/).filter((line) => line && !line.startsWith("#")).map((pattern) => applyBaseToPattern(pattern, base)); }, "parseIgnoreFile"); var toRelativePath = /* @__PURE__ */ __name((fileOrDirectory, cwd) => { cwd = slash(cwd); if (import_node_path.default.isAbsolute(fileOrDirectory)) { if (slash(fileOrDirectory).startsWith(cwd)) { return import_node_path.default.relative(cwd, fileOrDirectory); } throw new Error(`Path ${fileOrDirectory} is not in cwd ${cwd}`); } return fileOrDirectory; }, "toRelativePath"); var getIsIgnoredPredicate = /* @__PURE__ */ __name((files, cwd) => { const patterns = files.flatMap((file) => parseIgnoreFile(file, cwd)); const ignores = (0, import_ignore.default)().add(patterns); return (fileOrDirectory) => { fileOrDirectory = toPath(fileOrDirectory); fileOrDirectory = toRelativePath(fileOrDirectory, cwd); return ignores.ignores(slash(fileOrDirectory)); }; }, "getIsIgnoredPredicate"); var normalizeOptions = /* @__PURE__ */ __name((options = {}) => ({ cwd: toPath(options.cwd) || import_node_process.default.cwd() }), "normalizeOptions"); var isIgnoredByIgnoreFiles = /* @__PURE__ */ __name((patterns, options) => __async(void 0, null, function* () { const { cwd } = normalizeOptions(options); const paths = yield (0, import_fast_glob.default)(patterns, __spreadValues({ cwd }, ignoreFilesGlobOptions)); const files = yield Promise.all(paths.map((filePath) => __async(void 0, null, function* () { return { filePath, content: yield import_node_fs.default.promises.readFile(filePath, "utf8") }; }))); return getIsIgnoredPredicate(files, cwd); }), "isIgnoredByIgnoreFiles"); var isIgnoredByIgnoreFilesSync = /* @__PURE__ */ __name((patterns, options) => { const { cwd } = normalizeOptions(options); const paths = import_fast_glob.default.sync(patterns, __spreadValues({ cwd }, ignoreFilesGlobOptions)); const files = paths.map((filePath) => ({ filePath, content: import_node_fs.default.readFileSync(filePath, "utf8") })); return getIsIgnoredPredicate(files, cwd); }, "isIgnoredByIgnoreFilesSync"); // node_modules/globby/index.js var assertPatternsInput = /* @__PURE__ */ __name((patterns) => { if (patterns.some((pattern) => typeof pattern !== "string")) { throw new TypeError("Patterns must be a string or an array of strings"); } }, "assertPatternsInput"); var toPatternsArray = /* @__PURE__ */ __name((patterns) => { patterns = [...new Set([patterns].flat())]; assertPatternsInput(patterns); return patterns; }, "toPatternsArray"); var checkCwdOption = /* @__PURE__ */ __name((options) => { if (!options.cwd) { return; } let stat; try { stat = import_node_fs2.default.statSync(options.cwd); } catch (e) { return; } if (!stat.isDirectory()) { throw new Error("The `cwd` option must be a path to a directory"); } }, "checkCwdOption"); var normalizeOptions2 = /* @__PURE__ */ __name((options = {}) => { options = __spreadProps(__spreadValues({ ignore: [], expandDirectories: true }, options), { cwd: toPath(options.cwd) }); checkCwdOption(options); return options; }, "normalizeOptions"); var normalizeArguments = /* @__PURE__ */ __name((fn) => (patterns, options) => __async(void 0, null, function* () { return fn(toPatternsArray(patterns), normalizeOptions2(options)); }), "normalizeArguments"); var normalizeArgumentsSync = /* @__PURE__ */ __name((fn) => (patterns, options) => fn(toPatternsArray(patterns), normalizeOptions2(options)), "normalizeArgumentsSync"); var getIgnoreFilesPatterns = /* @__PURE__ */ __name((options) => { const { ignoreFiles, gitignore } = options; const patterns = ignoreFiles ? toPatternsArray(ignoreFiles) : []; if (gitignore) { patterns.push(GITIGNORE_FILES_PATTERN); } return patterns; }, "getIgnoreFilesPatterns"); var getFilter = /* @__PURE__ */ __name((options) => __async(void 0, null, function* () { const ignoreFilesPatterns = getIgnoreFilesPatterns(options); return createFilterFunction(ignoreFilesPatterns.length > 0 && (yield isIgnoredByIgnoreFiles(ignoreFilesPatterns, { cwd: options.cwd }))); }), "getFilter"); var getFilterSync = /* @__PURE__ */ __name((options) => { const ignoreFilesPatterns = getIgnoreFilesPatterns(options); return createFilterFunction(ignoreFilesPatterns.length > 0 && isIgnoredByIgnoreFilesSync(ignoreFilesPatterns, { cwd: options.cwd })); }, "getFilterSync"); var createFilterFunction = /* @__PURE__ */ __name((isIgnored) => { const seen = /* @__PURE__ */ new Set(); return (fastGlobResult) => { const path2 = fastGlobResult.path || fastGlobResult; const pathKey = import_node_path2.default.normalize(path2); const seenOrIgnored = seen.has(pathKey) || isIgnored && isIgnored(path2); seen.add(pathKey); return !seenOrIgnored; }; }, "createFilterFunction"); var unionFastGlobResults = /* @__PURE__ */ __name((results, filter2) => results.flat().filter((fastGlobResult) => filter2(fastGlobResult)), "unionFastGlobResults"); var unionFastGlobStreams = /* @__PURE__ */ __name((streams, filter2) => (0, import_merge2.default)(streams).pipe(new FilterStream((fastGlobResult) => filter2(fastGlobResult))), "unionFastGlobStreams"); var convertNegativePatterns = /* @__PURE__ */ __name((patterns, options) => { const tasks = []; while (patterns.length > 0) { const index2 = patterns.findIndex((pattern) => isNegativePattern(pattern)); if (index2 === -1) { tasks.push({ patterns, options }); break; } const ignorePattern = patterns[index2].slice(1); for (const task of tasks) { task.options.ignore.push(ignorePattern); } if (index2 !== 0) { tasks.push({ patterns: patterns.slice(0, index2), options: __spreadProps(__spreadValues({}, options), { ignore: [ ...options.ignore, ignorePattern ] }) }); } patterns = patterns.slice(index2 + 1); } return tasks; }, "convertNegativePatterns"); var getDirGlobOptions = /* @__PURE__ */ __name((options, cwd) => __spreadValues(__spreadValues({}, cwd ? { cwd } : {}), Array.isArray(options) ? { files: options } : options), "getDirGlobOptions"); var generateTasks = /* @__PURE__ */ __name((patterns, options) => __async(void 0, null, function* () { const globTasks = convertNegativePatterns(patterns, options); const { cwd, expandDirectories } = options; if (!expandDirectories) { return globTasks; } const patternExpandOptions = getDirGlobOptions(expandDirectories, cwd); const ignoreExpandOptions = cwd ? { cwd } : void 0; return Promise.all(globTasks.map((task) => __async(void 0, null, function* () { let { patterns: patterns2, options: options2 } = task; [ patterns2, options2.ignore ] = yield Promise.all([ (0, import_dir_glob.default)(patterns2, patternExpandOptions), (0, import_dir_glob.default)(options2.ignore, ignoreExpandOptions) ]); return { patterns: patterns2, options: options2 }; }))); }), "generateTasks"); var generateTasksSync = /* @__PURE__ */ __name((patterns, options) => { const globTasks = convertNegativePatterns(patterns, options); const { cwd, expandDirectories } = options; if (!expandDirectories) { return globTasks; } const patternExpandOptions = getDirGlobOptions(expandDirectories, cwd); const ignoreExpandOptions = cwd ? { cwd } : void 0; return globTasks.map((task) => { let { patterns: patterns2, options: options2 } = task; patterns2 = import_dir_glob.default.sync(patterns2, patternExpandOptions); options2.ignore = import_dir_glob.default.sync(options2.ignore, ignoreExpandOptions); return { patterns: patterns2, options: options2 }; }); }, "generateTasksSync"); var globby = normalizeArguments((patterns, options) => __async(void 0, null, function* () { const [ tasks, filter2 ] = yield Promise.all([ generateTasks(patterns, options), getFilter(options) ]); const results = yield Promise.all(tasks.map((task) => (0, import_fast_glob2.default)(task.patterns, task.options))); return unionFastGlobResults(results, filter2); })); var globbySync = normalizeArgumentsSync((patterns, options) => { const tasks = generateTasksSync(patterns, options); const filter2 = getFilterSync(options); const results = tasks.map((task) => import_fast_glob2.default.sync(task.patterns, task.options)); return unionFastGlobResults(results, filter2); }); var globbyStream = normalizeArgumentsSync((patterns, options) => { const tasks = generateTasksSync(patterns, options); const filter2 = getFilterSync(options); const streams = tasks.map((task) => import_fast_glob2.default.stream(task.patterns, task.options)); return unionFastGlobStreams(streams, filter2); }); var isDynamicPattern = normalizeArgumentsSync((patterns, options) => patterns.some((pattern) => import_fast_glob2.default.isDynamicPattern(pattern, options))); var generateGlobTasks = normalizeArguments(generateTasks); var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync); // src/Convert.ts var import_moment = __toESM(require_moment()); var import_sanitize_filename = __toESM(require_sanitize_filename()); function convertPdfToPng(file, density, quality, additionalImagemagickArgs) { return __async(this, null, function* () { let platformSpecific; switch ((0, import_os.platform)()) { case "win32": platformSpecific = "magick convert"; break; case "darwin": case "linux": platformSpecific = "convert"; break; } const randomPiece = (0, import_randomstring.generate)({ length: 4, charset: "alphanumeric" }); const folderName = (0, import_sanitize_filename.default)(`${(0, import_moment.default)().format("YYYY-M-D-H.m")}-${randomPiece}-${file.tFile.basename}`); const randomFolderPath = (0, import_path.join)((0, import_os.tmpdir)(), folderName); yield (0, import_promises.mkdir)(randomFolderPath); ObsidianOCRPlugin.logger.info(`Converting pdf ${file.absPath} to png(s) in ${randomFolderPath}`); const command = `${platformSpecific} -density ${density} -quality ${quality} -background white -alpha remove -alpha off ${additionalImagemagickArgs} "${file.absPath}" "${(0, import_path.join)(randomFolderPath, "out.png")}"`; const execPromise = (0, import_exec.default)(command); ObsidianOCRPlugin.children.push(execPromise.execProcess); const execResult = yield execPromise.execPromise; if (execResult.exitCode != 0) { ObsidianOCRPlugin.logger.error(`Error converting ${file.vaultRelativePath}: ${execResult.stderrOutput}`); return void 0; } return yield globby("*.png", { cwd: randomFolderPath, absolute: true }); }); } __name(convertPdfToPng, "convertPdfToPng"); function areDepsMet() { return __async(this, null, function* () { switch ((0, import_os.platform)()) { case "win32": return yield doesProgramExist("magick"); case "linux": case "darwin": return yield doesProgramExist("convert"); default: ObsidianOCRPlugin.logger.warn(`Dependency check not implemented for platform ${(0, import_os.platform)()}. Assuming everything is okay.`); return true; } }); } __name(areDepsMet, "areDepsMet"); // src/ocr/OCRProviderManager.ts var import_fs = require("fs"); var import_path2 = require("path"); var import_os2 = require("os"); var import_lodash = __toESM(require_lodash()); var _OCRProviderManager = class { static registerOCRProviders(...providers) { ObsidianOCRPlugin.logger.info(`Registering provider(s) ${providers.map((provider) => { return provider.getProviderName(); })}`); _OCRProviderManager.ocrProviders.push(...providers); } static deregisterOCRProvider(provider) { ObsidianOCRPlugin.logger.info(`Deregistering provider ${provider.getProviderName()}`); _OCRProviderManager.ocrProviders.remove(provider); } static getByName(name) { ObsidianOCRPlugin.logger.debug(`Returning provider with name ${name}`); return (0, import_lodash.find)(_OCRProviderManager.ocrProviders, (ocrProvider) => { return ocrProvider.getProviderName() == name; }); } static applyHomebrewWorkaround() { return __async(this, null, function* () { if ((0, import_fs.existsSync)("/opt/homebrew/bin")) { process.env.PATH = `${process.env.PATH}:/opt/homebrew/bin`; ObsidianOCRPlugin.logger.info(`Applying homebrew workaround. $PATH is now ${process.env.PATH}`); } }); } static addAdditionalPaths() { if (SettingsManager.currentSettings.additionalSearchPath.length == 0) return; switch ((0, import_os2.platform)()) { case "win32": process.env.PATH = `${process.env.PATH}${SettingsManager.currentSettings.additionalSearchPath}${import_path2.delimiter}`; break; case "darwin": case "linux": process.env.PATH = `${process.env.PATH}${import_path2.delimiter}${SettingsManager.currentSettings.additionalSearchPath}`; break; default: ObsidianOCRPlugin.logger.warn(`Additional paths not implemented for platform ${(0, import_os2.platform)()}. Doing nothing.`); } ObsidianOCRPlugin.logger.info(`Adding additional paths. $PATH is now ${process.env.PATH}`); } }; var OCRProviderManager = _OCRProviderManager; __name(OCRProviderManager, "OCRProviderManager"); OCRProviderManager.ocrProviders = []; // src/Settings.ts var _SettingsManager = class { static loadSettings(plugin) { return __async(this, null, function* () { _SettingsManager.plugin = plugin; _SettingsManager.currentSettings = Object.assign({}, this.DEFAULT_SETTINGS, yield plugin.loadData()); }); } static saveSettings() { return __async(this, null, function* () { yield _SettingsManager.plugin.saveData(_SettingsManager.currentSettings); }); } static saveOCRProviderSettings(provider, settings2) { return __async(this, null, function* () { _SettingsManager.currentSettings.ocrProviderSettings[provider.getProviderName()] = settings2; yield _SettingsManager.plugin.saveData(_SettingsManager.currentSettings); }); } static getOCRProviderSettings(provider) { return _SettingsManager.currentSettings.ocrProviderSettings[provider.getProviderName()]; } static validateSettings() { return __async(this, null, function* () { if (!(yield areDepsMet())) { ObsidianOCRPlugin.logger.info(`Repairing settings ${_SettingsManager.currentSettings.ocrPDF} -> false`); _SettingsManager.currentSettings.ocrPDF = false; } if (!(yield OCRProviderManager.getByName(_SettingsManager.currentSettings.ocrProviderName).isUsable())) { ObsidianOCRPlugin.logger.info(`Repairing settings ${_SettingsManager.currentSettings.ocrProviderName} -> NoOp`); _SettingsManager.currentSettings.ocrProviderName = "NoOp"; } }); } }; var SettingsManager = _SettingsManager; __name(SettingsManager, "SettingsManager"); SettingsManager.DEFAULT_SETTINGS = { ocrProviderName: "NoOp", ocrProviderSettings: {}, fuzzySearch: true, caseSensitive: false, ocrImage: false, ocrPDF: false, concurrentIndexingProcesses: 1, additionalSearchPath: "", density: 300, quality: 98, additionalImagemagickArgs: "", showTips: true, logToFile: false, logLevel: "warn" }; // src/File.ts var import_path3 = require("path"); var File2 = class { constructor(extension, vaultRelativePath, absPath, tFile) { this.extension = extension; this.vaultRelativePath = vaultRelativePath; this.absPath = absPath; this.tFile = tFile; } static fromVaultRelativePath(path2) { const extension = path2.split(".").pop(); if (!extension) throw new TypeError(`Unable to process file ${path2} because it has no extensions`); return new File2(extension, path2, app.vault.adapter.getFullPath(path2), app.vault.getAbstractFileByPath(path2)); } static fromAbsPath(path2) { return File2.fromVaultRelativePath((0, import_path3.relative)(path2, app.vault.adapter.getBasePath())); } static fromFile(file) { return File2.fromVaultRelativePath(file.path); } }; __name(File2, "File"); // src/hocr/BoundingBox.ts var BoundingBox = class { constructor(x1, y1, x2, y2) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; } static fromTitle(title) { const parts = title.split(" "); return new BoundingBox(parseInt(parts[1]), parseInt(parts[2]), parseInt(parts[3]), parseInt(parts[4])); } }; __name(BoundingBox, "BoundingBox"); // src/hocr/Word.ts var Word = class { constructor(wordS) { this.bounds = BoundingBox.fromTitle(wordS.title); this.text = wordS.innerText; } }; __name(Word, "Word"); // src/hocr/Line.ts var Line = class { constructor(lineP) { this.bounds = BoundingBox.fromTitle(lineP.title); this.children = Array.from(lineP.getElementsByClassName("ocrx_word")).map((wordSpan) => { return new Word(wordSpan); }); } }; __name(Line, "Line"); // src/hocr/Paragraph.ts var Paragraph = class { constructor(parP) { this.bounds = BoundingBox.fromTitle(parP.title); this.children = Array.from(parP.getElementsByClassName("ocr_line")).map((ocrLine) => { return new Line(ocrLine); }); } }; __name(Paragraph, "Paragraph"); // src/hocr/ContentArea.ts var ContentArea = class { constructor(careaDiv) { this.bounds = BoundingBox.fromTitle(careaDiv.title); this.children = Array.from(careaDiv.getElementsByClassName("ocr_par")).map((parP) => { return new Paragraph(parP); }); } }; __name(ContentArea, "ContentArea"); // src/utils/HocrUtils.ts function flattenText(page) { return page.children.map((child) => { return child.children; }).flat().map((child) => { return child.children; }).flat().map((child) => { return child.children; }).flat().map((child) => { return child.text; }).flat().join(" "); } __name(flattenText, "flattenText"); function parseTitle(title) { const titleParts = title.split("; "); const record = {}; titleParts.forEach((titlePart) => { const titleKeyPart = titlePart.split(" "); const key = titleKeyPart[0]; record[key] = titleKeyPart.slice(1, void 0).join(" "); }); return record; } __name(parseTitle, "parseTitle"); // src/hocr/Page.ts var Page = class { constructor(pageDiv, thumbnail, pageNumber) { this.thumbnail = thumbnail; this.pageNumber = pageNumber; this.titleProperties = parseTitle(pageDiv.title); this.bounds = BoundingBox.fromTitle(this.titleProperties["bbox"]); this.children = Array.from(pageDiv.getElementsByClassName("ocr_carea")).map((careaDiv) => { return new ContentArea(careaDiv); }); } }; __name(Page, "Page"); // src/hocr/Transcript.ts var import_fs2 = require("fs"); var jsonComplete = __toESM(require_json_complete_cjs_min()); var import_promises2 = require("fs/promises"); var Transcript = class { constructor(ocrVersion, originalFilePath, documents, imagePaths) { this.ocrVersion = ocrVersion; this.originalFilePath = originalFilePath; this.bounds = void 0; if (!documents) return; const capabilitySet = /* @__PURE__ */ new Set(); documents.forEach((document2) => { const capabilities = Transcript.getCapabilities(document2); capabilities.forEach((capability) => { capabilitySet.add(capability); }); }); this.capabilities = [...capabilitySet]; this.children = documents.map((document2, index2) => { return Array.from(document2.getElementsByClassName("ocr_page")).map((pageDiv) => { return new Page(pageDiv, new Buffer((0, import_fs2.readFileSync)(imagePaths[index2])).toString("base64"), index2); }); }).flat(); } static load(path2) { return __async(this, null, function* () { return jsonComplete.decode((yield (0, import_promises2.readFile)(path2)).toString()); }); } static encode(transcript) { return jsonComplete.encode(transcript); } static getCapabilities(document2) { const capabilitiesElements = document2.getElementsByName("ocr-capabilities"); if (capabilitiesElements.length == 0) ObsidianOCRPlugin.logger.warn("\u{1F628} HOCR has no capabilities"); return Array.from(capabilitiesElements).map((element) => { return element.title.split(" "); }).flat(); } }; __name(Transcript, "Transcript"); // src/db/DBManager.ts var import_sql = __toESM(require_sql_wasm()); var import_path4 = require("path"); var import_fs3 = require("fs"); var import_promises3 = require("fs/promises"); // src/db/SQLResultPage.ts var SQLResultPage = class { constructor(pageId, transcriptId, pageNum, thumbnail, transcriptText) { this.pageId = pageId; this.transcriptId = transcriptId; this.pageNum = pageNum; this.thumbnail = thumbnail; this.transcriptText = transcriptText; } }; __name(SQLResultPage, "SQLResultPage"); // src/db/SQLResultTranscript.ts var SQLResultTranscript = class { constructor(transcriptId, relativePath, numPages) { this.transcriptId = transcriptId; this.relativePath = relativePath; this.numPages = numPages; } }; __name(SQLResultTranscript, "SQLResultTranscript"); // src/db/FileSpecificSQLSettings.ts var FileSpecificSQLSettings = class { constructor(settingsId, relative_path, imageDensity, imageQuality, imagemagickArgs) { this.settingsId = settingsId; this.relative_path = relative_path; this.imageDensity = imageDensity; this.imageQuality = imageQuality; this.imagemagickArgs = imagemagickArgs; } }; __name(FileSpecificSQLSettings, "FileSpecificSQLSettings"); // src/db/SQLResultFolder.ts var SQLResultFolder = class { constructor(id, path2) { this.id = id; this.path = path2; } }; __name(SQLResultFolder, "SQLResultFolder"); // src/db/DBManager.ts var DBManager = class { static init() { return __async(this, null, function* () { DBManager.DB_PATH = (0, import_path4.join)(ObsidianOCRPlugin.plugin.app.vault.adapter.getBasePath(), ".obsidian-ocr.sqlite"); DBManager.SQL = yield (0, import_sql.default)({ locateFile: (file) => `https://sql.js.org/dist/${file}` }); if ((0, import_fs3.existsSync)(DBManager.DB_PATH)) { ObsidianOCRPlugin.logger.info(`Opening already existent database ${this.DB_PATH}`); DBManager.DB = new DBManager.SQL.Database(yield (0, import_promises3.readFile)(DBManager.DB_PATH)); } else { ObsidianOCRPlugin.logger.info(`Creating new database ${this.DB_PATH}`); DBManager.DB = new DBManager.SQL.Database(); yield DBManager.initDB(); } }); } static insertTranscript(relativeFilePath, pages) { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Inserting transcript with path ${relativeFilePath} and ${pages.length} pages`); const transcriptId = DBManager.DB.exec("INSERT OR IGNORE INTO transcripts (relative_path, num_pages) VALUES (:path, :numPages) RETURNING transcript_id", { ":path": relativeFilePath, ":numPages": pages.length }); pages.forEach((page, index2) => { DBManager.DB.run("INSERT OR IGNORE INTO pages (transcript_id, page_num, thumbnail, transcript_text) VALUES (:transcriptId, :pageNum, :thumbnail, :transcriptText)", { ":transcriptId": transcriptId[0].values[0][0], ":pageNum": index2, ":thumbnail": page.thumbnail, ":transcriptText": flattenText(page) }); }); yield DBManager.saveDB(); }); } static removeTranscriptByPath(relativeFilePath) { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Removing transcript with path ${relativeFilePath}`); const row = DBManager.unwrapSafe(DBManager.DB.exec("SELECT transcript_id FROM transcripts WHERE relative_path = :path;", { ":path": relativeFilePath })); if (!row) return; const transcriptId = row[0]; ObsidianOCRPlugin.logger.debug(`Transcript ID is ${transcriptId}`); DBManager.DB.run("DELETE FROM transcripts WHERE transcript_id = :id", { ":id": transcriptId }); DBManager.DB.run("DELETE FROM pages WHERE transcript_id = :id", { ":id": transcriptId }); DBManager.DB.run("DELETE FROM settings WHERE relative_path = :path", { ":path": relativeFilePath }); yield DBManager.saveDB(); }); } static updateTranscriptPath(oldPath, newPath) { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Updating transcript path from ${oldPath} to ${newPath}`); DBManager.DB.run("UPDATE transcripts SET relative_path = :newPath WHERE relative_path = :oldPath", { ":oldPath": oldPath, ":newPath": newPath }); yield DBManager.saveDB(); }); } static getAllTranscripts() { ObsidianOCRPlugin.logger.debug("Fetching all transcripts"); return DBManager.DB.exec("SELECT * FROM Transcripts;")[0].values.map((row) => { return new SQLResultTranscript(row[0], row[1], row[2]); }); } static getAllPages() { ObsidianOCRPlugin.logger.debug("Fetching all pages"); return DBManager.DB.exec("SELECT * FROM Pages;")[0].values.map((row) => { return new SQLResultPage(row[0], row[1], row[2], row[3], row[4]); }); } static getSettingsByRelativePath(path2) { ObsidianOCRPlugin.logger.debug(`Fetching settings with path ${path2}`); const row = DBManager.unwrapSafe(DBManager.DB.exec("SELECT * FROM settings WHERE relative_path = :path", { ":path": path2 })); if (!row) return void 0; return new FileSpecificSQLSettings(row[0], row[1], row[2], row[3], row[4]); } static setSettingsByRelativePath(path2, settings2) { ObsidianOCRPlugin.logger.info(`Setting settings with path ${path2} to ${JSON.stringify(settings2)}`); DBManager.DB.run("DELETE FROM settings WHERE relative_path = :path", { ":path": path2 }); DBManager.DB.run("INSERT OR IGNORE INTO settings (relative_path, image_density, image_quality, imagemagick_args) VALUES (:path, :imageQuality, :imageDensity, :imagemagickArgs)", { ":path": path2, ":imageQuality": settings2.imageQuality, ":imageDensity": settings2.imageDensity, ":imagemagickArgs": settings2.imagemagickArgs }); } static getTranscriptByRelativePath(relativeFilePath) { ObsidianOCRPlugin.logger.debug(`Fetching transcript with path ${relativeFilePath}`); const row = DBManager.unwrapSafe(DBManager.DB.exec("SELECT * FROM transcripts WHERE relative_path = :relativePath;", { ":relativePath": relativeFilePath })); if (!row) return void 0; return new SQLResultTranscript(row[0], row[1], row[2]); } static dispose() { ObsidianOCRPlugin.logger.info("Closing DB"); DBManager.DB.close(); } static saveDB() { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Saving DB to ${DBManager.DB_PATH}`); yield (0, import_promises3.writeFile)(DBManager.DB_PATH, Buffer.from(DBManager.DB.export())); }); } static doesTranscriptWithPathExist(relativeFilePath) { ObsidianOCRPlugin.logger.debug(`Checking if transcript with path ${relativeFilePath} exists`); return DBManager.DB.exec("SELECT EXISTS(SELECT 1 FROM transcripts WHERE relative_path = :path);", { ":path": relativeFilePath })[0].values[0][0] == 1; } static getPagesByTranscriptId(id) { ObsidianOCRPlugin.logger.debug(`Fetching pages with transcript id ${id}`); return DBManager.DB.exec("SELECT * FROM pages WHERE transcript_id = :id;", { ":id": id })[0].values.map((row) => { return new SQLResultPage(row[0], row[1], row[2], row[3], row[4]); }); } static getTranscriptById(id) { ObsidianOCRPlugin.logger.debug(`Fetching transcript with id ${id}`); const row = DBManager.unwrapSafe(DBManager.DB.exec("SELECT * FROM transcripts WHERE transcript_id = :id;", { ":id": id })); if (!row) return void 0; return new SQLResultTranscript(row[0], row[1], row[2]); } static resetDB() { ObsidianOCRPlugin.logger.info("Resetting DB"); DBManager.DB.run("DROP TABLE IF EXISTS pages"); DBManager.DB.run("DROP TABLE IF EXISTS transcripts"); DBManager.DB.run("DROP TABLE IF EXISTS settings"); DBManager.DB.run("DROP TABLE IF EXISTS ignored_folders"); } static deleteAllTranscripts() { ObsidianOCRPlugin.logger.info("Deleting all transcripts"); DBManager.DB.run("DELETE FROM pages"); DBManager.DB.run("DELETE FROM transcripts"); } static removeSettingsByRelativePath(path2) { ObsidianOCRPlugin.logger.info("Removing settings with path ${path}"); DBManager.DB.run("DELETE FROM settings WHERE relative_path = :path", { ":path": path2 }); } static addIgnoredFolder(vaultRelativePath) { ObsidianOCRPlugin.logger.info(`Adding ignored folder with path ${vaultRelativePath}`); DBManager.DB.run("INSERT OR IGNORE INTO ignored_folders (relative_path) VALUES (:path)", { ":path": vaultRelativePath }); } static removeIgnoredFolderById(id) { ObsidianOCRPlugin.logger.info(`Deleting ignored folder with id ${id}`); DBManager.DB.run("DELETE FROM ignored_folders WHERE folder_id = :id", { ":id": id }); } static getIgnoredFolderByPath(vaultRelativePath) { ObsidianOCRPlugin.logger.debug(`Fetching ignored folder with path ${vaultRelativePath}`); const row = DBManager.unwrapSafe(DBManager.DB.exec("SELECT * FROM ignored_folders WHERE relative_path = :path;", { ":path": vaultRelativePath })); if (!row) return void 0; return new SQLResultFolder(row[0], row[1]); } static getAllIgnoredFolders() { ObsidianOCRPlugin.logger.debug("Fetching all ignored folders"); const result = DBManager.DB.exec("SELECT * FROM ignored_folders;"); const results = result[0]; if (!results) return []; return results.values.map((row) => { return new SQLResultFolder(row[0], row[1]); }); } static unwrapSafe(result) { if (result.length == 0) return void 0; return result[0].values[0]; } static initDB() { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info("Initializing DB"); DBManager.DB.exec(` CREATE TABLE IF NOT EXISTS transcripts ( transcript_id integer PRIMARY KEY AUTOINCREMENT, relative_path text, num_pages integer, UNIQUE(relative_path) ); CREATE TABLE IF NOT EXISTS pages ( page_id integer PRIMARY KEY AUTOINCREMENT, transcript_id integer, page_num integer, thumbnail text, transcript_text text, FOREIGN KEY (transcript_id) REFERENCES transcripts (transcript_id) ON DELETE CASCADE ); CREATE TABLE IF NOT EXISTS settings ( settings_id integer PRIMARY KEY AUTOINCREMENT, relative_path text, image_density integer, image_quality integer, imagemagick_args text, UNIQUE(relative_path) ); CREATE TABLE IF NOT EXISTS ignored_folders ( folder_id integer PRIMARY KEY AUTOINCREMENT, relative_path text, UNIQUE(relative_path) ); `); yield DBManager.saveDB(); }); } }; __name(DBManager, "DBManager"); // src/utils/FileUtils.ts function isFileValid(file, settings2) { ObsidianOCRPlugin.logger.info(`Checking if file ${file.vaultRelativePath} with settings ${JSON.stringify(settings2)} is valid`); switch (getFileType(file)) { case FILE_TYPE.IMAGE: { ObsidianOCRPlugin.logger.info(`File ${file.vaultRelativePath} is an image`); ObsidianOCRPlugin.logger.info(`File ${file.vaultRelativePath} ${settings2.ocrImage ? "is" : "isn't"} valid`); return settings2.ocrImage; } case FILE_TYPE.PDF: { ObsidianOCRPlugin.logger.info(`File ${file.vaultRelativePath} is a pdf`); ObsidianOCRPlugin.logger.info(`File ${file.vaultRelativePath} ${settings2.ocrPDF ? "is" : "isn't"} valid`); return settings2.ocrPDF; } default: { ObsidianOCRPlugin.logger.info(`File ${file.vaultRelativePath} is neither an image nor a pdf, file isn't valid`); return false; } } } __name(isFileValid, "isFileValid"); var FILE_TYPE = /* @__PURE__ */ ((FILE_TYPE2) => { FILE_TYPE2[FILE_TYPE2["IMAGE"] = 0] = "IMAGE"; FILE_TYPE2[FILE_TYPE2["PDF"] = 1] = "PDF"; FILE_TYPE2[FILE_TYPE2["OTHER"] = 2] = "OTHER"; return FILE_TYPE2; })(FILE_TYPE || {}); function getFileType(file) { ObsidianOCRPlugin.logger.info(`Getting type of file ${file.vaultRelativePath}`); if (file.extension == "pdf") { ObsidianOCRPlugin.logger.info(`File ${file.vaultRelativePath} is a pdf`); return 1 /* PDF */; } if (["bmp", "pnm", "png", "jfif", "jpg", "jpeg", "tiff"].contains(file.extension)) { ObsidianOCRPlugin.logger.info(`File ${file.vaultRelativePath} is an image`); return 0 /* IMAGE */; } ObsidianOCRPlugin.logger.info(`File ${file.vaultRelativePath} is other`); return 2 /* OTHER */; } __name(getFileType, "getFileType"); function getAllJsonFiles(cwd) { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Getting all json files in ${cwd}`); return (yield globby("**/.*.ocr.json", { absolute: false, onlyFiles: true, cwd, ignore: [".obsidian/**/*"], dot: true })).map((filePath) => { return File2.fromVaultRelativePath(filePath); }); }); } __name(getAllJsonFiles, "getAllJsonFiles"); function isFileInIgnoredFolder(file) { const path2 = file instanceof File2 ? file.vaultRelativePath : file.path; ObsidianOCRPlugin.logger.info(`Checking if file ${path2} is in an ignored folder`); return DBManager.getAllIgnoredFolders().filter((result) => { return path2.contains(result.path) && path2 != result.path; }).length != 0; } __name(isFileInIgnoredFolder, "isFileInIgnoredFolder"); function shouldFileBeOCRed(file, settings2) { ObsidianOCRPlugin.logger.info(`Checking if file ${file.vaultRelativePath} with settings ${settings2} should be OCRed`); return isFileValid(file, settings2) && !DBManager.doesTranscriptWithPathExist(file.vaultRelativePath) && !isFileInIgnoredFolder(file); } __name(shouldFileBeOCRed, "shouldFileBeOCRed"); // src/utils/FileOps.ts var import_promises4 = require("fs/promises"); function removeAllJsonFiles() { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info("Removing all Json files"); StatusBar.addStatusDeleting(); for (const jsonFile of yield getAllJsonFiles(app.vault.adapter.getBasePath())) { ObsidianOCRPlugin.logger.info(`Removing JSON file ${jsonFile}`); yield (0, import_promises4.unlink)(jsonFile.absPath); } StatusBar.removeStatusDeleting(); }); } __name(removeAllJsonFiles, "removeAllJsonFiles"); function processFile(file) { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Processing file ${file.vaultRelativePath}`); const sqlSettings = DBManager.getSettingsByRelativePath(file.vaultRelativePath); switch (getFileType(file)) { case 1 /* PDF */: { ObsidianOCRPlugin.logger.info(`${file.vaultRelativePath} is a PDF file`); const imagePaths = yield convertPdfToPng(file, sqlSettings ? sqlSettings.imageDensity : SettingsManager.currentSettings.density, sqlSettings ? sqlSettings.imageQuality : SettingsManager.currentSettings.quality, sqlSettings ? sqlSettings.imagemagickArgs : SettingsManager.currentSettings.additionalImagemagickArgs); ObsidianOCRPlugin.logger.info(`Image paths are ${imagePaths}`); if (!imagePaths) return void 0; const ocrResults = yield OCRProviderManager.getByName(SettingsManager.currentSettings.ocrProviderName).performOCR(imagePaths); ObsidianOCRPlugin.logger.info(`OCR results are ${ocrResults}`); if (!ocrResults) return void 0; const transcript = new Transcript(ObsidianOCRPlugin.plugin.manifest.version, file.vaultRelativePath, ocrResults.map((result) => { return new DOMParser().parseFromString(result, "text/html"); }), imagePaths); ObsidianOCRPlugin.logger.info(`Transcript is ${transcript}`); StatusBar.removeIndexingFile(file); return transcript; } case 0 /* IMAGE */: { ObsidianOCRPlugin.logger.info(`${file.vaultRelativePath} is an image file`); const ocrResults = yield OCRProviderManager.getByName(SettingsManager.currentSettings.ocrProviderName).performOCR([file.absPath]); ObsidianOCRPlugin.logger.info(`OCR results are ${ocrResults}`); if (!ocrResults) return void 0; const transcript = new Transcript(ObsidianOCRPlugin.plugin.manifest.version, file.vaultRelativePath, [new DOMParser().parseFromString(ocrResults[0], "text/html")], [file.absPath]); ObsidianOCRPlugin.logger.info(`Transcript is ${transcript}`); StatusBar.removeIndexingFile(file); return transcript; } default: { ObsidianOCRPlugin.logger.warn(`${file.vaultRelativePath} can't be processed`); return void 0; } } }); } __name(processFile, "processFile"); function processVault(settings2) { ObsidianOCRPlugin.logger.info(`Processing vault with settings ${JSON.stringify(settings2)}`); app.vault.getFiles().map((tFile) => { return File2.fromFile(tFile); }).filter((file) => { const ocr = shouldFileBeOCRed(file, settings2); ObsidianOCRPlugin.logger.info(`File ${file.vaultRelativePath} ${ocr ? "should" : "shouldn't"} be OCRed`); return ocr; }).forEach((file) => __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Enqueuing file ${file.vaultRelativePath}`); yield OcrQueue.enqueueFile(file); })); } __name(processVault, "processVault"); // src/utils/OcrQueue.ts var import_timers = require("timers"); var OcrQueue = class { static getQueue() { this.ocrQueue = this.ocrQueue || async_default.queue(function(file, callback) { return __async(this, null, function* () { const transcript = yield processFile(file); if (transcript) yield DBManager.insertTranscript(file.vaultRelativePath, transcript.children); StatusBar.removeIndexingFile(file); callback(); }); }, SettingsManager.currentSettings.concurrentIndexingProcesses); return this.ocrQueue; } static enqueueFile(file) { return __async(this, null, function* () { this.getQueue().push(file); StatusBar.addIndexingFile(file); }); } static _changeMaxProcesses(processes) { OcrQueue.getQueue().concurrency = processes; } static changeMaxProcesses(processes) { if (this.processChangeTimer) { (0, import_timers.clearTimeout)(this.processChangeTimer); } this.processChangeTimer = (0, import_timers.setTimeout)(this._changeMaxProcesses, 5e3, processes); } }; __name(OcrQueue, "OcrQueue"); // src/StatusBar.ts var _StatusBar = class { static setupStatusBar(parentHTML) { _StatusBar.parentHTML = parentHTML; _StatusBar.parentHTML.onclick = () => { if (OcrQueue.getQueue().paused) OcrQueue.getQueue().resume(); else OcrQueue.getQueue().pause(); _StatusBar.paused = OcrQueue.getQueue().paused; _StatusBar.updateText(); }; } static addStatusDeleting() { _StatusBar.currentStatus.add(1 /* DELETING */); _StatusBar.updateText(); } static removeStatusDeleting() { _StatusBar.currentStatus.delete(1 /* DELETING */); _StatusBar.updateText(); } static addIndexingFile(file) { _StatusBar.indexingFiles.push(file); _StatusBar.currentStatus.add(0 /* INDEXING */); _StatusBar.maxIndexingFile = Math.max(_StatusBar.maxIndexingFile, _StatusBar.indexingFiles.length); _StatusBar.updateText(); } static removeIndexingFile(file) { _StatusBar.indexingFiles.remove(file); if (_StatusBar.indexingFiles.length == 0) { _StatusBar.currentStatus.delete(0 /* INDEXING */); _StatusBar.maxIndexingFile = 0; } _StatusBar.updateText(); } static hasStatus(status) { return _StatusBar.currentStatus.has(status); } static updateText() { if (!_StatusBar.parentHTML) ObsidianOCRPlugin.logger.warn("StatusBar parentHTML not yet defined, ignoring"); else _StatusBar.parentHTML.replaceChildren(); _StatusBar.currentStatus.forEach((status) => { _StatusBar.statusToString(status); }); } static statusToString(status) { if (status == 0 /* INDEXING */) { _StatusBar.parentHTML.createSpan({ text: `${_StatusBar.paused ? "\u23F8\uFE0F" : ""}\u{1F50E} Indexing (${_StatusBar.maxIndexingFile - _StatusBar.indexingFiles.length}/${_StatusBar.maxIndexingFile})`, cls: "bar-element" }); const progress = _StatusBar.parentHTML.createEl("progress", { cls: "bar-element" }); progress.value = _StatusBar.maxIndexingFile - _StatusBar.indexingFiles.length; progress.max = _StatusBar.maxIndexingFile; } else _StatusBar.parentHTML.createSpan({ text: "\u{1F5D1}\uFE0F Deleting", cls: "bar-element" }); } }; var StatusBar = _StatusBar; __name(StatusBar, "StatusBar"); StatusBar.indexingFiles = []; StatusBar.currentStatus = /* @__PURE__ */ new Set(); StatusBar.maxIndexingFile = 0; StatusBar.paused = false; // src/SettingsTab.ts var import_obsidian3 = require("obsidian"); var import_path5 = require("path"); // src/utils/installation/InstallationProviderManager.ts var _InstallationProviderManager = class { static registerProviders(...providers) { ObsidianOCRPlugin.logger.info(`Registering provider(s) ${providers}`); _InstallationProviderManager.providers.push(...providers); } static getCorrectProvider() { return __async(this, null, function* () { const provider = _InstallationProviderManager.providers.filter((provider2) => __async(this, null, function* () { return yield provider2.isApplicable(); }))[0]; ObsidianOCRPlugin.logger.debug(`Returning appropriate provider ${provider}`); return provider; }); } }; var InstallationProviderManager = _InstallationProviderManager; __name(InstallationProviderManager, "InstallationProviderManager"); InstallationProviderManager.providers = []; // src/modals/TerminalModal.ts var import_obsidian = require("obsidian"); var import_xterm = __toESM(require_xterm()); var import_xterm_addon_fit = __toESM(require_xterm_addon_fit()); var TerminalModal = class extends import_obsidian.Modal { constructor() { super(...arguments); this.terminal = new import_xterm.Terminal({ theme: { background: "#222222", foreground: "#c4c4c4" } }); } onOpen() { this.contentEl.replaceChildren(); const terminalDiv = this.contentEl.createEl("div"); const fitAddon = new import_xterm_addon_fit.FitAddon(); this.terminal.loadAddon(fitAddon); this.terminal.open(terminalDiv); terminalDiv.style.paddingTop = "15px"; fitAddon.fit(); } }; __name(TerminalModal, "TerminalModal"); // src/modals/ReindexingModal.ts var import_obsidian2 = require("obsidian"); var ReindexingModal = class extends import_obsidian2.Modal { onOpen() { ObsidianOCRPlugin.logger.debug("Opening reindexing modal"); this.contentEl.setText("Do you want to reindex your files?"); new import_obsidian2.Setting(this.contentEl).addButton((bc) => { bc.setWarning().setButtonText("Yes").onClick(() => __async(this, null, function* () { DBManager.deleteAllTranscripts(); processVault(SettingsManager.currentSettings); this.close(); })); }).addButton((bc) => { bc.setButtonText("No").onClick(() => { this.close(); }); }); } }; __name(ReindexingModal, "ReindexingModal"); // src/SettingsTab.ts var import_lodash2 = __toESM(require_lodash()); var SettingsTab = class extends import_obsidian3.PluginSettingTab { constructor(app2, plugin) { super(app2, plugin); this.plugin = plugin; } hide() { super.hide(); if (this.initialSettings.ocrProviderName != SettingsManager.currentSettings.ocrProviderName || !(0, import_lodash2.isEqual)(this.initialSettings.ocrProviderSettings, SettingsManager.currentSettings.ocrProviderSettings) || this.initialSettings.ocrImage != SettingsManager.currentSettings.ocrImage || this.initialSettings.ocrPDF != SettingsManager.currentSettings.ocrPDF || this.initialSettings.density != SettingsManager.currentSettings.density || this.initialSettings.quality != SettingsManager.currentSettings.quality || this.initialSettings.additionalImagemagickArgs != SettingsManager.currentSettings.additionalImagemagickArgs) new ReindexingModal(app).open(); } display() { return __async(this, null, function* () { this.initialSettings = (0, import_lodash2.cloneDeep)(SettingsManager.currentSettings); this.containerEl.replaceChildren(); new import_obsidian3.Setting(this.containerEl).addSlider((slider) => { slider.setLimits(1, 10, 1); slider.setValue(SettingsManager.currentSettings.concurrentIndexingProcesses); slider.setDynamicTooltip(); slider.onChange((value) => __async(this, null, function* () { SettingsManager.currentSettings.concurrentIndexingProcesses = value; OcrQueue.changeMaxProcesses(value); yield SettingsManager.saveSettings(); })); }).setName("Max OCR Processes").setDesc("Set the maximum number of concurrent OCR processes"); new import_obsidian3.Setting(this.containerEl).addToggle((tc) => { tc.setValue(SettingsManager.currentSettings.ocrImage); tc.onChange((value) => __async(this, null, function* () { SettingsManager.currentSettings.ocrImage = value; yield SettingsManager.saveSettings(); })); }).setName("OCR Image").setDesc("Whether images should be OCRed"); new import_obsidian3.Setting(this.containerEl).addToggle((tc) => { tc.setValue(SettingsManager.currentSettings.ocrPDF); tc.onChange((value) => __async(this, null, function* () { if (value) { if (yield areDepsMet()) { SettingsManager.currentSettings.ocrPDF = value; yield SettingsManager.saveSettings(); } else { new import_obsidian3.Notice("Install ImageMagick to OCR PDFs"); tc.setValue(false); } } else { SettingsManager.currentSettings.ocrPDF = value; yield SettingsManager.saveSettings(); } })); }).setName("OCR PDF").setDesc("Whether PDFs should be OCRed"); new import_obsidian3.Setting(this.containerEl).addSlider((slider) => { slider.setLimits(50, 300, 10); slider.setValue(SettingsManager.currentSettings.density); slider.setDynamicTooltip(); slider.onChange((value) => __async(this, null, function* () { SettingsManager.currentSettings.density = value; yield SettingsManager.saveSettings(); })); }).setName("Image density").setDesc("Image density of converted PDFs"); new import_obsidian3.Setting(this.containerEl).addSlider((slider) => { slider.setLimits(50, 100, 1); slider.setValue(SettingsManager.currentSettings.quality); slider.setDynamicTooltip(); slider.onChange((value) => __async(this, null, function* () { SettingsManager.currentSettings.quality = value; yield SettingsManager.saveSettings(); })); }).setName("Image quality").setDesc("Image quality of converted PDFs"); new import_obsidian3.Setting(this.containerEl).addText((tc) => { tc.setValue(SettingsManager.currentSettings.additionalImagemagickArgs); tc.setPlaceholder("Additional imagemagick args"); tc.onChange((value) => __async(this, null, function* () { SettingsManager.currentSettings.additionalImagemagickArgs = value; yield SettingsManager.saveSettings(); })); }).setName("Additional imagemagick args").setDesc("Additional args passed to imagemagick when converting PDF to PNGs"); new import_obsidian3.Setting(this.containerEl).addText((tc) => { tc.setValue(SettingsManager.currentSettings.additionalSearchPath); tc.setPlaceholder("Additional paths"); tc.onChange((value) => __async(this, null, function* () { SettingsManager.currentSettings.additionalSearchPath = value; yield SettingsManager.saveSettings(); })); }).setName("Additional search paths (Requires restart)").setDesc(`Additional paths to be searched for programs, in this format: "folder1${import_path5.delimiter}folder2..."`); if (!(yield areDepsMet())) new import_obsidian3.Setting(this.containerEl).addButton((btn) => { btn.setButtonText("[ALPHA] Install dependencies"); btn.onClick(() => __async(this, null, function* () { const installationProvider = yield InstallationProviderManager.getCorrectProvider(); if (installationProvider) { const modal = new TerminalModal(ObsidianOCRPlugin.plugin.app); modal.open(); installationProvider.installDependencies(modal.terminal); } else { new import_obsidian3.Notice("Automatic installation not yet implemented for this platform"); } })); }); new import_obsidian3.Setting(this.containerEl).addToggle((tc) => { tc.setValue(SettingsManager.currentSettings.showTips); tc.onChange((value) => __async(this, null, function* () { SettingsManager.currentSettings.showTips = value; yield SettingsManager.saveSettings(); })); }).setName("Show tips").setDesc("Whether to show a tip at startup"); new import_obsidian3.Setting(this.containerEl).addDropdown((dc) => { dc.addOptions({ "debug": "debug", "info": "info", "warn": "warn", "error": "error" }); dc.setValue(SettingsManager.currentSettings.logLevel.toString()); dc.onChange((value) => __async(this, null, function* () { SettingsManager.currentSettings.logLevel = value; ObsidianOCRPlugin.logger.setLevel(value); yield SettingsManager.saveSettings(); })); }).setName("Log level").setDesc("Set the log level. Useful for debugging"); new import_obsidian3.Setting(this.containerEl).addToggle((tc) => { tc.setValue(SettingsManager.currentSettings.logToFile); tc.onChange((value) => __async(this, null, function* () { SettingsManager.currentSettings.logToFile = value; yield SettingsManager.saveSettings(); })); }).setName("Log to file").setDesc("Log to a file in your vault. Useful for debugging"); let providerDiv; new import_obsidian3.Setting(this.containerEl).addDropdown((dd) => __async(this, null, function* () { OCRProviderManager.ocrProviders.forEach((ocrProvider) => { dd.addOption(ocrProvider.getProviderName(), ocrProvider.getProviderName()); }); dd.onChange((name) => __async(this, null, function* () { const provider = OCRProviderManager.getByName(name); if (!(yield provider.isUsable())) { new import_obsidian3.Notice(`Provider "${provider.getProviderName()}" is not usable because: "${yield provider.getReasonIsUnusable()}"`); dd.setValue(SettingsManager.currentSettings.ocrProviderName); } else { SettingsManager.currentSettings.ocrProviderName = name; yield SettingsManager.saveSettings(); providerDiv.replaceChildren(); OCRProviderManager.getByName(SettingsManager.currentSettings.ocrProviderName).displaySettings(providerDiv); } })); dd.setValue(SettingsManager.currentSettings.ocrProviderName); providerDiv = this.containerEl.createDiv(); })).setName("OCR Provider").setDesc("The OCR provider to use"); OCRProviderManager.getByName(SettingsManager.currentSettings.ocrProviderName).displaySettings(providerDiv); }); } }; __name(SettingsTab, "SettingsTab"); // src/ocr/providers/NoOpOCRProvider.ts var NoOpOCRProvider = class { getProviderName() { return "NoOp"; } displaySettings(element) { element.createEl("div", { text: "NoOp-Provider (No Operation) doesn't do anything. Choose another provider from the dropdown." }); } performOCR() { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info("Performing OCR with NoOp"); return [` `]; }); } isUsable() { return __async(this, null, function* () { return true; }); } getReasonIsUnusable() { return void 0; } }; __name(NoOpOCRProvider, "NoOpOCRProvider"); // src/ocr/providers/TesseractOCRProvider.ts var import_obsidian4 = require("obsidian"); var import_exec2 = __toESM(require_exec()); var import_os3 = require("os"); var _TesseractOCRProvider = class { constructor() { const settings2 = SettingsManager.getOCRProviderSettings(this); if (settings2) this.settings = settings2; else this.settings = _TesseractOCRProvider.DEFAULT_SETTINGS; } getReasonIsUnusable() { return __async(this, null, function* () { return (yield doesProgramExist("tesseract")) ? void 0 : "tesseract wasn't found"; }); } displaySettings(element) { return __async(this, null, function* () { new import_obsidian4.Setting(element).setName("Additional arguments").setDesc("Additional commandline arguments passed to tesseract").addText((tc) => { tc.setValue(this.settings.additionalArguments); tc.onChange((value) => __async(this, null, function* () { this.settings.additionalArguments = value; yield SettingsManager.saveOCRProviderSettings(this, this.settings); })); }); const execReturn = (0, import_exec2.default)("tesseract --list-langs"); const result = yield execReturn.execPromise; if (result.exitCode != 0) new import_obsidian4.Notice(result.stderrOutput); else { const langs = result.stdoutOutput.split(import_os3.EOL); langs.shift(); langs.pop(); new import_obsidian4.Setting(element).setName("OCR Language").setDesc("The language used by Tesseract for OCR detection").addDropdown((dd) => { langs.forEach((lang) => { dd.addOption(lang, lang); }); dd.setValue(this.settings["lang"]); dd.onChange((value) => __async(this, null, function* () { this.settings.lang = value; yield SettingsManager.saveOCRProviderSettings(this, this.settings); })); }); } }); } getProviderName() { return "Tesseract"; } isUsable() { return doesProgramExist("tesseract"); } performOCRSingle(source) { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Performing OCR on ${source} with Tesseract`); const execReturn = (0, import_exec2.default)(`tesseract ${this.settings.additionalArguments} "${source}" stdout -l ${this.settings.lang} hocr`); ObsidianOCRPlugin.children.push(execReturn.execProcess); const result = yield execReturn.execPromise; if (result.exitCode != 0) { ObsidianOCRPlugin.logger.error(`\u{1F975} Error happened during OCR of file ${source}: ${result.stderrOutput}`); return void 0; } return result.stdoutOutput; }); } performOCR(imagePaths) { return __async(this, null, function* () { const results = []; for (const source in imagePaths) { const ocrResult = yield this.performOCRSingle(imagePaths[source]); if (ocrResult) results.push(ocrResult); else return void 0; } return results; }); } }; var TesseractOCRProvider = _TesseractOCRProvider; __name(TesseractOCRProvider, "TesseractOCRProvider"); TesseractOCRProvider.DEFAULT_SETTINGS = { "lang": "osd", "additionalArguments": "" }; // src/modals/SearchModal.ts var import_obsidian6 = require("obsidian"); // src/modals/ImageModal.ts var import_obsidian5 = require("obsidian"); var ImageModal = class extends import_obsidian5.Modal { constructor(image) { super(app); this.image = image; } onOpen() { ObsidianOCRPlugin.logger.debug(`Opening image modal with image ${this.image}`); const image = this.contentEl.createEl("img"); image.src = `data:image/png;base64, ${this.image}`; image.onload = () => { this.modalEl.style.width = `${image.width.toString()}px`; this.modalEl.style.height = `${image.height.toString()}px`; }; } }; __name(ImageModal, "ImageModal"); // node_modules/fastest-levenshtein/esm/mod.js var peq = new Uint32Array(65536); var myers_32 = /* @__PURE__ */ __name((a, b) => { const n = a.length; const m = b.length; const lst = 1 << n - 1; let pv = -1; let mv = 0; let sc = n; let i = n; while (i--) { peq[a.charCodeAt(i)] |= 1 << i; } for (i = 0; i < m; i++) { let eq = peq[b.charCodeAt(i)]; const xv = eq | mv; eq |= (eq & pv) + pv ^ pv; mv |= ~(eq | pv); pv &= eq; if (mv & lst) { sc++; } if (pv & lst) { sc--; } mv = mv << 1 | 1; pv = pv << 1 | ~(xv | mv); mv &= xv; } i = n; while (i--) { peq[a.charCodeAt(i)] = 0; } return sc; }, "myers_32"); var myers_x = /* @__PURE__ */ __name((b, a) => { const n = a.length; const m = b.length; const mhc = []; const phc = []; const hsize = Math.ceil(n / 32); const vsize = Math.ceil(m / 32); for (let i = 0; i < hsize; i++) { phc[i] = -1; mhc[i] = 0; } let j = 0; for (; j < vsize - 1; j++) { let mv2 = 0; let pv2 = -1; const start2 = j * 32; const vlen2 = Math.min(32, m) + start2; for (let k = start2; k < vlen2; k++) { peq[b.charCodeAt(k)] |= 1 << k; } for (let i = 0; i < n; i++) { const eq = peq[a.charCodeAt(i)]; const pb = phc[i / 32 | 0] >>> i & 1; const mb = mhc[i / 32 | 0] >>> i & 1; const xv = eq | mv2; const xh = ((eq | mb) & pv2) + pv2 ^ pv2 | eq | mb; let ph = mv2 | ~(xh | pv2); let mh = pv2 & xh; if (ph >>> 31 ^ pb) { phc[i / 32 | 0] ^= 1 << i; } if (mh >>> 31 ^ mb) { mhc[i / 32 | 0] ^= 1 << i; } ph = ph << 1 | pb; mh = mh << 1 | mb; pv2 = mh | ~(xv | ph); mv2 = ph & xv; } for (let k = start2; k < vlen2; k++) { peq[b.charCodeAt(k)] = 0; } } let mv = 0; let pv = -1; const start = j * 32; const vlen = Math.min(32, m - start) + start; for (let k = start; k < vlen; k++) { peq[b.charCodeAt(k)] |= 1 << k; } let score = m; for (let i = 0; i < n; i++) { const eq = peq[a.charCodeAt(i)]; const pb = phc[i / 32 | 0] >>> i & 1; const mb = mhc[i / 32 | 0] >>> i & 1; const xv = eq | mv; const xh = ((eq | mb) & pv) + pv ^ pv | eq | mb; let ph = mv | ~(xh | pv); let mh = pv & xh; score += ph >>> m - 1 & 1; score -= mh >>> m - 1 & 1; if (ph >>> 31 ^ pb) { phc[i / 32 | 0] ^= 1 << i; } if (mh >>> 31 ^ mb) { mhc[i / 32 | 0] ^= 1 << i; } ph = ph << 1 | pb; mh = mh << 1 | mb; pv = mh | ~(xv | ph); mv = ph & xv; } for (let k = start; k < vlen; k++) { peq[b.charCodeAt(k)] = 0; } return score; }, "myers_x"); var distance = /* @__PURE__ */ __name((a, b) => { if (a.length < b.length) { const tmp = b; b = a; a = tmp; } if (b.length === 0) { return a.length; } if (a.length <= 32) { return myers_32(a, b); } return myers_x(a, b); }, "distance"); // src/modals/SearchModal.ts var SearchModal = class extends import_obsidian6.SuggestModal { constructor() { super(app); new import_obsidian6.Setting(this.modalEl).setName("Fuzzy search").setDesc("Enable or disable fuzzy search").addToggle((tc) => { tc.setValue(SettingsManager.currentSettings.fuzzySearch); tc.onChange((value) => __async(this, null, function* () { SettingsManager.currentSettings.fuzzySearch = value; yield SettingsManager.saveSettings(); this.inputEl.dispatchEvent(new Event("input", {})); })); }); new import_obsidian6.Setting(this.modalEl).setName("Case sensitive").setDesc("Enable or disable case sensitivity").addToggle((tc) => { tc.setValue(SettingsManager.currentSettings.caseSensitive); tc.onChange((value) => __async(this, null, function* () { SettingsManager.currentSettings.caseSensitive = value; yield SettingsManager.saveSettings(); this.inputEl.dispatchEvent(new Event("input", {})); })); }); } getSuggestions(query) { this.query = query; if (!query || query.length < 3) return []; ObsidianOCRPlugin.logger.debug(`Query is ${query}`); if (!this.pages) this.pages = DBManager.getAllPages(); if (SettingsManager.currentSettings.fuzzySearch) return this.pages.map((page) => { return { "page": page, "text": SettingsManager.currentSettings.caseSensitive ? page.transcriptText : page.transcriptText.toLowerCase() }; }).filter((pageObj) => { return pageObj.text != ""; }).map((pageObj) => { let min = Number.MAX_VALUE; for (let i = 0; i < pageObj.text.length - query.length; i += 2) { const substring = pageObj.text.substring(i, i + query.length); min = Math.min(min, distance(SettingsManager.currentSettings.caseSensitive ? query : query.toLowerCase(), substring)); } return { "page": pageObj.page, "difference": min }; }).sort((a, b) => { return a.difference - b.difference; }).map((pageObj) => { return pageObj.page; }).slice(0, 10); else return this.pages.filter((page) => { if (SettingsManager.currentSettings.caseSensitive) return page.transcriptText.includes(query); else return page.transcriptText.toLowerCase().includes(query.toLowerCase()); }); } renderSuggestion(page, el) { el.style.display = "flex"; el.style.maxHeight = "150px"; const leftColDiv = el.createEl("div", { cls: "suggestion-col" }); leftColDiv.id = "left-col"; const rightColDiv = el.createEl("div", { cls: "suggestion-col" }); rightColDiv.id = "right-col"; rightColDiv.createEl("h6", { text: `${DBManager.getTranscriptById(page.transcriptId).relativePath}, Page ${page.pageNum + 1}` }).id = "suggestion-heading"; rightColDiv.createEl("p", { text: page.transcriptText }).id = "suggestion-text-preview"; const image = leftColDiv.createEl("img"); image.src = `data:image/png;base64, ${page.thumbnail}`; image.id = "suggestion-thumbnail"; image.onclick = (event) => { event.stopImmediatePropagation(); new ImageModal(page.thumbnail).open(); }; } onChooseSuggestion(page) { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Opening file ${DBManager.getTranscriptById(page.transcriptId).relativePath}`); yield this.app.workspace.getLeaf(false).openFile(this.app.vault.getAbstractFileByPath(DBManager.getTranscriptById(page.transcriptId).relativePath), { eState: { subpath: `#page=${page.pageNum + 1}` } }); }); } }; __name(SearchModal, "SearchModal"); // src/utils/installation/providers/WindowsInstallationProvider.ts var import_sudo_prompt = __toESM(require_sudo_prompt()); var import_ansi_colors = __toESM(require_ansi_colors()); var import_os4 = require("os"); var WindowsInstallationProvider = class { installDependencies(terminal) { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info("Running automatic installation with WindowsInstallationProvider"); terminal.writeln(import_ansi_colors.default.green("Installing chocolatey")); (0, import_sudo_prompt.exec)(`powershell.exe -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\\chocolatey\\bin"`, (error, stdout, stderr) => { terminal.writeln(stdout.toString()); terminal.writeln(import_ansi_colors.default.yellow(stderr.toString())); if (error) { terminal.writeln(import_ansi_colors.default.red(error.message)); return; } terminal.writeln(import_ansi_colors.default.green("Installing tesseract and imagemagick")); (0, import_sudo_prompt.exec)("cinst -y tesseract imagemagick", (error2, stdout2, stderr2) => { terminal.writeln(stdout2.toString()); terminal.writeln(import_ansi_colors.default.yellow(stderr2.toString())); if (error2) { terminal.writeln(import_ansi_colors.default.red(error2.message)); return; } terminal.writeln(import_ansi_colors.default.green("Done. Restart obsidian for changed to take effect")); }); }); }); } isApplicable() { return __async(this, null, function* () { return (0, import_os4.platform)() == "win32"; }); } }; __name(WindowsInstallationProvider, "WindowsInstallationProvider"); // src/utils/installation/providers/DebInstallationProvider.ts var import_ansi_colors2 = __toESM(require_ansi_colors()); var import_sudo_prompt2 = __toESM(require_sudo_prompt()); var DebInstallationProvider = class { installDependencies(terminal) { return __async(this, null, function* () { ObsidianOCRPlugin.logger.info("Running automatic installation with DebInstallationProvider"); terminal.writeln(import_ansi_colors2.default.green("Installing tesseract and imagemagick")); (0, import_sudo_prompt2.exec)("DEBIAN_FRONTEND=noninteractive apt update -y && apt install -y tesseract imagemagick", (error, stdout, stderr) => { terminal.writeln(stdout.toString()); terminal.writeln(import_ansi_colors2.default.yellow(stderr.toString())); if (error) { terminal.writeln(import_ansi_colors2.default.red(error.message)); return; } terminal.writeln(import_ansi_colors2.default.green("Done. Restart obsidian for changes to take effect")); }); }); } isApplicable() { return __async(this, null, function* () { return yield doesProgramExist("apt"); }); } }; __name(DebInstallationProvider, "DebInstallationProvider"); // src/Tips.ts var import_obsidian7 = require("obsidian"); var import_crypto = require("crypto"); var _Tips = class { static showRandomTip() { new import_obsidian7.Notice(`Did you know? ${_Tips.tips[(0, import_crypto.randomInt)(0, _Tips.tips.length)]}`); } }; var Tips = _Tips; __name(Tips, "Tips"); Tips.tips = [ 'You can use the "Delete all transcripts" command to remove all transcript', 'You can open the search modal by either using the ribbon icon or the "Search OCR" command', "You can set the number of background processes in the settings to fit your computer's performance", "You can change whether images are searched for text in the settings", "You can change whether PDFs are searched for text in the settings", "You can increase the image quality to improve recognition accuracy", "You can increase the image density to improve recognition accuracy", "Know what you're doing? Add your own imagemagick arguments in the settings", "Don't like adding things to your path? Add additional folders to be searched in the settings", "Set your language when using tesseract in the settings", "Know what you're doing? Add your own tesseract arguments in the settings", "Don't like an aspect of the plugin? Create an issue or fork it!", "Found a problem? Create an issue on GitHub", "Have an idea on how to improve the plugin? Create an issue on GitHub", "You can enable or disable fuzzy searching in the search modal", "You can enable or disable case sensitive searching in the search modal", "The search modal only starts searching after entering at least 3 characters", "You can click on a page preview in the search modal in enlarge it" ]; // src/Main.ts var import_simple_node_logger = __toESM(require_simple_node_logger()); var import_path6 = require("path"); // src/modals/SettingsModal.ts var import_obsidian8 = require("obsidian"); // src/db/FileSpecificSettings.ts var FileSpecificSettings = class { constructor(imageDensity, imageQuality, imagemagickArgs) { this.imageDensity = imageDensity; this.imageQuality = imageQuality; this.imagemagickArgs = imagemagickArgs; } static DEFAULT() { return new FileSpecificSettings(300, 98, ""); } }; __name(FileSpecificSettings, "FileSpecificSettings"); // src/modals/SettingsModal.ts var SettingsModal = class extends import_obsidian8.Modal { constructor(filePath) { super(app); this.filePath = filePath; if (!DBManager.getSettingsByRelativePath(filePath)) this.settings = FileSpecificSettings.DEFAULT(); else this.settings = DBManager.getSettingsByRelativePath(filePath); } onOpen() { this.contentEl.replaceChildren(); new import_obsidian8.Setting(this.contentEl).addSlider((sc) => { sc.setLimits(50, 300, 10); sc.setValue(this.settings.imageDensity); sc.setDynamicTooltip(); sc.onChange((value) => { ObsidianOCRPlugin.logger.info(`Settings image density to ${value}`); this.settings.imageDensity = value; }); }).setName("Image density").setDesc("Image density of converted PDFs"); new import_obsidian8.Setting(this.contentEl).addSlider((sc) => { sc.setLimits(50, 100, 1); sc.setValue(this.settings.imageQuality); sc.setDynamicTooltip(); sc.onChange((value) => { this.settings.imageQuality = value; ObsidianOCRPlugin.logger.info(`Settings image quality to ${value}`); }); }).setName("Image quality").setDesc("Image quality of converted PDFs"); if (getFileType(File2.fromVaultRelativePath(this.filePath)) == 1 /* PDF */) new import_obsidian8.Setting(this.contentEl).addText((tc) => { tc.setValue(this.settings.imagemagickArgs); tc.setPlaceholder("Additional imagemagick args"); tc.onChange((value) => { this.settings.imagemagickArgs = value; ObsidianOCRPlugin.logger.info(`Settings imagemagick args to ${value}`); }); }).setName("Additional imagemagick args").setDesc("Additional args passed to imagemagick when converting PDF to PNGs"); new import_obsidian8.Setting(this.contentEl).addButton((bc) => { bc.setButtonText("Cancel"); bc.setWarning(); bc.onClick(() => { ObsidianOCRPlugin.logger.info("Closing modal"); this.close(); }); }).addButton((bc) => { bc.setButtonText("Remove"); bc.setWarning(); bc.onClick(() => __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Removing specific settings of file ${this.filePath}`); DBManager.removeSettingsByRelativePath(this.filePath); yield DBManager.saveDB(); this.close(); })); }).addButton((bc) => { bc.setButtonText("Save"); bc.onClick(() => __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Saving specific settings of file ${this.filePath}`); DBManager.setSettingsByRelativePath(this.filePath, this.settings); yield DBManager.saveDB(); this.close(); })); }).addButton((bc) => { bc.setButtonText("Save and reindex"); bc.onClick(() => __async(this, null, function* () { ObsidianOCRPlugin.logger.info(`Saving specific settings and reindexing of file ${this.filePath}`); DBManager.setSettingsByRelativePath(this.filePath, this.settings); yield DBManager.saveDB(); DBManager.removeSettingsByRelativePath(this.filePath); yield OcrQueue.enqueueFile(File2.fromVaultRelativePath(this.filePath)); this.close(); })); }); } }; __name(SettingsModal, "SettingsModal"); // node_modules/chai/index.mjs var import_index = __toESM(require_chai2(), 1); var expect = import_index.default.expect; var version = import_index.default.version; var Assertion = import_index.default.Assertion; var AssertionError = import_index.default.AssertionError; var util = import_index.default.util; var config = import_index.default.config; var use = import_index.default.use; var should = import_index.default.should; var assert = import_index.default.assert; var core = import_index.default.core; // src/utils/Test.ts function describe(desc, ...funcs) { return new Description(desc, funcs); } __name(describe, "describe"); function test(desc, func) { return new Test(desc, func); } __name(test, "test"); var Test = class { constructor(desc, func) { this.desc = desc; this.func = func; } }; __name(Test, "Test"); var Description = class { constructor(desc, funcs) { this.desc = desc; this.funcs = funcs; } run() { console.log(`\u{1F935} Running test suite ${this.desc}`); this.funcs.forEach((func) => { console.log(`\u{1F4DD} Running test ${func.desc}`); try { func.func(); console.log("\u2714\uFE0F Okay"); } catch (e) { console.log("\u274C\uFE0F Failed"); throw e; } }); console.log("\u2728\uFE0F Done"); } }; __name(Description, "Description"); // src/tests/FileUtils.test.ts var settings = { ocrProviderName: "NoOp", ocrProviderSettings: {}, fuzzySearch: true, caseSensitive: false, ocrImage: true, ocrPDF: true, concurrentIndexingProcesses: 1, additionalSearchPath: "", density: 300, quality: 98, additionalImagemagickArgs: "", showTips: true, logToFile: false, logLevel: "all" }; var FileUtils_test_default = [ describe("Check if `getFileType returns the correct file type`", test("check pdf", () => { const file = File2.fromVaultRelativePath("some/image.png"); expect(getFileType(file)).to.eq(0 /* IMAGE */); }), test("check pdf", () => { const file = File2.fromVaultRelativePath("some/document.pdf"); expect(getFileType(file)).to.eq(1 /* PDF */); }), test("check other", () => { const file = File2.fromVaultRelativePath("some/path.md"); expect(getFileType(file)).to.eq(2 /* OTHER */); })), describe("Check if `isFileValid` returns the correct value", test("check !png && !img", () => { const file = File2.fromVaultRelativePath("some/path.md"); expect(isFileValid(file, settings)).to.be.false; }), test("check png && ocrImage", () => { const file = File2.fromVaultRelativePath("some/image.png"); expect(isFileValid(file, settings)).to.be.true; }), test("check png && !ocrImage", () => { const file = File2.fromVaultRelativePath("some/image.png"); const notOcrImgSettings = Object.assign(settings, { ocrImage: false }); expect(isFileValid(file, notOcrImgSettings)).to.be.false; }), test("check pdf && ocrPdf", () => { const file = File2.fromVaultRelativePath("some/document.pdf"); expect(isFileValid(file, settings)).to.be.true; }), test("check pdf && !ocrPdf", () => { const file = File2.fromVaultRelativePath("some/document.pdf"); const notOcrPdfSettings = Object.assign(settings, { ocrPDF: false }); expect(isFileValid(file, notOcrPdfSettings)).to.be.false; })) ]; // src/utils/TestSuite.ts var TestSuite_default = [ FileUtils_test_default ].flat(); // src/utils/installation/providers/ArchInstallationProvider.ts var import_ansi_colors3 = __toESM(require_ansi_colors()); var import_sudo_prompt3 = __toESM(require_sudo_prompt()); var ArchInstallationProvider = class { installDependencies(terminal) { ObsidianOCRPlugin.logger.info("Running automatic installation with ArchInstallationProvider"); terminal.writeln(import_ansi_colors3.default.green("Installing tesseract and imagemagick")); (0, import_sudo_prompt3.exec)("pacman -Syy && pacman -S tesseract imagemagick ", (error, stdout, stderr) => { terminal.writeln(stdout.toString()); terminal.writeln(import_ansi_colors3.default.yellow(stderr.toString())); if (error) { terminal.writeln(import_ansi_colors3.default.red(error.message)); return; } terminal.writeln(import_ansi_colors3.default.green("Done. Restart obsidian for changes to take effect")); }); } isApplicable() { return __async(this, null, function* () { return yield doesProgramExist("pacman"); }); } }; __name(ArchInstallationProvider, "ArchInstallationProvider"); // node_modules/clipboardy/browser.js var clipboard = {}; clipboard.write = (text) => __async(void 0, null, function* () { yield navigator.clipboard.writeText(text); }); clipboard.read = () => __async(void 0, null, function* () { return navigator.clipboard.readText(); }); clipboard.readSync = () => { throw new Error("`.readSync()` is not supported in browsers!"); }; clipboard.writeSync = () => { throw new Error("`.writeSync()` is not supported in browsers!"); }; var browser_default = clipboard; // src/Main.ts var _ObsidianOCRPlugin = class extends import_obsidian9.Plugin { onload() { return __async(this, null, function* () { yield SettingsManager.loadSettings(this); _ObsidianOCRPlugin.logger = SettingsManager.currentSettings.logToFile ? (0, import_simple_node_logger.createSimpleFileLogger)((0, import_path6.join)(app.vault.adapter.getBasePath(), "obsidian-ocr.log")) : (0, import_simple_node_logger.createSimpleLogger)(); _ObsidianOCRPlugin.logger.setLevel(SettingsManager.currentSettings.logToFile ? "all" : SettingsManager.currentSettings.logLevel); _ObsidianOCRPlugin.plugin = this; OCRProviderManager.addAdditionalPaths(); yield OCRProviderManager.applyHomebrewWorkaround(); InstallationProviderManager.registerProviders(new WindowsInstallationProvider(), new DebInstallationProvider(), new ArchInstallationProvider()); OCRProviderManager.registerOCRProviders(new NoOpOCRProvider(), new TesseractOCRProvider()); yield DBManager.init(); yield SettingsManager.validateSettings(); this.registerEvent(this.app.vault.on("create", (tFile) => __async(this, null, function* () { if (tFile instanceof import_obsidian9.TFolder) return; const file = File2.fromFile(tFile); if (shouldFileBeOCRed(file, SettingsManager.currentSettings)) { yield OcrQueue.enqueueFile(file); } }))); this.registerEvent(this.app.vault.on("delete", (tFile) => __async(this, null, function* () { const file = File2.fromFile(tFile); if (!isFileValid(file, SettingsManager.currentSettings)) return; _ObsidianOCRPlugin.logger.info(`Deleting transcript with path ${file.vaultRelativePath}`); const transcript = DBManager.getTranscriptByRelativePath(file.vaultRelativePath); if (!transcript) return; yield DBManager.removeSettingsByRelativePath(file.vaultRelativePath); yield DBManager.removeTranscriptByPath(transcript.relativePath); }))); this.registerEvent(this.app.vault.on("rename", (file, oldPath) => __async(this, null, function* () { const newFile = File2.fromFile(file); if (!shouldFileBeOCRed(newFile, SettingsManager.currentSettings)) return; yield DBManager.updateTranscriptPath(oldPath, newFile.vaultRelativePath); }))); this.app.workspace.onLayoutReady(() => __async(this, null, function* () { StatusBar.setupStatusBar(this.addStatusBarItem()); if (SettingsManager.currentSettings.showTips) Tips.showRandomTip(); if (SettingsManager.currentSettings.ocrProviderName == "NoOp") new import_obsidian9.Notice("Don't forget to select an OCR Provider in the settings."); processVault(SettingsManager.currentSettings); })); this.app.workspace.on("quit", () => { _ObsidianOCRPlugin.children.forEach((child) => { child.kill(); }); DBManager.dispose(); }); this.registerEvent(this.app.workspace.on("file-menu", (menu, file) => { if (file instanceof import_obsidian9.TFolder) menu.addItem((item) => { item.setIcon("note-glyph"); const result = DBManager.getIgnoredFolderByPath(file.path); if (result) { item.setTitle("Unignore folder for OCR").onClick(() => __async(this, null, function* () { DBManager.removeIgnoredFolderById(result.id); yield DBManager.saveDB(); processVault(SettingsManager.currentSettings); })); if (isFileInIgnoredFolder(file)) item.setDisabled(true); } else { item.setTitle("Ignore folder for OCR").onClick(() => __async(this, null, function* () { DBManager.addIgnoredFolder(file.path); yield DBManager.saveDB(); DBManager.getAllTranscripts().filter((transcript) => { return isFileInIgnoredFolder(File2.fromVaultRelativePath(transcript.relativePath)); }).forEach((transcript) => { DBManager.removeTranscriptByPath(transcript.relativePath); }); yield DBManager.saveDB(); })); if (isFileInIgnoredFolder(file)) item.setDisabled(true); } }); else if (isFileValid(File2.fromFile(file), SettingsManager.currentSettings)) { menu.addItem((item) => { item.setTitle("Custom OCR settings").setIcon("note-glyph").onClick(() => { new SettingsModal(file.path).open(); }); if (isFileInIgnoredFolder(File2.fromFile(file))) item.setDisabled(true); }); menu.addItem((item) => { item.setTitle("Copy text to clipboard").setIcon("documents").onClick(() => { const transcript = DBManager.getTranscriptByRelativePath(file.path); if (!transcript) new import_obsidian9.Notice("No transcript available"); else { const pages = DBManager.getPagesByTranscriptId(transcript.transcriptId); const text = pages.map((page) => { return page.transcriptText; }).join("\n\n"); browser_default.write(text).then(() => { new import_obsidian9.Notice("Content copied to clipboard"); }); } }); }); } })); this.addSettingTab(new SettingsTab(this.app, this)); this.addRibbonIcon("magnifying-glass", "Search OCR", () => { new SearchModal().open(); }); this.addCommand({ id: "search-ocr", name: "Search OCR", callback: () => { new SearchModal().open(); } }); this.addCommand({ id: "delete-json", name: "Delete all transcripts", callback: () => __async(this, null, function* () { if (StatusBar.hasStatus(0 /* INDEXING */)) new import_obsidian9.Notice("Deleting is not available while indexing"); else { yield removeAllJsonFiles(); DBManager.deleteAllTranscripts(); processVault(SettingsManager.currentSettings); } }) }); this.addCommand({ id: "run-tests", name: "Run Obsidian-OCR unit tests", callback: () => { TestSuite_default.forEach((test2) => { test2.run(); }); } }); }); } }; var ObsidianOCRPlugin = _ObsidianOCRPlugin; __name(ObsidianOCRPlugin, "ObsidianOCRPlugin"); ObsidianOCRPlugin.children = []; /* @license BSL-1.0 https://git.io/fpQEc */ /*! * ### ._obj * * Quick reference to stored `actual` value for plugin developers. * * @api private */ /*! * ### .ifError(object) * * Asserts if value is not a false value, and throws if it is a true value. * This is added to allow for chai to be a drop-in replacement for Node's * assert class. * * var err = new Error('I am a custom error'); * assert.ifError(err); // Rethrows err! * * @name ifError * @param {Object} object * @namespace Assert * @api public */ /*! * Add a chainable method */ /*! * Aliases. */ /*! * Assert interface */ /*! * Assertion Constructor * * Creates object for chaining. * * `Assertion` objects contain metadata in the form of flags. Three flags can * be assigned during instantiation by passing arguments to this constructor: * * - `object`: This flag contains the target of the assertion. For example, in * the assertion `expect(numKittens).to.equal(7);`, the `object` flag will * contain `numKittens` so that the `equal` assertion can reference it when * needed. * * - `message`: This flag contains an optional custom error message to be * prepended to the error message that's generated by the assertion when it * fails. * * - `ssfi`: This flag stands for "start stack function indicator". It * contains a function reference that serves as the starting point for * removing frames from the stack trace of the error that's created by the * assertion when it fails. The goal is to provide a cleaner stack trace to * end users by removing Chai's internal functions. Note that it only works * in environments that support `Error.captureStackTrace`, and only when * `Chai.config.includeStack` hasn't been set to `false`. * * - `lockSsfi`: This flag controls whether or not the given `ssfi` flag * should retain its current value, even as assertions are chained off of * this object. This is usually set to `true` when creating a new assertion * from within another assertion. It's also temporarily set to `true` before * an overwritten assertion gets called by the overwriting assertion. * * @param {Mixed} obj target of the assertion * @param {String} msg (optional) custom error message * @param {Function} ssfi (optional) starting point for removing stack frames * @param {Boolean} lockSsfi (optional) whether or not the ssfi flag is locked * @api private */ /*! * Assertion Error */ /*! * Chai - addChainingMethod utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - addLengthGuard utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - addMethod utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - addProperty utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - compareByInspect utility * Copyright(c) 2011-2016 Jake Luer * MIT Licensed */ /*! * Chai - expectTypes utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - flag utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - getActual utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - getOwnEnumerableProperties utility * Copyright(c) 2011-2016 Jake Luer * MIT Licensed */ /*! * Chai - getOwnEnumerablePropertySymbols utility * Copyright(c) 2011-2016 Jake Luer * MIT Licensed */ /*! * Chai - getProperties utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - isNaN utility * Copyright(c) 2012-2015 Sakthipriyan Vairamani * MIT Licensed */ /*! * Chai - isProxyEnabled helper * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - message composition utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - overwriteChainableMethod utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - overwriteMethod utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - overwriteProperty utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - proxify utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - test utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai - transferFlags utility * Copyright(c) 2012-2014 Jake Luer * MIT Licensed */ /*! * Chai dependencies. */ /*! * Chai version */ /*! * Check if a property exists */ /*! * Check to see if the MemoizeMap has recorded a result of the two operands * * @param {Mixed} leftHandOperand * @param {Mixed} rightHandOperand * @param {MemoizeMap} memoizeMap * @returns {Boolean|null} result */ /*! * Checks error against a given set of criteria */ /*! * Compare by inspect method */ /*! * Compare two Regular Expressions for equality. * * @param {RegExp} leftHandOperand * @param {RegExp} rightHandOperand * @return {Boolean} result */ /*! * Compare two Sets/Maps for equality. Faster than other equality functions. * * @param {Set} leftHandOperand * @param {Set} rightHandOperand * @param {Object} [options] (Optional) * @return {Boolean} result */ /*! * Configuration */ /*! * Core Assertions */ /*! * Deep equal utility */ /*! * Deep path info */ /*! * Dependencies that are used for multiple exports are required here only once */ /*! * Determine if the given object has an @@iterator function. * * @param {Object} target * @return {Boolean} `true` if the object has an @@iterator function. */ /*! * Determines if two objects have matching values, given a set of keys. Defers to deepEqual for the equality check of * each key. If any value of the given key is not equal, the function will return false (early). * * @param {Mixed} leftHandOperand * @param {Mixed} rightHandOperand * @param {Array} keys An array of keys to compare the values of leftHandOperand and rightHandOperand against * @param {Object} [options] (Optional) * @return {Boolean} result */ /*! * Ensure correct constructor */ /*! * Expect interface */ /*! * Flag transferring utility */ /*! * Flag utility */ /*! * Function name */ /*! * Get own enumerable properties method */ /*! * Get own enumerable property symbols method */ /*! * Gets all entries from a Generator. This will consume the generator - which could have side effects. * * @param {Generator} target * @returns {Array} an array of entries from the Generator. */ /*! * Gets all iterator entries from the given Object. If the Object has no @@iterator function, returns an empty array. * This will consume the iterator - which could have side effects depending on the @@iterator implementation. * * @param {Object} target * @returns {Array} an array of entries from the @@iterator function */ /*! * Gets all own and inherited enumerable keys from a target. * * @param {Object} target * @returns {Array} an array of own and inherited enumerable keys from the target. */ /*! * Inherit from Error.prototype */ /*! * Inspect util */ /*! * Module dependencies */ /*! * Module dependencies. */ /*! * Module export. */ /*! * Module variables */ /*! * Object Display util */ /*! * Overwrite chainable method */ /*! * Primary Export */ /*! * Primary Exports */ /*! * Primary `Assertion` prototype */ /*! * Proxify util */ /*! * Recursively check the equality of two Objects. Once basic sameness has been established it will defer to `deepEqual` * for each enumerable key in the object. * * @param {Mixed} leftHandOperand * @param {Mixed} rightHandOperand * @param {Object} [options] (Optional) * @return {Boolean} result */ /*! * Return a function that will copy properties from * one object to another excluding any originally * listed. Returned function will create a new `{}`. * * @param {String} excluded properties ... * @return {Function} */ /*! * Returns true if the argument is a primitive. * * This intentionally returns true for all objects that can be compared by reference, * including functions and symbols. * * @param {Mixed} value * @return {Boolean} result */ /*! * Set the result of the equality into the MemoizeMap * * @param {Mixed} leftHandOperand * @param {Mixed} rightHandOperand * @param {MemoizeMap} memoizeMap * @param {Boolean} result */ /*! * Should interface */ /*! * Simple equality for flat iterable objects such as Arrays, TypedArrays or Node.js buffers. * * @param {Iterable} leftHandOperand * @param {Iterable} rightHandOperand * @param {Object} [options] (Optional) * @return {Boolean} result */ /*! * Simple equality for generator objects such as those returned by generator functions. * * @param {Iterable} leftHandOperand * @param {Iterable} rightHandOperand * @param {Object} [options] (Optional) * @return {Boolean} result */ /*! * Statically set name */ /*! * The main logic of the `deepEqual` function. * * @param {Mixed} leftHandOperand * @param {Mixed} rightHandOperand * @param {Object} [options] (optional) Additional options * @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality. * @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of complex objects for a speed boost. By passing `false` you can disable memoization, but this will cause circular references to blow the stack. * @return {Boolean} equal match */ /*! * Utility Functions */ /*! * Utils for plugins (not exported) */ /*! * actual utility */ /*! * add Method */ /*! * add Property */ /*! * addLengthGuard util */ /*! * assertion-error * Copyright(c) 2013 Jake Luer * MIT Licensed */ /*! * chai * Copyright(c) 2011 Jake Luer * MIT Licensed */ /*! * chai * Copyright(c) 2011-2014 Jake Luer * MIT Licensed */ /*! * chai * http://chaijs.com * Copyright(c) 2011-2014 Jake Luer * MIT Licensed */ /*! * deep-eql * Copyright(c) 2013 Jake Luer * MIT Licensed */ /*! * expectTypes utility */ /*! * fill-range * * Copyright (c) 2014-present, Jon Schlinkert. * Licensed under the MIT License. */ /*! * getOperator method */ /*! * is-extglob * * Copyright (c) 2014-2016, Jon Schlinkert. * Licensed under the MIT License. */ /*! * is-glob * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ /*! * is-number * * Copyright (c) 2014-present, Jon Schlinkert. * Released under the MIT License. */ /*! * isNaN method */ /*! * isProxyEnabled helper */ /*! * message utility */ /*! * overwrite Method */ /*! * overwrite Property */ /*! * test utility */ /*! * to-regex-range * * Copyright (c) 2015-present, Jon Schlinkert. * Released under the MIT License. */ /*! * type utility */ /*! queue-microtask. MIT License. Feross Aboukhadijeh */ /*! run-parallel. MIT License. Feross Aboukhadijeh */ /** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! moment.js //! momentjs.com //! version : 2.29.4