From ca1f47efc88a363722638fd14a9127306d3c1fe6 Mon Sep 17 00:00:00 2001 From: Jan Meyer Date: Fri, 27 Feb 2026 11:13:09 +0100 Subject: [PATCH] chore: inital commit --- .obsidian/app.json | 5 + .obsidian/appearance.json | 5 + .obsidian/community-plugins.json | 6 + .obsidian/core-plugins.json | 33 + .obsidian/graph.json | 22 + .obsidian/plugins/edit-in-neovim/data.json | 17 + .obsidian/plugins/edit-in-neovim/main.js | 33192 ++++++++++++++++ .../plugins/edit-in-neovim/manifest.json | 10 + .obsidian/plugins/obsidian-git/data.json | 68 + .obsidian/plugins/obsidian-git/main.js | 452 + .obsidian/plugins/obsidian-git/manifest.json | 10 + .obsidian/plugins/obsidian-git/styles.css | 705 + .../obsidian-minimal-settings/data.json | 34 + .../plugins/obsidian-minimal-settings/main.js | 8 + .../obsidian-minimal-settings/manifest.json | 11 + .../plugins/obsidian-typst-math/data.json | 11 + .obsidian/plugins/obsidian-typst-math/main.js | 805 + .../plugins/obsidian-typst-math/manifest.json | 10 + .../plugins/obsidian-typst-math/styles.css | 176 + .obsidian/themes/Minimal/manifest.json | 8 + .obsidian/themes/Minimal/theme.css | 2251 ++ .obsidian/themes/Tokyo Night/manifest.json | 6 + .obsidian/themes/Tokyo Night/theme.css | 2129 + .obsidian/workspace.json | 202 + DAS/Functions.md | 27 + DAS/Set Theory.md | 85 + ET/Grundlagen.md | 8 + ET/Kirchhoffsche Regeln.md | 14 + ET/Netzwerke.md | 22 + ET/images/beispiel_knotenregel.png | Bin 0 -> 85915 bytes Studium.md | 7 + mathe/notation.md | 5 + 32 files changed, 40344 insertions(+) create mode 100644 .obsidian/app.json create mode 100644 .obsidian/appearance.json create mode 100644 .obsidian/community-plugins.json create mode 100644 .obsidian/core-plugins.json create mode 100644 .obsidian/graph.json create mode 100644 .obsidian/plugins/edit-in-neovim/data.json create mode 100644 .obsidian/plugins/edit-in-neovim/main.js create mode 100644 .obsidian/plugins/edit-in-neovim/manifest.json create mode 100644 .obsidian/plugins/obsidian-git/data.json create mode 100644 .obsidian/plugins/obsidian-git/main.js create mode 100644 .obsidian/plugins/obsidian-git/manifest.json create mode 100644 .obsidian/plugins/obsidian-git/styles.css create mode 100644 .obsidian/plugins/obsidian-minimal-settings/data.json create mode 100644 .obsidian/plugins/obsidian-minimal-settings/main.js create mode 100644 .obsidian/plugins/obsidian-minimal-settings/manifest.json create mode 100644 .obsidian/plugins/obsidian-typst-math/data.json create mode 100644 .obsidian/plugins/obsidian-typst-math/main.js create mode 100644 .obsidian/plugins/obsidian-typst-math/manifest.json create mode 100644 .obsidian/plugins/obsidian-typst-math/styles.css create mode 100644 .obsidian/themes/Minimal/manifest.json create mode 100644 .obsidian/themes/Minimal/theme.css create mode 100644 .obsidian/themes/Tokyo Night/manifest.json create mode 100644 .obsidian/themes/Tokyo Night/theme.css create mode 100644 .obsidian/workspace.json create mode 100644 DAS/Functions.md create mode 100644 DAS/Set Theory.md create mode 100644 ET/Grundlagen.md create mode 100644 ET/Kirchhoffsche Regeln.md create mode 100644 ET/Netzwerke.md create mode 100644 ET/images/beispiel_knotenregel.png create mode 100644 Studium.md create mode 100644 mathe/notation.md diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 0000000..769a3c3 --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1,5 @@ +{ + "trashOption": "local", + "vimMode": true, + "alwaysUpdateLinks": true +} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 0000000..9be5bf4 --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1,5 @@ +{ + "theme": "obsidian", + "interfaceFontFamily": "Noto Sans", + "cssTheme": "Tokyo Night" +} \ No newline at end of file diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json new file mode 100644 index 0000000..a6f3859 --- /dev/null +++ b/.obsidian/community-plugins.json @@ -0,0 +1,6 @@ +[ + "obsidian-minimal-settings", + "obsidian-typst-cli", + "edit-in-neovim", + "obsidian-git" +] \ No newline at end of file diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json new file mode 100644 index 0000000..0faa60d --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,33 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "footnotes": false, + "properties": false, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": true, + "bases": true, + "webviewer": false +} \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json new file mode 100644 index 0000000..0df2344 --- /dev/null +++ b/.obsidian/graph.json @@ -0,0 +1,22 @@ +{ + "collapse-filter": true, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": false, + "showOrphans": true, + "collapse-color-groups": true, + "colorGroups": [], + "collapse-display": true, + "showArrow": false, + "textFadeMultiplier": 0, + "nodeSizeMultiplier": 1, + "lineSizeMultiplier": 1, + "collapse-forces": false, + "centerStrength": 0, + "repelStrength": 0, + "linkStrength": 0.500822368421053, + "linkDistance": 30, + "scale": 1, + "close": false +} \ No newline at end of file diff --git a/.obsidian/plugins/edit-in-neovim/data.json b/.obsidian/plugins/edit-in-neovim/data.json new file mode 100644 index 0000000..2c0642b --- /dev/null +++ b/.obsidian/plugins/edit-in-neovim/data.json @@ -0,0 +1,17 @@ +{ + "terminal": "wezterm", + "listenOn": "127.0.0.1:2006", + "openNeovimOnLoad": false, + "supportedFileTypes": [ + "txt", + "md", + "css", + "js", + "ts", + "tsx", + "jsx", + "json" + ], + "pathToBinary": "", + "appname": "" +} \ No newline at end of file diff --git a/.obsidian/plugins/edit-in-neovim/main.js b/.obsidian/plugins/edit-in-neovim/main.js new file mode 100644 index 0000000..c568d54 --- /dev/null +++ b/.obsidian/plugins/edit-in-neovim/main.js @@ -0,0 +1,33192 @@ +/* +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 __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +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( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// node_modules/@msgpack/msgpack/dist/utils/int.js +var require_int = __commonJS({ + "node_modules/@msgpack/msgpack/dist/utils/int.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getUint64 = exports.getInt64 = exports.setInt64 = exports.setUint64 = exports.UINT32_MAX = void 0; + exports.UINT32_MAX = 4294967295; + function setUint64(view, offset, value) { + const high = value / 4294967296; + const low = value; + view.setUint32(offset, high); + view.setUint32(offset + 4, low); + } + exports.setUint64 = setUint64; + function setInt64(view, offset, value) { + const high = Math.floor(value / 4294967296); + const low = value; + view.setUint32(offset, high); + view.setUint32(offset + 4, low); + } + exports.setInt64 = setInt64; + function getInt64(view, offset) { + const high = view.getInt32(offset); + const low = view.getUint32(offset + 4); + return high * 4294967296 + low; + } + exports.getInt64 = getInt64; + function getUint64(view, offset) { + const high = view.getUint32(offset); + const low = view.getUint32(offset + 4); + return high * 4294967296 + low; + } + exports.getUint64 = getUint64; + } +}); + +// node_modules/@msgpack/msgpack/dist/utils/utf8.js +var require_utf8 = __commonJS({ + "node_modules/@msgpack/msgpack/dist/utils/utf8.js"(exports) { + "use strict"; + var _a; + var _b; + var _c; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.utf8DecodeTD = exports.TEXT_DECODER_THRESHOLD = exports.utf8DecodeJs = exports.utf8EncodeTE = exports.TEXT_ENCODER_THRESHOLD = exports.utf8EncodeJs = exports.utf8Count = void 0; + var int_1 = require_int(); + var TEXT_ENCODING_AVAILABLE = (typeof process === "undefined" || ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a["TEXT_ENCODING"]) !== "never") && typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined"; + function utf8Count(str) { + const strLength = str.length; + let byteLength = 0; + let pos = 0; + while (pos < strLength) { + let value = str.charCodeAt(pos++); + if ((value & 4294967168) === 0) { + byteLength++; + continue; + } else if ((value & 4294965248) === 0) { + byteLength += 2; + } else { + if (value >= 55296 && value <= 56319) { + if (pos < strLength) { + const extra = str.charCodeAt(pos); + if ((extra & 64512) === 56320) { + ++pos; + value = ((value & 1023) << 10) + (extra & 1023) + 65536; + } + } + } + if ((value & 4294901760) === 0) { + byteLength += 3; + } else { + byteLength += 4; + } + } + } + return byteLength; + } + exports.utf8Count = utf8Count; + function utf8EncodeJs(str, output, outputOffset) { + const strLength = str.length; + let offset = outputOffset; + let pos = 0; + while (pos < strLength) { + let value = str.charCodeAt(pos++); + if ((value & 4294967168) === 0) { + output[offset++] = value; + continue; + } else if ((value & 4294965248) === 0) { + output[offset++] = value >> 6 & 31 | 192; + } else { + if (value >= 55296 && value <= 56319) { + if (pos < strLength) { + const extra = str.charCodeAt(pos); + if ((extra & 64512) === 56320) { + ++pos; + value = ((value & 1023) << 10) + (extra & 1023) + 65536; + } + } + } + if ((value & 4294901760) === 0) { + output[offset++] = value >> 12 & 15 | 224; + output[offset++] = value >> 6 & 63 | 128; + } else { + output[offset++] = value >> 18 & 7 | 240; + output[offset++] = value >> 12 & 63 | 128; + output[offset++] = value >> 6 & 63 | 128; + } + } + output[offset++] = value & 63 | 128; + } + } + exports.utf8EncodeJs = utf8EncodeJs; + var sharedTextEncoder = TEXT_ENCODING_AVAILABLE ? new TextEncoder() : void 0; + exports.TEXT_ENCODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE ? int_1.UINT32_MAX : typeof process !== "undefined" && ((_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b["TEXT_ENCODING"]) !== "force" ? 200 : 0; + function utf8EncodeTEencode(str, output, outputOffset) { + output.set(sharedTextEncoder.encode(str), outputOffset); + } + function utf8EncodeTEencodeInto(str, output, outputOffset) { + sharedTextEncoder.encodeInto(str, output.subarray(outputOffset)); + } + exports.utf8EncodeTE = (sharedTextEncoder === null || sharedTextEncoder === void 0 ? void 0 : sharedTextEncoder.encodeInto) ? utf8EncodeTEencodeInto : utf8EncodeTEencode; + var CHUNK_SIZE = 4096; + function utf8DecodeJs(bytes, inputOffset, byteLength) { + let offset = inputOffset; + const end = offset + byteLength; + const units = []; + let result2 = ""; + while (offset < end) { + const byte1 = bytes[offset++]; + if ((byte1 & 128) === 0) { + units.push(byte1); + } else if ((byte1 & 224) === 192) { + const byte2 = bytes[offset++] & 63; + units.push((byte1 & 31) << 6 | byte2); + } else if ((byte1 & 240) === 224) { + const byte2 = bytes[offset++] & 63; + const byte3 = bytes[offset++] & 63; + units.push((byte1 & 31) << 12 | byte2 << 6 | byte3); + } else if ((byte1 & 248) === 240) { + const byte2 = bytes[offset++] & 63; + const byte3 = bytes[offset++] & 63; + const byte4 = bytes[offset++] & 63; + let unit = (byte1 & 7) << 18 | byte2 << 12 | byte3 << 6 | byte4; + if (unit > 65535) { + unit -= 65536; + units.push(unit >>> 10 & 1023 | 55296); + unit = 56320 | unit & 1023; + } + units.push(unit); + } else { + units.push(byte1); + } + if (units.length >= CHUNK_SIZE) { + result2 += String.fromCharCode(...units); + units.length = 0; + } + } + if (units.length > 0) { + result2 += String.fromCharCode(...units); + } + return result2; + } + exports.utf8DecodeJs = utf8DecodeJs; + var sharedTextDecoder = TEXT_ENCODING_AVAILABLE ? new TextDecoder() : null; + exports.TEXT_DECODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE ? int_1.UINT32_MAX : typeof process !== "undefined" && ((_c = process === null || process === void 0 ? void 0 : process.env) === null || _c === void 0 ? void 0 : _c["TEXT_DECODER"]) !== "force" ? 200 : 0; + function utf8DecodeTD(bytes, inputOffset, byteLength) { + const stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength); + return sharedTextDecoder.decode(stringBytes); + } + exports.utf8DecodeTD = utf8DecodeTD; + } +}); + +// node_modules/@msgpack/msgpack/dist/ExtData.js +var require_ExtData = __commonJS({ + "node_modules/@msgpack/msgpack/dist/ExtData.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExtData = void 0; + var ExtData = class { + constructor(type, data) { + this.type = type; + this.data = data; + } + }; + exports.ExtData = ExtData; + } +}); + +// node_modules/@msgpack/msgpack/dist/DecodeError.js +var require_DecodeError = __commonJS({ + "node_modules/@msgpack/msgpack/dist/DecodeError.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DecodeError = void 0; + var DecodeError = class extends Error { + constructor(message) { + super(message); + const proto = Object.create(DecodeError.prototype); + Object.setPrototypeOf(this, proto); + Object.defineProperty(this, "name", { + configurable: true, + enumerable: false, + value: DecodeError.name + }); + } + }; + exports.DecodeError = DecodeError; + } +}); + +// node_modules/@msgpack/msgpack/dist/timestamp.js +var require_timestamp = __commonJS({ + "node_modules/@msgpack/msgpack/dist/timestamp.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.timestampExtension = exports.decodeTimestampExtension = exports.decodeTimestampToTimeSpec = exports.encodeTimestampExtension = exports.encodeDateToTimeSpec = exports.encodeTimeSpecToTimestamp = exports.EXT_TIMESTAMP = void 0; + var DecodeError_1 = require_DecodeError(); + var int_1 = require_int(); + exports.EXT_TIMESTAMP = -1; + var TIMESTAMP32_MAX_SEC = 4294967296 - 1; + var TIMESTAMP64_MAX_SEC = 17179869184 - 1; + function encodeTimeSpecToTimestamp({ sec, nsec }) { + if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) { + if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) { + const rv = new Uint8Array(4); + const view = new DataView(rv.buffer); + view.setUint32(0, sec); + return rv; + } else { + const secHigh = sec / 4294967296; + const secLow = sec & 4294967295; + const rv = new Uint8Array(8); + const view = new DataView(rv.buffer); + view.setUint32(0, nsec << 2 | secHigh & 3); + view.setUint32(4, secLow); + return rv; + } + } else { + const rv = new Uint8Array(12); + const view = new DataView(rv.buffer); + view.setUint32(0, nsec); + (0, int_1.setInt64)(view, 4, sec); + return rv; + } + } + exports.encodeTimeSpecToTimestamp = encodeTimeSpecToTimestamp; + function encodeDateToTimeSpec(date) { + const msec = date.getTime(); + const sec = Math.floor(msec / 1e3); + const nsec = (msec - sec * 1e3) * 1e6; + const nsecInSec = Math.floor(nsec / 1e9); + return { + sec: sec + nsecInSec, + nsec: nsec - nsecInSec * 1e9 + }; + } + exports.encodeDateToTimeSpec = encodeDateToTimeSpec; + function encodeTimestampExtension(object) { + if (object instanceof Date) { + const timeSpec = encodeDateToTimeSpec(object); + return encodeTimeSpecToTimestamp(timeSpec); + } else { + return null; + } + } + exports.encodeTimestampExtension = encodeTimestampExtension; + function decodeTimestampToTimeSpec(data) { + const view = new DataView(data.buffer, data.byteOffset, data.byteLength); + switch (data.byteLength) { + case 4: { + const sec = view.getUint32(0); + const nsec = 0; + return { sec, nsec }; + } + case 8: { + const nsec30AndSecHigh2 = view.getUint32(0); + const secLow32 = view.getUint32(4); + const sec = (nsec30AndSecHigh2 & 3) * 4294967296 + secLow32; + const nsec = nsec30AndSecHigh2 >>> 2; + return { sec, nsec }; + } + case 12: { + const sec = (0, int_1.getInt64)(view, 4); + const nsec = view.getUint32(0); + return { sec, nsec }; + } + default: + throw new DecodeError_1.DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${data.length}`); + } + } + exports.decodeTimestampToTimeSpec = decodeTimestampToTimeSpec; + function decodeTimestampExtension(data) { + const timeSpec = decodeTimestampToTimeSpec(data); + return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6); + } + exports.decodeTimestampExtension = decodeTimestampExtension; + exports.timestampExtension = { + type: exports.EXT_TIMESTAMP, + encode: encodeTimestampExtension, + decode: decodeTimestampExtension + }; + } +}); + +// node_modules/@msgpack/msgpack/dist/ExtensionCodec.js +var require_ExtensionCodec = __commonJS({ + "node_modules/@msgpack/msgpack/dist/ExtensionCodec.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExtensionCodec = void 0; + var ExtData_1 = require_ExtData(); + var timestamp_1 = require_timestamp(); + var ExtensionCodec = class { + constructor() { + this.builtInEncoders = []; + this.builtInDecoders = []; + this.encoders = []; + this.decoders = []; + this.register(timestamp_1.timestampExtension); + } + register({ type, encode, decode }) { + if (type >= 0) { + this.encoders[type] = encode; + this.decoders[type] = decode; + } else { + const index = 1 + type; + this.builtInEncoders[index] = encode; + this.builtInDecoders[index] = decode; + } + } + tryToEncode(object, context) { + for (let i = 0; i < this.builtInEncoders.length; i++) { + const encodeExt = this.builtInEncoders[i]; + if (encodeExt != null) { + const data = encodeExt(object, context); + if (data != null) { + const type = -1 - i; + return new ExtData_1.ExtData(type, data); + } + } + } + for (let i = 0; i < this.encoders.length; i++) { + const encodeExt = this.encoders[i]; + if (encodeExt != null) { + const data = encodeExt(object, context); + if (data != null) { + const type = i; + return new ExtData_1.ExtData(type, data); + } + } + } + if (object instanceof ExtData_1.ExtData) { + return object; + } + return null; + } + decode(data, type, context) { + const decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type]; + if (decodeExt) { + return decodeExt(data, type, context); + } else { + return new ExtData_1.ExtData(type, data); + } + } + }; + exports.ExtensionCodec = ExtensionCodec; + ExtensionCodec.defaultCodec = new ExtensionCodec(); + } +}); + +// node_modules/@msgpack/msgpack/dist/utils/typedArrays.js +var require_typedArrays = __commonJS({ + "node_modules/@msgpack/msgpack/dist/utils/typedArrays.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createDataView = exports.ensureUint8Array = void 0; + function ensureUint8Array(buffer) { + if (buffer instanceof Uint8Array) { + return buffer; + } else if (ArrayBuffer.isView(buffer)) { + return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); + } else if (buffer instanceof ArrayBuffer) { + return new Uint8Array(buffer); + } else { + return Uint8Array.from(buffer); + } + } + exports.ensureUint8Array = ensureUint8Array; + function createDataView(buffer) { + if (buffer instanceof ArrayBuffer) { + return new DataView(buffer); + } + const bufferView = ensureUint8Array(buffer); + return new DataView(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); + } + exports.createDataView = createDataView; + } +}); + +// node_modules/@msgpack/msgpack/dist/Encoder.js +var require_Encoder = __commonJS({ + "node_modules/@msgpack/msgpack/dist/Encoder.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Encoder = exports.DEFAULT_INITIAL_BUFFER_SIZE = exports.DEFAULT_MAX_DEPTH = void 0; + var utf8_1 = require_utf8(); + var ExtensionCodec_1 = require_ExtensionCodec(); + var int_1 = require_int(); + var typedArrays_1 = require_typedArrays(); + exports.DEFAULT_MAX_DEPTH = 100; + exports.DEFAULT_INITIAL_BUFFER_SIZE = 2048; + var Encoder = class { + constructor(extensionCodec = ExtensionCodec_1.ExtensionCodec.defaultCodec, context = void 0, maxDepth = exports.DEFAULT_MAX_DEPTH, initialBufferSize = exports.DEFAULT_INITIAL_BUFFER_SIZE, sortKeys = false, forceFloat32 = false, ignoreUndefined = false, forceIntegerToFloat = false) { + this.extensionCodec = extensionCodec; + this.context = context; + this.maxDepth = maxDepth; + this.initialBufferSize = initialBufferSize; + this.sortKeys = sortKeys; + this.forceFloat32 = forceFloat32; + this.ignoreUndefined = ignoreUndefined; + this.forceIntegerToFloat = forceIntegerToFloat; + this.pos = 0; + this.view = new DataView(new ArrayBuffer(this.initialBufferSize)); + this.bytes = new Uint8Array(this.view.buffer); + } + reinitializeState() { + this.pos = 0; + } + /** + * This is almost equivalent to {@link Encoder#encode}, but it returns an reference of the encoder's internal buffer and thus much faster than {@link Encoder#encode}. + * + * @returns Encodes the object and returns a shared reference the encoder's internal buffer. + */ + encodeSharedRef(object) { + this.reinitializeState(); + this.doEncode(object, 1); + return this.bytes.subarray(0, this.pos); + } + /** + * @returns Encodes the object and returns a copy of the encoder's internal buffer. + */ + encode(object) { + this.reinitializeState(); + this.doEncode(object, 1); + return this.bytes.slice(0, this.pos); + } + doEncode(object, depth) { + if (depth > this.maxDepth) { + throw new Error(`Too deep objects in depth ${depth}`); + } + if (object == null) { + this.encodeNil(); + } else if (typeof object === "boolean") { + this.encodeBoolean(object); + } else if (typeof object === "number") { + this.encodeNumber(object); + } else if (typeof object === "string") { + this.encodeString(object); + } else { + this.encodeObject(object, depth); + } + } + ensureBufferSizeToWrite(sizeToWrite) { + const requiredSize = this.pos + sizeToWrite; + if (this.view.byteLength < requiredSize) { + this.resizeBuffer(requiredSize * 2); + } + } + resizeBuffer(newSize) { + const newBuffer = new ArrayBuffer(newSize); + const newBytes = new Uint8Array(newBuffer); + const newView = new DataView(newBuffer); + newBytes.set(this.bytes); + this.view = newView; + this.bytes = newBytes; + } + encodeNil() { + this.writeU8(192); + } + encodeBoolean(object) { + if (object === false) { + this.writeU8(194); + } else { + this.writeU8(195); + } + } + encodeNumber(object) { + if (Number.isSafeInteger(object) && !this.forceIntegerToFloat) { + if (object >= 0) { + if (object < 128) { + this.writeU8(object); + } else if (object < 256) { + this.writeU8(204); + this.writeU8(object); + } else if (object < 65536) { + this.writeU8(205); + this.writeU16(object); + } else if (object < 4294967296) { + this.writeU8(206); + this.writeU32(object); + } else { + this.writeU8(207); + this.writeU64(object); + } + } else { + if (object >= -32) { + this.writeU8(224 | object + 32); + } else if (object >= -128) { + this.writeU8(208); + this.writeI8(object); + } else if (object >= -32768) { + this.writeU8(209); + this.writeI16(object); + } else if (object >= -2147483648) { + this.writeU8(210); + this.writeI32(object); + } else { + this.writeU8(211); + this.writeI64(object); + } + } + } else { + if (this.forceFloat32) { + this.writeU8(202); + this.writeF32(object); + } else { + this.writeU8(203); + this.writeF64(object); + } + } + } + writeStringHeader(byteLength) { + if (byteLength < 32) { + this.writeU8(160 + byteLength); + } else if (byteLength < 256) { + this.writeU8(217); + this.writeU8(byteLength); + } else if (byteLength < 65536) { + this.writeU8(218); + this.writeU16(byteLength); + } else if (byteLength < 4294967296) { + this.writeU8(219); + this.writeU32(byteLength); + } else { + throw new Error(`Too long string: ${byteLength} bytes in UTF-8`); + } + } + encodeString(object) { + const maxHeaderSize = 1 + 4; + const strLength = object.length; + if (strLength > utf8_1.TEXT_ENCODER_THRESHOLD) { + const byteLength = (0, utf8_1.utf8Count)(object); + this.ensureBufferSizeToWrite(maxHeaderSize + byteLength); + this.writeStringHeader(byteLength); + (0, utf8_1.utf8EncodeTE)(object, this.bytes, this.pos); + this.pos += byteLength; + } else { + const byteLength = (0, utf8_1.utf8Count)(object); + this.ensureBufferSizeToWrite(maxHeaderSize + byteLength); + this.writeStringHeader(byteLength); + (0, utf8_1.utf8EncodeJs)(object, this.bytes, this.pos); + this.pos += byteLength; + } + } + encodeObject(object, depth) { + const ext = this.extensionCodec.tryToEncode(object, this.context); + if (ext != null) { + this.encodeExtension(ext); + } else if (Array.isArray(object)) { + this.encodeArray(object, depth); + } else if (ArrayBuffer.isView(object)) { + this.encodeBinary(object); + } else if (typeof object === "object") { + this.encodeMap(object, depth); + } else { + throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(object)}`); + } + } + encodeBinary(object) { + const size = object.byteLength; + if (size < 256) { + this.writeU8(196); + this.writeU8(size); + } else if (size < 65536) { + this.writeU8(197); + this.writeU16(size); + } else if (size < 4294967296) { + this.writeU8(198); + this.writeU32(size); + } else { + throw new Error(`Too large binary: ${size}`); + } + const bytes = (0, typedArrays_1.ensureUint8Array)(object); + this.writeU8a(bytes); + } + encodeArray(object, depth) { + const size = object.length; + if (size < 16) { + this.writeU8(144 + size); + } else if (size < 65536) { + this.writeU8(220); + this.writeU16(size); + } else if (size < 4294967296) { + this.writeU8(221); + this.writeU32(size); + } else { + throw new Error(`Too large array: ${size}`); + } + for (const item of object) { + this.doEncode(item, depth + 1); + } + } + countWithoutUndefined(object, keys) { + let count = 0; + for (const key of keys) { + if (object[key] !== void 0) { + count++; + } + } + return count; + } + encodeMap(object, depth) { + const keys = Object.keys(object); + if (this.sortKeys) { + keys.sort(); + } + const size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length; + if (size < 16) { + this.writeU8(128 + size); + } else if (size < 65536) { + this.writeU8(222); + this.writeU16(size); + } else if (size < 4294967296) { + this.writeU8(223); + this.writeU32(size); + } else { + throw new Error(`Too large map object: ${size}`); + } + for (const key of keys) { + const value = object[key]; + if (!(this.ignoreUndefined && value === void 0)) { + this.encodeString(key); + this.doEncode(value, depth + 1); + } + } + } + encodeExtension(ext) { + const size = ext.data.length; + if (size === 1) { + this.writeU8(212); + } else if (size === 2) { + this.writeU8(213); + } else if (size === 4) { + this.writeU8(214); + } else if (size === 8) { + this.writeU8(215); + } else if (size === 16) { + this.writeU8(216); + } else if (size < 256) { + this.writeU8(199); + this.writeU8(size); + } else if (size < 65536) { + this.writeU8(200); + this.writeU16(size); + } else if (size < 4294967296) { + this.writeU8(201); + this.writeU32(size); + } else { + throw new Error(`Too large extension object: ${size}`); + } + this.writeI8(ext.type); + this.writeU8a(ext.data); + } + writeU8(value) { + this.ensureBufferSizeToWrite(1); + this.view.setUint8(this.pos, value); + this.pos++; + } + writeU8a(values) { + const size = values.length; + this.ensureBufferSizeToWrite(size); + this.bytes.set(values, this.pos); + this.pos += size; + } + writeI8(value) { + this.ensureBufferSizeToWrite(1); + this.view.setInt8(this.pos, value); + this.pos++; + } + writeU16(value) { + this.ensureBufferSizeToWrite(2); + this.view.setUint16(this.pos, value); + this.pos += 2; + } + writeI16(value) { + this.ensureBufferSizeToWrite(2); + this.view.setInt16(this.pos, value); + this.pos += 2; + } + writeU32(value) { + this.ensureBufferSizeToWrite(4); + this.view.setUint32(this.pos, value); + this.pos += 4; + } + writeI32(value) { + this.ensureBufferSizeToWrite(4); + this.view.setInt32(this.pos, value); + this.pos += 4; + } + writeF32(value) { + this.ensureBufferSizeToWrite(4); + this.view.setFloat32(this.pos, value); + this.pos += 4; + } + writeF64(value) { + this.ensureBufferSizeToWrite(8); + this.view.setFloat64(this.pos, value); + this.pos += 8; + } + writeU64(value) { + this.ensureBufferSizeToWrite(8); + (0, int_1.setUint64)(this.view, this.pos, value); + this.pos += 8; + } + writeI64(value) { + this.ensureBufferSizeToWrite(8); + (0, int_1.setInt64)(this.view, this.pos, value); + this.pos += 8; + } + }; + exports.Encoder = Encoder; + } +}); + +// node_modules/@msgpack/msgpack/dist/encode.js +var require_encode = __commonJS({ + "node_modules/@msgpack/msgpack/dist/encode.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.encode = void 0; + var Encoder_1 = require_Encoder(); + var defaultEncodeOptions = {}; + function encode(value, options = defaultEncodeOptions) { + const encoder = new Encoder_1.Encoder(options.extensionCodec, options.context, options.maxDepth, options.initialBufferSize, options.sortKeys, options.forceFloat32, options.ignoreUndefined, options.forceIntegerToFloat); + return encoder.encodeSharedRef(value); + } + exports.encode = encode; + } +}); + +// node_modules/@msgpack/msgpack/dist/utils/prettyByte.js +var require_prettyByte = __commonJS({ + "node_modules/@msgpack/msgpack/dist/utils/prettyByte.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.prettyByte = void 0; + function prettyByte(byte) { + return `${byte < 0 ? "-" : ""}0x${Math.abs(byte).toString(16).padStart(2, "0")}`; + } + exports.prettyByte = prettyByte; + } +}); + +// node_modules/@msgpack/msgpack/dist/CachedKeyDecoder.js +var require_CachedKeyDecoder = __commonJS({ + "node_modules/@msgpack/msgpack/dist/CachedKeyDecoder.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CachedKeyDecoder = void 0; + var utf8_1 = require_utf8(); + var DEFAULT_MAX_KEY_LENGTH = 16; + var DEFAULT_MAX_LENGTH_PER_KEY = 16; + var CachedKeyDecoder = class { + constructor(maxKeyLength = DEFAULT_MAX_KEY_LENGTH, maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY) { + this.maxKeyLength = maxKeyLength; + this.maxLengthPerKey = maxLengthPerKey; + this.hit = 0; + this.miss = 0; + this.caches = []; + for (let i = 0; i < this.maxKeyLength; i++) { + this.caches.push([]); + } + } + canBeCached(byteLength) { + return byteLength > 0 && byteLength <= this.maxKeyLength; + } + find(bytes, inputOffset, byteLength) { + const records = this.caches[byteLength - 1]; + FIND_CHUNK: + for (const record of records) { + const recordBytes = record.bytes; + for (let j = 0; j < byteLength; j++) { + if (recordBytes[j] !== bytes[inputOffset + j]) { + continue FIND_CHUNK; + } + } + return record.str; + } + return null; + } + store(bytes, value) { + const records = this.caches[bytes.length - 1]; + const record = { bytes, str: value }; + if (records.length >= this.maxLengthPerKey) { + records[Math.random() * records.length | 0] = record; + } else { + records.push(record); + } + } + decode(bytes, inputOffset, byteLength) { + const cachedValue = this.find(bytes, inputOffset, byteLength); + if (cachedValue != null) { + this.hit++; + return cachedValue; + } + this.miss++; + const str = (0, utf8_1.utf8DecodeJs)(bytes, inputOffset, byteLength); + const slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength); + this.store(slicedCopyOfBytes, str); + return str; + } + }; + exports.CachedKeyDecoder = CachedKeyDecoder; + } +}); + +// node_modules/@msgpack/msgpack/dist/Decoder.js +var require_Decoder = __commonJS({ + "node_modules/@msgpack/msgpack/dist/Decoder.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Decoder = exports.DataViewIndexOutOfBoundsError = void 0; + var prettyByte_1 = require_prettyByte(); + var ExtensionCodec_1 = require_ExtensionCodec(); + var int_1 = require_int(); + var utf8_1 = require_utf8(); + var typedArrays_1 = require_typedArrays(); + var CachedKeyDecoder_1 = require_CachedKeyDecoder(); + var DecodeError_1 = require_DecodeError(); + var isValidMapKeyType = (key) => { + const keyType = typeof key; + return keyType === "string" || keyType === "number"; + }; + var HEAD_BYTE_REQUIRED = -1; + var EMPTY_VIEW = new DataView(new ArrayBuffer(0)); + var EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer); + exports.DataViewIndexOutOfBoundsError = (() => { + try { + EMPTY_VIEW.getInt8(0); + } catch (e) { + return e.constructor; + } + throw new Error("never reached"); + })(); + var MORE_DATA = new exports.DataViewIndexOutOfBoundsError("Insufficient data"); + var sharedCachedKeyDecoder = new CachedKeyDecoder_1.CachedKeyDecoder(); + var Decoder = class { + constructor(extensionCodec = ExtensionCodec_1.ExtensionCodec.defaultCodec, context = void 0, maxStrLength = int_1.UINT32_MAX, maxBinLength = int_1.UINT32_MAX, maxArrayLength = int_1.UINT32_MAX, maxMapLength = int_1.UINT32_MAX, maxExtLength = int_1.UINT32_MAX, keyDecoder = sharedCachedKeyDecoder) { + this.extensionCodec = extensionCodec; + this.context = context; + this.maxStrLength = maxStrLength; + this.maxBinLength = maxBinLength; + this.maxArrayLength = maxArrayLength; + this.maxMapLength = maxMapLength; + this.maxExtLength = maxExtLength; + this.keyDecoder = keyDecoder; + this.totalPos = 0; + this.pos = 0; + this.view = EMPTY_VIEW; + this.bytes = EMPTY_BYTES; + this.headByte = HEAD_BYTE_REQUIRED; + this.stack = []; + } + reinitializeState() { + this.totalPos = 0; + this.headByte = HEAD_BYTE_REQUIRED; + this.stack.length = 0; + } + setBuffer(buffer) { + this.bytes = (0, typedArrays_1.ensureUint8Array)(buffer); + this.view = (0, typedArrays_1.createDataView)(this.bytes); + this.pos = 0; + } + appendBuffer(buffer) { + if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining(1)) { + this.setBuffer(buffer); + } else { + const remainingData = this.bytes.subarray(this.pos); + const newData = (0, typedArrays_1.ensureUint8Array)(buffer); + const newBuffer = new Uint8Array(remainingData.length + newData.length); + newBuffer.set(remainingData); + newBuffer.set(newData, remainingData.length); + this.setBuffer(newBuffer); + } + } + hasRemaining(size) { + return this.view.byteLength - this.pos >= size; + } + createExtraByteError(posToShow) { + const { view, pos } = this; + return new RangeError(`Extra ${view.byteLength - pos} of ${view.byteLength} byte(s) found at buffer[${posToShow}]`); + } + /** + * @throws {@link DecodeError} + * @throws {@link RangeError} + */ + decode(buffer) { + this.reinitializeState(); + this.setBuffer(buffer); + const object = this.doDecodeSync(); + if (this.hasRemaining(1)) { + throw this.createExtraByteError(this.pos); + } + return object; + } + *decodeMulti(buffer) { + this.reinitializeState(); + this.setBuffer(buffer); + while (this.hasRemaining(1)) { + yield this.doDecodeSync(); + } + } + async decodeAsync(stream) { + let decoded = false; + let object; + for await (const buffer of stream) { + if (decoded) { + throw this.createExtraByteError(this.totalPos); + } + this.appendBuffer(buffer); + try { + object = this.doDecodeSync(); + decoded = true; + } catch (e) { + if (!(e instanceof exports.DataViewIndexOutOfBoundsError)) { + throw e; + } + } + this.totalPos += this.pos; + } + if (decoded) { + if (this.hasRemaining(1)) { + throw this.createExtraByteError(this.totalPos); + } + return object; + } + const { headByte, pos, totalPos } = this; + throw new RangeError(`Insufficient data in parsing ${(0, prettyByte_1.prettyByte)(headByte)} at ${totalPos} (${pos} in the current buffer)`); + } + decodeArrayStream(stream) { + return this.decodeMultiAsync(stream, true); + } + decodeStream(stream) { + return this.decodeMultiAsync(stream, false); + } + async *decodeMultiAsync(stream, isArray) { + let isArrayHeaderRequired = isArray; + let arrayItemsLeft = -1; + for await (const buffer of stream) { + if (isArray && arrayItemsLeft === 0) { + throw this.createExtraByteError(this.totalPos); + } + this.appendBuffer(buffer); + if (isArrayHeaderRequired) { + arrayItemsLeft = this.readArraySize(); + isArrayHeaderRequired = false; + this.complete(); + } + try { + while (true) { + yield this.doDecodeSync(); + if (--arrayItemsLeft === 0) { + break; + } + } + } catch (e) { + if (!(e instanceof exports.DataViewIndexOutOfBoundsError)) { + throw e; + } + } + this.totalPos += this.pos; + } + } + doDecodeSync() { + DECODE: + while (true) { + const headByte = this.readHeadByte(); + let object; + if (headByte >= 224) { + object = headByte - 256; + } else if (headByte < 192) { + if (headByte < 128) { + object = headByte; + } else if (headByte < 144) { + const size = headByte - 128; + if (size !== 0) { + this.pushMapState(size); + this.complete(); + continue DECODE; + } else { + object = {}; + } + } else if (headByte < 160) { + const size = headByte - 144; + if (size !== 0) { + this.pushArrayState(size); + this.complete(); + continue DECODE; + } else { + object = []; + } + } else { + const byteLength = headByte - 160; + object = this.decodeUtf8String(byteLength, 0); + } + } else if (headByte === 192) { + object = null; + } else if (headByte === 194) { + object = false; + } else if (headByte === 195) { + object = true; + } else if (headByte === 202) { + object = this.readF32(); + } else if (headByte === 203) { + object = this.readF64(); + } else if (headByte === 204) { + object = this.readU8(); + } else if (headByte === 205) { + object = this.readU16(); + } else if (headByte === 206) { + object = this.readU32(); + } else if (headByte === 207) { + object = this.readU64(); + } else if (headByte === 208) { + object = this.readI8(); + } else if (headByte === 209) { + object = this.readI16(); + } else if (headByte === 210) { + object = this.readI32(); + } else if (headByte === 211) { + object = this.readI64(); + } else if (headByte === 217) { + const byteLength = this.lookU8(); + object = this.decodeUtf8String(byteLength, 1); + } else if (headByte === 218) { + const byteLength = this.lookU16(); + object = this.decodeUtf8String(byteLength, 2); + } else if (headByte === 219) { + const byteLength = this.lookU32(); + object = this.decodeUtf8String(byteLength, 4); + } else if (headByte === 220) { + const size = this.readU16(); + if (size !== 0) { + this.pushArrayState(size); + this.complete(); + continue DECODE; + } else { + object = []; + } + } else if (headByte === 221) { + const size = this.readU32(); + if (size !== 0) { + this.pushArrayState(size); + this.complete(); + continue DECODE; + } else { + object = []; + } + } else if (headByte === 222) { + const size = this.readU16(); + if (size !== 0) { + this.pushMapState(size); + this.complete(); + continue DECODE; + } else { + object = {}; + } + } else if (headByte === 223) { + const size = this.readU32(); + if (size !== 0) { + this.pushMapState(size); + this.complete(); + continue DECODE; + } else { + object = {}; + } + } else if (headByte === 196) { + const size = this.lookU8(); + object = this.decodeBinary(size, 1); + } else if (headByte === 197) { + const size = this.lookU16(); + object = this.decodeBinary(size, 2); + } else if (headByte === 198) { + const size = this.lookU32(); + object = this.decodeBinary(size, 4); + } else if (headByte === 212) { + object = this.decodeExtension(1, 0); + } else if (headByte === 213) { + object = this.decodeExtension(2, 0); + } else if (headByte === 214) { + object = this.decodeExtension(4, 0); + } else if (headByte === 215) { + object = this.decodeExtension(8, 0); + } else if (headByte === 216) { + object = this.decodeExtension(16, 0); + } else if (headByte === 199) { + const size = this.lookU8(); + object = this.decodeExtension(size, 1); + } else if (headByte === 200) { + const size = this.lookU16(); + object = this.decodeExtension(size, 2); + } else if (headByte === 201) { + const size = this.lookU32(); + object = this.decodeExtension(size, 4); + } else { + throw new DecodeError_1.DecodeError(`Unrecognized type byte: ${(0, prettyByte_1.prettyByte)(headByte)}`); + } + this.complete(); + const stack = this.stack; + while (stack.length > 0) { + const state = stack[stack.length - 1]; + if (state.type === 0) { + state.array[state.position] = object; + state.position++; + if (state.position === state.size) { + stack.pop(); + object = state.array; + } else { + continue DECODE; + } + } else if (state.type === 1) { + if (!isValidMapKeyType(object)) { + throw new DecodeError_1.DecodeError("The type of key must be string or number but " + typeof object); + } + if (object === "__proto__") { + throw new DecodeError_1.DecodeError("The key __proto__ is not allowed"); + } + state.key = object; + state.type = 2; + continue DECODE; + } else { + state.map[state.key] = object; + state.readCount++; + if (state.readCount === state.size) { + stack.pop(); + object = state.map; + } else { + state.key = null; + state.type = 1; + continue DECODE; + } + } + } + return object; + } + } + readHeadByte() { + if (this.headByte === HEAD_BYTE_REQUIRED) { + this.headByte = this.readU8(); + } + return this.headByte; + } + complete() { + this.headByte = HEAD_BYTE_REQUIRED; + } + readArraySize() { + const headByte = this.readHeadByte(); + switch (headByte) { + case 220: + return this.readU16(); + case 221: + return this.readU32(); + default: { + if (headByte < 160) { + return headByte - 144; + } else { + throw new DecodeError_1.DecodeError(`Unrecognized array type byte: ${(0, prettyByte_1.prettyByte)(headByte)}`); + } + } + } + } + pushMapState(size) { + if (size > this.maxMapLength) { + throw new DecodeError_1.DecodeError(`Max length exceeded: map length (${size}) > maxMapLengthLength (${this.maxMapLength})`); + } + this.stack.push({ + type: 1, + size, + key: null, + readCount: 0, + map: {} + }); + } + pushArrayState(size) { + if (size > this.maxArrayLength) { + throw new DecodeError_1.DecodeError(`Max length exceeded: array length (${size}) > maxArrayLength (${this.maxArrayLength})`); + } + this.stack.push({ + type: 0, + size, + array: new Array(size), + position: 0 + }); + } + decodeUtf8String(byteLength, headerOffset) { + var _a; + if (byteLength > this.maxStrLength) { + throw new DecodeError_1.DecodeError(`Max length exceeded: UTF-8 byte length (${byteLength}) > maxStrLength (${this.maxStrLength})`); + } + if (this.bytes.byteLength < this.pos + headerOffset + byteLength) { + throw MORE_DATA; + } + const offset = this.pos + headerOffset; + let object; + if (this.stateIsMapKey() && ((_a = this.keyDecoder) === null || _a === void 0 ? void 0 : _a.canBeCached(byteLength))) { + object = this.keyDecoder.decode(this.bytes, offset, byteLength); + } else if (byteLength > utf8_1.TEXT_DECODER_THRESHOLD) { + object = (0, utf8_1.utf8DecodeTD)(this.bytes, offset, byteLength); + } else { + object = (0, utf8_1.utf8DecodeJs)(this.bytes, offset, byteLength); + } + this.pos += headerOffset + byteLength; + return object; + } + stateIsMapKey() { + if (this.stack.length > 0) { + const state = this.stack[this.stack.length - 1]; + return state.type === 1; + } + return false; + } + decodeBinary(byteLength, headOffset) { + if (byteLength > this.maxBinLength) { + throw new DecodeError_1.DecodeError(`Max length exceeded: bin length (${byteLength}) > maxBinLength (${this.maxBinLength})`); + } + if (!this.hasRemaining(byteLength + headOffset)) { + throw MORE_DATA; + } + const offset = this.pos + headOffset; + const object = this.bytes.subarray(offset, offset + byteLength); + this.pos += headOffset + byteLength; + return object; + } + decodeExtension(size, headOffset) { + if (size > this.maxExtLength) { + throw new DecodeError_1.DecodeError(`Max length exceeded: ext length (${size}) > maxExtLength (${this.maxExtLength})`); + } + const extType = this.view.getInt8(this.pos + headOffset); + const data = this.decodeBinary( + size, + headOffset + 1 + /* extType */ + ); + return this.extensionCodec.decode(data, extType, this.context); + } + lookU8() { + return this.view.getUint8(this.pos); + } + lookU16() { + return this.view.getUint16(this.pos); + } + lookU32() { + return this.view.getUint32(this.pos); + } + readU8() { + const value = this.view.getUint8(this.pos); + this.pos++; + return value; + } + readI8() { + const value = this.view.getInt8(this.pos); + this.pos++; + return value; + } + readU16() { + const value = this.view.getUint16(this.pos); + this.pos += 2; + return value; + } + readI16() { + const value = this.view.getInt16(this.pos); + this.pos += 2; + return value; + } + readU32() { + const value = this.view.getUint32(this.pos); + this.pos += 4; + return value; + } + readI32() { + const value = this.view.getInt32(this.pos); + this.pos += 4; + return value; + } + readU64() { + const value = (0, int_1.getUint64)(this.view, this.pos); + this.pos += 8; + return value; + } + readI64() { + const value = (0, int_1.getInt64)(this.view, this.pos); + this.pos += 8; + return value; + } + readF32() { + const value = this.view.getFloat32(this.pos); + this.pos += 4; + return value; + } + readF64() { + const value = this.view.getFloat64(this.pos); + this.pos += 8; + return value; + } + }; + exports.Decoder = Decoder; + } +}); + +// node_modules/@msgpack/msgpack/dist/decode.js +var require_decode = __commonJS({ + "node_modules/@msgpack/msgpack/dist/decode.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.decodeMulti = exports.decode = exports.defaultDecodeOptions = void 0; + var Decoder_1 = require_Decoder(); + exports.defaultDecodeOptions = {}; + function decode(buffer, options = exports.defaultDecodeOptions) { + const decoder = new Decoder_1.Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); + return decoder.decode(buffer); + } + exports.decode = decode; + function decodeMulti(buffer, options = exports.defaultDecodeOptions) { + const decoder = new Decoder_1.Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); + return decoder.decodeMulti(buffer); + } + exports.decodeMulti = decodeMulti; + } +}); + +// node_modules/@msgpack/msgpack/dist/utils/stream.js +var require_stream = __commonJS({ + "node_modules/@msgpack/msgpack/dist/utils/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ensureAsyncIterable = exports.asyncIterableFromStream = exports.isAsyncIterable = void 0; + function isAsyncIterable(object) { + return object[Symbol.asyncIterator] != null; + } + exports.isAsyncIterable = isAsyncIterable; + function assertNonNull(value) { + if (value == null) { + throw new Error("Assertion Failure: value must not be null nor undefined"); + } + } + async function* asyncIterableFromStream(stream) { + const reader = stream.getReader(); + try { + while (true) { + const { done, value } = await reader.read(); + if (done) { + return; + } + assertNonNull(value); + yield value; + } + } finally { + reader.releaseLock(); + } + } + exports.asyncIterableFromStream = asyncIterableFromStream; + function ensureAsyncIterable(streamLike) { + if (isAsyncIterable(streamLike)) { + return streamLike; + } else { + return asyncIterableFromStream(streamLike); + } + } + exports.ensureAsyncIterable = ensureAsyncIterable; + } +}); + +// node_modules/@msgpack/msgpack/dist/decodeAsync.js +var require_decodeAsync = __commonJS({ + "node_modules/@msgpack/msgpack/dist/decodeAsync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.decodeStream = exports.decodeMultiStream = exports.decodeArrayStream = exports.decodeAsync = void 0; + var Decoder_1 = require_Decoder(); + var stream_1 = require_stream(); + var decode_1 = require_decode(); + async function decodeAsync(streamLike, options = decode_1.defaultDecodeOptions) { + const stream = (0, stream_1.ensureAsyncIterable)(streamLike); + const decoder = new Decoder_1.Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); + return decoder.decodeAsync(stream); + } + exports.decodeAsync = decodeAsync; + function decodeArrayStream(streamLike, options = decode_1.defaultDecodeOptions) { + const stream = (0, stream_1.ensureAsyncIterable)(streamLike); + const decoder = new Decoder_1.Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); + return decoder.decodeArrayStream(stream); + } + exports.decodeArrayStream = decodeArrayStream; + function decodeMultiStream(streamLike, options = decode_1.defaultDecodeOptions) { + const stream = (0, stream_1.ensureAsyncIterable)(streamLike); + const decoder = new Decoder_1.Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); + return decoder.decodeStream(stream); + } + exports.decodeMultiStream = decodeMultiStream; + function decodeStream(streamLike, options = decode_1.defaultDecodeOptions) { + return decodeMultiStream(streamLike, options); + } + exports.decodeStream = decodeStream; + } +}); + +// node_modules/@msgpack/msgpack/dist/index.js +var require_dist = __commonJS({ + "node_modules/@msgpack/msgpack/dist/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.decodeTimestampExtension = exports.encodeTimestampExtension = exports.decodeTimestampToTimeSpec = exports.encodeTimeSpecToTimestamp = exports.encodeDateToTimeSpec = exports.EXT_TIMESTAMP = exports.ExtData = exports.ExtensionCodec = exports.Encoder = exports.DataViewIndexOutOfBoundsError = exports.DecodeError = exports.Decoder = exports.decodeStream = exports.decodeMultiStream = exports.decodeArrayStream = exports.decodeAsync = exports.decodeMulti = exports.decode = exports.encode = void 0; + var encode_1 = require_encode(); + Object.defineProperty(exports, "encode", { enumerable: true, get: function() { + return encode_1.encode; + } }); + var decode_1 = require_decode(); + Object.defineProperty(exports, "decode", { enumerable: true, get: function() { + return decode_1.decode; + } }); + Object.defineProperty(exports, "decodeMulti", { enumerable: true, get: function() { + return decode_1.decodeMulti; + } }); + var decodeAsync_1 = require_decodeAsync(); + Object.defineProperty(exports, "decodeAsync", { enumerable: true, get: function() { + return decodeAsync_1.decodeAsync; + } }); + Object.defineProperty(exports, "decodeArrayStream", { enumerable: true, get: function() { + return decodeAsync_1.decodeArrayStream; + } }); + Object.defineProperty(exports, "decodeMultiStream", { enumerable: true, get: function() { + return decodeAsync_1.decodeMultiStream; + } }); + Object.defineProperty(exports, "decodeStream", { enumerable: true, get: function() { + return decodeAsync_1.decodeStream; + } }); + var Decoder_1 = require_Decoder(); + Object.defineProperty(exports, "Decoder", { enumerable: true, get: function() { + return Decoder_1.Decoder; + } }); + Object.defineProperty(exports, "DataViewIndexOutOfBoundsError", { enumerable: true, get: function() { + return Decoder_1.DataViewIndexOutOfBoundsError; + } }); + var DecodeError_1 = require_DecodeError(); + Object.defineProperty(exports, "DecodeError", { enumerable: true, get: function() { + return DecodeError_1.DecodeError; + } }); + var Encoder_1 = require_Encoder(); + Object.defineProperty(exports, "Encoder", { enumerable: true, get: function() { + return Encoder_1.Encoder; + } }); + var ExtensionCodec_1 = require_ExtensionCodec(); + Object.defineProperty(exports, "ExtensionCodec", { enumerable: true, get: function() { + return ExtensionCodec_1.ExtensionCodec; + } }); + var ExtData_1 = require_ExtData(); + Object.defineProperty(exports, "ExtData", { enumerable: true, get: function() { + return ExtData_1.ExtData; + } }); + var timestamp_1 = require_timestamp(); + Object.defineProperty(exports, "EXT_TIMESTAMP", { enumerable: true, get: function() { + return timestamp_1.EXT_TIMESTAMP; + } }); + Object.defineProperty(exports, "encodeDateToTimeSpec", { enumerable: true, get: function() { + return timestamp_1.encodeDateToTimeSpec; + } }); + Object.defineProperty(exports, "encodeTimeSpecToTimestamp", { enumerable: true, get: function() { + return timestamp_1.encodeTimeSpecToTimestamp; + } }); + Object.defineProperty(exports, "decodeTimestampToTimeSpec", { enumerable: true, get: function() { + return timestamp_1.decodeTimestampToTimeSpec; + } }); + Object.defineProperty(exports, "encodeTimestampExtension", { enumerable: true, get: function() { + return timestamp_1.encodeTimestampExtension; + } }); + Object.defineProperty(exports, "decodeTimestampExtension", { enumerable: true, get: function() { + return timestamp_1.decodeTimestampExtension; + } }); + } +}); + +// node_modules/neovim/lib/utils/util.js +var require_util = __commonJS({ + "node_modules/neovim/lib/utils/util.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.partialClone = partialClone; + function partialClone(obj, depth = 3, omitKeys = [], replacement = void 0) { + if (typeof obj !== "object" || obj === null || Object.getOwnPropertyNames(obj).length === 0) { + return obj; + } + const clonedObj = Array.isArray(obj) ? [] : {}; + if (depth === 0) { + return replacement || clonedObj; + } + for (const key of Object.keys(obj)) { + if (omitKeys.includes(key)) { + clonedObj[key] = replacement || (Array.isArray(obj) ? [] : {}); + } else if (Object.prototype.hasOwnProperty.call(obj, key)) { + clonedObj[key] = partialClone(obj[key], depth - 1, omitKeys, replacement); + } + } + return clonedObj; + } + } +}); + +// node_modules/logform/format.js +var require_format = __commonJS({ + "node_modules/logform/format.js"(exports, module2) { + "use strict"; + var InvalidFormatError = class extends Error { + constructor(formatFn) { + super(`Format functions must be synchronous taking a two arguments: (info, opts) +Found: ${formatFn.toString().split("\n")[0]} +`); + Error.captureStackTrace(this, InvalidFormatError); + } + }; + module2.exports = (formatFn) => { + if (formatFn.length > 2) { + throw new InvalidFormatError(formatFn); + } + function Format(options = {}) { + this.options = options; + } + Format.prototype.transform = formatFn; + function createFormatWrap(opts) { + return new Format(opts); + } + createFormatWrap.Format = Format; + return createFormatWrap; + }; + } +}); + +// node_modules/@colors/colors/lib/styles.js +var require_styles = __commonJS({ + "node_modules/@colors/colors/lib/styles.js"(exports, module2) { + var styles = {}; + module2["exports"] = styles; + var codes = { + reset: [0, 0], + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [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], + gray: [90, 39], + grey: [90, 39], + brightRed: [91, 39], + brightGreen: [92, 39], + brightYellow: [93, 39], + brightBlue: [94, 39], + brightMagenta: [95, 39], + brightCyan: [96, 39], + brightWhite: [97, 39], + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + bgGray: [100, 49], + bgGrey: [100, 49], + bgBrightRed: [101, 49], + bgBrightGreen: [102, 49], + bgBrightYellow: [103, 49], + bgBrightBlue: [104, 49], + bgBrightMagenta: [105, 49], + bgBrightCyan: [106, 49], + bgBrightWhite: [107, 49], + // legacy styles for colors pre v1.0.0 + blackBG: [40, 49], + redBG: [41, 49], + greenBG: [42, 49], + yellowBG: [43, 49], + blueBG: [44, 49], + magentaBG: [45, 49], + cyanBG: [46, 49], + whiteBG: [47, 49] + }; + Object.keys(codes).forEach(function(key) { + var val = codes[key]; + var style = styles[key] = []; + style.open = "\x1B[" + val[0] + "m"; + style.close = "\x1B[" + val[1] + "m"; + }); + } +}); + +// node_modules/@colors/colors/lib/system/has-flag.js +var require_has_flag = __commonJS({ + "node_modules/@colors/colors/lib/system/has-flag.js"(exports, module2) { + "use strict"; + module2.exports = function(flag, argv) { + argv = argv || process.argv || []; + var terminatorPos = argv.indexOf("--"); + var prefix = /^-{1,2}/.test(flag) ? "" : "--"; + var pos = argv.indexOf(prefix + flag); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); + }; + } +}); + +// node_modules/@colors/colors/lib/system/supports-colors.js +var require_supports_colors = __commonJS({ + "node_modules/@colors/colors/lib/system/supports-colors.js"(exports, module2) { + "use strict"; + var os2 = require("os"); + var hasFlag = require_has_flag(); + var env = process.env; + var forceColor = void 0; + if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) { + forceColor = false; + } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + forceColor = true; + } + if ("FORCE_COLOR" in env) { + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; + } + function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; + } + function supportsColor(stream) { + if (forceColor === false) { + return 0; + } + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; + } + if (hasFlag("color=256")) { + return 2; + } + if (stream && !stream.isTTY && forceColor !== true) { + return 0; + } + var min = forceColor ? 1 : 0; + if (process.platform === "win32") { + var osRelease = os2.release().split("."); + if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + return 1; + } + if ("CI" in env) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(sign) { + return sign in env; + }) || env.CI_NAME === "codeship") { + return 1; + } + return min; + } + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + if ("TERM_PROGRAM" in env) { + var version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env.TERM_PROGRAM) { + case "iTerm.app": + return version >= 3 ? 3 : 2; + case "Hyper": + return 3; + case "Apple_Terminal": + return 2; + } + } + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + if ("COLORTERM" in env) { + return 1; + } + if (env.TERM === "dumb") { + return min; + } + return min; + } + function getSupportLevel(stream) { + var level = supportsColor(stream); + return translateLevel(level); + } + module2.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) + }; + } +}); + +// node_modules/@colors/colors/lib/custom/trap.js +var require_trap = __commonJS({ + "node_modules/@colors/colors/lib/custom/trap.js"(exports, module2) { + module2["exports"] = function runTheTrap(text, options) { + var result2 = ""; + text = text || "Run the trap, drop the bass"; + text = text.split(""); + var trap = { + a: ["@", "\u0104", "\u023A", "\u0245", "\u0394", "\u039B", "\u0414"], + b: ["\xDF", "\u0181", "\u0243", "\u026E", "\u03B2", "\u0E3F"], + c: ["\xA9", "\u023B", "\u03FE"], + d: ["\xD0", "\u018A", "\u0500", "\u0501", "\u0502", "\u0503"], + e: [ + "\xCB", + "\u0115", + "\u018E", + "\u0258", + "\u03A3", + "\u03BE", + "\u04BC", + "\u0A6C" + ], + f: ["\u04FA"], + g: ["\u0262"], + h: ["\u0126", "\u0195", "\u04A2", "\u04BA", "\u04C7", "\u050A"], + i: ["\u0F0F"], + j: ["\u0134"], + k: ["\u0138", "\u04A0", "\u04C3", "\u051E"], + l: ["\u0139"], + m: ["\u028D", "\u04CD", "\u04CE", "\u0520", "\u0521", "\u0D69"], + n: ["\xD1", "\u014B", "\u019D", "\u0376", "\u03A0", "\u048A"], + o: [ + "\xD8", + "\xF5", + "\xF8", + "\u01FE", + "\u0298", + "\u047A", + "\u05DD", + "\u06DD", + "\u0E4F" + ], + p: ["\u01F7", "\u048E"], + q: ["\u09CD"], + r: ["\xAE", "\u01A6", "\u0210", "\u024C", "\u0280", "\u042F"], + s: ["\xA7", "\u03DE", "\u03DF", "\u03E8"], + t: ["\u0141", "\u0166", "\u0373"], + u: ["\u01B1", "\u054D"], + v: ["\u05D8"], + w: ["\u0428", "\u0460", "\u047C", "\u0D70"], + x: ["\u04B2", "\u04FE", "\u04FC", "\u04FD"], + y: ["\xA5", "\u04B0", "\u04CB"], + z: ["\u01B5", "\u0240"] + }; + text.forEach(function(c) { + c = c.toLowerCase(); + var chars = trap[c] || [" "]; + var rand = Math.floor(Math.random() * chars.length); + if (typeof trap[c] !== "undefined") { + result2 += trap[c][rand]; + } else { + result2 += c; + } + }); + return result2; + }; + } +}); + +// node_modules/@colors/colors/lib/custom/zalgo.js +var require_zalgo = __commonJS({ + "node_modules/@colors/colors/lib/custom/zalgo.js"(exports, module2) { + module2["exports"] = function zalgo(text, options) { + text = text || " he is here "; + var soul = { + "up": [ + "\u030D", + "\u030E", + "\u0304", + "\u0305", + "\u033F", + "\u0311", + "\u0306", + "\u0310", + "\u0352", + "\u0357", + "\u0351", + "\u0307", + "\u0308", + "\u030A", + "\u0342", + "\u0313", + "\u0308", + "\u034A", + "\u034B", + "\u034C", + "\u0303", + "\u0302", + "\u030C", + "\u0350", + "\u0300", + "\u0301", + "\u030B", + "\u030F", + "\u0312", + "\u0313", + "\u0314", + "\u033D", + "\u0309", + "\u0363", + "\u0364", + "\u0365", + "\u0366", + "\u0367", + "\u0368", + "\u0369", + "\u036A", + "\u036B", + "\u036C", + "\u036D", + "\u036E", + "\u036F", + "\u033E", + "\u035B", + "\u0346", + "\u031A" + ], + "down": [ + "\u0316", + "\u0317", + "\u0318", + "\u0319", + "\u031C", + "\u031D", + "\u031E", + "\u031F", + "\u0320", + "\u0324", + "\u0325", + "\u0326", + "\u0329", + "\u032A", + "\u032B", + "\u032C", + "\u032D", + "\u032E", + "\u032F", + "\u0330", + "\u0331", + "\u0332", + "\u0333", + "\u0339", + "\u033A", + "\u033B", + "\u033C", + "\u0345", + "\u0347", + "\u0348", + "\u0349", + "\u034D", + "\u034E", + "\u0353", + "\u0354", + "\u0355", + "\u0356", + "\u0359", + "\u035A", + "\u0323" + ], + "mid": [ + "\u0315", + "\u031B", + "\u0300", + "\u0301", + "\u0358", + "\u0321", + "\u0322", + "\u0327", + "\u0328", + "\u0334", + "\u0335", + "\u0336", + "\u035C", + "\u035D", + "\u035E", + "\u035F", + "\u0360", + "\u0362", + "\u0338", + "\u0337", + "\u0361", + " \u0489" + ] + }; + var all = [].concat(soul.up, soul.down, soul.mid); + function randomNumber(range) { + var r = Math.floor(Math.random() * range); + return r; + } + function isChar(character) { + var bool = false; + all.filter(function(i) { + bool = i === character; + }); + return bool; + } + function heComes(text2, options2) { + var result2 = ""; + var counts; + var l; + options2 = options2 || {}; + options2["up"] = typeof options2["up"] !== "undefined" ? options2["up"] : true; + options2["mid"] = typeof options2["mid"] !== "undefined" ? options2["mid"] : true; + options2["down"] = typeof options2["down"] !== "undefined" ? options2["down"] : true; + options2["size"] = typeof options2["size"] !== "undefined" ? options2["size"] : "maxi"; + text2 = text2.split(""); + for (l in text2) { + if (isChar(l)) { + continue; + } + result2 = result2 + text2[l]; + counts = { "up": 0, "down": 0, "mid": 0 }; + switch (options2.size) { + case "mini": + counts.up = randomNumber(8); + counts.mid = randomNumber(2); + counts.down = randomNumber(8); + break; + case "maxi": + counts.up = randomNumber(16) + 3; + counts.mid = randomNumber(4) + 1; + counts.down = randomNumber(64) + 3; + break; + default: + counts.up = randomNumber(8) + 1; + counts.mid = randomNumber(6) / 2; + counts.down = randomNumber(8) + 1; + break; + } + var arr = ["up", "mid", "down"]; + for (var d in arr) { + var index = arr[d]; + for (var i = 0; i <= counts[index]; i++) { + if (options2[index]) { + result2 = result2 + soul[index][randomNumber(soul[index].length)]; + } + } + } + } + return result2; + } + return heComes(text, options); + }; + } +}); + +// node_modules/@colors/colors/lib/maps/america.js +var require_america = __commonJS({ + "node_modules/@colors/colors/lib/maps/america.js"(exports, module2) { + module2["exports"] = function(colors) { + return function(letter, i, exploded) { + if (letter === " ") + return letter; + switch (i % 3) { + case 0: + return colors.red(letter); + case 1: + return colors.white(letter); + case 2: + return colors.blue(letter); + } + }; + }; + } +}); + +// node_modules/@colors/colors/lib/maps/zebra.js +var require_zebra = __commonJS({ + "node_modules/@colors/colors/lib/maps/zebra.js"(exports, module2) { + module2["exports"] = function(colors) { + return function(letter, i, exploded) { + return i % 2 === 0 ? letter : colors.inverse(letter); + }; + }; + } +}); + +// node_modules/@colors/colors/lib/maps/rainbow.js +var require_rainbow = __commonJS({ + "node_modules/@colors/colors/lib/maps/rainbow.js"(exports, module2) { + module2["exports"] = function(colors) { + var rainbowColors = ["red", "yellow", "green", "blue", "magenta"]; + return function(letter, i, exploded) { + if (letter === " ") { + return letter; + } else { + return colors[rainbowColors[i++ % rainbowColors.length]](letter); + } + }; + }; + } +}); + +// node_modules/@colors/colors/lib/maps/random.js +var require_random = __commonJS({ + "node_modules/@colors/colors/lib/maps/random.js"(exports, module2) { + module2["exports"] = function(colors) { + var available = [ + "underline", + "inverse", + "grey", + "yellow", + "red", + "green", + "blue", + "white", + "cyan", + "magenta", + "brightYellow", + "brightRed", + "brightGreen", + "brightBlue", + "brightWhite", + "brightCyan", + "brightMagenta" + ]; + return function(letter, i, exploded) { + return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 2))]](letter); + }; + }; + } +}); + +// node_modules/@colors/colors/lib/colors.js +var require_colors = __commonJS({ + "node_modules/@colors/colors/lib/colors.js"(exports, module2) { + var colors = {}; + module2["exports"] = colors; + colors.themes = {}; + var util = require("util"); + var ansiStyles = colors.styles = require_styles(); + var defineProps = Object.defineProperties; + var newLineRegex = new RegExp(/[\r\n]+/g); + colors.supportsColor = require_supports_colors().supportsColor; + if (typeof colors.enabled === "undefined") { + colors.enabled = colors.supportsColor() !== false; + } + colors.enable = function() { + colors.enabled = true; + }; + colors.disable = function() { + colors.enabled = false; + }; + colors.stripColors = colors.strip = function(str) { + return ("" + str).replace(/\x1B\[\d+m/g, ""); + }; + var stylize = colors.stylize = function stylize2(str, style) { + if (!colors.enabled) { + return str + ""; + } + var styleMap = ansiStyles[style]; + if (!styleMap && style in colors) { + return colors[style](str); + } + return styleMap.open + str + styleMap.close; + }; + var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; + var escapeStringRegexp = function(str) { + if (typeof str !== "string") { + throw new TypeError("Expected a string"); + } + return str.replace(matchOperatorsRe, "\\$&"); + }; + function build(_styles) { + var builder = function builder2() { + return applyStyle.apply(builder2, arguments); + }; + builder._styles = _styles; + builder.__proto__ = proto; + return builder; + } + var styles = function() { + var ret = {}; + ansiStyles.grey = ansiStyles.gray; + Object.keys(ansiStyles).forEach(function(key) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g"); + ret[key] = { + get: function() { + return build(this._styles.concat(key)); + } + }; + }); + return ret; + }(); + var proto = defineProps(function colors2() { + }, styles); + function applyStyle() { + var args = Array.prototype.slice.call(arguments); + var str = args.map(function(arg) { + if (arg != null && arg.constructor === String) { + return arg; + } else { + return util.inspect(arg); + } + }).join(" "); + if (!colors.enabled || !str) { + return str; + } + var newLinesPresent = str.indexOf("\n") != -1; + var nestedStyles = this._styles; + var i = nestedStyles.length; + while (i--) { + var code = ansiStyles[nestedStyles[i]]; + str = code.open + str.replace(code.closeRe, code.open) + code.close; + if (newLinesPresent) { + str = str.replace(newLineRegex, function(match) { + return code.close + match + code.open; + }); + } + } + return str; + } + colors.setTheme = function(theme) { + if (typeof theme === "string") { + console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));"); + return; + } + for (var style in theme) { + (function(style2) { + colors[style2] = function(str) { + if (typeof theme[style2] === "object") { + var out = str; + for (var i in theme[style2]) { + out = colors[theme[style2][i]](out); + } + return out; + } + return colors[theme[style2]](str); + }; + })(style); + } + }; + function init() { + var ret = {}; + Object.keys(styles).forEach(function(name) { + ret[name] = { + get: function() { + return build([name]); + } + }; + }); + return ret; + } + var sequencer = function sequencer2(map2, str) { + var exploded = str.split(""); + exploded = exploded.map(map2); + return exploded.join(""); + }; + colors.trap = require_trap(); + colors.zalgo = require_zalgo(); + colors.maps = {}; + colors.maps.america = require_america()(colors); + colors.maps.zebra = require_zebra()(colors); + colors.maps.rainbow = require_rainbow()(colors); + colors.maps.random = require_random()(colors); + for (map in colors.maps) { + (function(map2) { + colors[map2] = function(str) { + return sequencer(colors.maps[map2], str); + }; + })(map); + } + var map; + defineProps(colors, init()); + } +}); + +// node_modules/@colors/colors/safe.js +var require_safe = __commonJS({ + "node_modules/@colors/colors/safe.js"(exports, module2) { + var colors = require_colors(); + module2["exports"] = colors; + } +}); + +// node_modules/triple-beam/config/cli.js +var require_cli = __commonJS({ + "node_modules/triple-beam/config/cli.js"(exports) { + "use strict"; + exports.levels = { + error: 0, + warn: 1, + help: 2, + data: 3, + info: 4, + debug: 5, + prompt: 6, + verbose: 7, + input: 8, + silly: 9 + }; + exports.colors = { + error: "red", + warn: "yellow", + help: "cyan", + data: "grey", + info: "green", + debug: "blue", + prompt: "grey", + verbose: "cyan", + input: "grey", + silly: "magenta" + }; + } +}); + +// node_modules/triple-beam/config/npm.js +var require_npm = __commonJS({ + "node_modules/triple-beam/config/npm.js"(exports) { + "use strict"; + exports.levels = { + error: 0, + warn: 1, + info: 2, + http: 3, + verbose: 4, + debug: 5, + silly: 6 + }; + exports.colors = { + error: "red", + warn: "yellow", + info: "green", + http: "green", + verbose: "cyan", + debug: "blue", + silly: "magenta" + }; + } +}); + +// node_modules/triple-beam/config/syslog.js +var require_syslog = __commonJS({ + "node_modules/triple-beam/config/syslog.js"(exports) { + "use strict"; + exports.levels = { + emerg: 0, + alert: 1, + crit: 2, + error: 3, + warning: 4, + notice: 5, + info: 6, + debug: 7 + }; + exports.colors = { + emerg: "red", + alert: "yellow", + crit: "red", + error: "red", + warning: "red", + notice: "yellow", + info: "green", + debug: "blue" + }; + } +}); + +// node_modules/triple-beam/config/index.js +var require_config = __commonJS({ + "node_modules/triple-beam/config/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "cli", { + value: require_cli() + }); + Object.defineProperty(exports, "npm", { + value: require_npm() + }); + Object.defineProperty(exports, "syslog", { + value: require_syslog() + }); + } +}); + +// node_modules/triple-beam/index.js +var require_triple_beam = __commonJS({ + "node_modules/triple-beam/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "LEVEL", { + value: Symbol.for("level") + }); + Object.defineProperty(exports, "MESSAGE", { + value: Symbol.for("message") + }); + Object.defineProperty(exports, "SPLAT", { + value: Symbol.for("splat") + }); + Object.defineProperty(exports, "configs", { + value: require_config() + }); + } +}); + +// node_modules/logform/colorize.js +var require_colorize = __commonJS({ + "node_modules/logform/colorize.js"(exports, module2) { + "use strict"; + var colors = require_safe(); + var { LEVEL, MESSAGE } = require_triple_beam(); + colors.enabled = true; + var hasSpace = /\s+/; + var Colorizer = class { + constructor(opts = {}) { + if (opts.colors) { + this.addColors(opts.colors); + } + this.options = opts; + } + /* + * Adds the colors Object to the set of allColors + * known by the Colorizer + * + * @param {Object} colors Set of color mappings to add. + */ + static addColors(clrs) { + const nextColors = Object.keys(clrs).reduce((acc, level) => { + acc[level] = hasSpace.test(clrs[level]) ? clrs[level].split(hasSpace) : clrs[level]; + return acc; + }, {}); + Colorizer.allColors = Object.assign({}, Colorizer.allColors || {}, nextColors); + return Colorizer.allColors; + } + /* + * Adds the colors Object to the set of allColors + * known by the Colorizer + * + * @param {Object} colors Set of color mappings to add. + */ + addColors(clrs) { + return Colorizer.addColors(clrs); + } + /* + * function colorize (lookup, level, message) + * Performs multi-step colorization using @colors/colors/safe + */ + colorize(lookup, level, message) { + if (typeof message === "undefined") { + message = level; + } + if (!Array.isArray(Colorizer.allColors[lookup])) { + return colors[Colorizer.allColors[lookup]](message); + } + for (let i = 0, len = Colorizer.allColors[lookup].length; i < len; i++) { + message = colors[Colorizer.allColors[lookup][i]](message); + } + return message; + } + /* + * function transform (info, opts) + * Attempts to colorize the { level, message } of the given + * `logform` info object. + */ + transform(info, opts) { + if (opts.all && typeof info[MESSAGE] === "string") { + info[MESSAGE] = this.colorize(info[LEVEL], info.level, info[MESSAGE]); + } + if (opts.level || opts.all || !opts.message) { + info.level = this.colorize(info[LEVEL], info.level); + } + if (opts.all || opts.message) { + info.message = this.colorize(info[LEVEL], info.level, info.message); + } + return info; + } + }; + module2.exports = (opts) => new Colorizer(opts); + module2.exports.Colorizer = module2.exports.Format = Colorizer; + } +}); + +// node_modules/logform/levels.js +var require_levels = __commonJS({ + "node_modules/logform/levels.js"(exports, module2) { + "use strict"; + var { Colorizer } = require_colorize(); + module2.exports = (config) => { + Colorizer.addColors(config.colors || config); + return config; + }; + } +}); + +// node_modules/logform/align.js +var require_align = __commonJS({ + "node_modules/logform/align.js"(exports, module2) { + "use strict"; + var format = require_format(); + module2.exports = format((info) => { + info.message = ` ${info.message}`; + return info; + }); + } +}); + +// node_modules/logform/errors.js +var require_errors = __commonJS({ + "node_modules/logform/errors.js"(exports, module2) { + "use strict"; + var format = require_format(); + var { LEVEL, MESSAGE } = require_triple_beam(); + module2.exports = format((einfo, { stack, cause }) => { + if (einfo instanceof Error) { + const info = Object.assign({}, einfo, { + level: einfo.level, + [LEVEL]: einfo[LEVEL] || einfo.level, + message: einfo.message, + [MESSAGE]: einfo[MESSAGE] || einfo.message + }); + if (stack) + info.stack = einfo.stack; + if (cause) + info.cause = einfo.cause; + return info; + } + if (!(einfo.message instanceof Error)) + return einfo; + const err = einfo.message; + Object.assign(einfo, err); + einfo.message = err.message; + einfo[MESSAGE] = err.message; + if (stack) + einfo.stack = err.stack; + if (cause) + einfo.cause = err.cause; + return einfo; + }); + } +}); + +// node_modules/logform/pad-levels.js +var require_pad_levels = __commonJS({ + "node_modules/logform/pad-levels.js"(exports, module2) { + "use strict"; + var { configs, LEVEL, MESSAGE } = require_triple_beam(); + var Padder = class { + constructor(opts = { levels: configs.npm.levels }) { + this.paddings = Padder.paddingForLevels(opts.levels, opts.filler); + this.options = opts; + } + /** + * Returns the maximum length of keys in the specified `levels` Object. + * @param {Object} levels Set of all levels to calculate longest level against. + * @returns {Number} Maximum length of the longest level string. + */ + static getLongestLevel(levels) { + const lvls = Object.keys(levels).map((level) => level.length); + return Math.max(...lvls); + } + /** + * Returns the padding for the specified `level` assuming that the + * maximum length of all levels it's associated with is `maxLength`. + * @param {String} level Level to calculate padding for. + * @param {String} filler Repeatable text to use for padding. + * @param {Number} maxLength Length of the longest level + * @returns {String} Padding string for the `level` + */ + static paddingForLevel(level, filler, maxLength) { + const targetLen = maxLength + 1 - level.length; + const rep = Math.floor(targetLen / filler.length); + const padding = `${filler}${filler.repeat(rep)}`; + return padding.slice(0, targetLen); + } + /** + * Returns an object with the string paddings for the given `levels` + * using the specified `filler`. + * @param {Object} levels Set of all levels to calculate padding for. + * @param {String} filler Repeatable text to use for padding. + * @returns {Object} Mapping of level to desired padding. + */ + static paddingForLevels(levels, filler = " ") { + const maxLength = Padder.getLongestLevel(levels); + return Object.keys(levels).reduce((acc, level) => { + acc[level] = Padder.paddingForLevel(level, filler, maxLength); + return acc; + }, {}); + } + /** + * Prepends the padding onto the `message` based on the `LEVEL` of + * the `info`. This is based on the behavior of `winston@2` which also + * prepended the level onto the message. + * + * See: https://github.com/winstonjs/winston/blob/2.x/lib/winston/logger.js#L198-L201 + * + * @param {Info} info Logform info object + * @param {Object} opts Options passed along to this instance. + * @returns {Info} Modified logform info object. + */ + transform(info, opts) { + info.message = `${this.paddings[info[LEVEL]]}${info.message}`; + if (info[MESSAGE]) { + info[MESSAGE] = `${this.paddings[info[LEVEL]]}${info[MESSAGE]}`; + } + return info; + } + }; + module2.exports = (opts) => new Padder(opts); + module2.exports.Padder = module2.exports.Format = Padder; + } +}); + +// node_modules/logform/cli.js +var require_cli2 = __commonJS({ + "node_modules/logform/cli.js"(exports, module2) { + "use strict"; + var { Colorizer } = require_colorize(); + var { Padder } = require_pad_levels(); + var { configs, MESSAGE } = require_triple_beam(); + var CliFormat = class { + constructor(opts = {}) { + if (!opts.levels) { + opts.levels = configs.cli.levels; + } + this.colorizer = new Colorizer(opts); + this.padder = new Padder(opts); + this.options = opts; + } + /* + * function transform (info, opts) + * Attempts to both: + * 1. Pad the { level } + * 2. Colorize the { level, message } + * of the given `logform` info object depending on the `opts`. + */ + transform(info, opts) { + this.colorizer.transform( + this.padder.transform(info, opts), + opts + ); + info[MESSAGE] = `${info.level}:${info.message}`; + return info; + } + }; + module2.exports = (opts) => new CliFormat(opts); + module2.exports.Format = CliFormat; + } +}); + +// node_modules/logform/combine.js +var require_combine = __commonJS({ + "node_modules/logform/combine.js"(exports, module2) { + "use strict"; + var format = require_format(); + function cascade(formats) { + if (!formats.every(isValidFormat)) { + return; + } + return (info) => { + let obj = info; + for (let i = 0; i < formats.length; i++) { + obj = formats[i].transform(obj, formats[i].options); + if (!obj) { + return false; + } + } + return obj; + }; + } + function isValidFormat(fmt) { + if (typeof fmt.transform !== "function") { + throw new Error([ + "No transform function found on format. Did you create a format instance?", + "const myFormat = format(formatFn);", + "const instance = myFormat();" + ].join("\n")); + } + return true; + } + module2.exports = (...formats) => { + const combinedFormat = format(cascade(formats)); + const instance = combinedFormat(); + instance.Format = combinedFormat.Format; + return instance; + }; + module2.exports.cascade = cascade; + } +}); + +// node_modules/safe-stable-stringify/index.js +var require_safe_stable_stringify = __commonJS({ + "node_modules/safe-stable-stringify/index.js"(exports, module2) { + "use strict"; + var { hasOwnProperty } = Object.prototype; + var stringify = configure(); + stringify.configure = configure; + stringify.stringify = stringify; + stringify.default = stringify; + exports.stringify = stringify; + exports.configure = configure; + module2.exports = stringify; + var strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/; + function strEscape(str) { + if (str.length < 5e3 && !strEscapeSequencesRegExp.test(str)) { + return `"${str}"`; + } + return JSON.stringify(str); + } + function sort(array, comparator) { + if (array.length > 200 || comparator) { + return array.sort(comparator); + } + for (let i = 1; i < array.length; i++) { + const currentValue = array[i]; + let position = i; + while (position !== 0 && array[position - 1] > currentValue) { + array[position] = array[position - 1]; + position--; + } + array[position] = currentValue; + } + return array; + } + var typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor( + Object.getPrototypeOf( + Object.getPrototypeOf( + new Int8Array() + ) + ), + Symbol.toStringTag + ).get; + function isTypedArrayWithEntries(value) { + return typedArrayPrototypeGetSymbolToStringTag.call(value) !== void 0 && value.length !== 0; + } + function stringifyTypedArray(array, separator, maximumBreadth) { + if (array.length < maximumBreadth) { + maximumBreadth = array.length; + } + const whitespace = separator === "," ? "" : " "; + let res = `"0":${whitespace}${array[0]}`; + for (let i = 1; i < maximumBreadth; i++) { + res += `${separator}"${i}":${whitespace}${array[i]}`; + } + return res; + } + function getCircularValueOption(options) { + if (hasOwnProperty.call(options, "circularValue")) { + const circularValue = options.circularValue; + if (typeof circularValue === "string") { + return `"${circularValue}"`; + } + if (circularValue == null) { + return circularValue; + } + if (circularValue === Error || circularValue === TypeError) { + return { + toString() { + throw new TypeError("Converting circular structure to JSON"); + } + }; + } + throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined'); + } + return '"[Circular]"'; + } + function getDeterministicOption(options) { + let value; + if (hasOwnProperty.call(options, "deterministic")) { + value = options.deterministic; + if (typeof value !== "boolean" && typeof value !== "function") { + throw new TypeError('The "deterministic" argument must be of type boolean or comparator function'); + } + } + return value === void 0 ? true : value; + } + function getBooleanOption(options, key) { + let value; + if (hasOwnProperty.call(options, key)) { + value = options[key]; + if (typeof value !== "boolean") { + throw new TypeError(`The "${key}" argument must be of type boolean`); + } + } + return value === void 0 ? true : value; + } + function getPositiveIntegerOption(options, key) { + let value; + if (hasOwnProperty.call(options, key)) { + value = options[key]; + if (typeof value !== "number") { + throw new TypeError(`The "${key}" argument must be of type number`); + } + if (!Number.isInteger(value)) { + throw new TypeError(`The "${key}" argument must be an integer`); + } + if (value < 1) { + throw new RangeError(`The "${key}" argument must be >= 1`); + } + } + return value === void 0 ? Infinity : value; + } + function getItemCount(number) { + if (number === 1) { + return "1 item"; + } + return `${number} items`; + } + function getUniqueReplacerSet(replacerArray) { + const replacerSet = /* @__PURE__ */ new Set(); + for (const value of replacerArray) { + if (typeof value === "string" || typeof value === "number") { + replacerSet.add(String(value)); + } + } + return replacerSet; + } + function getStrictOption(options) { + if (hasOwnProperty.call(options, "strict")) { + const value = options.strict; + if (typeof value !== "boolean") { + throw new TypeError('The "strict" argument must be of type boolean'); + } + if (value) { + return (value2) => { + let message = `Object can not safely be stringified. Received type ${typeof value2}`; + if (typeof value2 !== "function") + message += ` (${value2.toString()})`; + throw new Error(message); + }; + } + } + } + function configure(options) { + options = { ...options }; + const fail = getStrictOption(options); + if (fail) { + if (options.bigint === void 0) { + options.bigint = false; + } + if (!("circularValue" in options)) { + options.circularValue = Error; + } + } + const circularValue = getCircularValueOption(options); + const bigint = getBooleanOption(options, "bigint"); + const deterministic = getDeterministicOption(options); + const comparator = typeof deterministic === "function" ? deterministic : void 0; + const maximumDepth = getPositiveIntegerOption(options, "maximumDepth"); + const maximumBreadth = getPositiveIntegerOption(options, "maximumBreadth"); + function stringifyFnReplacer(key, parent, stack, replacer, spacer, indentation) { + let value = parent[key]; + if (typeof value === "object" && value !== null && typeof value.toJSON === "function") { + value = value.toJSON(key); + } + value = replacer.call(parent, key, value); + switch (typeof value) { + case "string": + return strEscape(value); + case "object": { + if (value === null) { + return "null"; + } + if (stack.indexOf(value) !== -1) { + return circularValue; + } + let res = ""; + let join2 = ","; + const originalIndentation = indentation; + if (Array.isArray(value)) { + if (value.length === 0) { + return "[]"; + } + if (maximumDepth < stack.length + 1) { + return '"[Array]"'; + } + stack.push(value); + if (spacer !== "") { + indentation += spacer; + res += ` +${indentation}`; + join2 = `, +${indentation}`; + } + const maximumValuesToStringify = Math.min(value.length, maximumBreadth); + let i = 0; + for (; i < maximumValuesToStringify - 1; i++) { + const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += join2; + } + const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation); + res += tmp !== void 0 ? tmp : "null"; + if (value.length - 1 > maximumBreadth) { + const removedKeys = value.length - maximumBreadth - 1; + res += `${join2}"... ${getItemCount(removedKeys)} not stringified"`; + } + if (spacer !== "") { + res += ` +${originalIndentation}`; + } + stack.pop(); + return `[${res}]`; + } + let keys = Object.keys(value); + const keyLength = keys.length; + if (keyLength === 0) { + return "{}"; + } + if (maximumDepth < stack.length + 1) { + return '"[Object]"'; + } + let whitespace = ""; + let separator = ""; + if (spacer !== "") { + indentation += spacer; + join2 = `, +${indentation}`; + whitespace = " "; + } + const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth); + if (deterministic && !isTypedArrayWithEntries(value)) { + keys = sort(keys, comparator); + } + stack.push(value); + for (let i = 0; i < maximumPropertiesToStringify; i++) { + const key2 = keys[i]; + const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation); + if (tmp !== void 0) { + res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`; + separator = join2; + } + } + if (keyLength > maximumBreadth) { + const removedKeys = keyLength - maximumBreadth; + res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`; + separator = join2; + } + if (spacer !== "" && separator.length > 1) { + res = ` +${indentation}${res} +${originalIndentation}`; + } + stack.pop(); + return `{${res}}`; + } + case "number": + return isFinite(value) ? String(value) : fail ? fail(value) : "null"; + case "boolean": + return value === true ? "true" : "false"; + case "undefined": + return void 0; + case "bigint": + if (bigint) { + return String(value); + } + default: + return fail ? fail(value) : void 0; + } + } + function stringifyArrayReplacer(key, value, stack, replacer, spacer, indentation) { + if (typeof value === "object" && value !== null && typeof value.toJSON === "function") { + value = value.toJSON(key); + } + switch (typeof value) { + case "string": + return strEscape(value); + case "object": { + if (value === null) { + return "null"; + } + if (stack.indexOf(value) !== -1) { + return circularValue; + } + const originalIndentation = indentation; + let res = ""; + let join2 = ","; + if (Array.isArray(value)) { + if (value.length === 0) { + return "[]"; + } + if (maximumDepth < stack.length + 1) { + return '"[Array]"'; + } + stack.push(value); + if (spacer !== "") { + indentation += spacer; + res += ` +${indentation}`; + join2 = `, +${indentation}`; + } + const maximumValuesToStringify = Math.min(value.length, maximumBreadth); + let i = 0; + for (; i < maximumValuesToStringify - 1; i++) { + const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += join2; + } + const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation); + res += tmp !== void 0 ? tmp : "null"; + if (value.length - 1 > maximumBreadth) { + const removedKeys = value.length - maximumBreadth - 1; + res += `${join2}"... ${getItemCount(removedKeys)} not stringified"`; + } + if (spacer !== "") { + res += ` +${originalIndentation}`; + } + stack.pop(); + return `[${res}]`; + } + stack.push(value); + let whitespace = ""; + if (spacer !== "") { + indentation += spacer; + join2 = `, +${indentation}`; + whitespace = " "; + } + let separator = ""; + for (const key2 of replacer) { + const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation); + if (tmp !== void 0) { + res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`; + separator = join2; + } + } + if (spacer !== "" && separator.length > 1) { + res = ` +${indentation}${res} +${originalIndentation}`; + } + stack.pop(); + return `{${res}}`; + } + case "number": + return isFinite(value) ? String(value) : fail ? fail(value) : "null"; + case "boolean": + return value === true ? "true" : "false"; + case "undefined": + return void 0; + case "bigint": + if (bigint) { + return String(value); + } + default: + return fail ? fail(value) : void 0; + } + } + function stringifyIndent(key, value, stack, spacer, indentation) { + switch (typeof value) { + case "string": + return strEscape(value); + case "object": { + if (value === null) { + return "null"; + } + if (typeof value.toJSON === "function") { + value = value.toJSON(key); + if (typeof value !== "object") { + return stringifyIndent(key, value, stack, spacer, indentation); + } + if (value === null) { + return "null"; + } + } + if (stack.indexOf(value) !== -1) { + return circularValue; + } + const originalIndentation = indentation; + if (Array.isArray(value)) { + if (value.length === 0) { + return "[]"; + } + if (maximumDepth < stack.length + 1) { + return '"[Array]"'; + } + stack.push(value); + indentation += spacer; + let res2 = ` +${indentation}`; + const join3 = `, +${indentation}`; + const maximumValuesToStringify = Math.min(value.length, maximumBreadth); + let i = 0; + for (; i < maximumValuesToStringify - 1; i++) { + const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation); + res2 += tmp2 !== void 0 ? tmp2 : "null"; + res2 += join3; + } + const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation); + res2 += tmp !== void 0 ? tmp : "null"; + if (value.length - 1 > maximumBreadth) { + const removedKeys = value.length - maximumBreadth - 1; + res2 += `${join3}"... ${getItemCount(removedKeys)} not stringified"`; + } + res2 += ` +${originalIndentation}`; + stack.pop(); + return `[${res2}]`; + } + let keys = Object.keys(value); + const keyLength = keys.length; + if (keyLength === 0) { + return "{}"; + } + if (maximumDepth < stack.length + 1) { + return '"[Object]"'; + } + indentation += spacer; + const join2 = `, +${indentation}`; + let res = ""; + let separator = ""; + let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth); + if (isTypedArrayWithEntries(value)) { + res += stringifyTypedArray(value, join2, maximumBreadth); + keys = keys.slice(value.length); + maximumPropertiesToStringify -= value.length; + separator = join2; + } + if (deterministic) { + keys = sort(keys, comparator); + } + stack.push(value); + for (let i = 0; i < maximumPropertiesToStringify; i++) { + const key2 = keys[i]; + const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation); + if (tmp !== void 0) { + res += `${separator}${strEscape(key2)}: ${tmp}`; + separator = join2; + } + } + if (keyLength > maximumBreadth) { + const removedKeys = keyLength - maximumBreadth; + res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`; + separator = join2; + } + if (separator !== "") { + res = ` +${indentation}${res} +${originalIndentation}`; + } + stack.pop(); + return `{${res}}`; + } + case "number": + return isFinite(value) ? String(value) : fail ? fail(value) : "null"; + case "boolean": + return value === true ? "true" : "false"; + case "undefined": + return void 0; + case "bigint": + if (bigint) { + return String(value); + } + default: + return fail ? fail(value) : void 0; + } + } + function stringifySimple(key, value, stack) { + switch (typeof value) { + case "string": + return strEscape(value); + case "object": { + if (value === null) { + return "null"; + } + if (typeof value.toJSON === "function") { + value = value.toJSON(key); + if (typeof value !== "object") { + return stringifySimple(key, value, stack); + } + if (value === null) { + return "null"; + } + } + if (stack.indexOf(value) !== -1) { + return circularValue; + } + let res = ""; + const hasLength = value.length !== void 0; + if (hasLength && Array.isArray(value)) { + if (value.length === 0) { + return "[]"; + } + if (maximumDepth < stack.length + 1) { + return '"[Array]"'; + } + stack.push(value); + const maximumValuesToStringify = Math.min(value.length, maximumBreadth); + let i = 0; + for (; i < maximumValuesToStringify - 1; i++) { + const tmp2 = stringifySimple(String(i), value[i], stack); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += ","; + } + const tmp = stringifySimple(String(i), value[i], stack); + res += tmp !== void 0 ? tmp : "null"; + if (value.length - 1 > maximumBreadth) { + const removedKeys = value.length - maximumBreadth - 1; + res += `,"... ${getItemCount(removedKeys)} not stringified"`; + } + stack.pop(); + return `[${res}]`; + } + let keys = Object.keys(value); + const keyLength = keys.length; + if (keyLength === 0) { + return "{}"; + } + if (maximumDepth < stack.length + 1) { + return '"[Object]"'; + } + let separator = ""; + let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth); + if (hasLength && isTypedArrayWithEntries(value)) { + res += stringifyTypedArray(value, ",", maximumBreadth); + keys = keys.slice(value.length); + maximumPropertiesToStringify -= value.length; + separator = ","; + } + if (deterministic) { + keys = sort(keys, comparator); + } + stack.push(value); + for (let i = 0; i < maximumPropertiesToStringify; i++) { + const key2 = keys[i]; + const tmp = stringifySimple(key2, value[key2], stack); + if (tmp !== void 0) { + res += `${separator}${strEscape(key2)}:${tmp}`; + separator = ","; + } + } + if (keyLength > maximumBreadth) { + const removedKeys = keyLength - maximumBreadth; + res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`; + } + stack.pop(); + return `{${res}}`; + } + case "number": + return isFinite(value) ? String(value) : fail ? fail(value) : "null"; + case "boolean": + return value === true ? "true" : "false"; + case "undefined": + return void 0; + case "bigint": + if (bigint) { + return String(value); + } + default: + return fail ? fail(value) : void 0; + } + } + function stringify2(value, replacer, space) { + if (arguments.length > 1) { + let spacer = ""; + if (typeof space === "number") { + spacer = " ".repeat(Math.min(space, 10)); + } else if (typeof space === "string") { + spacer = space.slice(0, 10); + } + if (replacer != null) { + if (typeof replacer === "function") { + return stringifyFnReplacer("", { "": value }, [], replacer, spacer, ""); + } + if (Array.isArray(replacer)) { + return stringifyArrayReplacer("", value, [], getUniqueReplacerSet(replacer), spacer, ""); + } + } + if (spacer.length !== 0) { + return stringifyIndent("", value, [], spacer, ""); + } + } + return stringifySimple("", value, []); + } + return stringify2; + } + } +}); + +// node_modules/logform/json.js +var require_json = __commonJS({ + "node_modules/logform/json.js"(exports, module2) { + "use strict"; + var format = require_format(); + var { MESSAGE } = require_triple_beam(); + var stringify = require_safe_stable_stringify(); + function replacer(key, value) { + if (typeof value === "bigint") + return value.toString(); + return value; + } + module2.exports = format((info, opts) => { + const jsonStringify = stringify.configure(opts); + info[MESSAGE] = jsonStringify(info, opts.replacer || replacer, opts.space); + return info; + }); + } +}); + +// node_modules/logform/label.js +var require_label = __commonJS({ + "node_modules/logform/label.js"(exports, module2) { + "use strict"; + var format = require_format(); + module2.exports = format((info, opts) => { + if (opts.message) { + info.message = `[${opts.label}] ${info.message}`; + return info; + } + info.label = opts.label; + return info; + }); + } +}); + +// node_modules/logform/logstash.js +var require_logstash = __commonJS({ + "node_modules/logform/logstash.js"(exports, module2) { + "use strict"; + var format = require_format(); + var { MESSAGE } = require_triple_beam(); + var jsonStringify = require_safe_stable_stringify(); + module2.exports = format((info) => { + const logstash = {}; + if (info.message) { + logstash["@message"] = info.message; + delete info.message; + } + if (info.timestamp) { + logstash["@timestamp"] = info.timestamp; + delete info.timestamp; + } + logstash["@fields"] = info; + info[MESSAGE] = jsonStringify(logstash); + return info; + }); + } +}); + +// node_modules/logform/metadata.js +var require_metadata = __commonJS({ + "node_modules/logform/metadata.js"(exports, module2) { + "use strict"; + var format = require_format(); + function fillExcept(info, fillExceptKeys, metadataKey) { + const savedKeys = fillExceptKeys.reduce((acc, key) => { + acc[key] = info[key]; + delete info[key]; + return acc; + }, {}); + const metadata = Object.keys(info).reduce((acc, key) => { + acc[key] = info[key]; + delete info[key]; + return acc; + }, {}); + Object.assign(info, savedKeys, { + [metadataKey]: metadata + }); + return info; + } + function fillWith(info, fillWithKeys, metadataKey) { + info[metadataKey] = fillWithKeys.reduce((acc, key) => { + acc[key] = info[key]; + delete info[key]; + return acc; + }, {}); + return info; + } + module2.exports = format((info, opts = {}) => { + let metadataKey = "metadata"; + if (opts.key) { + metadataKey = opts.key; + } + let fillExceptKeys = []; + if (!opts.fillExcept && !opts.fillWith) { + fillExceptKeys.push("level"); + fillExceptKeys.push("message"); + } + if (opts.fillExcept) { + fillExceptKeys = opts.fillExcept; + } + if (fillExceptKeys.length > 0) { + return fillExcept(info, fillExceptKeys, metadataKey); + } + if (opts.fillWith) { + return fillWith(info, opts.fillWith, metadataKey); + } + return info; + }); + } +}); + +// node_modules/ms/index.js +var require_ms = __commonJS({ + "node_modules/ms/index.js"(exports, module2) { + var s = 1e3; + var m = s * 60; + var h = m * 60; + var d = h * 24; + var w = d * 7; + var y = d * 365.25; + module2.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === "string" && val.length > 0) { + return parse(val); + } else if (type === "number" && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) + ); + }; + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || "ms").toLowerCase(); + switch (type) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return n * y; + case "weeks": + case "week": + case "w": + return n * w; + case "days": + case "day": + case "d": + return n * d; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return n * h; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return n * m; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return n * s; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return n; + default: + return void 0; + } + } + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + "d"; + } + if (msAbs >= h) { + return Math.round(ms / h) + "h"; + } + if (msAbs >= m) { + return Math.round(ms / m) + "m"; + } + if (msAbs >= s) { + return Math.round(ms / s) + "s"; + } + return ms + "ms"; + } + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, "day"); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, "hour"); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, "minute"); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, "second"); + } + return ms + " ms"; + } + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); + } + } +}); + +// node_modules/logform/ms.js +var require_ms2 = __commonJS({ + "node_modules/logform/ms.js"(exports, module2) { + "use strict"; + var format = require_format(); + var ms = require_ms(); + module2.exports = format((info) => { + const curr = +new Date(); + exports.diff = curr - (exports.prevTime || curr); + exports.prevTime = curr; + info.ms = `+${ms(exports.diff)}`; + return info; + }); + } +}); + +// node_modules/logform/pretty-print.js +var require_pretty_print = __commonJS({ + "node_modules/logform/pretty-print.js"(exports, module2) { + "use strict"; + var inspect = require("util").inspect; + var format = require_format(); + var { LEVEL, MESSAGE, SPLAT } = require_triple_beam(); + module2.exports = format((info, opts = {}) => { + const stripped = Object.assign({}, info); + delete stripped[LEVEL]; + delete stripped[MESSAGE]; + delete stripped[SPLAT]; + info[MESSAGE] = inspect(stripped, false, opts.depth || null, opts.colorize); + return info; + }); + } +}); + +// node_modules/logform/printf.js +var require_printf = __commonJS({ + "node_modules/logform/printf.js"(exports, module2) { + "use strict"; + var { MESSAGE } = require_triple_beam(); + var Printf = class { + constructor(templateFn) { + this.template = templateFn; + } + transform(info) { + info[MESSAGE] = this.template(info); + return info; + } + }; + module2.exports = (opts) => new Printf(opts); + module2.exports.Printf = module2.exports.Format = Printf; + } +}); + +// node_modules/logform/simple.js +var require_simple = __commonJS({ + "node_modules/logform/simple.js"(exports, module2) { + "use strict"; + var format = require_format(); + var { MESSAGE } = require_triple_beam(); + var jsonStringify = require_safe_stable_stringify(); + module2.exports = format((info) => { + const stringifiedRest = jsonStringify(Object.assign({}, info, { + level: void 0, + message: void 0, + splat: void 0 + })); + const padding = info.padding && info.padding[info.level] || ""; + if (stringifiedRest !== "{}") { + info[MESSAGE] = `${info.level}:${padding} ${info.message} ${stringifiedRest}`; + } else { + info[MESSAGE] = `${info.level}:${padding} ${info.message}`; + } + return info; + }); + } +}); + +// node_modules/logform/splat.js +var require_splat = __commonJS({ + "node_modules/logform/splat.js"(exports, module2) { + "use strict"; + var util = require("util"); + var { SPLAT } = require_triple_beam(); + var formatRegExp = /%[scdjifoO%]/g; + var escapedPercent = /%%/g; + var Splatter = class { + constructor(opts) { + this.options = opts; + } + /** + * Check to see if tokens <= splat.length, assign { splat, meta } into the + * `info` accordingly, and write to this instance. + * + * @param {Info} info Logform info message. + * @param {String[]} tokens Set of string interpolation tokens. + * @returns {Info} Modified info message + * @private + */ + _splat(info, tokens) { + const msg = info.message; + const splat = info[SPLAT] || info.splat || []; + const percents = msg.match(escapedPercent); + const escapes = percents && percents.length || 0; + const expectedSplat = tokens.length - escapes; + const extraSplat = expectedSplat - splat.length; + const metas = extraSplat < 0 ? splat.splice(extraSplat, -1 * extraSplat) : []; + const metalen = metas.length; + if (metalen) { + for (let i = 0; i < metalen; i++) { + Object.assign(info, metas[i]); + } + } + info.message = util.format(msg, ...splat); + return info; + } + /** + * Transforms the `info` message by using `util.format` to complete + * any `info.message` provided it has string interpolation tokens. + * If no tokens exist then `info` is immutable. + * + * @param {Info} info Logform info message. + * @param {Object} opts Options for this instance. + * @returns {Info} Modified info message + */ + transform(info) { + const msg = info.message; + const splat = info[SPLAT] || info.splat; + if (!splat || !splat.length) { + return info; + } + const tokens = msg && msg.match && msg.match(formatRegExp); + if (!tokens && (splat || splat.length)) { + const metas = splat.length > 1 ? splat.splice(0) : splat; + const metalen = metas.length; + if (metalen) { + for (let i = 0; i < metalen; i++) { + Object.assign(info, metas[i]); + } + } + return info; + } + if (tokens) { + return this._splat(info, tokens); + } + return info; + } + }; + module2.exports = (opts) => new Splatter(opts); + } +}); + +// node_modules/fecha/lib/fecha.umd.js +var require_fecha_umd = __commonJS({ + "node_modules/fecha/lib/fecha.umd.js"(exports, module2) { + (function(global2, factory) { + typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : factory(global2.fecha = {}); + })(exports, function(exports2) { + "use strict"; + var token = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g; + var twoDigitsOptional = "\\d\\d?"; + var twoDigits = "\\d\\d"; + var threeDigits = "\\d{3}"; + var fourDigits = "\\d{4}"; + var word = "[^\\s]+"; + var literal = /\[([^]*?)\]/gm; + function shorten(arr, sLen) { + var newArr = []; + for (var i = 0, len = arr.length; i < len; i++) { + newArr.push(arr[i].substr(0, sLen)); + } + return newArr; + } + var monthUpdate = function(arrName) { + return function(v, i18n) { + var lowerCaseArr = i18n[arrName].map(function(v2) { + return v2.toLowerCase(); + }); + var index = lowerCaseArr.indexOf(v.toLowerCase()); + if (index > -1) { + return index; + } + return null; + }; + }; + function assign(origObj) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { + var obj = args_1[_a]; + for (var key in obj) { + origObj[key] = obj[key]; + } + } + return origObj; + } + var dayNames = [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ]; + var monthNames = [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ]; + var monthNamesShort = shorten(monthNames, 3); + var dayNamesShort = shorten(dayNames, 3); + var defaultI18n = { + dayNamesShort, + dayNames, + monthNamesShort, + monthNames, + amPm: ["am", "pm"], + DoFn: function(dayOfMonth) { + return dayOfMonth + ["th", "st", "nd", "rd"][dayOfMonth % 10 > 3 ? 0 : (dayOfMonth - dayOfMonth % 10 !== 10 ? 1 : 0) * dayOfMonth % 10]; + } + }; + var globalI18n = assign({}, defaultI18n); + var setGlobalDateI18n = function(i18n) { + return globalI18n = assign(globalI18n, i18n); + }; + var regexEscape = function(str) { + return str.replace(/[|\\{()[^$+*?.-]/g, "\\$&"); + }; + var pad = function(val, len) { + if (len === void 0) { + len = 2; + } + val = String(val); + while (val.length < len) { + val = "0" + val; + } + return val; + }; + var formatFlags = { + D: function(dateObj) { + return String(dateObj.getDate()); + }, + DD: function(dateObj) { + return pad(dateObj.getDate()); + }, + Do: function(dateObj, i18n) { + return i18n.DoFn(dateObj.getDate()); + }, + d: function(dateObj) { + return String(dateObj.getDay()); + }, + dd: function(dateObj) { + return pad(dateObj.getDay()); + }, + ddd: function(dateObj, i18n) { + return i18n.dayNamesShort[dateObj.getDay()]; + }, + dddd: function(dateObj, i18n) { + return i18n.dayNames[dateObj.getDay()]; + }, + M: function(dateObj) { + return String(dateObj.getMonth() + 1); + }, + MM: function(dateObj) { + return pad(dateObj.getMonth() + 1); + }, + MMM: function(dateObj, i18n) { + return i18n.monthNamesShort[dateObj.getMonth()]; + }, + MMMM: function(dateObj, i18n) { + return i18n.monthNames[dateObj.getMonth()]; + }, + YY: function(dateObj) { + return pad(String(dateObj.getFullYear()), 4).substr(2); + }, + YYYY: function(dateObj) { + return pad(dateObj.getFullYear(), 4); + }, + h: function(dateObj) { + return String(dateObj.getHours() % 12 || 12); + }, + hh: function(dateObj) { + return pad(dateObj.getHours() % 12 || 12); + }, + H: function(dateObj) { + return String(dateObj.getHours()); + }, + HH: function(dateObj) { + return pad(dateObj.getHours()); + }, + m: function(dateObj) { + return String(dateObj.getMinutes()); + }, + mm: function(dateObj) { + return pad(dateObj.getMinutes()); + }, + s: function(dateObj) { + return String(dateObj.getSeconds()); + }, + ss: function(dateObj) { + return pad(dateObj.getSeconds()); + }, + S: function(dateObj) { + return String(Math.round(dateObj.getMilliseconds() / 100)); + }, + SS: function(dateObj) { + return pad(Math.round(dateObj.getMilliseconds() / 10), 2); + }, + SSS: function(dateObj) { + return pad(dateObj.getMilliseconds(), 3); + }, + a: function(dateObj, i18n) { + return dateObj.getHours() < 12 ? i18n.amPm[0] : i18n.amPm[1]; + }, + A: function(dateObj, i18n) { + return dateObj.getHours() < 12 ? i18n.amPm[0].toUpperCase() : i18n.amPm[1].toUpperCase(); + }, + ZZ: function(dateObj) { + var offset = dateObj.getTimezoneOffset(); + return (offset > 0 ? "-" : "+") + pad(Math.floor(Math.abs(offset) / 60) * 100 + Math.abs(offset) % 60, 4); + }, + Z: function(dateObj) { + var offset = dateObj.getTimezoneOffset(); + return (offset > 0 ? "-" : "+") + pad(Math.floor(Math.abs(offset) / 60), 2) + ":" + pad(Math.abs(offset) % 60, 2); + } + }; + var monthParse = function(v) { + return +v - 1; + }; + var emptyDigits = [null, twoDigitsOptional]; + var emptyWord = [null, word]; + var amPm = [ + "isPm", + word, + function(v, i18n) { + var val = v.toLowerCase(); + if (val === i18n.amPm[0]) { + return 0; + } else if (val === i18n.amPm[1]) { + return 1; + } + return null; + } + ]; + var timezoneOffset = [ + "timezoneOffset", + "[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?", + function(v) { + var parts = (v + "").match(/([+-]|\d\d)/gi); + if (parts) { + var minutes = +parts[1] * 60 + parseInt(parts[2], 10); + return parts[0] === "+" ? minutes : -minutes; + } + return 0; + } + ]; + var parseFlags = { + D: ["day", twoDigitsOptional], + DD: ["day", twoDigits], + Do: ["day", twoDigitsOptional + word, function(v) { + return parseInt(v, 10); + }], + M: ["month", twoDigitsOptional, monthParse], + MM: ["month", twoDigits, monthParse], + YY: [ + "year", + twoDigits, + function(v) { + var now = new Date(); + var cent = +("" + now.getFullYear()).substr(0, 2); + return +("" + (+v > 68 ? cent - 1 : cent) + v); + } + ], + h: ["hour", twoDigitsOptional, void 0, "isPm"], + hh: ["hour", twoDigits, void 0, "isPm"], + H: ["hour", twoDigitsOptional], + HH: ["hour", twoDigits], + m: ["minute", twoDigitsOptional], + mm: ["minute", twoDigits], + s: ["second", twoDigitsOptional], + ss: ["second", twoDigits], + YYYY: ["year", fourDigits], + S: ["millisecond", "\\d", function(v) { + return +v * 100; + }], + SS: ["millisecond", twoDigits, function(v) { + return +v * 10; + }], + SSS: ["millisecond", threeDigits], + d: emptyDigits, + dd: emptyDigits, + ddd: emptyWord, + dddd: emptyWord, + MMM: ["month", word, monthUpdate("monthNamesShort")], + MMMM: ["month", word, monthUpdate("monthNames")], + a: amPm, + A: amPm, + ZZ: timezoneOffset, + Z: timezoneOffset + }; + var globalMasks = { + default: "ddd MMM DD YYYY HH:mm:ss", + shortDate: "M/D/YY", + mediumDate: "MMM D, YYYY", + longDate: "MMMM D, YYYY", + fullDate: "dddd, MMMM D, YYYY", + isoDate: "YYYY-MM-DD", + isoDateTime: "YYYY-MM-DDTHH:mm:ssZ", + shortTime: "HH:mm", + mediumTime: "HH:mm:ss", + longTime: "HH:mm:ss.SSS" + }; + var setGlobalDateMasks = function(masks) { + return assign(globalMasks, masks); + }; + var format = function(dateObj, mask, i18n) { + if (mask === void 0) { + mask = globalMasks["default"]; + } + if (i18n === void 0) { + i18n = {}; + } + if (typeof dateObj === "number") { + dateObj = new Date(dateObj); + } + if (Object.prototype.toString.call(dateObj) !== "[object Date]" || isNaN(dateObj.getTime())) { + throw new Error("Invalid Date pass to format"); + } + mask = globalMasks[mask] || mask; + var literals = []; + mask = mask.replace(literal, function($0, $1) { + literals.push($1); + return "@@@"; + }); + var combinedI18nSettings = assign(assign({}, globalI18n), i18n); + mask = mask.replace(token, function($0) { + return formatFlags[$0](dateObj, combinedI18nSettings); + }); + return mask.replace(/@@@/g, function() { + return literals.shift(); + }); + }; + function parse(dateStr, format2, i18n) { + if (i18n === void 0) { + i18n = {}; + } + if (typeof format2 !== "string") { + throw new Error("Invalid format in fecha parse"); + } + format2 = globalMasks[format2] || format2; + if (dateStr.length > 1e3) { + return null; + } + var today = new Date(); + var dateInfo = { + year: today.getFullYear(), + month: 0, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0, + isPm: null, + timezoneOffset: null + }; + var parseInfo = []; + var literals = []; + var newFormat = format2.replace(literal, function($0, $1) { + literals.push(regexEscape($1)); + return "@@@"; + }); + var specifiedFields = {}; + var requiredFields = {}; + newFormat = regexEscape(newFormat).replace(token, function($0) { + var info = parseFlags[$0]; + var field2 = info[0], regex = info[1], requiredField = info[3]; + if (specifiedFields[field2]) { + throw new Error("Invalid format. " + field2 + " specified twice in format"); + } + specifiedFields[field2] = true; + if (requiredField) { + requiredFields[requiredField] = true; + } + parseInfo.push(info); + return "(" + regex + ")"; + }); + Object.keys(requiredFields).forEach(function(field2) { + if (!specifiedFields[field2]) { + throw new Error("Invalid format. " + field2 + " is required in specified format"); + } + }); + newFormat = newFormat.replace(/@@@/g, function() { + return literals.shift(); + }); + var matches = dateStr.match(new RegExp(newFormat, "i")); + if (!matches) { + return null; + } + var combinedI18nSettings = assign(assign({}, globalI18n), i18n); + for (var i = 1; i < matches.length; i++) { + var _a = parseInfo[i - 1], field = _a[0], parser = _a[2]; + var value = parser ? parser(matches[i], combinedI18nSettings) : +matches[i]; + if (value == null) { + return null; + } + dateInfo[field] = value; + } + if (dateInfo.isPm === 1 && dateInfo.hour != null && +dateInfo.hour !== 12) { + dateInfo.hour = +dateInfo.hour + 12; + } else if (dateInfo.isPm === 0 && +dateInfo.hour === 12) { + dateInfo.hour = 0; + } + var dateTZ; + if (dateInfo.timezoneOffset == null) { + dateTZ = new Date(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute, dateInfo.second, dateInfo.millisecond); + var validateFields = [ + ["month", "getMonth"], + ["day", "getDate"], + ["hour", "getHours"], + ["minute", "getMinutes"], + ["second", "getSeconds"] + ]; + for (var i = 0, len = validateFields.length; i < len; i++) { + if (specifiedFields[validateFields[i][0]] && dateInfo[validateFields[i][0]] !== dateTZ[validateFields[i][1]]()) { + return null; + } + } + } else { + dateTZ = new Date(Date.UTC(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute - dateInfo.timezoneOffset, dateInfo.second, dateInfo.millisecond)); + if (dateInfo.month > 11 || dateInfo.month < 0 || dateInfo.day > 31 || dateInfo.day < 1 || dateInfo.hour > 23 || dateInfo.hour < 0 || dateInfo.minute > 59 || dateInfo.minute < 0 || dateInfo.second > 59 || dateInfo.second < 0) { + return null; + } + } + return dateTZ; + } + var fecha = { + format, + parse, + defaultI18n, + setGlobalDateI18n, + setGlobalDateMasks + }; + exports2.assign = assign; + exports2.default = fecha; + exports2.format = format; + exports2.parse = parse; + exports2.defaultI18n = defaultI18n; + exports2.setGlobalDateI18n = setGlobalDateI18n; + exports2.setGlobalDateMasks = setGlobalDateMasks; + Object.defineProperty(exports2, "__esModule", { value: true }); + }); + } +}); + +// node_modules/logform/timestamp.js +var require_timestamp2 = __commonJS({ + "node_modules/logform/timestamp.js"(exports, module2) { + "use strict"; + var fecha = require_fecha_umd(); + var format = require_format(); + module2.exports = format((info, opts = {}) => { + if (opts.format) { + info.timestamp = typeof opts.format === "function" ? opts.format() : fecha.format(new Date(), opts.format); + } + if (!info.timestamp) { + info.timestamp = new Date().toISOString(); + } + if (opts.alias) { + info[opts.alias] = info.timestamp; + } + return info; + }); + } +}); + +// node_modules/logform/uncolorize.js +var require_uncolorize = __commonJS({ + "node_modules/logform/uncolorize.js"(exports, module2) { + "use strict"; + var colors = require_safe(); + var format = require_format(); + var { MESSAGE } = require_triple_beam(); + module2.exports = format((info, opts) => { + if (opts.level !== false) { + info.level = colors.strip(info.level); + } + if (opts.message !== false) { + info.message = colors.strip(String(info.message)); + } + if (opts.raw !== false && info[MESSAGE]) { + info[MESSAGE] = colors.strip(String(info[MESSAGE])); + } + return info; + }); + } +}); + +// node_modules/logform/index.js +var require_logform = __commonJS({ + "node_modules/logform/index.js"(exports) { + "use strict"; + var format = exports.format = require_format(); + exports.levels = require_levels(); + function exposeFormat(name, requireFormat) { + Object.defineProperty(format, name, { + get() { + return requireFormat(); + }, + configurable: true + }); + } + exposeFormat("align", function() { + return require_align(); + }); + exposeFormat("errors", function() { + return require_errors(); + }); + exposeFormat("cli", function() { + return require_cli2(); + }); + exposeFormat("combine", function() { + return require_combine(); + }); + exposeFormat("colorize", function() { + return require_colorize(); + }); + exposeFormat("json", function() { + return require_json(); + }); + exposeFormat("label", function() { + return require_label(); + }); + exposeFormat("logstash", function() { + return require_logstash(); + }); + exposeFormat("metadata", function() { + return require_metadata(); + }); + exposeFormat("ms", function() { + return require_ms2(); + }); + exposeFormat("padLevels", function() { + return require_pad_levels(); + }); + exposeFormat("prettyPrint", function() { + return require_pretty_print(); + }); + exposeFormat("printf", function() { + return require_printf(); + }); + exposeFormat("simple", function() { + return require_simple(); + }); + exposeFormat("splat", function() { + return require_splat(); + }); + exposeFormat("timestamp", function() { + return require_timestamp2(); + }); + exposeFormat("uncolorize", function() { + return require_uncolorize(); + }); + } +}); + +// node_modules/winston/lib/winston/common.js +var require_common = __commonJS({ + "node_modules/winston/lib/winston/common.js"(exports) { + "use strict"; + var { format } = require("util"); + exports.warn = { + deprecated(prop) { + return () => { + throw new Error(format("{ %s } was removed in winston@3.0.0.", prop)); + }; + }, + useFormat(prop) { + return () => { + throw new Error([ + format("{ %s } was removed in winston@3.0.0.", prop), + "Use a custom winston.format = winston.format(function) instead." + ].join("\n")); + }; + }, + forFunctions(obj, type, props) { + props.forEach((prop) => { + obj[prop] = exports.warn[type](prop); + }); + }, + forProperties(obj, type, props) { + props.forEach((prop) => { + const notice = exports.warn[type](prop); + Object.defineProperty(obj, prop, { + get: notice, + set: notice + }); + }); + } + }; + } +}); + +// node_modules/winston/package.json +var require_package = __commonJS({ + "node_modules/winston/package.json"(exports, module2) { + module2.exports = { + name: "winston", + description: "A logger for just about everything.", + version: "3.14.1", + author: "Charlie Robbins ", + maintainers: [ + "David Hyde " + ], + repository: { + type: "git", + url: "https://github.com/winstonjs/winston.git" + }, + keywords: [ + "winston", + "logger", + "logging", + "logs", + "sysadmin", + "bunyan", + "pino", + "loglevel", + "tools", + "json", + "stream" + ], + dependencies: { + "@dabh/diagnostics": "^2.0.2", + "@colors/colors": "^1.6.0", + async: "^3.2.3", + "is-stream": "^2.0.0", + logform: "^2.6.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.7.0" + }, + devDependencies: { + "@babel/cli": "^7.23.9", + "@babel/core": "^7.24.0", + "@babel/preset-env": "^7.24.0", + "@dabh/eslint-config-populist": "^4.4.0", + "@types/node": "^20.11.24", + "abstract-winston-transport": "^0.5.1", + assume: "^2.2.0", + "cross-spawn-async": "^2.2.5", + eslint: "^8.57.0", + hock: "^1.4.1", + mocha: "^10.3.0", + nyc: "^15.1.0", + rimraf: "5.0.1", + split2: "^4.1.0", + "std-mocks": "^2.0.0", + through2: "^4.0.2", + "winston-compat": "^0.1.5" + }, + main: "./lib/winston.js", + browser: "./dist/winston", + types: "./index.d.ts", + scripts: { + lint: "eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist", + test: "rimraf test/fixtures/logs/* && mocha", + "test:coverage": "nyc npm run test:unit", + "test:unit": "mocha test/unit", + "test:integration": "mocha test/integration", + build: "rimraf dist && babel lib -d dist", + prepublishOnly: "npm run build" + }, + engines: { + node: ">= 12.0.0" + }, + license: "MIT" + }; + } +}); + +// node_modules/util-deprecate/node.js +var require_node = __commonJS({ + "node_modules/util-deprecate/node.js"(exports, module2) { + module2.exports = require("util").deprecate; + } +}); + +// node_modules/readable-stream/lib/internal/streams/stream.js +var require_stream2 = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/stream.js"(exports, module2) { + module2.exports = require("stream"); + } +}); + +// node_modules/readable-stream/lib/internal/streams/destroy.js +var require_destroy = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/destroy.js"(exports, module2) { + "use strict"; + function destroy(err, cb) { + var _this = this; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process.nextTick(emitErrorNT, this, err); + } + } + return this; + } + if (this._readableState) { + this._readableState.destroyed = true; + } + if (this._writableState) { + this._writableState.destroyed = true; + } + this._destroy(err || null, function(err2) { + if (!cb && err2) { + if (!_this._writableState) { + process.nextTick(emitErrorAndCloseNT, _this, err2); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process.nextTick(emitErrorAndCloseNT, _this, err2); + } else { + process.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process.nextTick(emitCloseNT, _this); + cb(err2); + } else { + process.nextTick(emitCloseNT, _this); + } + }); + return this; + } + function emitErrorAndCloseNT(self2, err) { + emitErrorNT(self2, err); + emitCloseNT(self2); + } + function emitCloseNT(self2) { + if (self2._writableState && !self2._writableState.emitClose) + return; + if (self2._readableState && !self2._readableState.emitClose) + return; + self2.emit("close"); + } + function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } + } + function emitErrorNT(self2, err) { + self2.emit("error", err); + } + function errorOrDestroy(stream, err) { + var rState = stream._readableState; + var wState = stream._writableState; + if (rState && rState.autoDestroy || wState && wState.autoDestroy) + stream.destroy(err); + else + stream.emit("error", err); + } + module2.exports = { + destroy, + undestroy, + errorOrDestroy + }; + } +}); + +// node_modules/readable-stream/errors.js +var require_errors2 = __commonJS({ + "node_modules/readable-stream/errors.js"(exports, module2) { + "use strict"; + var codes = {}; + function createErrorType(code, message, Base) { + if (!Base) { + Base = Error; + } + function getMessage(arg1, arg2, arg3) { + if (typeof message === "string") { + return message; + } else { + return message(arg1, arg2, arg3); + } + } + class NodeError extends Base { + constructor(arg1, arg2, arg3) { + super(getMessage(arg1, arg2, arg3)); + } + } + NodeError.prototype.name = Base.name; + NodeError.prototype.code = code; + codes[code] = NodeError; + } + function oneOf(expected, thing) { + if (Array.isArray(expected)) { + const len = expected.length; + expected = expected.map((i) => String(i)); + if (len > 2) { + return `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1]; + } else if (len === 2) { + return `one of ${thing} ${expected[0]} or ${expected[1]}`; + } else { + return `of ${thing} ${expected[0]}`; + } + } else { + return `of ${thing} ${String(expected)}`; + } + } + function startsWith(str, search, pos) { + return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; + } + function endsWith(str, search, this_len) { + if (this_len === void 0 || this_len > str.length) { + this_len = str.length; + } + return str.substring(this_len - search.length, this_len) === search; + } + function includes(str, search, start) { + if (typeof start !== "number") { + start = 0; + } + if (start + search.length > str.length) { + return false; + } else { + return str.indexOf(search, start) !== -1; + } + } + createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) { + return 'The value "' + value + '" is invalid for option "' + name + '"'; + }, TypeError); + createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) { + let determiner; + if (typeof expected === "string" && startsWith(expected, "not ")) { + determiner = "must not be"; + expected = expected.replace(/^not /, ""); + } else { + determiner = "must be"; + } + let msg; + if (endsWith(name, " argument")) { + msg = `The ${name} ${determiner} ${oneOf(expected, "type")}`; + } else { + const type = includes(name, ".") ? "property" : "argument"; + msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, "type")}`; + } + msg += `. Received type ${typeof actual}`; + return msg; + }, TypeError); + createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); + createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) { + return "The " + name + " method is not implemented"; + }); + createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); + createErrorType("ERR_STREAM_DESTROYED", function(name) { + return "Cannot call " + name + " after a stream was destroyed"; + }); + createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); + createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); + createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); + createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); + createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { + return "Unknown encoding: " + arg; + }, TypeError); + createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); + module2.exports.codes = codes; + } +}); + +// node_modules/readable-stream/lib/internal/streams/state.js +var require_state = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/state.js"(exports, module2) { + "use strict"; + var ERR_INVALID_OPT_VALUE = require_errors2().codes.ERR_INVALID_OPT_VALUE; + function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; + } + function getHighWaterMark(state, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name = isDuplex ? duplexKey : "highWaterMark"; + throw new ERR_INVALID_OPT_VALUE(name, hwm); + } + return Math.floor(hwm); + } + return state.objectMode ? 16 : 16 * 1024; + } + module2.exports = { + getHighWaterMark + }; + } +}); + +// node_modules/inherits/inherits_browser.js +var require_inherits_browser = __commonJS({ + "node_modules/inherits/inherits_browser.js"(exports, module2) { + if (typeof Object.create === "function") { + module2.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + } + }; + } else { + module2.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + } +}); + +// node_modules/inherits/inherits.js +var require_inherits = __commonJS({ + "node_modules/inherits/inherits.js"(exports, module2) { + try { + util = require("util"); + if (typeof util.inherits !== "function") + throw ""; + module2.exports = util.inherits; + } catch (e) { + module2.exports = require_inherits_browser(); + } + var util; + } +}); + +// node_modules/readable-stream/lib/internal/streams/buffer_list.js +var require_buffer_list = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports, module2) { + "use strict"; + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = null != arguments[i] ? arguments[i] : {}; + i % 2 ? ownKeys(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var _require = require("buffer"); + var Buffer2 = _require.Buffer; + var _require2 = require("util"); + var inspect = _require2.inspect; + var custom = inspect && inspect.custom || "inspect"; + function copyBuffer(src, target, offset) { + Buffer2.prototype.copy.call(src, target, offset); + } + module2.exports = /* @__PURE__ */ function() { + function BufferList() { + _classCallCheck(this, BufferList); + this.head = null; + this.tail = null; + this.length = 0; + } + _createClass(BufferList, [{ + key: "push", + value: function push(v) { + var entry = { + data: v, + next: null + }; + if (this.length > 0) + this.tail.next = entry; + else + this.head = entry; + this.tail = entry; + ++this.length; + } + }, { + key: "unshift", + value: function unshift(v) { + var entry = { + data: v, + next: this.head + }; + if (this.length === 0) + this.tail = entry; + this.head = entry; + ++this.length; + } + }, { + key: "shift", + value: function shift() { + if (this.length === 0) + return; + var ret = this.head.data; + if (this.length === 1) + this.head = this.tail = null; + else + this.head = this.head.next; + --this.length; + return ret; + } + }, { + key: "clear", + value: function clear() { + this.head = this.tail = null; + this.length = 0; + } + }, { + key: "join", + value: function join2(s) { + if (this.length === 0) + return ""; + var p = this.head; + var ret = "" + p.data; + while (p = p.next) + ret += s + p.data; + return ret; + } + }, { + key: "concat", + value: function concat(n) { + if (this.length === 0) + return Buffer2.alloc(0); + var ret = Buffer2.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + } + // Consumes a specified amount of bytes or characters from the buffered data. + }, { + key: "consume", + value: function consume(n, hasStrings) { + var ret; + if (n < this.head.data.length) { + ret = this.head.data.slice(0, n); + this.head.data = this.head.data.slice(n); + } else if (n === this.head.data.length) { + ret = this.shift(); + } else { + ret = hasStrings ? this._getString(n) : this._getBuffer(n); + } + return ret; + } + }, { + key: "first", + value: function first() { + return this.head.data; + } + // Consumes a specified amount of characters from the buffered data. + }, { + key: "_getString", + value: function _getString(n) { + var p = this.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) + ret += str; + else + ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) + this.head = p.next; + else + this.head = this.tail = null; + } else { + this.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + this.length -= c; + return ret; + } + // Consumes a specified amount of bytes from the buffered data. + }, { + key: "_getBuffer", + value: function _getBuffer(n) { + var ret = Buffer2.allocUnsafe(n); + var p = this.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) + this.head = p.next; + else + this.head = this.tail = null; + } else { + this.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + this.length -= c; + return ret; + } + // Make sure the linked list only shows the minimal necessary information. + }, { + key: custom, + value: function value(_, options) { + return inspect(this, _objectSpread(_objectSpread({}, options), {}, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + })); + } + }]); + return BufferList; + }(); + } +}); + +// node_modules/readable-stream/lib/internal/streams/end-of-stream.js +var require_end_of_stream = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports, module2) { + "use strict"; + var ERR_STREAM_PREMATURE_CLOSE = require_errors2().codes.ERR_STREAM_PREMATURE_CLOSE; + function once(callback) { + var called = false; + return function() { + if (called) + return; + called = true; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + callback.apply(this, args); + }; + } + function noop() { + } + function isRequest(stream) { + return stream.setHeader && typeof stream.abort === "function"; + } + function eos(stream, opts, callback) { + if (typeof opts === "function") + return eos(stream, null, opts); + if (!opts) + opts = {}; + callback = once(callback || noop); + var readable = opts.readable || opts.readable !== false && stream.readable; + var writable = opts.writable || opts.writable !== false && stream.writable; + var onlegacyfinish = function onlegacyfinish2() { + if (!stream.writable) + onfinish(); + }; + var writableEnded = stream._writableState && stream._writableState.finished; + var onfinish = function onfinish2() { + writable = false; + writableEnded = true; + if (!readable) + callback.call(stream); + }; + var readableEnded = stream._readableState && stream._readableState.endEmitted; + var onend = function onend2() { + readable = false; + readableEnded = true; + if (!writable) + callback.call(stream); + }; + var onerror = function onerror2(err) { + callback.call(stream, err); + }; + var onclose = function onclose2() { + var err; + if (readable && !readableEnded) { + if (!stream._readableState || !stream._readableState.ended) + err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + if (writable && !writableEnded) { + if (!stream._writableState || !stream._writableState.ended) + err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + }; + var onrequest = function onrequest2() { + stream.req.on("finish", onfinish); + }; + if (isRequest(stream)) { + stream.on("complete", onfinish); + stream.on("abort", onclose); + if (stream.req) + onrequest(); + else + stream.on("request", onrequest); + } else if (writable && !stream._writableState) { + stream.on("end", onlegacyfinish); + stream.on("close", onlegacyfinish); + } + stream.on("end", onend); + stream.on("finish", onfinish); + if (opts.error !== false) + stream.on("error", onerror); + stream.on("close", onclose); + return function() { + stream.removeListener("complete", onfinish); + stream.removeListener("abort", onclose); + stream.removeListener("request", onrequest); + if (stream.req) + stream.req.removeListener("finish", onfinish); + stream.removeListener("end", onlegacyfinish); + stream.removeListener("close", onlegacyfinish); + stream.removeListener("finish", onfinish); + stream.removeListener("end", onend); + stream.removeListener("error", onerror); + stream.removeListener("close", onclose); + }; + } + module2.exports = eos; + } +}); + +// node_modules/readable-stream/lib/internal/streams/async_iterator.js +var require_async_iterator = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports, module2) { + "use strict"; + var _Object$setPrototypeO; + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var finished = require_end_of_stream(); + var kLastResolve = Symbol("lastResolve"); + var kLastReject = Symbol("lastReject"); + var kError = Symbol("error"); + var kEnded = Symbol("ended"); + var kLastPromise = Symbol("lastPromise"); + var kHandlePromise = Symbol("handlePromise"); + var kStream = Symbol("stream"); + function createIterResult(value, done) { + return { + value, + done + }; + } + function readAndResolve(iter) { + var resolve = iter[kLastResolve]; + if (resolve !== null) { + var data = iter[kStream].read(); + if (data !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve(createIterResult(data, false)); + } + } + } + function onReadable(iter) { + process.nextTick(readAndResolve, iter); + } + function wrapForNext(lastPromise, iter) { + return function(resolve, reject) { + lastPromise.then(function() { + if (iter[kEnded]) { + resolve(createIterResult(void 0, true)); + return; + } + iter[kHandlePromise](resolve, reject); + }, reject); + }; + } + var AsyncIteratorPrototype = Object.getPrototypeOf(function() { + }); + var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, + next: function next() { + var _this = this; + var error = this[kError]; + if (error !== null) { + return Promise.reject(error); + } + if (this[kEnded]) { + return Promise.resolve(createIterResult(void 0, true)); + } + if (this[kStream].destroyed) { + return new Promise(function(resolve, reject) { + process.nextTick(function() { + if (_this[kError]) { + reject(_this[kError]); + } else { + resolve(createIterResult(void 0, true)); + } + }); + }); + } + var lastPromise = this[kLastPromise]; + var promise; + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + var data = this[kStream].read(); + if (data !== null) { + return Promise.resolve(createIterResult(data, false)); + } + promise = new Promise(this[kHandlePromise]); + } + this[kLastPromise] = promise; + return promise; + } + }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { + return this; + }), _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + return new Promise(function(resolve, reject) { + _this2[kStream].destroy(null, function(err) { + if (err) { + reject(err); + return; + } + resolve(createIterResult(void 0, true)); + }); + }); + }), _Object$setPrototypeO), AsyncIteratorPrototype); + var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) { + var _Object$create; + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + value: stream, + writable: true + }), _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true + }), _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true + }), _defineProperty(_Object$create, kError, { + value: null, + writable: true + }), _defineProperty(_Object$create, kEnded, { + value: stream._readableState.endEmitted, + writable: true + }), _defineProperty(_Object$create, kHandlePromise, { + value: function value(resolve, reject) { + var data = iterator[kStream].read(); + if (data) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(data, false)); + } else { + iterator[kLastResolve] = resolve; + iterator[kLastReject] = reject; + } + }, + writable: true + }), _Object$create)); + iterator[kLastPromise] = null; + finished(stream, function(err) { + if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { + var reject = iterator[kLastReject]; + if (reject !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject(err); + } + iterator[kError] = err; + return; + } + var resolve = iterator[kLastResolve]; + if (resolve !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(void 0, true)); + } + iterator[kEnded] = true; + }); + stream.on("readable", onReadable.bind(null, iterator)); + return iterator; + }; + module2.exports = createReadableStreamAsyncIterator; + } +}); + +// node_modules/readable-stream/lib/internal/streams/from.js +var require_from = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/from.js"(exports, module2) { + "use strict"; + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + function _asyncToGenerator(fn) { + return function() { + var self2 = this, args = arguments; + return new Promise(function(resolve, reject) { + var gen = fn.apply(self2, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(void 0); + }); + }; + } + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = null != arguments[i] ? arguments[i] : {}; + i % 2 ? ownKeys(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var ERR_INVALID_ARG_TYPE = require_errors2().codes.ERR_INVALID_ARG_TYPE; + function from(Readable, iterable, opts) { + var iterator; + if (iterable && typeof iterable.next === "function") { + iterator = iterable; + } else if (iterable && iterable[Symbol.asyncIterator]) + iterator = iterable[Symbol.asyncIterator](); + else if (iterable && iterable[Symbol.iterator]) + iterator = iterable[Symbol.iterator](); + else + throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable); + var readable = new Readable(_objectSpread({ + objectMode: true + }, opts)); + var reading = false; + readable._read = function() { + if (!reading) { + reading = true; + next(); + } + }; + function next() { + return _next2.apply(this, arguments); + } + function _next2() { + _next2 = _asyncToGenerator(function* () { + try { + var _yield$iterator$next = yield iterator.next(), value = _yield$iterator$next.value, done = _yield$iterator$next.done; + if (done) { + readable.push(null); + } else if (readable.push(yield value)) { + next(); + } else { + reading = false; + } + } catch (err) { + readable.destroy(err); + } + }); + return _next2.apply(this, arguments); + } + return readable; + } + module2.exports = from; + } +}); + +// node_modules/readable-stream/lib/_stream_readable.js +var require_stream_readable = __commonJS({ + "node_modules/readable-stream/lib/_stream_readable.js"(exports, module2) { + "use strict"; + module2.exports = Readable; + var Duplex; + Readable.ReadableState = ReadableState; + var EE = require("events").EventEmitter; + var EElistenerCount = function EElistenerCount2(emitter, type) { + return emitter.listeners(type).length; + }; + var Stream = require_stream2(); + var Buffer2 = require("buffer").Buffer; + var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk) { + return Buffer2.from(chunk); + } + function _isUint8Array(obj) { + return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; + } + var debugUtil = require("util"); + var debug; + if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog("stream"); + } else { + debug = function debug2() { + }; + } + var BufferList = require_buffer_list(); + var destroyImpl = require_destroy(); + var _require = require_state(); + var getHighWaterMark = _require.getHighWaterMark; + var _require$codes = require_errors2().codes; + var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; + var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF; + var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; + var ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; + var StringDecoder; + var createReadableStreamAsyncIterator; + var from; + require_inherits()(Readable, Stream); + var errorOrDestroy = destroyImpl.errorOrDestroy; + var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; + function prependListener(emitter, event, fn) { + if (typeof emitter.prependListener === "function") + return emitter.prependListener(event, fn); + if (!emitter._events || !emitter._events[event]) + emitter.on(event, fn); + else if (Array.isArray(emitter._events[event])) + emitter._events[event].unshift(fn); + else + emitter._events[event] = [fn, emitter._events[event]]; + } + function ReadableState(options, stream, isDuplex) { + Duplex = Duplex || require_stream_duplex(); + options = options || {}; + if (typeof isDuplex !== "boolean") + isDuplex = stream instanceof Duplex; + this.objectMode = !!options.objectMode; + if (isDuplex) + this.objectMode = this.objectMode || !!options.readableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex); + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + this.sync = true; + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.destroyed = false; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.awaitDrain = 0; + this.readingMore = false; + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) + StringDecoder = require("string_decoder/").StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } + } + function Readable(options) { + Duplex = Duplex || require_stream_duplex(); + if (!(this instanceof Readable)) + return new Readable(options); + var isDuplex = this instanceof Duplex; + this._readableState = new ReadableState(options, this, isDuplex); + this.readable = true; + if (options) { + if (typeof options.read === "function") + this._read = options.read; + if (typeof options.destroy === "function") + this._destroy = options.destroy; + } + Stream.call(this); + } + Object.defineProperty(Readable.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === void 0) { + return false; + } + return this._readableState.destroyed; + }, + set: function set(value) { + if (!this._readableState) { + return; + } + this._readableState.destroyed = value; + } + }); + Readable.prototype.destroy = destroyImpl.destroy; + Readable.prototype._undestroy = destroyImpl.undestroy; + Readable.prototype._destroy = function(err, cb) { + cb(err); + }; + Readable.prototype.push = function(chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + if (!state.objectMode) { + if (typeof chunk === "string") { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer2.from(chunk, encoding); + encoding = ""; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); + }; + Readable.prototype.unshift = function(chunk) { + return readableAddChunk(this, chunk, null, true, false); + }; + function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + debug("readableAddChunk", chunk); + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) + er = chunkInvalid(state, chunk); + if (er) { + errorOrDestroy(stream, er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + if (addToFront) { + if (state.endEmitted) + errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); + else + addChunk(stream, state, chunk, true); + } else if (state.ended) { + errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state.destroyed) { + return false; + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) + addChunk(stream, state, chunk, false); + else + maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + maybeReadMore(stream, state); + } + } + return !state.ended && (state.length < state.highWaterMark || state.length === 0); + } + function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + state.awaitDrain = 0; + stream.emit("data", chunk); + } else { + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) + state.buffer.unshift(chunk); + else + state.buffer.push(chunk); + if (state.needReadable) + emitReadable(stream); + } + maybeReadMore(stream, state); + } + function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk); + } + return er; + } + Readable.prototype.isPaused = function() { + return this._readableState.flowing === false; + }; + Readable.prototype.setEncoding = function(enc) { + if (!StringDecoder) + StringDecoder = require("string_decoder/").StringDecoder; + var decoder = new StringDecoder(enc); + this._readableState.decoder = decoder; + this._readableState.encoding = this._readableState.decoder.encoding; + var p = this._readableState.buffer.head; + var content = ""; + while (p !== null) { + content += decoder.write(p.data); + p = p.next; + } + this._readableState.buffer.clear(); + if (content !== "") + this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; + }; + var MAX_HWM = 1073741824; + function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; + } + function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) + return 0; + if (state.objectMode) + return 1; + if (n !== n) { + if (state.flowing && state.length) + return state.buffer.head.data.length; + else + return state.length; + } + if (n > state.highWaterMark) + state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) + return n; + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; + } + Readable.prototype.read = function(n) { + debug("read", n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + if (n !== 0) + state.emittedReadable = false; + if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + debug("read: emitReadable", state.length, state.ended); + if (state.length === 0 && state.ended) + endReadable(this); + else + emitReadable(this); + return null; + } + n = howMuchToRead(n, state); + if (n === 0 && state.ended) { + if (state.length === 0) + endReadable(this); + return null; + } + var doRead = state.needReadable; + debug("need readable", doRead); + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug("length less than watermark", doRead); + } + if (state.ended || state.reading) { + doRead = false; + debug("reading or ended", doRead); + } else if (doRead) { + debug("do read"); + state.reading = true; + state.sync = true; + if (state.length === 0) + state.needReadable = true; + this._read(state.highWaterMark); + state.sync = false; + if (!state.reading) + n = howMuchToRead(nOrig, state); + } + var ret; + if (n > 0) + ret = fromList(n, state); + else + ret = null; + if (ret === null) { + state.needReadable = state.length <= state.highWaterMark; + n = 0; + } else { + state.length -= n; + state.awaitDrain = 0; + } + if (state.length === 0) { + if (!state.ended) + state.needReadable = true; + if (nOrig !== n && state.ended) + endReadable(this); + } + if (ret !== null) + this.emit("data", ret); + return ret; + }; + function onEofChunk(stream, state) { + debug("onEofChunk"); + if (state.ended) + return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + if (state.sync) { + emitReadable(stream); + } else { + state.needReadable = false; + if (!state.emittedReadable) { + state.emittedReadable = true; + emitReadable_(stream); + } + } + } + function emitReadable(stream) { + var state = stream._readableState; + debug("emitReadable", state.needReadable, state.emittedReadable); + state.needReadable = false; + if (!state.emittedReadable) { + debug("emitReadable", state.flowing); + state.emittedReadable = true; + process.nextTick(emitReadable_, stream); + } + } + function emitReadable_(stream) { + var state = stream._readableState; + debug("emitReadable_", state.destroyed, state.length, state.ended); + if (!state.destroyed && (state.length || state.ended)) { + stream.emit("readable"); + state.emittedReadable = false; + } + state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; + flow(stream); + } + function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(maybeReadMore_, stream, state); + } + } + function maybeReadMore_(stream, state) { + while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { + var len = state.length; + debug("maybeReadMore read 0"); + stream.read(0); + if (len === state.length) + break; + } + state.readingMore = false; + } + Readable.prototype._read = function(n) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); + }; + Readable.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) + process.nextTick(endFn); + else + src.once("end", endFn); + dest.on("unpipe", onunpipe); + function onunpipe(readable, unpipeInfo) { + debug("onunpipe"); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + function onend() { + debug("onend"); + dest.end(); + } + var ondrain = pipeOnDrain(src); + dest.on("drain", ondrain); + var cleanedUp = false; + function cleanup() { + debug("cleanup"); + dest.removeListener("close", onclose); + dest.removeListener("finish", onfinish); + dest.removeListener("drain", ondrain); + dest.removeListener("error", onerror); + dest.removeListener("unpipe", onunpipe); + src.removeListener("end", onend); + src.removeListener("end", unpipe); + src.removeListener("data", ondata); + cleanedUp = true; + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) + ondrain(); + } + src.on("data", ondata); + function ondata(chunk) { + debug("ondata"); + var ret = dest.write(chunk); + debug("dest.write", ret); + if (ret === false) { + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug("false write response, pause", state.awaitDrain); + state.awaitDrain++; + } + src.pause(); + } + } + function onerror(er) { + debug("onerror", er); + unpipe(); + dest.removeListener("error", onerror); + if (EElistenerCount(dest, "error") === 0) + errorOrDestroy(dest, er); + } + prependListener(dest, "error", onerror); + function onclose() { + dest.removeListener("finish", onfinish); + unpipe(); + } + dest.once("close", onclose); + function onfinish() { + debug("onfinish"); + dest.removeListener("close", onclose); + unpipe(); + } + dest.once("finish", onfinish); + function unpipe() { + debug("unpipe"); + src.unpipe(dest); + } + dest.emit("pipe", src); + if (!state.flowing) { + debug("pipe resume"); + src.resume(); + } + return dest; + }; + function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state = src._readableState; + debug("pipeOnDrain", state.awaitDrain); + if (state.awaitDrain) + state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { + state.flowing = true; + flow(src); + } + }; + } + Readable.prototype.unpipe = function(dest) { + var state = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; + if (state.pipesCount === 0) + return this; + if (state.pipesCount === 1) { + if (dest && dest !== state.pipes) + return this; + if (!dest) + dest = state.pipes; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) + dest.emit("unpipe", this, unpipeInfo); + return this; + } + if (!dest) { + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + for (var i = 0; i < len; i++) + dests[i].emit("unpipe", this, { + hasUnpiped: false + }); + return this; + } + var index = indexOf(state.pipes, dest); + if (index === -1) + return this; + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + dest.emit("unpipe", this, unpipeInfo); + return this; + }; + Readable.prototype.on = function(ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + var state = this._readableState; + if (ev === "data") { + state.readableListening = this.listenerCount("readable") > 0; + if (state.flowing !== false) + this.resume(); + } else if (ev === "readable") { + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.flowing = false; + state.emittedReadable = false; + debug("on readable", state.length, state.reading); + if (state.length) { + emitReadable(this); + } else if (!state.reading) { + process.nextTick(nReadingNextTick, this); + } + } + } + return res; + }; + Readable.prototype.addListener = Readable.prototype.on; + Readable.prototype.removeListener = function(ev, fn) { + var res = Stream.prototype.removeListener.call(this, ev, fn); + if (ev === "readable") { + process.nextTick(updateReadableListening, this); + } + return res; + }; + Readable.prototype.removeAllListeners = function(ev) { + var res = Stream.prototype.removeAllListeners.apply(this, arguments); + if (ev === "readable" || ev === void 0) { + process.nextTick(updateReadableListening, this); + } + return res; + }; + function updateReadableListening(self2) { + var state = self2._readableState; + state.readableListening = self2.listenerCount("readable") > 0; + if (state.resumeScheduled && !state.paused) { + state.flowing = true; + } else if (self2.listenerCount("data") > 0) { + self2.resume(); + } + } + function nReadingNextTick(self2) { + debug("readable nexttick read 0"); + self2.read(0); + } + Readable.prototype.resume = function() { + var state = this._readableState; + if (!state.flowing) { + debug("resume"); + state.flowing = !state.readableListening; + resume(this, state); + } + state.paused = false; + return this; + }; + function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process.nextTick(resume_, stream, state); + } + } + function resume_(stream, state) { + debug("resume", state.reading); + if (!state.reading) { + stream.read(0); + } + state.resumeScheduled = false; + stream.emit("resume"); + flow(stream); + if (state.flowing && !state.reading) + stream.read(0); + } + Readable.prototype.pause = function() { + debug("call pause flowing=%j", this._readableState.flowing); + if (this._readableState.flowing !== false) { + debug("pause"); + this._readableState.flowing = false; + this.emit("pause"); + } + this._readableState.paused = true; + return this; + }; + function flow(stream) { + var state = stream._readableState; + debug("flow", state.flowing); + while (state.flowing && stream.read() !== null) + ; + } + Readable.prototype.wrap = function(stream) { + var _this = this; + var state = this._readableState; + var paused = false; + stream.on("end", function() { + debug("wrapped end"); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) + _this.push(chunk); + } + _this.push(null); + }); + stream.on("data", function(chunk) { + debug("wrapped data"); + if (state.decoder) + chunk = state.decoder.write(chunk); + if (state.objectMode && (chunk === null || chunk === void 0)) + return; + else if (!state.objectMode && (!chunk || !chunk.length)) + return; + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + for (var i in stream) { + if (this[i] === void 0 && typeof stream[i] === "function") { + this[i] = function methodWrap(method) { + return function methodWrapReturnFunction() { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + this._read = function(n2) { + debug("wrapped _read", n2); + if (paused) { + paused = false; + stream.resume(); + } + }; + return this; + }; + if (typeof Symbol === "function") { + Readable.prototype[Symbol.asyncIterator] = function() { + if (createReadableStreamAsyncIterator === void 0) { + createReadableStreamAsyncIterator = require_async_iterator(); + } + return createReadableStreamAsyncIterator(this); + }; + } + Object.defineProperty(Readable.prototype, "readableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.highWaterMark; + } + }); + Object.defineProperty(Readable.prototype, "readableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState && this._readableState.buffer; + } + }); + Object.defineProperty(Readable.prototype, "readableFlowing", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.flowing; + }, + set: function set(state) { + if (this._readableState) { + this._readableState.flowing = state; + } + } + }); + Readable._fromList = fromList; + Object.defineProperty(Readable.prototype, "readableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.length; + } + }); + function fromList(n, state) { + if (state.length === 0) + return null; + var ret; + if (state.objectMode) + ret = state.buffer.shift(); + else if (!n || n >= state.length) { + if (state.decoder) + ret = state.buffer.join(""); + else if (state.buffer.length === 1) + ret = state.buffer.first(); + else + ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + ret = state.buffer.consume(n, state.decoder); + } + return ret; + } + function endReadable(stream) { + var state = stream._readableState; + debug("endReadable", state.endEmitted); + if (!state.endEmitted) { + state.ended = true; + process.nextTick(endReadableNT, state, stream); + } + } + function endReadableNT(state, stream) { + debug("endReadableNT", state.endEmitted, state.length); + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit("end"); + if (state.autoDestroy) { + var wState = stream._writableState; + if (!wState || wState.autoDestroy && wState.finished) { + stream.destroy(); + } + } + } + } + if (typeof Symbol === "function") { + Readable.from = function(iterable, opts) { + if (from === void 0) { + from = require_from(); + } + return from(Readable, iterable, opts); + }; + } + function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) + return i; + } + return -1; + } + } +}); + +// node_modules/readable-stream/lib/_stream_duplex.js +var require_stream_duplex = __commonJS({ + "node_modules/readable-stream/lib/_stream_duplex.js"(exports, module2) { + "use strict"; + var objectKeys = Object.keys || function(obj) { + var keys2 = []; + for (var key in obj) + keys2.push(key); + return keys2; + }; + module2.exports = Duplex; + var Readable = require_stream_readable(); + var Writable = require_stream_writable(); + require_inherits()(Duplex, Readable); + { + keys = objectKeys(Writable.prototype); + for (v = 0; v < keys.length; v++) { + method = keys[v]; + if (!Duplex.prototype[method]) + Duplex.prototype[method] = Writable.prototype[method]; + } + } + var keys; + var method; + var v; + function Duplex(options) { + if (!(this instanceof Duplex)) + return new Duplex(options); + Readable.call(this, options); + Writable.call(this, options); + this.allowHalfOpen = true; + if (options) { + if (options.readable === false) + this.readable = false; + if (options.writable === false) + this.writable = false; + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once("end", onend); + } + } + } + Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } + }); + Object.defineProperty(Duplex.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } + }); + Object.defineProperty(Duplex.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } + }); + function onend() { + if (this._writableState.ended) + return; + process.nextTick(onEndNT, this); + } + function onEndNT(self2) { + self2.end(); + } + Object.defineProperty(Duplex.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === void 0 || this._writableState === void 0) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set(value) { + if (this._readableState === void 0 || this._writableState === void 0) { + return; + } + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } + }); + } +}); + +// node_modules/readable-stream/lib/_stream_writable.js +var require_stream_writable = __commonJS({ + "node_modules/readable-stream/lib/_stream_writable.js"(exports, module2) { + "use strict"; + module2.exports = Writable; + function CorkedRequest(state) { + var _this = this; + this.next = null; + this.entry = null; + this.finish = function() { + onCorkedFinish(_this, state); + }; + } + var Duplex; + Writable.WritableState = WritableState; + var internalUtil = { + deprecate: require_node() + }; + var Stream = require_stream2(); + var Buffer2 = require("buffer").Buffer; + var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk) { + return Buffer2.from(chunk); + } + function _isUint8Array(obj) { + return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; + } + var destroyImpl = require_destroy(); + var _require = require_state(); + var getHighWaterMark = _require.getHighWaterMark; + var _require$codes = require_errors2().codes; + var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; + var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; + var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; + var ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE; + var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; + var ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES; + var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END; + var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; + var errorOrDestroy = destroyImpl.errorOrDestroy; + require_inherits()(Writable, Stream); + function nop() { + } + function WritableState(options, stream, isDuplex) { + Duplex = Duplex || require_stream_duplex(); + options = options || {}; + if (typeof isDuplex !== "boolean") + isDuplex = stream instanceof Duplex; + this.objectMode = !!options.objectMode; + if (isDuplex) + this.objectMode = this.objectMode || !!options.writableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex); + this.finalCalled = false; + this.needDrain = false; + this.ending = false; + this.ended = false; + this.finished = false; + this.destroyed = false; + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.length = 0; + this.writing = false; + this.corked = 0; + this.sync = true; + this.bufferProcessing = false; + this.onwrite = function(er) { + onwrite(stream, er); + }; + this.writecb = null; + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; + this.pendingcb = 0; + this.prefinished = false; + this.errorEmitted = false; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.bufferedRequestCount = 0; + this.corkedRequestsFree = new CorkedRequest(this); + } + WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; + }; + (function() { + try { + Object.defineProperty(WritableState.prototype, "buffer", { + get: internalUtil.deprecate(function writableStateBufferGetter() { + return this.getBuffer(); + }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") + }); + } catch (_) { + } + })(); + var realHasInstance; + if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function value(object) { + if (realHasInstance.call(this, object)) + return true; + if (this !== Writable) + return false; + return object && object._writableState instanceof WritableState; + } + }); + } else { + realHasInstance = function realHasInstance2(object) { + return object instanceof this; + }; + } + function Writable(options) { + Duplex = Duplex || require_stream_duplex(); + var isDuplex = this instanceof Duplex; + if (!isDuplex && !realHasInstance.call(Writable, this)) + return new Writable(options); + this._writableState = new WritableState(options, this, isDuplex); + this.writable = true; + if (options) { + if (typeof options.write === "function") + this._write = options.write; + if (typeof options.writev === "function") + this._writev = options.writev; + if (typeof options.destroy === "function") + this._destroy = options.destroy; + if (typeof options.final === "function") + this._final = options.final; + } + Stream.call(this); + } + Writable.prototype.pipe = function() { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); + }; + function writeAfterEnd(stream, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); + errorOrDestroy(stream, er); + process.nextTick(cb, er); + } + function validChunk(stream, state, chunk, cb) { + var er; + if (chunk === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk !== "string" && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk); + } + if (er) { + errorOrDestroy(stream, er); + process.nextTick(cb, er); + return false; + } + return true; + } + Writable.prototype.write = function(chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + if (isBuf && !Buffer2.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (isBuf) + encoding = "buffer"; + else if (!encoding) + encoding = state.defaultEncoding; + if (typeof cb !== "function") + cb = nop; + if (state.ending) + writeAfterEnd(this, cb); + else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + return ret; + }; + Writable.prototype.cork = function() { + this._writableState.corked++; + }; + Writable.prototype.uncork = function() { + var state = this._writableState; + if (state.corked) { + state.corked--; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) + clearBuffer(this, state); + } + }; + Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + if (typeof encoding === "string") + encoding = encoding.toLowerCase(); + if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) + throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; + }; + Object.defineProperty(Writable.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } + }); + function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") { + chunk = Buffer2.from(chunk, encoding); + } + return chunk; + } + Object.defineProperty(Writable.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } + }); + function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = "buffer"; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + state.length += len; + var ret = state.length < state.highWaterMark; + if (!ret) + state.needDrain = true; + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk, + encoding, + isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + return ret; + } + function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (state.destroyed) + state.onwrite(new ERR_STREAM_DESTROYED("write")); + else if (writev) + stream._writev(chunk, state.onwrite); + else + stream._write(chunk, encoding, state.onwrite); + state.sync = false; + } + function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) { + process.nextTick(cb, er); + process.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + } else { + cb(er); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + finishMaybe(stream, state); + } + } + function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; + } + function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + if (typeof cb !== "function") + throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) + onwriteError(stream, state, sync, er, cb); + else { + var finished = needFinish(state) || stream.destroyed; + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + if (sync) { + process.nextTick(afterWrite, stream, state, finished, cb); + } else { + afterWrite(stream, state, finished, cb); + } + } + } + function afterWrite(stream, state, finished, cb) { + if (!finished) + onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); + } + function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit("drain"); + } + } + function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + if (stream._writev && entry && entry.next) { + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) + allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + doWrite(stream, state, true, state.length, buffer, "", holder.finish); + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + if (state.writing) { + break; + } + } + if (entry === null) + state.lastBufferedRequest = null; + } + state.bufferedRequest = entry; + state.bufferProcessing = false; + } + Writable.prototype._write = function(chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); + }; + Writable.prototype._writev = null; + Writable.prototype.end = function(chunk, encoding, cb) { + var state = this._writableState; + if (typeof chunk === "function") { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (chunk !== null && chunk !== void 0) + this.write(chunk, encoding); + if (state.corked) { + state.corked = 1; + this.uncork(); + } + if (!state.ending) + endWritable(this, state, cb); + return this; + }; + Object.defineProperty(Writable.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } + }); + function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; + } + function callFinal(stream, state) { + stream._final(function(err) { + state.pendingcb--; + if (err) { + errorOrDestroy(stream, err); + } + state.prefinished = true; + stream.emit("prefinish"); + finishMaybe(stream, state); + }); + } + function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === "function" && !state.destroyed) { + state.pendingcb++; + state.finalCalled = true; + process.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit("prefinish"); + } + } + } + function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit("finish"); + if (state.autoDestroy) { + var rState = stream._readableState; + if (!rState || rState.autoDestroy && rState.endEmitted) { + stream.destroy(); + } + } + } + } + return need; + } + function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) + process.nextTick(cb); + else + stream.once("finish", cb); + } + state.ended = true; + stream.writable = false; + } + function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + state.corkedRequestsFree.next = corkReq; + } + Object.defineProperty(Writable.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._writableState === void 0) { + return false; + } + return this._writableState.destroyed; + }, + set: function set(value) { + if (!this._writableState) { + return; + } + this._writableState.destroyed = value; + } + }); + Writable.prototype.destroy = destroyImpl.destroy; + Writable.prototype._undestroy = destroyImpl.undestroy; + Writable.prototype._destroy = function(err, cb) { + cb(err); + }; + } +}); + +// node_modules/winston-transport/modern.js +var require_modern = __commonJS({ + "node_modules/winston-transport/modern.js"(exports, module2) { + "use strict"; + var util = require("util"); + var Writable = require_stream_writable(); + var { LEVEL } = require_triple_beam(); + var TransportStream = module2.exports = function TransportStream2(options = {}) { + Writable.call(this, { objectMode: true, highWaterMark: options.highWaterMark }); + this.format = options.format; + this.level = options.level; + this.handleExceptions = options.handleExceptions; + this.handleRejections = options.handleRejections; + this.silent = options.silent; + if (options.log) + this.log = options.log; + if (options.logv) + this.logv = options.logv; + if (options.close) + this.close = options.close; + this.once("pipe", (logger) => { + this.levels = logger.levels; + this.parent = logger; + }); + this.once("unpipe", (src) => { + if (src === this.parent) { + this.parent = null; + if (this.close) { + this.close(); + } + } + }); + }; + util.inherits(TransportStream, Writable); + TransportStream.prototype._write = function _write(info, enc, callback) { + if (this.silent || info.exception === true && !this.handleExceptions) { + return callback(null); + } + const level = this.level || this.parent && this.parent.level; + if (!level || this.levels[level] >= this.levels[info[LEVEL]]) { + if (info && !this.format) { + return this.log(info, callback); + } + let errState; + let transformed; + try { + transformed = this.format.transform(Object.assign({}, info), this.format.options); + } catch (err) { + errState = err; + } + if (errState || !transformed) { + callback(); + if (errState) + throw errState; + return; + } + return this.log(transformed, callback); + } + this._writableState.sync = false; + return callback(null); + }; + TransportStream.prototype._writev = function _writev(chunks, callback) { + if (this.logv) { + const infos = chunks.filter(this._accept, this); + if (!infos.length) { + return callback(null); + } + return this.logv(infos, callback); + } + for (let i = 0; i < chunks.length; i++) { + if (!this._accept(chunks[i])) + continue; + if (chunks[i].chunk && !this.format) { + this.log(chunks[i].chunk, chunks[i].callback); + continue; + } + let errState; + let transformed; + try { + transformed = this.format.transform( + Object.assign({}, chunks[i].chunk), + this.format.options + ); + } catch (err) { + errState = err; + } + if (errState || !transformed) { + chunks[i].callback(); + if (errState) { + callback(null); + throw errState; + } + } else { + this.log(transformed, chunks[i].callback); + } + } + return callback(null); + }; + TransportStream.prototype._accept = function _accept(write) { + const info = write.chunk; + if (this.silent) { + return false; + } + const level = this.level || this.parent && this.parent.level; + if (info.exception === true || !level || this.levels[level] >= this.levels[info[LEVEL]]) { + if (this.handleExceptions || info.exception !== true) { + return true; + } + } + return false; + }; + TransportStream.prototype._nop = function _nop() { + return void 0; + }; + } +}); + +// node_modules/winston-transport/legacy.js +var require_legacy = __commonJS({ + "node_modules/winston-transport/legacy.js"(exports, module2) { + "use strict"; + var util = require("util"); + var { LEVEL } = require_triple_beam(); + var TransportStream = require_modern(); + var LegacyTransportStream = module2.exports = function LegacyTransportStream2(options = {}) { + TransportStream.call(this, options); + if (!options.transport || typeof options.transport.log !== "function") { + throw new Error("Invalid transport, must be an object with a log method."); + } + this.transport = options.transport; + this.level = this.level || options.transport.level; + this.handleExceptions = this.handleExceptions || options.transport.handleExceptions; + this._deprecated(); + function transportError(err) { + this.emit("error", err, this.transport); + } + if (!this.transport.__winstonError) { + this.transport.__winstonError = transportError.bind(this); + this.transport.on("error", this.transport.__winstonError); + } + }; + util.inherits(LegacyTransportStream, TransportStream); + LegacyTransportStream.prototype._write = function _write(info, enc, callback) { + if (this.silent || info.exception === true && !this.handleExceptions) { + return callback(null); + } + if (!this.level || this.levels[this.level] >= this.levels[info[LEVEL]]) { + this.transport.log(info[LEVEL], info.message, info, this._nop); + } + callback(null); + }; + LegacyTransportStream.prototype._writev = function _writev(chunks, callback) { + for (let i = 0; i < chunks.length; i++) { + if (this._accept(chunks[i])) { + this.transport.log( + chunks[i].chunk[LEVEL], + chunks[i].chunk.message, + chunks[i].chunk, + this._nop + ); + chunks[i].callback(); + } + } + return callback(null); + }; + LegacyTransportStream.prototype._deprecated = function _deprecated() { + console.error([ + `${this.transport.name} is a legacy winston transport. Consider upgrading: `, + "- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md" + ].join("\n")); + }; + LegacyTransportStream.prototype.close = function close() { + if (this.transport.close) { + this.transport.close(); + } + if (this.transport.__winstonError) { + this.transport.removeListener("error", this.transport.__winstonError); + this.transport.__winstonError = null; + } + }; + } +}); + +// node_modules/winston-transport/index.js +var require_winston_transport = __commonJS({ + "node_modules/winston-transport/index.js"(exports, module2) { + "use strict"; + module2.exports = require_modern(); + module2.exports.LegacyTransportStream = require_legacy(); + } +}); + +// node_modules/winston/lib/winston/transports/console.js +var require_console = __commonJS({ + "node_modules/winston/lib/winston/transports/console.js"(exports, module2) { + "use strict"; + var os2 = require("os"); + var { LEVEL, MESSAGE } = require_triple_beam(); + var TransportStream = require_winston_transport(); + module2.exports = class Console extends TransportStream { + /** + * Constructor function for the Console transport object responsible for + * persisting log messages and metadata to a terminal or TTY. + * @param {!Object} [options={}] - Options for this instance. + */ + constructor(options = {}) { + super(options); + // Keep a reference to the log, warn, and error console methods + // in case they get redirected to this transport after the logger is + // instantiated. This prevents a circular reference issue. + __publicField(this, "_consoleLog", console.log.bind(console)); + __publicField(this, "_consoleWarn", console.warn.bind(console)); + __publicField(this, "_consoleError", console.error.bind(console)); + this.name = options.name || "console"; + this.stderrLevels = this._stringArrayToSet(options.stderrLevels); + this.consoleWarnLevels = this._stringArrayToSet(options.consoleWarnLevels); + this.eol = typeof options.eol === "string" ? options.eol : os2.EOL; + this.forceConsole = options.forceConsole || false; + this.setMaxListeners(30); + } + /** + * Core logging method exposed to Winston. + * @param {Object} info - TODO: add param description. + * @param {Function} callback - TODO: add param description. + * @returns {undefined} + */ + log(info, callback) { + setImmediate(() => this.emit("logged", info)); + if (this.stderrLevels[info[LEVEL]]) { + if (console._stderr && !this.forceConsole) { + console._stderr.write(`${info[MESSAGE]}${this.eol}`); + } else { + this._consoleError(info[MESSAGE]); + } + if (callback) { + callback(); + } + return; + } else if (this.consoleWarnLevels[info[LEVEL]]) { + if (console._stderr && !this.forceConsole) { + console._stderr.write(`${info[MESSAGE]}${this.eol}`); + } else { + this._consoleWarn(info[MESSAGE]); + } + if (callback) { + callback(); + } + return; + } + if (console._stdout && !this.forceConsole) { + console._stdout.write(`${info[MESSAGE]}${this.eol}`); + } else { + this._consoleLog(info[MESSAGE]); + } + if (callback) { + callback(); + } + } + /** + * Returns a Set-like object with strArray's elements as keys (each with the + * value true). + * @param {Array} strArray - Array of Set-elements as strings. + * @param {?string} [errMsg] - Custom error message thrown on invalid input. + * @returns {Object} - TODO: add return description. + * @private + */ + _stringArrayToSet(strArray, errMsg) { + if (!strArray) + return {}; + errMsg = errMsg || "Cannot make set from type other than Array of string elements"; + if (!Array.isArray(strArray)) { + throw new Error(errMsg); + } + return strArray.reduce((set, el) => { + if (typeof el !== "string") { + throw new Error(errMsg); + } + set[el] = true; + return set; + }, {}); + } + }; + } +}); + +// node_modules/async/internal/isArrayLike.js +var require_isArrayLike = __commonJS({ + "node_modules/async/internal/isArrayLike.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isArrayLike; + function isArrayLike(value) { + return value && typeof value.length === "number" && value.length >= 0 && value.length % 1 === 0; + } + module2.exports = exports.default; + } +}); + +// node_modules/async/internal/initialParams.js +var require_initialParams = __commonJS({ + "node_modules/async/internal/initialParams.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = function(fn) { + return function(...args) { + var callback = args.pop(); + return fn.call(this, args, callback); + }; + }; + module2.exports = exports.default; + } +}); + +// node_modules/async/internal/setImmediate.js +var require_setImmediate = __commonJS({ + "node_modules/async/internal/setImmediate.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.fallback = fallback; + exports.wrap = wrap; + var hasQueueMicrotask = exports.hasQueueMicrotask = typeof queueMicrotask === "function" && queueMicrotask; + var hasSetImmediate = exports.hasSetImmediate = typeof setImmediate === "function" && setImmediate; + var hasNextTick = exports.hasNextTick = typeof process === "object" && typeof process.nextTick === "function"; + function fallback(fn) { + setTimeout(fn, 0); + } + function wrap(defer) { + return (fn, ...args) => defer(() => fn(...args)); + } + var _defer; + if (hasQueueMicrotask) { + _defer = queueMicrotask; + } else if (hasSetImmediate) { + _defer = setImmediate; + } else if (hasNextTick) { + _defer = process.nextTick; + } else { + _defer = fallback; + } + exports.default = wrap(_defer); + } +}); + +// node_modules/async/asyncify.js +var require_asyncify = __commonJS({ + "node_modules/async/asyncify.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = asyncify; + var _initialParams = require_initialParams(); + var _initialParams2 = _interopRequireDefault(_initialParams); + var _setImmediate = require_setImmediate(); + var _setImmediate2 = _interopRequireDefault(_setImmediate); + var _wrapAsync = require_wrapAsync(); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function asyncify(func) { + if ((0, _wrapAsync.isAsync)(func)) { + return function(...args) { + const callback = args.pop(); + const promise = func.apply(this, args); + return handlePromise(promise, callback); + }; + } + return (0, _initialParams2.default)(function(args, callback) { + var result2; + try { + result2 = func.apply(this, args); + } catch (e) { + return callback(e); + } + if (result2 && typeof result2.then === "function") { + return handlePromise(result2, callback); + } else { + callback(null, result2); + } + }); + } + function handlePromise(promise, callback) { + return promise.then((value) => { + invokeCallback(callback, null, value); + }, (err) => { + invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); + }); + } + function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (err) { + (0, _setImmediate2.default)((e) => { + throw e; + }, err); + } + } + module2.exports = exports.default; + } +}); + +// node_modules/async/internal/wrapAsync.js +var require_wrapAsync = __commonJS({ + "node_modules/async/internal/wrapAsync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.isAsyncIterable = exports.isAsyncGenerator = exports.isAsync = void 0; + var _asyncify = require_asyncify(); + var _asyncify2 = _interopRequireDefault(_asyncify); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isAsync(fn) { + return fn[Symbol.toStringTag] === "AsyncFunction"; + } + function isAsyncGenerator(fn) { + return fn[Symbol.toStringTag] === "AsyncGenerator"; + } + function isAsyncIterable(obj) { + return typeof obj[Symbol.asyncIterator] === "function"; + } + function wrapAsync(asyncFn) { + if (typeof asyncFn !== "function") + throw new Error("expected a function"); + return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn; + } + exports.default = wrapAsync; + exports.isAsync = isAsync; + exports.isAsyncGenerator = isAsyncGenerator; + exports.isAsyncIterable = isAsyncIterable; + } +}); + +// node_modules/async/internal/awaitify.js +var require_awaitify = __commonJS({ + "node_modules/async/internal/awaitify.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = awaitify; + function awaitify(asyncFn, arity) { + if (!arity) + 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, reject) => { + args[arity - 1] = (err, ...cbArgs) => { + if (err) + return reject(err); + resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); + }; + asyncFn.apply(this, args); + }); + } + return awaitable; + } + module2.exports = exports.default; + } +}); + +// node_modules/async/internal/parallel.js +var require_parallel = __commonJS({ + "node_modules/async/internal/parallel.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _isArrayLike = require_isArrayLike(); + var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + var _wrapAsync = require_wrapAsync(); + var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + var _awaitify = require_awaitify(); + var _awaitify2 = _interopRequireDefault(_awaitify); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + exports.default = (0, _awaitify2.default)((eachfn, tasks, callback) => { + var results = (0, _isArrayLike2.default)(tasks) ? [] : {}; + eachfn(tasks, (task, key, taskCb) => { + (0, _wrapAsync2.default)(task)((err, ...result2) => { + if (result2.length < 2) { + [result2] = result2; + } + results[key] = result2; + taskCb(err); + }); + }, (err) => callback(err, results)); + }, 3); + module2.exports = exports.default; + } +}); + +// node_modules/async/internal/once.js +var require_once = __commonJS({ + "node_modules/async/internal/once.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = once; + function once(fn) { + function wrapper(...args) { + if (fn === null) + return; + var callFn = fn; + fn = null; + callFn.apply(this, args); + } + Object.assign(wrapper, fn); + return wrapper; + } + module2.exports = exports.default; + } +}); + +// node_modules/async/internal/getIterator.js +var require_getIterator = __commonJS({ + "node_modules/async/internal/getIterator.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = function(coll) { + return coll[Symbol.iterator] && coll[Symbol.iterator](); + }; + module2.exports = exports.default; + } +}); + +// node_modules/async/internal/iterator.js +var require_iterator = __commonJS({ + "node_modules/async/internal/iterator.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = createIterator; + var _isArrayLike = require_isArrayLike(); + var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + var _getIterator = require_getIterator(); + var _getIterator2 = _interopRequireDefault(_getIterator); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function createArrayIterator(coll) { + var i = -1; + var len = coll.length; + return function next() { + return ++i < len ? { value: coll[i], key: i } : null; + }; + } + function createES2015Iterator(iterator) { + var i = -1; + return function next() { + var item = iterator.next(); + if (item.done) + return null; + i++; + return { value: item.value, key: i }; + }; + } + function createObjectIterator(obj) { + var okeys = obj ? Object.keys(obj) : []; + var i = -1; + var len = okeys.length; + return function next() { + var key = okeys[++i]; + if (key === "__proto__") { + return next(); + } + return i < len ? { value: obj[key], key } : null; + }; + } + function createIterator(coll) { + if ((0, _isArrayLike2.default)(coll)) { + return createArrayIterator(coll); + } + var iterator = (0, _getIterator2.default)(coll); + return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); + } + module2.exports = exports.default; + } +}); + +// node_modules/async/internal/onlyOnce.js +var require_onlyOnce = __commonJS({ + "node_modules/async/internal/onlyOnce.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = onlyOnce; + 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); + }; + } + module2.exports = exports.default; + } +}); + +// node_modules/async/internal/breakLoop.js +var require_breakLoop = __commonJS({ + "node_modules/async/internal/breakLoop.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + var breakLoop = {}; + exports.default = breakLoop; + module2.exports = exports.default; + } +}); + +// node_modules/async/internal/asyncEachOfLimit.js +var require_asyncEachOfLimit = __commonJS({ + "node_modules/async/internal/asyncEachOfLimit.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = asyncEachOfLimit; + var _breakLoop = require_breakLoop(); + var _breakLoop2 = _interopRequireDefault(_breakLoop); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + 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); + } + function iterateeCallback(err, result2) { + running -= 1; + if (canceled) + return; + if (err) + return handleError(err); + if (err === false) { + done = true; + canceled = true; + return; + } + if (result2 === _breakLoop2.default || done && running <= 0) { + done = true; + return callback(null); + } + replenish(); + } + function handleError(err) { + if (canceled) + return; + awaiting = false; + done = true; + callback(err); + } + replenish(); + } + module2.exports = exports.default; + } +}); + +// node_modules/async/internal/eachOfLimit.js +var require_eachOfLimit = __commonJS({ + "node_modules/async/internal/eachOfLimit.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _once = require_once(); + var _once2 = _interopRequireDefault(_once); + var _iterator = require_iterator(); + var _iterator2 = _interopRequireDefault(_iterator); + var _onlyOnce = require_onlyOnce(); + var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + var _wrapAsync = require_wrapAsync(); + var _asyncEachOfLimit = require_asyncEachOfLimit(); + var _asyncEachOfLimit2 = _interopRequireDefault(_asyncEachOfLimit); + var _breakLoop = require_breakLoop(); + var _breakLoop2 = _interopRequireDefault(_breakLoop); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + exports.default = (limit) => { + return (obj, iteratee, callback) => { + callback = (0, _once2.default)(callback); + if (limit <= 0) { + throw new RangeError("concurrency limit cannot be less than 1"); + } + if (!obj) { + return callback(null); + } + if ((0, _wrapAsync.isAsyncGenerator)(obj)) { + return (0, _asyncEachOfLimit2.default)(obj, limit, iteratee, callback); + } + if ((0, _wrapAsync.isAsyncIterable)(obj)) { + return (0, _asyncEachOfLimit2.default)(obj[Symbol.asyncIterator](), limit, iteratee, callback); + } + var nextElem = (0, _iterator2.default)(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 === _breakLoop2.default || done && running <= 0) { + done = true; + return callback(null); + } else if (!looping) { + replenish(); + } + } + 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, (0, _onlyOnce2.default)(iterateeCallback)); + } + looping = false; + } + replenish(); + }; + }; + module2.exports = exports.default; + } +}); + +// node_modules/async/eachOfLimit.js +var require_eachOfLimit2 = __commonJS({ + "node_modules/async/eachOfLimit.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _eachOfLimit2 = require_eachOfLimit(); + var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2); + var _wrapAsync = require_wrapAsync(); + var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + var _awaitify = require_awaitify(); + var _awaitify2 = _interopRequireDefault(_awaitify); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function eachOfLimit(coll, limit, iteratee, callback) { + return (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback); + } + exports.default = (0, _awaitify2.default)(eachOfLimit, 4); + module2.exports = exports.default; + } +}); + +// node_modules/async/eachOfSeries.js +var require_eachOfSeries = __commonJS({ + "node_modules/async/eachOfSeries.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _eachOfLimit = require_eachOfLimit2(); + var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + var _awaitify = require_awaitify(); + var _awaitify2 = _interopRequireDefault(_awaitify); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function eachOfSeries(coll, iteratee, callback) { + return (0, _eachOfLimit2.default)(coll, 1, iteratee, callback); + } + exports.default = (0, _awaitify2.default)(eachOfSeries, 3); + module2.exports = exports.default; + } +}); + +// node_modules/async/series.js +var require_series = __commonJS({ + "node_modules/async/series.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = series; + var _parallel2 = require_parallel(); + var _parallel3 = _interopRequireDefault(_parallel2); + var _eachOfSeries = require_eachOfSeries(); + var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function series(tasks, callback) { + return (0, _parallel3.default)(_eachOfSeries2.default, tasks, callback); + } + module2.exports = exports.default; + } +}); + +// node_modules/readable-stream/lib/_stream_transform.js +var require_stream_transform = __commonJS({ + "node_modules/readable-stream/lib/_stream_transform.js"(exports, module2) { + "use strict"; + module2.exports = Transform; + var _require$codes = require_errors2().codes; + var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; + var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; + var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING; + var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; + var Duplex = require_stream_duplex(); + require_inherits()(Transform, Duplex); + function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; + if (cb === null) { + return this.emit("error", new ERR_MULTIPLE_CALLBACK()); + } + ts.writechunk = null; + ts.writecb = null; + if (data != null) + this.push(data); + cb(er); + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } + } + function Transform(options) { + if (!(this instanceof Transform)) + return new Transform(options); + Duplex.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + this._readableState.needReadable = true; + this._readableState.sync = false; + if (options) { + if (typeof options.transform === "function") + this._transform = options.transform; + if (typeof options.flush === "function") + this._flush = options.flush; + } + this.on("prefinish", prefinish); + } + function prefinish() { + var _this = this; + if (typeof this._flush === "function" && !this._readableState.destroyed) { + this._flush(function(er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } + } + Transform.prototype.push = function(chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); + }; + Transform.prototype._transform = function(chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); + }; + Transform.prototype._write = function(chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } + }; + Transform.prototype._read = function(n) { + var ts = this._transformState; + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + ts.needTransform = true; + } + }; + Transform.prototype._destroy = function(err, cb) { + Duplex.prototype._destroy.call(this, err, function(err2) { + cb(err2); + }); + }; + function done(stream, er, data) { + if (er) + return stream.emit("error", er); + if (data != null) + stream.push(data); + if (stream._writableState.length) + throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream._transformState.transforming) + throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream.push(null); + } + } +}); + +// node_modules/readable-stream/lib/_stream_passthrough.js +var require_stream_passthrough = __commonJS({ + "node_modules/readable-stream/lib/_stream_passthrough.js"(exports, module2) { + "use strict"; + module2.exports = PassThrough; + var Transform = require_stream_transform(); + require_inherits()(PassThrough, Transform); + function PassThrough(options) { + if (!(this instanceof PassThrough)) + return new PassThrough(options); + Transform.call(this, options); + } + PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); + }; + } +}); + +// node_modules/readable-stream/lib/internal/streams/pipeline.js +var require_pipeline = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports, module2) { + "use strict"; + var eos; + function once(callback) { + var called = false; + return function() { + if (called) + return; + called = true; + callback.apply(void 0, arguments); + }; + } + var _require$codes = require_errors2().codes; + var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS; + var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; + function noop(err) { + if (err) + throw err; + } + function isRequest(stream) { + return stream.setHeader && typeof stream.abort === "function"; + } + function destroyer(stream, reading, writing, callback) { + callback = once(callback); + var closed = false; + stream.on("close", function() { + closed = true; + }); + if (eos === void 0) + eos = require_end_of_stream(); + eos(stream, { + readable: reading, + writable: writing + }, function(err) { + if (err) + return callback(err); + closed = true; + callback(); + }); + var destroyed = false; + return function(err) { + if (closed) + return; + if (destroyed) + return; + destroyed = true; + if (isRequest(stream)) + return stream.abort(); + if (typeof stream.destroy === "function") + return stream.destroy(); + callback(err || new ERR_STREAM_DESTROYED("pipe")); + }; + } + function call(fn) { + fn(); + } + function pipe(from, to) { + return from.pipe(to); + } + function popCallback(streams) { + if (!streams.length) + return noop; + if (typeof streams[streams.length - 1] !== "function") + return noop; + return streams.pop(); + } + function pipeline() { + for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { + streams[_key] = arguments[_key]; + } + var callback = popCallback(streams); + if (Array.isArray(streams[0])) + streams = streams[0]; + if (streams.length < 2) { + throw new ERR_MISSING_ARGS("streams"); + } + var error; + var destroys = streams.map(function(stream, i) { + var reading = i < streams.length - 1; + var writing = i > 0; + return destroyer(stream, reading, writing, function(err) { + if (!error) + error = err; + if (err) + destroys.forEach(call); + if (reading) + return; + destroys.forEach(call); + callback(error); + }); + }); + return streams.reduce(pipe); + } + module2.exports = pipeline; + } +}); + +// node_modules/readable-stream/readable.js +var require_readable = __commonJS({ + "node_modules/readable-stream/readable.js"(exports, module2) { + var Stream = require("stream"); + if (process.env.READABLE_STREAM === "disable" && Stream) { + module2.exports = Stream.Readable; + Object.assign(module2.exports, Stream); + module2.exports.Stream = Stream; + } else { + exports = module2.exports = require_stream_readable(); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require_stream_writable(); + exports.Duplex = require_stream_duplex(); + exports.Transform = require_stream_transform(); + exports.PassThrough = require_stream_passthrough(); + exports.finished = require_end_of_stream(); + exports.pipeline = require_pipeline(); + } + } +}); + +// node_modules/@dabh/diagnostics/diagnostics.js +var require_diagnostics = __commonJS({ + "node_modules/@dabh/diagnostics/diagnostics.js"(exports, module2) { + var adapters = []; + var modifiers = []; + var logger = function devnull() { + }; + function use(adapter) { + if (~adapters.indexOf(adapter)) + return false; + adapters.push(adapter); + return true; + } + function set(custom) { + logger = custom; + } + function enabled(namespace) { + var async = []; + for (var i = 0; i < adapters.length; i++) { + if (adapters[i].async) { + async.push(adapters[i]); + continue; + } + if (adapters[i](namespace)) + return true; + } + if (!async.length) + return false; + return new Promise(function pinky(resolve) { + Promise.all( + async.map(function prebind(fn) { + return fn(namespace); + }) + ).then(function resolved(values) { + resolve(values.some(Boolean)); + }); + }); + } + function modify(fn) { + if (~modifiers.indexOf(fn)) + return false; + modifiers.push(fn); + return true; + } + function write() { + logger.apply(logger, arguments); + } + function process2(message) { + for (var i = 0; i < modifiers.length; i++) { + message = modifiers[i].apply(modifiers[i], arguments); + } + return message; + } + function introduce(fn, options) { + var has = Object.prototype.hasOwnProperty; + for (var key in options) { + if (has.call(options, key)) { + fn[key] = options[key]; + } + } + return fn; + } + function nope(options) { + options.enabled = false; + options.modify = modify; + options.set = set; + options.use = use; + return introduce(function diagnopes() { + return false; + }, options); + } + function yep(options) { + function diagnostics() { + var args = Array.prototype.slice.call(arguments, 0); + write.call(write, options, process2(args, options)); + return true; + } + options.enabled = true; + options.modify = modify; + options.set = set; + options.use = use; + return introduce(diagnostics, options); + } + module2.exports = function create(diagnostics) { + diagnostics.introduce = introduce; + diagnostics.enabled = enabled; + diagnostics.process = process2; + diagnostics.modify = modify; + diagnostics.write = write; + diagnostics.nope = nope; + diagnostics.yep = yep; + diagnostics.set = set; + diagnostics.use = use; + return diagnostics; + }; + } +}); + +// node_modules/@dabh/diagnostics/node/production.js +var require_production = __commonJS({ + "node_modules/@dabh/diagnostics/node/production.js"(exports, module2) { + var create = require_diagnostics(); + var diagnostics = create(function prod(namespace, options) { + options = options || {}; + options.namespace = namespace; + options.prod = true; + options.dev = false; + if (!(options.force || prod.force)) + return prod.nope(options); + return prod.yep(options); + }); + module2.exports = diagnostics; + } +}); + +// node_modules/color-name/index.js +var require_color_name = __commonJS({ + "node_modules/color-name/index.js"(exports, module2) { + "use strict"; + module2.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] + }; + } +}); + +// node_modules/is-arrayish/index.js +var require_is_arrayish = __commonJS({ + "node_modules/is-arrayish/index.js"(exports, module2) { + module2.exports = function isArrayish(obj) { + if (!obj || typeof obj === "string") { + return false; + } + return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== "String"); + }; + } +}); + +// node_modules/simple-swizzle/index.js +var require_simple_swizzle = __commonJS({ + "node_modules/simple-swizzle/index.js"(exports, module2) { + "use strict"; + var isArrayish = require_is_arrayish(); + var concat = Array.prototype.concat; + var slice = Array.prototype.slice; + var swizzle = module2.exports = function swizzle2(args) { + var results = []; + for (var i = 0, len = args.length; i < len; i++) { + var arg = args[i]; + if (isArrayish(arg)) { + results = concat.call(results, slice.call(arg)); + } else { + results.push(arg); + } + } + return results; + }; + swizzle.wrap = function(fn) { + return function() { + return fn(swizzle(arguments)); + }; + }; + } +}); + +// node_modules/color-string/index.js +var require_color_string = __commonJS({ + "node_modules/color-string/index.js"(exports, module2) { + var colorNames = require_color_name(); + var swizzle = require_simple_swizzle(); + var hasOwnProperty = Object.hasOwnProperty; + var reverseNames = /* @__PURE__ */ Object.create(null); + for (name in colorNames) { + if (hasOwnProperty.call(colorNames, name)) { + reverseNames[colorNames[name]] = name; + } + } + var name; + var cs = module2.exports = { + to: {}, + get: {} + }; + cs.get = function(string) { + var prefix = string.substring(0, 3).toLowerCase(); + var val; + var model; + switch (prefix) { + case "hsl": + val = cs.get.hsl(string); + model = "hsl"; + break; + case "hwb": + val = cs.get.hwb(string); + model = "hwb"; + break; + default: + val = cs.get.rgb(string); + model = "rgb"; + break; + } + if (!val) { + return null; + } + return { model, value: val }; + }; + cs.get.rgb = function(string) { + if (!string) { + return null; + } + var abbr = /^#([a-f0-9]{3,4})$/i; + var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i; + var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/; + var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/; + var keyword = /^(\w+)$/; + var rgb = [0, 0, 0, 1]; + var match; + var i; + var hexAlpha; + if (match = string.match(hex)) { + hexAlpha = match[2]; + match = match[1]; + for (i = 0; i < 3; i++) { + var i2 = i * 2; + rgb[i] = parseInt(match.slice(i2, i2 + 2), 16); + } + if (hexAlpha) { + rgb[3] = parseInt(hexAlpha, 16) / 255; + } + } else if (match = string.match(abbr)) { + match = match[1]; + hexAlpha = match[3]; + for (i = 0; i < 3; i++) { + rgb[i] = parseInt(match[i] + match[i], 16); + } + if (hexAlpha) { + rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255; + } + } else if (match = string.match(rgba)) { + for (i = 0; i < 3; i++) { + rgb[i] = parseInt(match[i + 1], 0); + } + if (match[4]) { + if (match[5]) { + rgb[3] = parseFloat(match[4]) * 0.01; + } else { + rgb[3] = parseFloat(match[4]); + } + } + } else if (match = string.match(per)) { + for (i = 0; i < 3; i++) { + rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55); + } + if (match[4]) { + if (match[5]) { + rgb[3] = parseFloat(match[4]) * 0.01; + } else { + rgb[3] = parseFloat(match[4]); + } + } + } else if (match = string.match(keyword)) { + if (match[1] === "transparent") { + return [0, 0, 0, 0]; + } + if (!hasOwnProperty.call(colorNames, match[1])) { + return null; + } + rgb = colorNames[match[1]]; + rgb[3] = 1; + return rgb; + } else { + return null; + } + for (i = 0; i < 3; i++) { + rgb[i] = clamp(rgb[i], 0, 255); + } + rgb[3] = clamp(rgb[3], 0, 1); + return rgb; + }; + cs.get.hsl = function(string) { + if (!string) { + return null; + } + var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/; + var match = string.match(hsl); + if (match) { + var alpha = parseFloat(match[4]); + var h = (parseFloat(match[1]) % 360 + 360) % 360; + var s = clamp(parseFloat(match[2]), 0, 100); + var l = clamp(parseFloat(match[3]), 0, 100); + var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1); + return [h, s, l, a]; + } + return null; + }; + cs.get.hwb = function(string) { + if (!string) { + return null; + } + var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/; + var match = string.match(hwb); + if (match) { + var alpha = parseFloat(match[4]); + var h = (parseFloat(match[1]) % 360 + 360) % 360; + var w = clamp(parseFloat(match[2]), 0, 100); + var b = clamp(parseFloat(match[3]), 0, 100); + var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1); + return [h, w, b, a]; + } + return null; + }; + cs.to.hex = function() { + var rgba = swizzle(arguments); + return "#" + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : ""); + }; + cs.to.rgb = function() { + var rgba = swizzle(arguments); + return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ")" : "rgba(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ", " + rgba[3] + ")"; + }; + cs.to.rgb.percent = function() { + var rgba = swizzle(arguments); + var r = Math.round(rgba[0] / 255 * 100); + var g = Math.round(rgba[1] / 255 * 100); + var b = Math.round(rgba[2] / 255 * 100); + return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r + "%, " + g + "%, " + b + "%)" : "rgba(" + r + "%, " + g + "%, " + b + "%, " + rgba[3] + ")"; + }; + cs.to.hsl = function() { + var hsla = swizzle(arguments); + return hsla.length < 4 || hsla[3] === 1 ? "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)" : "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")"; + }; + cs.to.hwb = function() { + var hwba = swizzle(arguments); + var a = ""; + if (hwba.length >= 4 && hwba[3] !== 1) { + a = ", " + hwba[3]; + } + return "hwb(" + hwba[0] + ", " + hwba[1] + "%, " + hwba[2] + "%" + a + ")"; + }; + cs.to.keyword = function(rgb) { + return reverseNames[rgb.slice(0, 3)]; + }; + function clamp(num, min, max) { + return Math.min(Math.max(min, num), max); + } + function hexDouble(num) { + var str = Math.round(num).toString(16).toUpperCase(); + return str.length < 2 ? "0" + str : str; + } + } +}); + +// node_modules/color/node_modules/color-name/index.js +var require_color_name2 = __commonJS({ + "node_modules/color/node_modules/color-name/index.js"(exports, module2) { + "use strict"; + module2.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] + }; + } +}); + +// node_modules/color/node_modules/color-convert/conversions.js +var require_conversions = __commonJS({ + "node_modules/color/node_modules/color-convert/conversions.js"(exports, module2) { + var cssKeywords = require_color_name2(); + var reverseKeywords = {}; + for (key in cssKeywords) { + if (cssKeywords.hasOwnProperty(key)) { + reverseKeywords[cssKeywords[key]] = key; + } + } + var key; + var convert = module2.exports = { + rgb: { channels: 3, labels: "rgb" }, + hsl: { channels: 3, labels: "hsl" }, + hsv: { channels: 3, labels: "hsv" }, + hwb: { channels: 3, labels: "hwb" }, + cmyk: { channels: 4, labels: "cmyk" }, + xyz: { channels: 3, labels: "xyz" }, + lab: { channels: 3, labels: "lab" }, + lch: { channels: 3, labels: "lch" }, + hex: { channels: 1, labels: ["hex"] }, + keyword: { channels: 1, labels: ["keyword"] }, + ansi16: { channels: 1, labels: ["ansi16"] }, + ansi256: { channels: 1, labels: ["ansi256"] }, + hcg: { channels: 3, labels: ["h", "c", "g"] }, + apple: { channels: 3, labels: ["r16", "g16", "b16"] }, + gray: { channels: 1, labels: ["gray"] } + }; + for (model in convert) { + if (convert.hasOwnProperty(model)) { + if (!("channels" in convert[model])) { + throw new Error("missing channels property: " + model); + } + if (!("labels" in convert[model])) { + throw new Error("missing channel labels property: " + model); + } + if (convert[model].labels.length !== convert[model].channels) { + throw new Error("channel and label counts mismatch: " + model); + } + channels = convert[model].channels; + labels = convert[model].labels; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], "channels", { value: channels }); + Object.defineProperty(convert[model], "labels", { value: labels }); + } + } + var channels; + var labels; + var model; + convert.rgb.hsl = function(rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var min = Math.min(r, g, b); + var max = Math.max(r, g, b); + var delta = max - min; + var h; + var s; + var l; + if (max === min) { + h = 0; + } else if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else if (b === max) { + h = 4 + (r - g) / delta; + } + h = Math.min(h * 60, 360); + if (h < 0) { + h += 360; + } + l = (min + max) / 2; + if (max === min) { + s = 0; + } else if (l <= 0.5) { + s = delta / (max + min); + } else { + s = delta / (2 - max - min); + } + return [h, s * 100, l * 100]; + }; + convert.rgb.hsv = function(rgb) { + var rdif; + var gdif; + var bdif; + var h; + var s; + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var v = Math.max(r, g, b); + var diff = v - Math.min(r, g, b); + var diffc = function(c) { + return (v - c) / 6 / diff + 1 / 2; + }; + if (diff === 0) { + h = s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = 1 / 3 + rdif - bdif; + } else if (b === v) { + h = 2 / 3 + gdif - rdif; + } + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } + return [ + h * 360, + s * 100, + v * 100 + ]; + }; + convert.rgb.hwb = function(rgb) { + var r = rgb[0]; + var g = rgb[1]; + var b = rgb[2]; + var h = convert.rgb.hsl(rgb)[0]; + var w = 1 / 255 * Math.min(r, Math.min(g, b)); + b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); + return [h, w * 100, b * 100]; + }; + convert.rgb.cmyk = function(rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var c; + var m; + var y; + var k; + k = Math.min(1 - r, 1 - g, 1 - b); + c = (1 - r - k) / (1 - k) || 0; + m = (1 - g - k) / (1 - k) || 0; + y = (1 - b - k) / (1 - k) || 0; + return [c * 100, m * 100, y * 100, k * 100]; + }; + function comparativeDistance(x, y) { + return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2); + } + convert.rgb.keyword = function(rgb) { + var reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } + var currentClosestDistance = Infinity; + var currentClosestKeyword; + for (var keyword in cssKeywords) { + if (cssKeywords.hasOwnProperty(keyword)) { + var value = cssKeywords[keyword]; + var distance = comparativeDistance(rgb, value); + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } + } + return currentClosestKeyword; + }; + convert.keyword.rgb = function(keyword) { + return cssKeywords[keyword]; + }; + convert.rgb.xyz = function(rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92; + g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92; + b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92; + var x = r * 0.4124 + g * 0.3576 + b * 0.1805; + var y = r * 0.2126 + g * 0.7152 + b * 0.0722; + var z = r * 0.0193 + g * 0.1192 + b * 0.9505; + return [x * 100, y * 100, z * 100]; + }; + convert.rgb.lab = function(rgb) { + var xyz = convert.rgb.xyz(rgb); + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + var l; + var a; + var b; + x /= 95.047; + y /= 100; + z /= 108.883; + x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116; + y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116; + z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116; + l = 116 * y - 16; + a = 500 * (x - y); + b = 200 * (y - z); + return [l, a, b]; + }; + convert.hsl.rgb = function(hsl) { + var h = hsl[0] / 360; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var t1; + var t2; + var t3; + var rgb; + var val; + if (s === 0) { + val = l * 255; + return [val, val, val]; + } + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } + t1 = 2 * l - t2; + rgb = [0, 0, 0]; + for (var i = 0; i < 3; i++) { + t3 = h + 1 / 3 * -(i - 1); + if (t3 < 0) { + t3++; + } + if (t3 > 1) { + t3--; + } + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; + } + rgb[i] = val * 255; + } + return rgb; + }; + convert.hsl.hsv = function(hsl) { + var h = hsl[0]; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var smin = s; + var lmin = Math.max(l, 0.01); + var sv; + var v; + l *= 2; + s *= l <= 1 ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + v = (l + s) / 2; + sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s); + return [h, sv * 100, v * 100]; + }; + convert.hsv.rgb = function(hsv) { + var h = hsv[0] / 60; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var hi = Math.floor(h) % 6; + var f = h - Math.floor(h); + var p = 255 * v * (1 - s); + var q = 255 * v * (1 - s * f); + var t = 255 * v * (1 - s * (1 - f)); + v *= 255; + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; + } + }; + convert.hsv.hsl = function(hsv) { + var h = hsv[0]; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var vmin = Math.max(v, 0.01); + var lmin; + var sl; + var l; + l = (2 - s) * v; + lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= lmin <= 1 ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; + return [h, sl * 100, l * 100]; + }; + convert.hwb.rgb = function(hwb) { + var h = hwb[0] / 360; + var wh = hwb[1] / 100; + var bl = hwb[2] / 100; + var ratio = wh + bl; + var i; + var v; + var f; + var n; + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } + i = Math.floor(6 * h); + v = 1 - bl; + f = 6 * h - i; + if ((i & 1) !== 0) { + f = 1 - f; + } + n = wh + f * (v - wh); + var r; + var g; + var b; + switch (i) { + default: + case 6: + case 0: + r = v; + g = n; + b = wh; + break; + case 1: + r = n; + g = v; + b = wh; + break; + case 2: + r = wh; + g = v; + b = n; + break; + case 3: + r = wh; + g = n; + b = v; + break; + case 4: + r = n; + g = wh; + b = v; + break; + case 5: + r = v; + g = wh; + b = n; + break; + } + return [r * 255, g * 255, b * 255]; + }; + convert.cmyk.rgb = function(cmyk) { + var c = cmyk[0] / 100; + var m = cmyk[1] / 100; + var y = cmyk[2] / 100; + var k = cmyk[3] / 100; + var r; + var g; + var b; + r = 1 - Math.min(1, c * (1 - k) + k); + g = 1 - Math.min(1, m * (1 - k) + k); + b = 1 - Math.min(1, y * (1 - k) + k); + return [r * 255, g * 255, b * 255]; + }; + convert.xyz.rgb = function(xyz) { + var x = xyz[0] / 100; + var y = xyz[1] / 100; + var z = xyz[2] / 100; + var r; + var g; + var b; + r = x * 3.2406 + y * -1.5372 + z * -0.4986; + g = x * -0.9689 + y * 1.8758 + z * 0.0415; + b = x * 0.0557 + y * -0.204 + z * 1.057; + r = r > 31308e-7 ? 1.055 * Math.pow(r, 1 / 2.4) - 0.055 : r * 12.92; + g = g > 31308e-7 ? 1.055 * Math.pow(g, 1 / 2.4) - 0.055 : g * 12.92; + b = b > 31308e-7 ? 1.055 * Math.pow(b, 1 / 2.4) - 0.055 : b * 12.92; + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); + return [r * 255, g * 255, b * 255]; + }; + convert.xyz.lab = function(xyz) { + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + var l; + var a; + var b; + x /= 95.047; + y /= 100; + z /= 108.883; + x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116; + y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116; + z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116; + l = 116 * y - 16; + a = 500 * (x - y); + b = 200 * (y - z); + return [l, a, b]; + }; + convert.lab.xyz = function(lab) { + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var x; + var y; + var z; + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; + var y2 = Math.pow(y, 3); + var x2 = Math.pow(x, 3); + var z2 = Math.pow(z, 3); + y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787; + x *= 95.047; + y *= 100; + z *= 108.883; + return [x, y, z]; + }; + convert.lab.lch = function(lab) { + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var hr; + var h; + var c; + hr = Math.atan2(b, a); + h = hr * 360 / 2 / Math.PI; + if (h < 0) { + h += 360; + } + c = Math.sqrt(a * a + b * b); + return [l, c, h]; + }; + convert.lch.lab = function(lch) { + var l = lch[0]; + var c = lch[1]; + var h = lch[2]; + var a; + var b; + var hr; + hr = h / 360 * 2 * Math.PI; + a = c * Math.cos(hr); + b = c * Math.sin(hr); + return [l, a, b]; + }; + convert.rgb.ansi16 = function(args) { + var r = args[0]; + var g = args[1]; + var b = args[2]; + var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; + value = Math.round(value / 50); + if (value === 0) { + return 30; + } + var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255)); + if (value === 2) { + ansi += 60; + } + return ansi; + }; + convert.hsv.ansi16 = function(args) { + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); + }; + convert.rgb.ansi256 = function(args) { + var r = args[0]; + var g = args[1]; + var b = args[2]; + if (r === g && g === b) { + if (r < 8) { + return 16; + } + if (r > 248) { + return 231; + } + return Math.round((r - 8) / 247 * 24) + 232; + } + var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5); + return ansi; + }; + convert.ansi16.rgb = function(args) { + var color = args % 10; + if (color === 0 || color === 7) { + if (args > 50) { + color += 3.5; + } + color = color / 10.5 * 255; + return [color, color, color]; + } + var mult = (~~(args > 50) + 1) * 0.5; + var r = (color & 1) * mult * 255; + var g = (color >> 1 & 1) * mult * 255; + var b = (color >> 2 & 1) * mult * 255; + return [r, g, b]; + }; + convert.ansi256.rgb = function(args) { + if (args >= 232) { + var c = (args - 232) * 10 + 8; + return [c, c, c]; + } + args -= 16; + var rem; + var r = Math.floor(args / 36) / 5 * 255; + var g = Math.floor((rem = args % 36) / 6) / 5 * 255; + var b = rem % 6 / 5 * 255; + return [r, g, b]; + }; + convert.rgb.hex = function(args) { + var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255); + var string = integer.toString(16).toUpperCase(); + return "000000".substring(string.length) + string; + }; + convert.hex.rgb = function(args) { + var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; + } + var colorString = match[0]; + if (match[0].length === 3) { + colorString = colorString.split("").map(function(char) { + return char + char; + }).join(""); + } + var integer = parseInt(colorString, 16); + var r = integer >> 16 & 255; + var g = integer >> 8 & 255; + var b = integer & 255; + return [r, g, b]; + }; + convert.rgb.hcg = function(rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var max = Math.max(Math.max(r, g), b); + var min = Math.min(Math.min(r, g), b); + var chroma = max - min; + var grayscale; + var hue; + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; + } + if (chroma <= 0) { + hue = 0; + } else if (max === r) { + hue = (g - b) / chroma % 6; + } else if (max === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma + 4; + } + hue /= 6; + hue %= 1; + return [hue * 360, chroma * 100, grayscale * 100]; + }; + convert.hsl.hcg = function(hsl) { + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var c = 1; + var f = 0; + if (l < 0.5) { + c = 2 * s * l; + } else { + c = 2 * s * (1 - l); + } + if (c < 1) { + f = (l - 0.5 * c) / (1 - c); + } + return [hsl[0], c * 100, f * 100]; + }; + convert.hsv.hcg = function(hsv) { + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var c = s * v; + var f = 0; + if (c < 1) { + f = (v - c) / (1 - c); + } + return [hsv[0], c * 100, f * 100]; + }; + convert.hcg.rgb = function(hcg) { + var h = hcg[0] / 360; + var c = hcg[1] / 100; + var g = hcg[2] / 100; + if (c === 0) { + return [g * 255, g * 255, g * 255]; + } + var pure = [0, 0, 0]; + var hi = h % 1 * 6; + var v = hi % 1; + var w = 1 - v; + var mg = 0; + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; + pure[1] = v; + pure[2] = 0; + break; + case 1: + pure[0] = w; + pure[1] = 1; + pure[2] = 0; + break; + case 2: + pure[0] = 0; + pure[1] = 1; + pure[2] = v; + break; + case 3: + pure[0] = 0; + pure[1] = w; + pure[2] = 1; + break; + case 4: + pure[0] = v; + pure[1] = 0; + pure[2] = 1; + break; + default: + pure[0] = 1; + pure[1] = 0; + pure[2] = w; + } + mg = (1 - c) * g; + return [ + (c * pure[0] + mg) * 255, + (c * pure[1] + mg) * 255, + (c * pure[2] + mg) * 255 + ]; + }; + convert.hcg.hsv = function(hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + var v = c + g * (1 - c); + var f = 0; + if (v > 0) { + f = c / v; + } + return [hcg[0], f * 100, v * 100]; + }; + convert.hcg.hsl = function(hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + var l = g * (1 - c) + 0.5 * c; + var s = 0; + if (l > 0 && l < 0.5) { + s = c / (2 * l); + } else if (l >= 0.5 && l < 1) { + s = c / (2 * (1 - l)); + } + return [hcg[0], s * 100, l * 100]; + }; + convert.hcg.hwb = function(hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + var v = c + g * (1 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; + }; + convert.hwb.hcg = function(hwb) { + var w = hwb[1] / 100; + var b = hwb[2] / 100; + var v = 1 - b; + var c = v - w; + var g = 0; + if (c < 1) { + g = (v - c) / (1 - c); + } + return [hwb[0], c * 100, g * 100]; + }; + convert.apple.rgb = function(apple) { + return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255]; + }; + convert.rgb.apple = function(rgb) { + return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535]; + }; + convert.gray.rgb = function(args) { + return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; + }; + convert.gray.hsl = convert.gray.hsv = function(args) { + return [0, 0, args[0]]; + }; + convert.gray.hwb = function(gray) { + return [0, 100, gray[0]]; + }; + convert.gray.cmyk = function(gray) { + return [0, 0, 0, gray[0]]; + }; + convert.gray.lab = function(gray) { + return [gray[0], 0, 0]; + }; + convert.gray.hex = function(gray) { + var val = Math.round(gray[0] / 100 * 255) & 255; + var integer = (val << 16) + (val << 8) + val; + var string = integer.toString(16).toUpperCase(); + return "000000".substring(string.length) + string; + }; + convert.rgb.gray = function(rgb) { + var val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val / 255 * 100]; + }; + } +}); + +// node_modules/color/node_modules/color-convert/route.js +var require_route = __commonJS({ + "node_modules/color/node_modules/color-convert/route.js"(exports, module2) { + var conversions = require_conversions(); + function buildGraph() { + var graph = {}; + var models = Object.keys(conversions); + for (var len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } + return graph; + } + function deriveBFS(fromModel) { + var graph = buildGraph(); + var queue = [fromModel]; + graph[fromModel].distance = 0; + while (queue.length) { + var current = queue.pop(); + var adjacents = Object.keys(conversions[current]); + for (var len = adjacents.length, i = 0; i < len; i++) { + var adjacent = adjacents[i]; + var node = graph[adjacent]; + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } + return graph; + } + function link(from, to) { + return function(args) { + return to(from(args)); + }; + } + function wrapConversion(toModel, graph) { + var path = [graph[toModel].parent, toModel]; + var fn = conversions[graph[toModel].parent][toModel]; + var cur = graph[toModel].parent; + while (graph[cur].parent) { + path.unshift(graph[cur].parent); + fn = link(conversions[graph[cur].parent][cur], fn); + cur = graph[cur].parent; + } + fn.conversion = path; + return fn; + } + module2.exports = function(fromModel) { + var graph = deriveBFS(fromModel); + var conversion = {}; + var models = Object.keys(graph); + for (var len = models.length, i = 0; i < len; i++) { + var toModel = models[i]; + var node = graph[toModel]; + if (node.parent === null) { + continue; + } + conversion[toModel] = wrapConversion(toModel, graph); + } + return conversion; + }; + } +}); + +// node_modules/color/node_modules/color-convert/index.js +var require_color_convert = __commonJS({ + "node_modules/color/node_modules/color-convert/index.js"(exports, module2) { + var conversions = require_conversions(); + var route = require_route(); + var convert = {}; + var models = Object.keys(conversions); + function wrapRaw(fn) { + var wrappedFn = function(args) { + if (args === void 0 || args === null) { + return args; + } + if (arguments.length > 1) { + args = Array.prototype.slice.call(arguments); + } + return fn(args); + }; + if ("conversion" in fn) { + wrappedFn.conversion = fn.conversion; + } + return wrappedFn; + } + function wrapRounded(fn) { + var wrappedFn = function(args) { + if (args === void 0 || args === null) { + return args; + } + if (arguments.length > 1) { + args = Array.prototype.slice.call(arguments); + } + var result2 = fn(args); + if (typeof result2 === "object") { + for (var len = result2.length, i = 0; i < len; i++) { + result2[i] = Math.round(result2[i]); + } + } + return result2; + }; + if ("conversion" in fn) { + wrappedFn.conversion = fn.conversion; + } + return wrappedFn; + } + models.forEach(function(fromModel) { + convert[fromModel] = {}; + Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels }); + Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels }); + var routes = route(fromModel); + var routeModels = Object.keys(routes); + routeModels.forEach(function(toModel) { + var fn = routes[toModel]; + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); + }); + module2.exports = convert; + } +}); + +// node_modules/color/index.js +var require_color = __commonJS({ + "node_modules/color/index.js"(exports, module2) { + "use strict"; + var colorString = require_color_string(); + var convert = require_color_convert(); + var _slice = [].slice; + var skippedModels = [ + // to be honest, I don't really feel like keyword belongs in color convert, but eh. + "keyword", + // gray conflicts with some method names, and has its own method defined. + "gray", + // shouldn't really be in color-convert either... + "hex" + ]; + var hashedModelKeys = {}; + Object.keys(convert).forEach(function(model) { + hashedModelKeys[_slice.call(convert[model].labels).sort().join("")] = model; + }); + var limiters = {}; + function Color(obj, model) { + if (!(this instanceof Color)) { + return new Color(obj, model); + } + if (model && model in skippedModels) { + model = null; + } + if (model && !(model in convert)) { + throw new Error("Unknown model: " + model); + } + var i; + var channels; + if (obj == null) { + this.model = "rgb"; + this.color = [0, 0, 0]; + this.valpha = 1; + } else if (obj instanceof Color) { + this.model = obj.model; + this.color = obj.color.slice(); + this.valpha = obj.valpha; + } else if (typeof obj === "string") { + var result2 = colorString.get(obj); + if (result2 === null) { + throw new Error("Unable to parse color from string: " + obj); + } + this.model = result2.model; + channels = convert[this.model].channels; + this.color = result2.value.slice(0, channels); + this.valpha = typeof result2.value[channels] === "number" ? result2.value[channels] : 1; + } else if (obj.length) { + this.model = model || "rgb"; + channels = convert[this.model].channels; + var newArr = _slice.call(obj, 0, channels); + this.color = zeroArray(newArr, channels); + this.valpha = typeof obj[channels] === "number" ? obj[channels] : 1; + } else if (typeof obj === "number") { + obj &= 16777215; + this.model = "rgb"; + this.color = [ + obj >> 16 & 255, + obj >> 8 & 255, + obj & 255 + ]; + this.valpha = 1; + } else { + this.valpha = 1; + var keys = Object.keys(obj); + if ("alpha" in obj) { + keys.splice(keys.indexOf("alpha"), 1); + this.valpha = typeof obj.alpha === "number" ? obj.alpha : 0; + } + var hashedKeys = keys.sort().join(""); + if (!(hashedKeys in hashedModelKeys)) { + throw new Error("Unable to parse color from object: " + JSON.stringify(obj)); + } + this.model = hashedModelKeys[hashedKeys]; + var labels = convert[this.model].labels; + var color = []; + for (i = 0; i < labels.length; i++) { + color.push(obj[labels[i]]); + } + this.color = zeroArray(color); + } + if (limiters[this.model]) { + channels = convert[this.model].channels; + for (i = 0; i < channels; i++) { + var limit = limiters[this.model][i]; + if (limit) { + this.color[i] = limit(this.color[i]); + } + } + } + this.valpha = Math.max(0, Math.min(1, this.valpha)); + if (Object.freeze) { + Object.freeze(this); + } + } + Color.prototype = { + toString: function() { + return this.string(); + }, + toJSON: function() { + return this[this.model](); + }, + string: function(places) { + var self2 = this.model in colorString.to ? this : this.rgb(); + self2 = self2.round(typeof places === "number" ? places : 1); + var args = self2.valpha === 1 ? self2.color : self2.color.concat(this.valpha); + return colorString.to[self2.model](args); + }, + percentString: function(places) { + var self2 = this.rgb().round(typeof places === "number" ? places : 1); + var args = self2.valpha === 1 ? self2.color : self2.color.concat(this.valpha); + return colorString.to.rgb.percent(args); + }, + array: function() { + return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha); + }, + object: function() { + var result2 = {}; + var channels = convert[this.model].channels; + var labels = convert[this.model].labels; + for (var i = 0; i < channels; i++) { + result2[labels[i]] = this.color[i]; + } + if (this.valpha !== 1) { + result2.alpha = this.valpha; + } + return result2; + }, + unitArray: function() { + var rgb = this.rgb().color; + rgb[0] /= 255; + rgb[1] /= 255; + rgb[2] /= 255; + if (this.valpha !== 1) { + rgb.push(this.valpha); + } + return rgb; + }, + unitObject: function() { + var rgb = this.rgb().object(); + rgb.r /= 255; + rgb.g /= 255; + rgb.b /= 255; + if (this.valpha !== 1) { + rgb.alpha = this.valpha; + } + return rgb; + }, + round: function(places) { + places = Math.max(places || 0, 0); + return new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model); + }, + alpha: function(val) { + if (arguments.length) { + return new Color(this.color.concat(Math.max(0, Math.min(1, val))), this.model); + } + return this.valpha; + }, + // rgb + red: getset("rgb", 0, maxfn(255)), + green: getset("rgb", 1, maxfn(255)), + blue: getset("rgb", 2, maxfn(255)), + hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, function(val) { + return (val % 360 + 360) % 360; + }), + // eslint-disable-line brace-style + saturationl: getset("hsl", 1, maxfn(100)), + lightness: getset("hsl", 2, maxfn(100)), + saturationv: getset("hsv", 1, maxfn(100)), + value: getset("hsv", 2, maxfn(100)), + chroma: getset("hcg", 1, maxfn(100)), + gray: getset("hcg", 2, maxfn(100)), + white: getset("hwb", 1, maxfn(100)), + wblack: getset("hwb", 2, maxfn(100)), + cyan: getset("cmyk", 0, maxfn(100)), + magenta: getset("cmyk", 1, maxfn(100)), + yellow: getset("cmyk", 2, maxfn(100)), + black: getset("cmyk", 3, maxfn(100)), + x: getset("xyz", 0, maxfn(100)), + y: getset("xyz", 1, maxfn(100)), + z: getset("xyz", 2, maxfn(100)), + l: getset("lab", 0, maxfn(100)), + a: getset("lab", 1), + b: getset("lab", 2), + keyword: function(val) { + if (arguments.length) { + return new Color(val); + } + return convert[this.model].keyword(this.color); + }, + hex: function(val) { + if (arguments.length) { + return new Color(val); + } + return colorString.to.hex(this.rgb().round().color); + }, + rgbNumber: function() { + var rgb = this.rgb().color; + return (rgb[0] & 255) << 16 | (rgb[1] & 255) << 8 | rgb[2] & 255; + }, + luminosity: function() { + var rgb = this.rgb().color; + var lum = []; + for (var i = 0; i < rgb.length; i++) { + var chan = rgb[i] / 255; + lum[i] = chan <= 0.03928 ? chan / 12.92 : Math.pow((chan + 0.055) / 1.055, 2.4); + } + return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2]; + }, + contrast: function(color2) { + var lum1 = this.luminosity(); + var lum2 = color2.luminosity(); + if (lum1 > lum2) { + return (lum1 + 0.05) / (lum2 + 0.05); + } + return (lum2 + 0.05) / (lum1 + 0.05); + }, + level: function(color2) { + var contrastRatio = this.contrast(color2); + if (contrastRatio >= 7.1) { + return "AAA"; + } + return contrastRatio >= 4.5 ? "AA" : ""; + }, + isDark: function() { + var rgb = this.rgb().color; + var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1e3; + return yiq < 128; + }, + isLight: function() { + return !this.isDark(); + }, + negate: function() { + var rgb = this.rgb(); + for (var i = 0; i < 3; i++) { + rgb.color[i] = 255 - rgb.color[i]; + } + return rgb; + }, + lighten: function(ratio) { + var hsl = this.hsl(); + hsl.color[2] += hsl.color[2] * ratio; + return hsl; + }, + darken: function(ratio) { + var hsl = this.hsl(); + hsl.color[2] -= hsl.color[2] * ratio; + return hsl; + }, + saturate: function(ratio) { + var hsl = this.hsl(); + hsl.color[1] += hsl.color[1] * ratio; + return hsl; + }, + desaturate: function(ratio) { + var hsl = this.hsl(); + hsl.color[1] -= hsl.color[1] * ratio; + return hsl; + }, + whiten: function(ratio) { + var hwb = this.hwb(); + hwb.color[1] += hwb.color[1] * ratio; + return hwb; + }, + blacken: function(ratio) { + var hwb = this.hwb(); + hwb.color[2] += hwb.color[2] * ratio; + return hwb; + }, + grayscale: function() { + var rgb = this.rgb().color; + var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11; + return Color.rgb(val, val, val); + }, + fade: function(ratio) { + return this.alpha(this.valpha - this.valpha * ratio); + }, + opaquer: function(ratio) { + return this.alpha(this.valpha + this.valpha * ratio); + }, + rotate: function(degrees) { + var hsl = this.hsl(); + var hue = hsl.color[0]; + hue = (hue + degrees) % 360; + hue = hue < 0 ? 360 + hue : hue; + hsl.color[0] = hue; + return hsl; + }, + mix: function(mixinColor, weight) { + if (!mixinColor || !mixinColor.rgb) { + throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor); + } + var color1 = mixinColor.rgb(); + var color2 = this.rgb(); + var p = weight === void 0 ? 0.5 : weight; + var w = 2 * p - 1; + var a = color1.alpha() - color2.alpha(); + var w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2; + var w2 = 1 - w1; + return Color.rgb( + w1 * color1.red() + w2 * color2.red(), + w1 * color1.green() + w2 * color2.green(), + w1 * color1.blue() + w2 * color2.blue(), + color1.alpha() * p + color2.alpha() * (1 - p) + ); + } + }; + Object.keys(convert).forEach(function(model) { + if (skippedModels.indexOf(model) !== -1) { + return; + } + var channels = convert[model].channels; + Color.prototype[model] = function() { + if (this.model === model) { + return new Color(this); + } + if (arguments.length) { + return new Color(arguments, model); + } + var newAlpha = typeof arguments[channels] === "number" ? channels : this.valpha; + return new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model); + }; + Color[model] = function(color) { + if (typeof color === "number") { + color = zeroArray(_slice.call(arguments), channels); + } + return new Color(color, model); + }; + }); + function roundTo(num, places) { + return Number(num.toFixed(places)); + } + function roundToPlace(places) { + return function(num) { + return roundTo(num, places); + }; + } + function getset(model, channel, modifier) { + model = Array.isArray(model) ? model : [model]; + model.forEach(function(m) { + (limiters[m] || (limiters[m] = []))[channel] = modifier; + }); + model = model[0]; + return function(val) { + var result2; + if (arguments.length) { + if (modifier) { + val = modifier(val); + } + result2 = this[model](); + result2.color[channel] = val; + return result2; + } + result2 = this[model]().color[channel]; + if (modifier) { + result2 = modifier(result2); + } + return result2; + }; + } + function maxfn(max) { + return function(v) { + return Math.max(0, Math.min(max, v)); + }; + } + function assertArray(val) { + return Array.isArray(val) ? val : [val]; + } + function zeroArray(arr, length) { + for (var i = 0; i < length; i++) { + if (typeof arr[i] !== "number") { + arr[i] = 0; + } + } + return arr; + } + module2.exports = Color; + } +}); + +// node_modules/text-hex/index.js +var require_text_hex = __commonJS({ + "node_modules/text-hex/index.js"(exports, module2) { + "use strict"; + module2.exports = function hex(str) { + for (var i = 0, hash = 0; i < str.length; hash = str.charCodeAt(i++) + ((hash << 5) - hash)) + ; + var color = Math.floor( + Math.abs( + Math.sin(hash) * 1e4 % 1 * 16777216 + ) + ).toString(16); + return "#" + Array(6 - color.length + 1).join("0") + color; + }; + } +}); + +// node_modules/colorspace/index.js +var require_colorspace = __commonJS({ + "node_modules/colorspace/index.js"(exports, module2) { + "use strict"; + var color = require_color(); + var hex = require_text_hex(); + module2.exports = function colorspace(namespace, delimiter2) { + var split = namespace.split(delimiter2 || ":"); + var base = hex(split[0]); + if (!split.length) + return base; + for (var i = 0, l = split.length - 1; i < l; i++) { + base = color(base).mix(color(hex(split[i + 1]))).saturate(1).hex(); + } + return base; + }; + } +}); + +// node_modules/kuler/index.js +var require_kuler = __commonJS({ + "node_modules/kuler/index.js"(exports, module2) { + "use strict"; + function Kuler(text, color) { + if (color) + return new Kuler(text).style(color); + if (!(this instanceof Kuler)) + return new Kuler(text); + this.text = text; + } + Kuler.prototype.prefix = "\x1B["; + Kuler.prototype.suffix = "m"; + Kuler.prototype.hex = function hex(color) { + color = color[0] === "#" ? color.substring(1) : color; + if (color.length === 3) { + color = color.split(""); + color[5] = color[2]; + color[4] = color[2]; + color[3] = color[1]; + color[2] = color[1]; + color[1] = color[0]; + color = color.join(""); + } + var r = color.substring(0, 2), g = color.substring(2, 4), b = color.substring(4, 6); + return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)]; + }; + Kuler.prototype.rgb = function rgb(r, g, b) { + var red = r / 255 * 5, green = g / 255 * 5, blue = b / 255 * 5; + return this.ansi(red, green, blue); + }; + Kuler.prototype.ansi = function ansi(r, g, b) { + var red = Math.round(r), green = Math.round(g), blue = Math.round(b); + return 16 + red * 36 + green * 6 + blue; + }; + Kuler.prototype.reset = function reset() { + return this.prefix + "39;49" + this.suffix; + }; + Kuler.prototype.style = function style(color) { + return this.prefix + "38;5;" + this.rgb.apply(this, this.hex(color)) + this.suffix + this.text + this.reset(); + }; + module2.exports = Kuler; + } +}); + +// node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js +var require_namespace_ansi = __commonJS({ + "node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js"(exports, module2) { + var colorspace = require_colorspace(); + var kuler = require_kuler(); + module2.exports = function ansiModifier(args, options) { + var namespace = options.namespace; + var ansi = options.colors !== false ? kuler(namespace + ":", colorspace(namespace)) : namespace + ":"; + args[0] = ansi + " " + args[0]; + return args; + }; + } +}); + +// node_modules/enabled/index.js +var require_enabled = __commonJS({ + "node_modules/enabled/index.js"(exports, module2) { + "use strict"; + module2.exports = function enabled(name, variable) { + if (!variable) + return false; + var variables = variable.split(/[\s,]+/), i = 0; + for (; i < variables.length; i++) { + variable = variables[i].replace("*", ".*?"); + if ("-" === variable.charAt(0)) { + if (new RegExp("^" + variable.substr(1) + "$").test(name)) { + return false; + } + continue; + } + if (new RegExp("^" + variable + "$").test(name)) { + return true; + } + } + return false; + }; + } +}); + +// node_modules/@dabh/diagnostics/adapters/index.js +var require_adapters = __commonJS({ + "node_modules/@dabh/diagnostics/adapters/index.js"(exports, module2) { + var enabled = require_enabled(); + module2.exports = function create(fn) { + return function adapter(namespace) { + try { + return enabled(namespace, fn()); + } catch (e) { + } + return false; + }; + }; + } +}); + +// node_modules/@dabh/diagnostics/adapters/process.env.js +var require_process_env = __commonJS({ + "node_modules/@dabh/diagnostics/adapters/process.env.js"(exports, module2) { + var adapter = require_adapters(); + module2.exports = adapter(function processenv() { + return process.env.DEBUG || process.env.DIAGNOSTICS; + }); + } +}); + +// node_modules/@dabh/diagnostics/logger/console.js +var require_console2 = __commonJS({ + "node_modules/@dabh/diagnostics/logger/console.js"(exports, module2) { + module2.exports = function(meta, messages) { + try { + Function.prototype.apply.call(console.log, console, messages); + } catch (e) { + } + }; + } +}); + +// node_modules/@dabh/diagnostics/node/development.js +var require_development = __commonJS({ + "node_modules/@dabh/diagnostics/node/development.js"(exports, module2) { + var create = require_diagnostics(); + var tty = require("tty").isatty(1); + var diagnostics = create(function dev(namespace, options) { + options = options || {}; + options.colors = "colors" in options ? options.colors : tty; + options.namespace = namespace; + options.prod = false; + options.dev = true; + if (!dev.enabled(namespace) && !(options.force || dev.force)) { + return dev.nope(options); + } + return dev.yep(options); + }); + diagnostics.modify(require_namespace_ansi()); + diagnostics.use(require_process_env()); + diagnostics.set(require_console2()); + module2.exports = diagnostics; + } +}); + +// node_modules/@dabh/diagnostics/node/index.js +var require_node2 = __commonJS({ + "node_modules/@dabh/diagnostics/node/index.js"(exports, module2) { + if (process.env.NODE_ENV === "production") { + module2.exports = require_production(); + } else { + module2.exports = require_development(); + } + } +}); + +// node_modules/winston/lib/winston/tail-file.js +var require_tail_file = __commonJS({ + "node_modules/winston/lib/winston/tail-file.js"(exports, module2) { + "use strict"; + var fs = require("fs"); + var { StringDecoder } = require("string_decoder"); + var { Stream } = require_readable(); + function noop() { + } + module2.exports = (options, iter) => { + const buffer = Buffer.alloc(64 * 1024); + const decode = new StringDecoder("utf8"); + const stream = new Stream(); + let buff = ""; + let pos = 0; + let row = 0; + if (options.start === -1) { + delete options.start; + } + stream.readable = true; + stream.destroy = () => { + stream.destroyed = true; + stream.emit("end"); + stream.emit("close"); + }; + fs.open(options.file, "a+", "0644", (err, fd) => { + if (err) { + if (!iter) { + stream.emit("error", err); + } else { + iter(err); + } + stream.destroy(); + return; + } + (function read() { + if (stream.destroyed) { + fs.close(fd, noop); + return; + } + return fs.read(fd, buffer, 0, buffer.length, pos, (error, bytes) => { + if (error) { + if (!iter) { + stream.emit("error", error); + } else { + iter(error); + } + stream.destroy(); + return; + } + if (!bytes) { + if (buff) { + if (options.start == null || row > options.start) { + if (!iter) { + stream.emit("line", buff); + } else { + iter(null, buff); + } + } + row++; + buff = ""; + } + return setTimeout(read, 1e3); + } + let data = decode.write(buffer.slice(0, bytes)); + if (!iter) { + stream.emit("data", data); + } + data = (buff + data).split(/\n+/); + const l = data.length - 1; + let i = 0; + for (; i < l; i++) { + if (options.start == null || row > options.start) { + if (!iter) { + stream.emit("line", data[i]); + } else { + iter(null, data[i]); + } + } + row++; + } + buff = data[l]; + pos += bytes; + return read(); + }); + })(); + }); + if (!iter) { + return stream; + } + return stream.destroy; + }; + } +}); + +// node_modules/winston/lib/winston/transports/file.js +var require_file = __commonJS({ + "node_modules/winston/lib/winston/transports/file.js"(exports, module2) { + "use strict"; + var fs = require("fs"); + var path = require("path"); + var asyncSeries = require_series(); + var zlib = require("zlib"); + var { MESSAGE } = require_triple_beam(); + var { Stream, PassThrough } = require_readable(); + var TransportStream = require_winston_transport(); + var debug = require_node2()("winston:file"); + var os2 = require("os"); + var tailFile = require_tail_file(); + module2.exports = class File extends TransportStream { + /** + * Constructor function for the File transport object responsible for + * persisting log messages and metadata to one or more files. + * @param {Object} options - Options for this instance. + */ + constructor(options = {}) { + super(options); + this.name = options.name || "file"; + function throwIf(target, ...args) { + args.slice(1).forEach((name) => { + if (options[name]) { + throw new Error(`Cannot set ${name} and ${target} together`); + } + }); + } + this._stream = new PassThrough(); + this._stream.setMaxListeners(30); + this._onError = this._onError.bind(this); + if (options.filename || options.dirname) { + throwIf("filename or dirname", "stream"); + this._basename = this.filename = options.filename ? path.basename(options.filename) : "winston.log"; + this.dirname = options.dirname || path.dirname(options.filename); + this.options = options.options || { flags: "a" }; + } else if (options.stream) { + console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"); + throwIf("stream", "filename", "maxsize"); + this._dest = this._stream.pipe(this._setupStream(options.stream)); + this.dirname = path.dirname(this._dest.path); + } else { + throw new Error("Cannot log to file without filename or stream."); + } + this.maxsize = options.maxsize || null; + this.rotationFormat = options.rotationFormat || false; + this.zippedArchive = options.zippedArchive || false; + this.maxFiles = options.maxFiles || null; + this.eol = typeof options.eol === "string" ? options.eol : os2.EOL; + this.tailable = options.tailable || false; + this.lazy = options.lazy || false; + this._size = 0; + this._pendingSize = 0; + this._created = 0; + this._drain = false; + this._opening = false; + this._ending = false; + this._fileExist = false; + if (this.dirname) + this._createLogDirIfNotExist(this.dirname); + if (!this.lazy) + this.open(); + } + finishIfEnding() { + if (this._ending) { + if (this._opening) { + this.once("open", () => { + this._stream.once("finish", () => this.emit("finish")); + setImmediate(() => this._stream.end()); + }); + } else { + this._stream.once("finish", () => this.emit("finish")); + setImmediate(() => this._stream.end()); + } + } + } + /** + * Core logging method exposed to Winston. Metadata is optional. + * @param {Object} info - TODO: add param description. + * @param {Function} callback - TODO: add param description. + * @returns {undefined} + */ + log(info, callback = () => { + }) { + if (this.silent) { + callback(); + return true; + } + if (this._drain) { + this._stream.once("drain", () => { + this._drain = false; + this.log(info, callback); + }); + return; + } + if (this._rotate) { + this._stream.once("rotate", () => { + this._rotate = false; + this.log(info, callback); + }); + return; + } + if (this.lazy) { + if (!this._fileExist) { + if (!this._opening) { + this.open(); + } + this.once("open", () => { + this._fileExist = true; + this.log(info, callback); + return; + }); + return; + } + if (this._needsNewFile(this._pendingSize)) { + this._dest.once("close", () => { + if (!this._opening) { + this.open(); + } + this.once("open", () => { + this.log(info, callback); + return; + }); + return; + }); + return; + } + } + const output = `${info[MESSAGE]}${this.eol}`; + const bytes = Buffer.byteLength(output); + function logged() { + this._size += bytes; + this._pendingSize -= bytes; + debug("logged %s %s", this._size, output); + this.emit("logged", info); + if (this._rotate) { + return; + } + if (this._opening) { + return; + } + if (!this._needsNewFile()) { + return; + } + if (this.lazy) { + this._endStream(() => { + this.emit("fileclosed"); + }); + return; + } + this._rotate = true; + this._endStream(() => this._rotateFile()); + } + this._pendingSize += bytes; + if (this._opening && !this.rotatedWhileOpening && this._needsNewFile(this._size + this._pendingSize)) { + this.rotatedWhileOpening = true; + } + const written = this._stream.write(output, logged.bind(this)); + if (!written) { + this._drain = true; + this._stream.once("drain", () => { + this._drain = false; + callback(); + }); + } else { + callback(); + } + debug("written", written, this._drain); + this.finishIfEnding(); + return written; + } + /** + * Query the transport. Options object is optional. + * @param {Object} options - Loggly-like query options for this instance. + * @param {function} callback - Continuation to respond to when complete. + * TODO: Refactor me. + */ + query(options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } + options = normalizeQuery(options); + const file = path.join(this.dirname, this.filename); + let buff = ""; + let results = []; + let row = 0; + const stream = fs.createReadStream(file, { + encoding: "utf8" + }); + stream.on("error", (err) => { + if (stream.readable) { + stream.destroy(); + } + if (!callback) { + return; + } + return err.code !== "ENOENT" ? callback(err) : callback(null, results); + }); + stream.on("data", (data) => { + data = (buff + data).split(/\n+/); + const l = data.length - 1; + let i = 0; + for (; i < l; i++) { + if (!options.start || row >= options.start) { + add(data[i]); + } + row++; + } + buff = data[l]; + }); + stream.on("close", () => { + if (buff) { + add(buff, true); + } + if (options.order === "desc") { + results = results.reverse(); + } + if (callback) + callback(null, results); + }); + function add(buff2, attempt) { + try { + const log = JSON.parse(buff2); + if (check(log)) { + push(log); + } + } catch (e) { + if (!attempt) { + stream.emit("error", e); + } + } + } + function push(log) { + if (options.rows && results.length >= options.rows && options.order !== "desc") { + if (stream.readable) { + stream.destroy(); + } + return; + } + if (options.fields) { + log = options.fields.reduce((obj, key) => { + obj[key] = log[key]; + return obj; + }, {}); + } + if (options.order === "desc") { + if (results.length >= options.rows) { + results.shift(); + } + } + results.push(log); + } + function check(log) { + if (!log) { + return; + } + if (typeof log !== "object") { + return; + } + const time = new Date(log.timestamp); + if (options.from && time < options.from || options.until && time > options.until || options.level && options.level !== log.level) { + return; + } + return true; + } + function normalizeQuery(options2) { + options2 = options2 || {}; + options2.rows = options2.rows || options2.limit || 10; + options2.start = options2.start || 0; + options2.until = options2.until || new Date(); + if (typeof options2.until !== "object") { + options2.until = new Date(options2.until); + } + options2.from = options2.from || options2.until - 24 * 60 * 60 * 1e3; + if (typeof options2.from !== "object") { + options2.from = new Date(options2.from); + } + options2.order = options2.order || "desc"; + return options2; + } + } + /** + * Returns a log stream for this transport. Options object is optional. + * @param {Object} options - Stream options for this instance. + * @returns {Stream} - TODO: add return description. + * TODO: Refactor me. + */ + stream(options = {}) { + const file = path.join(this.dirname, this.filename); + const stream = new Stream(); + const tail = { + file, + start: options.start + }; + stream.destroy = tailFile(tail, (err, line) => { + if (err) { + return stream.emit("error", err); + } + try { + stream.emit("data", line); + line = JSON.parse(line); + stream.emit("log", line); + } catch (e) { + stream.emit("error", e); + } + }); + return stream; + } + /** + * Checks to see the filesize of. + * @returns {undefined} + */ + open() { + if (!this.filename) + return; + if (this._opening) + return; + this._opening = true; + this.stat((err, size) => { + if (err) { + return this.emit("error", err); + } + debug("stat done: %s { size: %s }", this.filename, size); + this._size = size; + this._dest = this._createStream(this._stream); + this._opening = false; + this.once("open", () => { + if (!this._stream.emit("rotate")) { + this._rotate = false; + } + }); + }); + } + /** + * Stat the file and assess information in order to create the proper stream. + * @param {function} callback - TODO: add param description. + * @returns {undefined} + */ + stat(callback) { + const target = this._getFile(); + const fullpath = path.join(this.dirname, target); + fs.stat(fullpath, (err, stat) => { + if (err && err.code === "ENOENT") { + debug("ENOENT\xA0ok", fullpath); + this.filename = target; + return callback(null, 0); + } + if (err) { + debug(`err ${err.code} ${fullpath}`); + return callback(err); + } + if (!stat || this._needsNewFile(stat.size)) { + return this._incFile(() => this.stat(callback)); + } + this.filename = target; + callback(null, stat.size); + }); + } + /** + * Closes the stream associated with this instance. + * @param {function} cb - TODO: add param description. + * @returns {undefined} + */ + close(cb) { + if (!this._stream) { + return; + } + this._stream.end(() => { + if (cb) { + cb(); + } + this.emit("flush"); + this.emit("closed"); + }); + } + /** + * TODO: add method description. + * @param {number} size - TODO: add param description. + * @returns {undefined} + */ + _needsNewFile(size) { + size = size || this._size; + return this.maxsize && size >= this.maxsize; + } + /** + * TODO: add method description. + * @param {Error} err - TODO: add param description. + * @returns {undefined} + */ + _onError(err) { + this.emit("error", err); + } + /** + * TODO: add method description. + * @param {Stream} stream - TODO: add param description. + * @returns {mixed} - TODO: add return description. + */ + _setupStream(stream) { + stream.on("error", this._onError); + return stream; + } + /** + * TODO: add method description. + * @param {Stream} stream - TODO: add param description. + * @returns {mixed} - TODO: add return description. + */ + _cleanupStream(stream) { + stream.removeListener("error", this._onError); + stream.destroy(); + return stream; + } + /** + * TODO: add method description. + */ + _rotateFile() { + this._incFile(() => this.open()); + } + /** + * Unpipe from the stream that has been marked as full and end it so it + * flushes to disk. + * + * @param {function} callback - Callback for when the current file has closed. + * @private + */ + _endStream(callback = () => { + }) { + if (this._dest) { + this._stream.unpipe(this._dest); + this._dest.end(() => { + this._cleanupStream(this._dest); + callback(); + }); + } else { + callback(); + } + } + /** + * Returns the WritableStream for the active file on this instance. If we + * should gzip the file then a zlib stream is returned. + * + * @param {ReadableStream} source –PassThrough to pipe to the file when open. + * @returns {WritableStream} Stream that writes to disk for the active file. + */ + _createStream(source) { + const fullpath = path.join(this.dirname, this.filename); + debug("create stream start", fullpath, this.options); + const dest = fs.createWriteStream(fullpath, this.options).on("error", (err) => debug(err)).on("close", () => debug("close", dest.path, dest.bytesWritten)).on("open", () => { + debug("file open ok", fullpath); + this.emit("open", fullpath); + source.pipe(dest); + if (this.rotatedWhileOpening) { + this._stream = new PassThrough(); + this._stream.setMaxListeners(30); + this._rotateFile(); + this.rotatedWhileOpening = false; + this._cleanupStream(dest); + source.end(); + } + }); + debug("create stream ok", fullpath); + return dest; + } + /** + * TODO: add method description. + * @param {function} callback - TODO: add param description. + * @returns {undefined} + */ + _incFile(callback) { + debug("_incFile", this.filename); + const ext = path.extname(this._basename); + const basename = path.basename(this._basename, ext); + const tasks = []; + if (this.zippedArchive) { + tasks.push( + function(cb) { + const num = this._created > 0 && !this.tailable ? this._created : ""; + this._compressFile( + path.join(this.dirname, `${basename}${num}${ext}`), + path.join(this.dirname, `${basename}${num}${ext}.gz`), + cb + ); + }.bind(this) + ); + } + tasks.push( + function(cb) { + if (!this.tailable) { + this._created += 1; + this._checkMaxFilesIncrementing(ext, basename, cb); + } else { + this._checkMaxFilesTailable(ext, basename, cb); + } + }.bind(this) + ); + asyncSeries(tasks, callback); + } + /** + * Gets the next filename to use for this instance in the case that log + * filesizes are being capped. + * @returns {string} - TODO: add return description. + * @private + */ + _getFile() { + const ext = path.extname(this._basename); + const basename = path.basename(this._basename, ext); + const isRotation = this.rotationFormat ? this.rotationFormat() : this._created; + return !this.tailable && this._created ? `${basename}${isRotation}${ext}` : `${basename}${ext}`; + } + /** + * Increment the number of files created or checked by this instance. + * @param {mixed} ext - TODO: add param description. + * @param {mixed} basename - TODO: add param description. + * @param {mixed} callback - TODO: add param description. + * @returns {undefined} + * @private + */ + _checkMaxFilesIncrementing(ext, basename, callback) { + if (!this.maxFiles || this._created < this.maxFiles) { + return setImmediate(callback); + } + const oldest = this._created - this.maxFiles; + const isOldest = oldest !== 0 ? oldest : ""; + const isZipped = this.zippedArchive ? ".gz" : ""; + const filePath = `${basename}${isOldest}${ext}${isZipped}`; + const target = path.join(this.dirname, filePath); + fs.unlink(target, callback); + } + /** + * Roll files forward based on integer, up to maxFiles. e.g. if base if + * file.log and it becomes oversized, roll to file1.log, and allow file.log + * to be re-used. If file is oversized again, roll file1.log to file2.log, + * roll file.log to file1.log, and so on. + * @param {mixed} ext - TODO: add param description. + * @param {mixed} basename - TODO: add param description. + * @param {mixed} callback - TODO: add param description. + * @returns {undefined} + * @private + */ + _checkMaxFilesTailable(ext, basename, callback) { + const tasks = []; + if (!this.maxFiles) { + return; + } + const isZipped = this.zippedArchive ? ".gz" : ""; + for (let x = this.maxFiles - 1; x > 1; x--) { + tasks.push(function(i, cb) { + let fileName = `${basename}${i - 1}${ext}${isZipped}`; + const tmppath = path.join(this.dirname, fileName); + fs.exists(tmppath, (exists) => { + if (!exists) { + return cb(null); + } + fileName = `${basename}${i}${ext}${isZipped}`; + fs.rename(tmppath, path.join(this.dirname, fileName), cb); + }); + }.bind(this, x)); + } + asyncSeries(tasks, () => { + fs.rename( + path.join(this.dirname, `${basename}${ext}${isZipped}`), + path.join(this.dirname, `${basename}1${ext}${isZipped}`), + callback + ); + }); + } + /** + * Compresses src to dest with gzip and unlinks src + * @param {string} src - path to source file. + * @param {string} dest - path to zipped destination file. + * @param {Function} callback - callback called after file has been compressed. + * @returns {undefined} + * @private + */ + _compressFile(src, dest, callback) { + fs.access(src, fs.F_OK, (err) => { + if (err) { + return callback(); + } + var gzip = zlib.createGzip(); + var inp = fs.createReadStream(src); + var out = fs.createWriteStream(dest); + out.on("finish", () => { + fs.unlink(src, callback); + }); + inp.pipe(gzip).pipe(out); + }); + } + _createLogDirIfNotExist(dirPath) { + if (!fs.existsSync(dirPath)) { + fs.mkdirSync(dirPath, { recursive: true }); + } + } + }; + } +}); + +// node_modules/winston/lib/winston/transports/http.js +var require_http = __commonJS({ + "node_modules/winston/lib/winston/transports/http.js"(exports, module2) { + "use strict"; + var http = require("http"); + var https = require("https"); + var { Stream } = require_readable(); + var TransportStream = require_winston_transport(); + var { configure } = require_safe_stable_stringify(); + module2.exports = class Http extends TransportStream { + /** + * Constructor function for the Http transport object responsible for + * persisting log messages and metadata to a terminal or TTY. + * @param {!Object} [options={}] - Options for this instance. + */ + // eslint-disable-next-line max-statements + constructor(options = {}) { + super(options); + this.options = options; + this.name = options.name || "http"; + this.ssl = !!options.ssl; + this.host = options.host || "localhost"; + this.port = options.port; + this.auth = options.auth; + this.path = options.path || ""; + this.maximumDepth = options.maximumDepth; + this.agent = options.agent; + this.headers = options.headers || {}; + this.headers["content-type"] = "application/json"; + this.batch = options.batch || false; + this.batchInterval = options.batchInterval || 5e3; + this.batchCount = options.batchCount || 10; + this.batchOptions = []; + this.batchTimeoutID = -1; + this.batchCallback = {}; + if (!this.port) { + this.port = this.ssl ? 443 : 80; + } + } + /** + * Core logging method exposed to Winston. + * @param {Object} info - TODO: add param description. + * @param {function} callback - TODO: add param description. + * @returns {undefined} + */ + log(info, callback) { + this._request(info, null, null, (err, res) => { + if (res && res.statusCode !== 200) { + err = new Error(`Invalid HTTP Status Code: ${res.statusCode}`); + } + if (err) { + this.emit("warn", err); + } else { + this.emit("logged", info); + } + }); + if (callback) { + setImmediate(callback); + } + } + /** + * Query the transport. Options object is optional. + * @param {Object} options - Loggly-like query options for this instance. + * @param {function} callback - Continuation to respond to when complete. + * @returns {undefined} + */ + query(options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } + options = { + method: "query", + params: this.normalizeQuery(options) + }; + const auth = options.params.auth || null; + delete options.params.auth; + const path = options.params.path || null; + delete options.params.path; + this._request(options, auth, path, (err, res, body) => { + if (res && res.statusCode !== 200) { + err = new Error(`Invalid HTTP Status Code: ${res.statusCode}`); + } + if (err) { + return callback(err); + } + if (typeof body === "string") { + try { + body = JSON.parse(body); + } catch (e) { + return callback(e); + } + } + callback(null, body); + }); + } + /** + * Returns a log stream for this transport. Options object is optional. + * @param {Object} options - Stream options for this instance. + * @returns {Stream} - TODO: add return description + */ + stream(options = {}) { + const stream = new Stream(); + options = { + method: "stream", + params: options + }; + const path = options.params.path || null; + delete options.params.path; + const auth = options.params.auth || null; + delete options.params.auth; + let buff = ""; + const req = this._request(options, auth, path); + stream.destroy = () => req.destroy(); + req.on("data", (data) => { + data = (buff + data).split(/\n+/); + const l = data.length - 1; + let i = 0; + for (; i < l; i++) { + try { + stream.emit("log", JSON.parse(data[i])); + } catch (e) { + stream.emit("error", e); + } + } + buff = data[l]; + }); + req.on("error", (err) => stream.emit("error", err)); + return stream; + } + /** + * Make a request to a winstond server or any http server which can + * handle json-rpc. + * @param {function} options - Options to sent the request. + * @param {Object?} auth - authentication options + * @param {string} path - request path + * @param {function} callback - Continuation to respond to when complete. + */ + _request(options, auth, path, callback) { + options = options || {}; + auth = auth || this.auth; + path = path || this.path || ""; + if (this.batch) { + this._doBatch(options, callback, auth, path); + } else { + this._doRequest(options, callback, auth, path); + } + } + /** + * Send or memorize the options according to batch configuration + * @param {function} options - Options to sent the request. + * @param {function} callback - Continuation to respond to when complete. + * @param {Object?} auth - authentication options + * @param {string} path - request path + */ + _doBatch(options, callback, auth, path) { + this.batchOptions.push(options); + if (this.batchOptions.length === 1) { + const me = this; + this.batchCallback = callback; + this.batchTimeoutID = setTimeout(function() { + me.batchTimeoutID = -1; + me._doBatchRequest(me.batchCallback, auth, path); + }, this.batchInterval); + } + if (this.batchOptions.length === this.batchCount) { + this._doBatchRequest(this.batchCallback, auth, path); + } + } + /** + * Initiate a request with the memorized batch options, stop the batch timeout + * @param {function} callback - Continuation to respond to when complete. + * @param {Object?} auth - authentication options + * @param {string} path - request path + */ + _doBatchRequest(callback, auth, path) { + if (this.batchTimeoutID > 0) { + clearTimeout(this.batchTimeoutID); + this.batchTimeoutID = -1; + } + const batchOptionsCopy = this.batchOptions.slice(); + this.batchOptions = []; + this._doRequest(batchOptionsCopy, callback, auth, path); + } + /** + * Make a request to a winstond server or any http server which can + * handle json-rpc. + * @param {function} options - Options to sent the request. + * @param {function} callback - Continuation to respond to when complete. + * @param {Object?} auth - authentication options + * @param {string} path - request path + */ + _doRequest(options, callback, auth, path) { + const headers = Object.assign({}, this.headers); + if (auth && auth.bearer) { + headers.Authorization = `Bearer ${auth.bearer}`; + } + const req = (this.ssl ? https : http).request({ + ...this.options, + method: "POST", + host: this.host, + port: this.port, + path: `/${path.replace(/^\//, "")}`, + headers, + auth: auth && auth.username && auth.password ? `${auth.username}:${auth.password}` : "", + agent: this.agent + }); + req.on("error", callback); + req.on("response", (res) => res.on("end", () => callback(null, res)).resume()); + const jsonStringify = configure({ + ...this.maximumDepth && { maximumDepth: this.maximumDepth } + }); + req.end(Buffer.from(jsonStringify(options, this.options.replacer), "utf8")); + } + }; + } +}); + +// node_modules/is-stream/index.js +var require_is_stream = __commonJS({ + "node_modules/is-stream/index.js"(exports, module2) { + "use strict"; + var isStream = (stream) => stream !== null && typeof stream === "object" && typeof stream.pipe === "function"; + isStream.writable = (stream) => isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object"; + isStream.readable = (stream) => isStream(stream) && stream.readable !== false && typeof stream._read === "function" && typeof stream._readableState === "object"; + isStream.duplex = (stream) => isStream.writable(stream) && isStream.readable(stream); + isStream.transform = (stream) => isStream.duplex(stream) && typeof stream._transform === "function"; + module2.exports = isStream; + } +}); + +// node_modules/winston/lib/winston/transports/stream.js +var require_stream3 = __commonJS({ + "node_modules/winston/lib/winston/transports/stream.js"(exports, module2) { + "use strict"; + var isStream = require_is_stream(); + var { MESSAGE } = require_triple_beam(); + var os2 = require("os"); + var TransportStream = require_winston_transport(); + module2.exports = class Stream extends TransportStream { + /** + * Constructor function for the Console transport object responsible for + * persisting log messages and metadata to a terminal or TTY. + * @param {!Object} [options={}] - Options for this instance. + */ + constructor(options = {}) { + super(options); + if (!options.stream || !isStream(options.stream)) { + throw new Error("options.stream is required."); + } + this._stream = options.stream; + this._stream.setMaxListeners(Infinity); + this.isObjectMode = options.stream._writableState.objectMode; + this.eol = typeof options.eol === "string" ? options.eol : os2.EOL; + } + /** + * Core logging method exposed to Winston. + * @param {Object} info - TODO: add param description. + * @param {Function} callback - TODO: add param description. + * @returns {undefined} + */ + log(info, callback) { + setImmediate(() => this.emit("logged", info)); + if (this.isObjectMode) { + this._stream.write(info); + if (callback) { + callback(); + } + return; + } + this._stream.write(`${info[MESSAGE]}${this.eol}`); + if (callback) { + callback(); + } + return; + } + }; + } +}); + +// node_modules/winston/lib/winston/transports/index.js +var require_transports = __commonJS({ + "node_modules/winston/lib/winston/transports/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "Console", { + configurable: true, + enumerable: true, + get() { + return require_console(); + } + }); + Object.defineProperty(exports, "File", { + configurable: true, + enumerable: true, + get() { + return require_file(); + } + }); + Object.defineProperty(exports, "Http", { + configurable: true, + enumerable: true, + get() { + return require_http(); + } + }); + Object.defineProperty(exports, "Stream", { + configurable: true, + enumerable: true, + get() { + return require_stream3(); + } + }); + } +}); + +// node_modules/winston/lib/winston/config/index.js +var require_config2 = __commonJS({ + "node_modules/winston/lib/winston/config/index.js"(exports) { + "use strict"; + var logform = require_logform(); + var { configs } = require_triple_beam(); + exports.cli = logform.levels(configs.cli); + exports.npm = logform.levels(configs.npm); + exports.syslog = logform.levels(configs.syslog); + exports.addColors = logform.levels; + } +}); + +// node_modules/async/eachOf.js +var require_eachOf = __commonJS({ + "node_modules/async/eachOf.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _isArrayLike = require_isArrayLike(); + var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + var _breakLoop = require_breakLoop(); + var _breakLoop2 = _interopRequireDefault(_breakLoop); + var _eachOfLimit = require_eachOfLimit2(); + var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + var _once = require_once(); + var _once2 = _interopRequireDefault(_once); + var _onlyOnce = require_onlyOnce(); + var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + var _wrapAsync = require_wrapAsync(); + var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + var _awaitify = require_awaitify(); + var _awaitify2 = _interopRequireDefault(_awaitify); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function eachOfArrayLike(coll, iteratee, callback) { + callback = (0, _once2.default)(callback); + var index = 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 === _breakLoop2.default) { + callback(null); + } + } + for (; index < length; index++) { + iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback)); + } + } + function eachOfGeneric(coll, iteratee, callback) { + return (0, _eachOfLimit2.default)(coll, Infinity, iteratee, callback); + } + function eachOf(coll, iteratee, callback) { + var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric; + return eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback); + } + exports.default = (0, _awaitify2.default)(eachOf, 3); + module2.exports = exports.default; + } +}); + +// node_modules/async/internal/withoutIndex.js +var require_withoutIndex = __commonJS({ + "node_modules/async/internal/withoutIndex.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = _withoutIndex; + function _withoutIndex(iteratee) { + return (value, index, callback) => iteratee(value, callback); + } + module2.exports = exports.default; + } +}); + +// node_modules/async/forEach.js +var require_forEach = __commonJS({ + "node_modules/async/forEach.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _eachOf = require_eachOf(); + var _eachOf2 = _interopRequireDefault(_eachOf); + var _withoutIndex = require_withoutIndex(); + var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + var _wrapAsync = require_wrapAsync(); + var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + var _awaitify = require_awaitify(); + var _awaitify2 = _interopRequireDefault(_awaitify); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function eachLimit(coll, iteratee, callback) { + return (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); + } + exports.default = (0, _awaitify2.default)(eachLimit, 3); + module2.exports = exports.default; + } +}); + +// node_modules/fn.name/index.js +var require_fn = __commonJS({ + "node_modules/fn.name/index.js"(exports, module2) { + "use strict"; + var toString = Object.prototype.toString; + module2.exports = function name(fn) { + if ("string" === typeof fn.displayName && fn.constructor.name) { + return fn.displayName; + } else if ("string" === typeof fn.name && fn.name) { + return fn.name; + } + if ("object" === typeof fn && fn.constructor && "string" === typeof fn.constructor.name) + return fn.constructor.name; + var named = fn.toString(), type = toString.call(fn).slice(8, -1); + if ("Function" === type) { + named = named.substring(named.indexOf("(") + 1, named.indexOf(")")); + } else { + named = type; + } + return named || "anonymous"; + }; + } +}); + +// node_modules/one-time/index.js +var require_one_time = __commonJS({ + "node_modules/one-time/index.js"(exports, module2) { + "use strict"; + var name = require_fn(); + module2.exports = function one(fn) { + var called = 0, value; + function onetime() { + if (called) + return value; + called = 1; + value = fn.apply(this, arguments); + fn = null; + return value; + } + onetime.displayName = name(fn); + return onetime; + }; + } +}); + +// node_modules/stack-trace/lib/stack-trace.js +var require_stack_trace = __commonJS({ + "node_modules/stack-trace/lib/stack-trace.js"(exports) { + exports.get = function(belowFn) { + var oldLimit = Error.stackTraceLimit; + Error.stackTraceLimit = Infinity; + var dummyObject = {}; + var v8Handler = Error.prepareStackTrace; + Error.prepareStackTrace = function(dummyObject2, v8StackTrace2) { + return v8StackTrace2; + }; + Error.captureStackTrace(dummyObject, belowFn || exports.get); + var v8StackTrace = dummyObject.stack; + Error.prepareStackTrace = v8Handler; + Error.stackTraceLimit = oldLimit; + return v8StackTrace; + }; + exports.parse = function(err) { + if (!err.stack) { + return []; + } + var self2 = this; + var lines = err.stack.split("\n").slice(1); + return lines.map(function(line) { + if (line.match(/^\s*[-]{4,}$/)) { + return self2._createParsedCallSite({ + fileName: line, + lineNumber: null, + functionName: null, + typeName: null, + methodName: null, + columnNumber: null, + "native": null + }); + } + var lineMatch = line.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/); + if (!lineMatch) { + return; + } + var object = null; + var method = null; + var functionName = null; + var typeName = null; + var methodName = null; + var isNative = lineMatch[5] === "native"; + if (lineMatch[1]) { + functionName = lineMatch[1]; + var methodStart = functionName.lastIndexOf("."); + if (functionName[methodStart - 1] == ".") + methodStart--; + if (methodStart > 0) { + object = functionName.substr(0, methodStart); + method = functionName.substr(methodStart + 1); + var objectEnd = object.indexOf(".Module"); + if (objectEnd > 0) { + functionName = functionName.substr(objectEnd + 1); + object = object.substr(0, objectEnd); + } + } + typeName = null; + } + if (method) { + typeName = object; + methodName = method; + } + if (method === "") { + methodName = null; + functionName = null; + } + var properties = { + fileName: lineMatch[2] || null, + lineNumber: parseInt(lineMatch[3], 10) || null, + functionName, + typeName, + methodName, + columnNumber: parseInt(lineMatch[4], 10) || null, + "native": isNative + }; + return self2._createParsedCallSite(properties); + }).filter(function(callSite) { + return !!callSite; + }); + }; + function CallSite(properties) { + for (var property in properties) { + this[property] = properties[property]; + } + } + var strProperties = [ + "this", + "typeName", + "functionName", + "methodName", + "fileName", + "lineNumber", + "columnNumber", + "function", + "evalOrigin" + ]; + var boolProperties = [ + "topLevel", + "eval", + "native", + "constructor" + ]; + strProperties.forEach(function(property) { + CallSite.prototype[property] = null; + CallSite.prototype["get" + property[0].toUpperCase() + property.substr(1)] = function() { + return this[property]; + }; + }); + boolProperties.forEach(function(property) { + CallSite.prototype[property] = false; + CallSite.prototype["is" + property[0].toUpperCase() + property.substr(1)] = function() { + return this[property]; + }; + }); + exports._createParsedCallSite = function(properties) { + return new CallSite(properties); + }; + } +}); + +// node_modules/winston/lib/winston/exception-stream.js +var require_exception_stream = __commonJS({ + "node_modules/winston/lib/winston/exception-stream.js"(exports, module2) { + "use strict"; + var { Writable } = require_readable(); + module2.exports = class ExceptionStream extends Writable { + /** + * Constructor function for the ExceptionStream responsible for wrapping a + * TransportStream; only allowing writes of `info` objects with + * `info.exception` set to true. + * @param {!TransportStream} transport - Stream to filter to exceptions + */ + constructor(transport) { + super({ objectMode: true }); + if (!transport) { + throw new Error("ExceptionStream requires a TransportStream instance."); + } + this.handleExceptions = true; + this.transport = transport; + } + /** + * Writes the info object to our transport instance if (and only if) the + * `exception` property is set on the info. + * @param {mixed} info - TODO: add param description. + * @param {mixed} enc - TODO: add param description. + * @param {mixed} callback - TODO: add param description. + * @returns {mixed} - TODO: add return description. + * @private + */ + _write(info, enc, callback) { + if (info.exception) { + return this.transport.log(info, callback); + } + callback(); + return true; + } + }; + } +}); + +// node_modules/winston/lib/winston/exception-handler.js +var require_exception_handler = __commonJS({ + "node_modules/winston/lib/winston/exception-handler.js"(exports, module2) { + "use strict"; + var os2 = require("os"); + var asyncForEach = require_forEach(); + var debug = require_node2()("winston:exception"); + var once = require_one_time(); + var stackTrace = require_stack_trace(); + var ExceptionStream = require_exception_stream(); + module2.exports = class ExceptionHandler { + /** + * TODO: add contructor description + * @param {!Logger} logger - TODO: add param description + */ + constructor(logger) { + if (!logger) { + throw new Error("Logger is required to handle exceptions"); + } + this.logger = logger; + this.handlers = /* @__PURE__ */ new Map(); + } + /** + * Handles `uncaughtException` events for the current process by adding any + * handlers passed in. + * @returns {undefined} + */ + handle(...args) { + args.forEach((arg) => { + if (Array.isArray(arg)) { + return arg.forEach((handler) => this._addHandler(handler)); + } + this._addHandler(arg); + }); + if (!this.catcher) { + this.catcher = this._uncaughtException.bind(this); + process.on("uncaughtException", this.catcher); + } + } + /** + * Removes any handlers to `uncaughtException` events for the current + * process. This does not modify the state of the `this.handlers` set. + * @returns {undefined} + */ + unhandle() { + if (this.catcher) { + process.removeListener("uncaughtException", this.catcher); + this.catcher = false; + Array.from(this.handlers.values()).forEach((wrapper) => this.logger.unpipe(wrapper)); + } + } + /** + * TODO: add method description + * @param {Error} err - Error to get information about. + * @returns {mixed} - TODO: add return description. + */ + getAllInfo(err) { + let message = null; + if (err) { + message = typeof err === "string" ? err : err.message; + } + return { + error: err, + // TODO (indexzero): how do we configure this? + level: "error", + message: [ + `uncaughtException: ${message || "(no error message)"}`, + err && err.stack || " No stack trace" + ].join("\n"), + stack: err && err.stack, + exception: true, + date: new Date().toString(), + process: this.getProcessInfo(), + os: this.getOsInfo(), + trace: this.getTrace(err) + }; + } + /** + * Gets all relevant process information for the currently running process. + * @returns {mixed} - TODO: add return description. + */ + getProcessInfo() { + return { + pid: process.pid, + uid: process.getuid ? process.getuid() : null, + gid: process.getgid ? process.getgid() : null, + cwd: process.cwd(), + execPath: process.execPath, + version: process.version, + argv: process.argv, + memoryUsage: process.memoryUsage() + }; + } + /** + * Gets all relevant OS information for the currently running process. + * @returns {mixed} - TODO: add return description. + */ + getOsInfo() { + return { + loadavg: os2.loadavg(), + uptime: os2.uptime() + }; + } + /** + * Gets a stack trace for the specified error. + * @param {mixed} err - TODO: add param description. + * @returns {mixed} - TODO: add return description. + */ + getTrace(err) { + const trace = err ? stackTrace.parse(err) : stackTrace.get(); + return trace.map((site) => { + return { + column: site.getColumnNumber(), + file: site.getFileName(), + function: site.getFunctionName(), + line: site.getLineNumber(), + method: site.getMethodName(), + native: site.isNative() + }; + }); + } + /** + * Helper method to add a transport as an exception handler. + * @param {Transport} handler - The transport to add as an exception handler. + * @returns {void} + */ + _addHandler(handler) { + if (!this.handlers.has(handler)) { + handler.handleExceptions = true; + const wrapper = new ExceptionStream(handler); + this.handlers.set(handler, wrapper); + this.logger.pipe(wrapper); + } + } + /** + * Logs all relevant information around the `err` and exits the current + * process. + * @param {Error} err - Error to handle + * @returns {mixed} - TODO: add return description. + * @private + */ + _uncaughtException(err) { + const info = this.getAllInfo(err); + const handlers = this._getExceptionHandlers(); + let doExit = typeof this.logger.exitOnError === "function" ? this.logger.exitOnError(err) : this.logger.exitOnError; + let timeout; + if (!handlers.length && doExit) { + console.warn("winston: exitOnError cannot be true with no exception handlers."); + console.warn("winston: not exiting process."); + doExit = false; + } + function gracefulExit() { + debug("doExit", doExit); + debug("process._exiting", process._exiting); + if (doExit && !process._exiting) { + if (timeout) { + clearTimeout(timeout); + } + process.exit(1); + } + } + if (!handlers || handlers.length === 0) { + return process.nextTick(gracefulExit); + } + asyncForEach(handlers, (handler, next) => { + const done = once(next); + const transport = handler.transport || handler; + function onDone(event) { + return () => { + debug(event); + done(); + }; + } + transport._ending = true; + transport.once("finish", onDone("finished")); + transport.once("error", onDone("error")); + }, () => doExit && gracefulExit()); + this.logger.log(info); + if (doExit) { + timeout = setTimeout(gracefulExit, 3e3); + } + } + /** + * Returns the list of transports and exceptionHandlers for this instance. + * @returns {Array} - List of transports and exceptionHandlers for this + * instance. + * @private + */ + _getExceptionHandlers() { + return this.logger.transports.filter((wrap) => { + const transport = wrap.transport || wrap; + return transport.handleExceptions; + }); + } + }; + } +}); + +// node_modules/winston/lib/winston/rejection-stream.js +var require_rejection_stream = __commonJS({ + "node_modules/winston/lib/winston/rejection-stream.js"(exports, module2) { + "use strict"; + var { Writable } = require_readable(); + module2.exports = class RejectionStream extends Writable { + /** + * Constructor function for the RejectionStream responsible for wrapping a + * TransportStream; only allowing writes of `info` objects with + * `info.rejection` set to true. + * @param {!TransportStream} transport - Stream to filter to rejections + */ + constructor(transport) { + super({ objectMode: true }); + if (!transport) { + throw new Error("RejectionStream requires a TransportStream instance."); + } + this.handleRejections = true; + this.transport = transport; + } + /** + * Writes the info object to our transport instance if (and only if) the + * `rejection` property is set on the info. + * @param {mixed} info - TODO: add param description. + * @param {mixed} enc - TODO: add param description. + * @param {mixed} callback - TODO: add param description. + * @returns {mixed} - TODO: add return description. + * @private + */ + _write(info, enc, callback) { + if (info.rejection) { + return this.transport.log(info, callback); + } + callback(); + return true; + } + }; + } +}); + +// node_modules/winston/lib/winston/rejection-handler.js +var require_rejection_handler = __commonJS({ + "node_modules/winston/lib/winston/rejection-handler.js"(exports, module2) { + "use strict"; + var os2 = require("os"); + var asyncForEach = require_forEach(); + var debug = require_node2()("winston:rejection"); + var once = require_one_time(); + var stackTrace = require_stack_trace(); + var RejectionStream = require_rejection_stream(); + module2.exports = class RejectionHandler { + /** + * TODO: add contructor description + * @param {!Logger} logger - TODO: add param description + */ + constructor(logger) { + if (!logger) { + throw new Error("Logger is required to handle rejections"); + } + this.logger = logger; + this.handlers = /* @__PURE__ */ new Map(); + } + /** + * Handles `unhandledRejection` events for the current process by adding any + * handlers passed in. + * @returns {undefined} + */ + handle(...args) { + args.forEach((arg) => { + if (Array.isArray(arg)) { + return arg.forEach((handler) => this._addHandler(handler)); + } + this._addHandler(arg); + }); + if (!this.catcher) { + this.catcher = this._unhandledRejection.bind(this); + process.on("unhandledRejection", this.catcher); + } + } + /** + * Removes any handlers to `unhandledRejection` events for the current + * process. This does not modify the state of the `this.handlers` set. + * @returns {undefined} + */ + unhandle() { + if (this.catcher) { + process.removeListener("unhandledRejection", this.catcher); + this.catcher = false; + Array.from(this.handlers.values()).forEach( + (wrapper) => this.logger.unpipe(wrapper) + ); + } + } + /** + * TODO: add method description + * @param {Error} err - Error to get information about. + * @returns {mixed} - TODO: add return description. + */ + getAllInfo(err) { + let message = null; + if (err) { + message = typeof err === "string" ? err : err.message; + } + return { + error: err, + // TODO (indexzero): how do we configure this? + level: "error", + message: [ + `unhandledRejection: ${message || "(no error message)"}`, + err && err.stack || " No stack trace" + ].join("\n"), + stack: err && err.stack, + rejection: true, + date: new Date().toString(), + process: this.getProcessInfo(), + os: this.getOsInfo(), + trace: this.getTrace(err) + }; + } + /** + * Gets all relevant process information for the currently running process. + * @returns {mixed} - TODO: add return description. + */ + getProcessInfo() { + return { + pid: process.pid, + uid: process.getuid ? process.getuid() : null, + gid: process.getgid ? process.getgid() : null, + cwd: process.cwd(), + execPath: process.execPath, + version: process.version, + argv: process.argv, + memoryUsage: process.memoryUsage() + }; + } + /** + * Gets all relevant OS information for the currently running process. + * @returns {mixed} - TODO: add return description. + */ + getOsInfo() { + return { + loadavg: os2.loadavg(), + uptime: os2.uptime() + }; + } + /** + * Gets a stack trace for the specified error. + * @param {mixed} err - TODO: add param description. + * @returns {mixed} - TODO: add return description. + */ + getTrace(err) { + const trace = err ? stackTrace.parse(err) : stackTrace.get(); + return trace.map((site) => { + return { + column: site.getColumnNumber(), + file: site.getFileName(), + function: site.getFunctionName(), + line: site.getLineNumber(), + method: site.getMethodName(), + native: site.isNative() + }; + }); + } + /** + * Helper method to add a transport as an exception handler. + * @param {Transport} handler - The transport to add as an exception handler. + * @returns {void} + */ + _addHandler(handler) { + if (!this.handlers.has(handler)) { + handler.handleRejections = true; + const wrapper = new RejectionStream(handler); + this.handlers.set(handler, wrapper); + this.logger.pipe(wrapper); + } + } + /** + * Logs all relevant information around the `err` and exits the current + * process. + * @param {Error} err - Error to handle + * @returns {mixed} - TODO: add return description. + * @private + */ + _unhandledRejection(err) { + const info = this.getAllInfo(err); + const handlers = this._getRejectionHandlers(); + let doExit = typeof this.logger.exitOnError === "function" ? this.logger.exitOnError(err) : this.logger.exitOnError; + let timeout; + if (!handlers.length && doExit) { + console.warn("winston: exitOnError cannot be true with no rejection handlers."); + console.warn("winston: not exiting process."); + doExit = false; + } + function gracefulExit() { + debug("doExit", doExit); + debug("process._exiting", process._exiting); + if (doExit && !process._exiting) { + if (timeout) { + clearTimeout(timeout); + } + process.exit(1); + } + } + if (!handlers || handlers.length === 0) { + return process.nextTick(gracefulExit); + } + asyncForEach( + handlers, + (handler, next) => { + const done = once(next); + const transport = handler.transport || handler; + function onDone(event) { + return () => { + debug(event); + done(); + }; + } + transport._ending = true; + transport.once("finish", onDone("finished")); + transport.once("error", onDone("error")); + }, + () => doExit && gracefulExit() + ); + this.logger.log(info); + if (doExit) { + timeout = setTimeout(gracefulExit, 3e3); + } + } + /** + * Returns the list of transports and exceptionHandlers for this instance. + * @returns {Array} - List of transports and exceptionHandlers for this + * instance. + * @private + */ + _getRejectionHandlers() { + return this.logger.transports.filter((wrap) => { + const transport = wrap.transport || wrap; + return transport.handleRejections; + }); + } + }; + } +}); + +// node_modules/winston/lib/winston/profiler.js +var require_profiler = __commonJS({ + "node_modules/winston/lib/winston/profiler.js"(exports, module2) { + "use strict"; + var Profiler = class { + /** + * Constructor function for the Profiler instance used by + * `Logger.prototype.startTimer`. When done is called the timer will finish + * and log the duration. + * @param {!Logger} logger - TODO: add param description. + * @private + */ + constructor(logger) { + const Logger = require_logger(); + if (typeof logger !== "object" || Array.isArray(logger) || !(logger instanceof Logger)) { + throw new Error("Logger is required for profiling"); + } else { + this.logger = logger; + this.start = Date.now(); + } + } + /** + * Ends the current timer (i.e. Profiler) instance and logs the `msg` along + * with the duration since creation. + * @returns {mixed} - TODO: add return description. + * @private + */ + done(...args) { + if (typeof args[args.length - 1] === "function") { + console.warn("Callback function no longer supported as of winston@3.0.0"); + args.pop(); + } + const info = typeof args[args.length - 1] === "object" ? args.pop() : {}; + info.level = info.level || "info"; + info.durationMs = Date.now() - this.start; + return this.logger.write(info); + } + }; + module2.exports = Profiler; + } +}); + +// node_modules/winston/lib/winston/logger.js +var require_logger = __commonJS({ + "node_modules/winston/lib/winston/logger.js"(exports, module2) { + "use strict"; + var { Stream, Transform } = require_readable(); + var asyncForEach = require_forEach(); + var { LEVEL, SPLAT } = require_triple_beam(); + var isStream = require_is_stream(); + var ExceptionHandler = require_exception_handler(); + var RejectionHandler = require_rejection_handler(); + var LegacyTransportStream = require_legacy(); + var Profiler = require_profiler(); + var { warn } = require_common(); + var config = require_config2(); + var formatRegExp = /%[scdjifoO%]/g; + var Logger = class extends Transform { + /** + * Constructor function for the Logger object responsible for persisting log + * messages and metadata to one or more transports. + * @param {!Object} options - foo + */ + constructor(options) { + super({ objectMode: true }); + this.configure(options); + } + child(defaultRequestMetadata) { + const logger = this; + return Object.create(logger, { + write: { + value: function(info) { + const infoClone = Object.assign( + {}, + defaultRequestMetadata, + info + ); + if (info instanceof Error) { + infoClone.stack = info.stack; + infoClone.message = info.message; + } + logger.write(infoClone); + } + } + }); + } + /** + * This will wholesale reconfigure this instance by: + * 1. Resetting all transports. Older transports will be removed implicitly. + * 2. Set all other options including levels, colors, rewriters, filters, + * exceptionHandlers, etc. + * @param {!Object} options - TODO: add param description. + * @returns {undefined} + */ + configure({ + silent, + format, + defaultMeta, + levels, + level = "info", + exitOnError = true, + transports, + colors, + emitErrs, + formatters, + padLevels, + rewriters, + stripColors, + exceptionHandlers, + rejectionHandlers + } = {}) { + if (this.transports.length) { + this.clear(); + } + this.silent = silent; + this.format = format || this.format || require_json()(); + this.defaultMeta = defaultMeta || null; + this.levels = levels || this.levels || config.npm.levels; + this.level = level; + if (this.exceptions) { + this.exceptions.unhandle(); + } + if (this.rejections) { + this.rejections.unhandle(); + } + this.exceptions = new ExceptionHandler(this); + this.rejections = new RejectionHandler(this); + this.profilers = {}; + this.exitOnError = exitOnError; + if (transports) { + transports = Array.isArray(transports) ? transports : [transports]; + transports.forEach((transport) => this.add(transport)); + } + if (colors || emitErrs || formatters || padLevels || rewriters || stripColors) { + throw new Error( + [ + "{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.", + "Use a custom winston.format(function) instead.", + "See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md" + ].join("\n") + ); + } + if (exceptionHandlers) { + this.exceptions.handle(exceptionHandlers); + } + if (rejectionHandlers) { + this.rejections.handle(rejectionHandlers); + } + } + isLevelEnabled(level) { + const givenLevelValue = getLevelValue(this.levels, level); + if (givenLevelValue === null) { + return false; + } + const configuredLevelValue = getLevelValue(this.levels, this.level); + if (configuredLevelValue === null) { + return false; + } + if (!this.transports || this.transports.length === 0) { + return configuredLevelValue >= givenLevelValue; + } + const index = this.transports.findIndex((transport) => { + let transportLevelValue = getLevelValue(this.levels, transport.level); + if (transportLevelValue === null) { + transportLevelValue = configuredLevelValue; + } + return transportLevelValue >= givenLevelValue; + }); + return index !== -1; + } + /* eslint-disable valid-jsdoc */ + /** + * Ensure backwards compatibility with a `log` method + * @param {mixed} level - Level the log message is written at. + * @param {mixed} msg - TODO: add param description. + * @param {mixed} meta - TODO: add param description. + * @returns {Logger} - TODO: add return description. + * + * @example + * // Supports the existing API: + * logger.log('info', 'Hello world', { custom: true }); + * logger.log('info', new Error('Yo, it\'s on fire')); + * + * // Requires winston.format.splat() + * logger.log('info', '%s %d%%', 'A string', 50, { thisIsMeta: true }); + * + * // And the new API with a single JSON literal: + * logger.log({ level: 'info', message: 'Hello world', custom: true }); + * logger.log({ level: 'info', message: new Error('Yo, it\'s on fire') }); + * + * // Also requires winston.format.splat() + * logger.log({ + * level: 'info', + * message: '%s %d%%', + * [SPLAT]: ['A string', 50], + * meta: { thisIsMeta: true } + * }); + * + */ + /* eslint-enable valid-jsdoc */ + log(level, msg, ...splat) { + if (arguments.length === 1) { + level[LEVEL] = level.level; + this._addDefaultMeta(level); + this.write(level); + return this; + } + if (arguments.length === 2) { + if (msg && typeof msg === "object") { + msg[LEVEL] = msg.level = level; + this._addDefaultMeta(msg); + this.write(msg); + return this; + } + msg = { [LEVEL]: level, level, message: msg }; + this._addDefaultMeta(msg); + this.write(msg); + return this; + } + const [meta] = splat; + if (typeof meta === "object" && meta !== null) { + const tokens = msg && msg.match && msg.match(formatRegExp); + if (!tokens) { + const info = Object.assign({}, this.defaultMeta, meta, { + [LEVEL]: level, + [SPLAT]: splat, + level, + message: msg + }); + if (meta.message) + info.message = `${info.message} ${meta.message}`; + if (meta.stack) + info.stack = meta.stack; + this.write(info); + return this; + } + } + this.write(Object.assign({}, this.defaultMeta, { + [LEVEL]: level, + [SPLAT]: splat, + level, + message: msg + })); + return this; + } + /** + * Pushes data so that it can be picked up by all of our pipe targets. + * @param {mixed} info - TODO: add param description. + * @param {mixed} enc - TODO: add param description. + * @param {mixed} callback - Continues stream processing. + * @returns {undefined} + * @private + */ + _transform(info, enc, callback) { + if (this.silent) { + return callback(); + } + if (!info[LEVEL]) { + info[LEVEL] = info.level; + } + if (!this.levels[info[LEVEL]] && this.levels[info[LEVEL]] !== 0) { + console.error("[winston] Unknown logger level: %s", info[LEVEL]); + } + if (!this._readableState.pipes) { + console.error( + "[winston] Attempt to write logs with no transports, which can increase memory usage: %j", + info + ); + } + try { + this.push(this.format.transform(info, this.format.options)); + } finally { + this._writableState.sync = false; + callback(); + } + } + /** + * Delays the 'finish' event until all transport pipe targets have + * also emitted 'finish' or are already finished. + * @param {mixed} callback - Continues stream processing. + */ + _final(callback) { + const transports = this.transports.slice(); + asyncForEach( + transports, + (transport, next) => { + if (!transport || transport.finished) + return setImmediate(next); + transport.once("finish", next); + transport.end(); + }, + callback + ); + } + /** + * Adds the transport to this logger instance by piping to it. + * @param {mixed} transport - TODO: add param description. + * @returns {Logger} - TODO: add return description. + */ + add(transport) { + const target = !isStream(transport) || transport.log.length > 2 ? new LegacyTransportStream({ transport }) : transport; + if (!target._writableState || !target._writableState.objectMode) { + throw new Error( + "Transports must WritableStreams in objectMode. Set { objectMode: true }." + ); + } + this._onEvent("error", target); + this._onEvent("warn", target); + this.pipe(target); + if (transport.handleExceptions) { + this.exceptions.handle(); + } + if (transport.handleRejections) { + this.rejections.handle(); + } + return this; + } + /** + * Removes the transport from this logger instance by unpiping from it. + * @param {mixed} transport - TODO: add param description. + * @returns {Logger} - TODO: add return description. + */ + remove(transport) { + if (!transport) + return this; + let target = transport; + if (!isStream(transport) || transport.log.length > 2) { + target = this.transports.filter( + (match) => match.transport === transport + )[0]; + } + if (target) { + this.unpipe(target); + } + return this; + } + /** + * Removes all transports from this logger instance. + * @returns {Logger} - TODO: add return description. + */ + clear() { + this.unpipe(); + return this; + } + /** + * Cleans up resources (streams, event listeners) for all transports + * associated with this instance (if necessary). + * @returns {Logger} - TODO: add return description. + */ + close() { + this.exceptions.unhandle(); + this.rejections.unhandle(); + this.clear(); + this.emit("close"); + return this; + } + /** + * Sets the `target` levels specified on this instance. + * @param {Object} Target levels to use on this instance. + */ + setLevels() { + warn.deprecated("setLevels"); + } + /** + * Queries the all transports for this instance with the specified `options`. + * This will aggregate each transport's results into one object containing + * a property per transport. + * @param {Object} options - Query options for this instance. + * @param {function} callback - Continuation to respond to when complete. + */ + query(options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } + options = options || {}; + const results = {}; + const queryObject = Object.assign({}, options.query || {}); + function queryTransport(transport, next) { + if (options.query && typeof transport.formatQuery === "function") { + options.query = transport.formatQuery(queryObject); + } + transport.query(options, (err, res) => { + if (err) { + return next(err); + } + if (typeof transport.formatResults === "function") { + res = transport.formatResults(res, options.format); + } + next(null, res); + }); + } + function addResults(transport, next) { + queryTransport(transport, (err, result2) => { + if (next) { + result2 = err || result2; + if (result2) { + results[transport.name] = result2; + } + next(); + } + next = null; + }); + } + asyncForEach( + this.transports.filter((transport) => !!transport.query), + addResults, + () => callback(null, results) + ); + } + /** + * Returns a log stream for all transports. Options object is optional. + * @param{Object} options={} - Stream options for this instance. + * @returns {Stream} - TODO: add return description. + */ + stream(options = {}) { + const out = new Stream(); + const streams = []; + out._streams = streams; + out.destroy = () => { + let i = streams.length; + while (i--) { + streams[i].destroy(); + } + }; + this.transports.filter((transport) => !!transport.stream).forEach((transport) => { + const str = transport.stream(options); + if (!str) { + return; + } + streams.push(str); + str.on("log", (log) => { + log.transport = log.transport || []; + log.transport.push(transport.name); + out.emit("log", log); + }); + str.on("error", (err) => { + err.transport = err.transport || []; + err.transport.push(transport.name); + out.emit("error", err); + }); + }); + return out; + } + /** + * Returns an object corresponding to a specific timing. When done is called + * the timer will finish and log the duration. e.g.: + * @returns {Profile} - TODO: add return description. + * @example + * const timer = winston.startTimer() + * setTimeout(() => { + * timer.done({ + * message: 'Logging message' + * }); + * }, 1000); + */ + startTimer() { + return new Profiler(this); + } + /** + * Tracks the time inbetween subsequent calls to this method with the same + * `id` parameter. The second call to this method will log the difference in + * milliseconds along with the message. + * @param {string} id Unique id of the profiler + * @returns {Logger} - TODO: add return description. + */ + profile(id, ...args) { + const time = Date.now(); + if (this.profilers[id]) { + const timeEnd = this.profilers[id]; + delete this.profilers[id]; + if (typeof args[args.length - 2] === "function") { + console.warn( + "Callback function no longer supported as of winston@3.0.0" + ); + args.pop(); + } + const info = typeof args[args.length - 1] === "object" ? args.pop() : {}; + info.level = info.level || "info"; + info.durationMs = time - timeEnd; + info.message = info.message || id; + return this.write(info); + } + this.profilers[id] = time; + return this; + } + /** + * Backwards compatibility to `exceptions.handle` in winston < 3.0.0. + * @returns {undefined} + * @deprecated + */ + handleExceptions(...args) { + console.warn( + "Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()" + ); + this.exceptions.handle(...args); + } + /** + * Backwards compatibility to `exceptions.handle` in winston < 3.0.0. + * @returns {undefined} + * @deprecated + */ + unhandleExceptions(...args) { + console.warn( + "Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()" + ); + this.exceptions.unhandle(...args); + } + /** + * Throw a more meaningful deprecation notice + * @throws {Error} - TODO: add throws description. + */ + cli() { + throw new Error( + [ + "Logger.cli() was removed in winston@3.0.0", + "Use a custom winston.formats.cli() instead.", + "See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md" + ].join("\n") + ); + } + /** + * Bubbles the `event` that occured on the specified `transport` up + * from this instance. + * @param {string} event - The event that occured + * @param {Object} transport - Transport on which the event occured + * @private + */ + _onEvent(event, transport) { + function transportEvent(err) { + if (event === "error" && !this.transports.includes(transport)) { + this.add(transport); + } + this.emit(event, err, transport); + } + if (!transport["__winston" + event]) { + transport["__winston" + event] = transportEvent.bind(this); + transport.on(event, transport["__winston" + event]); + } + } + _addDefaultMeta(msg) { + if (this.defaultMeta) { + Object.assign(msg, this.defaultMeta); + } + } + }; + function getLevelValue(levels, level) { + const value = levels[level]; + if (!value && value !== 0) { + return null; + } + return value; + } + Object.defineProperty(Logger.prototype, "transports", { + configurable: false, + enumerable: true, + get() { + const { pipes } = this._readableState; + return !Array.isArray(pipes) ? [pipes].filter(Boolean) : pipes; + } + }); + module2.exports = Logger; + } +}); + +// node_modules/winston/lib/winston/create-logger.js +var require_create_logger = __commonJS({ + "node_modules/winston/lib/winston/create-logger.js"(exports, module2) { + "use strict"; + var { LEVEL } = require_triple_beam(); + var config = require_config2(); + var Logger = require_logger(); + var debug = require_node2()("winston:create-logger"); + function isLevelEnabledFunctionName(level) { + return "is" + level.charAt(0).toUpperCase() + level.slice(1) + "Enabled"; + } + module2.exports = function(opts = {}) { + opts.levels = opts.levels || config.npm.levels; + class DerivedLogger extends Logger { + /** + * Create a new class derived logger for which the levels can be attached to + * the prototype of. This is a V8 optimization that is well know to increase + * performance of prototype functions. + * @param {!Object} options - Options for the created logger. + */ + constructor(options) { + super(options); + } + } + const logger = new DerivedLogger(opts); + Object.keys(opts.levels).forEach(function(level) { + debug('Define prototype method for "%s"', level); + if (level === "log") { + console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.'); + return; + } + DerivedLogger.prototype[level] = function(...args) { + const self2 = this || logger; + if (args.length === 1) { + const [msg] = args; + const info = msg && msg.message && msg || { message: msg }; + info.level = info[LEVEL] = level; + self2._addDefaultMeta(info); + self2.write(info); + return this || logger; + } + if (args.length === 0) { + self2.log(level, ""); + return self2; + } + return self2.log(level, ...args); + }; + DerivedLogger.prototype[isLevelEnabledFunctionName(level)] = function() { + return (this || logger).isLevelEnabled(level); + }; + }); + return logger; + }; + } +}); + +// node_modules/winston/lib/winston/container.js +var require_container = __commonJS({ + "node_modules/winston/lib/winston/container.js"(exports, module2) { + "use strict"; + var createLogger = require_create_logger(); + module2.exports = class Container { + /** + * Constructor function for the Container object responsible for managing a + * set of `winston.Logger` instances based on string ids. + * @param {!Object} [options={}] - Default pass-thru options for Loggers. + */ + constructor(options = {}) { + this.loggers = /* @__PURE__ */ new Map(); + this.options = options; + } + /** + * Retrieves a `winston.Logger` instance for the specified `id`. If an + * instance does not exist, one is created. + * @param {!string} id - The id of the Logger to get. + * @param {?Object} [options] - Options for the Logger instance. + * @returns {Logger} - A configured Logger instance with a specified id. + */ + add(id, options) { + if (!this.loggers.has(id)) { + options = Object.assign({}, options || this.options); + const existing = options.transports || this.options.transports; + if (existing) { + options.transports = Array.isArray(existing) ? existing.slice() : [existing]; + } else { + options.transports = []; + } + const logger = createLogger(options); + logger.on("close", () => this._delete(id)); + this.loggers.set(id, logger); + } + return this.loggers.get(id); + } + /** + * Retreives a `winston.Logger` instance for the specified `id`. If + * an instance does not exist, one is created. + * @param {!string} id - The id of the Logger to get. + * @param {?Object} [options] - Options for the Logger instance. + * @returns {Logger} - A configured Logger instance with a specified id. + */ + get(id, options) { + return this.add(id, options); + } + /** + * Check if the container has a logger with the id. + * @param {?string} id - The id of the Logger instance to find. + * @returns {boolean} - Boolean value indicating if this instance has a + * logger with the specified `id`. + */ + has(id) { + return !!this.loggers.has(id); + } + /** + * Closes a `Logger` instance with the specified `id` if it exists. + * If no `id` is supplied then all Loggers are closed. + * @param {?string} id - The id of the Logger instance to close. + * @returns {undefined} + */ + close(id) { + if (id) { + return this._removeLogger(id); + } + this.loggers.forEach((val, key) => this._removeLogger(key)); + } + /** + * Remove a logger based on the id. + * @param {!string} id - The id of the logger to remove. + * @returns {undefined} + * @private + */ + _removeLogger(id) { + if (!this.loggers.has(id)) { + return; + } + const logger = this.loggers.get(id); + logger.close(); + this._delete(id); + } + /** + * Deletes a `Logger` instance with the specified `id`. + * @param {!string} id - The id of the Logger instance to delete from + * container. + * @returns {undefined} + * @private + */ + _delete(id) { + this.loggers.delete(id); + } + }; + } +}); + +// node_modules/winston/lib/winston.js +var require_winston = __commonJS({ + "node_modules/winston/lib/winston.js"(exports) { + "use strict"; + var logform = require_logform(); + var { warn } = require_common(); + exports.version = require_package().version; + exports.transports = require_transports(); + exports.config = require_config2(); + exports.addColors = logform.levels; + exports.format = logform.format; + exports.createLogger = require_create_logger(); + exports.Logger = require_logger(); + exports.ExceptionHandler = require_exception_handler(); + exports.RejectionHandler = require_rejection_handler(); + exports.Container = require_container(); + exports.Transport = require_winston_transport(); + exports.loggers = new exports.Container(); + var defaultLogger = exports.createLogger(); + Object.keys(exports.config.npm.levels).concat([ + "log", + "query", + "stream", + "add", + "remove", + "clear", + "profile", + "startTimer", + "handleExceptions", + "unhandleExceptions", + "handleRejections", + "unhandleRejections", + "configure", + "child" + ]).forEach( + (method) => exports[method] = (...args) => defaultLogger[method](...args) + ); + Object.defineProperty(exports, "level", { + get() { + return defaultLogger.level; + }, + set(val) { + defaultLogger.level = val; + } + }); + Object.defineProperty(exports, "exceptions", { + get() { + return defaultLogger.exceptions; + } + }); + Object.defineProperty(exports, "rejections", { + get() { + return defaultLogger.rejections; + } + }); + ["exitOnError"].forEach((prop) => { + Object.defineProperty(exports, prop, { + get() { + return defaultLogger[prop]; + }, + set(val) { + defaultLogger[prop] = val; + } + }); + }); + Object.defineProperty(exports, "default", { + get() { + return { + exceptionHandlers: defaultLogger.exceptionHandlers, + rejectionHandlers: defaultLogger.rejectionHandlers, + transports: defaultLogger.transports + }; + } + }); + warn.deprecated(exports, "setLevels"); + warn.forFunctions(exports, "useFormat", ["cli"]); + warn.forProperties(exports, "useFormat", ["padLevels", "stripColors"]); + warn.forFunctions(exports, "deprecated", [ + "addRewriter", + "addFilter", + "clone", + "extend" + ]); + warn.forProperties(exports, "deprecated", ["emitErrs", "levelLength"]); + } +}); + +// node_modules/neovim/lib/utils/logger.js +var require_logger2 = __commonJS({ + "node_modules/neovim/lib/utils/logger.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result2 = {}; + if (mod != null) { + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result2, mod, k); + } + __setModuleDefault(result2, mod); + return result2; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getLogger = getLogger; + var winston = __importStar(require_winston()); + var node_util_1 = require("util"); + var level = process.env.NVIM_NODE_LOG_LEVEL || "debug"; + var loggerKeys = ["info", "warn", "error", "debug", "level"]; + function getFormat(colorize) { + return winston.format.combine(winston.format.splat(), winston.format.timestamp({ + format: "YYYY-MM-DD HH:mm:ss" + }), winston.format.printf((info) => { + let msg; + try { + msg = typeof info.message === "object" ? (0, node_util_1.inspect)(info.message, false, 2, colorize) : info.message; + } catch (_a) { + msg = info.message; + } + const lvl = info.level === "debug" ? "DBG" : info.level.slice(0, 3).toUpperCase(); + return `${info.timestamp} ${lvl} ${msg}`; + })); + } + function setupWinstonLogger() { + const logger = winston.createLogger({ + level + }); + if (process.env.NVIM_NODE_LOG_FILE) { + logger.add(new winston.transports.File({ + filename: process.env.NVIM_NODE_LOG_FILE, + level, + format: getFormat(false) + })); + } + if (process.env.ALLOW_CONSOLE) { + logger.add(new winston.transports.Console({ + format: getFormat(true) + })); + } + if (!process.env.NVIM_NODE_LOG_FILE && !process.env.ALLOW_CONSOLE) { + logger.add(new winston.transports.Console({ silent: true })); + } + Object.keys(console).forEach((k) => { + const loggerKey = k === "log" ? "info" : k; + if (k === "assert") { + console.assert = function(condition, ...data) { + if (!condition) { + logger.error("assertion failed", ...data); + } + }; + } else if (loggerKeys.includes(loggerKey)) { + console[k] = function(...args) { + const loggerFn = logger[loggerKey]; + loggerFn.apply(logger, args); + }; + } + }); + return logger; + } + var _logger; + function getLogger() { + if (!_logger) { + _logger = setupWinstonLogger(); + } + return _logger; + } + } +}); + +// node_modules/neovim/lib/api/Base.js +var require_Base = __commonJS({ + "node_modules/neovim/lib/api/Base.js"(exports) { + "use strict"; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result2) { + result2.done ? resolve(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var _a; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BaseApi = void 0; + var node_events_1 = require("events"); + var util_1 = require_util(); + var logger_1 = require_logger2(); + var DO_REQUEST = Symbol("DO_REQUEST"); + var BaseApi = class extends node_events_1.EventEmitter { + constructor({ transport, data, logger, metadata, client }) { + super(); + this._isReady = Promise.resolve(false); + this[_a] = (name, args = []) => new Promise((resolve, reject) => { + this.transport.request(name, args, (err, res) => { + if (this.logger.level === "debug") { + let logData; + try { + logData = res && typeof res === "object" ? (0, util_1.partialClone)(res, 2, ["logger", "transport", "client"], "[Object]") : res; + } catch (_b) { + logData = String(res); + } + this.logger.debug(`response -> ${name}: %O`, logData); + } + if (err) { + reject(new Error(`${name}: ${err[1]}`)); + } else { + resolve(res); + } + }); + }); + this.transport = transport; + this.data = data; + this.logger = logger || (0, logger_1.getLogger)(); + this.client = client; + if (metadata) { + Object.defineProperty(this, "metadata", { value: metadata }); + } + } + equals(other) { + try { + return String(this.data) === String(other.data); + } catch (e) { + return false; + } + } + asyncRequest(name_1) { + return __awaiter(this, arguments, void 0, function* (name, args = []) { + yield this._isReady; + this.logger.debug(`request -> ${name}`); + return this[DO_REQUEST](name, args).catch((err) => { + const newError = new Error(err.message); + this.logger.error(`failed request to "%s": %s: %s`, name, newError.name, newError.message); + throw newError; + }); + }); + } + request(name, args = []) { + return this.asyncRequest(name, args); + } + _getArgsByPrefix(...args) { + const _args = []; + if (this.prefix !== "nvim_") { + _args.push(this); + } + return _args.concat(args); + } + /** Retrieves a scoped variable depending on type (using `this.prefix`) */ + getVar(name) { + return __awaiter(this, void 0, void 0, function* () { + const args = this._getArgsByPrefix(name); + return this.request(`${this.prefix}get_var`, args).then((res) => res, (err) => { + if (err && err.message && err.message.includes("not found")) { + return null; + } + throw err; + }); + }); + } + /** Set a scoped variable */ + setVar(name, value) { + const args = this._getArgsByPrefix(name, value); + return this.request(`${this.prefix}set_var`, args); + } + /** Delete a scoped variable */ + deleteVar(name) { + const args = this._getArgsByPrefix(name); + return this.request(`${this.prefix}del_var`, args); + } + /** Retrieves a scoped option depending on type of `this` */ + getOption(name) { + const args = this._getArgsByPrefix(name); + return this.request(`${this.prefix}get_option`, args); + } + /** Set scoped option */ + setOption(name, value) { + const args = this._getArgsByPrefix(name, value); + return this.request(`${this.prefix}set_option`, args); + } + // TODO: Is this necessary? + /** `request` is basically the same except you can choose to wait forpromise to be resolved */ + notify(name, args) { + this.logger.debug(`notify -> ${name}`); + this.transport.notify(name, args); + } + }; + exports.BaseApi = BaseApi; + _a = DO_REQUEST; + } +}); + +// node_modules/neovim/lib/api/Buffer.js +var require_Buffer = __commonJS({ + "node_modules/neovim/lib/api/Buffer.js"(exports) { + "use strict"; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result2) { + result2.done ? resolve(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var _a; + var _b; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Buffer = exports.ATTACH = exports.DETACH = void 0; + var Base_1 = require_Base(); + var types_1 = require_types(); + exports.DETACH = Symbol("detachBuffer"); + exports.ATTACH = Symbol("attachBuffer"); + var Buffer2 = class extends Base_1.BaseApi { + constructor() { + super(...arguments); + this.prefix = types_1.Metadata[types_1.ExtType.Buffer].prefix; + this[_a] = (...args_1) => __awaiter(this, [...args_1], void 0, function* (sendBuffer = false, options = {}) { + if (this.client.isAttached(this)) + return true; + return this.request(`${this.prefix}attach`, [this, sendBuffer, options]); + }); + this[_b] = () => this.request(`${this.prefix}detach`, [this]); + } + get isAttached() { + return this.client.isAttached(this); + } + /** + * Get the bufnr of Buffer + */ + get id() { + return this.data; + } + /** Total number of lines in buffer */ + get length() { + return this.request(`${this.prefix}line_count`, [this]); + } + /** Get lines in buffer */ + get lines() { + return this.getLines(); + } + /** Gets a changed tick of a buffer */ + get changedtick() { + return this.request(`${this.prefix}get_changedtick`, [this]); + } + get commands() { + return this.getCommands(); + } + getCommands(options = {}) { + return this.request(`${this.prefix}get_commands`, [this, options]); + } + /** Get specific lines of buffer */ + getLines({ start, end, strictIndexing } = { start: 0, end: -1, strictIndexing: true }) { + const indexing = typeof strictIndexing === "undefined" ? true : strictIndexing; + return this.request(`${this.prefix}get_lines`, [ + this, + start, + end, + indexing + ]); + } + /** Set lines of buffer given indeces */ + setLines(_lines, { start: _start, end: _end, strictIndexing } = { + strictIndexing: true + }) { + if (_start === void 0 || _end === void 0) { + throw new Error("start and end are required"); + } + const indexing = typeof strictIndexing === "undefined" ? true : strictIndexing; + const lines = typeof _lines === "string" ? [_lines] : _lines; + const end = typeof _end !== "undefined" ? _end : _start + 1; + return this.request(`${this.prefix}set_lines`, [ + this, + _start, + end, + indexing, + lines + ]); + } + /** Insert lines at `start` index */ + insert(lines, start) { + return this.setLines(lines, { + start, + end: start, + strictIndexing: true + }); + } + /** Replace lines starting at `start` index */ + replace(_lines, start) { + const lines = typeof _lines === "string" ? [_lines] : _lines; + return this.setLines(lines, { + start, + end: start + lines.length, + strictIndexing: false + }); + } + /** Remove lines at index */ + remove(start, end, strictIndexing) { + return this.setLines([], { start, end, strictIndexing }); + } + /** Append a string or list of lines to end of buffer */ + append(lines) { + return this.setLines(lines, { + start: -1, + end: -1, + strictIndexing: false + }); + } + /** Get buffer name */ + get name() { + return this.request(`${this.prefix}get_name`, [this]); + } + /** Set current buffer name */ + set name(value) { + this.request(`${this.prefix}set_name`, [this, value]); + } + /** Is current buffer valid */ + get valid() { + return this.request(`${this.prefix}is_valid`, [this]); + } + /** Get mark position given mark name */ + mark(name) { + return this.request(`${this.prefix}get_mark`, [this, name]); + } + // range(start, end) { + // """Return a `Range` object, which represents part of the Buffer.""" + // return Range(this, start, end) + // } + /** + * Gets a list of buffer-local |mapping| definitions. + */ + getKeymap(mode) { + return this.request(`${this.prefix}get_keymap`, [this, mode]); + } + /** + * Checks if a buffer is valid and loaded. See |api-buffer| for + * more info about unloaded buffers. + */ + get loaded() { + return this.request(`${this.prefix}is_loaded`, [this]); + } + /** + * Returns the byte offset for a line. + * + * Line 1 (index=0) has offset 0. UTF-8 bytes are counted. EOL is + * one byte. 'fileformat' and 'fileencoding' are ignored. The + * line index just after the last line gives the total byte-count + * of the buffer. A final EOL byte is counted if it would be + * written, see 'eol'. + * + * Unlike |line2byte()|, throws error for out-of-bounds indexing. + * Returns -1 for unloaded buffer. + * + * @return {Number} Integer byte offset, or -1 for unloaded buffer. + */ + getOffset(index) { + return this.request(`${this.prefix}get_offset`, [this, index]); + } + /** + * Adds a highlight to buffer. + * + * Useful for plugins that dynamically generate highlights to a + * buffer (like a semantic highlighter or linter). The function + * adds a single highlight to a buffer. Unlike |matchaddpos()| + * highlights follow changes to line numbering (as lines are + * inserted/removed above the highlighted line), like signs and + * marks do. + * + * Namespaces are used for batch deletion/updating of a set of + * highlights. To create a namespace, use |nvim_create_namespace| + * which returns a namespace id. Pass it in to this function as + * `ns_id` to add highlights to the namespace. All highlights in + * the same namespace can then be cleared with single call to + * |nvim_buf_clear_namespace|. If the highlight never will be + * deleted by an API call, pass `ns_id = -1`. + * + * As a shorthand, `ns_id = 0` can be used to create a new + * namespace for the highlight, the allocated id is then + * returned. If `hl_group` is the empty string no highlight is + * added, but a new `ns_id` is still returned. This is supported + * for backwards compatibility, new code should use + * |nvim_create_namespace| to create a new empty namespace. + */ + addHighlight({ hlGroup: _hlGroup, line, colStart: _start, colEnd: _end, srcId: _srcId }) { + const hlGroup = typeof _hlGroup !== "undefined" ? _hlGroup : ""; + const colEnd = typeof _end !== "undefined" ? _end : -1; + const colStart = typeof _start !== "undefined" ? _start : -0; + const srcId = typeof _srcId !== "undefined" ? _srcId : -1; + return this.request(`${this.prefix}add_highlight`, [ + this, + srcId, + hlGroup, + line, + colStart, + colEnd + ]); + } + /** + * Deprecated + */ + clearHighlight(args = {}) { + console.warn("`clearHighlight` is deprecated, use ``clearNamespace()` instead"); + const defaults = { + srcId: -1, + lineStart: 0, + lineEnd: -1 + }; + const { srcId, lineStart, lineEnd } = Object.assign(Object.assign({}, defaults), args); + return this.request(`${this.prefix}clear_highlight`, [ + this, + srcId, + lineStart, + lineEnd + ]); + } + /** + * Clears namespaced objects, highlights and virtual text, from a line range + * + * To clear the namespace in the entire buffer, pass in 0 and -1 to line_start and line_end respectively. + * + * @param {Number} nsId Namespace to clear, or -1 to clear all namespaces + * @param {Number} lineStart Start of range of lines to clear + * @param {Number} lineEnd End of range of lines to clear (exclusive) or -1 to clear to end of buffer + */ + clearNamespace(args) { + const defaults = { + nsId: -1, + lineStart: 0, + lineEnd: -1 + }; + const { nsId, lineStart, lineEnd } = Object.assign(Object.assign({}, defaults), args); + this.request(`${this.prefix}clear_namespace`, [ + this, + nsId, + lineStart, + lineEnd + ]); + } + /** + * Set the virtual text (annotation) for a buffer line. + * + * By default (and currently the only option) the text will be + * placed after the buffer text. Virtual text will never cause + * reflow, rather virtual text will be truncated at the end of + * the screen line. The virtual text will begin one cell + * (|lcs-eol| or space) after the ordinary text. + * + * Namespaces are used to support batch deletion/updating of + * virtual text. To create a namespace, use + * |nvim_create_namespace|. Virtual text is cleared using + * |nvim_buf_clear_namespace|. The same `ns_id` can be used for + * both virtual text and highlights added by + * |nvim_buf_add_highlight|, both can then be cleared with a + * single call to |nvim_buf_clear_namespace|. If the virtual text + * never will be cleared by an API call, pass `ns_id = -1`. + * + * As a shorthand, `ns_id = 0` can be used to create a new + * namespace for the virtual text, the allocated id is then + * returned. + * + * @param + * @param {Number} nsId Namespace to use or 0 to create a namespace, or -1 for a ungrouped annotation + * @param {Number} line Line to annotate with virtual text (zero-indexed) + * @param {VirtualTextChunk[]} chunks A list of [text, hl_group] arrays, each + representing a text chunk with specified + highlight. `hl_group` element can be omitted for + no highlight. + * @param {Object} opts Optional parameters. Currently not used. + */ + setVirtualText(nsId, line, chunks, opts = {}) { + return this.request(`${this.prefix}set_virtual_text`, [ + this, + nsId, + line, + chunks, + opts + ]); + } + /** + * Listens to buffer for events + */ + listen(eventName, cb) { + if (!this.isAttached) { + this[exports.ATTACH]().then((attached) => { + if (!attached) { + this.unlisten(eventName, cb); + } + }); + } + this.client.attachBuffer(this, eventName, cb); + return () => { + this.unlisten(eventName, cb); + }; + } + unlisten(eventName, cb) { + if (!this.isAttached) + return; + const shouldDetach = this.client.detachBuffer(this, eventName, cb); + if (!shouldDetach) + return; + this[exports.DETACH](); + } + }; + exports.Buffer = Buffer2; + _a = exports.ATTACH, _b = exports.DETACH; + } +}); + +// node_modules/neovim/lib/api/utils/createChainableApi.js +var require_createChainableApi = __commonJS({ + "node_modules/neovim/lib/api/utils/createChainableApi.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createChainableApi = createChainableApi; + var Base_1 = require_Base(); + var baseProperties = Object.getOwnPropertyNames(Base_1.BaseApi.prototype); + function createChainableApi(name, Type, requestPromise, chainCallPromise) { + const that = this; + if (that[`${name}Promise`] && that[`${name}Promise`].status === 0 && that[`${name}Proxy`]) { + return that[`${name}Proxy`]; + } + that[`${name}Promise`] = requestPromise(); + [...baseProperties, ...Object.getOwnPropertyNames(Type.prototype)].forEach((key) => { + Object.defineProperty(that[`${name}Promise`], key, { + enumerable: true, + writable: true, + configurable: true + }); + }); + const proxyHandler = { + get: (target, prop) => { + const isOnPrototype = Object.prototype.hasOwnProperty.call(Type.prototype, prop) || Object.prototype.hasOwnProperty.call(Base_1.BaseApi.prototype, prop); + const descriptor = Object.getOwnPropertyDescriptor(Type.prototype, prop) || Object.getOwnPropertyDescriptor(Base_1.BaseApi.prototype, prop); + const isGetter = descriptor && (typeof descriptor.get !== "undefined" || typeof descriptor.set !== "undefined"); + if (Type && isOnPrototype) { + if (isOnPrototype && !isGetter && (prop in Type.prototype && typeof Type.prototype[prop] === "function" || prop in Base_1.BaseApi.prototype && typeof Base_1.BaseApi.prototype[prop] === "function")) { + return (...args) => that[`${name}Promise`].then((res) => res[prop].call(res, ...args)); + } + return chainCallPromise && chainCallPromise() || that[`${name}Promise`].then((res) => res[prop]); + } + if (prop in target) { + if (typeof target[prop] === "function") { + return target[prop].bind(target); + } + return target[prop]; + } + return null; + }, + set: (target, prop, value, receiver) => { + if (receiver && (receiver instanceof Promise || "then" in receiver)) { + receiver.then((obj) => { + if (prop in obj) { + obj[prop] = value; + } + }); + } else { + target[prop] = value; + } + return true; + } + }; + that[`${name}Proxy`] = new Proxy(that[`${name}Promise`], proxyHandler); + return that[`${name}Proxy`]; + } + } +}); + +// node_modules/neovim/lib/api/Tabpage.js +var require_Tabpage = __commonJS({ + "node_modules/neovim/lib/api/Tabpage.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Tabpage = void 0; + var Base_1 = require_Base(); + var types_1 = require_types(); + var createChainableApi_1 = require_createChainableApi(); + var Window_1 = require_Window(); + var Tabpage = class extends Base_1.BaseApi { + constructor() { + super(...arguments); + this.prefix = types_1.Metadata[types_1.ExtType.Tabpage].prefix; + } + /** Returns all windows of tabpage */ + get windows() { + return this.request(`${this.prefix}list_wins`, [this]); + } + /** Gets the current window of tabpage */ + get window() { + return createChainableApi_1.createChainableApi.call(this, "Window", Window_1.Window, () => this.request(`${this.prefix}get_win`, [this])); + } + /** Is current tabpage valid */ + get valid() { + return this.request(`${this.prefix}is_valid`, [this]); + } + /** Tabpage number */ + get number() { + return this.request(`${this.prefix}get_number`, [this]); + } + /** Invalid */ + getOption() { + this.logger.error("Tabpage does not have `getOption`"); + } + /** Invalid */ + setOption() { + this.logger.error("Tabpage does not have `setOption`"); + } + }; + exports.Tabpage = Tabpage; + } +}); + +// node_modules/neovim/lib/api/Window.js +var require_Window = __commonJS({ + "node_modules/neovim/lib/api/Window.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Window = void 0; + var Base_1 = require_Base(); + var types_1 = require_types(); + var createChainableApi_1 = require_createChainableApi(); + var Tabpage_1 = require_Tabpage(); + var Buffer_1 = require_Buffer(); + var Window = class extends Base_1.BaseApi { + constructor() { + super(...arguments); + this.prefix = types_1.Metadata[types_1.ExtType.Window].prefix; + } + /** + * The windowid that not change within a Vim session + */ + get id() { + return this.data; + } + /** Get current buffer of window */ + get buffer() { + return createChainableApi_1.createChainableApi.call(this, "Buffer", Buffer_1.Buffer, () => this.request(`${this.prefix}get_buf`, [this])); + } + /** Get the Tabpage that contains the window */ + get tabpage() { + return createChainableApi_1.createChainableApi.call(this, "Tabpage", Tabpage_1.Tabpage, () => this.request(`${this.prefix}get_tabpage`, [this])); + } + /** Get cursor position */ + get cursor() { + return this.request(`${this.prefix}get_cursor`, [this]); + } + /** Set cursor position */ + set cursor(pos) { + this.request(`${this.prefix}set_cursor`, [this, pos]); + } + /** Get window height by number of rows */ + get height() { + return this.request(`${this.prefix}get_height`, [this]); + } + /** Set window height by number of rows */ + set height(height) { + this.request(`${this.prefix}set_height`, [this, height]); + } + /** Get window width by number of columns */ + get width() { + return this.request(`${this.prefix}get_width`, [this]); + } + /** Set window width by number of columns */ + set width(width) { + this.request(`${this.prefix}set_width`, [this, width]); + } + /** Get window position */ + get position() { + return this.request(`${this.prefix}get_position`, [this]); + } + /** 0-indexed, on-screen window position(row) in display cells. */ + get row() { + return this.request(`${this.prefix}get_position`, [this]).then((position) => position[0]); + } + /** 0-indexed, on-screen window position(col) in display cells. */ + get col() { + return this.request(`${this.prefix}get_position`, [this]).then((position) => position[1]); + } + /** Is window valid */ + get valid() { + return this.request(`${this.prefix}is_valid`, [this]); + } + /** Get window number */ + get number() { + return this.request(`${this.prefix}get_number`, [this]); + } + /** + * Closes window + * + * @param {Boolean} force Force close window + */ + close(force = false) { + return this.request(`${this.prefix}close`, [this, force]); + } + /** + * Configure window position. Currently this is only used to + * configure floating and external windows (including changing a + * split window to these types). + * + * See documentation at |nvim_open_win()|, for the meaning of + * parameters. Pass in -1 for 'witdh' and 'height' to keep + * exiting size. + * + * When reconfiguring a floating window, absent option keys will + * not be changed. The following restriction apply: `row`, `col` + * and `relative` must be reconfigured together. Only changing a + * subset of these is an error. + * + * @param {Window} window Window handle + * @Param {Object} options Options object + */ + config(options = {}) { + return this.request(`${this.prefix}set_config`, [this, options]); + } + }; + exports.Window = Window; + } +}); + +// node_modules/neovim/lib/api/types.js +var require_types = __commonJS({ + "node_modules/neovim/lib/api/types.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Metadata = exports.ExtType = void 0; + var Buffer_1 = require_Buffer(); + var Window_1 = require_Window(); + var Tabpage_1 = require_Tabpage(); + var ExtType; + (function(ExtType2) { + ExtType2[ExtType2["Buffer"] = 0] = "Buffer"; + ExtType2[ExtType2["Window"] = 1] = "Window"; + ExtType2[ExtType2["Tabpage"] = 2] = "Tabpage"; + })(ExtType || (exports.ExtType = ExtType = {})); + exports.Metadata = [ + { + constructor: Buffer_1.Buffer, + name: "Buffer", + prefix: "nvim_buf_" + }, + { + constructor: Window_1.Window, + name: "Window", + prefix: "nvim_win_" + }, + { + constructor: Tabpage_1.Tabpage, + name: "Tabpage", + prefix: "nvim_tabpage_" + } + ]; + } +}); + +// node_modules/neovim/lib/utils/transport.js +var require_transport = __commonJS({ + "node_modules/neovim/lib/utils/transport.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Transport = exports.exportsForTesting = void 0; + var node_events_1 = require("events"); + var node_util_1 = require("util"); + var msgpack_1 = require_dist(); + var types_1 = require_types(); + if (process.env.NODE_ENV === "test") { + exports.exportsForTesting = { + onTransportFail: new node_events_1.EventEmitter() + }; + } + var Response = class { + constructor(encoder, requestId) { + this.encoder = encoder; + this.requestId = requestId; + } + send(resp, isError) { + if (this.sent) { + throw new Error(`Response to id ${this.requestId} already sent`); + } + const encoded = (0, msgpack_1.encode)([ + 1, + this.requestId, + isError ? resp : null, + !isError ? resp : null + ]); + this.encoder.write(Buffer.from(encoded.buffer, encoded.byteOffset, encoded.byteLength)); + this.sent = true; + } + }; + var Transport = class extends node_events_1.EventEmitter { + constructor() { + super(...arguments); + this.pending = /* @__PURE__ */ new Map(); + this.nextRequestId = 1; + this.extensionCodec = this.initializeExtensionCodec(); + } + initializeExtensionCodec() { + const codec = new msgpack_1.ExtensionCodec(); + types_1.Metadata.forEach(({ constructor }, id) => { + codec.register({ + type: id, + encode: (input) => { + if (input instanceof constructor) { + return (0, msgpack_1.encode)(input.data); + } + return null; + }, + decode: (data) => new constructor({ + transport: this, + client: this.client, + data: (0, msgpack_1.decode)(data) + }) + }); + }); + return codec; + } + encodeToBuffer(value) { + const encoded = (0, msgpack_1.encode)(value, { extensionCodec: this.extensionCodec }); + return Buffer.from(encoded.buffer, encoded.byteOffset, encoded.byteLength); + } + attach(writer, reader, client) { + this.writer = writer; + this.reader = reader; + this.client = client; + this.reader.on("end", () => { + this.emit("detach"); + }); + const asyncDecodeGenerator = (0, msgpack_1.decodeMultiStream)(this.reader, { + extensionCodec: this.extensionCodec + }); + const resolveGeneratorRecursively = (iter) => { + iter.next().then((resolved) => { + if (!resolved.done) { + if (!Array.isArray(resolved.value)) { + let valstr = "?"; + try { + valstr = (0, node_util_1.inspect)(resolved.value, { + sorted: true, + maxArrayLength: 10, + maxStringLength: 500, + compact: true, + breakLength: 500 + }); + } catch (error) { + } + const errMsg = `invalid msgpack-RPC message: expected array, got: ${valstr}`; + const onFail = exports.exportsForTesting === null || exports.exportsForTesting === void 0 ? void 0 : exports.exportsForTesting.onTransportFail; + if (onFail) { + onFail.emit("fail", errMsg); + return; + } + throw new TypeError(errMsg); + } + this.parseMessage(resolved.value); + resolveGeneratorRecursively(iter); + return; + } + Promise.resolve(); + }); + }; + resolveGeneratorRecursively(asyncDecodeGenerator); + } + request(method, args, cb) { + this.nextRequestId = this.nextRequestId + 1; + this.writer.write(this.encodeToBuffer([0, this.nextRequestId, method, args])); + this.pending.set(this.nextRequestId, cb); + } + notify(method, args) { + this.writer.write(this.encodeToBuffer([2, method, args])); + } + parseMessage(msg) { + const msgType = msg[0]; + if (msgType === 0) { + this.emit("request", msg[2].toString(), msg[3], new Response(this.writer, msg[1])); + } else if (msgType === 1) { + const id = msg[1]; + const handler = this.pending.get(id); + if (!handler) { + throw new Error(`no pending handler for id ${id}`); + } + this.pending.delete(id); + handler(msg[2], msg[3]); + } else if (msgType === 2) { + this.emit("notification", msg[1].toString(), msg[2]); + } else { + this.writer.write(this.encodeToBuffer([1, 0, "Invalid message type", null])); + } + } + }; + exports.Transport = Transport; + } +}); + +// node_modules/neovim/lib/api/Neovim.js +var require_Neovim = __commonJS({ + "node_modules/neovim/lib/api/Neovim.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Neovim = void 0; + var Base_1 = require_Base(); + var createChainableApi_1 = require_createChainableApi(); + var Buffer_1 = require_Buffer(); + var Tabpage_1 = require_Tabpage(); + var Window_1 = require_Window(); + var Neovim2 = class extends Base_1.BaseApi { + constructor() { + super(...arguments); + this.prefix = "nvim_"; + this.Buffer = Buffer_1.Buffer; + this.Window = Window_1.Window; + this.Tabpage = Tabpage_1.Tabpage; + } + /** + * Retrieves nvim API information + */ + get apiInfo() { + return this.request(`${this.prefix}get_api_info`); + } + /** + * Gets the current list of buffer handles + * + * Includes unlisted (unloaded/deleted) buffers, like `ls!`. Use `buffer.loaded` + * to check if a buffer is loaded + * + * @return {Buffer[]} List of buffer handles + */ + get buffers() { + return this.request(`${this.prefix}list_bufs`); + } + /** + * Gets the current buffer + * + * @return {Buffer} Buffer handle + */ + get buffer() { + return createChainableApi_1.createChainableApi.call(this, "Buffer", Buffer_1.Buffer, () => this.request(`${this.prefix}get_current_buf`)); + } + /** + * Sets the current buffer + */ + set buffer(buffer) { + this.request(`${this.prefix}set_current_buf`, [buffer]); + } + /** + * Get information about all open channels + * + * @return {Channel[]} Array of channels + */ + get chans() { + return this.request(`${this.prefix}list_chans`); + } + /** + * Gets information about a channel + * + * @param {Number} chan The channel number + * @return {Channel} A channel + */ + getChanInfo(chan) { + return this.request(`${this.prefix}get_chan_info`, [chan]); + } + /** + * Gets a map of buffer-local |user-commands|. + */ + get commands() { + return this.getCommands(); + } + /** + * Gets a map of buffer-local |user-commands|. + * + * @param options Optional parameters (currently not used) + * @return Map of maps describing commands + */ + getCommands(options = {}) { + return this.request(`${this.prefix}get_commands`, [options]); + } + /** + * Gets the current list of tabpage handles + * + * @return {Tabpage[]} List of tagpage handles + */ + get tabpages() { + return this.request(`${this.prefix}list_tabpages`); + } + /** + * Gets the window tabpage + * + * @return {Tabpage} Tagpage that contains the window + */ + get tabpage() { + return createChainableApi_1.createChainableApi.call(this, "Tabpage", Tabpage_1.Tabpage, () => this.request(`${this.prefix}get_current_tabpage`)); + } + /** + * Sets the current tabpage + */ + set tabpage(tabpage) { + this.request(`${this.prefix}set_current_tabpage`, [tabpage]); + } + /** + * Gets the current list of window handles + * + * @return {Window[]} List of window handles + */ + get windows() { + return this.getWindows(); + } + /** + * Gets the current window + * + * @return Window handle + */ + get window() { + return this.getWindow(); + } + /** + * Sets the current window + * + * @param win Window handle + */ + set window(win) { + if (win instanceof Window_1.Window) + this.setWindow(win); + else + win.then((win2) => this.setWindow(win2)); + } + /** + * Gets the current list of window handles + * + * @return {Window[]} List of window handles + */ + getWindows() { + return this.request(`${this.prefix}list_wins`); + } + /** + * Gets the current window + * + * @return {Window} Window handle + */ + getWindow() { + return createChainableApi_1.createChainableApi.call(this, "Window", Window_1.Window, () => this.request(`${this.prefix}get_current_win`)); + } + /** + * Sets the current window + * + * @param win Window handle + */ + setWindow(win) { + return this.request(`${this.prefix}set_current_win`, [win]); + } + /** + * Gets the paths contained in "runtimepath" + * + * @return {String[]} List of paths + */ + get runtimePaths() { + return this.request(`${this.prefix}list_runtime_paths`); + } + /** + * Changes the global working directory + * + * @param dir Directory path + * + */ + set dir(dir) { + this.request(`${this.prefix}set_current_dir`, [dir]); + } + /** + * Gets the current line + * + * @return {String} Current line string + */ + get line() { + return this.getLine(); + } + /** + * Sets current line + * + * @param {String} line Line contents + */ + set line(line) { + if (typeof line === "string") { + this.setLine(line); + } + } + /** + * Gets the current line + * + * @return {String} Current line string + */ + getLine() { + return this.request(`${this.prefix}get_current_line`); + } + /** + * Sets current line + * + * @param {String} line Line contents + */ + setLine(line) { + return this.request(`${this.prefix}set_current_line`, [line]); + } + /** + * Gets a list of global (non-buffer-local) |mapping| definitions. + * + * @param {String} mode Mode short-name ("n", "i", "v", ...) + * @return {Object[]} Array of maparg()-like dictionaries describing mappings. The "buffer" key is always zero. + */ + getKeymap(mode) { + return this.request(`${this.prefix}get_keymap`, [mode]); + } + /** + * Gets the current mode. |mode()| "blocking" is true if Nvim is waiting for input. + * + * @return Mode info + */ + get mode() { + return this.request(`${this.prefix}get_mode`); + } + /** + * Gets map of defined colors + * + * @return Color map + */ + get colorMap() { + return this.request(`${this.prefix}get_color_map`); + } + /** + * Get color by name + * + * @param name Color name + * @return Color value + */ + getColorByName(name) { + return this.request(`${this.prefix}get_color_by_name`, [name]); + } + /** + * Get highlight by name or id + * + * @param nameOrId Name or ID + * @param isRgb Should export RGB colors + * @return Highlight definition map + */ + getHighlight(nameOrId, isRgb = true) { + const functionName = typeof nameOrId === "string" ? "by_name" : "by_id"; + return this.request(`${this.prefix}get_hl_${functionName}`, [ + nameOrId, + isRgb + ]); + } + /** + * Get highlight definition by name + * + * @param name Highlight group name + * @param isRgb Should export RGB colors + * @return Highlight definition map + */ + getHighlightByName(name, isRgb = true) { + return this.request(`${this.prefix}get_hl_by_name`, [name, isRgb]); + } + /** + * Get highlight definition by id |hlID()| + * + * @param id Highlight id as returned by |hlID()| + * @param isRgb Should export RGB colors + * @return Highlight definition map + */ + getHighlightById(id, isRgb = true) { + return this.request(`${this.prefix}get_hl_by_id`, [id, isRgb]); + } + /** + * Deletes the current line + */ + deleteCurrentLine() { + return this.request(`${this.prefix}del_current_line`); + } + /** + * Evaluates a VimL expression (:help expression). Dictionaries + * and Lists are recursively expanded. On VimL error: Returns a + * generic error; v:errmsg is not updated. + * + */ + eval(expr) { + return this.request(`${this.prefix}eval`, [expr]); + } + /** + * Executes Lua code. + */ + lua(code, args = []) { + const _args = Array.isArray(args) ? args : [args]; + return this.request(`${this.prefix}execute_lua`, [code, _args]); + } + /** + * Alias for `lua()` to be consistent with neovim API + */ + executeLua(code, args = []) { + return this.lua(code, args); + } + /** + * Calls a VimL |Dictionary-function| with the given arguments. + * + * On execution error: fails with VimL error, does not update v:errmsg. + */ + callDictFunction(dict, fname, args = []) { + const _args = Array.isArray(args) ? args : [args]; + return this.request(`${this.prefix}call_dict_function`, [ + dict, + fname, + _args + ]); + } + /** + * Calls a VimL function with the given arguments. + * + * On execution error: fails with VimL error, does not update v:errmsg. + */ + call(fname, args = []) { + const _args = Array.isArray(args) ? args : [args]; + return this.request(`${this.prefix}call_function`, [fname, _args]); + } + /** + * Alias for `call` + */ + callFunction(fname, args = []) { + return this.call(fname, args); + } + /** + * Calls many API methods atomically. + * + * This has two main usages: + * - To perform several requests from an async context atomically, i.e. without + * interleaving redraws, RPC requests from other clients, or user interactions + * (however API methods may trigger autocommands or event processing which have + * such side-effects, e.g. |:sleep| may wake timers) + * + * - To minimize RPC overhead (roundtrips) of a sequence of many requests. + */ + callAtomic(calls) { + return this.request(`${this.prefix}call_atomic`, [calls]); + } + /** + * Executes an ex-command. + * + * On execution error: fails with VimL error, does not update v:errmsg. + * + * @param {String} arg Ex-command string + */ + command(arg) { + return this.request(`${this.prefix}command`, [arg]); + } + /** + * Executes an ex-command and returns its (non-error) output. + * Shell |:!| output is not captured. + * + * On execution error: fails with VimL error, does not update v:errmsg. + */ + commandOutput(arg) { + return this.request(`${this.prefix}command_output`, [arg]); + } + /** + * Gets a v: variable + * + * @param {String} name Variable name + * @return {VimValue} Variable value + */ + getVvar(name) { + return this.request(`${this.prefix}get_vvar`, [name]); + } + /** + * Sets a v: variable, if it is not readonly. + * + * @param {String} name Variable name + * @param {VimValue} value Variable value + */ + setVvar(name, value) { + return this.request(`${this.prefix}set_vvar`, [name, value]); + } + /** + * Sends input-keys to Nvim, subject to various quirks controlled + * by `mode` flags. This is a blocking call, unlike |nvim_input()|. + * + * On execution error: does not fail, but updates v:errmsg. + * + * @param {String} keys To be typed + * @param {String} mode Behavior flags, see |feedkeys()| + * @param {Boolean} escapeCsi If true, escape K_SPECIAL/CSI bytes in `keys` + */ + feedKeys(keys, mode, escapeCsi) { + return this.request(`${this.prefix}feedkeys`, [keys, mode, escapeCsi]); + } + /** + * Queues raw user-input. Unlike |nvim_feedkeys()|, this uses a + * low-level input buffer and the call is non-blocking (input is + * processed asynchronously by the eventloop). + * + * On execution error: does not fail, but updates v:errmsg. + * + * Note: + * |keycodes| like are translated, so "<" is special. To + * input a literal "<", send . + * + * Note: + * For mouse events use |nvim_input_mouse()|. The pseudokey + * form "" is deprecated since + * |api-level| 6. + * + * @param {String} keys To be typed + */ + input(keys) { + return this.request(`${this.prefix}input`, [keys]); + } + /** + * Send mouse event from GUI. + * + * The call is non-blocking. It doesn't wait on any resulting + * action, but queues the event to be processed soon by the event + * loop. + * + * Note: + * Currently this doesn't support "scripting" multiple mouse + * events by calling it multiple times in a loop: the + * intermediate mouse positions will be ignored. It should be + * used to implement real-time mouse input in a GUI. The + * deprecated pseudokey form ("") of + * |nvim_input()| has the same limitiation. + * + * @param {String} button Mouse button: one of "left", "right", "middle", "wheel". + * @param {String} action For ordinary buttons, one of "press", "drag", "release". + * For the wheel, one of "up", "down", "left", "right". + * @param {String} modifier String of modifiers each represented by a + * single char. The same specifiers are used as + * for a key press, except that the "-" separator + * is optional, so "C-A-", "c-a" and "CA" can all + * be used to specify Ctrl+Alt+click. + * @param {Number} grid Grid number if the client uses |ui-multigrid|, else 0. + * @param {Number} row Mouse row-position (zero-based, like redraw events) + * @param {Number} col Mouse column-position (zero-based, like redraw events) + */ + inputMouse(button, action, modifier, grid, row, col) { + return this.request(`${this.prefix}input_mouse`, [ + button, + action, + modifier, + grid, + row, + col + ]); + } + /** + * Parse a VimL Expression + * + * TODO: return type, see :help + */ + parseExpression(expr, flags, highlight) { + return this.request(`${this.prefix}parse_expression`, [ + expr, + flags, + highlight + ]); + } + /** + * Gets info describing process `pid`. + * + * @param {Number} pid pid + * @return {Proc} Map of process properties, or null if process not found + */ + getProc(pid) { + return this.request(`${this.prefix}get_proc`, [pid]); + } + /** + * Gets the immediate children of process `pid` + * + * @return {Proc[]} Array of child process ids, empty if process not found + */ + getProcChildren(pid) { + return this.request(`${this.prefix}get_proc_children`, [pid]); + } + /** + * Replaces terminal codes and |keycodes| (, , ...) in a + * string with the internal representation. + * + * @param {String} str String to be converted. + * @param {Boolean} fromPart Legacy Vim parameter. Usually true. + * @param {Boolean} doIt Also translate . Ignored if `special` is false. + * @param {Boolean} special Replace |keycodes|, e.g. becomes a "\n" char. + */ + replaceTermcodes(str, fromPart, doIt, special) { + return this.request(`${this.prefix}replace_termcodes`, [ + str, + fromPart, + doIt, + special + ]); + } + /** + * Calculates the number of display cells occupied by `text`. + * counts as one cell. + * + * @param {String} str Some text + * @return {Number} Number of cells + */ + strWidth(str) { + return this.request(`${this.prefix}strwidth`, [str]); + } + /** Write to output buffer */ + outWrite(str) { + return this.request(`${this.prefix}out_write`, [str]); + } + outWriteLine(str) { + return this.outWrite(`${str} +`); + } + /** Write to error buffer */ + errWrite(str) { + return this.request(`${this.prefix}err_write`, [str]); + } + /** Write to error buffer */ + errWriteLine(str) { + return this.request(`${this.prefix}err_writeln`, [str]); + } + /** + * Gets a list of dictionaries representing attached UIs. + * + * @return {Ui[]} Array of UI dictionaries + * Each dictionary has the following keys: + * "height" requested height of the UI + * "width" requested width of the UI + * "rgb" whether the UI uses rgb colors (false implies cterm colors) + * "ext_..." Requested UI extensions, see |ui-options| + * "chan" Channel id of remote UI (not present for TUI) + */ + get uis() { + return this.request(`${this.prefix}list_uis`); + } + uiAttach(width, height, options) { + return this.request(`${this.prefix}ui_attach`, [width, height, options]); + } + uiDetach() { + return this.request(`${this.prefix}ui_detach`, []); + } + /** + * TODO: Documentation + * + * @param {Number} width The new requested width + * @param {Number} height The new requested height + */ + uiTryResize(width, height) { + return this.request(`${this.prefix}ui_try_resize`, [width, height]); + } + /** + * Tell Nvim to resize a grid. Triggers a grid_resize event with + * the requested grid size or the maximum size if it exceeds size + * limits. + * + * On invalid grid handle, fails with error. + * + * @param {Number} grid The handle of the grid to be changed + * @param {Number} width The new requested width + * @param {Number} height The new requested height + */ + uiTryResizeGrid(grid, width, height) { + return this.request(`${this.prefix}ui_try_resize_grid`, [ + grid, + width, + height + ]); + } + /** + * Set UI Option + */ + uiSetOption(name, value) { + return this.request(`${this.prefix}ui_set_option`, [name, value]); + } + /** + * Subscribe to nvim event broadcasts + * + * @param {String} event Event type string + */ + subscribe(event) { + return this.request(`${this.prefix}subscribe`, [event]); + } + /** + * Unsubscribe to nvim event broadcasts + * + * @param {String} event Event type string + */ + unsubscribe(event) { + return this.request(`${this.prefix}unsubscribe`, [event]); + } + /** + * Identify the client for nvim. Can be called more than once, + * but subsequent calls will remove earlier info, which should be + * resent if it is still valid. (This could happen if a library + * first identifies the channel, and a plugin using that library + * later overrides that info) + * + */ + setClientInfo(name, version, type, methods, attributes) { + this.request(`${this.prefix}set_client_info`, [ + name, + version, + type, + methods, + attributes + ]); + } + /** + * Creates a new namespace, or gets an existing one. + * + * Namespaces are used for buffer highlights and virtual text, + * see |nvim_buf_add_highlight()| and |nvim_buf_set_virtual_text()|. + * + * Namespaces can be named or anonymous. If `name` matches an + * existing namespace, the associated id is returned. If `name` + * is an empty string a new, anonymous namespace is created. + * + * @param name Namespace name or empty string + * @return Namespace id + */ + createNamespace(name = "") { + return this.request(`${this.prefix}create_namespace`, [name]); + } + /** + * Alias for `getNamespaces()` + */ + get namespaces() { + return this.getNamespaces(); + } + /** + * Gets existing, non-anonymous namespaces. + * + * @return {Object} dict that maps from names to namespace ids. + */ + getNamespaces() { + return this.request(`${this.prefix}get_namespaces`); + } + /** + * Selects an item in the completion popupmenu. + * + * If |ins-completion| is not active this API call is silently + * ignored. Useful for an external UI using |ui-popupmenu| to + * control the popupmenu with the mouse. Can also be used in a + * mapping; use |:map-cmd| to ensure the mapping doesn't + * end completion mode. + * + * @param {Number} item Index (zero-based) of the item to select. + * Value of -1 selects nothing and restores the original text. + * @param {Boolean} insert Whether the selection should be inserted in the buffer. + * @param {Boolean} finish Finish the completion and dismiss the popupmenu. + * Implies `insert`. + * @param {Object} opts Optional parameters. Reserved for future use. + */ + selectPopupmenuItem(item, insert, finish, opts = {}) { + return this.request(`${this.prefix}select_popupmenu_item`, [ + item, + insert, + finish, + opts + ]); + } + /** + * Creates a new, empty, unnamed buffer. + * + * @param {Boolean} listed Controls 'buflisted' + * @param {Boolean} scratch Creates a "throwaway" |scratch-buffer| for temporary work (always 'nomodified') + * @return {Buffer|Number} Buffer handle, or 0 on error + */ + createBuf(listed, scratch) { + return this.request(`${this.prefix}create_buf`, [listed, scratch]); + } + /** + * Public alias for `createBuf` + */ + createBuffer(listed, scratch) { + return this.createBuf(listed, scratch); + } + /** + * Open a new window. + * Currently this is used to open floating and external windows. + * Floats are windows that are drawn above the split layout, at + * some anchor position in some other window. Floats can be draw + * internally or by external GUI with the |ui-multigrid| + * extension. External windows are only supported with multigrid + * GUIs, and are displayed as separate top-level windows. + * + * Exactly one of `external` and `relative` must be specified. + * + * @param {Buffer} buffer Handle of buffer to be displayed in the window + * @param {Boolean} enter Whether the window should be entered (made the current window) + * @Param {Object} options Options object + * @return {Window|Number} The Window handle or 0 when error + */ + openWin(buffer, enter, options) { + return this.request(`${this.prefix}open_win`, [buffer, enter, options]); + } + /** + * Public alias for `openWin` + */ + openWindow(buffer, enter, options) { + return this.openWin(buffer, enter, options); + } + /** + * Configure window position. Currently this is only used to + * configure floating and external windows (including changing a + * split window to these types). + * + * See documentation at |nvim_open_win()|, for the meaning of + * parameters. Pass in -1 for 'witdh' and 'height' to keep + * exiting size. + * + * When reconfiguring a floating window, absent option keys will + * not be changed. The following restriction apply: `row`, `col` + * and `relative` must be reconfigured together. Only changing a + * subset of these is an error. + * + * @param window Window handle + * @param options height, width of window (in character cells) + * @Param Options object + */ + winConfig(window2, options = {}) { + return window2.config(options); + } + /** + * Public Alias for `winConfig` + */ + windowConfig(window2, options = {}) { + return this.winConfig(window2, options); + } + /** + * Closes window + * + * @param {Boolean} force Force close window + */ + winClose(window2, force) { + return window2.close(force); + } + /** + * Public alias for `winClose` + */ + windowClose(window2, force) { + return this.winClose(window2, force); + } + /** + * Quit nvim + */ + quit() { + this.command("qa!"); + } + }; + exports.Neovim = Neovim2; + } +}); + +// node_modules/neovim/lib/api/client.js +var require_client = __commonJS({ + "node_modules/neovim/lib/api/client.js"(exports) { + "use strict"; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result2) { + result2.done ? resolve(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NeovimClient = void 0; + var transport_1 = require_transport(); + var Neovim_1 = require_Neovim(); + var REGEX_BUF_EVENT = /nvim_buf_(.*)_event/; + var NeovimClient = class extends Neovim_1.Neovim { + constructor(options = {}) { + super({ + logger: options.logger, + transport: options.transport || new transport_1.Transport() + }); + this.attachedBuffers = /* @__PURE__ */ new Map(); + this.requestQueue = []; + this.transportAttached = false; + this.handleRequest = this.handleRequest.bind(this); + this.handleNotification = this.handleNotification.bind(this); + } + /** Attaches msgpack to read/write streams * */ + attach({ reader, writer }) { + this.transport.attach(writer, reader, this); + this.transportAttached = true; + this.setupTransport(); + } + get isApiReady() { + return this.transportAttached && this._channelId !== void 0; + } + get channelId() { + return (() => __awaiter(this, void 0, void 0, function* () { + yield this._isReady; + if (!this._channelId) { + throw new Error("channelId requested before _isReady"); + } + return this._channelId; + }))(); + } + isAttached(buffer) { + const key = `${buffer.data}`; + return this.attachedBuffers.has(key); + } + handleRequest(method, args, resp, ...restArgs) { + if (!this.isApiReady && method !== "specs") { + this.logger.info("handleRequest (queued): %s", method); + this.requestQueue.push({ + type: "request", + args: [method, args, resp, ...restArgs] + }); + } else { + this.logger.info("handleRequest: %s", method); + this.emit("request", method, args, resp); + } + } + emitNotification(method, args) { + if (method.endsWith("_event")) { + if (!method.startsWith("nvim_buf_")) { + this.logger.error("Unhandled event: %s", method); + return; + } + const shortName = method.replace(REGEX_BUF_EVENT, "$1"); + const [buffer] = args; + const bufferKey = `${buffer.data}`; + const bufferMap = this.attachedBuffers.get(bufferKey); + if (bufferMap === void 0) { + return; + } + const cbs = bufferMap.get(shortName) || []; + cbs.forEach((cb) => cb(...args)); + if (shortName === "detach") { + this.attachedBuffers.delete(bufferKey); + } + } else { + this.emit("notification", method, args); + } + } + handleNotification(method, args, ...restArgs) { + this.logger.info("handleNotification: %s", method); + if (!this.isApiReady) { + this.requestQueue.push({ + type: "notification", + args: [method, args, ...restArgs] + }); + } else { + this.emitNotification(method, args); + } + } + // Listen and setup handlers for transport + setupTransport() { + if (!this.transportAttached) { + throw new Error("Not attached to input/output"); + } + this.transport.on("request", this.handleRequest); + this.transport.on("notification", this.handleNotification); + this.transport.on("detach", () => { + this.emit("disconnect"); + this.transport.removeAllListeners("request"); + this.transport.removeAllListeners("notification"); + this.transport.removeAllListeners("detach"); + }); + this._isReady = this.generateApi(); + } + requestApi() { + return new Promise((resolve, reject) => { + this.transport.request("nvim_get_api_info", [], (err, res) => { + if (err) { + reject(err); + } else { + resolve(res); + } + }); + }); + } + // Request API from neovim and augment this current class to add these APIs + generateApi() { + return __awaiter(this, void 0, void 0, function* () { + let results; + try { + results = yield this.requestApi(); + } catch (err) { + this.logger.error("Could not get vim api results"); + this.logger.error(err); + } + if (results) { + try { + const [ + channelId + /* , encodedMetadata */ + ] = results; + this._channelId = channelId; + this.requestQueue.forEach((pending) => { + if (pending.type === "notification") { + this.emitNotification(pending.args[0], pending.args[1]); + } else { + this.emit(pending.type, ...pending.args); + } + }); + this.requestQueue = []; + return true; + } catch (e) { + const err = e; + this.logger.error(`Could not dynamically generate neovim API: %s: %O`, err.name, { + error: err + }); + this.logger.error(err.stack); + return false; + } + } + return false; + }); + } + attachBuffer(buffer, eventName, cb) { + var _a; + const bufferKey = `${buffer.data}`; + if (!this.attachedBuffers.has(bufferKey)) { + this.attachedBuffers.set(bufferKey, /* @__PURE__ */ new Map()); + } + const bufferMap = this.attachedBuffers.get(bufferKey); + if (!bufferMap) { + throw Error(`buffer not found: ${bufferKey}`); + } + if (!bufferMap.get(eventName)) { + bufferMap.set(eventName, []); + } + const cbs = (_a = bufferMap.get(eventName)) !== null && _a !== void 0 ? _a : []; + if (cbs.includes(cb)) + return cb; + cbs.push(cb); + bufferMap.set(eventName, cbs); + this.attachedBuffers.set(bufferKey, bufferMap); + return cb; + } + /** + * Returns `true` if buffer should be detached + */ + detachBuffer(buffer, eventName, cb) { + const bufferKey = `${buffer.data}`; + const bufferMap = this.attachedBuffers.get(bufferKey); + if (!bufferMap) + return false; + const handlers = (bufferMap.get(eventName) || []).filter((handler) => handler !== cb); + if (!handlers.length) { + bufferMap.delete(eventName); + } else { + bufferMap.set(eventName, handlers); + } + if (!bufferMap.size) { + this.attachedBuffers.delete(bufferKey); + return true; + } + return false; + } + }; + exports.NeovimClient = NeovimClient; + } +}); + +// node_modules/neovim/lib/attach/attach.js +var require_attach = __commonJS({ + "node_modules/neovim/lib/attach/attach.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.attach = attach2; + var node_net_1 = require("net"); + var client_1 = require_client(); + var logger_1 = require_logger2(); + function attach2({ reader: _reader, writer: _writer, proc, socket, options = {} }) { + let writer; + let reader; + if (socket) { + const client = (0, node_net_1.createConnection)(socket); + writer = client; + reader = client; + } else if (_reader && _writer) { + writer = _writer; + reader = _reader; + } else if (proc) { + writer = proc.stdin; + reader = proc.stdout; + } + if (writer && reader) { + const loggerInstance = options.logger || (0, logger_1.getLogger)(); + const neovim = new client_1.NeovimClient({ logger: loggerInstance }); + neovim.attach({ + writer, + reader + }); + return neovim; + } + throw new Error("Invalid arguments, could not attach"); + } + } +}); + +// node_modules/neovim/lib/api/index.js +var require_api = __commonJS({ + "node_modules/neovim/lib/api/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Tabpage = exports.Window = exports.Buffer = exports.NeovimClient = exports.Neovim = void 0; + var Neovim_1 = require_Neovim(); + Object.defineProperty(exports, "Neovim", { enumerable: true, get: function() { + return Neovim_1.Neovim; + } }); + var client_1 = require_client(); + Object.defineProperty(exports, "NeovimClient", { enumerable: true, get: function() { + return client_1.NeovimClient; + } }); + var Buffer_1 = require_Buffer(); + Object.defineProperty(exports, "Buffer", { enumerable: true, get: function() { + return Buffer_1.Buffer; + } }); + var Window_1 = require_Window(); + Object.defineProperty(exports, "Window", { enumerable: true, get: function() { + return Window_1.Window; + } }); + var Tabpage_1 = require_Tabpage(); + Object.defineProperty(exports, "Tabpage", { enumerable: true, get: function() { + return Tabpage_1.Tabpage; + } }); + } +}); + +// node_modules/neovim/lib/plugin/properties.js +var require_properties = __commonJS({ + "node_modules/neovim/lib/plugin/properties.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NVIM_METHOD_NAME = exports.NVIM_SYNC = exports.NVIM_SPEC = exports.NVIM_DEV_MODE = exports.NVIM_PLUGIN = void 0; + exports.NVIM_PLUGIN = "_nvim_plugin"; + exports.NVIM_DEV_MODE = "_nvim_dev_mode"; + exports.NVIM_SPEC = "_nvim_rpc_spec"; + exports.NVIM_SYNC = "_nvim_rpc_sync"; + exports.NVIM_METHOD_NAME = "_nvim_rpc_method_name"; + } +}); + +// node_modules/neovim/lib/host/NvimPlugin.js +var require_NvimPlugin = __commonJS({ + "node_modules/neovim/lib/host/NvimPlugin.js"(exports) { + "use strict"; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result2) { + result2.done ? resolve(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NvimPlugin = void 0; + exports.callable = callable; + function callable(fn) { + if (typeof fn === "function") { + return fn; + } + if (Array.isArray(fn) && fn.length === 2) { + return function(...args) { + return fn[1].apply(fn[0], args); + }; + } + throw new Error(); + } + var NvimPlugin = class { + constructor(filename, plugin, nvim) { + this.filename = filename; + this.nvim = nvim; + this.dev = false; + this.alwaysInit = false; + this.autocmds = {}; + this.commands = {}; + this.functions = {}; + try { + this.instance = new plugin(this); + } catch (err) { + if (err instanceof TypeError) { + this.instance = plugin(this); + } else { + throw err; + } + } + } + setOptions(options) { + this.dev = options.dev === void 0 ? this.dev : options.dev; + this.alwaysInit = !!options.alwaysInit; + } + // Cache module (in dev mode will clear the require module cache) + get shouldCacheModule() { + return !this.dev; + } + registerAutocmd(name, fn, options) { + if (!(options === null || options === void 0 ? void 0 : options.pattern)) { + this.nvim.logger.error(`registerAutocmd expected pattern option for ${name}`); + return; + } + const spec = { + type: "autocmd", + name, + sync: !!(options === null || options === void 0 ? void 0 : options.sync), + opts: {} + }; + ["pattern", "eval"].forEach((option) => { + if (options && typeof options[option] !== "undefined") { + spec.opts[option] = options[option]; + } + }); + try { + this.autocmds[`${name} ${options.pattern}`] = { + fn: callable(fn), + spec + }; + } catch (err) { + this.nvim.logger.error(`registerAutocmd expected callable argument for ${name}`); + } + } + registerCommand(name, fn, options) { + const spec = { + type: "command", + name, + sync: !!(options === null || options === void 0 ? void 0 : options.sync), + opts: {} + }; + ["range", "nargs", "complete"].forEach((option) => { + if (options && typeof options[option] !== "undefined") { + spec.opts[option] = options[option]; + } + }); + try { + this.commands[name] = { + fn: callable(fn), + spec + }; + } catch (err) { + this.nvim.logger.error(`registerCommand expected callable argument for ${name}`); + } + } + registerFunction(name, fn, options) { + const spec = { + type: "function", + name, + sync: !!(options === null || options === void 0 ? void 0 : options.sync), + opts: {} + }; + ["range", "eval"].forEach((option) => { + if (options && typeof options[option] !== "undefined") { + spec.opts[option] = options[option]; + } + }); + try { + this.functions[name] = { + fn: callable(fn), + spec + }; + } catch (err) { + this.nvim.logger.error(`registerFunction expected callable argument for ${name}`); + } + } + get specs() { + const autocmds = Object.keys(this.autocmds).map((key) => this.autocmds[key].spec); + const commands = Object.keys(this.commands).map((key) => this.commands[key].spec); + const functions = Object.keys(this.functions).map((key) => this.functions[key].spec); + return autocmds.concat(commands).concat(functions); + } + handleRequest(name, type, args) { + return __awaiter(this, void 0, void 0, function* () { + let handlers; + switch (type) { + case "autocmd": + handlers = this.autocmds; + break; + case "command": + handlers = this.commands; + break; + case "function": + handlers = this.functions; + break; + default: + const errMsg = `No handler for unknown type ${type}: "${name}" in ${this.filename}`; + this.nvim.logger.error(errMsg); + throw new Error(errMsg); + } + if (handlers.hasOwnProperty(name)) { + const handler = handlers[name]; + try { + return handler.spec.sync ? handler.fn(...args) : yield handler.fn(...args); + } catch (e) { + const err = e; + const msg = `Error in plugin for ${type}:${name}: ${err.message}`; + this.nvim.logger.error(`${msg} (file: ${this.filename}, stack: ${err.stack})`); + throw new Error(msg, { cause: err }); + } + } else { + const errMsg = `Missing handler for ${type}: "${name}" in ${this.filename}`; + this.nvim.logger.error(errMsg); + throw new Error(errMsg); + } + }); + } + }; + exports.NvimPlugin = NvimPlugin; + } +}); + +// node_modules/neovim/lib/plugin/plugin.js +var require_plugin = __commonJS({ + "node_modules/neovim/lib/plugin/plugin.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NvimPlugin = exports.Neovim = void 0; + exports.plugin = plugin; + var properties_1 = require_properties(); + var Neovim_1 = require_Neovim(); + Object.defineProperty(exports, "Neovim", { enumerable: true, get: function() { + return Neovim_1.Neovim; + } }); + var NvimPlugin_1 = require_NvimPlugin(); + Object.defineProperty(exports, "NvimPlugin", { enumerable: true, get: function() { + return NvimPlugin_1.NvimPlugin; + } }); + function wrapper(cls, options) { + return class extends cls { + constructor(...args) { + const plugin2 = args[0]; + super(plugin2.nvim, plugin2); + this.setApi(plugin2.nvim); + if (options) { + plugin2.setOptions(options); + } + plugin2.nvim.logger.info(`Decorating class ${cls}`); + Object.getOwnPropertyNames(cls.prototype).forEach((methodName) => { + plugin2.nvim.logger.info(`Method name ${methodName}`); + plugin2.nvim.logger.info(`${cls.prototype[methodName]} ${typeof cls.prototype[methodName]}`); + plugin2.nvim.logger.info(`${this} ${typeof this}`); + const method = cls.prototype[methodName]; + if (method && method[properties_1.NVIM_SPEC]) { + const spec = method[properties_1.NVIM_SPEC]; + switch (spec.type) { + case "autocmd": + const autoCmdOpts = { + pattern: spec.opts.pattern, + sync: spec.sync + }; + if (typeof spec.opts.eval !== "undefined") { + autoCmdOpts.eval = spec.opts.eval; + } + plugin2.registerAutocmd(spec.name, [this, method], autoCmdOpts); + break; + case "command": + const cmdOpts = { + sync: spec.sync + }; + if (typeof spec.opts.range !== "undefined") { + cmdOpts.range = spec.opts.range; + } + if (typeof spec.opts.nargs !== "undefined") { + cmdOpts.nargs = spec.opts.nargs; + } + if (typeof spec.opts.complete !== "undefined") { + cmdOpts.complete = spec.opts.complete; + } + plugin2.registerCommand(spec.name, [this, method], cmdOpts); + break; + case "function": + const funcOpts = { + sync: spec.sync + }; + if (typeof spec.opts.range !== "undefined") { + funcOpts.range = spec.opts.range; + } + if (typeof spec.opts.eval !== "undefined") { + funcOpts.eval = spec.opts.eval; + } + plugin2.registerFunction(spec.name, [this, method], funcOpts); + break; + default: + break; + } + } + }); + } + setApi(nvim) { + this.nvim = nvim; + } + }; + } + function plugin(outter) { + return typeof outter !== "function" ? (cls) => wrapper(cls, outter) : wrapper(outter); + } + } +}); + +// node_modules/neovim/lib/plugin/function.js +var require_function = __commonJS({ + "node_modules/neovim/lib/plugin/function.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.nvimFunction = nvimFunction; + var properties_1 = require_properties(); + function nvimFunction(name, options = {}) { + return function(cls, methodName) { + const sync = options && !!options.sync; + const isMethod = typeof methodName === "string"; + const f = isMethod ? cls[methodName] : cls; + const opts = {}; + if (options && options.range) { + opts.range = options.range; + } + if (options && options.eval) { + opts.eval = options.eval; + } + Object.defineProperty(f, properties_1.NVIM_METHOD_NAME, { value: `function:${name}` }); + Object.defineProperty(f, properties_1.NVIM_SYNC, { value: !!sync }); + Object.defineProperty(f, properties_1.NVIM_SPEC, { + value: { + type: "function", + name, + sync: !!sync, + opts + } + }); + if (isMethod) { + cls[methodName] = f; + } + return cls; + }; + } + } +}); + +// node_modules/neovim/lib/plugin/autocmd.js +var require_autocmd = __commonJS({ + "node_modules/neovim/lib/plugin/autocmd.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.autocmd = autocmd; + var properties_1 = require_properties(); + function autocmd(name, options) { + return function(cls, methodName) { + const sync = options && !!options.sync; + const isMethod = typeof methodName === "string"; + const f = isMethod ? cls[methodName] : cls; + const opts = { + pattern: "" + }; + ["pattern", "eval"].forEach((option) => { + if (options && typeof options[option] !== "undefined") { + opts[option] = options[option]; + } + }); + const nameWithPattern = `${name}${(options === null || options === void 0 ? void 0 : options.pattern) ? `:${options.pattern}` : ""}`; + Object.defineProperty(f, properties_1.NVIM_METHOD_NAME, { + value: `autocmd:${nameWithPattern}` + }); + Object.defineProperty(f, properties_1.NVIM_SYNC, { value: !!sync }); + Object.defineProperty(f, properties_1.NVIM_SPEC, { + value: { + type: "autocmd", + name, + sync: !!sync, + opts + } + }); + if (isMethod) { + cls[methodName] = f; + } + return cls; + }; + } + } +}); + +// node_modules/neovim/lib/plugin/command.js +var require_command = __commonJS({ + "node_modules/neovim/lib/plugin/command.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.command = command; + var properties_1 = require_properties(); + function command(name, options) { + return function(cls, methodName) { + const sync = options && !!options.sync; + const isMethod = typeof methodName === "string"; + const f = isMethod ? cls[methodName] : cls; + const opts = {}; + ["range", "nargs", "complete"].forEach((option) => { + if (options && typeof options[option] !== "undefined") { + opts[option] = options[option]; + } + }); + Object.defineProperty(f, properties_1.NVIM_METHOD_NAME, { value: `command:${name}` }); + Object.defineProperty(f, properties_1.NVIM_SYNC, { value: !!sync }); + Object.defineProperty(f, properties_1.NVIM_SPEC, { + value: { + type: "command", + name, + sync: !!sync, + opts + } + }); + if (isMethod) { + cls[methodName] = f; + } + return cls; + }; + } + } +}); + +// node_modules/neovim/lib/plugin/index.js +var require_plugin2 = __commonJS({ + "node_modules/neovim/lib/plugin/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Command = exports.Autocmd = exports.Function = exports.Plugin = void 0; + var plugin_1 = require_plugin(); + Object.defineProperty(exports, "Plugin", { enumerable: true, get: function() { + return plugin_1.plugin; + } }); + var function_1 = require_function(); + Object.defineProperty(exports, "Function", { enumerable: true, get: function() { + return function_1.nvimFunction; + } }); + var autocmd_1 = require_autocmd(); + Object.defineProperty(exports, "Autocmd", { enumerable: true, get: function() { + return autocmd_1.autocmd; + } }); + var command_1 = require_command(); + Object.defineProperty(exports, "Command", { enumerable: true, get: function() { + return command_1.command; + } }); + } +}); + +// node_modules/neovim/lib/plugin.js +var require_plugin3 = __commonJS({ + "node_modules/neovim/lib/plugin.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Command = exports.Autocmd = exports.Function = exports.Plugin = void 0; + var index_1 = require_plugin2(); + Object.defineProperty(exports, "Plugin", { enumerable: true, get: function() { + return index_1.Plugin; + } }); + Object.defineProperty(exports, "Function", { enumerable: true, get: function() { + return index_1.Function; + } }); + Object.defineProperty(exports, "Autocmd", { enumerable: true, get: function() { + return index_1.Autocmd; + } }); + Object.defineProperty(exports, "Command", { enumerable: true, get: function() { + return index_1.Command; + } }); + } +}); + +// node_modules/neovim/lib/host/factory.js +var require_factory = __commonJS({ + "node_modules/neovim/lib/host/factory.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result2 = {}; + if (mod != null) { + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result2, mod, k); + } + __setModuleDefault(result2, mod); + return result2; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.loadPlugin = loadPlugin; + var path = __importStar(require("path")); + var Module = require("module"); + var NvimPlugin_1 = require_NvimPlugin(); + function createPlugin(filename, nvim, options = {}) { + try { + nvim.logger.debug(`createPlugin.${filename}.clearCache: ${options && !options.cache}`); + if (options && !options.cache) { + try { + delete Module._cache[require.resolve(filename)]; + } catch (err) { + } + } + const defaultImport = require(filename); + const plugin = defaultImport && defaultImport.default || defaultImport; + if (typeof plugin === "function") { + return new NvimPlugin_1.NvimPlugin(filename, plugin, nvim); + } + } catch (e) { + const err = e; + const file = path.basename(filename); + nvim.logger.error(`[${file}] ${err.stack}`); + nvim.logger.error(`[${file}] Error loading child ChildPlugin ${filename}`); + } + return null; + } + function loadPlugin(filename, nvim, options = {}) { + try { + return createPlugin(filename, nvim, options); + } catch (err) { + return null; + } + } + } +}); + +// node_modules/neovim/lib/utils/findNvim.js +var require_findNvim = __commonJS({ + "node_modules/neovim/lib/utils/findNvim.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.exportsForTesting = void 0; + exports.findNvim = findNvim3; + var node_child_process_1 = require("child_process"); + var node_path_1 = require("path"); + var node_fs_1 = require("fs"); + var versionRegex = /^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/; + var nvimVersionRegex = /^NVIM\s+v(.+)$/m; + var buildTypeRegex = /^Build\s+type:\s+(.+)$/m; + var luaJitVersionRegex = /^LuaJIT\s+(.+)$/m; + var windows2 = process.platform === "win32"; + function parseVersion(version) { + if (typeof version !== "string") { + throw new TypeError("Invalid version format: not a string"); + } + const match = version.match(versionRegex); + if (!match) { + return void 0; + } + const [, major, minor, patch, prerelease] = match; + const majorNumber = Number(major); + const minorNumber = Number(minor); + const patchNumber = Number(patch); + const versionParts = [ + majorNumber, + minorNumber, + patchNumber + ]; + if (prerelease !== void 0) { + versionParts.push(prerelease); + } else { + versionParts.push("zzz"); + } + return versionParts; + } + function compareVersions(a, b) { + var _a, _b, _c, _d, _e, _f; + const versionA = parseVersion(a); + const versionB = parseVersion(b); + const length = Math.min((_a = versionA === null || versionA === void 0 ? void 0 : versionA.length) !== null && _a !== void 0 ? _a : 0, (_b = versionB === null || versionB === void 0 ? void 0 : versionB.length) !== null && _b !== void 0 ? _b : 0); + for (let i = 0; i < length; i = i + 1) { + const partA = (_c = versionA === null || versionA === void 0 ? void 0 : versionA[i]) !== null && _c !== void 0 ? _c : 0; + const partB = (_d = versionB === null || versionB === void 0 ? void 0 : versionB[i]) !== null && _d !== void 0 ? _d : 0; + if (partA < partB) { + return -1; + } + if (partA > partB) { + return 1; + } + } + if (((_e = versionB === null || versionB === void 0 ? void 0 : versionB.length) !== null && _e !== void 0 ? _e : 0) > ((_f = versionA === null || versionA === void 0 ? void 0 : versionA.length) !== null && _f !== void 0 ? _f : 0)) { + return -1; + } + return 0; + } + function normalizePath2(path) { + return (0, node_path_1.normalize)(windows2 ? path.toLowerCase() : path); + } + function getPlatformSearchDirs() { + const paths = /* @__PURE__ */ new Set(); + const { PATH, USERPROFILE, LOCALAPPDATA, PROGRAMFILES, HOME } = process.env; + PATH === null || PATH === void 0 ? void 0 : PATH.split(node_path_1.delimiter).forEach((p) => paths.add(normalizePath2(p))); + if (windows2) { + if (USERPROFILE) { + paths.add(normalizePath2(`${USERPROFILE}/scoop/shims`)); + } + paths.add(normalizePath2("C:/ProgramData/scoop/shims")); + if (LOCALAPPDATA) { + paths.add(normalizePath2(`${LOCALAPPDATA}/Microsoft/WindowsApps`)); + paths.add(normalizePath2(`${LOCALAPPDATA}/Microsoft/WinGet/Packages`)); + } + if (PROGRAMFILES) { + paths.add(normalizePath2(`${PROGRAMFILES}/Neovim/bin`)); + paths.add(normalizePath2(`${PROGRAMFILES} (x86)/Neovim/bin`)); + paths.add(normalizePath2(`${PROGRAMFILES}/WinGet/Packages`)); + paths.add(normalizePath2(`${PROGRAMFILES} (x86)/WinGet/Packages`)); + } + } else { + [ + "/usr/local/bin", + "/usr/bin", + "/opt/homebrew/bin", + "/home/linuxbrew/.linuxbrew/bin", + "/snap/nvim/current/usr/bin" + ].forEach((p) => paths.add(p)); + if (HOME) { + paths.add(normalizePath2(`${HOME}/bin`)); + paths.add(normalizePath2(`${HOME}/.linuxbrew/bin`)); + } + } + return paths; + } + function findNvim3(opt = {}) { + var _a, _b, _c; + const platformDirs = getPlatformSearchDirs(); + const nvimExecutable = windows2 ? "nvim.exe" : "nvim"; + const normalizedPathsFromUser = ((_a = opt.paths) !== null && _a !== void 0 ? _a : []).map(normalizePath2); + const allPaths = /* @__PURE__ */ new Set([ + ...normalizedPathsFromUser, + ...((_b = opt.dirs) !== null && _b !== void 0 ? _b : []).map((dir) => normalizePath2((0, node_path_1.join)(dir, nvimExecutable))), + ...[...platformDirs].map((dir) => (0, node_path_1.join)(dir, nvimExecutable)) + ]); + const matches = new Array(); + const invalid = new Array(); + for (const nvimPath of allPaths) { + if ((0, node_fs_1.existsSync)(nvimPath) || normalizedPathsFromUser.includes(nvimPath)) { + try { + (0, node_fs_1.accessSync)(nvimPath, node_fs_1.constants.X_OK); + const nvimVersionFull = (0, node_child_process_1.execFileSync)(nvimPath, [ + "--version" + ]).toString(); + const nvimVersionMatch = nvimVersionRegex.exec(nvimVersionFull); + const buildTypeMatch = buildTypeRegex.exec(nvimVersionFull); + const luaJitVersionMatch = luaJitVersionRegex.exec(nvimVersionFull); + if (nvimVersionMatch && buildTypeMatch && luaJitVersionMatch) { + if ("minVersion" in opt && compareVersions((_c = opt.minVersion) !== null && _c !== void 0 ? _c : "0.0.0", nvimVersionMatch[1]) === 1) { + invalid.push({ + nvimVersion: nvimVersionMatch[1], + path: nvimPath, + buildType: buildTypeMatch[1], + luaJitVersion: luaJitVersionMatch[1] + }); + } else { + matches.push({ + nvimVersion: nvimVersionMatch[1], + path: nvimPath, + buildType: buildTypeMatch[1], + luaJitVersion: luaJitVersionMatch[1] + }); + if (opt.firstMatch) { + return { + matches, + invalid + }; + } + } + } + } catch (e) { + invalid.push({ + path: nvimPath, + error: e + }); + } + } + } + if (opt.orderBy === void 0 || opt.orderBy === "desc") { + matches.sort((a, b) => { + var _a2, _b2; + return compareVersions((_a2 = b.nvimVersion) !== null && _a2 !== void 0 ? _a2 : "0.0.0", (_b2 = a.nvimVersion) !== null && _b2 !== void 0 ? _b2 : "0.0.0"); + }); + } + return { + matches, + invalid + }; + } + if (process.env.NODE_ENV === "test") { + exports.exportsForTesting = { + parseVersion, + compareVersions, + normalizePath: normalizePath2 + }; + } + } +}); + +// node_modules/neovim/lib/index.js +var require_lib = __commonJS({ + "node_modules/neovim/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findNvim = exports.loadPlugin = exports.NvimPlugin = exports.Command = exports.Autocmd = exports.Function = exports.Plugin = exports.Window = exports.Tabpage = exports.Buffer = exports.NeovimClient = exports.Neovim = exports.attach = void 0; + var attach_1 = require_attach(); + Object.defineProperty(exports, "attach", { enumerable: true, get: function() { + return attach_1.attach; + } }); + var index_1 = require_api(); + Object.defineProperty(exports, "Neovim", { enumerable: true, get: function() { + return index_1.Neovim; + } }); + Object.defineProperty(exports, "NeovimClient", { enumerable: true, get: function() { + return index_1.NeovimClient; + } }); + Object.defineProperty(exports, "Buffer", { enumerable: true, get: function() { + return index_1.Buffer; + } }); + Object.defineProperty(exports, "Tabpage", { enumerable: true, get: function() { + return index_1.Tabpage; + } }); + Object.defineProperty(exports, "Window", { enumerable: true, get: function() { + return index_1.Window; + } }); + var plugin_1 = require_plugin3(); + Object.defineProperty(exports, "Plugin", { enumerable: true, get: function() { + return plugin_1.Plugin; + } }); + Object.defineProperty(exports, "Function", { enumerable: true, get: function() { + return plugin_1.Function; + } }); + Object.defineProperty(exports, "Autocmd", { enumerable: true, get: function() { + return plugin_1.Autocmd; + } }); + Object.defineProperty(exports, "Command", { enumerable: true, get: function() { + return plugin_1.Command; + } }); + var NvimPlugin_1 = require_NvimPlugin(); + Object.defineProperty(exports, "NvimPlugin", { enumerable: true, get: function() { + return NvimPlugin_1.NvimPlugin; + } }); + var factory_1 = require_factory(); + Object.defineProperty(exports, "loadPlugin", { enumerable: true, get: function() { + return factory_1.loadPlugin; + } }); + var findNvim_1 = require_findNvim(); + Object.defineProperty(exports, "findNvim", { enumerable: true, get: function() { + return findNvim_1.findNvim; + } }); + } +}); + +// node_modules/systeminformation/package.json +var require_package2 = __commonJS({ + "node_modules/systeminformation/package.json"(exports, module2) { + module2.exports = { + name: "systeminformation", + version: "5.25.11", + description: "Advanced, lightweight system and OS information library", + license: "MIT", + author: "Sebastian Hildebrandt (https://plus-innovations.com)", + homepage: "https://systeminformation.io", + main: "./lib/index.js", + type: "commonjs", + bin: { + systeminformation: "lib/cli.js" + }, + types: "./lib/index.d.ts", + scripts: { + test: "node ./test/test.js", + testDeno: "deno run -A ./test/test.js" + }, + files: [ + "lib/" + ], + keywords: [ + "system information", + "sysinfo", + "monitor", + "monitoring", + "os", + "linux", + "osx", + "windows", + "freebsd", + "openbsd", + "netbsd", + "cpu", + "cpuload", + "physical cores", + "logical cores", + "processor", + "cores", + "threads", + "socket type", + "memory", + "file system", + "fsstats", + "diskio", + "block devices", + "netstats", + "network", + "network interfaces", + "network connections", + "network stats", + "iface", + "printer", + "processes", + "users", + "internet", + "battery", + "docker", + "docker stats", + "docker processes", + "graphics", + "graphic card", + "graphic controller", + "gpu", + "display", + "smart", + "disk layout", + "usb", + "audio", + "bluetooth", + "wifi", + "wifinetworks", + "virtual box", + "virtualbox", + "vm", + "backend", + "hardware", + "BIOS", + "chassis" + ], + repository: { + type: "git", + url: "https://github.com/sebhildebrandt/systeminformation.git" + }, + funding: { + type: "Buy me a coffee", + url: "https://www.buymeacoffee.com/systeminfo" + }, + os: [ + "darwin", + "linux", + "win32", + "freebsd", + "openbsd", + "netbsd", + "sunos", + "android" + ], + engines: { + node: ">=8.0.0" + } + }; + } +}); + +// node_modules/systeminformation/lib/util.js +var require_util2 = __commonJS({ + "node_modules/systeminformation/lib/util.js"(exports) { + "use strict"; + var os2 = require("os"); + var fs = require("fs"); + var path = require("path"); + var spawn2 = require("child_process").spawn; + var exec2 = require("child_process").exec; + var execSync = require("child_process").execSync; + var util = require("util"); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _cores = 0; + var wmicPath = ""; + var codepage = ""; + var _smartMonToolsInstalled = null; + var _rpi_cpuinfo = null; + var WINDIR = process.env.WINDIR || "C:\\Windows"; + var _psChild; + var _psResult = ""; + var _psCmds = []; + var _psPersistent = false; + var _powerShell = ""; + var _psToUTF8 = "$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; "; + var _psCmdStart = "--###START###--"; + var _psError = "--ERROR--"; + var _psCmdSeperator = "--###ENDCMD###--"; + var _psIdSeperator = "--##ID##--"; + var execOptsWin = { + windowsHide: true, + maxBuffer: 1024 * 2e4, + encoding: "UTF-8", + env: Object.assign({}, process.env, { LANG: "en_US.UTF-8" }) + }; + var execOptsLinux = { + maxBuffer: 1024 * 2e4, + encoding: "UTF-8", + stdio: ["pipe", "pipe", "ignore"] + }; + function toInt(value) { + let result2 = parseInt(value, 10); + if (isNaN(result2)) { + result2 = 0; + } + return result2; + } + function splitByNumber(str) { + let numberStarted = false; + let num = ""; + let cpart = ""; + for (const c of str) { + if (c >= "0" && c <= "9" || numberStarted) { + numberStarted = true; + num += c; + } else { + cpart += c; + } + } + return [cpart, num]; + } + var stringObj = new String(); + var stringReplace = new String().replace; + var stringToLower = new String().toLowerCase; + var stringToString = new String().toString; + var stringSubstr = new String().substr; + var stringSubstring = new String().substring; + var stringTrim = new String().trim; + var stringStartWith = new String().startsWith; + var mathMin = Math.min; + function isFunction(functionToCheck) { + let getType = {}; + return functionToCheck && getType.toString.call(functionToCheck) === "[object Function]"; + } + function unique(obj) { + let uniques = []; + let stringify = {}; + for (let i = 0; i < obj.length; i++) { + let keys = Object.keys(obj[i]); + keys.sort(function(a, b) { + return a - b; + }); + let str = ""; + for (let j = 0; j < keys.length; j++) { + str += JSON.stringify(keys[j]); + str += JSON.stringify(obj[i][keys[j]]); + } + if (!{}.hasOwnProperty.call(stringify, str)) { + uniques.push(obj[i]); + stringify[str] = true; + } + } + return uniques; + } + function sortByKey(array, keys) { + return array.sort(function(a, b) { + let x = ""; + let y = ""; + keys.forEach(function(key) { + x = x + a[key]; + y = y + b[key]; + }); + return x < y ? -1 : x > y ? 1 : 0; + }); + } + function cores() { + if (_cores === 0) { + _cores = os2.cpus().length; + } + return _cores; + } + function getValue(lines, property, separator, trimmed, lineMatch) { + separator = separator || ":"; + property = property.toLowerCase(); + trimmed = trimmed || false; + lineMatch = lineMatch || false; + let result2 = ""; + lines.some((line) => { + let lineLower = line.toLowerCase().replace(/\t/g, ""); + if (trimmed) { + lineLower = lineLower.trim(); + } + if (lineLower.startsWith(property) && (lineMatch ? lineLower.match(property + separator) || lineLower.match(property + " " + separator) : true)) { + const parts = trimmed ? line.trim().split(separator) : line.split(separator); + if (parts.length >= 2) { + parts.shift(); + result2 = parts.join(separator).trim(); + return true; + } + } + }); + return result2; + } + function decodeEscapeSequence(str, base) { + base = base || 16; + return str.replace(/\\x([0-9A-Fa-f]{2})/g, function() { + return String.fromCharCode(parseInt(arguments[1], base)); + }); + } + function detectSplit(str) { + let seperator = ""; + let part = 0; + str.split("").forEach((element) => { + if (element >= "0" && element <= "9") { + if (part === 1) { + part++; + } + } else { + if (part === 0) { + part++; + } + if (part === 1) { + seperator += element; + } + } + }); + return seperator; + } + function parseTime(t, pmDesignator) { + pmDesignator = pmDesignator || ""; + t = t.toUpperCase(); + let hour = 0; + let min = 0; + let splitter = detectSplit(t); + let parts = t.split(splitter); + if (parts.length >= 2) { + if (parts[2]) { + parts[1] += parts[2]; + } + let isPM = parts[1] && parts[1].toLowerCase().indexOf("pm") > -1 || parts[1].toLowerCase().indexOf("p.m.") > -1 || parts[1].toLowerCase().indexOf("p. m.") > -1 || parts[1].toLowerCase().indexOf("n") > -1 || parts[1].toLowerCase().indexOf("ch") > -1 || parts[1].toLowerCase().indexOf("\xF6s") > -1 || pmDesignator && parts[1].toLowerCase().indexOf(pmDesignator) > -1; + hour = parseInt(parts[0], 10); + min = parseInt(parts[1], 10); + hour = isPM && hour < 12 ? hour + 12 : hour; + return ("0" + hour).substr(-2) + ":" + ("0" + min).substr(-2); + } + } + function parseDateTime(dt, culture) { + const result2 = { + date: "", + time: "" + }; + culture = culture || {}; + let dateFormat = (culture.dateFormat || "").toLowerCase(); + let pmDesignator = culture.pmDesignator || ""; + const parts = dt.split(" "); + if (parts[0]) { + if (parts[0].indexOf("/") >= 0) { + const dtparts = parts[0].split("/"); + if (dtparts.length === 3) { + if (dtparts[0].length === 4) { + result2.date = dtparts[0] + "-" + ("0" + dtparts[1]).substr(-2) + "-" + ("0" + dtparts[2]).substr(-2); + } else if (dtparts[2].length === 2) { + if (dateFormat.indexOf("/d/") > -1 || dateFormat.indexOf("/dd/") > -1) { + result2.date = "20" + dtparts[2] + "-" + ("0" + dtparts[1]).substr(-2) + "-" + ("0" + dtparts[0]).substr(-2); + } else { + result2.date = "20" + dtparts[2] + "-" + ("0" + dtparts[1]).substr(-2) + "-" + ("0" + dtparts[0]).substr(-2); + } + } else { + const isEN = dt.toLowerCase().indexOf("pm") > -1 || dt.toLowerCase().indexOf("p.m.") > -1 || dt.toLowerCase().indexOf("p. m.") > -1 || dt.toLowerCase().indexOf("am") > -1 || dt.toLowerCase().indexOf("a.m.") > -1 || dt.toLowerCase().indexOf("a. m.") > -1; + if ((isEN || dateFormat.indexOf("/d/") > -1 || dateFormat.indexOf("/dd/") > -1) && dateFormat.indexOf("dd/") !== 0) { + result2.date = dtparts[2] + "-" + ("0" + dtparts[0]).substr(-2) + "-" + ("0" + dtparts[1]).substr(-2); + } else { + result2.date = dtparts[2] + "-" + ("0" + dtparts[1]).substr(-2) + "-" + ("0" + dtparts[0]).substr(-2); + } + } + } + } + if (parts[0].indexOf(".") >= 0) { + const dtparts = parts[0].split("."); + if (dtparts.length === 3) { + if (dateFormat.indexOf(".d.") > -1 || dateFormat.indexOf(".dd.") > -1) { + result2.date = dtparts[2] + "-" + ("0" + dtparts[0]).substr(-2) + "-" + ("0" + dtparts[1]).substr(-2); + } else { + result2.date = dtparts[2] + "-" + ("0" + dtparts[1]).substr(-2) + "-" + ("0" + dtparts[0]).substr(-2); + } + } + } + if (parts[0].indexOf("-") >= 0) { + const dtparts = parts[0].split("-"); + if (dtparts.length === 3) { + result2.date = dtparts[0] + "-" + ("0" + dtparts[1]).substr(-2) + "-" + ("0" + dtparts[2]).substr(-2); + } + } + } + if (parts[1]) { + parts.shift(); + let time = parts.join(" "); + result2.time = parseTime(time, pmDesignator); + } + return result2; + } + function parseHead(head, rights) { + let space = rights > 0; + let count = 1; + let from = 0; + let to = 0; + let result2 = []; + for (let i = 0; i < head.length; i++) { + if (count <= rights) { + if (/\s/.test(head[i]) && !space) { + to = i - 1; + result2.push({ + from, + to: to + 1, + cap: head.substring(from, to + 1) + }); + from = to + 2; + count++; + } + space = head[i] === " "; + } else { + if (!/\s/.test(head[i]) && space) { + to = i - 1; + if (from < to) { + result2.push({ + from, + to, + cap: head.substring(from, to) + }); + } + from = to + 1; + count++; + } + space = head[i] === " "; + } + } + to = 5e3; + result2.push({ + from, + to, + cap: head.substring(from, to) + }); + let len = result2.length; + for (let i = 0; i < len; i++) { + if (result2[i].cap.replace(/\s/g, "").length === 0) { + if (i + 1 < len) { + result2[i].to = result2[i + 1].to; + result2[i].cap = result2[i].cap + result2[i + 1].cap; + result2.splice(i + 1, 1); + len = len - 1; + } + } + } + return result2; + } + function findObjectByKey(array, key, value) { + for (let i = 0; i < array.length; i++) { + if (array[i][key] === value) { + return i; + } + } + return -1; + } + function getPowershell() { + _powerShell = "powershell.exe"; + if (_windows) { + const defaultPath = `${WINDIR}\\system32\\WindowsPowerShell\\v1.0\\powershell.exe`; + if (fs.existsSync(defaultPath)) { + _powerShell = defaultPath; + } + } + } + function getWmic() { + if (os2.type() === "Windows_NT" && !wmicPath) { + wmicPath = WINDIR + "\\system32\\wbem\\wmic.exe"; + if (!fs.existsSync(wmicPath)) { + try { + const wmicPathArray = execSync("WHERE WMIC", execOptsWin).toString().split("\r\n"); + if (wmicPathArray && wmicPathArray.length) { + wmicPath = wmicPathArray[0]; + } else { + wmicPath = "wmic"; + } + } catch (e) { + wmicPath = "wmic"; + } + } + } + return wmicPath; + } + function wmic(command) { + return new Promise((resolve) => { + process.nextTick(() => { + try { + powerShell(getWmic() + " " + command).then((stdout) => { + resolve(stdout, ""); + }); + } catch (e) { + resolve("", e); + } + }); + }); + } + function getVboxmanage() { + return _windows ? `"${process.env.VBOX_INSTALL_PATH || process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"` : "vboxmanage"; + } + function powerShellProceedResults(data) { + let id = ""; + let parts; + let res = ""; + if (data.indexOf(_psCmdStart) >= 0) { + parts = data.split(_psCmdStart); + const parts2 = parts[1].split(_psIdSeperator); + id = parts2[0]; + if (parts2.length > 1) { + data = parts2.slice(1).join(_psIdSeperator); + } + } + if (data.indexOf(_psCmdSeperator) >= 0) { + parts = data.split(_psCmdSeperator); + res = parts[0]; + } + let remove = -1; + for (let i = 0; i < _psCmds.length; i++) { + if (_psCmds[i].id === id) { + remove = i; + _psCmds[i].callback(res); + } + } + if (remove >= 0) { + _psCmds.splice(remove, 1); + } + } + function powerShellStart() { + if (!_psChild) { + _psChild = spawn2(_powerShell, ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-NoExit", "-Command", "-"], { + stdio: "pipe", + windowsHide: true, + maxBuffer: 1024 * 2e4, + encoding: "UTF-8", + env: Object.assign({}, process.env, { LANG: "en_US.UTF-8" }) + }); + if (_psChild && _psChild.pid) { + _psPersistent = true; + _psChild.stdout.on("data", function(data) { + _psResult = _psResult + data.toString("utf8"); + if (data.indexOf(_psCmdSeperator) >= 0) { + powerShellProceedResults(_psResult); + _psResult = ""; + } + }); + _psChild.stderr.on("data", function() { + powerShellProceedResults(_psResult + _psError); + }); + _psChild.on("error", function() { + powerShellProceedResults(_psResult + _psError); + }); + _psChild.on("close", function() { + if (_psChild) { + _psChild.kill(); + } + }); + } + } + } + function powerShellRelease() { + try { + if (_psChild) { + _psChild.stdin.write("exit" + os2.EOL); + _psChild.stdin.end(); + _psPersistent = false; + } + } catch (e) { + if (_psChild) { + _psChild.kill(); + } + } + _psChild = null; + } + function powerShell(cmd) { + if (_psPersistent) { + const id = Math.random().toString(36).substring(2, 12); + return new Promise((resolve) => { + process.nextTick(() => { + function callback(data) { + resolve(data); + } + _psCmds.push({ + id, + cmd, + callback, + start: new Date() + }); + try { + if (_psChild && _psChild.pid) { + _psChild.stdin.write(_psToUTF8 + "echo " + _psCmdStart + id + _psIdSeperator + "; " + os2.EOL + cmd + os2.EOL + "echo " + _psCmdSeperator + os2.EOL); + } + } catch (e) { + resolve(""); + } + }); + }); + } else { + let result2 = ""; + return new Promise((resolve) => { + process.nextTick(() => { + try { + const child = spawn2(_powerShell, ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-NoExit", "-ExecutionPolicy", "Unrestricted", "-Command", "-"], { + stdio: "pipe", + windowsHide: true, + maxBuffer: 1024 * 2e4, + encoding: "UTF-8", + env: Object.assign({}, process.env, { LANG: "en_US.UTF-8" }) + }); + if (child && !child.pid) { + child.on("error", function() { + resolve(result2); + }); + } + if (child && child.pid) { + child.stdout.on("data", function(data) { + result2 = result2 + data.toString("utf8"); + }); + child.stderr.on("data", function() { + child.kill(); + resolve(result2); + }); + child.on("close", function() { + child.kill(); + resolve(result2); + }); + child.on("error", function() { + child.kill(); + resolve(result2); + }); + try { + child.stdin.write(_psToUTF8 + cmd + os2.EOL); + child.stdin.write("exit" + os2.EOL); + child.stdin.end(); + } catch (e) { + child.kill(); + resolve(result2); + } + } else { + resolve(result2); + } + } catch (e) { + resolve(result2); + } + }); + }); + } + } + function execSafe(cmd, args, options) { + let result2 = ""; + options = options || {}; + return new Promise((resolve) => { + process.nextTick(() => { + try { + const child = spawn2(cmd, args, options); + if (child && !child.pid) { + child.on("error", function() { + resolve(result2); + }); + } + if (child && child.pid) { + child.stdout.on("data", function(data) { + result2 += data.toString(); + }); + child.on("close", function() { + child.kill(); + resolve(result2); + }); + child.on("error", function() { + child.kill(); + resolve(result2); + }); + } else { + resolve(result2); + } + } catch (e) { + resolve(result2); + } + }); + }); + } + function getCodepage() { + if (_windows) { + if (!codepage) { + try { + const stdout = execSync("chcp", execOptsWin); + const lines = stdout.toString().split("\r\n"); + const parts = lines[0].split(":"); + codepage = parts.length > 1 ? parts[1].replace(".", "").trim() : ""; + } catch (err) { + codepage = "437"; + } + } + return codepage; + } + if (_linux || _darwin || _freebsd || _openbsd || _netbsd) { + if (!codepage) { + try { + const stdout = execSync("echo $LANG", execOptsLinux); + const lines = stdout.toString().split("\r\n"); + const parts = lines[0].split("."); + codepage = parts.length > 1 ? parts[1].trim() : ""; + if (!codepage) { + codepage = "UTF-8"; + } + } catch (err) { + codepage = "UTF-8"; + } + } + return codepage; + } + } + function smartMonToolsInstalled() { + if (_smartMonToolsInstalled !== null) { + return _smartMonToolsInstalled; + } + _smartMonToolsInstalled = false; + if (_windows) { + try { + const pathArray = execSync("WHERE smartctl 2>nul", execOptsWin).toString().split("\r\n"); + if (pathArray && pathArray.length) { + _smartMonToolsInstalled = pathArray[0].indexOf(":\\") >= 0; + } else { + _smartMonToolsInstalled = false; + } + } catch (e) { + _smartMonToolsInstalled = false; + } + } + if (_linux || _darwin || _freebsd || _openbsd || _netbsd) { + try { + const pathArray = execSync("which smartctl 2>/dev/null", execOptsLinux).toString().split("\r\n"); + _smartMonToolsInstalled = pathArray.length > 0; + } catch (e) { + util.noop(); + } + } + return _smartMonToolsInstalled; + } + function isRaspberry(cpuinfo) { + const PI_MODEL_NO = [ + "BCM2708", + "BCM2709", + "BCM2710", + "BCM2711", + "BCM2712", + "BCM2835", + "BCM2836", + "BCM2837", + "BCM2837B0" + ]; + if (_rpi_cpuinfo !== null) { + cpuinfo = _rpi_cpuinfo; + } else if (cpuinfo === void 0) { + try { + cpuinfo = fs.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split("\n"); + _rpi_cpuinfo = cpuinfo; + } catch (e) { + return false; + } + } + const hardware = getValue(cpuinfo, "hardware"); + const model = getValue(cpuinfo, "model"); + return hardware && PI_MODEL_NO.indexOf(hardware) > -1 || model && model.indexOf("Raspberry Pi") > -1; + } + function isRaspbian() { + let osrelease = []; + try { + osrelease = fs.readFileSync("/etc/os-release", { encoding: "utf8" }).toString().split("\n"); + } catch (e) { + return false; + } + const id = getValue(osrelease, "id", "="); + return id && id.indexOf("raspbian") > -1; + } + function execWin(cmd, opts, callback) { + if (!callback) { + callback = opts; + opts = execOptsWin; + } + let newCmd = "chcp 65001 > nul && cmd /C " + cmd + " && chcp " + codepage + " > nul"; + exec2(newCmd, opts, function(error, stdout) { + callback(error, stdout); + }); + } + function darwinXcodeExists() { + const cmdLineToolsExists = fs.existsSync("/Library/Developer/CommandLineTools/usr/bin/"); + const xcodeAppExists = fs.existsSync("/Applications/Xcode.app/Contents/Developer/Tools"); + const xcodeExists = fs.existsSync("/Library/Developer/Xcode/"); + return cmdLineToolsExists || xcodeExists || xcodeAppExists; + } + function nanoSeconds() { + const time = process.hrtime(); + if (!Array.isArray(time) || time.length !== 2) { + return 0; + } + return +time[0] * 1e9 + +time[1]; + } + function countUniqueLines(lines, startingWith) { + startingWith = startingWith || ""; + const uniqueLines = []; + lines.forEach((line) => { + if (line.startsWith(startingWith)) { + if (uniqueLines.indexOf(line) === -1) { + uniqueLines.push(line); + } + } + }); + return uniqueLines.length; + } + function countLines(lines, startingWith) { + startingWith = startingWith || ""; + const uniqueLines = []; + lines.forEach((line) => { + if (line.startsWith(startingWith)) { + uniqueLines.push(line); + } + }); + return uniqueLines.length; + } + function sanitizeShellString(str, strict) { + if (typeof strict === "undefined") { + strict = false; + } + const s = str || ""; + let result2 = ""; + const l = mathMin(s.length, 2e3); + for (let i = 0; i <= l; i++) { + if (!(s[i] === void 0 || s[i] === ">" || s[i] === "<" || s[i] === "*" || s[i] === "?" || s[i] === "[" || s[i] === "]" || s[i] === "|" || s[i] === "\u02DA" || s[i] === "$" || s[i] === ";" || s[i] === "&" || s[i] === "]" || s[i] === "#" || s[i] === "\\" || s[i] === " " || s[i] === "\n" || s[i] === "\r" || s[i] === "'" || s[i] === "`" || s[i] === '"' || s[i].length > 1 || strict && s[i] === "(" || strict && s[i] === ")" || strict && s[i] === "@" || strict && s[i] === " " || strict && s[i] == "{" || strict && s[i] == ";" || strict && s[i] == "}")) { + result2 = result2 + s[i]; + } + } + return result2; + } + function isPrototypePolluted() { + const s = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + let notPolluted = true; + let st = ""; + try { + st.__proto__.replace = stringReplace; + st.__proto__.toLowerCase = stringToLower; + st.__proto__.toString = stringToString; + st.__proto__.substr = stringSubstr; + st.__proto__.substring = stringSubstring; + st.__proto__.trim = stringTrim; + st.__proto__.startsWith = stringStartWith; + } catch (e) { + Object.setPrototypeOf(st, stringObj); + } + notPolluted = notPolluted || s.length !== 62; + const ms = Date.now(); + if (typeof ms === "number" && ms > 16e11) { + const l = ms % 100 + 15; + for (let i = 0; i < l; i++) { + const r = Math.random() * 61.99999999 + 1; + const rs = parseInt(Math.floor(r).toString(), 10); + const rs2 = parseInt(r.toString().split(".")[0], 10); + const q = Math.random() * 61.99999999 + 1; + const qs = parseInt(Math.floor(q).toString(), 10); + const qs2 = parseInt(q.toString().split(".")[0], 10); + notPolluted = notPolluted && r !== q; + notPolluted = notPolluted && rs === rs2 && qs === qs2; + st += s[rs - 1]; + } + notPolluted = notPolluted && st.length === l; + let p = Math.random() * l * 0.9999999999; + let stm = st.substr(0, p) + " " + st.substr(p, 2e3); + try { + stm.__proto__.replace = stringReplace; + } catch (e) { + Object.setPrototypeOf(stm, stringObj); + } + let sto = stm.replace(/ /g, ""); + notPolluted = notPolluted && st === sto; + p = Math.random() * l * 0.9999999999; + stm = st.substr(0, p) + "{" + st.substr(p, 2e3); + sto = stm.replace(/{/g, ""); + notPolluted = notPolluted && st === sto; + p = Math.random() * l * 0.9999999999; + stm = st.substr(0, p) + "*" + st.substr(p, 2e3); + sto = stm.replace(/\*/g, ""); + notPolluted = notPolluted && st === sto; + p = Math.random() * l * 0.9999999999; + stm = st.substr(0, p) + "$" + st.substr(p, 2e3); + sto = stm.replace(/\$/g, ""); + notPolluted = notPolluted && st === sto; + const stl = st.toLowerCase(); + notPolluted = notPolluted && stl.length === l && stl[l - 1] && !stl[l]; + for (let i = 0; i < l; i++) { + const s1 = st[i]; + try { + s1.__proto__.toLowerCase = stringToLower; + } catch (e) { + Object.setPrototypeOf(st, stringObj); + } + const s2 = stl ? stl[i] : ""; + const s1l = s1.toLowerCase(); + notPolluted = notPolluted && s1l[0] === s2 && s1l[0] && !s1l[1]; + } + } + return !notPolluted; + } + function hex2bin(hex) { + return ("00000000" + parseInt(hex, 16).toString(2)).substr(-8); + } + function getFilesInPath(source) { + const lstatSync = fs.lstatSync; + const readdirSync = fs.readdirSync; + const join2 = path.join; + function isDirectory(source2) { + return lstatSync(source2).isDirectory(); + } + function isFile(source2) { + return lstatSync(source2).isFile(); + } + function getDirectories(source2) { + return readdirSync(source2).map(function(name) { + return join2(source2, name); + }).filter(isDirectory); + } + function getFiles(source2) { + return readdirSync(source2).map(function(name) { + return join2(source2, name); + }).filter(isFile); + } + function getFilesRecursively(source2) { + try { + let dirs = getDirectories(source2); + let files = dirs.map(function(dir) { + return getFilesRecursively(dir); + }).reduce(function(a, b) { + return a.concat(b); + }, []); + return files.concat(getFiles(source2)); + } catch (e) { + return []; + } + } + if (fs.existsSync(source)) { + return getFilesRecursively(source); + } else { + return []; + } + } + function decodePiCpuinfo(lines) { + if (_rpi_cpuinfo === null) { + _rpi_cpuinfo = lines; + } else if (lines === void 0) { + lines = _rpi_cpuinfo; + } + const oldRevisionCodes = { + "0002": { + type: "B", + revision: "1.0", + memory: 256, + manufacturer: "Egoman", + processor: "BCM2835" + }, + "0003": { + type: "B", + revision: "1.0", + memory: 256, + manufacturer: "Egoman", + processor: "BCM2835" + }, + "0004": { + type: "B", + revision: "2.0", + memory: 256, + manufacturer: "Sony UK", + processor: "BCM2835" + }, + "0005": { + type: "B", + revision: "2.0", + memory: 256, + manufacturer: "Qisda", + processor: "BCM2835" + }, + "0006": { + type: "B", + revision: "2.0", + memory: 256, + manufacturer: "Egoman", + processor: "BCM2835" + }, + "0007": { + type: "A", + revision: "2.0", + memory: 256, + manufacturer: "Egoman", + processor: "BCM2835" + }, + "0008": { + type: "A", + revision: "2.0", + memory: 256, + manufacturer: "Sony UK", + processor: "BCM2835" + }, + "0009": { + type: "A", + revision: "2.0", + memory: 256, + manufacturer: "Qisda", + processor: "BCM2835" + }, + "000d": { + type: "B", + revision: "2.0", + memory: 512, + manufacturer: "Egoman", + processor: "BCM2835" + }, + "000e": { + type: "B", + revision: "2.0", + memory: 512, + manufacturer: "Sony UK", + processor: "BCM2835" + }, + "000f": { + type: "B", + revision: "2.0", + memory: 512, + manufacturer: "Egoman", + processor: "BCM2835" + }, + "0010": { + type: "B+", + revision: "1.2", + memory: 512, + manufacturer: "Sony UK", + processor: "BCM2835" + }, + "0011": { + type: "CM1", + revision: "1.0", + memory: 512, + manufacturer: "Sony UK", + processor: "BCM2835" + }, + "0012": { + type: "A+", + revision: "1.1", + memory: 256, + manufacturer: "Sony UK", + processor: "BCM2835" + }, + "0013": { + type: "B+", + revision: "1.2", + memory: 512, + manufacturer: "Embest", + processor: "BCM2835" + }, + "0014": { + type: "CM1", + revision: "1.0", + memory: 512, + manufacturer: "Embest", + processor: "BCM2835" + }, + "0015": { + type: "A+", + revision: "1.1", + memory: 256, + manufacturer: "512MB Embest", + processor: "BCM2835" + } + }; + const processorList = [ + "BCM2835", + "BCM2836", + "BCM2837", + "BCM2711", + "BCM2712" + ]; + const manufacturerList = [ + "Sony UK", + "Egoman", + "Embest", + "Sony Japan", + "Embest", + "Stadium" + ]; + const typeList = { + "00": "A", + "01": "B", + "02": "A+", + "03": "B+", + "04": "2B", + "05": "Alpha (early prototype)", + "06": "CM1", + "08": "3B", + "09": "Zero", + "0a": "CM3", + "0c": "Zero W", + "0d": "3B+", + "0e": "3A+", + "0f": "Internal use only", + "10": "CM3+", + "11": "4B", + "12": "Zero 2 W", + "13": "400", + "14": "CM4", + "15": "CM4S", + "16": "Internal use only", + "17": "5", + "18": "CM5", + "19": "500", + "1a": "CM5 Lite" + }; + const revisionCode = getValue(lines, "revision", ":", true); + const model = getValue(lines, "model:", ":", true); + const serial = getValue(lines, "serial", ":", true); + let result2 = {}; + if ({}.hasOwnProperty.call(oldRevisionCodes, revisionCode)) { + result2 = { + model, + serial, + revisionCode, + memory: oldRevisionCodes[revisionCode].memory, + manufacturer: oldRevisionCodes[revisionCode].manufacturer, + processor: oldRevisionCodes[revisionCode].processor, + type: oldRevisionCodes[revisionCode].type, + revision: oldRevisionCodes[revisionCode].revision + }; + } else { + const revision = ("00000000" + getValue(lines, "revision", ":", true).toLowerCase()).substr(-8); + const memSizeCode = parseInt(hex2bin(revision.substr(2, 1)).substr(5, 3), 2) || 0; + const manufacturer = manufacturerList[parseInt(revision.substr(3, 1), 10)]; + const processor = processorList[parseInt(revision.substr(4, 1), 10)]; + const typeCode = revision.substr(5, 2); + result2 = { + model, + serial, + revisionCode, + memory: 256 * Math.pow(2, memSizeCode), + manufacturer, + processor, + type: {}.hasOwnProperty.call(typeList, typeCode) ? typeList[typeCode] : "", + revision: "1." + revision.substr(7, 1) + }; + } + return result2; + } + function getRpiGpu(cpuinfo) { + if (_rpi_cpuinfo === null && cpuinfo !== void 0) { + _rpi_cpuinfo = cpuinfo; + } else if (cpuinfo === void 0 && _rpi_cpuinfo !== null) { + cpuinfo = _rpi_cpuinfo; + } else { + try { + cpuinfo = fs.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split("\n"); + _rpi_cpuinfo = cpuinfo; + } catch (e) { + return false; + } + } + const rpi = decodePiCpuinfo(cpuinfo); + if (rpi.type === "4B" || rpi.type === "CM4" || rpi.type === "CM4S" || rpi.type === "400") { + return "VideoCore VI"; + } + if (rpi.type === "5" || rpi.type === "500") { + return "VideoCore VII"; + } + return "VideoCore IV"; + } + function promiseAll(promises) { + const resolvingPromises = promises.map(function(promise) { + return new Promise(function(resolve) { + let payload = new Array(2); + promise.then(function(result2) { + payload[0] = result2; + }).catch(function(error) { + payload[1] = error; + }).then(function() { + resolve(payload); + }); + }); + }); + const errors = []; + const results = []; + return Promise.all(resolvingPromises).then(function(items) { + items.forEach(function(payload) { + if (payload[1]) { + errors.push(payload[1]); + results.push(null); + } else { + errors.push(null); + results.push(payload[0]); + } + }); + return { + errors, + results + }; + }); + } + function promisify(nodeStyleFunction) { + return function() { + const args = Array.prototype.slice.call(arguments); + return new Promise(function(resolve, reject) { + args.push(function(err, data) { + if (err) { + reject(err); + } else { + resolve(data); + } + }); + nodeStyleFunction.apply(null, args); + }); + }; + } + function promisifySave(nodeStyleFunction) { + return function() { + const args = Array.prototype.slice.call(arguments); + return new Promise(function(resolve) { + args.push(function(err, data) { + resolve(data); + }); + nodeStyleFunction.apply(null, args); + }); + }; + } + function linuxVersion() { + let result2 = ""; + if (_linux) { + try { + result2 = execSync("uname -v", execOptsLinux).toString(); + } catch (e) { + result2 = ""; + } + } + return result2; + } + function plistParser(xmlStr) { + const tags = ["array", "dict", "key", "string", "integer", "date", "real", "data", "boolean", "arrayEmpty"]; + const startStr = "" && pos < len) { + pos++; + } + let depth = 0; + let inTagStart = false; + let inTagContent = false; + let inTagEnd = false; + let metaData = [{ tagStart: "", tagEnd: "", tagContent: "", key: "", data: null }]; + let c = ""; + let cn = xmlStr[pos]; + while (pos < len) { + c = cn; + if (pos + 1 < len) { + cn = xmlStr[pos + 1]; + } + if (c === "<") { + inTagContent = false; + if (cn === "/") { + inTagEnd = true; + } else if (metaData[depth].tagStart) { + metaData[depth].tagContent = ""; + if (!metaData[depth].data) { + metaData[depth].data = metaData[depth].tagStart === "array" ? [] : {}; + } + depth++; + metaData.push({ tagStart: "", tagEnd: "", tagContent: "", key: null, data: null }); + inTagStart = true; + inTagContent = false; + } else if (!inTagStart) { + inTagStart = true; + } + } else if (c === ">") { + if (metaData[depth].tagStart === "true/") { + inTagStart = false; + inTagEnd = true; + metaData[depth].tagStart = ""; + metaData[depth].tagEnd = "/boolean"; + metaData[depth].data = true; + } + if (metaData[depth].tagStart === "false/") { + inTagStart = false; + inTagEnd = true; + metaData[depth].tagStart = ""; + metaData[depth].tagEnd = "/boolean"; + metaData[depth].data = false; + } + if (metaData[depth].tagStart === "array/") { + inTagStart = false; + inTagEnd = true; + metaData[depth].tagStart = ""; + metaData[depth].tagEnd = "/arrayEmpty"; + metaData[depth].data = []; + } + if (inTagContent) { + inTagContent = false; + } + if (inTagStart) { + inTagStart = false; + inTagContent = true; + if (metaData[depth].tagStart === "array") { + metaData[depth].data = []; + } + if (metaData[depth].tagStart === "dict") { + metaData[depth].data = {}; + } + } + if (inTagEnd) { + inTagEnd = false; + if (metaData[depth].tagEnd && tags.indexOf(metaData[depth].tagEnd.substr(1)) >= 0) { + if (metaData[depth].tagEnd === "/dict" || metaData[depth].tagEnd === "/array") { + if (depth > 1 && metaData[depth - 2].tagStart === "array") { + metaData[depth - 2].data.push(metaData[depth - 1].data); + } + if (depth > 1 && metaData[depth - 2].tagStart === "dict") { + metaData[depth - 2].data[metaData[depth - 1].key] = metaData[depth - 1].data; + } + depth--; + metaData.pop(); + metaData[depth].tagContent = ""; + metaData[depth].tagStart = ""; + metaData[depth].tagEnd = ""; + } else { + if (metaData[depth].tagEnd === "/key" && metaData[depth].tagContent) { + metaData[depth].key = metaData[depth].tagContent; + } else { + if (metaData[depth].tagEnd === "/real" && metaData[depth].tagContent) { + metaData[depth].data = parseFloat(metaData[depth].tagContent) || 0; + } + if (metaData[depth].tagEnd === "/integer" && metaData[depth].tagContent) { + metaData[depth].data = parseInt(metaData[depth].tagContent) || 0; + } + if (metaData[depth].tagEnd === "/string" && metaData[depth].tagContent) { + metaData[depth].data = metaData[depth].tagContent || ""; + } + if (metaData[depth].tagEnd === "/boolean") { + metaData[depth].data = metaData[depth].tagContent || false; + } + if (metaData[depth].tagEnd === "/arrayEmpty") { + metaData[depth].data = metaData[depth].tagContent || []; + } + if (depth > 0 && metaData[depth - 1].tagStart === "array") { + metaData[depth - 1].data.push(metaData[depth].data); + } + if (depth > 0 && metaData[depth - 1].tagStart === "dict") { + metaData[depth - 1].data[metaData[depth].key] = metaData[depth].data; + } + } + metaData[depth].tagContent = ""; + metaData[depth].tagStart = ""; + metaData[depth].tagEnd = ""; + } + } + metaData[depth].tagEnd = ""; + inTagStart = false; + inTagContent = false; + } + } else { + if (inTagStart) { + metaData[depth].tagStart += c; + } + if (inTagEnd) { + metaData[depth].tagEnd += c; + } + if (inTagContent) { + metaData[depth].tagContent += c; + } + } + pos++; + } + return metaData[0].data; + } + function strIsNumeric(str) { + return typeof str === "string" && !isNaN(str) && !isNaN(parseFloat(str)); + } + function plistReader(output) { + const lines = output.split("\n"); + for (let i = 0; i < lines.length; i++) { + if (lines[i].indexOf(" = ") >= 0) { + const lineParts = lines[i].split(" = "); + lineParts[0] = lineParts[0].trim(); + if (!lineParts[0].startsWith('"')) { + lineParts[0] = '"' + lineParts[0] + '"'; + } + lineParts[1] = lineParts[1].trim(); + if (lineParts[1].indexOf('"') === -1 && lineParts[1].endsWith(";")) { + const valueString = lineParts[1].substring(0, lineParts[1].length - 1); + if (!strIsNumeric(valueString)) { + lineParts[1] = `"${valueString}";`; + } + } + if (lineParts[1].indexOf('"') >= 0 && lineParts[1].endsWith(";")) { + const valueString = lineParts[1].substring(0, lineParts[1].length - 1).replace(/"/g, ""); + if (strIsNumeric(valueString)) { + lineParts[1] = `${valueString};`; + } + } + lines[i] = lineParts.join(" : "); + } + lines[i] = lines[i].replace(/\(/g, "[").replace(/\)/g, "]").replace(/;/g, ",").trim(); + if (lines[i].startsWith("}") && lines[i - 1] && lines[i - 1].endsWith(",")) { + lines[i - 1] = lines[i - 1].substring(0, lines[i - 1].length - 1); + } + } + output = lines.join(""); + let obj = {}; + try { + obj = JSON.parse(output); + } catch (e) { + noop(); + } + return obj; + } + function semverCompare(v1, v2) { + let res = 0; + const parts1 = v1.split("."); + const parts2 = v2.split("."); + if (parts1[0] < parts2[0]) { + res = 1; + } else if (parts1[0] > parts2[0]) { + res = -1; + } else if (parts1[0] === parts2[0] && parts1.length >= 2 && parts2.length >= 2) { + if (parts1[1] < parts2[1]) { + res = 1; + } else if (parts1[1] > parts2[1]) { + res = -1; + } else if (parts1[1] === parts2[1]) { + if (parts1.length >= 3 && parts2.length >= 3) { + if (parts1[2] < parts2[2]) { + res = 1; + } else if (parts1[2] > parts2[2]) { + res = -1; + } + } else if (parts2.length >= 3) { + res = 1; + } + } + } + return res; + } + function getAppleModel(key) { + const appleModelIds = [ + { + key: "Mac15,12", + name: "MacBook Air", + size: "13-inch", + processor: "M3", + year: "2024", + additional: "" + }, + { + key: "Mac14,15", + name: "MacBook Air", + size: "15-inch", + processor: "M2", + year: "2024", + additional: "" + }, + { + key: "Mac14,2", + name: "MacBook Air", + size: "13-inch", + processor: "M2", + year: "2022", + additional: "" + }, + { + key: "MacBookAir10,1", + name: "MacBook Air", + size: "13-inch", + processor: "M1", + year: "2020", + additional: "" + }, + { + key: "MacBookAir9,1", + name: "MacBook Air", + size: "13-inch", + processor: "", + year: "2020", + additional: "" + }, + { + key: "MacBookAir8,2", + name: "MacBook Air", + size: "13-inch", + processor: "", + year: "2019", + additional: "" + }, + { + key: "MacBookAir8,1", + name: "MacBook Air", + size: "13-inch", + processor: "", + year: "2018", + additional: "" + }, + { + key: "MacBookAir7,2", + name: "MacBook Air", + size: "13-inch", + processor: "", + year: "2017", + additional: "" + }, + { + key: "MacBookAir7,2", + name: "MacBook Air", + size: "13-inch", + processor: "", + year: "Early 2015", + additional: "" + }, + { + key: "MacBookAir7,1", + name: "MacBook Air", + size: "11-inch", + processor: "", + year: "Early 2015", + additional: "" + }, + { + key: "MacBookAir6,2", + name: "MacBook Air", + size: "13-inch", + processor: "", + year: "Early 2014", + additional: "" + }, + { + key: "MacBookAir6,1", + name: "MacBook Air", + size: "11-inch", + processor: "", + year: "Early 2014", + additional: "" + }, + { + key: "MacBookAir6,2", + name: "MacBook Air", + size: "13-inch", + processor: "", + year: "Mid 2013", + additional: "" + }, + { + key: "MacBookAir6,1", + name: "MacBook Air", + size: "11-inch", + processor: "", + year: "Mid 2013", + additional: "" + }, + { + key: "MacBookAir5,2", + name: "MacBook Air", + size: "13-inch", + processor: "", + year: "Mid 2012", + additional: "" + }, + { + key: "MacBookAir5,1", + name: "MacBook Air", + size: "11-inch", + processor: "", + year: "Mid 2012", + additional: "" + }, + { + key: "MacBookAir4,2", + name: "MacBook Air", + size: "13-inch", + processor: "", + year: "Mid 2011", + additional: "" + }, + { + key: "MacBookAir4,1", + name: "MacBook Air", + size: "11-inch", + processor: "", + year: "Mid 2011", + additional: "" + }, + { + key: "MacBookAir3,2", + name: "MacBook Air", + size: "13-inch", + processor: "", + year: "Late 2010", + additional: "" + }, + { + key: "MacBookAir3,1", + name: "MacBook Air", + size: "11-inch", + processor: "", + year: "Late 2010", + additional: "" + }, + { + key: "MacBookAir2,1", + name: "MacBook Air", + size: "13-inch", + processor: "", + year: "Mid 2009", + additional: "" + }, + { + key: "Mac16,1", + name: "MacBook Pro", + size: "14-inch", + processor: "M4", + year: "2024", + additional: "" + }, + { + key: "Mac16,6", + name: "MacBook Pro", + size: "14-inch", + processor: "M4 Pro", + year: "2024", + additional: "" + }, + { + key: "Mac16,8", + name: "MacBook Pro", + size: "14-inch", + processor: "M4 Max", + year: "2024", + additional: "" + }, + { + key: "Mac16,5", + name: "MacBook Pro", + size: "16-inch", + processor: "M4 Pro", + year: "2024", + additional: "" + }, + { + key: "Mac16,6", + name: "MacBook Pro", + size: "16-inch", + processor: "M4 Max", + year: "2024", + additional: "" + }, + { + key: "Mac15,3", + name: "MacBook Pro", + size: "14-inch", + processor: "M3", + year: "Nov 2023", + additional: "" + }, + { + key: "Mac15,6", + name: "MacBook Pro", + size: "14-inch", + processor: "M3 Pro", + year: "Nov 2023", + additional: "" + }, + { + key: "Mac15,8", + name: "MacBook Pro", + size: "14-inch", + processor: "M3 Pro", + year: "Nov 2023", + additional: "" + }, + { + key: "Mac15,10", + name: "MacBook Pro", + size: "14-inch", + processor: "M3 Max", + year: "Nov 2023", + additional: "" + }, + { + key: "Mac15,7", + name: "MacBook Pro", + size: "16-inch", + processor: "M3 Pro", + year: "Nov 2023", + additional: "" + }, + { + key: "Mac15,9", + name: "MacBook Pro", + size: "16-inch", + processor: "M3 Pro", + year: "Nov 2023", + additional: "" + }, + { + key: "Mac15,11", + name: "MacBook Pro", + size: "16-inch", + processor: "M3 Max", + year: "Nov 2023", + additional: "" + }, + { + key: "Mac14,5", + name: "MacBook Pro", + size: "14-inch", + processor: "M2 Max", + year: "2023", + additional: "" + }, + { + key: "Mac14,9", + name: "MacBook Pro", + size: "14-inch", + processor: "M2 Max", + year: "2023", + additional: "" + }, + { + key: "Mac14,6", + name: "MacBook Pro", + size: "16-inch", + processor: "M2 Max", + year: "2023", + additional: "" + }, + { + key: "Mac14,10", + name: "MacBook Pro", + size: "16-inch", + processor: "M2 Max", + year: "2023", + additional: "" + }, + { + key: "Mac14,7", + name: "MacBook Pro", + size: "13-inch", + processor: "M2", + year: "2022", + additional: "" + }, + { + key: "MacBookPro18,3", + name: "MacBook Pro", + size: "14-inch", + processor: "M1 Pro", + year: "2021", + additional: "" + }, + { + key: "MacBookPro18,4", + name: "MacBook Pro", + size: "14-inch", + processor: "M1 Max", + year: "2021", + additional: "" + }, + { + key: "MacBookPro18,1", + name: "MacBook Pro", + size: "16-inch", + processor: "M1 Pro", + year: "2021", + additional: "" + }, + { + key: "MacBookPro18,2", + name: "MacBook Pro", + size: "16-inch", + processor: "M1 Max", + year: "2021", + additional: "" + }, + { + key: "MacBookPro17,1", + name: "MacBook Pro", + size: "13-inch", + processor: "M1", + year: "2020", + additional: "" + }, + { + key: "MacBookPro16,3", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "2020", + additional: "Two Thunderbolt 3 ports" + }, + { + key: "MacBookPro16,2", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "2020", + additional: "Four Thunderbolt 3 ports" + }, + { + key: "MacBookPro16,1", + name: "MacBook Pro", + size: "16-inch", + processor: "", + year: "2019", + additional: "" + }, + { + key: "MacBookPro16,4", + name: "MacBook Pro", + size: "16-inch", + processor: "", + year: "2019", + additional: "" + }, + { + key: "MacBookPro15,3", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "2019", + additional: "" + }, + { + key: "MacBookPro15,2", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "2019", + additional: "" + }, + { + key: "MacBookPro15,1", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "2019", + additional: "" + }, + { + key: "MacBookPro15,4", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "2019", + additional: "Two Thunderbolt 3 ports" + }, + { + key: "MacBookPro15,1", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "2018", + additional: "" + }, + { + key: "MacBookPro15,2", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "2018", + additional: "Four Thunderbolt 3 ports" + }, + { + key: "MacBookPro14,1", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "2017", + additional: "Two Thunderbolt 3 ports" + }, + { + key: "MacBookPro14,2", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "2017", + additional: "Four Thunderbolt 3 ports" + }, + { + key: "MacBookPro14,3", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "2017", + additional: "" + }, + { + key: "MacBookPro13,1", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "2016", + additional: "Two Thunderbolt 3 ports" + }, + { + key: "MacBookPro13,2", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "2016", + additional: "Four Thunderbolt 3 ports" + }, + { + key: "MacBookPro13,3", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "2016", + additional: "" + }, + { + key: "MacBookPro11,4", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "Mid 2015", + additional: "" + }, + { + key: "MacBookPro11,5", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "Mid 2015", + additional: "" + }, + { + key: "MacBookPro12,1", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "Early 2015", + additional: "" + }, + { + key: "MacBookPro11,2", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "Late 2013", + additional: "" + }, + { + key: "MacBookPro11,3", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "Late 2013", + additional: "" + }, + { + key: "MacBookPro11,1", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "Late 2013", + additional: "" + }, + { + key: "MacBookPro10,1", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "Mid 2012", + additional: "" + }, + { + key: "MacBookPro10,2", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "Late 2012", + additional: "" + }, + { + key: "MacBookPro9,1", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "Mid 2012", + additional: "" + }, + { + key: "MacBookPro9,2", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "Mid 2012", + additional: "" + }, + { + key: "MacBookPro8,3", + name: "MacBook Pro", + size: "17-inch", + processor: "", + year: "Early 2011", + additional: "" + }, + { + key: "MacBookPro8,2", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "Early 2011", + additional: "" + }, + { + key: "MacBookPro8,1", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "Early 2011", + additional: "" + }, + { + key: "MacBookPro6,1", + name: "MacBook Pro", + size: "17-inch", + processor: "", + year: "Mid 2010", + additional: "" + }, + { + key: "MacBookPro6,2", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "Mid 2010", + additional: "" + }, + { + key: "MacBookPro7,1", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "Mid 2010", + additional: "" + }, + { + key: "MacBookPro5,2", + name: "MacBook Pro", + size: "17-inch", + processor: "", + year: "Early 2009", + additional: "" + }, + { + key: "MacBookPro5,3", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "Mid 2009", + additional: "" + }, + { + key: "MacBookPro5,5", + name: "MacBook Pro", + size: "13-inch", + processor: "", + year: "Mid 2009", + additional: "" + }, + { + key: "MacBookPro5,1", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "Late 2008", + additional: "" + }, + { + key: "MacBookPro4,1", + name: "MacBook Pro", + size: "15-inch", + processor: "", + year: "Early 2008", + additional: "" + }, + { + key: "MacBook10,1", + name: "MacBook", + size: "12-inch", + processor: "", + year: "2017", + additional: "" + }, + { + key: "MacBook9,1", + name: "MacBook", + size: "12-inch", + processor: "", + year: "Early 2016", + additional: "" + }, + { + key: "MacBook8,1", + name: "MacBook", + size: "12-inch", + processor: "", + year: "Early 2015", + additional: "" + }, + { + key: "MacBook7,1", + name: "MacBook", + size: "13-inch", + processor: "", + year: "Mid 2010", + additional: "" + }, + { + key: "MacBook6,1", + name: "MacBook", + size: "13-inch", + processor: "", + year: "Late 2009", + additional: "" + }, + { + key: "MacBook5,2", + name: "MacBook", + size: "13-inch", + processor: "", + year: "Early 2009", + additional: "" + }, + { + key: "Mac14,13", + name: "Mac Studio", + size: "", + processor: "", + year: "2023", + additional: "" + }, + { + key: "Mac14,14", + name: "Mac Studio", + size: "", + processor: "", + year: "2023", + additional: "" + }, + { + key: "Mac13,1", + name: "Mac Studio", + size: "", + processor: "", + year: "2022", + additional: "" + }, + { + key: "Mac13,2", + name: "Mac Studio", + size: "", + processor: "", + year: "2022", + additional: "" + }, + { + key: "Mac16,11", + name: "Mac mini", + size: "", + processor: "M4 Pro", + year: "2024", + additional: "" + }, + { + key: "Mac16,10", + name: "Mac mini", + size: "", + processor: "M4", + year: "2024", + additional: "" + }, + { + key: "Mac14,3", + name: "Mac mini", + size: "", + processor: "M2", + year: "2023", + additional: "" + }, + { + key: "Mac14,12", + name: "Mac mini", + size: "", + processor: "M2 Pro", + year: "2023", + additional: "" + }, + { + key: "Macmini9,1", + name: "Mac mini", + size: "", + processor: "M1", + year: "2020", + additional: "" + }, + { + key: "Macmini8,1", + name: "Mac mini", + size: "", + processor: "", + year: "Late 2018", + additional: "" + }, + { + key: "Macmini7,1", + name: "Mac mini", + size: "", + processor: "", + year: "Late 2014", + additional: "" + }, + { + key: "Macmini6,1", + name: "Mac mini", + size: "", + processor: "", + year: "Late 2012", + additional: "" + }, + { + key: "Macmini6,2", + name: "Mac mini", + size: "", + processor: "", + year: "Late 2012", + additional: "" + }, + { + key: "Macmini5,1", + name: "Mac mini", + size: "", + processor: "", + year: "Mid 2011", + additional: "" + }, + { + key: "Macmini5,2", + name: "Mac mini", + size: "", + processor: "", + year: "Mid 2011", + additional: "" + }, + { + key: "Macmini4,1", + name: "Mac mini", + size: "", + processor: "", + year: "Mid 2010", + additional: "" + }, + { + key: "Macmini3,1", + name: "Mac mini", + size: "", + processor: "", + year: "Early 2009", + additional: "" + }, + { + key: "Mac16,3", + name: "iMac", + size: "24-inch", + processor: "M4", + year: "2024", + additional: "Four ports" + }, + { + key: "Mac16,2", + name: "iMac", + size: "24-inch", + processor: "M4", + year: "2024", + additional: "Two ports" + }, + { + key: "Mac15,5", + name: "iMac", + size: "24-inch", + processor: "M3", + year: "2023", + additional: "Four ports" + }, + { + key: "Mac15,4", + name: "iMac", + size: "24-inch", + processor: "M3", + year: "2023", + additional: "Two ports" + }, + { + key: "iMac21,1", + name: "iMac", + size: "24-inch", + processor: "M1", + year: "2021", + additional: "" + }, + { + key: "iMac21,2", + name: "iMac", + size: "24-inch", + processor: "M1", + year: "2021", + additional: "" + }, + { + key: "iMac20,1", + name: "iMac", + size: "27-inch", + processor: "", + year: "2020", + additional: "Retina 5K" + }, + { + key: "iMac20,2", + name: "iMac", + size: "27-inch", + processor: "", + year: "2020", + additional: "Retina 5K" + }, + { + key: "iMac19,1", + name: "iMac", + size: "27-inch", + processor: "", + year: "2019", + additional: "Retina 5K" + }, + { + key: "iMac19,2", + name: "iMac", + size: "21.5-inch", + processor: "", + year: "2019", + additional: "Retina 4K" + }, + { + key: "iMacPro1,1", + name: "iMac Pro", + size: "", + processor: "", + year: "2017", + additional: "" + }, + { + key: "iMac18,3", + name: "iMac", + size: "27-inch", + processor: "", + year: "2017", + additional: "Retina 5K" + }, + { + key: "iMac18,2", + name: "iMac", + size: "21.5-inch", + processor: "", + year: "2017", + additional: "Retina 4K" + }, + { + key: "iMac18,1", + name: "iMac", + size: "21.5-inch", + processor: "", + year: "2017", + additional: "" + }, + { + key: "iMac17,1", + name: "iMac", + size: "27-inch", + processor: "", + year: "Late 2015", + additional: "Retina 5K" + }, + { + key: "iMac16,2", + name: "iMac", + size: "21.5-inch", + processor: "", + year: "Late 2015", + additional: "Retina 4K" + }, + { + key: "iMac16,1", + name: "iMac", + size: "21.5-inch", + processor: "", + year: "Late 2015", + additional: "" + }, + { + key: "iMac15,1", + name: "iMac", + size: "27-inch", + processor: "", + year: "Late 2014", + additional: "Retina 5K" + }, + { + key: "iMac14,4", + name: "iMac", + size: "21.5-inch", + processor: "", + year: "Mid 2014", + additional: "" + }, + { + key: "iMac14,2", + name: "iMac", + size: "27-inch", + processor: "", + year: "Late 2013", + additional: "" + }, + { + key: "iMac14,1", + name: "iMac", + size: "21.5-inch", + processor: "", + year: "Late 2013", + additional: "" + }, + { + key: "iMac13,2", + name: "iMac", + size: "27-inch", + processor: "", + year: "Late 2012", + additional: "" + }, + { + key: "iMac13,1", + name: "iMac", + size: "21.5-inch", + processor: "", + year: "Late 2012", + additional: "" + }, + { + key: "iMac12,2", + name: "iMac", + size: "27-inch", + processor: "", + year: "Mid 2011", + additional: "" + }, + { + key: "iMac12,1", + name: "iMac", + size: "21.5-inch", + processor: "", + year: "Mid 2011", + additional: "" + }, + { + key: "iMac11,3", + name: "iMac", + size: "27-inch", + processor: "", + year: "Mid 2010", + additional: "" + }, + { + key: "iMac11,2", + name: "iMac", + size: "21.5-inch", + processor: "", + year: "Mid 2010", + additional: "" + }, + { + key: "iMac10,1", + name: "iMac", + size: "21.5-inch", + processor: "", + year: "Late 2009", + additional: "" + }, + { + key: "iMac9,1", + name: "iMac", + size: "20-inch", + processor: "", + year: "Early 2009", + additional: "" + }, + { + key: "Mac14,8", + name: "Mac Pro", + size: "", + processor: "", + year: "2023", + additional: "" + }, + { + key: "Mac14,8", + name: "Mac Pro", + size: "", + processor: "", + year: "2023", + additional: "Rack" + }, + { + key: "MacPro7,1", + name: "Mac Pro", + size: "", + processor: "", + year: "2019", + additional: "" + }, + { + key: "MacPro7,1", + name: "Mac Pro", + size: "", + processor: "", + year: "2019", + additional: "Rack" + }, + { + key: "MacPro6,1", + name: "Mac Pro", + size: "", + processor: "", + year: "Late 2013", + additional: "" + }, + { + key: "MacPro5,1", + name: "Mac Pro", + size: "", + processor: "", + year: "Mid 2012", + additional: "" + }, + { + key: "MacPro5,1", + name: "Mac Pro Server", + size: "", + processor: "", + year: "Mid 2012", + additional: "Server" + }, + { + key: "MacPro5,1", + name: "Mac Pro", + size: "", + processor: "", + year: "Mid 2010", + additional: "" + }, + { + key: "MacPro5,1", + name: "Mac Pro Server", + size: "", + processor: "", + year: "Mid 2010", + additional: "Server" + }, + { + key: "MacPro4,1", + name: "Mac Pro", + size: "", + processor: "", + year: "Early 2009", + additional: "" + } + ]; + const list = appleModelIds.filter((model) => model.key === key); + if (list.length === 0) { + return { + key, + model: "Apple", + version: "Unknown" + }; + } + const features = []; + if (list[0].size) { + features.push(list[0].size); + } + if (list[0].processor) { + features.push(list[0].processor); + } + if (list[0].year) { + features.push(list[0].year); + } + if (list[0].additional) { + features.push(list[0].additional); + } + return { + key, + model: list[0].name, + version: list[0].name + " (" + features.join(", ") + ")" + }; + } + function checkWebsite(url, timeout = 5e3) { + const http = url.startsWith("https:") || url.indexOf(":443/") > 0 || url.indexOf(":8443/") > 0 ? require("https") : require("http"); + const t = Date.now(); + return new Promise((resolve) => { + const request = http.get(url, function(res) { + res.on("data", () => { + }); + res.on("end", () => { + resolve({ + url, + statusCode: res.statusCode, + message: res.statusMessage, + time: Date.now() - t + }); + }); + }).on("error", function(e) { + resolve({ + url, + statusCode: 404, + message: e.message, + time: Date.now() - t + }); + }).setTimeout(timeout, () => { + request.close(); + resolve({ + url, + statusCode: 408, + message: "Request Timeout", + time: Date.now() - t + }); + }); + }); + } + function cleanString(str) { + return str.replace(/To Be Filled By O.E.M./g, ""); + } + function noop() { + } + exports.toInt = toInt; + exports.splitByNumber = splitByNumber; + exports.execOptsWin = execOptsWin; + exports.execOptsLinux = execOptsLinux; + exports.getCodepage = getCodepage; + exports.execWin = execWin; + exports.isFunction = isFunction; + exports.unique = unique; + exports.sortByKey = sortByKey; + exports.cores = cores; + exports.getValue = getValue; + exports.decodeEscapeSequence = decodeEscapeSequence; + exports.parseDateTime = parseDateTime; + exports.parseHead = parseHead; + exports.findObjectByKey = findObjectByKey; + exports.getWmic = getWmic; + exports.wmic = wmic; + exports.darwinXcodeExists = darwinXcodeExists; + exports.getVboxmanage = getVboxmanage; + exports.powerShell = powerShell; + exports.powerShellStart = powerShellStart; + exports.powerShellRelease = powerShellRelease; + exports.execSafe = execSafe; + exports.nanoSeconds = nanoSeconds; + exports.countUniqueLines = countUniqueLines; + exports.countLines = countLines; + exports.noop = noop; + exports.isRaspberry = isRaspberry; + exports.isRaspbian = isRaspbian; + exports.sanitizeShellString = sanitizeShellString; + exports.isPrototypePolluted = isPrototypePolluted; + exports.decodePiCpuinfo = decodePiCpuinfo; + exports.getRpiGpu = getRpiGpu; + exports.promiseAll = promiseAll; + exports.promisify = promisify; + exports.promisifySave = promisifySave; + exports.smartMonToolsInstalled = smartMonToolsInstalled; + exports.linuxVersion = linuxVersion; + exports.plistParser = plistParser; + exports.plistReader = plistReader; + exports.stringObj = stringObj; + exports.stringReplace = stringReplace; + exports.stringToLower = stringToLower; + exports.stringToString = stringToString; + exports.stringSubstr = stringSubstr; + exports.stringSubstring = stringSubstring; + exports.stringTrim = stringTrim; + exports.stringStartWith = stringStartWith; + exports.mathMin = mathMin; + exports.WINDIR = WINDIR; + exports.getFilesInPath = getFilesInPath; + exports.semverCompare = semverCompare; + exports.getAppleModel = getAppleModel; + exports.checkWebsite = checkWebsite; + exports.cleanString = cleanString; + exports.getPowershell = getPowershell; + } +}); + +// node_modules/systeminformation/lib/system.js +var require_system = __commonJS({ + "node_modules/systeminformation/lib/system.js"(exports) { + "use strict"; + var fs = require("fs"); + var os2 = require("os"); + var util = require_util2(); + var exec2 = require("child_process").exec; + var execSync = require("child_process").execSync; + var execPromise = util.promisify(require("child_process").exec); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + function system(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + manufacturer: "", + model: "Computer", + version: "", + serial: "-", + uuid: "-", + sku: "-", + virtual: false + }; + if (_linux || _freebsd || _openbsd || _netbsd) { + exec2("export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL", function(error, stdout) { + let lines = stdout.toString().split("\n"); + result2.manufacturer = cleanDefaults(util.getValue(lines, "manufacturer")); + result2.model = cleanDefaults(util.getValue(lines, "product name")); + result2.version = cleanDefaults(util.getValue(lines, "version")); + result2.serial = cleanDefaults(util.getValue(lines, "serial number")); + result2.uuid = cleanDefaults(util.getValue(lines, "uuid")).toLowerCase(); + result2.sku = cleanDefaults(util.getValue(lines, "sku number")); + const cmd = `echo -n "product_name: "; cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null; echo; + echo -n "product_serial: "; cat /sys/devices/virtual/dmi/id/product_serial 2>/dev/null; echo; + echo -n "product_uuid: "; cat /sys/devices/virtual/dmi/id/product_uuid 2>/dev/null; echo; + echo -n "product_version: "; cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null; echo; + echo -n "sys_vendor: "; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;`; + try { + lines = execSync(cmd, util.execOptsLinux).toString().split("\n"); + result2.manufacturer = cleanDefaults(result2.manufacturer === "" ? util.getValue(lines, "sys_vendor") : result2.manufacturer); + result2.model = cleanDefaults(result2.model === "" ? util.getValue(lines, "product_name") : result2.model); + result2.version = cleanDefaults(result2.version === "" ? util.getValue(lines, "product_version") : result2.version); + result2.serial = cleanDefaults(result2.serial === "" ? util.getValue(lines, "product_serial") : result2.serial); + result2.uuid = cleanDefaults(result2.uuid === "" ? util.getValue(lines, "product_uuid").toLowerCase() : result2.uuid); + } catch (e) { + util.noop(); + } + if (!result2.serial) { + result2.serial = "-"; + } + if (!result2.manufacturer) { + result2.manufacturer = ""; + } + if (!result2.model) { + result2.model = "Computer"; + } + if (!result2.version) { + result2.version = ""; + } + if (!result2.sku) { + result2.sku = "-"; + } + if (result2.model.toLowerCase() === "virtualbox" || result2.model.toLowerCase() === "kvm" || result2.model.toLowerCase() === "virtual machine" || result2.model.toLowerCase() === "bochs" || result2.model.toLowerCase().startsWith("vmware") || result2.model.toLowerCase().startsWith("droplet")) { + result2.virtual = true; + switch (result2.model.toLowerCase()) { + case "virtualbox": + result2.virtualHost = "VirtualBox"; + break; + case "vmware": + result2.virtualHost = "VMware"; + break; + case "kvm": + result2.virtualHost = "KVM"; + break; + case "bochs": + result2.virtualHost = "bochs"; + break; + } + } + if (result2.manufacturer.toLowerCase().startsWith("vmware") || result2.manufacturer.toLowerCase() === "xen") { + result2.virtual = true; + switch (result2.manufacturer.toLowerCase()) { + case "vmware": + result2.virtualHost = "VMware"; + break; + case "xen": + result2.virtualHost = "Xen"; + break; + } + } + if (!result2.virtual) { + try { + const disksById = execSync("ls -1 /dev/disk/by-id/ 2>/dev/null", util.execOptsLinux).toString(); + if (disksById.indexOf("_QEMU_") >= 0) { + result2.virtual = true; + result2.virtualHost = "QEMU"; + } + if (disksById.indexOf("_VBOX_") >= 0) { + result2.virtual = true; + result2.virtualHost = "VirtualBox"; + } + } catch (e) { + util.noop(); + } + } + if (!result2.virtual && (os2.release().toLowerCase().indexOf("microsoft") >= 0 || os2.release().toLowerCase().endsWith("wsl2"))) { + const kernelVersion = parseFloat(os2.release().toLowerCase()); + result2.virtual = true; + result2.manufacturer = "Microsoft"; + result2.model = "WSL"; + result2.version = kernelVersion < 4.19 ? "1" : "2"; + } + if ((_freebsd || _openbsd || _netbsd) && !result2.virtualHost) { + try { + const procInfo = execSync("dmidecode -t 4", util.execOptsLinux); + const procLines = procInfo.toString().split("\n"); + const procManufacturer = util.getValue(procLines, "manufacturer", ":", true); + switch (procManufacturer.toLowerCase()) { + case "virtualbox": + result2.virtualHost = "VirtualBox"; + break; + case "vmware": + result2.virtualHost = "VMware"; + break; + case "kvm": + result2.virtualHost = "KVM"; + break; + case "bochs": + result2.virtualHost = "bochs"; + break; + } + } catch (e) { + util.noop(); + } + } + if (fs.existsSync("/.dockerenv") || fs.existsSync("/.dockerinit")) { + result2.model = "Docker Container"; + } + try { + const stdout2 = execSync('dmesg 2>/dev/null | grep -iE "virtual|hypervisor" | grep -iE "vmware|qemu|kvm|xen" | grep -viE "Nested Virtualization|/virtual/"'); + let lines2 = stdout2.toString().split("\n"); + if (lines2.length > 0) { + if (result2.model === "Computer") { + result2.model = "Virtual machine"; + } + result2.virtual = true; + if (stdout2.toString().toLowerCase().indexOf("vmware") >= 0 && !result2.virtualHost) { + result2.virtualHost = "VMware"; + } + if (stdout2.toString().toLowerCase().indexOf("qemu") >= 0 && !result2.virtualHost) { + result2.virtualHost = "QEMU"; + } + if (stdout2.toString().toLowerCase().indexOf("xen") >= 0 && !result2.virtualHost) { + result2.virtualHost = "Xen"; + } + if (stdout2.toString().toLowerCase().indexOf("kvm") >= 0 && !result2.virtualHost) { + result2.virtualHost = "KVM"; + } + } + } catch (e) { + util.noop(); + } + if (result2.manufacturer === "" && result2.model === "Computer" && result2.version === "") { + fs.readFile("/proc/cpuinfo", function(error2, stdout2) { + if (!error2) { + let lines2 = stdout2.toString().split("\n"); + result2.model = util.getValue(lines2, "hardware", ":", true).toUpperCase(); + result2.version = util.getValue(lines2, "revision", ":", true).toLowerCase(); + result2.serial = util.getValue(lines2, "serial", ":", true); + const model = util.getValue(lines2, "model:", ":", true); + if (util.isRaspberry(lines2)) { + const rPIRevision = util.decodePiCpuinfo(lines2); + result2.model = rPIRevision.model; + result2.version = rPIRevision.revisionCode; + result2.manufacturer = "Raspberry Pi Foundation"; + result2.raspberry = { + manufacturer: rPIRevision.manufacturer, + processor: rPIRevision.processor, + type: rPIRevision.type, + revision: rPIRevision.revision + }; + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } + if (_darwin) { + exec2("ioreg -c IOPlatformExpertDevice -d 2", function(error, stdout) { + if (!error) { + let lines = stdout.toString().replace(/[<>"]/g, "").split("\n"); + const model = util.getAppleModel(util.getValue(lines, "model", "=", true)); + result2.manufacturer = util.getValue(lines, "manufacturer", "=", true); + result2.model = model.key; + result2.type = macOsChassisType(model.version); + result2.version = model.version; + result2.serial = util.getValue(lines, "ioplatformserialnumber", "=", true); + result2.uuid = util.getValue(lines, "ioplatformuuid", "=", true).toLowerCase(); + result2.sku = util.getValue(lines, "board-id", "=", true) || util.getValue(lines, "target-sub-type", "=", true); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos) { + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_windows) { + try { + util.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select Name,Vendor,Version,IdentifyingNumber,UUID | fl").then((stdout, error) => { + if (!error) { + let lines = stdout.split("\r\n"); + result2.manufacturer = util.getValue(lines, "vendor", ":"); + result2.model = util.getValue(lines, "name", ":"); + result2.version = util.getValue(lines, "version", ":"); + result2.serial = util.getValue(lines, "identifyingnumber", ":"); + result2.uuid = util.getValue(lines, "uuid", ":").toLowerCase(); + const model = result2.model.toLowerCase(); + if (model === "virtualbox" || model === "kvm" || model === "virtual machine" || model === "bochs" || model.startsWith("vmware") || model.startsWith("qemu") || model.startsWith("parallels")) { + result2.virtual = true; + if (model.startsWith("virtualbox")) { + result2.virtualHost = "VirtualBox"; + } + if (model.startsWith("vmware")) { + result2.virtualHost = "VMware"; + } + if (model.startsWith("kvm")) { + result2.virtualHost = "KVM"; + } + if (model.startsWith("bochs")) { + result2.virtualHost = "bochs"; + } + if (model.startsWith("qemu")) { + result2.virtualHost = "KVM"; + } + if (model.startsWith("parallels")) { + result2.virtualHost = "Parallels"; + } + } + const manufacturer = result2.manufacturer.toLowerCase(); + if (manufacturer.startsWith("vmware") || manufacturer.startsWith("qemu") || manufacturer === "xen" || manufacturer.startsWith("parallels")) { + result2.virtual = true; + if (manufacturer.startsWith("vmware")) { + result2.virtualHost = "VMware"; + } + if (manufacturer.startsWith("xen")) { + result2.virtualHost = "Xen"; + } + if (manufacturer.startsWith("qemu")) { + result2.virtualHost = "KVM"; + } + if (manufacturer.startsWith("parallels")) { + result2.virtualHost = "Parallels"; + } + } + util.powerShell('Get-CimInstance MS_Systeminformation -Namespace "root/wmi" | select systemsku | fl ').then((stdout2, error2) => { + if (!error2) { + let lines2 = stdout2.split("\r\n"); + result2.sku = util.getValue(lines2, "systemsku", ":"); + } + if (!result2.virtual) { + util.powerShell("Get-CimInstance Win32_bios | select Version, SerialNumber, SMBIOSBIOSVersion").then((stdout3, error3) => { + if (!error3) { + let lines2 = stdout3.toString(); + if (lines2.indexOf("VRTUAL") >= 0 || lines2.indexOf("A M I ") >= 0 || lines2.indexOf("VirtualBox") >= 0 || lines2.indexOf("VMWare") >= 0 || lines2.indexOf("Xen") >= 0 || lines2.indexOf("Parallels") >= 0) { + result2.virtual = true; + if (lines2.indexOf("VirtualBox") >= 0 && !result2.virtualHost) { + result2.virtualHost = "VirtualBox"; + } + if (lines2.indexOf("VMware") >= 0 && !result2.virtualHost) { + result2.virtualHost = "VMware"; + } + if (lines2.indexOf("Xen") >= 0 && !result2.virtualHost) { + result2.virtualHost = "Xen"; + } + if (lines2.indexOf("VRTUAL") >= 0 && !result2.virtualHost) { + result2.virtualHost = "Hyper-V"; + } + if (lines2.indexOf("A M I") >= 0 && !result2.virtualHost) { + result2.virtualHost = "Virtual PC"; + } + if (lines2.indexOf("Parallels") >= 0 && !result2.virtualHost) { + result2.virtualHost = "Parallels"; + } + } + if (callback) { + callback(result2); + } + resolve(result2); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + exports.system = system; + function cleanDefaults(s) { + const cmpStr = s.toLowerCase(); + if (cmpStr.indexOf("o.e.m.") === -1 && cmpStr.indexOf("default string") === -1 && cmpStr !== "default") { + return s || ""; + } + return ""; + } + function bios(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + vendor: "", + version: "", + releaseDate: "", + revision: "" + }; + let cmd = ""; + if (_linux || _freebsd || _openbsd || _netbsd) { + if (process.arch === "arm") { + cmd = "cat /proc/cpuinfo | grep Serial"; + } else { + cmd = "export LC_ALL=C; dmidecode -t bios 2>/dev/null; unset LC_ALL"; + } + exec2(cmd, function(error, stdout) { + let lines = stdout.toString().split("\n"); + result2.vendor = util.getValue(lines, "Vendor"); + result2.version = util.getValue(lines, "Version"); + let datetime = util.getValue(lines, "Release Date"); + result2.releaseDate = util.parseDateTime(datetime).date; + result2.revision = util.getValue(lines, "BIOS Revision"); + result2.serial = util.getValue(lines, "SerialNumber"); + let language = util.getValue(lines, "Currently Installed Language").split("|")[0]; + if (language) { + result2.language = language; + } + if (lines.length && stdout.toString().indexOf("Characteristics:") >= 0) { + const features = []; + lines.forEach((line) => { + if (line.indexOf(" is supported") >= 0) { + const feature = line.split(" is supported")[0].trim(); + features.push(feature); + } + }); + result2.features = features; + } + const cmd2 = `echo -n "bios_date: "; cat /sys/devices/virtual/dmi/id/bios_date 2>/dev/null; echo; + echo -n "bios_vendor: "; cat /sys/devices/virtual/dmi/id/bios_vendor 2>/dev/null; echo; + echo -n "bios_version: "; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;`; + try { + lines = execSync(cmd2, util.execOptsLinux).toString().split("\n"); + result2.vendor = !result2.vendor ? util.getValue(lines, "bios_vendor") : result2.vendor; + result2.version = !result2.version ? util.getValue(lines, "bios_version") : result2.version; + datetime = util.getValue(lines, "bios_date"); + result2.releaseDate = !result2.releaseDate ? util.parseDateTime(datetime).date : result2.releaseDate; + } catch (e) { + util.noop(); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_darwin) { + result2.vendor = "Apple Inc."; + exec2( + "system_profiler SPHardwareDataType -json", + function(error, stdout) { + try { + const hardwareData = JSON.parse(stdout.toString()); + if (hardwareData && hardwareData.SPHardwareDataType && hardwareData.SPHardwareDataType.length) { + let bootRomVersion = hardwareData.SPHardwareDataType[0].boot_rom_version; + bootRomVersion = bootRomVersion ? bootRomVersion.split("(")[0].trim() : null; + result2.version = bootRomVersion; + } + } catch (e) { + util.noop(); + } + if (callback) { + callback(result2); + } + resolve(result2); + } + ); + } + if (_sunos) { + result2.vendor = "Sun Microsystems"; + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_windows) { + try { + util.powerShell('Get-CimInstance Win32_bios | select Description,Version,Manufacturer,@{n="ReleaseDate";e={$_.ReleaseDate.ToString("yyyy-MM-dd")}},BuildNumber,SerialNumber,SMBIOSBIOSVersion | fl').then((stdout, error) => { + if (!error) { + let lines = stdout.toString().split("\r\n"); + const description = util.getValue(lines, "description", ":"); + const version = util.getValue(lines, "SMBIOSBIOSVersion", ":"); + if (description.indexOf(" Version ") !== -1) { + result2.vendor = description.split(" Version ")[0].trim(); + result2.version = description.split(" Version ")[1].trim(); + } else if (description.indexOf(" Ver: ") !== -1) { + result2.vendor = util.getValue(lines, "manufacturer", ":"); + result2.version = description.split(" Ver: ")[1].trim(); + } else { + result2.vendor = util.getValue(lines, "manufacturer", ":"); + result2.version = version || util.getValue(lines, "version", ":"); + } + result2.releaseDate = util.getValue(lines, "releasedate", ":"); + result2.revision = util.getValue(lines, "buildnumber", ":"); + result2.serial = cleanDefaults(util.getValue(lines, "serialnumber", ":")); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + exports.bios = bios; + function baseboard(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + manufacturer: "", + model: "", + version: "", + serial: "-", + assetTag: "-", + memMax: null, + memSlots: null + }; + let cmd = ""; + if (_linux || _freebsd || _openbsd || _netbsd) { + if (process.arch === "arm") { + cmd = "cat /proc/cpuinfo | grep Serial"; + } else { + cmd = "export LC_ALL=C; dmidecode -t 2 2>/dev/null; unset LC_ALL"; + } + const workload = []; + workload.push(execPromise(cmd)); + workload.push(execPromise("export LC_ALL=C; dmidecode -t memory 2>/dev/null")); + util.promiseAll( + workload + ).then((data) => { + let lines = data.results[0] ? data.results[0].toString().split("\n") : [""]; + result2.manufacturer = cleanDefaults(util.getValue(lines, "Manufacturer")); + result2.model = cleanDefaults(util.getValue(lines, "Product Name")); + result2.version = cleanDefaults(util.getValue(lines, "Version")); + result2.serial = cleanDefaults(util.getValue(lines, "Serial Number")); + result2.assetTag = cleanDefaults(util.getValue(lines, "Asset Tag")); + const cmd2 = `echo -n "board_asset_tag: "; cat /sys/devices/virtual/dmi/id/board_asset_tag 2>/dev/null; echo; + echo -n "board_name: "; cat /sys/devices/virtual/dmi/id/board_name 2>/dev/null; echo; + echo -n "board_serial: "; cat /sys/devices/virtual/dmi/id/board_serial 2>/dev/null; echo; + echo -n "board_vendor: "; cat /sys/devices/virtual/dmi/id/board_vendor 2>/dev/null; echo; + echo -n "board_version: "; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;`; + try { + lines = execSync(cmd2, util.execOptsLinux).toString().split("\n"); + result2.manufacturer = cleanDefaults(!result2.manufacturer ? util.getValue(lines, "board_vendor") : result2.manufacturer); + result2.model = cleanDefaults(!result2.model ? util.getValue(lines, "board_name") : result2.model); + result2.version = cleanDefaults(!result2.version ? util.getValue(lines, "board_version") : result2.version); + result2.serial = cleanDefaults(!result2.serial ? util.getValue(lines, "board_serial") : result2.serial); + result2.assetTag = cleanDefaults(!result2.assetTag ? util.getValue(lines, "board_asset_tag") : result2.assetTag); + } catch (e) { + util.noop(); + } + lines = data.results[1] ? data.results[1].toString().split("\n") : [""]; + result2.memMax = util.toInt(util.getValue(lines, "Maximum Capacity")) * 1024 * 1024 * 1024 || null; + result2.memSlots = util.toInt(util.getValue(lines, "Number Of Devices")) || null; + if (util.isRaspberry()) { + const rpi = util.decodePiCpuinfo(); + result2.manufacturer = rpi.manufacturer; + result2.model = "Raspberry Pi"; + result2.serial = rpi.serial; + result2.version = rpi.type + " - " + rpi.revision; + result2.memMax = os2.totalmem(); + result2.memSlots = 0; + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_darwin) { + const workload = []; + workload.push(execPromise("ioreg -c IOPlatformExpertDevice -d 2")); + workload.push(execPromise("system_profiler SPMemoryDataType")); + util.promiseAll( + workload + ).then((data) => { + let lines = data.results[0] ? data.results[0].toString().replace(/[<>"]/g, "").split("\n") : [""]; + result2.manufacturer = util.getValue(lines, "manufacturer", "=", true); + result2.model = util.getValue(lines, "model", "=", true); + result2.version = util.getValue(lines, "version", "=", true); + result2.serial = util.getValue(lines, "ioplatformserialnumber", "=", true); + result2.assetTag = util.getValue(lines, "board-id", "=", true); + let devices = data.results[1] ? data.results[1].toString().split(" BANK ") : [""]; + if (devices.length === 1) { + devices = data.results[1] ? data.results[1].toString().split(" DIMM") : [""]; + } + devices.shift(); + result2.memSlots = devices.length; + if (os2.arch() === "arm64") { + result2.memSlots = 0; + result2.memMax = os2.totalmem(); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos) { + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_windows) { + try { + const workload = []; + const win10plus = parseInt(os2.release()) >= 10; + const maxCapacityAttribute = win10plus ? "MaxCapacityEx" : "MaxCapacity"; + workload.push(util.powerShell("Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl")); + workload.push(util.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${maxCapacityAttribute}, MemoryDevices | fl`)); + util.promiseAll( + workload + ).then((data) => { + let lines = data.results[0] ? data.results[0].toString().split("\r\n") : [""]; + result2.manufacturer = cleanDefaults(util.getValue(lines, "manufacturer", ":")); + result2.model = cleanDefaults(util.getValue(lines, "model", ":")); + if (!result2.model) { + result2.model = cleanDefaults(util.getValue(lines, "product", ":")); + } + result2.version = cleanDefaults(util.getValue(lines, "version", ":")); + result2.serial = cleanDefaults(util.getValue(lines, "serialnumber", ":")); + result2.assetTag = cleanDefaults(util.getValue(lines, "partnumber", ":")); + if (!result2.assetTag) { + result2.assetTag = cleanDefaults(util.getValue(lines, "sku", ":")); + } + lines = data.results[1] ? data.results[1].toString().split("\r\n") : [""]; + result2.memMax = util.toInt(util.getValue(lines, maxCapacityAttribute, ":")) * (win10plus ? 1024 : 1) || null; + result2.memSlots = util.toInt(util.getValue(lines, "MemoryDevices", ":")) || null; + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + exports.baseboard = baseboard; + function macOsChassisType(model) { + model = model.toLowerCase(); + if (model.indexOf("macbookair") >= 0 || model.indexOf("macbook air") >= 0) { + return "Notebook"; + } + if (model.indexOf("macbookpro") >= 0 || model.indexOf("macbook pro") >= 0) { + return "Notebook"; + } + if (model.indexOf("macbook") >= 0) { + return "Notebook"; + } + if (model.indexOf("macmini") >= 0 || model.indexOf("mac mini") >= 0) { + return "Desktop"; + } + if (model.indexOf("imac") >= 0) { + return "Desktop"; + } + if (model.indexOf("macstudio") >= 0 || model.indexOf("mac studio") >= 0) { + return "Desktop"; + } + if (model.indexOf("macpro") >= 0 || model.indexOf("mac pro") >= 0) { + return "Tower"; + } + return "Other"; + } + function chassis(callback) { + const chassisTypes = [ + "Other", + "Unknown", + "Desktop", + "Low Profile Desktop", + "Pizza Box", + "Mini Tower", + "Tower", + "Portable", + "Laptop", + "Notebook", + "Hand Held", + "Docking Station", + "All in One", + "Sub Notebook", + "Space-Saving", + "Lunch Box", + "Main System Chassis", + "Expansion Chassis", + "SubChassis", + "Bus Expansion Chassis", + "Peripheral Chassis", + "Storage Chassis", + "Rack Mount Chassis", + "Sealed-Case PC", + "Multi-System Chassis", + "Compact PCI", + "Advanced TCA", + "Blade", + "Blade Enclosure", + "Tablet", + "Convertible", + "Detachable", + "IoT Gateway ", + "Embedded PC", + "Mini PC", + "Stick PC" + ]; + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + manufacturer: "", + model: "", + type: "", + version: "", + serial: "-", + assetTag: "-", + sku: "" + }; + if (_linux || _freebsd || _openbsd || _netbsd) { + const cmd = `echo -n "chassis_asset_tag: "; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo; + echo -n "chassis_serial: "; cat /sys/devices/virtual/dmi/id/chassis_serial 2>/dev/null; echo; + echo -n "chassis_type: "; cat /sys/devices/virtual/dmi/id/chassis_type 2>/dev/null; echo; + echo -n "chassis_vendor: "; cat /sys/devices/virtual/dmi/id/chassis_vendor 2>/dev/null; echo; + echo -n "chassis_version: "; cat /sys/devices/virtual/dmi/id/chassis_version 2>/dev/null; echo;`; + exec2(cmd, function(error, stdout) { + let lines = stdout.toString().split("\n"); + result2.manufacturer = cleanDefaults(util.getValue(lines, "chassis_vendor")); + const ctype = parseInt(util.getValue(lines, "chassis_type").replace(/\D/g, "")); + result2.type = cleanDefaults(ctype && !isNaN(ctype) && ctype < chassisTypes.length ? chassisTypes[ctype - 1] : ""); + result2.version = cleanDefaults(util.getValue(lines, "chassis_version")); + result2.serial = cleanDefaults(util.getValue(lines, "chassis_serial")); + result2.assetTag = cleanDefaults(util.getValue(lines, "chassis_asset_tag")); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_darwin) { + exec2("ioreg -c IOPlatformExpertDevice -d 2", function(error, stdout) { + if (!error) { + let lines = stdout.toString().replace(/[<>"]/g, "").split("\n"); + const model = util.getAppleModel(util.getValue(lines, "model", "=", true)); + result2.manufacturer = util.getValue(lines, "manufacturer", "=", true); + result2.model = model.key; + result2.type = macOsChassisType(model.model); + result2.version = model.version; + result2.serial = util.getValue(lines, "ioplatformserialnumber", "=", true); + result2.assetTag = util.getValue(lines, "board-id", "=", true) || util.getValue(lines, "target-type", "=", true); + result2.sku = util.getValue(lines, "target-sub-type", "=", true); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos) { + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_windows) { + try { + util.powerShell("Get-CimInstance Win32_SystemEnclosure | select Model,Manufacturer,ChassisTypes,Version,SerialNumber,PartNumber,SKU,SMBIOSAssetTag | fl").then((stdout, error) => { + if (!error) { + let lines = stdout.toString().split("\r\n"); + result2.manufacturer = cleanDefaults(util.getValue(lines, "manufacturer", ":")); + result2.model = cleanDefaults(util.getValue(lines, "model", ":")); + const ctype = parseInt(util.getValue(lines, "ChassisTypes", ":").replace(/\D/g, "")); + result2.type = ctype && !isNaN(ctype) && ctype < chassisTypes.length ? chassisTypes[ctype - 1] : ""; + result2.version = cleanDefaults(util.getValue(lines, "version", ":")); + result2.serial = cleanDefaults(util.getValue(lines, "serialnumber", ":")); + result2.assetTag = cleanDefaults(util.getValue(lines, "partnumber", ":")); + if (!result2.assetTag) { + result2.assetTag = cleanDefaults(util.getValue(lines, "SMBIOSAssetTag", ":")); + } + result2.sku = cleanDefaults(util.getValue(lines, "sku", ":")); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + exports.chassis = chassis; + } +}); + +// node_modules/systeminformation/lib/osinfo.js +var require_osinfo = __commonJS({ + "node_modules/systeminformation/lib/osinfo.js"(exports) { + "use strict"; + var os2 = require("os"); + var fs = require("fs"); + var util = require_util2(); + var exec2 = require("child_process").exec; + var execSync = require("child_process").execSync; + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + function time() { + let t = new Date().toString().split(" "); + const result2 = { + current: Date.now(), + uptime: os2.uptime(), + timezone: t.length >= 7 ? t[5] : "", + timezoneName: Intl ? Intl.DateTimeFormat().resolvedOptions().timeZone : t.length >= 7 ? t.slice(6).join(" ").replace(/\(/g, "").replace(/\)/g, "") : "" + }; + if (_darwin || _linux) { + try { + const stdout = execSync("date +%Z && date +%z && ls -l /etc/localtime 2>/dev/null", util.execOptsLinux); + const lines = stdout.toString().split(os2.EOL); + if (lines.length > 3 && !lines[0]) { + lines.shift(); + } + let timezone = lines[0] || ""; + if (timezone.startsWith("+") || timezone.startsWith("-")) { + timezone = "GMT"; + } + return { + current: Date.now(), + uptime: os2.uptime(), + timezone: lines[1] ? timezone + lines[1] : timezone, + timezoneName: lines[2] && lines[2].indexOf("/zoneinfo/") > 0 ? lines[2].split("/zoneinfo/")[1] || "" : "" + }; + } catch (e) { + util.noop(); + } + } + return result2; + } + exports.time = time; + function getLogoFile(distro) { + distro = distro || ""; + distro = distro.toLowerCase(); + let result2 = _platform; + if (_windows) { + result2 = "windows"; + } else if (distro.indexOf("mac os") !== -1 || distro.indexOf("macos") !== -1) { + result2 = "apple"; + } else if (distro.indexOf("arch") !== -1) { + result2 = "arch"; + } else if (distro.indexOf("cachy") !== -1) { + result2 = "cachy"; + } else if (distro.indexOf("centos") !== -1) { + result2 = "centos"; + } else if (distro.indexOf("coreos") !== -1) { + result2 = "coreos"; + } else if (distro.indexOf("debian") !== -1) { + result2 = "debian"; + } else if (distro.indexOf("deepin") !== -1) { + result2 = "deepin"; + } else if (distro.indexOf("elementary") !== -1) { + result2 = "elementary"; + } else if (distro.indexOf("endeavour") !== -1) { + result2 = "endeavour"; + } else if (distro.indexOf("fedora") !== -1) { + result2 = "fedora"; + } else if (distro.indexOf("gentoo") !== -1) { + result2 = "gentoo"; + } else if (distro.indexOf("mageia") !== -1) { + result2 = "mageia"; + } else if (distro.indexOf("mandriva") !== -1) { + result2 = "mandriva"; + } else if (distro.indexOf("manjaro") !== -1) { + result2 = "manjaro"; + } else if (distro.indexOf("mint") !== -1) { + result2 = "mint"; + } else if (distro.indexOf("mx") !== -1) { + result2 = "mx"; + } else if (distro.indexOf("openbsd") !== -1) { + result2 = "openbsd"; + } else if (distro.indexOf("freebsd") !== -1) { + result2 = "freebsd"; + } else if (distro.indexOf("opensuse") !== -1) { + result2 = "opensuse"; + } else if (distro.indexOf("pclinuxos") !== -1) { + result2 = "pclinuxos"; + } else if (distro.indexOf("puppy") !== -1) { + result2 = "puppy"; + } else if (distro.indexOf("popos") !== -1) { + result2 = "popos"; + } else if (distro.indexOf("raspbian") !== -1) { + result2 = "raspbian"; + } else if (distro.indexOf("reactos") !== -1) { + result2 = "reactos"; + } else if (distro.indexOf("redhat") !== -1) { + result2 = "redhat"; + } else if (distro.indexOf("slackware") !== -1) { + result2 = "slackware"; + } else if (distro.indexOf("sugar") !== -1) { + result2 = "sugar"; + } else if (distro.indexOf("steam") !== -1) { + result2 = "steam"; + } else if (distro.indexOf("suse") !== -1) { + result2 = "suse"; + } else if (distro.indexOf("mate") !== -1) { + result2 = "ubuntu-mate"; + } else if (distro.indexOf("lubuntu") !== -1) { + result2 = "lubuntu"; + } else if (distro.indexOf("xubuntu") !== -1) { + result2 = "xubuntu"; + } else if (distro.indexOf("ubuntu") !== -1) { + result2 = "ubuntu"; + } else if (distro.indexOf("solaris") !== -1) { + result2 = "solaris"; + } else if (distro.indexOf("tails") !== -1) { + result2 = "tails"; + } else if (distro.indexOf("feren") !== -1) { + result2 = "ferenos"; + } else if (distro.indexOf("robolinux") !== -1) { + result2 = "robolinux"; + } else if (_linux && distro) { + result2 = distro.toLowerCase().trim().replace(/\s+/g, "-"); + } + return result2; + } + function getFQDN() { + let fqdn = os2.hostname; + if (_linux || _darwin) { + try { + const stdout = execSync("hostname -f 2>/dev/null", util.execOptsLinux); + fqdn = stdout.toString().split(os2.EOL)[0]; + } catch (e) { + util.noop(); + } + } + if (_freebsd || _openbsd || _netbsd) { + try { + const stdout = execSync("hostname 2>/dev/null"); + fqdn = stdout.toString().split(os2.EOL)[0]; + } catch (e) { + util.noop(); + } + } + if (_windows) { + try { + const stdout = execSync("echo %COMPUTERNAME%.%USERDNSDOMAIN%", util.execOptsWin); + fqdn = stdout.toString().replace(".%USERDNSDOMAIN%", "").split(os2.EOL)[0]; + } catch (e) { + util.noop(); + } + } + return fqdn; + } + function osInfo(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + platform: _platform === "win32" ? "Windows" : _platform, + distro: "unknown", + release: "unknown", + codename: "", + kernel: os2.release(), + arch: os2.arch(), + hostname: os2.hostname(), + fqdn: getFQDN(), + codepage: "", + logofile: "", + serial: "", + build: "", + servicepack: "", + uefi: false + }; + if (_linux) { + exec2("cat /etc/*-release; cat /usr/lib/os-release; cat /etc/openwrt_release", function(error, stdout) { + let release = {}; + let lines = stdout.toString().split("\n"); + lines.forEach(function(line) { + if (line.indexOf("=") !== -1) { + release[line.split("=")[0].trim().toUpperCase()] = line.split("=")[1].trim(); + } + }); + result2.distro = (release.DISTRIB_ID || release.NAME || "unknown").replace(/"/g, ""); + result2.logofile = getLogoFile(result2.distro); + let releaseVersion = (release.VERSION || "").replace(/"/g, ""); + let codename = (release.DISTRIB_CODENAME || release.VERSION_CODENAME || "").replace(/"/g, ""); + const prettyName = (release.PRETTY_NAME || "").replace(/"/g, ""); + if (prettyName.indexOf(result2.distro + " ") === 0) { + releaseVersion = prettyName.replace(result2.distro + " ", "").trim(); + } + if (releaseVersion.indexOf("(") >= 0) { + codename = releaseVersion.split("(")[1].replace(/[()]/g, "").trim(); + releaseVersion = releaseVersion.split("(")[0].trim(); + } + result2.release = (releaseVersion || release.DISTRIB_RELEASE || release.VERSION_ID || "unknown").replace(/"/g, ""); + result2.codename = codename; + result2.codepage = util.getCodepage(); + result2.build = (release.BUILD_ID || "").replace(/"/g, "").trim(); + isUefiLinux().then((uefi) => { + result2.uefi = uefi; + uuid().then((data) => { + result2.serial = data.os; + if (callback) { + callback(result2); + } + resolve(result2); + }); + }); + }); + } + if (_freebsd || _openbsd || _netbsd) { + exec2("sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod kern.geom.confxml", function(error, stdout) { + let lines = stdout.toString().split("\n"); + const distro = util.getValue(lines, "kern.ostype"); + const logofile = getLogoFile(distro); + const release = util.getValue(lines, "kern.osrelease").split("-")[0]; + const serial = util.getValue(lines, "kern.uuid"); + const bootmethod = util.getValue(lines, "machdep.bootmethod"); + const uefiConf = stdout.toString().indexOf("efi") >= 0; + const uefi = bootmethod ? bootmethod.toLowerCase().indexOf("uefi") >= 0 : uefiConf ? uefiConf : null; + result2.distro = distro || result2.distro; + result2.logofile = logofile || result2.logofile; + result2.release = release || result2.release; + result2.serial = serial || result2.serial; + result2.codename = ""; + result2.codepage = util.getCodepage(); + result2.uefi = uefi || null; + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_darwin) { + exec2("sw_vers; sysctl kern.ostype kern.osrelease kern.osrevision kern.uuid", function(error, stdout) { + let lines = stdout.toString().split("\n"); + result2.serial = util.getValue(lines, "kern.uuid"); + result2.distro = util.getValue(lines, "ProductName"); + result2.release = (util.getValue(lines, "ProductVersion", ":", true, true) + " " + util.getValue(lines, "ProductVersionExtra", ":", true, true)).trim(); + result2.build = util.getValue(lines, "BuildVersion"); + result2.logofile = getLogoFile(result2.distro); + result2.codename = "macOS"; + result2.codename = result2.release.indexOf("10.4") > -1 ? "OS X Tiger" : result2.codename; + result2.codename = result2.release.indexOf("10.5") > -1 ? "OS X Leopard" : result2.codename; + result2.codename = result2.release.indexOf("10.6") > -1 ? "OS X Snow Leopard" : result2.codename; + result2.codename = result2.release.indexOf("10.7") > -1 ? "OS X Lion" : result2.codename; + result2.codename = result2.release.indexOf("10.8") > -1 ? "OS X Mountain Lion" : result2.codename; + result2.codename = result2.release.indexOf("10.9") > -1 ? "OS X Mavericks" : result2.codename; + result2.codename = result2.release.indexOf("10.10") > -1 ? "OS X Yosemite" : result2.codename; + result2.codename = result2.release.indexOf("10.11") > -1 ? "OS X El Capitan" : result2.codename; + result2.codename = result2.release.indexOf("10.12") > -1 ? "Sierra" : result2.codename; + result2.codename = result2.release.indexOf("10.13") > -1 ? "High Sierra" : result2.codename; + result2.codename = result2.release.indexOf("10.14") > -1 ? "Mojave" : result2.codename; + result2.codename = result2.release.indexOf("10.15") > -1 ? "Catalina" : result2.codename; + result2.codename = result2.release.startsWith("11.") ? "Big Sur" : result2.codename; + result2.codename = result2.release.startsWith("12.") ? "Monterey" : result2.codename; + result2.codename = result2.release.startsWith("13.") ? "Ventura" : result2.codename; + result2.codename = result2.release.startsWith("14.") ? "Sonoma" : result2.codename; + result2.codename = result2.release.startsWith("15.") ? "Sequoia" : result2.codename; + result2.uefi = true; + result2.codepage = util.getCodepage(); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos) { + result2.release = result2.kernel; + exec2("uname -o", function(error, stdout) { + let lines = stdout.toString().split("\n"); + result2.distro = lines[0]; + result2.logofile = getLogoFile(result2.distro); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_windows) { + result2.logofile = getLogoFile(); + result2.release = result2.kernel; + try { + const workload = []; + workload.push(util.powerShell("Get-CimInstance Win32_OperatingSystem | select Caption,SerialNumber,BuildNumber,ServicePackMajorVersion,ServicePackMinorVersion | fl")); + workload.push(util.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")); + workload.push(util.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession")); + util.promiseAll( + workload + ).then((data) => { + let lines = data.results[0] ? data.results[0].toString().split("\r\n") : [""]; + result2.distro = util.getValue(lines, "Caption", ":").trim(); + result2.serial = util.getValue(lines, "SerialNumber", ":").trim(); + result2.build = util.getValue(lines, "BuildNumber", ":").trim(); + result2.servicepack = util.getValue(lines, "ServicePackMajorVersion", ":").trim() + "." + util.getValue(lines, "ServicePackMinorVersion", ":").trim(); + result2.codepage = util.getCodepage(); + const hyperv = data.results[1] ? data.results[1].toString().toLowerCase() : ""; + result2.hypervisor = hyperv.indexOf("true") !== -1; + const term = data.results[2] ? data.results[2].toString() : ""; + result2.remoteSession = term.toString().toLowerCase().indexOf("true") >= 0; + isUefiWindows().then((uefi) => { + result2.uefi = uefi; + if (callback) { + callback(result2); + } + resolve(result2); + }); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + exports.osInfo = osInfo; + function isUefiLinux() { + return new Promise((resolve) => { + process.nextTick(() => { + fs.stat("/sys/firmware/efi", function(err) { + if (!err) { + return resolve(true); + } else { + exec2('dmesg | grep -E "EFI v"', function(error, stdout) { + if (!error) { + const lines = stdout.toString().split("\n"); + return resolve(lines.length > 0); + } + return resolve(false); + }); + } + }); + }); + }); + } + function isUefiWindows() { + return new Promise((resolve) => { + process.nextTick(() => { + try { + exec2('findstr /C:"Detected boot environment" "%windir%\\Panther\\setupact.log"', util.execOptsWin, function(error, stdout) { + if (!error) { + const line = stdout.toString().split("\n\r")[0]; + return resolve(line.toLowerCase().indexOf("efi") >= 0); + } else { + exec2("echo %firmware_type%", util.execOptsWin, function(error2, stdout2) { + if (!error2) { + const line = stdout2.toString() || ""; + return resolve(line.toLowerCase().indexOf("efi") >= 0); + } else { + return resolve(false); + } + }); + } + }); + } catch (e) { + return resolve(false); + } + }); + }); + } + function versions(apps, callback) { + let versionObject = { + kernel: os2.release(), + apache: "", + bash: "", + bun: "", + deno: "", + docker: "", + dotnet: "", + fish: "", + gcc: "", + git: "", + grunt: "", + gulp: "", + homebrew: "", + java: "", + mongodb: "", + mysql: "", + nginx: "", + node: "", + //process.versions.node, + npm: "", + openssl: "", + perl: "", + php: "", + pip3: "", + pip: "", + pm2: "", + postfix: "", + postgresql: "", + powershell: "", + python3: "", + python: "", + redis: "", + systemOpenssl: "", + systemOpensslLib: "", + tsc: "", + v8: process.versions.v8, + virtualbox: "", + yarn: "", + zsh: "" + }; + function checkVersionParam(apps2) { + if (apps2 === "*") { + return { + versions: versionObject, + counter: 34 + }; + } + if (!Array.isArray(apps2)) { + apps2 = apps2.trim().toLowerCase().replace(/,+/g, "|").replace(/ /g, "|"); + apps2 = apps2.split("|"); + const result2 = { + versions: {}, + counter: 0 + }; + apps2.forEach((el) => { + if (el) { + for (let key in versionObject) { + if ({}.hasOwnProperty.call(versionObject, key)) { + if (key.toLowerCase() === el.toLowerCase() && !{}.hasOwnProperty.call(result2.versions, key)) { + result2.versions[key] = versionObject[key]; + if (key === "openssl") { + result2.versions.systemOpenssl = ""; + result2.versions.systemOpensslLib = ""; + } + if (!result2.versions[key]) { + result2.counter++; + } + } + } + } + } + }); + return result2; + } + } + return new Promise((resolve) => { + process.nextTick(() => { + if (util.isFunction(apps) && !callback) { + callback = apps; + apps = "*"; + } else { + apps = apps || "*"; + if (typeof apps !== "string") { + if (callback) { + callback({}); + } + return resolve({}); + } + } + const appsObj = checkVersionParam(apps); + let totalFunctions = appsObj.counter; + let functionProcessed = function() { + return function() { + if (--totalFunctions === 0) { + if (callback) { + callback(appsObj.versions); + } + resolve(appsObj.versions); + } + }; + }(); + let cmd = ""; + try { + if ({}.hasOwnProperty.call(appsObj.versions, "openssl")) { + appsObj.versions.openssl = process.versions.openssl; + exec2("openssl version", function(error, stdout) { + if (!error) { + let openssl_string = stdout.toString().split("\n")[0].trim(); + let openssl = openssl_string.split(" "); + appsObj.versions.systemOpenssl = openssl.length > 0 ? openssl[1] : openssl[0]; + appsObj.versions.systemOpensslLib = openssl.length > 0 ? openssl[0] : "openssl"; + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "npm")) { + exec2("npm -v", function(error, stdout) { + if (!error) { + appsObj.versions.npm = stdout.toString().split("\n")[0]; + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "pm2")) { + cmd = "pm2"; + if (_windows) { + cmd += ".cmd"; + } + exec2(`${cmd} -v`, function(error, stdout) { + if (!error) { + let pm2 = stdout.toString().split("\n")[0].trim(); + if (!pm2.startsWith("[PM2]")) { + appsObj.versions.pm2 = pm2; + } + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "yarn")) { + exec2("yarn --version", function(error, stdout) { + if (!error) { + appsObj.versions.yarn = stdout.toString().split("\n")[0]; + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "gulp")) { + cmd = "gulp"; + if (_windows) { + cmd += ".cmd"; + } + exec2(`${cmd} --version`, function(error, stdout) { + if (!error) { + const gulp = stdout.toString().split("\n")[0] || ""; + appsObj.versions.gulp = (gulp.toLowerCase().split("version")[1] || "").trim(); + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "homebrew")) { + cmd = "brew"; + exec2(`${cmd} --version`, function(error, stdout) { + if (!error) { + const brew = stdout.toString().split("\n")[0] || ""; + appsObj.versions.homebrew = (brew.toLowerCase().split(" ")[1] || "").trim(); + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "tsc")) { + cmd = "tsc"; + if (_windows) { + cmd += ".cmd"; + } + exec2(`${cmd} --version`, function(error, stdout) { + if (!error) { + const tsc = stdout.toString().split("\n")[0] || ""; + appsObj.versions.tsc = (tsc.toLowerCase().split("version")[1] || "").trim(); + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "grunt")) { + cmd = "grunt"; + if (_windows) { + cmd += ".cmd"; + } + exec2(`${cmd} --version`, function(error, stdout) { + if (!error) { + const grunt = stdout.toString().split("\n")[0] || ""; + appsObj.versions.grunt = (grunt.toLowerCase().split("cli v")[1] || "").trim(); + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "git")) { + if (_darwin) { + const gitHomebrewExists = fs.existsSync("/usr/local/Cellar/git") || fs.existsSync("/opt/homebrew/bin/git"); + if (util.darwinXcodeExists() || gitHomebrewExists) { + exec2("git --version", function(error, stdout) { + if (!error) { + let git = stdout.toString().split("\n")[0] || ""; + git = (git.toLowerCase().split("version")[1] || "").trim(); + appsObj.versions.git = (git.split(" ")[0] || "").trim(); + } + functionProcessed(); + }); + } else { + functionProcessed(); + } + } else { + exec2("git --version", function(error, stdout) { + if (!error) { + let git = stdout.toString().split("\n")[0] || ""; + git = (git.toLowerCase().split("version")[1] || "").trim(); + appsObj.versions.git = (git.split(" ")[0] || "").trim(); + } + functionProcessed(); + }); + } + } + if ({}.hasOwnProperty.call(appsObj.versions, "apache")) { + exec2("apachectl -v 2>&1", function(error, stdout) { + if (!error) { + const apache = (stdout.toString().split("\n")[0] || "").split(":"); + appsObj.versions.apache = apache.length > 1 ? apache[1].replace("Apache", "").replace("/", "").split("(")[0].trim() : ""; + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "nginx")) { + exec2("nginx -v 2>&1", function(error, stdout) { + if (!error) { + const nginx = stdout.toString().split("\n")[0] || ""; + appsObj.versions.nginx = (nginx.toLowerCase().split("/")[1] || "").trim(); + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "mysql")) { + exec2("mysql -V", function(error, stdout) { + if (!error) { + let mysql = stdout.toString().split("\n")[0] || ""; + mysql = mysql.toLowerCase(); + if (mysql.indexOf(",") > -1) { + mysql = (mysql.split(",")[0] || "").trim(); + const parts = mysql.split(" "); + appsObj.versions.mysql = (parts[parts.length - 1] || "").trim(); + } else { + if (mysql.indexOf(" ver ") > -1) { + mysql = mysql.split(" ver ")[1]; + appsObj.versions.mysql = mysql.split(" ")[0]; + } + } + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "php")) { + exec2("php -v", function(error, stdout) { + if (!error) { + const php = stdout.toString().split("\n")[0] || ""; + let parts = php.split("("); + if (parts[0].indexOf("-")) { + parts = parts[0].split("-"); + } + appsObj.versions.php = parts[0].replace(/[^0-9.]/g, ""); + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "redis")) { + exec2("redis-server --version", function(error, stdout) { + if (!error) { + const redis = stdout.toString().split("\n")[0] || ""; + const parts = redis.split(" "); + appsObj.versions.redis = util.getValue(parts, "v", "=", true); + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "docker")) { + exec2("docker --version", function(error, stdout) { + if (!error) { + const docker = stdout.toString().split("\n")[0] || ""; + const parts = docker.split(" "); + appsObj.versions.docker = parts.length > 2 && parts[2].endsWith(",") ? parts[2].slice(0, -1) : ""; + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "postfix")) { + exec2("postconf -d | grep mail_version", function(error, stdout) { + if (!error) { + const postfix = stdout.toString().split("\n") || []; + appsObj.versions.postfix = util.getValue(postfix, "mail_version", "=", true); + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "mongodb")) { + exec2("mongod --version", function(error, stdout) { + if (!error) { + const mongodb = stdout.toString().split("\n")[0] || ""; + appsObj.versions.mongodb = (mongodb.toLowerCase().split(",")[0] || "").replace(/[^0-9.]/g, ""); + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "postgresql")) { + if (_linux) { + exec2("locate bin/postgres", function(error, stdout) { + if (!error) { + const postgresqlBin = stdout.toString().split("\n").sort(); + if (postgresqlBin.length) { + exec2(postgresqlBin[postgresqlBin.length - 1] + " -V", function(error2, stdout2) { + if (!error2) { + const postgresql = stdout2.toString().split("\n")[0].split(" ") || []; + appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : ""; + } + functionProcessed(); + }); + } else { + functionProcessed(); + } + } else { + exec2("psql -V", function(error2, stdout2) { + if (!error2) { + const postgresql = stdout2.toString().split("\n")[0].split(" ") || []; + appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : ""; + appsObj.versions.postgresql = appsObj.versions.postgresql.split("-")[0]; + } + functionProcessed(); + }); + } + }); + } else { + if (_windows) { + util.powerShell("Get-CimInstance Win32_Service | select caption | fl").then((stdout) => { + let serviceSections = stdout.split(/\n\s*\n/); + serviceSections.forEach((item) => { + if (item.trim() !== "") { + let lines = item.trim().split("\r\n"); + let srvCaption = util.getValue(lines, "caption", ":", true).toLowerCase(); + if (srvCaption.indexOf("postgresql") > -1) { + const parts = srvCaption.split(" server "); + if (parts.length > 1) { + appsObj.versions.postgresql = parts[1]; + } + } + } + }); + functionProcessed(); + }); + } else { + exec2("postgres -V", function(error, stdout) { + if (!error) { + const postgresql = stdout.toString().split("\n")[0].split(" ") || []; + appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : ""; + } else { + exec2("pg_config --version", function(error2, stdout2) { + if (!error2) { + const postgresql = stdout2.toString().split("\n")[0].split(" ") || []; + appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : ""; + } + }); + } + functionProcessed(); + }); + } + } + } + if ({}.hasOwnProperty.call(appsObj.versions, "perl")) { + exec2("perl -v", function(error, stdout) { + if (!error) { + const perl = stdout.toString().split("\n") || ""; + while (perl.length > 0 && perl[0].trim() === "") { + perl.shift(); + } + if (perl.length > 0) { + appsObj.versions.perl = perl[0].split("(").pop().split(")")[0].replace("v", ""); + } + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "python")) { + if (_darwin) { + try { + const stdout = execSync("sw_vers"); + const lines = stdout.toString().split("\n"); + const osVersion = util.getValue(lines, "ProductVersion", ":"); + const gitHomebrewExists1 = fs.existsSync("/usr/local/Cellar/python"); + const gitHomebrewExists2 = fs.existsSync("/opt/homebrew/bin/python"); + if (util.darwinXcodeExists() && util.semverCompare("12.0.1", osVersion) < 0 || gitHomebrewExists1 || gitHomebrewExists2) { + const cmd2 = gitHomebrewExists1 ? "/usr/local/Cellar/python -V 2>&1" : gitHomebrewExists2 ? "/opt/homebrew/bin/python -V 2>&1" : "python -V 2>&1"; + exec2(cmd2, function(error, stdout2) { + if (!error) { + const python = stdout2.toString().split("\n")[0] || ""; + appsObj.versions.python = python.toLowerCase().replace("python", "").trim(); + } + functionProcessed(); + }); + } else { + functionProcessed(); + } + } catch (e) { + functionProcessed(); + } + } else { + exec2("python -V 2>&1", function(error, stdout) { + if (!error) { + const python = stdout.toString().split("\n")[0] || ""; + appsObj.versions.python = python.toLowerCase().replace("python", "").trim(); + } + functionProcessed(); + }); + } + } + if ({}.hasOwnProperty.call(appsObj.versions, "python3")) { + if (_darwin) { + const gitHomebrewExists = fs.existsSync("/usr/local/Cellar/python3") || fs.existsSync("/opt/homebrew/bin/python3"); + if (util.darwinXcodeExists() || gitHomebrewExists) { + exec2("python3 -V 2>&1", function(error, stdout) { + if (!error) { + const python = stdout.toString().split("\n")[0] || ""; + appsObj.versions.python3 = python.toLowerCase().replace("python", "").trim(); + } + functionProcessed(); + }); + } else { + functionProcessed(); + } + } else { + exec2("python3 -V 2>&1", function(error, stdout) { + if (!error) { + const python = stdout.toString().split("\n")[0] || ""; + appsObj.versions.python3 = python.toLowerCase().replace("python", "").trim(); + } + functionProcessed(); + }); + } + } + if ({}.hasOwnProperty.call(appsObj.versions, "pip")) { + if (_darwin) { + const gitHomebrewExists = fs.existsSync("/usr/local/Cellar/pip") || fs.existsSync("/opt/homebrew/bin/pip"); + if (util.darwinXcodeExists() || gitHomebrewExists) { + exec2("pip -V 2>&1", function(error, stdout) { + if (!error) { + const pip = stdout.toString().split("\n")[0] || ""; + const parts = pip.split(" "); + appsObj.versions.pip = parts.length >= 2 ? parts[1] : ""; + } + functionProcessed(); + }); + } else { + functionProcessed(); + } + } else { + exec2("pip -V 2>&1", function(error, stdout) { + if (!error) { + const pip = stdout.toString().split("\n")[0] || ""; + const parts = pip.split(" "); + appsObj.versions.pip = parts.length >= 2 ? parts[1] : ""; + } + functionProcessed(); + }); + } + } + if ({}.hasOwnProperty.call(appsObj.versions, "pip3")) { + if (_darwin) { + const gitHomebrewExists = fs.existsSync("/usr/local/Cellar/pip3") || fs.existsSync("/opt/homebrew/bin/pip3"); + if (util.darwinXcodeExists() || gitHomebrewExists) { + exec2("pip3 -V 2>&1", function(error, stdout) { + if (!error) { + const pip = stdout.toString().split("\n")[0] || ""; + const parts = pip.split(" "); + appsObj.versions.pip3 = parts.length >= 2 ? parts[1] : ""; + } + functionProcessed(); + }); + } else { + functionProcessed(); + } + } else { + exec2("pip3 -V 2>&1", function(error, stdout) { + if (!error) { + const pip = stdout.toString().split("\n")[0] || ""; + const parts = pip.split(" "); + appsObj.versions.pip3 = parts.length >= 2 ? parts[1] : ""; + } + functionProcessed(); + }); + } + } + if ({}.hasOwnProperty.call(appsObj.versions, "java")) { + if (_darwin) { + exec2("/usr/libexec/java_home -V 2>&1", function(error, stdout) { + if (!error && stdout.toString().toLowerCase().indexOf("no java runtime") === -1) { + exec2("java -version 2>&1", function(error2, stdout2) { + if (!error2) { + const java = stdout2.toString().split("\n")[0] || ""; + const parts = java.split('"'); + appsObj.versions.java = parts.length === 3 ? parts[1].trim() : ""; + } + functionProcessed(); + }); + } else { + functionProcessed(); + } + }); + } else { + exec2("java -version 2>&1", function(error, stdout) { + if (!error) { + const java = stdout.toString().split("\n")[0] || ""; + const parts = java.split('"'); + appsObj.versions.java = parts.length === 3 ? parts[1].trim() : ""; + } + functionProcessed(); + }); + } + } + if ({}.hasOwnProperty.call(appsObj.versions, "gcc")) { + if (_darwin && util.darwinXcodeExists() || !_darwin) { + exec2("gcc -dumpversion", function(error, stdout) { + if (!error) { + appsObj.versions.gcc = stdout.toString().split("\n")[0].trim() || ""; + } + if (appsObj.versions.gcc.indexOf(".") > -1) { + functionProcessed(); + } else { + exec2("gcc --version", function(error2, stdout2) { + if (!error2) { + const gcc = stdout2.toString().split("\n")[0].trim(); + if (gcc.indexOf("gcc") > -1 && gcc.indexOf(")") > -1) { + const parts = gcc.split(")"); + appsObj.versions.gcc = parts[1].trim() || appsObj.versions.gcc; + } + } + functionProcessed(); + }); + } + }); + } else { + functionProcessed(); + } + } + if ({}.hasOwnProperty.call(appsObj.versions, "virtualbox")) { + exec2(util.getVboxmanage() + " -v 2>&1", function(error, stdout) { + if (!error) { + const vbox = stdout.toString().split("\n")[0] || ""; + const parts = vbox.split("r"); + appsObj.versions.virtualbox = parts[0]; + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "bash")) { + exec2("bash --version", function(error, stdout) { + if (!error) { + const line = stdout.toString().split("\n")[0]; + const parts = line.split(" version "); + if (parts.length > 1) { + appsObj.versions.bash = parts[1].split(" ")[0].split("(")[0]; + } + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "zsh")) { + exec2("zsh --version", function(error, stdout) { + if (!error) { + const line = stdout.toString().split("\n")[0]; + const parts = line.split("zsh "); + if (parts.length > 1) { + appsObj.versions.zsh = parts[1].split(" ")[0]; + } + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "fish")) { + exec2("fish --version", function(error, stdout) { + if (!error) { + const line = stdout.toString().split("\n")[0]; + const parts = line.split(" version "); + if (parts.length > 1) { + appsObj.versions.fish = parts[1].split(" ")[0]; + } + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "bun")) { + exec2("bun -v", function(error, stdout) { + if (!error) { + const line = stdout.toString().split("\n")[0].trim(); + appsObj.versions.bun = line; + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "deno")) { + exec2("deno -v", function(error, stdout) { + if (!error) { + const line = stdout.toString().split("\n")[0].trim(); + const parts = line.split(" "); + if (parts.length > 1) { + appsObj.versions.deno = parts[1]; + } + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "node")) { + exec2("node -v", function(error, stdout) { + if (!error) { + let line = stdout.toString().split("\n")[0].trim(); + if (line.startsWith("v")) { + line = line.slice(1); + } + appsObj.versions.node = line; + } + functionProcessed(); + }); + } + if ({}.hasOwnProperty.call(appsObj.versions, "powershell")) { + if (_windows) { + util.powerShell("$PSVersionTable").then((stdout) => { + const lines = stdout.toString().toLowerCase().split("\n").map((line) => line.replace(/ +/g, " ").replace(/ +/g, ":")); + appsObj.versions.powershell = util.getValue(lines, "psversion"); + functionProcessed(); + }); + } else { + functionProcessed(); + } + } + if ({}.hasOwnProperty.call(appsObj.versions, "dotnet")) { + if (_windows) { + util.powerShell('gci "HKLM:\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP" -recurse | gp -name Version,Release -EA 0 | where { $_.PSChildName -match "^(?!S)\\p{L}"} | select PSChildName, Version, Release').then((stdout) => { + const lines = stdout.toString().split("\r\n"); + let dotnet = ""; + lines.forEach((line) => { + line = line.replace(/ +/g, " "); + const parts = line.split(" "); + dotnet = dotnet || (parts[0].toLowerCase().startsWith("client") && parts.length > 2 ? parts[1].trim() : parts[0].toLowerCase().startsWith("full") && parts.length > 2 ? parts[1].trim() : ""); + }); + appsObj.versions.dotnet = dotnet.trim(); + functionProcessed(); + }); + } else { + functionProcessed(); + } + } + } catch (e) { + if (callback) { + callback(appsObj.versions); + } + resolve(appsObj.versions); + } + }); + }); + } + exports.versions = versions; + function shell(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + if (_windows) { + try { + const result2 = "CMD"; + util.powerShell(`Get-CimInstance -className win32_process | where-object {$_.ProcessId -eq ${process.ppid} } | select Name`).then((stdout) => { + let result3 = "CMD"; + if (stdout) { + if (stdout.toString().toLowerCase().indexOf("powershell") >= 0) { + result3 = "PowerShell"; + } + } + if (callback) { + callback(result3); + } + resolve(result3); + }); + } catch (e) { + if (callback) { + callback(result); + } + resolve(result); + } + } else { + let result2 = ""; + exec2("echo $SHELL", function(error, stdout) { + if (!error) { + result2 = stdout.toString().split("\n")[0]; + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + }); + }); + } + exports.shell = shell; + function getUniqueMacAdresses() { + let macs = []; + try { + const ifaces = os2.networkInterfaces(); + for (let dev in ifaces) { + if ({}.hasOwnProperty.call(ifaces, dev)) { + ifaces[dev].forEach(function(details) { + if (details && details.mac && details.mac !== "00:00:00:00:00:00") { + const mac = details.mac.toLowerCase(); + if (macs.indexOf(mac) === -1) { + macs.push(mac); + } + } + }); + } + } + macs = macs.sort(function(a, b) { + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + return 0; + }); + } catch (e) { + macs.push("00:00:00:00:00:00"); + } + return macs; + } + function uuid(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + os: "", + hardware: "", + macs: getUniqueMacAdresses() + }; + let parts; + if (_darwin) { + exec2("system_profiler SPHardwareDataType -json", function(error, stdout) { + if (!error) { + try { + const jsonObj = JSON.parse(stdout.toString()); + if (jsonObj.SPHardwareDataType && jsonObj.SPHardwareDataType.length > 0) { + const spHardware = jsonObj.SPHardwareDataType[0]; + result2.os = spHardware.platform_UUID.toLowerCase(); + result2.hardware = spHardware.serial_number; + } + } catch (e) { + util.noop(); + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_linux) { + const cmd = `echo -n "os: "; cat /var/lib/dbus/machine-id 2> /dev/null || +cat /etc/machine-id 2> /dev/null; echo; +echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`; + exec2(cmd, function(error, stdout) { + const lines = stdout.toString().split("\n"); + result2.os = util.getValue(lines, "os").toLowerCase(); + result2.hardware = util.getValue(lines, "hardware").toLowerCase(); + if (!result2.hardware) { + const lines2 = fs.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split("\n"); + const serial = util.getValue(lines2, "serial"); + result2.hardware = serial || ""; + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_freebsd || _openbsd || _netbsd) { + exec2("sysctl -i kern.hostid kern.hostuuid", function(error, stdout) { + const lines = stdout.toString().split("\n"); + result2.os = util.getValue(lines, "kern.hostid", ":").toLowerCase(); + result2.hardware = util.getValue(lines, "kern.hostuuid", ":").toLowerCase(); + if (result2.os.indexOf("unknown") >= 0) { + result2.os = ""; + } + if (result2.hardware.indexOf("unknown") >= 0) { + result2.hardware = ""; + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_windows) { + let sysdir = "%windir%\\System32"; + if (process.arch === "ia32" && Object.prototype.hasOwnProperty.call(process.env, "PROCESSOR_ARCHITEW6432")) { + sysdir = "%windir%\\sysnative\\cmd.exe /c %windir%\\System32"; + } + util.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select UUID | fl").then((stdout) => { + let lines = stdout.split("\r\n"); + result2.hardware = util.getValue(lines, "uuid", ":").toLowerCase(); + exec2(`${sysdir}\\reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography" /v MachineGuid`, util.execOptsWin, function(error, stdout2) { + parts = stdout2.toString().split("\n\r")[0].split("REG_SZ"); + result2.os = parts.length > 1 ? parts[1].replace(/\r+|\n+|\s+/ig, "").toLowerCase() : ""; + if (callback) { + callback(result2); + } + resolve(result2); + }); + }); + } + }); + }); + } + exports.uuid = uuid; + } +}); + +// node_modules/systeminformation/lib/cpu.js +var require_cpu = __commonJS({ + "node_modules/systeminformation/lib/cpu.js"(exports) { + "use strict"; + var os2 = require("os"); + var exec2 = require("child_process").exec; + var execSync = require("child_process").execSync; + var fs = require("fs"); + var util = require_util2(); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + var _cpu_speed = 0; + var _current_cpu = { + user: 0, + nice: 0, + system: 0, + idle: 0, + irq: 0, + steal: 0, + guest: 0, + load: 0, + tick: 0, + ms: 0, + currentLoad: 0, + currentLoadUser: 0, + currentLoadSystem: 0, + currentLoadNice: 0, + currentLoadIdle: 0, + currentLoadIrq: 0, + currentLoadSteal: 0, + currentLoadGuest: 0, + rawCurrentLoad: 0, + rawCurrentLoadUser: 0, + rawCurrentLoadSystem: 0, + rawCurrentLoadNice: 0, + rawCurrentLoadIdle: 0, + rawCurrentLoadIrq: 0, + rawCurrentLoadSteal: 0, + rawCurrentLoadGuest: 0 + }; + var _cpus = []; + var _corecount = 0; + var AMDBaseFrequencies = { + "8346": "1.8", + "8347": "1.9", + "8350": "2.0", + "8354": "2.2", + "8356|SE": "2.4", + "8356": "2.3", + "8360": "2.5", + "2372": "2.1", + "2373": "2.1", + "2374": "2.2", + "2376": "2.3", + "2377": "2.3", + "2378": "2.4", + "2379": "2.4", + "2380": "2.5", + "2381": "2.5", + "2382": "2.6", + "2384": "2.7", + "2386": "2.8", + "2387": "2.8", + "2389": "2.9", + "2393": "3.1", + "8374": "2.2", + "8376": "2.3", + "8378": "2.4", + "8379": "2.4", + "8380": "2.5", + "8381": "2.5", + "8382": "2.6", + "8384": "2.7", + "8386": "2.8", + "8387": "2.8", + "8389": "2.9", + "8393": "3.1", + "2419EE": "1.8", + "2423HE": "2.0", + "2425HE": "2.1", + "2427": "2.2", + "2431": "2.4", + "2435": "2.6", + "2439SE": "2.8", + "8425HE": "2.1", + "8431": "2.4", + "8435": "2.6", + "8439SE": "2.8", + "4122": "2.2", + "4130": "2.6", + "4162EE": "1.7", + "4164EE": "1.8", + "4170HE": "2.1", + "4174HE": "2.3", + "4176HE": "2.4", + "4180": "2.6", + "4184": "2.8", + "6124HE": "1.8", + "6128HE": "2.0", + "6132HE": "2.2", + "6128": "2.0", + "6134": "2.3", + "6136": "2.4", + "6140": "2.6", + "6164HE": "1.7", + "6166HE": "1.8", + "6168": "1.9", + "6172": "2.1", + "6174": "2.2", + "6176": "2.3", + "6176SE": "2.3", + "6180SE": "2.5", + "3250": "2.5", + "3260": "2.7", + "3280": "2.4", + "4226": "2.7", + "4228": "2.8", + "4230": "2.9", + "4234": "3.1", + "4238": "3.3", + "4240": "3.4", + "4256": "1.6", + "4274": "2.5", + "4276": "2.6", + "4280": "2.8", + "4284": "3.0", + "6204": "3.3", + "6212": "2.6", + "6220": "3.0", + "6234": "2.4", + "6238": "2.6", + "6262HE": "1.6", + "6272": "2.1", + "6274": "2.2", + "6276": "2.3", + "6278": "2.4", + "6282SE": "2.6", + "6284SE": "2.7", + "6308": "3.5", + "6320": "2.8", + "6328": "3.2", + "6338P": "2.3", + "6344": "2.6", + "6348": "2.8", + "6366": "1.8", + "6370P": "2.0", + "6376": "2.3", + "6378": "2.4", + "6380": "2.5", + "6386": "2.8", + "FX|4100": "3.6", + "FX|4120": "3.9", + "FX|4130": "3.8", + "FX|4150": "3.8", + "FX|4170": "4.2", + "FX|6100": "3.3", + "FX|6120": "3.6", + "FX|6130": "3.6", + "FX|6200": "3.8", + "FX|8100": "2.8", + "FX|8120": "3.1", + "FX|8140": "3.2", + "FX|8150": "3.6", + "FX|8170": "3.9", + "FX|4300": "3.8", + "FX|4320": "4.0", + "FX|4350": "4.2", + "FX|6300": "3.5", + "FX|6350": "3.9", + "FX|8300": "3.3", + "FX|8310": "3.4", + "FX|8320": "3.5", + "FX|8350": "4.0", + "FX|8370": "4.0", + "FX|9370": "4.4", + "FX|9590": "4.7", + "FX|8320E": "3.2", + "FX|8370E": "3.3", + // ZEN Desktop CPUs + "1200": "3.1", + "Pro 1200": "3.1", + "1300X": "3.5", + "Pro 1300": "3.5", + "1400": "3.2", + "1500X": "3.5", + "Pro 1500": "3.5", + "1600": "3.2", + "1600X": "3.6", + "Pro 1600": "3.2", + "1700": "3.0", + "Pro 1700": "3.0", + "1700X": "3.4", + "Pro 1700X": "3.4", + "1800X": "3.6", + "1900X": "3.8", + "1920": "3.2", + "1920X": "3.5", + "1950X": "3.4", + // ZEN Desktop APUs + "200GE": "3.2", + "Pro 200GE": "3.2", + "220GE": "3.4", + "240GE": "3.5", + "3000G": "3.5", + "300GE": "3.4", + "3050GE": "3.4", + "2200G": "3.5", + "Pro 2200G": "3.5", + "2200GE": "3.2", + "Pro 2200GE": "3.2", + "2400G": "3.6", + "Pro 2400G": "3.6", + "2400GE": "3.2", + "Pro 2400GE": "3.2", + // ZEN Mobile APUs + "Pro 200U": "2.3", + "300U": "2.4", + "2200U": "2.5", + "3200U": "2.6", + "2300U": "2.0", + "Pro 2300U": "2.0", + "2500U": "2.0", + "Pro 2500U": "2.2", + "2600H": "3.2", + "2700U": "2.0", + "Pro 2700U": "2.2", + "2800H": "3.3", + // ZEN Server Processors + "7351": "2.4", + "7351P": "2.4", + "7401": "2.0", + "7401P": "2.0", + "7551P": "2.0", + "7551": "2.0", + "7251": "2.1", + "7261": "2.5", + "7281": "2.1", + "7301": "2.2", + "7371": "3.1", + "7451": "2.3", + "7501": "2.0", + "7571": "2.2", + "7601": "2.2", + // ZEN Embedded Processors + "V1500B": "2.2", + "V1780B": "3.35", + "V1202B": "2.3", + "V1404I": "2.0", + "V1605B": "2.0", + "V1756B": "3.25", + "V1807B": "3.35", + "3101": "2.1", + "3151": "2.7", + "3201": "1.5", + "3251": "2.5", + "3255": "2.5", + "3301": "2.0", + "3351": "1.9", + "3401": "1.85", + "3451": "2.15", + // ZEN+ Desktop + "1200|AF": "3.1", + "2300X": "3.5", + "2500X": "3.6", + "2600": "3.4", + "2600E": "3.1", + "1600|AF": "3.2", + "2600X": "3.6", + "2700": "3.2", + "2700E": "2.8", + "Pro 2700": "3.2", + "2700X": "3.7", + "Pro 2700X": "3.6", + "2920X": "3.5", + "2950X": "3.5", + "2970WX": "3.0", + "2990WX": "3.0", + // ZEN+ Desktop APU + "Pro 300GE": "3.4", + "Pro 3125GE": "3.4", + "3150G": "3.5", + "Pro 3150G": "3.5", + "3150GE": "3.3", + "Pro 3150GE": "3.3", + "3200G": "3.6", + "Pro 3200G": "3.6", + "3200GE": "3.3", + "Pro 3200GE": "3.3", + "3350G": "3.6", + "Pro 3350G": "3.6", + "3350GE": "3.3", + "Pro 3350GE": "3.3", + "3400G": "3.7", + "Pro 3400G": "3.7", + "3400GE": "3.3", + "Pro 3400GE": "3.3", + // ZEN+ Mobile + "3300U": "2.1", + "PRO 3300U": "2.1", + "3450U": "2.1", + "3500U": "2.1", + "PRO 3500U": "2.1", + "3500C": "2.1", + "3550H": "2.1", + "3580U": "2.1", + "3700U": "2.3", + "PRO 3700U": "2.3", + "3700C": "2.3", + "3750H": "2.3", + "3780U": "2.3", + // ZEN2 Desktop CPUS + "3100": "3.6", + "3300X": "3.8", + "3500": "3.6", + "3500X": "3.6", + "3600": "3.6", + "Pro 3600": "3.6", + "3600X": "3.8", + "3600XT": "3.8", + "Pro 3700": "3.6", + "3700X": "3.6", + "3800X": "3.9", + "3800XT": "3.9", + "3900": "3.1", + "Pro 3900": "3.1", + "3900X": "3.8", + "3900XT": "3.8", + "3950X": "3.5", + "3960X": "3.8", + "3970X": "3.7", + "3990X": "2.9", + "3945WX": "4.0", + "3955WX": "3.9", + "3975WX": "3.5", + "3995WX": "2.7", + // ZEN2 Desktop APUs + "4300GE": "3.5", + "Pro 4300GE": "3.5", + "4300G": "3.8", + "Pro 4300G": "3.8", + "4600GE": "3.3", + "Pro 4650GE": "3.3", + "4600G": "3.7", + "Pro 4650G": "3.7", + "4700GE": "3.1", + "Pro 4750GE": "3.1", + "4700G": "3.6", + "Pro 4750G": "3.6", + "4300U": "2.7", + "4450U": "2.5", + "Pro 4450U": "2.5", + "4500U": "2.3", + "4600U": "2.1", + "PRO 4650U": "2.1", + "4680U": "2.1", + "4600HS": "3.0", + "4600H": "3.0", + "4700U": "2.0", + "PRO 4750U": "1.7", + "4800U": "1.8", + "4800HS": "2.9", + "4800H": "2.9", + "4900HS": "3.0", + "4900H": "3.3", + "5300U": "2.6", + "5500U": "2.1", + "5700U": "1.8", + // ZEN2 - EPYC + "7232P": "3.1", + "7302P": "3.0", + "7402P": "2.8", + "7502P": "2.5", + "7702P": "2.0", + "7252": "3.1", + "7262": "3.2", + "7272": "2.9", + "7282": "2.8", + "7302": "3.0", + "7352": "2.3", + "7402": "2.8", + "7452": "2.35", + "7502": "2.5", + "7532": "2.4", + "7542": "2.9", + "7552": "2.2", + "7642": "2.3", + "7662": "2.0", + "7702": "2.0", + "7742": "2.25", + "7H12": "2.6", + "7F32": "3.7", + "7F52": "3.5", + "7F72": "3.2", + // Epyc (Milan) + "7773X": "2.2", + "7763": "2.45", + "7713": "2.0", + "7713P": "2.0", + "7663": "2.0", + "7643": "2.3", + "7573X": "2.8", + "75F3": "2.95", + "7543": "2.8", + "7543P": "2.8", + "7513": "2.6", + "7473X": "2.8", + "7453": "2.75", + "74F3": "3.2", + "7443": "2.85", + "7443P": "2.85", + "7413": "2.65", + "7373X": "3.05", + "73F3": "3.5", + "7343": "3.2", + "7313": "3.0", + "7313P": "3.0", + "72F3": "3.7", + // ZEN3 + "5600X": "3.7", + "5800X": "3.8", + "5900X": "3.7", + "5950X": "3.4", + "5945WX": "4.1", + "5955WX": "4.0", + "5965WX": "3.8", + "5975WX": "3.6", + "5995WX": "2.7", + "7960X": "4.2", + "7970X": "4.0", + "7980X": "3.2", + "7965WX": "4.2", + "7975WX": "4.0", + "7985WX": "3.2", + "7995WX": "2.5", + // ZEN4 + "9754": "2.25", + "9754S": "2.25", + "9734": "2.2", + "9684X": "2.55", + "9384X": "3.1", + "9184X": "3.55", + "9654P": "2.4", + "9654": "2.4", + "9634": "2.25", + "9554P": "3.1", + "9554": "3.1", + "9534": "2.45", + "9474F": "3.6", + "9454P": "2.75", + "9454": "2.75", + "9374F": "3.85", + "9354P": "3.25", + "9354": "3.25", + "9334": "2.7", + "9274F": "4.05", + "9254": "2.9", + "9224": "2.5", + "9174F": "4.1", + "9124": "3.0" + }; + var socketTypes = { + 1: "Other", + 2: "Unknown", + 3: "Daughter Board", + 4: "ZIF Socket", + 5: "Replacement/Piggy Back", + 6: "None", + 7: "LIF Socket", + 8: "Slot 1", + 9: "Slot 2", + 10: "370 Pin Socket", + 11: "Slot A", + 12: "Slot M", + 13: "423", + 14: "A (Socket 462)", + 15: "478", + 16: "754", + 17: "940", + 18: "939", + 19: "mPGA604", + 20: "LGA771", + 21: "LGA775", + 22: "S1", + 23: "AM2", + 24: "F (1207)", + 25: "LGA1366", + 26: "G34", + 27: "AM3", + 28: "C32", + 29: "LGA1156", + 30: "LGA1567", + 31: "PGA988A", + 32: "BGA1288", + 33: "rPGA988B", + 34: "BGA1023", + 35: "BGA1224", + 36: "LGA1155", + 37: "LGA1356", + 38: "LGA2011", + 39: "FS1", + 40: "FS2", + 41: "FM1", + 42: "FM2", + 43: "LGA2011-3", + 44: "LGA1356-3", + 45: "LGA1150", + 46: "BGA1168", + 47: "BGA1234", + 48: "BGA1364", + 49: "AM4", + 50: "LGA1151", + 51: "BGA1356", + 52: "BGA1440", + 53: "BGA1515", + 54: "LGA3647-1", + 55: "SP3", + 56: "SP3r2", + 57: "LGA2066", + 58: "BGA1392", + 59: "BGA1510", + 60: "BGA1528", + 61: "LGA4189", + 62: "LGA1200", + 63: "LGA4677", + 64: "LGA1700", + 65: "BGA1744", + 66: "BGA1781", + 67: "BGA1211", + 68: "BGA2422", + 69: "LGA1211", + 70: "LGA2422", + 71: "LGA5773", + 72: "BGA5773" + }; + var socketTypesByName = { + "LGA1150": "i7-5775C i3-4340 i3-4170 G3250 i3-4160T i3-4160 E3-1231 G3258 G3240 i7-4790S i7-4790K i7-4790 i5-4690K i5-4690 i5-4590T i5-4590S i5-4590 i5-4460 i3-4360 i3-4150 G1820 G3420 G3220 i7-4771 i5-4440 i3-4330 i3-4130T i3-4130 E3-1230 i7-4770S i7-4770K i7-4770 i5-4670K i5-4670 i5-4570T i5-4570S i5-4570 i5-4430", + "LGA1151": "i9-9900KS E-2288G E-2224 G5420 i9-9900T i9-9900 i7-9700T i7-9700F i7-9700E i7-9700 i5-9600 i5-9500T i5-9500F i5-9500 i5-9400T i3-9350K i3-9300 i3-9100T i3-9100F i3-9100 G4930 i9-9900KF i7-9700KF i5-9600KF i5-9400F i5-9400 i3-9350KF i9-9900K i7-9700K i5-9600K G5500 G5400 i7-8700T i7-8086K i5-8600 i5-8500T i5-8500 i5-8400T i3-8300 i3-8100T G4900 i7-8700K i7-8700 i5-8600K i5-8400 i3-8350K i3-8100 E3-1270 G4600 G4560 i7-7700T i7-7700K i7-7700 i5-7600K i5-7600 i5-7500T i5-7500 i5-7400 i3-7350K i3-7300 i3-7100T i3-7100 G3930 G3900 G4400 i7-6700T i7-6700K i7-6700 i5-6600K i5-6600 i5-6500T i5-6500 i5-6400T i5-6400 i3-6300 i3-6100T i3-6100 E3-1270 E3-1270 T4500 T4400", + "1155": "G440 G460 G465 G470 G530T G540T G550T G1610T G1620T G530 G540 G1610 G550 G1620 G555 G1630 i3-2100T i3-2120T i3-3220T i3-3240T i3-3250T i3-2100 i3-2105 i3-2102 i3-3210 i3-3220 i3-2125 i3-2120 i3-3225 i3-2130 i3-3245 i3-3240 i3-3250 i5-3570T i5-2500T i5-2400S i5-2405S i5-2390T i5-3330S i5-2500S i5-3335S i5-2300 i5-3450S i5-3340S i5-3470S i5-3475S i5-3470T i5-2310 i5-3550S i5-2320 i5-3330 i5-3350P i5-3450 i5-2400 i5-3340 i5-3570S i5-2380P i5-2450P i5-3470 i5-2500K i5-3550 i5-2500 i5-3570 i5-3570K i5-2550K i7-3770T i7-2600S i7-3770S i7-2600K i7-2600 i7-3770 i7-3770K i7-2700K G620T G630T G640T G2020T G645T G2100T G2030T G622 G860T G620 G632 G2120T G630 G640 G2010 G840 G2020 G850 G645 G2030 G860 G2120 G870 G2130 G2140 E3-1220L E3-1220L E3-1260L E3-1265L E3-1220 E3-1225 E3-1220 E3-1235 E3-1225 E3-1230 E3-1230 E3-1240 E3-1245 E3-1270 E3-1275 E3-1240 E3-1245 E3-1270 E3-1280 E3-1275 E3-1290 E3-1280 E3-1290" + }; + function getSocketTypesByName(str) { + let result2 = ""; + for (const key in socketTypesByName) { + const names = socketTypesByName[key].split(" "); + names.forEach((element) => { + if (str.indexOf(element) >= 0) { + result2 = key; + } + }); + } + return result2; + } + function cpuManufacturer(str) { + let result2 = str; + str = str.toLowerCase(); + if (str.indexOf("intel") >= 0) { + result2 = "Intel"; + } + if (str.indexOf("amd") >= 0) { + result2 = "AMD"; + } + if (str.indexOf("qemu") >= 0) { + result2 = "QEMU"; + } + if (str.indexOf("hygon") >= 0) { + result2 = "Hygon"; + } + if (str.indexOf("centaur") >= 0) { + result2 = "WinChip/Via"; + } + if (str.indexOf("vmware") >= 0) { + result2 = "VMware"; + } + if (str.indexOf("Xen") >= 0) { + result2 = "Xen Hypervisor"; + } + if (str.indexOf("tcg") >= 0) { + result2 = "QEMU"; + } + if (str.indexOf("apple") >= 0) { + result2 = "Apple"; + } + if (str.indexOf("sifive") >= 0) { + result2 = "SiFive"; + } + if (str.indexOf("thead") >= 0) { + result2 = "T-Head"; + } + if (str.indexOf("andestech") >= 0) { + result2 = "Andes Technology"; + } + return result2; + } + function cpuBrandManufacturer(res) { + res.brand = res.brand.replace(/\(R\)+/g, "\xAE").replace(/\s+/g, " ").trim(); + res.brand = res.brand.replace(/\(TM\)+/g, "\u2122").replace(/\s+/g, " ").trim(); + res.brand = res.brand.replace(/\(C\)+/g, "\xA9").replace(/\s+/g, " ").trim(); + res.brand = res.brand.replace(/CPU+/g, "").replace(/\s+/g, " ").trim(); + res.manufacturer = cpuManufacturer(res.brand); + let parts = res.brand.split(" "); + parts.shift(); + res.brand = parts.join(" "); + return res; + } + function getAMDSpeed(brand) { + let result2 = "0"; + for (let key in AMDBaseFrequencies) { + if ({}.hasOwnProperty.call(AMDBaseFrequencies, key)) { + let parts = key.split("|"); + let found = 0; + parts.forEach((item) => { + if (brand.indexOf(item) > -1) { + found++; + } + }); + if (found === parts.length) { + result2 = AMDBaseFrequencies[key]; + } + } + } + return parseFloat(result2); + } + function getCpu() { + return new Promise((resolve) => { + process.nextTick(() => { + const UNKNOWN = "unknown"; + let result2 = { + manufacturer: UNKNOWN, + brand: UNKNOWN, + vendor: "", + family: "", + model: "", + stepping: "", + revision: "", + voltage: "", + speed: 0, + speedMin: 0, + speedMax: 0, + governor: "", + cores: util.cores(), + physicalCores: util.cores(), + performanceCores: util.cores(), + efficiencyCores: 0, + processors: 1, + socket: "", + flags: "", + virtualization: false, + cache: {} + }; + cpuFlags().then((flags) => { + result2.flags = flags; + result2.virtualization = flags.indexOf("vmx") > -1 || flags.indexOf("svm") > -1; + if (_darwin) { + exec2("sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily", function(error, stdout) { + let lines = stdout.toString().split("\n"); + const modelline = util.getValue(lines, "machdep.cpu.brand_string"); + const modellineParts = modelline.split("@"); + result2.brand = modellineParts[0].trim(); + const speed = modellineParts[1] ? modellineParts[1].trim() : "0"; + result2.speed = parseFloat(speed.replace(/GHz+/g, "")); + let tbFrequency = util.getValue(lines, "hw.tbfrequency") / 1e9; + tbFrequency = tbFrequency < 0.1 ? tbFrequency * 100 : tbFrequency; + result2.speed = result2.speed === 0 ? tbFrequency : result2.speed; + _cpu_speed = result2.speed; + result2 = cpuBrandManufacturer(result2); + result2.speedMin = util.getValue(lines, "hw.cpufrequency_min") ? util.getValue(lines, "hw.cpufrequency_min") / 1e9 : result2.speed; + result2.speedMax = util.getValue(lines, "hw.cpufrequency_max") ? util.getValue(lines, "hw.cpufrequency_max") / 1e9 : result2.speed; + result2.vendor = util.getValue(lines, "machdep.cpu.vendor") || "Apple"; + result2.family = util.getValue(lines, "machdep.cpu.family") || util.getValue(lines, "hw.cpufamily"); + result2.model = util.getValue(lines, "machdep.cpu.model"); + result2.stepping = util.getValue(lines, "machdep.cpu.stepping") || util.getValue(lines, "hw.cpusubfamily"); + result2.virtualization = true; + const countProcessors = util.getValue(lines, "hw.packages"); + const countCores = util.getValue(lines, "hw.physicalcpu_max"); + const countThreads = util.getValue(lines, "hw.ncpu"); + if (os2.arch() === "arm64") { + result2.socket = "SOC"; + try { + const clusters = execSync("ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type").toString().split("\n"); + const efficiencyCores = clusters.filter((line) => line.indexOf('"E"') >= 0).length; + const performanceCores = clusters.filter((line) => line.indexOf('"P"') >= 0).length; + result2.efficiencyCores = efficiencyCores; + result2.performanceCores = performanceCores; + } catch (e) { + util.noop(); + } + } + if (countProcessors) { + result2.processors = parseInt(countProcessors) || 1; + } + if (countCores && countThreads) { + result2.cores = parseInt(countThreads) || util.cores(); + result2.physicalCores = parseInt(countCores) || util.cores(); + } + cpuCache().then((res) => { + result2.cache = res; + resolve(result2); + }); + }); + } + if (_linux) { + let modelline = ""; + let lines = []; + if (os2.cpus()[0] && os2.cpus()[0].model) { + modelline = os2.cpus()[0].model; + } + exec2('export LC_ALL=C; lscpu; echo -n "Governor: "; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null; echo; unset LC_ALL', function(error, stdout) { + if (!error) { + lines = stdout.toString().split("\n"); + } + modelline = util.getValue(lines, "model name") || modelline; + modelline = util.getValue(lines, "bios model name") || modelline; + modelline = util.cleanString(modelline); + const modellineParts = modelline.split("@"); + result2.brand = modellineParts[0].trim(); + result2.speed = modellineParts[1] ? parseFloat(modellineParts[1].trim()) : 0; + if (result2.speed === 0 && (result2.brand.indexOf("AMD") > -1 || result2.brand.toLowerCase().indexOf("ryzen") > -1)) { + result2.speed = getAMDSpeed(result2.brand); + } + if (result2.speed === 0) { + const current = getCpuCurrentSpeedSync(); + if (current.avg !== 0) { + result2.speed = current.avg; + } + } + _cpu_speed = result2.speed; + result2.speedMin = Math.round(parseFloat(util.getValue(lines, "cpu min mhz").replace(/,/g, ".")) / 10) / 100; + result2.speedMax = Math.round(parseFloat(util.getValue(lines, "cpu max mhz").replace(/,/g, ".")) / 10) / 100; + result2 = cpuBrandManufacturer(result2); + result2.vendor = cpuManufacturer(util.getValue(lines, "vendor id")); + result2.family = util.getValue(lines, "cpu family"); + result2.model = util.getValue(lines, "model:"); + result2.stepping = util.getValue(lines, "stepping"); + result2.revision = util.getValue(lines, "cpu revision"); + result2.cache.l1d = util.getValue(lines, "l1d cache"); + if (result2.cache.l1d) { + result2.cache.l1d = parseInt(result2.cache.l1d) * (result2.cache.l1d.indexOf("M") !== -1 ? 1024 * 1024 : result2.cache.l1d.indexOf("K") !== -1 ? 1024 : 1); + } + result2.cache.l1i = util.getValue(lines, "l1i cache"); + if (result2.cache.l1i) { + result2.cache.l1i = parseInt(result2.cache.l1i) * (result2.cache.l1i.indexOf("M") !== -1 ? 1024 * 1024 : result2.cache.l1i.indexOf("K") !== -1 ? 1024 : 1); + } + result2.cache.l2 = util.getValue(lines, "l2 cache"); + if (result2.cache.l2) { + result2.cache.l2 = parseInt(result2.cache.l2) * (result2.cache.l2.indexOf("M") !== -1 ? 1024 * 1024 : result2.cache.l2.indexOf("K") !== -1 ? 1024 : 1); + } + result2.cache.l3 = util.getValue(lines, "l3 cache"); + if (result2.cache.l3) { + result2.cache.l3 = parseInt(result2.cache.l3) * (result2.cache.l3.indexOf("M") !== -1 ? 1024 * 1024 : result2.cache.l3.indexOf("K") !== -1 ? 1024 : 1); + } + const threadsPerCore = util.getValue(lines, "thread(s) per core") || "1"; + const processors = util.getValue(lines, "socket(s)") || "1"; + const threadsPerCoreInt = parseInt(threadsPerCore, 10); + const processorsInt = parseInt(processors, 10) || 1; + const coresPerSocket = parseInt(util.getValue(lines, "core(s) per socket"), 10); + result2.physicalCores = coresPerSocket ? coresPerSocket * processorsInt : result2.cores / threadsPerCoreInt; + result2.performanceCores = threadsPerCoreInt > 1 ? result2.cores - result2.physicalCores : result2.cores; + result2.efficiencyCores = threadsPerCoreInt > 1 ? result2.cores - threadsPerCoreInt * result2.performanceCores : 0; + result2.processors = processorsInt; + result2.governor = util.getValue(lines, "governor") || ""; + if (result2.vendor === "ARM" && util.isRaspberry()) { + const rPIRevision = util.decodePiCpuinfo(); + result2.family = result2.manufacturer; + result2.manufacturer = rPIRevision.manufacturer; + result2.brand = rPIRevision.processor; + result2.revision = rPIRevision.revisionCode; + result2.socket = "SOC"; + } + if (util.getValue(lines, "architecture") === "riscv64") { + const linesRiscV = fs.readFileSync("/proc/cpuinfo").toString().split("\n"); + const uarch = util.getValue(linesRiscV, "uarch") || ""; + if (uarch.indexOf(",") > -1) { + const split = uarch.split(","); + result2.manufacturer = cpuManufacturer(split[0]); + result2.brand = split[1]; + } + } + let lines2 = []; + exec2('export LC_ALL=C; dmidecode \u2013t 4 2>/dev/null | grep "Upgrade: Socket"; unset LC_ALL', function(error2, stdout2) { + lines2 = stdout2.toString().split("\n"); + if (lines2 && lines2.length) { + result2.socket = util.getValue(lines2, "Upgrade").replace("Socket", "").trim() || result2.socket; + } + resolve(result2); + }); + }); + } + if (_freebsd || _openbsd || _netbsd) { + let modelline = ""; + let lines = []; + if (os2.cpus()[0] && os2.cpus()[0].model) { + modelline = os2.cpus()[0].model; + } + exec2("export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL", function(error, stdout) { + let cache = []; + if (!error) { + const data = stdout.toString().split("# dmidecode"); + const processor = data.length > 1 ? data[1] : ""; + cache = data.length > 2 ? data[2].split("Cache Information") : []; + lines = processor.split("\n"); + } + result2.brand = modelline.split("@")[0].trim(); + result2.speed = modelline.split("@")[1] ? parseFloat(modelline.split("@")[1].trim()) : 0; + if (result2.speed === 0 && (result2.brand.indexOf("AMD") > -1 || result2.brand.toLowerCase().indexOf("ryzen") > -1)) { + result2.speed = getAMDSpeed(result2.brand); + } + if (result2.speed === 0) { + const current = getCpuCurrentSpeedSync(); + if (current.avg !== 0) { + result2.speed = current.avg; + } + } + _cpu_speed = result2.speed; + result2.speedMin = result2.speed; + result2.speedMax = Math.round(parseFloat(util.getValue(lines, "max speed").replace(/Mhz/g, "")) / 10) / 100; + result2 = cpuBrandManufacturer(result2); + result2.vendor = cpuManufacturer(util.getValue(lines, "manufacturer")); + let sig = util.getValue(lines, "signature"); + sig = sig.split(","); + for (let i = 0; i < sig.length; i++) { + sig[i] = sig[i].trim(); + } + result2.family = util.getValue(sig, "Family", " ", true); + result2.model = util.getValue(sig, "Model", " ", true); + result2.stepping = util.getValue(sig, "Stepping", " ", true); + result2.revision = ""; + const voltage = parseFloat(util.getValue(lines, "voltage")); + result2.voltage = isNaN(voltage) ? "" : voltage.toFixed(2); + for (let i = 0; i < cache.length; i++) { + lines = cache[i].split("\n"); + let cacheType = util.getValue(lines, "Socket Designation").toLowerCase().replace(" ", "-").split("-"); + cacheType = cacheType.length ? cacheType[0] : ""; + const sizeParts = util.getValue(lines, "Installed Size").split(" "); + let size = parseInt(sizeParts[0], 10); + const unit = sizeParts.length > 1 ? sizeParts[1] : "kb"; + size = size * (unit === "kb" ? 1024 : unit === "mb" ? 1024 * 1024 : unit === "gb" ? 1024 * 1024 * 1024 : 1); + if (cacheType) { + if (cacheType === "l1") { + result2.cache[cacheType + "d"] = size / 2; + result2.cache[cacheType + "i"] = size / 2; + } else { + result2.cache[cacheType] = size; + } + } + } + result2.socket = util.getValue(lines, "Upgrade").replace("Socket", "").trim(); + const threadCount = util.getValue(lines, "thread count").trim(); + const coreCount = util.getValue(lines, "core count").trim(); + if (coreCount && threadCount) { + result2.cores = parseInt(threadCount, 10); + result2.physicalCores = parseInt(coreCount, 10); + } + resolve(result2); + }); + } + if (_sunos) { + resolve(result2); + } + if (_windows) { + try { + const workload = []; + workload.push(util.powerShell("Get-CimInstance Win32_processor | select Name, Revision, L2CacheSize, L3CacheSize, Manufacturer, MaxClockSpeed, Description, UpgradeMethod, Caption, NumberOfLogicalProcessors, NumberOfCores | fl")); + workload.push(util.powerShell("Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl")); + workload.push(util.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")); + Promise.all( + workload + ).then((data) => { + let lines = data[0].split("\r\n"); + let name = util.getValue(lines, "name", ":") || ""; + if (name.indexOf("@") >= 0) { + result2.brand = name.split("@")[0].trim(); + result2.speed = name.split("@")[1] ? parseFloat(name.split("@")[1].trim()) : 0; + _cpu_speed = result2.speed; + } else { + result2.brand = name.trim(); + result2.speed = 0; + } + result2 = cpuBrandManufacturer(result2); + result2.revision = util.getValue(lines, "revision", ":"); + result2.vendor = util.getValue(lines, "manufacturer", ":"); + result2.speedMax = Math.round(parseFloat(util.getValue(lines, "maxclockspeed", ":").replace(/,/g, ".")) / 10) / 100; + if (result2.speed === 0 && (result2.brand.indexOf("AMD") > -1 || result2.brand.toLowerCase().indexOf("ryzen") > -1)) { + result2.speed = getAMDSpeed(result2.brand); + } + if (result2.speed === 0) { + result2.speed = result2.speedMax; + } + result2.speedMin = result2.speed; + let description = util.getValue(lines, "description", ":").split(" "); + for (let i = 0; i < description.length; i++) { + if (description[i].toLowerCase().startsWith("family") && i + 1 < description.length && description[i + 1]) { + result2.family = description[i + 1]; + } + if (description[i].toLowerCase().startsWith("model") && i + 1 < description.length && description[i + 1]) { + result2.model = description[i + 1]; + } + if (description[i].toLowerCase().startsWith("stepping") && i + 1 < description.length && description[i + 1]) { + result2.stepping = description[i + 1]; + } + } + const socketId = util.getValue(lines, "UpgradeMethod", ":"); + if (socketTypes[socketId]) { + result2.socket = socketTypes[socketId]; + } + const socketByName = getSocketTypesByName(name); + if (socketByName) { + result2.socket = socketByName; + } + const countProcessors = util.countLines(lines, "Caption"); + const countThreads = util.getValue(lines, "NumberOfLogicalProcessors", ":"); + const countCores = util.getValue(lines, "NumberOfCores", ":"); + if (countProcessors) { + result2.processors = parseInt(countProcessors) || 1; + } + if (countCores && countThreads) { + result2.cores = parseInt(countThreads) || util.cores(); + result2.physicalCores = parseInt(countCores) || util.cores(); + } + if (countProcessors > 1) { + result2.cores = result2.cores * countProcessors; + result2.physicalCores = result2.physicalCores * countProcessors; + } + result2.cache = parseWinCache(data[0], data[1]); + const hyperv = data[2] ? data[2].toString().toLowerCase() : ""; + result2.virtualization = hyperv.indexOf("true") !== -1; + resolve(result2); + }); + } catch (e) { + resolve(result2); + } + } + }); + }); + }); + } + function cpu(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + getCpu().then((result2) => { + if (callback) { + callback(result2); + } + resolve(result2); + }); + }); + }); + } + exports.cpu = cpu; + function getCpuCurrentSpeedSync() { + let cpus = os2.cpus(); + let minFreq = 999999999; + let maxFreq = 0; + let avgFreq = 0; + let cores = []; + let speeds = []; + if (cpus && cpus.length && cpus[0].speed) { + for (let i in cpus) { + speeds.push(cpus[i].speed > 100 ? (cpus[i].speed + 1) / 1e3 : cpus[i].speed / 10); + } + } else if (_linux) { + try { + const speedStrings = execSync('cat /proc/cpuinfo | grep "cpu MHz" | cut -d " " -f 3', util.execOptsLinux).toString().split("\n").filter((line) => line.length > 0); + for (let i in speedStrings) { + speeds.push(Math.floor(parseInt(speedStrings[i], 10) / 10) / 100); + } + } catch (e) { + util.noop(); + } + } + if (speeds && speeds.length) { + for (let i in speeds) { + avgFreq = avgFreq + speeds[i]; + if (speeds[i] > maxFreq) { + maxFreq = speeds[i]; + } + if (speeds[i] < minFreq) { + minFreq = speeds[i]; + } + cores.push(parseFloat(speeds[i].toFixed(2))); + } + avgFreq = avgFreq / speeds.length; + return { + min: parseFloat(minFreq.toFixed(2)), + max: parseFloat(maxFreq.toFixed(2)), + avg: parseFloat(avgFreq.toFixed(2)), + cores + }; + } else { + return { + min: 0, + max: 0, + avg: 0, + cores + }; + } + } + function cpuCurrentSpeed(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = getCpuCurrentSpeedSync(); + if (result2.avg === 0 && _cpu_speed !== 0) { + const currCpuSpeed = parseFloat(_cpu_speed); + result2 = { + min: currCpuSpeed, + max: currCpuSpeed, + avg: currCpuSpeed, + cores: [] + }; + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + }); + } + exports.cpuCurrentSpeed = cpuCurrentSpeed; + function cpuTemperature(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + main: null, + cores: [], + max: null, + socket: [], + chipset: null + }; + if (_linux) { + try { + const cmd2 = 'cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;'; + const parts = execSync(cmd2, util.execOptsLinux).toString().split("-----\n"); + if (parts.length === 2) { + const lines = parts[0].split("\n"); + const lines2 = parts[1].split("\n"); + for (let i = 0; i < lines.length; i++) { + const line = lines[i].trim(); + if (line.startsWith("acpi") && lines2[i]) { + result2.socket.push(Math.round(parseInt(lines2[i], 10) / 100) / 10); + } + if (line.startsWith("pch") && lines2[i]) { + result2.chipset = Math.round(parseInt(lines2[i], 10) / 100) / 10; + } + } + } + } catch (e) { + util.noop(); + } + const cmd = 'for mon in /sys/class/hwmon/hwmon*; do for label in "$mon"/temp*_label; do if [ -f $label ]; then value=${label%_*}_input; echo $(cat "$label")___$(cat "$value"); fi; done; done;'; + try { + exec2(cmd, function(error, stdout) { + stdout = stdout.toString(); + const tdiePos = stdout.toLowerCase().indexOf("tdie"); + if (tdiePos !== -1) { + stdout = stdout.substring(tdiePos); + } + let lines = stdout.split("\n"); + let tctl = 0; + lines.forEach((line) => { + const parts = line.split("___"); + const label = parts[0]; + const value = parts.length > 1 && parts[1] ? parts[1] : "0"; + if (value && label && label.toLowerCase() === "tctl") { + tctl = result2.main = Math.round(parseInt(value, 10) / 100) / 10; + } + if (value && (label === void 0 || label && label.toLowerCase().startsWith("core"))) { + result2.cores.push(Math.round(parseInt(value, 10) / 100) / 10); + } else if (value && label && result2.main === null && (label.toLowerCase().indexOf("package") >= 0 || label.toLowerCase().indexOf("physical") >= 0 || label.toLowerCase() === "tccd1")) { + result2.main = Math.round(parseInt(value, 10) / 100) / 10; + } + }); + if (tctl && result2.main === null) { + result2.main = tctl; + } + if (result2.cores.length > 0) { + if (result2.main === null) { + result2.main = Math.round(result2.cores.reduce((a, b) => a + b, 0) / result2.cores.length); + } + let maxtmp = Math.max.apply(Math, result2.cores); + result2.max = maxtmp > result2.main ? maxtmp : result2.main; + } + if (result2.main !== null) { + if (result2.max === null) { + result2.max = result2.main; + } + if (callback) { + callback(result2); + } + resolve(result2); + return; + } + exec2("sensors", function(error2, stdout2) { + if (!error2) { + let lines2 = stdout2.toString().split("\n"); + let tdieTemp = null; + let newSectionStarts = true; + let section = ""; + lines2.forEach(function(line) { + if (line.trim() === "") { + newSectionStarts = true; + } else if (newSectionStarts) { + if (line.trim().toLowerCase().startsWith("acpi")) { + section = "acpi"; + } + if (line.trim().toLowerCase().startsWith("pch")) { + section = "pch"; + } + if (line.trim().toLowerCase().startsWith("core")) { + section = "core"; + } + newSectionStarts = false; + } + let regex = /[+-]([^°]*)/g; + let temps = line.match(regex); + let firstPart = line.split(":")[0].toUpperCase(); + if (section === "acpi") { + if (firstPart.indexOf("TEMP") !== -1) { + result2.socket.push(parseFloat(temps)); + } + } else if (section === "pch") { + if (firstPart.indexOf("TEMP") !== -1 && !result2.chipset) { + result2.chipset = parseFloat(temps); + } + } + if (firstPart.indexOf("PHYSICAL") !== -1 || firstPart.indexOf("PACKAGE") !== -1) { + result2.main = parseFloat(temps); + } + if (firstPart.indexOf("CORE ") !== -1) { + result2.cores.push(parseFloat(temps)); + } + if (firstPart.indexOf("TDIE") !== -1 && tdieTemp === null) { + tdieTemp = parseFloat(temps); + } + }); + if (result2.cores.length > 0) { + result2.main = Math.round(result2.cores.reduce((a, b) => a + b, 0) / result2.cores.length); + let maxtmp = Math.max.apply(Math, result2.cores); + result2.max = maxtmp > result2.main ? maxtmp : result2.main; + } else { + if (result2.main === null && tdieTemp !== null) { + result2.main = tdieTemp; + result2.max = tdieTemp; + } + } + if (result2.main !== null || result2.max !== null) { + if (callback) { + callback(result2); + } + resolve(result2); + return; + } + } + fs.stat("/sys/class/thermal/thermal_zone0/temp", function(err) { + if (err === null) { + fs.readFile("/sys/class/thermal/thermal_zone0/temp", function(error3, stdout3) { + if (!error3) { + let lines2 = stdout3.toString().split("\n"); + if (lines2.length > 0) { + result2.main = parseFloat(lines2[0]) / 1e3; + result2.max = result2.main; + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + exec2("/opt/vc/bin/vcgencmd measure_temp", function(error3, stdout3) { + if (!error3) { + let lines2 = stdout3.toString().split("\n"); + if (lines2.length > 0 && lines2[0].indexOf("=")) { + result2.main = parseFloat(lines2[0].split("=")[1]); + result2.max = result2.main; + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + }); + }); + }); + } catch (er) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_freebsd || _openbsd || _netbsd) { + exec2("sysctl dev.cpu | grep temp", function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + let sum = 0; + lines.forEach(function(line) { + const parts = line.split(":"); + if (parts.length > 1) { + const temp = parseFloat(parts[1].replace(",", ".")); + if (temp > result2.max) { + result2.max = temp; + } + sum = sum + temp; + result2.cores.push(temp); + } + }); + if (result2.cores.length) { + result2.main = Math.round(sum / result2.cores.length * 100) / 100; + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_darwin) { + let osxTemp = null; + try { + osxTemp = require("osx-temperature-sensor"); + } catch (er) { + osxTemp = null; + } + if (osxTemp) { + result2 = osxTemp.cpuTemperature(); + if (result2.main) { + result2.main = Math.round(result2.main * 100) / 100; + } + if (result2.max) { + result2.max = Math.round(result2.max * 100) / 100; + } + if (result2.cores && result2.cores.length) { + for (let i = 0; i < result2.cores.length; i++) { + result2.cores[i] = Math.round(result2.cores[i] * 100) / 100; + } + } + } + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_sunos) { + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_windows) { + try { + util.powerShell('Get-CimInstance MSAcpi_ThermalZoneTemperature -Namespace "root/wmi" | Select CurrentTemperature').then((stdout, error) => { + if (!error) { + let sum = 0; + let lines = stdout.split("\r\n").filter((line) => line.trim() !== "").filter((line, idx) => idx > 0); + lines.forEach(function(line) { + let value = (parseInt(line, 10) - 2732) / 10; + if (!isNaN(value)) { + sum = sum + value; + if (value > result2.max) { + result2.max = value; + } + result2.cores.push(value); + } + }); + if (result2.cores.length) { + result2.main = sum / result2.cores.length; + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + exports.cpuTemperature = cpuTemperature; + function cpuFlags(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = ""; + if (_windows) { + try { + exec2('reg query "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0" /v FeatureSet', util.execOptsWin, function(error, stdout) { + if (!error) { + let flag_hex = stdout.split("0x").pop().trim(); + let flag_bin_unpadded = parseInt(flag_hex, 16).toString(2); + let flag_bin = "0".repeat(32 - flag_bin_unpadded.length) + flag_bin_unpadded; + let all_flags = [ + "fpu", + "vme", + "de", + "pse", + "tsc", + "msr", + "pae", + "mce", + "cx8", + "apic", + "", + "sep", + "mtrr", + "pge", + "mca", + "cmov", + "pat", + "pse-36", + "psn", + "clfsh", + "", + "ds", + "acpi", + "mmx", + "fxsr", + "sse", + "sse2", + "ss", + "htt", + "tm", + "ia64", + "pbe" + ]; + for (let f = 0; f < all_flags.length; f++) { + if (flag_bin[f] === "1" && all_flags[f] !== "") { + result2 += " " + all_flags[f]; + } + } + result2 = result2.trim().toLowerCase(); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_linux) { + try { + exec2("export LC_ALL=C; lscpu; unset LC_ALL", function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + lines.forEach(function(line) { + if (line.split(":")[0].toUpperCase().indexOf("FLAGS") !== -1) { + result2 = line.split(":")[1].trim().toLowerCase(); + } + }); + } + if (!result2) { + fs.readFile("/proc/cpuinfo", function(error2, stdout2) { + if (!error2) { + let lines = stdout2.toString().split("\n"); + result2 = util.getValue(lines, "features", ":", true).toLowerCase(); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_freebsd || _openbsd || _netbsd) { + exec2("export LC_ALL=C; dmidecode -t 4 2>/dev/null; unset LC_ALL", function(error, stdout) { + let flags = []; + if (!error) { + let parts = stdout.toString().split(" Flags:"); + const lines = parts.length > 1 ? parts[1].split(" Version:")[0].split("\n") : []; + lines.forEach(function(line) { + let flag = (line.indexOf("(") ? line.split("(")[0].toLowerCase() : "").trim().replace(/\t/g, ""); + if (flag) { + flags.push(flag); + } + }); + } + result2 = flags.join(" ").trim().toLowerCase(); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_darwin) { + exec2("sysctl machdep.cpu.features", function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + if (lines.length > 0 && lines[0].indexOf("machdep.cpu.features:") !== -1) { + result2 = lines[0].split(":")[1].trim().toLowerCase(); + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos) { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + } + exports.cpuFlags = cpuFlags; + function cpuCache(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + l1d: null, + l1i: null, + l2: null, + l3: null + }; + if (_linux) { + try { + exec2("export LC_ALL=C; lscpu; unset LC_ALL", function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + lines.forEach(function(line) { + let parts = line.split(":"); + if (parts[0].toUpperCase().indexOf("L1D CACHE") !== -1) { + result2.l1d = parseInt(parts[1].trim()) * (parts[1].indexOf("M") !== -1 ? 1024 * 1024 : parts[1].indexOf("K") !== -1 ? 1024 : 1); + } + if (parts[0].toUpperCase().indexOf("L1I CACHE") !== -1) { + result2.l1i = parseInt(parts[1].trim()) * (parts[1].indexOf("M") !== -1 ? 1024 * 1024 : parts[1].indexOf("K") !== -1 ? 1024 : 1); + } + if (parts[0].toUpperCase().indexOf("L2 CACHE") !== -1) { + result2.l2 = parseInt(parts[1].trim()) * (parts[1].indexOf("M") !== -1 ? 1024 * 1024 : parts[1].indexOf("K") !== -1 ? 1024 : 1); + } + if (parts[0].toUpperCase().indexOf("L3 CACHE") !== -1) { + result2.l3 = parseInt(parts[1].trim()) * (parts[1].indexOf("M") !== -1 ? 1024 * 1024 : parts[1].indexOf("K") !== -1 ? 1024 : 1); + } + }); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_freebsd || _openbsd || _netbsd) { + exec2("export LC_ALL=C; dmidecode -t 7 2>/dev/null; unset LC_ALL", function(error, stdout) { + let cache = []; + if (!error) { + const data = stdout.toString(); + cache = data.split("Cache Information"); + cache.shift(); + } + for (let i = 0; i < cache.length; i++) { + const lines = cache[i].split("\n"); + let cacheType = util.getValue(lines, "Socket Designation").toLowerCase().replace(" ", "-").split("-"); + cacheType = cacheType.length ? cacheType[0] : ""; + const sizeParts = util.getValue(lines, "Installed Size").split(" "); + let size = parseInt(sizeParts[0], 10); + const unit = sizeParts.length > 1 ? sizeParts[1] : "kb"; + size = size * (unit === "kb" ? 1024 : unit === "mb" ? 1024 * 1024 : unit === "gb" ? 1024 * 1024 * 1024 : 1); + if (cacheType) { + if (cacheType === "l1") { + result2.cache[cacheType + "d"] = size / 2; + result2.cache[cacheType + "i"] = size / 2; + } else { + result2.cache[cacheType] = size; + } + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_darwin) { + exec2("sysctl hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize", function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + lines.forEach(function(line) { + let parts = line.split(":"); + if (parts[0].toLowerCase().indexOf("hw.l1icachesize") !== -1) { + result2.l1d = parseInt(parts[1].trim()) * (parts[1].indexOf("K") !== -1 ? 1024 : 1); + } + if (parts[0].toLowerCase().indexOf("hw.l1dcachesize") !== -1) { + result2.l1i = parseInt(parts[1].trim()) * (parts[1].indexOf("K") !== -1 ? 1024 : 1); + } + if (parts[0].toLowerCase().indexOf("hw.l2cachesize") !== -1) { + result2.l2 = parseInt(parts[1].trim()) * (parts[1].indexOf("K") !== -1 ? 1024 : 1); + } + if (parts[0].toLowerCase().indexOf("hw.l3cachesize") !== -1) { + result2.l3 = parseInt(parts[1].trim()) * (parts[1].indexOf("K") !== -1 ? 1024 : 1); + } + }); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos) { + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_windows) { + try { + const workload = []; + workload.push(util.powerShell("Get-CimInstance Win32_processor | select L2CacheSize, L3CacheSize | fl")); + workload.push(util.powerShell("Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl")); + Promise.all( + workload + ).then((data) => { + result2 = parseWinCache(data[0], data[1]); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + function parseWinCache(linesProc, linesCache) { + let result2 = { + l1d: null, + l1i: null, + l2: null, + l3: null + }; + let lines = linesProc.split("\r\n"); + result2.l1d = 0; + result2.l1i = 0; + result2.l2 = util.getValue(lines, "l2cachesize", ":"); + result2.l3 = util.getValue(lines, "l3cachesize", ":"); + if (result2.l2) { + result2.l2 = parseInt(result2.l2, 10) * 1024; + } else { + result2.l2 = 0; + } + if (result2.l3) { + result2.l3 = parseInt(result2.l3, 10) * 1024; + } else { + result2.l3 = 0; + } + const parts = linesCache.split(/\n\s*\n/); + let l1i = 0; + let l1d = 0; + let l2 = 0; + parts.forEach(function(part) { + const lines2 = part.split("\r\n"); + const cacheType = util.getValue(lines2, "CacheType"); + const level = util.getValue(lines2, "Level"); + const installedSize = util.getValue(lines2, "InstalledSize"); + if (level === "3" && cacheType === "3") { + result2.l1i = result2.l1i + parseInt(installedSize, 10) * 1024; + } + if (level === "3" && cacheType === "4") { + result2.l1d = result2.l1d + parseInt(installedSize, 10) * 1024; + } + if (level === "3" && cacheType === "5") { + l1i = parseInt(installedSize, 10) / 2; + l1d = parseInt(installedSize, 10) / 2; + } + if (level === "4" && cacheType === "5") { + l2 = l2 + parseInt(installedSize, 10) * 1024; + } + }); + if (!result2.l1i && !result2.l1d) { + result2.l1i = l1i; + result2.l1d = l1d; + } + if (l2) { + result2.l2 = l2; + } + return result2; + } + exports.cpuCache = cpuCache; + function getLoad() { + return new Promise((resolve) => { + process.nextTick(() => { + let loads = os2.loadavg().map(function(x) { + return x / util.cores(); + }); + let avgLoad = parseFloat(Math.max.apply(Math, loads).toFixed(2)); + let result2 = {}; + let now = Date.now() - _current_cpu.ms; + if (now >= 200) { + _current_cpu.ms = Date.now(); + const cpus = os2.cpus().map(function(cpu2) { + cpu2.times.steal = 0; + cpu2.times.guest = 0; + return cpu2; + }); + let totalUser = 0; + let totalSystem = 0; + let totalNice = 0; + let totalIrq = 0; + let totalIdle = 0; + let totalSteal = 0; + let totalGuest = 0; + let cores = []; + _corecount = cpus && cpus.length ? cpus.length : 0; + if (_linux) { + try { + const lines = execSync("cat /proc/stat 2>/dev/null | grep cpu", util.execOptsLinux).toString().split("\n"); + if (lines.length > 1) { + lines.shift(); + if (lines.length === cpus.length) { + for (let i = 0; i < lines.length; i++) { + let parts = lines[i].split(" "); + if (parts.length >= 10) { + const steal = parseFloat(parts[8]) || 0; + const guest = parseFloat(parts[9]) || 0; + cpus[i].times.steal = steal; + cpus[i].times.guest = guest; + } + } + } + } + } catch (e) { + util.noop(); + } + } + for (let i = 0; i < _corecount; i++) { + const cpu2 = cpus[i].times; + totalUser += cpu2.user; + totalSystem += cpu2.sys; + totalNice += cpu2.nice; + totalIdle += cpu2.idle; + totalIrq += cpu2.irq; + totalSteal += cpu2.steal || 0; + totalGuest += cpu2.guest || 0; + let tmpTick = _cpus && _cpus[i] && _cpus[i].totalTick ? _cpus[i].totalTick : 0; + let tmpLoad = _cpus && _cpus[i] && _cpus[i].totalLoad ? _cpus[i].totalLoad : 0; + let tmpUser = _cpus && _cpus[i] && _cpus[i].user ? _cpus[i].user : 0; + let tmpSystem = _cpus && _cpus[i] && _cpus[i].sys ? _cpus[i].sys : 0; + let tmpNice = _cpus && _cpus[i] && _cpus[i].nice ? _cpus[i].nice : 0; + let tmpIdle = _cpus && _cpus[i] && _cpus[i].idle ? _cpus[i].idle : 0; + let tmpIrq = _cpus && _cpus[i] && _cpus[i].irq ? _cpus[i].irq : 0; + let tmpSteal = _cpus && _cpus[i] && _cpus[i].steal ? _cpus[i].steal : 0; + let tmpGuest = _cpus && _cpus[i] && _cpus[i].guest ? _cpus[i].guest : 0; + _cpus[i] = cpu2; + _cpus[i].totalTick = _cpus[i].user + _cpus[i].sys + _cpus[i].nice + _cpus[i].irq + _cpus[i].steal + _cpus[i].guest + _cpus[i].idle; + _cpus[i].totalLoad = _cpus[i].user + _cpus[i].sys + _cpus[i].nice + _cpus[i].irq + _cpus[i].steal + _cpus[i].guest; + _cpus[i].currentTick = _cpus[i].totalTick - tmpTick; + _cpus[i].load = _cpus[i].totalLoad - tmpLoad; + _cpus[i].loadUser = _cpus[i].user - tmpUser; + _cpus[i].loadSystem = _cpus[i].sys - tmpSystem; + _cpus[i].loadNice = _cpus[i].nice - tmpNice; + _cpus[i].loadIdle = _cpus[i].idle - tmpIdle; + _cpus[i].loadIrq = _cpus[i].irq - tmpIrq; + _cpus[i].loadSteal = _cpus[i].steal - tmpSteal; + _cpus[i].loadGuest = _cpus[i].guest - tmpGuest; + cores[i] = {}; + cores[i].load = _cpus[i].load / _cpus[i].currentTick * 100; + cores[i].loadUser = _cpus[i].loadUser / _cpus[i].currentTick * 100; + cores[i].loadSystem = _cpus[i].loadSystem / _cpus[i].currentTick * 100; + cores[i].loadNice = _cpus[i].loadNice / _cpus[i].currentTick * 100; + cores[i].loadIdle = _cpus[i].loadIdle / _cpus[i].currentTick * 100; + cores[i].loadIrq = _cpus[i].loadIrq / _cpus[i].currentTick * 100; + cores[i].loadSteal = _cpus[i].loadSteal / _cpus[i].currentTick * 100; + cores[i].loadGuest = _cpus[i].loadGuest / _cpus[i].currentTick * 100; + cores[i].rawLoad = _cpus[i].load; + cores[i].rawLoadUser = _cpus[i].loadUser; + cores[i].rawLoadSystem = _cpus[i].loadSystem; + cores[i].rawLoadNice = _cpus[i].loadNice; + cores[i].rawLoadIdle = _cpus[i].loadIdle; + cores[i].rawLoadIrq = _cpus[i].loadIrq; + cores[i].rawLoadSteal = _cpus[i].loadSteal; + cores[i].rawLoadGuest = _cpus[i].loadGuest; + } + let totalTick = totalUser + totalSystem + totalNice + totalIrq + totalSteal + totalGuest + totalIdle; + let totalLoad = totalUser + totalSystem + totalNice + totalIrq + totalSteal + totalGuest; + let currentTick = totalTick - _current_cpu.tick; + result2 = { + avgLoad, + currentLoad: (totalLoad - _current_cpu.load) / currentTick * 100, + currentLoadUser: (totalUser - _current_cpu.user) / currentTick * 100, + currentLoadSystem: (totalSystem - _current_cpu.system) / currentTick * 100, + currentLoadNice: (totalNice - _current_cpu.nice) / currentTick * 100, + currentLoadIdle: (totalIdle - _current_cpu.idle) / currentTick * 100, + currentLoadIrq: (totalIrq - _current_cpu.irq) / currentTick * 100, + currentLoadSteal: (totalSteal - _current_cpu.steal) / currentTick * 100, + currentLoadGuest: (totalGuest - _current_cpu.guest) / currentTick * 100, + rawCurrentLoad: totalLoad - _current_cpu.load, + rawCurrentLoadUser: totalUser - _current_cpu.user, + rawCurrentLoadSystem: totalSystem - _current_cpu.system, + rawCurrentLoadNice: totalNice - _current_cpu.nice, + rawCurrentLoadIdle: totalIdle - _current_cpu.idle, + rawCurrentLoadIrq: totalIrq - _current_cpu.irq, + rawCurrentLoadSteal: totalSteal - _current_cpu.steal, + rawCurrentLoadGuest: totalGuest - _current_cpu.guest, + cpus: cores + }; + _current_cpu = { + user: totalUser, + nice: totalNice, + system: totalSystem, + idle: totalIdle, + irq: totalIrq, + steal: totalSteal, + guest: totalGuest, + tick: totalTick, + load: totalLoad, + ms: _current_cpu.ms, + currentLoad: result2.currentLoad, + currentLoadUser: result2.currentLoadUser, + currentLoadSystem: result2.currentLoadSystem, + currentLoadNice: result2.currentLoadNice, + currentLoadIdle: result2.currentLoadIdle, + currentLoadIrq: result2.currentLoadIrq, + currentLoadSteal: result2.currentLoadSteal, + currentLoadGuest: result2.currentLoadGuest, + rawCurrentLoad: result2.rawCurrentLoad, + rawCurrentLoadUser: result2.rawCurrentLoadUser, + rawCurrentLoadSystem: result2.rawCurrentLoadSystem, + rawCurrentLoadNice: result2.rawCurrentLoadNice, + rawCurrentLoadIdle: result2.rawCurrentLoadIdle, + rawCurrentLoadIrq: result2.rawCurrentLoadIrq, + rawCurrentLoadSteal: result2.rawCurrentLoadSteal, + rawCurrentLoadGuest: result2.rawCurrentLoadGuest + }; + } else { + let cores = []; + for (let i = 0; i < _corecount; i++) { + cores[i] = {}; + cores[i].load = _cpus[i].load / _cpus[i].currentTick * 100; + cores[i].loadUser = _cpus[i].loadUser / _cpus[i].currentTick * 100; + cores[i].loadSystem = _cpus[i].loadSystem / _cpus[i].currentTick * 100; + cores[i].loadNice = _cpus[i].loadNice / _cpus[i].currentTick * 100; + cores[i].loadIdle = _cpus[i].loadIdle / _cpus[i].currentTick * 100; + cores[i].loadIrq = _cpus[i].loadIrq / _cpus[i].currentTick * 100; + cores[i].rawLoad = _cpus[i].load; + cores[i].rawLoadUser = _cpus[i].loadUser; + cores[i].rawLoadSystem = _cpus[i].loadSystem; + cores[i].rawLoadNice = _cpus[i].loadNice; + cores[i].rawLoadIdle = _cpus[i].loadIdle; + cores[i].rawLoadIrq = _cpus[i].loadIrq; + cores[i].rawLoadSteal = _cpus[i].loadSteal; + cores[i].rawLoadGuest = _cpus[i].loadGuest; + } + result2 = { + avgLoad, + currentLoad: _current_cpu.currentLoad, + currentLoadUser: _current_cpu.currentLoadUser, + currentLoadSystem: _current_cpu.currentLoadSystem, + currentLoadNice: _current_cpu.currentLoadNice, + currentLoadIdle: _current_cpu.currentLoadIdle, + currentLoadIrq: _current_cpu.currentLoadIrq, + currentLoadSteal: _current_cpu.currentLoadSteal, + currentLoadGuest: _current_cpu.currentLoadGuest, + rawCurrentLoad: _current_cpu.rawCurrentLoad, + rawCurrentLoadUser: _current_cpu.rawCurrentLoadUser, + rawCurrentLoadSystem: _current_cpu.rawCurrentLoadSystem, + rawCurrentLoadNice: _current_cpu.rawCurrentLoadNice, + rawCurrentLoadIdle: _current_cpu.rawCurrentLoadIdle, + rawCurrentLoadIrq: _current_cpu.rawCurrentLoadIrq, + rawCurrentLoadSteal: _current_cpu.rawCurrentLoadSteal, + rawCurrentLoadGuest: _current_cpu.rawCurrentLoadGuest, + cpus: cores + }; + } + resolve(result2); + }); + }); + } + function currentLoad(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + getLoad().then((result2) => { + if (callback) { + callback(result2); + } + resolve(result2); + }); + }); + }); + } + exports.currentLoad = currentLoad; + function getFullLoad() { + return new Promise((resolve) => { + process.nextTick(() => { + const cpus = os2.cpus(); + let totalUser = 0; + let totalSystem = 0; + let totalNice = 0; + let totalIrq = 0; + let totalIdle = 0; + let result2 = 0; + if (cpus && cpus.length) { + for (let i = 0, len = cpus.length; i < len; i++) { + const cpu2 = cpus[i].times; + totalUser += cpu2.user; + totalSystem += cpu2.sys; + totalNice += cpu2.nice; + totalIrq += cpu2.irq; + totalIdle += cpu2.idle; + } + let totalTicks = totalIdle + totalIrq + totalNice + totalSystem + totalUser; + result2 = (totalTicks - totalIdle) / totalTicks * 100; + } + resolve(result2); + }); + }); + } + function fullLoad(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + getFullLoad().then((result2) => { + if (callback) { + callback(result2); + } + resolve(result2); + }); + }); + }); + } + exports.fullLoad = fullLoad; + } +}); + +// node_modules/systeminformation/lib/memory.js +var require_memory = __commonJS({ + "node_modules/systeminformation/lib/memory.js"(exports) { + "use strict"; + var os2 = require("os"); + var exec2 = require("child_process").exec; + var execSync = require("child_process").execSync; + var util = require_util2(); + var fs = require("fs"); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + var OSX_RAM_manufacturers = { + "0x014F": "Transcend Information", + "0x2C00": "Micron Technology Inc.", + "0x802C": "Micron Technology Inc.", + "0x80AD": "Hynix Semiconductor Inc.", + "0x80CE": "Samsung Electronics Inc.", + "0xAD00": "Hynix Semiconductor Inc.", + "0xCE00": "Samsung Electronics Inc.", + "0x02FE": "Elpida", + "0x5105": "Qimonda AG i. In.", + "0x8551": "Qimonda AG i. In.", + "0x859B": "Crucial", + "0x04CD": "G-Skill" + }; + var LINUX_RAM_manufacturers = { + "017A": "Apacer", + "0198": "HyperX", + "029E": "Corsair", + "04CB": "A-DATA", + "04CD": "G-Skill", + "059B": "Crucial", + "00CE": "Samsung", + "1315": "Crucial", + "014F": "Transcend Information", + "2C00": "Micron Technology Inc.", + "802C": "Micron Technology Inc.", + "80AD": "Hynix Semiconductor Inc.", + "80CE": "Samsung Electronics Inc.", + "AD00": "Hynix Semiconductor Inc.", + "CE00": "Samsung Electronics Inc.", + "02FE": "Elpida", + "5105": "Qimonda AG i. In.", + "8551": "Qimonda AG i. In.", + "859B": "Crucial" + }; + function mem(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + total: os2.totalmem(), + free: os2.freemem(), + used: os2.totalmem() - os2.freemem(), + active: os2.totalmem() - os2.freemem(), + // temporarily (fallback) + available: os2.freemem(), + // temporarily (fallback) + buffers: 0, + cached: 0, + slab: 0, + buffcache: 0, + swaptotal: 0, + swapused: 0, + swapfree: 0, + writeback: null, + dirty: null + }; + if (_linux) { + try { + fs.readFile("/proc/meminfo", function(error, stdout) { + if (!error) { + const lines = stdout.toString().split("\n"); + result2.total = parseInt(util.getValue(lines, "memtotal"), 10); + result2.total = result2.total ? result2.total * 1024 : os2.totalmem(); + result2.free = parseInt(util.getValue(lines, "memfree"), 10); + result2.free = result2.free ? result2.free * 1024 : os2.freemem(); + result2.used = result2.total - result2.free; + result2.buffers = parseInt(util.getValue(lines, "buffers"), 10); + result2.buffers = result2.buffers ? result2.buffers * 1024 : 0; + result2.cached = parseInt(util.getValue(lines, "cached"), 10); + result2.cached = result2.cached ? result2.cached * 1024 : 0; + result2.slab = parseInt(util.getValue(lines, "slab"), 10); + result2.slab = result2.slab ? result2.slab * 1024 : 0; + result2.buffcache = result2.buffers + result2.cached + result2.slab; + let available = parseInt(util.getValue(lines, "memavailable"), 10); + result2.available = available ? available * 1024 : result2.free + result2.buffcache; + result2.active = result2.total - result2.available; + result2.swaptotal = parseInt(util.getValue(lines, "swaptotal"), 10); + result2.swaptotal = result2.swaptotal ? result2.swaptotal * 1024 : 0; + result2.swapfree = parseInt(util.getValue(lines, "swapfree"), 10); + result2.swapfree = result2.swapfree ? result2.swapfree * 1024 : 0; + result2.swapused = result2.swaptotal - result2.swapfree; + result2.writeback = parseInt(util.getValue(lines, "writeback"), 10); + result2.writeback = result2.writeback ? result2.writeback * 1024 : 0; + result2.dirty = parseInt(util.getValue(lines, "dirty"), 10); + result2.dirty = result2.dirty ? result2.dirty * 1024 : 0; + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_freebsd || _openbsd || _netbsd) { + try { + exec2("/sbin/sysctl hw.realmem hw.physmem vm.stats.vm.v_page_count vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count vm.stats.vm.v_page_size", function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + const pagesize = parseInt(util.getValue(lines, "vm.stats.vm.v_page_size"), 10); + const inactive = parseInt(util.getValue(lines, "vm.stats.vm.v_inactive_count"), 10) * pagesize; + const cache = parseInt(util.getValue(lines, "vm.stats.vm.v_cache_count"), 10) * pagesize; + result2.total = parseInt(util.getValue(lines, "hw.realmem"), 10); + if (isNaN(result2.total)) { + result2.total = parseInt(util.getValue(lines, "hw.physmem"), 10); + } + result2.free = parseInt(util.getValue(lines, "vm.stats.vm.v_free_count"), 10) * pagesize; + result2.buffcache = inactive + cache; + result2.available = result2.buffcache + result2.free; + result2.active = result2.total - result2.free - result2.buffcache; + result2.swaptotal = 0; + result2.swapfree = 0; + result2.swapused = 0; + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_sunos) { + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_darwin) { + let pageSize = 4096; + try { + let sysPpageSize = util.toInt(execSync("sysctl -n vm.pagesize").toString()); + pageSize = sysPpageSize || pageSize; + } catch (e) { + util.noop(); + } + try { + exec2('vm_stat 2>/dev/null | grep "Pages active"', function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + result2.active = parseInt(lines[0].split(":")[1], 10) * pageSize; + result2.buffcache = result2.used - result2.active; + result2.available = result2.free + result2.buffcache; + } + exec2("sysctl -n vm.swapusage 2>/dev/null", function(error2, stdout2) { + if (!error2) { + let lines = stdout2.toString().split("\n"); + if (lines.length > 0) { + let firstline = lines[0].replace(/,/g, ".").replace(/M/g, ""); + let lineArray = firstline.trim().split(" "); + lineArray.forEach((line) => { + if (line.toLowerCase().indexOf("total") !== -1) { + result2.swaptotal = parseFloat(line.split("=")[1].trim()) * 1024 * 1024; + } + if (line.toLowerCase().indexOf("used") !== -1) { + result2.swapused = parseFloat(line.split("=")[1].trim()) * 1024 * 1024; + } + if (line.toLowerCase().indexOf("free") !== -1) { + result2.swapfree = parseFloat(line.split("=")[1].trim()) * 1024 * 1024; + } + }); + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_windows) { + let swaptotal = 0; + let swapused = 0; + try { + util.powerShell("Get-CimInstance Win32_PageFileUsage | Select AllocatedBaseSize, CurrentUsage").then((stdout, error) => { + if (!error) { + let lines = stdout.split("\r\n").filter((line) => line.trim() !== "").filter((line, idx) => idx > 0); + lines.forEach(function(line) { + if (line !== "") { + line = line.trim().split(/\s\s+/); + swaptotal = swaptotal + (parseInt(line[0], 10) || 0); + swapused = swapused + (parseInt(line[1], 10) || 0); + } + }); + } + result2.swaptotal = swaptotal * 1024 * 1024; + result2.swapused = swapused * 1024 * 1024; + result2.swapfree = result2.swaptotal - result2.swapused; + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + exports.mem = mem; + function memLayout(callback) { + function getManufacturerDarwin(manId) { + if ({}.hasOwnProperty.call(OSX_RAM_manufacturers, manId)) { + return OSX_RAM_manufacturers[manId]; + } + return manId; + } + function getManufacturerLinux(manId) { + const manIdSearch = manId.replace("0x", "").toUpperCase(); + if (manIdSearch.length === 4 && {}.hasOwnProperty.call(LINUX_RAM_manufacturers, manIdSearch)) { + return LINUX_RAM_manufacturers[manIdSearch]; + } + return manId; + } + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = []; + if (_linux || _freebsd || _openbsd || _netbsd) { + exec2('export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL', function(error, stdout) { + if (!error) { + let devices = stdout.toString().split("Memory Device"); + devices.shift(); + devices.forEach(function(device) { + let lines = device.split("\n"); + const sizeString = util.getValue(lines, "Size"); + const size = sizeString.indexOf("GB") >= 0 ? parseInt(sizeString, 10) * 1024 * 1024 * 1024 : parseInt(sizeString, 10) * 1024 * 1024; + let bank = util.getValue(lines, "Bank Locator"); + if (bank.toLowerCase().indexOf("bad") >= 0) { + bank = ""; + } + if (parseInt(util.getValue(lines, "Size"), 10) > 0) { + const totalWidth = util.toInt(util.getValue(lines, "Total Width")); + const dataWidth = util.toInt(util.getValue(lines, "Data Width")); + result2.push({ + size, + bank, + type: util.getValue(lines, "Type:"), + ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false, + clockSpeed: util.getValue(lines, "Configured Clock Speed:") ? parseInt(util.getValue(lines, "Configured Clock Speed:"), 10) : util.getValue(lines, "Speed:") ? parseInt(util.getValue(lines, "Speed:"), 10) : null, + formFactor: util.getValue(lines, "Form Factor:"), + manufacturer: getManufacturerLinux(util.getValue(lines, "Manufacturer:")), + partNum: util.getValue(lines, "Part Number:"), + serialNum: util.getValue(lines, "Serial Number:"), + voltageConfigured: parseFloat(util.getValue(lines, "Configured Voltage:")) || null, + voltageMin: parseFloat(util.getValue(lines, "Minimum Voltage:")) || null, + voltageMax: parseFloat(util.getValue(lines, "Maximum Voltage:")) || null + }); + } else { + result2.push({ + size: 0, + bank, + type: "Empty", + ecc: null, + clockSpeed: 0, + formFactor: util.getValue(lines, "Form Factor:"), + partNum: "", + serialNum: "", + voltageConfigured: null, + voltageMin: null, + voltageMax: null + }); + } + }); + } + if (!result2.length) { + result2.push({ + size: os2.totalmem(), + bank: "", + type: "", + ecc: null, + clockSpeed: 0, + formFactor: "", + partNum: "", + serialNum: "", + voltageConfigured: null, + voltageMin: null, + voltageMax: null + }); + try { + let stdout2 = execSync("cat /proc/cpuinfo 2>/dev/null", util.execOptsLinux); + let lines = stdout2.toString().split("\n"); + let version = util.getValue(lines, "revision", ":", true).toLowerCase(); + if (util.isRaspberry(lines)) { + const clockSpeed = { + "0": 400, + "1": 450, + "2": 450, + "3": 3200, + "4": 4267 + }; + result2[0].type = "LPDDR2"; + result2[0].type = version && version[2] && version[2] === "3" ? "LPDDR4" : result2[0].type; + result2[0].type = version && version[2] && version[2] === "4" ? "LPDDR4X" : result2[0].type; + result2[0].ecc = false; + result2[0].clockSpeed = version && version[2] && clockSpeed[version[2]] || 400; + result2[0].clockSpeed = version && version[4] && version[4] === "d" ? 500 : result2[0].clockSpeed; + result2[0].formFactor = "SoC"; + stdout2 = execSync("vcgencmd get_config sdram_freq 2>/dev/null", util.execOptsLinux); + lines = stdout2.toString().split("\n"); + let freq = parseInt(util.getValue(lines, "sdram_freq", "=", true), 10) || 0; + if (freq) { + result2[0].clockSpeed = freq; + } + stdout2 = execSync("vcgencmd measure_volts sdram_p 2>/dev/null", util.execOptsLinux); + lines = stdout2.toString().split("\n"); + let voltage = parseFloat(util.getValue(lines, "volt", "=", true)) || 0; + if (voltage) { + result2[0].voltageConfigured = voltage; + result2[0].voltageMin = voltage; + result2[0].voltageMax = voltage; + } + } + } catch (e) { + util.noop(); + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_darwin) { + exec2("system_profiler SPMemoryDataType", function(error, stdout) { + if (!error) { + const allLines = stdout.toString().split("\n"); + const eccStatus = util.getValue(allLines, "ecc", ":", true).toLowerCase(); + let devices = stdout.toString().split(" BANK "); + let hasBank = true; + if (devices.length === 1) { + devices = stdout.toString().split(" DIMM"); + hasBank = false; + } + devices.shift(); + devices.forEach(function(device) { + let lines = device.split("\n"); + const bank = (hasBank ? "BANK " : "DIMM") + lines[0].trim().split("/")[0]; + const size = parseInt(util.getValue(lines, " Size")); + if (size) { + result2.push({ + size: size * 1024 * 1024 * 1024, + bank, + type: util.getValue(lines, " Type:"), + ecc: eccStatus ? eccStatus === "enabled" : null, + clockSpeed: parseInt(util.getValue(lines, " Speed:"), 10), + formFactor: "", + manufacturer: getManufacturerDarwin(util.getValue(lines, " Manufacturer:")), + partNum: util.getValue(lines, " Part Number:"), + serialNum: util.getValue(lines, " Serial Number:"), + voltageConfigured: null, + voltageMin: null, + voltageMax: null + }); + } else { + result2.push({ + size: 0, + bank, + type: "Empty", + ecc: null, + clockSpeed: 0, + formFactor: "", + manufacturer: "", + partNum: "", + serialNum: "", + voltageConfigured: null, + voltageMin: null, + voltageMax: null + }); + } + }); + } + if (!result2.length) { + const lines = stdout.toString().split("\n"); + const size = parseInt(util.getValue(lines, " Memory:")); + const type = util.getValue(lines, " Type:"); + const manufacturerId = util.getValue(lines, " Manufacturer:"); + if (size && type) { + result2.push({ + size: size * 1024 * 1024 * 1024, + bank: "0", + type, + ecc: false, + clockSpeed: null, + formFactor: "SOC", + manufacturer: getManufacturerDarwin(manufacturerId), + partNum: "", + serialNum: "", + voltageConfigured: null, + voltageMin: null, + voltageMax: null + }); + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos) { + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_windows) { + const memoryTypes = "Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4|Logical non-volatile device|HBM|HBM2|DDR5|LPDDR5".split("|"); + const FormFactors = "Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA".split("|"); + try { + util.powerShell("Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,Speed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage,Tag | fl").then((stdout, error) => { + if (!error) { + let devices = stdout.toString().split(/\n\s*\n/); + devices.shift(); + devices.forEach(function(device) { + let lines = device.split("\r\n"); + const dataWidth = util.toInt(util.getValue(lines, "DataWidth", ":")); + const totalWidth = util.toInt(util.getValue(lines, "TotalWidth", ":")); + const size = parseInt(util.getValue(lines, "Capacity", ":"), 10) || 0; + const tag = util.getValue(lines, "Tag", ":"); + const tagInt = util.splitByNumber(tag); + if (size) { + result2.push({ + size, + bank: util.getValue(lines, "BankLabel", ":") + (tagInt[1] ? "/" + tagInt[1] : ""), + // BankLabel + type: memoryTypes[parseInt(util.getValue(lines, "MemoryType", ":"), 10) || parseInt(util.getValue(lines, "SMBIOSMemoryType", ":"), 10)], + ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false, + clockSpeed: parseInt(util.getValue(lines, "ConfiguredClockSpeed", ":"), 10) || parseInt(util.getValue(lines, "Speed", ":"), 10) || 0, + formFactor: FormFactors[parseInt(util.getValue(lines, "FormFactor", ":"), 10) || 0], + manufacturer: util.getValue(lines, "Manufacturer", ":"), + partNum: util.getValue(lines, "PartNumber", ":"), + serialNum: util.getValue(lines, "SerialNumber", ":"), + voltageConfigured: (parseInt(util.getValue(lines, "ConfiguredVoltage", ":"), 10) || 0) / 1e3, + voltageMin: (parseInt(util.getValue(lines, "MinVoltage", ":"), 10) || 0) / 1e3, + voltageMax: (parseInt(util.getValue(lines, "MaxVoltage", ":"), 10) || 0) / 1e3 + }); + } + }); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + exports.memLayout = memLayout; + } +}); + +// node_modules/systeminformation/lib/battery.js +var require_battery = __commonJS({ + "node_modules/systeminformation/lib/battery.js"(exports, module2) { + "use strict"; + var exec2 = require("child_process").exec; + var fs = require("fs"); + var util = require_util2(); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + function parseWinBatteryPart(lines, designedCapacity, fullChargeCapacity) { + const result2 = {}; + let status = util.getValue(lines, "BatteryStatus", ":").trim(); + if (status >= 0) { + const statusValue = status ? parseInt(status) : 0; + result2.status = statusValue; + result2.hasBattery = true; + result2.maxCapacity = fullChargeCapacity || parseInt(util.getValue(lines, "DesignCapacity", ":") || 0); + result2.designedCapacity = parseInt(util.getValue(lines, "DesignCapacity", ":") || designedCapacity); + result2.voltage = parseInt(util.getValue(lines, "DesignVoltage", ":") || 0) / 1e3; + result2.capacityUnit = "mWh"; + result2.percent = parseInt(util.getValue(lines, "EstimatedChargeRemaining", ":") || 0); + result2.currentCapacity = parseInt(result2.maxCapacity * result2.percent / 100); + result2.isCharging = statusValue >= 6 && statusValue <= 9 || statusValue === 11 || statusValue !== 3 && statusValue !== 1 && result2.percent < 100; + result2.acConnected = result2.isCharging || statusValue === 2; + result2.model = util.getValue(lines, "DeviceID", ":"); + } else { + result2.status = -1; + } + return result2; + } + module2.exports = function(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + hasBattery: false, + cycleCount: 0, + isCharging: false, + designedCapacity: 0, + maxCapacity: 0, + currentCapacity: 0, + voltage: 0, + capacityUnit: "", + percent: 0, + timeRemaining: null, + acConnected: true, + type: "", + model: "", + manufacturer: "", + serial: "" + }; + if (_linux) { + let battery_path = ""; + if (fs.existsSync("/sys/class/power_supply/BAT1/uevent")) { + battery_path = "/sys/class/power_supply/BAT1/"; + } else if (fs.existsSync("/sys/class/power_supply/BAT0/uevent")) { + battery_path = "/sys/class/power_supply/BAT0/"; + } + let acConnected = false; + let acPath = ""; + if (fs.existsSync("/sys/class/power_supply/AC/online")) { + acPath = "/sys/class/power_supply/AC/online"; + } else if (fs.existsSync("/sys/class/power_supply/AC0/online")) { + acPath = "/sys/class/power_supply/AC0/online"; + } + if (acPath) { + const file = fs.readFileSync(acPath); + acConnected = file.toString().trim() === "1"; + } + if (battery_path) { + fs.readFile(battery_path + "uevent", function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + result2.isCharging = util.getValue(lines, "POWER_SUPPLY_STATUS", "=").toLowerCase() === "charging"; + result2.acConnected = acConnected || result2.isCharging; + result2.voltage = parseInt("0" + util.getValue(lines, "POWER_SUPPLY_VOLTAGE_NOW", "="), 10) / 1e6; + result2.capacityUnit = result2.voltage ? "mWh" : "mAh"; + result2.cycleCount = parseInt("0" + util.getValue(lines, "POWER_SUPPLY_CYCLE_COUNT", "="), 10); + result2.maxCapacity = Math.round(parseInt("0" + util.getValue(lines, "POWER_SUPPLY_CHARGE_FULL", "=", true, true), 10) / 1e3 * (result2.voltage || 1)); + const desingedMinVoltage = parseInt("0" + util.getValue(lines, "POWER_SUPPLY_VOLTAGE_MIN_DESIGN", "="), 10) / 1e6; + result2.designedCapacity = Math.round(parseInt("0" + util.getValue(lines, "POWER_SUPPLY_CHARGE_FULL_DESIGN", "=", true, true), 10) / 1e3 * (desingedMinVoltage || result2.voltage || 1)); + result2.currentCapacity = Math.round(parseInt("0" + util.getValue(lines, "POWER_SUPPLY_CHARGE_NOW", "="), 10) / 1e3 * (result2.voltage || 1)); + if (!result2.maxCapacity) { + result2.maxCapacity = parseInt("0" + util.getValue(lines, "POWER_SUPPLY_ENERGY_FULL", "=", true, true), 10) / 1e3; + result2.designedCapacity = parseInt("0" + util.getValue(lines, "POWER_SUPPLY_ENERGY_FULL_DESIGN", "=", true, true), 10) / 1e3 | result2.maxCapacity; + result2.currentCapacity = parseInt("0" + util.getValue(lines, "POWER_SUPPLY_ENERGY_NOW", "="), 10) / 1e3; + } + const percent = util.getValue(lines, "POWER_SUPPLY_CAPACITY", "="); + const energy = parseInt("0" + util.getValue(lines, "POWER_SUPPLY_ENERGY_NOW", "="), 10); + const power = parseInt("0" + util.getValue(lines, "POWER_SUPPLY_POWER_NOW", "="), 10); + const current = parseInt("0" + util.getValue(lines, "POWER_SUPPLY_CURRENT_NOW", "="), 10); + const charge = parseInt("0" + util.getValue(lines, "POWER_SUPPLY_CHARGE_NOW", "="), 10); + result2.percent = parseInt("0" + percent, 10); + if (result2.maxCapacity && result2.currentCapacity) { + result2.hasBattery = true; + if (!percent) { + result2.percent = 100 * result2.currentCapacity / result2.maxCapacity; + } + } + if (result2.isCharging) { + result2.hasBattery = true; + } + if (energy && power) { + result2.timeRemaining = Math.floor(energy / power * 60); + } else if (current && charge) { + result2.timeRemaining = Math.floor(charge / current * 60); + } else if (current && result2.currentCapacity) { + result2.timeRemaining = Math.floor(result2.currentCapacity / current * 60); + } + result2.type = util.getValue(lines, "POWER_SUPPLY_TECHNOLOGY", "="); + result2.model = util.getValue(lines, "POWER_SUPPLY_MODEL_NAME", "="); + result2.manufacturer = util.getValue(lines, "POWER_SUPPLY_MANUFACTURER", "="); + result2.serial = util.getValue(lines, "POWER_SUPPLY_SERIAL_NUMBER", "="); + if (callback) { + callback(result2); + } + resolve(result2); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_freebsd || _openbsd || _netbsd) { + exec2("sysctl -i hw.acpi.battery hw.acpi.acline", function(error, stdout) { + let lines = stdout.toString().split("\n"); + const batteries = parseInt("0" + util.getValue(lines, "hw.acpi.battery.units"), 10); + const percent = parseInt("0" + util.getValue(lines, "hw.acpi.battery.life"), 10); + result2.hasBattery = batteries > 0; + result2.cycleCount = null; + result2.isCharging = util.getValue(lines, "hw.acpi.acline") !== "1"; + result2.acConnected = result2.isCharging; + result2.maxCapacity = null; + result2.currentCapacity = null; + result2.capacityUnit = "unknown"; + result2.percent = batteries ? percent : null; + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_darwin) { + exec2('ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|DeviceName|BatterySerialNumber|Serial|TimeRemaining|Voltage"; pmset -g batt | grep %', function(error, stdout) { + if (stdout) { + let lines = stdout.toString().replace(/ +/g, "").replace(/"+/g, "").replace(/-/g, "").split("\n"); + result2.cycleCount = parseInt("0" + util.getValue(lines, "cyclecount", "="), 10); + result2.voltage = parseInt("0" + util.getValue(lines, "voltage", "="), 10) / 1e3; + result2.capacityUnit = result2.voltage ? "mWh" : "mAh"; + result2.maxCapacity = Math.round(parseInt("0" + util.getValue(lines, "applerawmaxcapacity", "="), 10) * (result2.voltage || 1)); + result2.currentCapacity = Math.round(parseInt("0" + util.getValue(lines, "applerawcurrentcapacity", "="), 10) * (result2.voltage || 1)); + result2.designedCapacity = Math.round(parseInt("0" + util.getValue(lines, "DesignCapacity", "="), 10) * (result2.voltage || 1)); + result2.manufacturer = "Apple"; + result2.serial = util.getValue(lines, "BatterySerialNumber", "=") || util.getValue(lines, "Serial", "="); + result2.model = util.getValue(lines, "DeviceName", "="); + let percent = null; + const line = util.getValue(lines, "internal", "Battery"); + let parts = line.split(";"); + if (parts && parts[0]) { + let parts2 = parts[0].split(" "); + if (parts2 && parts2[1]) { + percent = parseFloat(parts2[1].trim().replace(/%/g, "")); + } + } + if (parts && parts[1]) { + result2.isCharging = parts[1].trim() === "charging"; + result2.acConnected = parts[1].trim() !== "discharging"; + } else { + result2.isCharging = util.getValue(lines, "ischarging", "=").toLowerCase() === "yes"; + result2.acConnected = result2.isCharging; + } + if (result2.maxCapacity && result2.currentCapacity) { + result2.hasBattery = true; + result2.type = "Li-ion"; + result2.percent = percent !== null ? percent : Math.round(100 * result2.currentCapacity / result2.maxCapacity); + if (!result2.isCharging) { + result2.timeRemaining = parseInt("0" + util.getValue(lines, "TimeRemaining", "="), 10); + } + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos) { + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_windows) { + try { + const workload = []; + workload.push(util.powerShell("Get-CimInstance Win32_Battery | select BatteryStatus, DesignCapacity, DesignVoltage, EstimatedChargeRemaining, DeviceID | fl")); + workload.push(util.powerShell("(Get-WmiObject -Class BatteryStaticData -Namespace ROOT/WMI).DesignedCapacity")); + workload.push(util.powerShell("(Get-CimInstance -Class BatteryFullChargedCapacity -Namespace ROOT/WMI).FullChargedCapacity")); + util.promiseAll( + workload + ).then((data) => { + if (data) { + let parts = data.results[0].split(/\n\s*\n/); + let batteries = []; + const hasValue = (value) => /\S/.test(value); + for (let i = 0; i < parts.length; i++) { + if (hasValue(parts[i]) && (!batteries.length || !hasValue(parts[i - 1]))) { + batteries.push([]); + } + if (hasValue(parts[i])) { + batteries[batteries.length - 1].push(parts[i]); + } + } + let designCapacities = data.results[1].split("\r\n").filter((e) => e); + let fullChargeCapacities = data.results[2].split("\r\n").filter((e) => e); + if (batteries.length) { + let first = false; + let additionalBatteries = []; + for (let i = 0; i < batteries.length; i++) { + let lines = batteries[i][0].split("\r\n"); + const designedCapacity = designCapacities && designCapacities.length >= i + 1 && designCapacities[i] ? util.toInt(designCapacities[i]) : 0; + const fullChargeCapacity = fullChargeCapacities && fullChargeCapacities.length >= i + 1 && fullChargeCapacities[i] ? util.toInt(fullChargeCapacities[i]) : 0; + const parsed = parseWinBatteryPart(lines, designedCapacity, fullChargeCapacity); + if (!first && parsed.status > 0 && parsed.status !== 10) { + result2.hasBattery = parsed.hasBattery; + result2.maxCapacity = parsed.maxCapacity; + result2.designedCapacity = parsed.designedCapacity; + result2.voltage = parsed.voltage; + result2.capacityUnit = parsed.capacityUnit; + result2.percent = parsed.percent; + result2.currentCapacity = parsed.currentCapacity; + result2.isCharging = parsed.isCharging; + result2.acConnected = parsed.acConnected; + result2.model = parsed.model; + first = true; + } else if (parsed.status !== -1) { + additionalBatteries.push( + { + hasBattery: parsed.hasBattery, + maxCapacity: parsed.maxCapacity, + designedCapacity: parsed.designedCapacity, + voltage: parsed.voltage, + capacityUnit: parsed.capacityUnit, + percent: parsed.percent, + currentCapacity: parsed.currentCapacity, + isCharging: parsed.isCharging, + timeRemaining: null, + acConnected: parsed.acConnected, + model: parsed.model, + type: "", + manufacturer: "", + serial: "" + } + ); + } + } + if (!first && additionalBatteries.length) { + result2 = additionalBatteries[0]; + additionalBatteries.shift(); + } + if (additionalBatteries.length) { + result2.additionalBatteries = additionalBatteries; + } + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + }; + } +}); + +// node_modules/systeminformation/lib/graphics.js +var require_graphics = __commonJS({ + "node_modules/systeminformation/lib/graphics.js"(exports) { + "use strict"; + var fs = require("fs"); + var exec2 = require("child_process").exec; + var execSync = require("child_process").execSync; + var util = require_util2(); + var _platform = process.platform; + var _nvidiaSmiPath = ""; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + var _resolutionX = 0; + var _resolutionY = 0; + var _pixelDepth = 0; + var _refreshRate = 0; + var videoTypes = { + "-2": "UNINITIALIZED", + "-1": "OTHER", + "0": "HD15", + "1": "SVIDEO", + "2": "Composite video", + "3": "Component video", + "4": "DVI", + "5": "HDMI", + "6": "LVDS", + "8": "D_JPN", + "9": "SDI", + "10": "DP", + "11": "DP embedded", + "12": "UDI", + "13": "UDI embedded", + "14": "SDTVDONGLE", + "15": "MIRACAST", + "2147483648": "INTERNAL" + }; + function getVendorFromModel(model) { + const manufacturers = [ + { pattern: "^LG.+", manufacturer: "LG" }, + { pattern: "^BENQ.+", manufacturer: "BenQ" }, + { pattern: "^ASUS.+", manufacturer: "Asus" }, + { pattern: "^DELL.+", manufacturer: "Dell" }, + { pattern: "^SAMSUNG.+", manufacturer: "Samsung" }, + { pattern: "^VIEWSON.+", manufacturer: "ViewSonic" }, + { pattern: "^SONY.+", manufacturer: "Sony" }, + { pattern: "^ACER.+", manufacturer: "Acer" }, + { pattern: "^AOC.+", manufacturer: "AOC Monitors" }, + { pattern: "^HP.+", manufacturer: "HP" }, + { pattern: "^EIZO.?", manufacturer: "Eizo" }, + { pattern: "^PHILIPS.?", manufacturer: "Philips" }, + { pattern: "^IIYAMA.?", manufacturer: "Iiyama" }, + { pattern: "^SHARP.?", manufacturer: "Sharp" }, + { pattern: "^NEC.?", manufacturer: "NEC" }, + { pattern: "^LENOVO.?", manufacturer: "Lenovo" }, + { pattern: "COMPAQ.?", manufacturer: "Compaq" }, + { pattern: "APPLE.?", manufacturer: "Apple" }, + { pattern: "INTEL.?", manufacturer: "Intel" }, + { pattern: "AMD.?", manufacturer: "AMD" }, + { pattern: "NVIDIA.?", manufacturer: "NVDIA" } + ]; + let result2 = ""; + if (model) { + model = model.toUpperCase(); + manufacturers.forEach((manufacturer) => { + const re = RegExp(manufacturer.pattern); + if (re.test(model)) { + result2 = manufacturer.manufacturer; + } + }); + } + return result2; + } + function getVendorFromId(id) { + const vendors = { + "610": "Apple", + "1e6d": "LG", + "10ac": "DELL", + "4dd9": "Sony", + "38a3": "NEC" + }; + return vendors[id] || ""; + } + function vendorToId(str) { + let result2 = ""; + str = (str || "").toLowerCase(); + if (str.indexOf("apple") >= 0) { + result2 = "0x05ac"; + } else if (str.indexOf("nvidia") >= 0) { + result2 = "0x10de"; + } else if (str.indexOf("intel") >= 0) { + result2 = "0x8086"; + } else if (str.indexOf("ati") >= 0 || str.indexOf("amd") >= 0) { + result2 = "0x1002"; + } + return result2; + } + function getMetalVersion(id) { + const families = { + "spdisplays_mtlgpufamilymac1": "mac1", + "spdisplays_mtlgpufamilymac2": "mac2", + "spdisplays_mtlgpufamilyapple1": "apple1", + "spdisplays_mtlgpufamilyapple2": "apple2", + "spdisplays_mtlgpufamilyapple3": "apple3", + "spdisplays_mtlgpufamilyapple4": "apple4", + "spdisplays_mtlgpufamilyapple5": "apple5", + "spdisplays_mtlgpufamilyapple6": "apple6", + "spdisplays_mtlgpufamilyapple7": "apple7", + "spdisplays_metalfeaturesetfamily11": "family1_v1", + "spdisplays_metalfeaturesetfamily12": "family1_v2", + "spdisplays_metalfeaturesetfamily13": "family1_v3", + "spdisplays_metalfeaturesetfamily14": "family1_v4", + "spdisplays_metalfeaturesetfamily21": "family2_v1" + }; + return families[id] || ""; + } + function graphics(callback) { + function parseLinesDarwin(graphicsArr) { + const res = { + controllers: [], + displays: [] + }; + try { + graphicsArr.forEach(function(item) { + const bus = (item.sppci_bus || "").indexOf("builtin") > -1 ? "Built-In" : (item.sppci_bus || "").indexOf("pcie") > -1 ? "PCIe" : ""; + const vram = (parseInt(item.spdisplays_vram || "", 10) || 0) * ((item.spdisplays_vram || "").indexOf("GB") > -1 ? 1024 : 1); + const vramDyn = (parseInt(item.spdisplays_vram_shared || "", 10) || 0) * ((item.spdisplays_vram_shared || "").indexOf("GB") > -1 ? 1024 : 1); + let metalVersion = getMetalVersion(item.spdisplays_metal || item.spdisplays_metalfamily || ""); + res.controllers.push({ + vendor: getVendorFromModel(item.spdisplays_vendor || "") || item.spdisplays_vendor || "", + model: item.sppci_model || "", + bus, + vramDynamic: bus === "Built-In", + vram: vram || vramDyn || null, + deviceId: item["spdisplays_device-id"] || "", + vendorId: item["spdisplays_vendor-id"] || vendorToId((item["spdisplays_vendor"] || "") + (item.sppci_model || "")), + external: item.sppci_device_type === "spdisplays_egpu", + cores: item["sppci_cores"] || null, + metalVersion + }); + if (item.spdisplays_ndrvs && item.spdisplays_ndrvs.length) { + item.spdisplays_ndrvs.forEach(function(displayItem) { + const connectionType = displayItem["spdisplays_connection_type"] || ""; + const currentResolutionParts = (displayItem["_spdisplays_resolution"] || "").split("@"); + const currentResolution = currentResolutionParts[0].split("x"); + const pixelParts = (displayItem["_spdisplays_pixels"] || "").split("x"); + const pixelDepthString = displayItem["spdisplays_depth"] || ""; + const serial = displayItem["_spdisplays_display-serial-number"] || displayItem["_spdisplays_display-serial-number2"] || null; + res.displays.push({ + vendor: getVendorFromId(displayItem["_spdisplays_display-vendor-id"] || "") || getVendorFromModel(displayItem["_name"] || ""), + vendorId: displayItem["_spdisplays_display-vendor-id"] || "", + model: displayItem["_name"] || "", + productionYear: displayItem["_spdisplays_display-year"] || null, + serial: serial !== "0" ? serial : null, + displayId: displayItem["_spdisplays_displayID"] || null, + main: displayItem["spdisplays_main"] ? displayItem["spdisplays_main"] === "spdisplays_yes" : false, + builtin: (displayItem["spdisplays_display_type"] || "").indexOf("built-in") > -1, + connection: connectionType.indexOf("_internal") > -1 ? "Internal" : connectionType.indexOf("_displayport") > -1 ? "Display Port" : connectionType.indexOf("_hdmi") > -1 ? "HDMI" : null, + sizeX: null, + sizeY: null, + pixelDepth: pixelDepthString === "CGSThirtyBitColor" ? 30 : pixelDepthString === "CGSThirtytwoBitColor" ? 32 : pixelDepthString === "CGSTwentyfourBitColor" ? 24 : null, + resolutionX: pixelParts.length > 1 ? parseInt(pixelParts[0], 10) : null, + resolutionY: pixelParts.length > 1 ? parseInt(pixelParts[1], 10) : null, + currentResX: currentResolution.length > 1 ? parseInt(currentResolution[0], 10) : null, + currentResY: currentResolution.length > 1 ? parseInt(currentResolution[1], 10) : null, + positionX: 0, + positionY: 0, + currentRefreshRate: currentResolutionParts.length > 1 ? parseInt(currentResolutionParts[1], 10) : null + }); + }); + } + }); + return res; + } catch (e) { + return res; + } + } + function parseLinesLinuxControllers(lines) { + let controllers = []; + let currentController = { + vendor: "", + subVendor: "", + model: "", + bus: "", + busAddress: "", + vram: null, + vramDynamic: false, + pciID: "" + }; + let isGraphicsController = false; + let pciIDs = []; + try { + pciIDs = execSync('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "', util.execOptsLinux).toString().split("\n"); + for (let i2 = 0; i2 < pciIDs.length; i2++) { + pciIDs[i2] = pciIDs[i2].replace("Bus Address:", "").replace("0000:", "").trim(); + } + pciIDs = pciIDs.filter(function(el) { + return el != null && el; + }); + } catch (e) { + util.noop(); + } + let i = 1; + lines.forEach((line) => { + let subsystem = ""; + if (i < lines.length && lines[i]) { + subsystem = lines[i]; + if (subsystem.indexOf(":") > 0) { + subsystem = subsystem.split(":")[1]; + } + } + if ("" !== line.trim()) { + if (" " !== line[0] && " " !== line[0]) { + let isExternal = pciIDs.indexOf(line.split(" ")[0]) >= 0; + let vgapos = line.toLowerCase().indexOf(" vga "); + let _3dcontrollerpos = line.toLowerCase().indexOf("3d controller"); + if (vgapos !== -1 || _3dcontrollerpos !== -1) { + if (_3dcontrollerpos !== -1 && vgapos === -1) { + vgapos = _3dcontrollerpos; + } + if (currentController.vendor || currentController.model || currentController.bus || currentController.vram !== null || currentController.vramDynamic) { + controllers.push(currentController); + currentController = { + vendor: "", + model: "", + bus: "", + busAddress: "", + vram: null, + vramDynamic: false + }; + } + const pciIDCandidate = line.split(" ")[0]; + if (/[\da-fA-F]{2}:[\da-fA-F]{2}\.[\da-fA-F]/.test(pciIDCandidate)) { + currentController.busAddress = pciIDCandidate; + } + isGraphicsController = true; + let endpos = line.search(/\[[0-9a-f]{4}:[0-9a-f]{4}]|$/); + let parts = line.substr(vgapos, endpos - vgapos).split(":"); + currentController.busAddress = line.substr(0, vgapos).trim(); + if (parts.length > 1) { + parts[1] = parts[1].trim(); + if (parts[1].toLowerCase().indexOf("corporation") >= 0) { + currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf("corporation") + 11).trim(); + currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf("corporation") + 11, 200).split("(")[0].trim(); + currentController.bus = pciIDs.length > 0 && isExternal ? "PCIe" : "Onboard"; + currentController.vram = null; + currentController.vramDynamic = false; + } else if (parts[1].toLowerCase().indexOf(" inc.") >= 0) { + if ((parts[1].match(/]/g) || []).length > 1) { + currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf("]") + 1).trim(); + currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf("]") + 1, 200).trim().split("(")[0].trim(); + } else { + currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(" inc.") + 5).trim(); + currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(" inc.") + 5, 200).trim().split("(")[0].trim(); + } + currentController.bus = pciIDs.length > 0 && isExternal ? "PCIe" : "Onboard"; + currentController.vram = null; + currentController.vramDynamic = false; + } else if (parts[1].toLowerCase().indexOf(" ltd.") >= 0) { + if ((parts[1].match(/]/g) || []).length > 1) { + currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf("]") + 1).trim(); + currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf("]") + 1, 200).trim().split("(")[0].trim(); + } else { + currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(" ltd.") + 5).trim(); + currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(" ltd.") + 5, 200).trim().split("(")[0].trim(); + } + } + if (currentController.model && subsystem.indexOf(currentController.model) !== -1) { + const subVendor = subsystem.split(currentController.model)[0].trim(); + if (subVendor) { + currentController.subVendor = subVendor; + } + } + } + } else { + isGraphicsController = false; + } + } + if (isGraphicsController) { + let parts = line.split(":"); + if (parts.length > 1 && parts[0].replace(/ +/g, "").toLowerCase().indexOf("devicename") !== -1 && parts[1].toLowerCase().indexOf("onboard") !== -1) { + currentController.bus = "Onboard"; + } + if (parts.length > 1 && parts[0].replace(/ +/g, "").toLowerCase().indexOf("region") !== -1 && parts[1].toLowerCase().indexOf("memory") !== -1) { + let memparts = parts[1].split("="); + if (memparts.length > 1) { + currentController.vram = parseInt(memparts[1]); + } + } + } + } + i++; + }); + if (currentController.vendor || currentController.model || currentController.bus || currentController.busAddress || currentController.vram !== null || currentController.vramDynamic) { + controllers.push(currentController); + } + return controllers; + } + function parseLinesLinuxClinfo(controllers, lines) { + const fieldPattern = /\[([^\]]+)\]\s+(\w+)\s+(.*)/; + const devices = lines.reduce((devices2, line) => { + const field = fieldPattern.exec(line.trim()); + if (field) { + if (!devices2[field[1]]) { + devices2[field[1]] = {}; + } + devices2[field[1]][field[2]] = field[3]; + } + return devices2; + }, {}); + for (let deviceId in devices) { + const device = devices[deviceId]; + if (device["CL_DEVICE_TYPE"] === "CL_DEVICE_TYPE_GPU") { + let busAddress; + if (device["CL_DEVICE_TOPOLOGY_AMD"]) { + const bdf = device["CL_DEVICE_TOPOLOGY_AMD"].match(/[a-zA-Z0-9]+:\d+\.\d+/); + if (bdf) { + busAddress = bdf[0]; + } + } else if (device["CL_DEVICE_PCI_BUS_ID_NV"] && device["CL_DEVICE_PCI_SLOT_ID_NV"]) { + const bus = parseInt(device["CL_DEVICE_PCI_BUS_ID_NV"]); + const slot = parseInt(device["CL_DEVICE_PCI_SLOT_ID_NV"]); + if (!isNaN(bus) && !isNaN(slot)) { + const b = bus & 255; + const d = slot >> 3 & 255; + const f = slot & 7; + busAddress = `${b.toString().padStart(2, "0")}:${d.toString().padStart(2, "0")}.${f}`; + } + } + if (busAddress) { + let controller = controllers.find((controller2) => controller2.busAddress === busAddress); + if (!controller) { + controller = { + vendor: "", + model: "", + bus: "", + busAddress, + vram: null, + vramDynamic: false + }; + controllers.push(controller); + } + controller.vendor = device["CL_DEVICE_VENDOR"]; + if (device["CL_DEVICE_BOARD_NAME_AMD"]) { + controller.model = device["CL_DEVICE_BOARD_NAME_AMD"]; + } else { + controller.model = device["CL_DEVICE_NAME"]; + } + const memory = parseInt(device["CL_DEVICE_GLOBAL_MEM_SIZE"]); + if (!isNaN(memory)) { + controller.vram = Math.round(memory / 1024 / 1024); + } + } + } + } + return controllers; + } + function getNvidiaSmi() { + if (_nvidiaSmiPath) { + return _nvidiaSmiPath; + } + if (_windows) { + try { + const basePath = util.WINDIR + "\\System32\\DriverStore\\FileRepository"; + const candidateDirs = fs.readdirSync(basePath).filter((dir) => { + return fs.readdirSync([basePath, dir].join("/")).includes("nvidia-smi.exe"); + }); + const targetDir = candidateDirs.reduce((prevDir, currentDir) => { + const previousNvidiaSmi = fs.statSync([basePath, prevDir, "nvidia-smi.exe"].join("/")); + const currentNvidiaSmi = fs.statSync([basePath, currentDir, "nvidia-smi.exe"].join("/")); + return previousNvidiaSmi.ctimeMs > currentNvidiaSmi.ctimeMs ? prevDir : currentDir; + }); + if (targetDir) { + _nvidiaSmiPath = [basePath, targetDir, "nvidia-smi.exe"].join("/"); + } + } catch (e) { + util.noop(); + } + } else if (_linux) { + _nvidiaSmiPath = "nvidia-smi"; + } + return _nvidiaSmiPath; + } + function nvidiaSmi(options) { + const nvidiaSmiExe = getNvidiaSmi(); + options = options || util.execOptsWin; + if (nvidiaSmiExe) { + const nvidiaSmiOpts = "--query-gpu=driver_version,pci.sub_device_id,name,pci.bus_id,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu,temperature.memory,power.draw,power.limit,clocks.gr,clocks.mem --format=csv,noheader,nounits"; + const cmd = nvidiaSmiExe + " " + nvidiaSmiOpts + (_linux ? " 2>/dev/null" : ""); + if (_linux) { + options.stdio = ["pipe", "pipe", "ignore"]; + } + try { + const res = execSync(cmd, options).toString(); + return res; + } catch (e) { + util.noop(); + } + } + return ""; + } + function nvidiaDevices() { + function safeParseNumber(value) { + if ([null, void 0].includes(value)) { + return value; + } + return parseFloat(value); + } + const stdout = nvidiaSmi(); + if (!stdout) { + return []; + } + const gpus = stdout.split("\n").filter(Boolean); + let results = gpus.map((gpu) => { + const splittedData = gpu.split(", ").map((value) => value.includes("N/A") ? void 0 : value); + if (splittedData.length === 16) { + return { + driverVersion: splittedData[0], + subDeviceId: splittedData[1], + name: splittedData[2], + pciBus: splittedData[3], + fanSpeed: safeParseNumber(splittedData[4]), + memoryTotal: safeParseNumber(splittedData[5]), + memoryUsed: safeParseNumber(splittedData[6]), + memoryFree: safeParseNumber(splittedData[7]), + utilizationGpu: safeParseNumber(splittedData[8]), + utilizationMemory: safeParseNumber(splittedData[9]), + temperatureGpu: safeParseNumber(splittedData[10]), + temperatureMemory: safeParseNumber(splittedData[11]), + powerDraw: safeParseNumber(splittedData[12]), + powerLimit: safeParseNumber(splittedData[13]), + clockCore: safeParseNumber(splittedData[14]), + clockMemory: safeParseNumber(splittedData[15]) + }; + } else { + return {}; + } + }); + results = results.filter((item) => { + return "pciBus" in item; + }); + return results; + } + function mergeControllerNvidia(controller, nvidia) { + if (nvidia.driverVersion) { + controller.driverVersion = nvidia.driverVersion; + } + if (nvidia.subDeviceId) { + controller.subDeviceId = nvidia.subDeviceId; + } + if (nvidia.name) { + controller.name = nvidia.name; + } + if (nvidia.pciBus) { + controller.pciBus = nvidia.pciBus; + } + if (nvidia.fanSpeed) { + controller.fanSpeed = nvidia.fanSpeed; + } + if (nvidia.memoryTotal) { + controller.memoryTotal = nvidia.memoryTotal; + controller.vram = nvidia.memoryTotal; + controller.vramDynamic = false; + } + if (nvidia.memoryUsed) { + controller.memoryUsed = nvidia.memoryUsed; + } + if (nvidia.memoryFree) { + controller.memoryFree = nvidia.memoryFree; + } + if (nvidia.utilizationGpu) { + controller.utilizationGpu = nvidia.utilizationGpu; + } + if (nvidia.utilizationMemory) { + controller.utilizationMemory = nvidia.utilizationMemory; + } + if (nvidia.temperatureGpu) { + controller.temperatureGpu = nvidia.temperatureGpu; + } + if (nvidia.temperatureMemory) { + controller.temperatureMemory = nvidia.temperatureMemory; + } + if (nvidia.powerDraw) { + controller.powerDraw = nvidia.powerDraw; + } + if (nvidia.powerLimit) { + controller.powerLimit = nvidia.powerLimit; + } + if (nvidia.clockCore) { + controller.clockCore = nvidia.clockCore; + } + if (nvidia.clockMemory) { + controller.clockMemory = nvidia.clockMemory; + } + return controller; + } + function parseLinesLinuxEdid(edid) { + let result2 = { + vendor: "", + model: "", + deviceName: "", + main: false, + builtin: false, + connection: "", + sizeX: null, + sizeY: null, + pixelDepth: null, + resolutionX: null, + resolutionY: null, + currentResX: null, + currentResY: null, + positionX: 0, + positionY: 0, + currentRefreshRate: null + }; + let start = 108; + if (edid.substr(start, 6) === "000000") { + start += 36; + } + if (edid.substr(start, 6) === "000000") { + start += 36; + } + if (edid.substr(start, 6) === "000000") { + start += 36; + } + if (edid.substr(start, 6) === "000000") { + start += 36; + } + result2.resolutionX = parseInt("0x0" + edid.substr(start + 8, 1) + edid.substr(start + 4, 2)); + result2.resolutionY = parseInt("0x0" + edid.substr(start + 14, 1) + edid.substr(start + 10, 2)); + result2.sizeX = parseInt("0x0" + edid.substr(start + 28, 1) + edid.substr(start + 24, 2)); + result2.sizeY = parseInt("0x0" + edid.substr(start + 29, 1) + edid.substr(start + 26, 2)); + start = edid.indexOf("000000fc00"); + if (start >= 0) { + let model_raw = edid.substr(start + 10, 26); + if (model_raw.indexOf("0a") !== -1) { + model_raw = model_raw.substr(0, model_raw.indexOf("0a")); + } + try { + if (model_raw.length > 2) { + result2.model = model_raw.match(/.{1,2}/g).map(function(v) { + return String.fromCharCode(parseInt(v, 16)); + }).join(""); + } + } catch (e) { + util.noop(); + } + } else { + result2.model = ""; + } + return result2; + } + function parseLinesLinuxDisplays(lines, depth) { + let displays = []; + let currentDisplay = { + vendor: "", + model: "", + deviceName: "", + main: false, + builtin: false, + connection: "", + sizeX: null, + sizeY: null, + pixelDepth: null, + resolutionX: null, + resolutionY: null, + currentResX: null, + currentResY: null, + positionX: 0, + positionY: 0, + currentRefreshRate: null + }; + let is_edid = false; + let is_current = false; + let edid_raw = ""; + let start = 0; + for (let i = 1; i < lines.length; i++) { + if ("" !== lines[i].trim()) { + if (" " !== lines[i][0] && " " !== lines[i][0] && lines[i].toLowerCase().indexOf(" connected ") !== -1) { + if (currentDisplay.model || currentDisplay.main || currentDisplay.builtin || currentDisplay.connection || currentDisplay.sizeX !== null || currentDisplay.pixelDepth !== null || currentDisplay.resolutionX !== null) { + displays.push(currentDisplay); + currentDisplay = { + vendor: "", + model: "", + main: false, + builtin: false, + connection: "", + sizeX: null, + sizeY: null, + pixelDepth: null, + resolutionX: null, + resolutionY: null, + currentResX: null, + currentResY: null, + positionX: 0, + positionY: 0, + currentRefreshRate: null + }; + } + let parts = lines[i].split(" "); + currentDisplay.connection = parts[0]; + currentDisplay.main = lines[i].toLowerCase().indexOf(" primary ") >= 0; + currentDisplay.builtin = parts[0].toLowerCase().indexOf("edp") >= 0; + } + if (is_edid) { + if (lines[i].search(/\S|$/) > start) { + edid_raw += lines[i].toLowerCase().trim(); + } else { + let edid_decoded = parseLinesLinuxEdid(edid_raw); + currentDisplay.vendor = edid_decoded.vendor; + currentDisplay.model = edid_decoded.model; + currentDisplay.resolutionX = edid_decoded.resolutionX; + currentDisplay.resolutionY = edid_decoded.resolutionY; + currentDisplay.sizeX = edid_decoded.sizeX; + currentDisplay.sizeY = edid_decoded.sizeY; + currentDisplay.pixelDepth = depth; + is_edid = false; + } + } + if (lines[i].toLowerCase().indexOf("edid:") >= 0) { + is_edid = true; + start = lines[i].search(/\S|$/); + } + if (lines[i].toLowerCase().indexOf("*current") >= 0) { + const parts1 = lines[i].split("("); + if (parts1 && parts1.length > 1 && parts1[0].indexOf("x") >= 0) { + const resParts = parts1[0].trim().split("x"); + currentDisplay.currentResX = util.toInt(resParts[0]); + currentDisplay.currentResY = util.toInt(resParts[1]); + } + is_current = true; + } + if (is_current && lines[i].toLowerCase().indexOf("clock") >= 0 && lines[i].toLowerCase().indexOf("hz") >= 0 && lines[i].toLowerCase().indexOf("v: height") >= 0) { + const parts1 = lines[i].split("clock"); + if (parts1 && parts1.length > 1 && parts1[1].toLowerCase().indexOf("hz") >= 0) { + currentDisplay.currentRefreshRate = util.toInt(parts1[1]); + } + is_current = false; + } + } + } + if (currentDisplay.model || currentDisplay.main || currentDisplay.builtin || currentDisplay.connection || currentDisplay.sizeX !== null || currentDisplay.pixelDepth !== null || currentDisplay.resolutionX !== null) { + displays.push(currentDisplay); + } + return displays; + } + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + controllers: [], + displays: [] + }; + if (_darwin) { + let cmd = "system_profiler -xml -detailLevel full SPDisplaysDataType"; + exec2(cmd, function(error, stdout) { + if (!error) { + try { + const output = stdout.toString(); + result2 = parseLinesDarwin(util.plistParser(output)[0]._items); + } catch (e) { + util.noop(); + } + try { + stdout = execSync('defaults read /Library/Preferences/com.apple.windowserver.plist 2>/dev/null;defaults read /Library/Preferences/com.apple.windowserver.displays.plist 2>/dev/null; echo ""', { maxBuffer: 1024 * 2e4 }); + const output = (stdout || "").toString(); + const obj = util.plistReader(output); + if (obj["DisplayAnyUserSets"] && obj["DisplayAnyUserSets"]["Configs"] && obj["DisplayAnyUserSets"]["Configs"][0] && obj["DisplayAnyUserSets"]["Configs"][0]["DisplayConfig"]) { + const current = obj["DisplayAnyUserSets"]["Configs"][0]["DisplayConfig"]; + let i = 0; + current.forEach((o) => { + if (o["CurrentInfo"] && o["CurrentInfo"]["OriginX"] !== void 0 && result2.displays && result2.displays[i]) { + result2.displays[i].positionX = o["CurrentInfo"]["OriginX"]; + } + if (o["CurrentInfo"] && o["CurrentInfo"]["OriginY"] !== void 0 && result2.displays && result2.displays[i]) { + result2.displays[i].positionY = o["CurrentInfo"]["OriginY"]; + } + i++; + }); + } + if (obj["DisplayAnyUserSets"] && obj["DisplayAnyUserSets"].length > 0 && obj["DisplayAnyUserSets"][0].length > 0 && obj["DisplayAnyUserSets"][0][0]["DisplayID"]) { + const current = obj["DisplayAnyUserSets"][0]; + let i = 0; + current.forEach((o) => { + if ("OriginX" in o && result2.displays && result2.displays[i]) { + result2.displays[i].positionX = o["OriginX"]; + } + if ("OriginY" in o && result2.displays && result2.displays[i]) { + result2.displays[i].positionY = o["OriginY"]; + } + if (o["Mode"] && o["Mode"]["BitsPerPixel"] !== void 0 && result2.displays && result2.displays[i]) { + result2.displays[i].pixelDepth = o["Mode"]["BitsPerPixel"]; + } + i++; + }); + } + } catch (e) { + util.noop(); + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_linux) { + if (util.isRaspberry()) { + let cmd2 = `fbset -s 2> /dev/null | grep 'mode "' ; vcgencmd get_mem gpu 2> /dev/null; tvservice -s 2> /dev/null; tvservice -n 2> /dev/null;`; + exec2(cmd2, function(error, stdout) { + let lines = stdout.toString().split("\n"); + if (lines.length > 3 && lines[0].indexOf('mode "') >= -1 && lines[2].indexOf("0x12000a") > -1) { + const parts = lines[0].replace("mode", "").replace(/"/g, "").trim().split("x"); + if (parts.length === 2) { + result2.displays.push({ + vendor: "", + model: util.getValue(lines, "device_name", "="), + main: true, + builtin: false, + connection: "HDMI", + sizeX: null, + sizeY: null, + pixelDepth: null, + resolutionX: parseInt(parts[0], 10), + resolutionY: parseInt(parts[1], 10), + currentResX: null, + currentResY: null, + positionX: 0, + positionY: 0, + currentRefreshRate: null + }); + } + } + if (lines.length >= 1 && stdout.toString().indexOf("gpu=") >= -1) { + result2.controllers.push({ + vendor: "Broadcom", + model: util.getRpiGpu(), + bus: "", + vram: util.getValue(lines, "gpu", "=").replace("M", ""), + vramDynamic: true + }); + } + }); + } + let cmd = "lspci -vvv 2>/dev/null"; + exec2(cmd, function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + if (result2.controllers.length === 0) { + result2.controllers = parseLinesLinuxControllers(lines); + const nvidiaData = nvidiaDevices(); + result2.controllers = result2.controllers.map((controller) => { + return mergeControllerNvidia(controller, nvidiaData.find((contr) => contr.pciBus.toLowerCase().endsWith(controller.busAddress.toLowerCase())) || {}); + }); + } + } + let cmd2 = "clinfo --raw"; + exec2(cmd2, function(error2, stdout2) { + if (!error2) { + let lines = stdout2.toString().split("\n"); + result2.controllers = parseLinesLinuxClinfo(result2.controllers, lines); + } + let cmd3 = "xdpyinfo 2>/dev/null | grep 'depth of root window' | awk '{ print $5 }'"; + exec2(cmd3, function(error3, stdout3) { + let depth = 0; + if (!error3) { + let lines = stdout3.toString().split("\n"); + depth = parseInt(lines[0]) || 0; + } + let cmd4 = "xrandr --verbose 2>/dev/null"; + exec2(cmd4, function(error4, stdout4) { + if (!error4) { + let lines = stdout4.toString().split("\n"); + result2.displays = parseLinesLinuxDisplays(lines, depth); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + }); + }); + }); + } + if (_freebsd || _openbsd || _netbsd) { + if (callback) { + callback(null); + } + resolve(null); + } + if (_sunos) { + if (callback) { + callback(null); + } + resolve(null); + } + if (_windows) { + try { + const workload = []; + workload.push(util.powerShell("Get-CimInstance win32_VideoController | fl *")); + workload.push(util.powerShell('gp "HKLM:\\SYSTEM\\ControlSet001\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}\\*" -ErrorAction SilentlyContinue | where MatchingDeviceId $null -NE | select MatchingDeviceId,HardwareInformation.qwMemorySize | fl')); + workload.push(util.powerShell("Get-CimInstance win32_desktopmonitor | fl *")); + workload.push(util.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorBasicDisplayParams | fl")); + workload.push(util.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::AllScreens")); + workload.push(util.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorConnectionParams | fl")); + workload.push(util.powerShell('gwmi WmiMonitorID -Namespace root\\wmi | ForEach-Object {(($_.ManufacturerName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.ProductCodeID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + $_.InstanceName}')); + const nvidiaData = nvidiaDevices(); + Promise.all( + workload + ).then((data) => { + let csections = data[0].replace(/\r/g, "").split(/\n\s*\n/); + let vsections = data[1].replace(/\r/g, "").split(/\n\s*\n/); + result2.controllers = parseLinesWindowsControllers(csections, vsections); + result2.controllers = result2.controllers.map((controller) => { + if (controller.vendor.toLowerCase() === "nvidia") { + return mergeControllerNvidia(controller, nvidiaData.find((device) => { + let windowsSubDeviceId = (controller.subDeviceId || "").toLowerCase(); + const nvidiaSubDeviceIdParts = device.subDeviceId.split("x"); + let nvidiaSubDeviceId = nvidiaSubDeviceIdParts.length > 1 ? nvidiaSubDeviceIdParts[1].toLowerCase() : nvidiaSubDeviceIdParts[0].toLowerCase(); + const lengthDifference = Math.abs(windowsSubDeviceId.length - nvidiaSubDeviceId.length); + if (windowsSubDeviceId.length > nvidiaSubDeviceId.length) { + for (let i = 0; i < lengthDifference; i++) { + nvidiaSubDeviceId = "0" + nvidiaSubDeviceId; + } + } else if (windowsSubDeviceId.length < nvidiaSubDeviceId.length) { + for (let i = 0; i < lengthDifference; i++) { + windowsSubDeviceId = "0" + windowsSubDeviceId; + } + } + return windowsSubDeviceId === nvidiaSubDeviceId; + }) || {}); + } else { + return controller; + } + }); + let dsections = data[2].replace(/\r/g, "").split(/\n\s*\n/); + if (dsections[0].trim() === "") { + dsections.shift(); + } + if (dsections.length && dsections[dsections.length - 1].trim() === "") { + dsections.pop(); + } + let msections = data[3].replace(/\r/g, "").split("Active "); + msections.shift(); + let ssections = data[4].replace(/\r/g, "").split("BitsPerPixel "); + ssections.shift(); + let tsections = data[5].replace(/\r/g, "").split(/\n\s*\n/); + tsections.shift(); + const res = data[6].replace(/\r/g, "").split(/\n/); + let isections = []; + res.forEach((element) => { + const parts = element.split("|"); + if (parts.length === 5) { + isections.push({ + vendor: parts[0], + code: parts[1], + model: parts[2], + serial: parts[3], + instanceId: parts[4] + }); + } + }); + result2.displays = parseLinesWindowsDisplaysPowershell(ssections, msections, dsections, tsections, isections); + if (result2.displays.length === 1) { + if (_resolutionX) { + result2.displays[0].resolutionX = _resolutionX; + if (!result2.displays[0].currentResX) { + result2.displays[0].currentResX = _resolutionX; + } + } + if (_resolutionY) { + result2.displays[0].resolutionY = _resolutionY; + if (result2.displays[0].currentResY === 0) { + result2.displays[0].currentResY = _resolutionY; + } + } + if (_pixelDepth) { + result2.displays[0].pixelDepth = _pixelDepth; + } + } + result2.displays = result2.displays.map((element) => { + if (_refreshRate && !element.currentRefreshRate) { + element.currentRefreshRate = _refreshRate; + } + return element; + }); + if (callback) { + callback(result2); + } + resolve(result2); + }).catch(() => { + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + function parseLinesWindowsControllers(sections, vections) { + const memorySizes = {}; + for (const i in vections) { + if ({}.hasOwnProperty.call(vections, i)) { + if (vections[i].trim() !== "") { + const lines = vections[i].trim().split("\n"); + const matchingDeviceId = util.getValue(lines, "MatchingDeviceId").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i); + if (matchingDeviceId) { + const quadWordmemorySize = parseInt(util.getValue(lines, "HardwareInformation.qwMemorySize")); + if (!isNaN(quadWordmemorySize)) { + let deviceId = matchingDeviceId[1].toUpperCase() + "&" + matchingDeviceId[2].toUpperCase(); + if (matchingDeviceId[3]) { + deviceId += "&" + matchingDeviceId[3].toUpperCase(); + } + if (matchingDeviceId[4]) { + deviceId += "&" + matchingDeviceId[4].toUpperCase(); + } + memorySizes[deviceId] = quadWordmemorySize; + } + } + } + } + } + let controllers = []; + for (let i in sections) { + if ({}.hasOwnProperty.call(sections, i)) { + if (sections[i].trim() !== "") { + let lines = sections[i].trim().split("\n"); + let pnpDeviceId = util.getValue(lines, "PNPDeviceID", ":").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i); + let subDeviceId = null; + let memorySize = null; + if (pnpDeviceId) { + subDeviceId = pnpDeviceId[3] || ""; + if (subDeviceId) { + subDeviceId = subDeviceId.split("_")[1]; + } + if (memorySize == null && pnpDeviceId[3] && pnpDeviceId[4]) { + const deviceId = pnpDeviceId[1].toUpperCase() + "&" + pnpDeviceId[2].toUpperCase() + "&" + pnpDeviceId[3].toUpperCase() + "&" + pnpDeviceId[4].toUpperCase(); + if ({}.hasOwnProperty.call(memorySizes, deviceId)) { + memorySize = memorySizes[deviceId]; + } + } + if (memorySize == null && pnpDeviceId[3]) { + const deviceId = pnpDeviceId[1].toUpperCase() + "&" + pnpDeviceId[2].toUpperCase() + "&" + pnpDeviceId[3].toUpperCase(); + if ({}.hasOwnProperty.call(memorySizes, deviceId)) { + memorySize = memorySizes[deviceId]; + } + } + if (memorySize == null && pnpDeviceId[4]) { + const deviceId = pnpDeviceId[1].toUpperCase() + "&" + pnpDeviceId[2].toUpperCase() + "&" + pnpDeviceId[4].toUpperCase(); + if ({}.hasOwnProperty.call(memorySizes, deviceId)) { + memorySize = memorySizes[deviceId]; + } + } + if (memorySize == null) { + const deviceId = pnpDeviceId[1].toUpperCase() + "&" + pnpDeviceId[2].toUpperCase(); + if ({}.hasOwnProperty.call(memorySizes, deviceId)) { + memorySize = memorySizes[deviceId]; + } + } + } + controllers.push({ + vendor: util.getValue(lines, "AdapterCompatibility", ":"), + model: util.getValue(lines, "name", ":"), + bus: util.getValue(lines, "PNPDeviceID", ":").startsWith("PCI") ? "PCI" : "", + vram: (memorySize == null ? util.toInt(util.getValue(lines, "AdapterRAM", ":")) : memorySize) / 1024 / 1024, + vramDynamic: util.getValue(lines, "VideoMemoryType", ":") === "2", + subDeviceId + }); + _resolutionX = util.toInt(util.getValue(lines, "CurrentHorizontalResolution", ":")) || _resolutionX; + _resolutionY = util.toInt(util.getValue(lines, "CurrentVerticalResolution", ":")) || _resolutionY; + _refreshRate = util.toInt(util.getValue(lines, "CurrentRefreshRate", ":")) || _refreshRate; + _pixelDepth = util.toInt(util.getValue(lines, "CurrentBitsPerPixel", ":")) || _pixelDepth; + } + } + } + return controllers; + } + function parseLinesWindowsDisplaysPowershell(ssections, msections, dsections, tsections, isections) { + let displays = []; + let vendor = ""; + let model = ""; + let deviceID = ""; + let resolutionX = 0; + let resolutionY = 0; + if (dsections && dsections.length) { + let linesDisplay = dsections[0].split("\n"); + vendor = util.getValue(linesDisplay, "MonitorManufacturer", ":"); + model = util.getValue(linesDisplay, "Name", ":"); + deviceID = util.getValue(linesDisplay, "PNPDeviceID", ":").replace(/&/g, "&").toLowerCase(); + resolutionX = util.toInt(util.getValue(linesDisplay, "ScreenWidth", ":")); + resolutionY = util.toInt(util.getValue(linesDisplay, "ScreenHeight", ":")); + } + for (let i = 0; i < ssections.length; i++) { + if (ssections[i].trim() !== "") { + ssections[i] = "BitsPerPixel " + ssections[i]; + msections[i] = "Active " + msections[i]; + if (tsections.length === 0 || tsections[i] === void 0) { + tsections[i] = "Unknown"; + } + let linesScreen = ssections[i].split("\n"); + let linesMonitor = msections[i].split("\n"); + let linesConnection = tsections[i].split("\n"); + const bitsPerPixel = util.getValue(linesScreen, "BitsPerPixel"); + const bounds = util.getValue(linesScreen, "Bounds").replace("{", "").replace("}", "").replace(/=/g, ":").split(","); + const primary = util.getValue(linesScreen, "Primary"); + const sizeX = util.getValue(linesMonitor, "MaxHorizontalImageSize"); + const sizeY = util.getValue(linesMonitor, "MaxVerticalImageSize"); + const instanceName = util.getValue(linesMonitor, "InstanceName").toLowerCase(); + const videoOutputTechnology = util.getValue(linesConnection, "VideoOutputTechnology"); + const deviceName = util.getValue(linesScreen, "DeviceName"); + let displayVendor = ""; + let displayModel = ""; + isections.forEach((element) => { + if (element.instanceId.toLowerCase().startsWith(instanceName) && vendor.startsWith("(") && model.startsWith("PnP")) { + displayVendor = element.vendor; + displayModel = element.model; + } + }); + displays.push({ + vendor: instanceName.startsWith(deviceID) && displayVendor === "" ? vendor : displayVendor, + model: instanceName.startsWith(deviceID) && displayModel === "" ? model : displayModel, + deviceName, + main: primary.toLowerCase() === "true", + builtin: videoOutputTechnology === "2147483648", + connection: videoOutputTechnology && videoTypes[videoOutputTechnology] ? videoTypes[videoOutputTechnology] : "", + resolutionX: util.toInt(util.getValue(bounds, "Width", ":")), + resolutionY: util.toInt(util.getValue(bounds, "Height", ":")), + sizeX: sizeX ? parseInt(sizeX, 10) : null, + sizeY: sizeY ? parseInt(sizeY, 10) : null, + pixelDepth: bitsPerPixel, + currentResX: util.toInt(util.getValue(bounds, "Width", ":")), + currentResY: util.toInt(util.getValue(bounds, "Height", ":")), + positionX: util.toInt(util.getValue(bounds, "X", ":")), + positionY: util.toInt(util.getValue(bounds, "Y", ":")) + }); + } + } + if (ssections.length === 0) { + displays.push({ + vendor, + model, + main: true, + sizeX: null, + sizeY: null, + resolutionX, + resolutionY, + pixelDepth: null, + currentResX: resolutionX, + currentResY: resolutionY, + positionX: 0, + positionY: 0 + }); + } + return displays; + } + } + exports.graphics = graphics; + } +}); + +// node_modules/systeminformation/lib/filesystem.js +var require_filesystem = __commonJS({ + "node_modules/systeminformation/lib/filesystem.js"(exports) { + "use strict"; + var util = require_util2(); + var fs = require("fs"); + var exec2 = require("child_process").exec; + var execSync = require("child_process").execSync; + var execPromiseSave = util.promisifySave(require("child_process").exec); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + var _fs_speed = {}; + var _disk_io = {}; + function fsSize(drive, callback) { + if (util.isFunction(drive)) { + callback = drive; + drive = ""; + } + let macOsDisks = []; + let osMounts = []; + function getmacOsFsType(fs2) { + if (!fs2.startsWith("/")) { + return "NFS"; + } + const parts = fs2.split("/"); + const fsShort = parts[parts.length - 1]; + const macOsDisksSingle = macOsDisks.filter((item) => item.indexOf(fsShort) >= 0); + if (macOsDisksSingle.length === 1 && macOsDisksSingle[0].indexOf("APFS") >= 0) { + return "APFS"; + } + return "HFS"; + } + function isLinuxTmpFs(fs2) { + const linuxTmpFileSystems = ["rootfs", "unionfs", "squashfs", "cramfs", "initrd", "initramfs", "devtmpfs", "tmpfs", "udev", "devfs", "specfs", "type", "appimaged"]; + let result2 = false; + linuxTmpFileSystems.forEach((linuxFs) => { + if (fs2.toLowerCase().indexOf(linuxFs) >= 0) { + result2 = true; + } + }); + return result2; + } + function filterLines(stdout) { + let lines = stdout.toString().split("\n"); + lines.shift(); + if (stdout.toString().toLowerCase().indexOf("filesystem")) { + let removeLines = 0; + for (let i = 0; i < lines.length; i++) { + if (lines[i] && lines[i].toLowerCase().startsWith("filesystem")) { + removeLines = i; + } + } + for (let i = 0; i < removeLines; i++) { + lines.shift(); + } + } + return lines; + } + function parseDf(lines) { + let data = []; + lines.forEach(function(line) { + if (line !== "") { + line = line.replace(/ +/g, " ").split(" "); + if (line && (line[0].startsWith("/") || line[6] && line[6] === "/" || line[0].indexOf("/") > 0 || line[0].indexOf(":") === 1 || !_darwin && !isLinuxTmpFs(line[1]))) { + const fs2 = line[0]; + const fsType = _linux || _freebsd || _openbsd || _netbsd ? line[1] : getmacOsFsType(line[0]); + const size = parseInt(_linux || _freebsd || _openbsd || _netbsd ? line[2] : line[1]) * 1024; + const used = parseInt(_linux || _freebsd || _openbsd || _netbsd ? line[3] : line[2]) * 1024; + const available = parseInt(_linux || _freebsd || _openbsd || _netbsd ? line[4] : line[3]) * 1024; + const use = parseFloat((100 * (used / (used + available))).toFixed(2)); + let rw = osMounts && Object.keys(osMounts).length > 0 ? osMounts[fs2] || false : null; + line.splice(0, _linux || _freebsd || _openbsd || _netbsd ? 6 : 5); + const mount = line.join(" "); + if (!data.find((el) => el.fs === fs2 && el.type === fsType)) { + data.push({ + fs: fs2, + type: fsType, + size, + used, + available, + use, + mount, + rw + }); + } + } + } + }); + return data; + } + return new Promise((resolve) => { + process.nextTick(() => { + let data = []; + if (_linux || _freebsd || _openbsd || _netbsd || _darwin) { + let cmd = ""; + macOsDisks = []; + osMounts = {}; + if (_darwin) { + cmd = "df -kP"; + try { + macOsDisks = execSync("diskutil list").toString().split("\n").filter((line) => { + return !line.startsWith("/") && line.indexOf(":") > 0; + }); + execSync("mount").toString().split("\n").filter((line) => { + return line.startsWith("/"); + }).forEach((line) => { + osMounts[line.split(" ")[0]] = line.toLowerCase().indexOf("read-only") === -1; + }); + } catch (e) { + util.noop(); + } + } + if (_linux) { + try { + cmd = "export LC_ALL=C; df -lkPTx squashfs; unset LC_ALL"; + execSync("cat /proc/mounts 2>/dev/null", util.execOptsLinux).toString().split("\n").filter((line) => { + return line.startsWith("/"); + }).forEach((line) => { + osMounts[line.split(" ")[0]] = osMounts[line.split(" ")[0]] || false; + if (line.toLowerCase().indexOf("/snap/") === -1) { + osMounts[line.split(" ")[0]] = line.toLowerCase().indexOf("rw,") >= 0 || line.toLowerCase().indexOf(" rw ") >= 0; + } + }); + } catch (e) { + util.noop(); + } + } + if (_freebsd || _openbsd || _netbsd) { + try { + cmd = "df -lkPT"; + execSync("mount").toString().split("\n").forEach((line) => { + osMounts[line.split(" ")[0]] = line.toLowerCase().indexOf("read-only") === -1; + }); + } catch (e) { + util.noop(); + } + } + exec2(cmd, { maxBuffer: 1024 * 1024 }, function(error, stdout) { + let lines = filterLines(stdout); + data = parseDf(lines); + if (drive) { + data = data.filter((item) => { + return item.fs.toLowerCase().indexOf(drive.toLowerCase()) >= 0 || item.mount.toLowerCase().indexOf(drive.toLowerCase()) >= 0; + }); + } + if ((!error || data.length) && stdout.toString().trim() !== "") { + if (callback) { + callback(data); + } + resolve(data); + } else { + exec2("df -kPT", { maxBuffer: 1024 * 1024 }, function(error2, stdout2) { + if (!error2) { + let lines2 = filterLines(stdout2); + data = parseDf(lines2); + } + if (callback) { + callback(data); + } + resolve(data); + }); + } + }); + } + if (_sunos) { + if (callback) { + callback(data); + } + resolve(data); + } + if (_windows) { + try { + const cmd = `Get-WmiObject Win32_logicaldisk | select Access,Caption,FileSystem,FreeSpace,Size ${drive ? "| where -property Caption -eq " + drive : ""} | fl`; + util.powerShell(cmd).then((stdout, error) => { + if (!error) { + let devices = stdout.toString().split(/\n\s*\n/); + devices.forEach(function(device) { + let lines = device.split("\r\n"); + const size = util.toInt(util.getValue(lines, "size", ":")); + const free = util.toInt(util.getValue(lines, "freespace", ":")); + const caption = util.getValue(lines, "caption", ":"); + const rwValue = util.getValue(lines, "access", ":"); + const rw = rwValue ? util.toInt(rwValue) !== 1 : null; + if (size) { + data.push({ + fs: caption, + type: util.getValue(lines, "filesystem", ":"), + size, + used: size - free, + available: free, + use: parseFloat((100 * (size - free) / size).toFixed(2)), + mount: caption, + rw + }); + } + }); + } + if (callback) { + callback(data); + } + resolve(data); + }); + } catch (e) { + if (callback) { + callback(data); + } + resolve(data); + } + } + }); + }); + } + exports.fsSize = fsSize; + function fsOpenFiles(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + const result2 = { + max: null, + allocated: null, + available: null + }; + if (_freebsd || _openbsd || _netbsd || _darwin) { + let cmd = "sysctl -i kern.maxfiles kern.num_files kern.open_files"; + exec2(cmd, { maxBuffer: 1024 * 1024 }, function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + result2.max = parseInt(util.getValue(lines, "kern.maxfiles", ":"), 10); + result2.allocated = parseInt(util.getValue(lines, "kern.num_files", ":"), 10) || parseInt(util.getValue(lines, "kern.open_files", ":"), 10); + result2.available = result2.max - result2.allocated; + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_linux) { + fs.readFile("/proc/sys/fs/file-nr", function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + if (lines[0]) { + const parts = lines[0].replace(/\s+/g, " ").split(" "); + if (parts.length === 3) { + result2.allocated = parseInt(parts[0], 10); + result2.available = parseInt(parts[1], 10); + result2.max = parseInt(parts[2], 10); + if (!result2.available) { + result2.available = result2.max - result2.allocated; + } + } + } + if (callback) { + callback(result2); + } + resolve(result2); + } else { + fs.readFile("/proc/sys/fs/file-max", function(error2, stdout2) { + if (!error2) { + let lines = stdout2.toString().split("\n"); + if (lines[0]) { + result2.max = parseInt(lines[0], 10); + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + }); + } + if (_sunos) { + if (callback) { + callback(null); + } + resolve(null); + } + if (_windows) { + if (callback) { + callback(null); + } + resolve(null); + } + }); + }); + } + exports.fsOpenFiles = fsOpenFiles; + function parseBytes(s) { + return parseInt(s.substr(s.indexOf(" (") + 2, s.indexOf(" Bytes)") - 10)); + } + function parseDevices(lines) { + let devices = []; + let i = 0; + lines.forEach((line) => { + if (line.length > 0) { + if (line[0] === "*") { + i++; + } else { + let parts = line.split(":"); + if (parts.length > 1) { + if (!devices[i]) { + devices[i] = { + name: "", + identifier: "", + type: "disk", + fsType: "", + mount: "", + size: 0, + physical: "HDD", + uuid: "", + label: "", + model: "", + serial: "", + removable: false, + protocol: "", + group: "", + device: "" + }; + } + parts[0] = parts[0].trim().toUpperCase().replace(/ +/g, ""); + parts[1] = parts[1].trim(); + if ("DEVICEIDENTIFIER" === parts[0]) { + devices[i].identifier = parts[1]; + } + if ("DEVICENODE" === parts[0]) { + devices[i].name = parts[1]; + } + if ("VOLUMENAME" === parts[0]) { + if (parts[1].indexOf("Not applicable") === -1) { + devices[i].label = parts[1]; + } + } + if ("PROTOCOL" === parts[0]) { + devices[i].protocol = parts[1]; + } + if ("DISKSIZE" === parts[0]) { + devices[i].size = parseBytes(parts[1]); + } + if ("FILESYSTEMPERSONALITY" === parts[0]) { + devices[i].fsType = parts[1]; + } + if ("MOUNTPOINT" === parts[0]) { + devices[i].mount = parts[1]; + } + if ("VOLUMEUUID" === parts[0]) { + devices[i].uuid = parts[1]; + } + if ("READ-ONLYMEDIA" === parts[0] && parts[1] === "Yes") { + devices[i].physical = "CD/DVD"; + } + if ("SOLIDSTATE" === parts[0] && parts[1] === "Yes") { + devices[i].physical = "SSD"; + } + if ("VIRTUAL" === parts[0]) { + devices[i].type = "virtual"; + } + if ("REMOVABLEMEDIA" === parts[0]) { + devices[i].removable = parts[1] === "Removable"; + } + if ("PARTITIONTYPE" === parts[0]) { + devices[i].type = "part"; + } + if ("DEVICE/MEDIANAME" === parts[0]) { + devices[i].model = parts[1]; + } + } + } + } + }); + return devices; + } + function parseBlk(lines) { + let data = []; + lines.filter((line) => line !== "").forEach((line) => { + try { + line = decodeURIComponent(line.replace(/\\x/g, "%")); + line = line.replace(/\\/g, "\\\\"); + let disk = JSON.parse(line); + data.push({ + "name": disk.name, + "type": disk.type, + "fsType": disk.fsType, + "mount": disk.mountpoint, + "size": parseInt(disk.size), + "physical": disk.type === "disk" ? disk.rota === "0" ? "SSD" : "HDD" : disk.type === "rom" ? "CD/DVD" : "", + "uuid": disk.uuid, + "label": disk.label, + "model": (disk.model || "").trim(), + "serial": disk.serial, + "removable": disk.rm === "1", + "protocol": disk.tran, + "group": disk.group || "" + }); + } catch (e) { + util.noop(); + } + }); + data = util.unique(data); + data = util.sortByKey(data, ["type", "name"]); + return data; + } + function decodeMdabmData(lines) { + const raid = util.getValue(lines, "md_level", "="); + const label = util.getValue(lines, "md_name", "="); + const uuid = util.getValue(lines, "md_uuid", "="); + const members = []; + lines.forEach((line) => { + if (line.toLowerCase().startsWith("md_device_dev") && line.toLowerCase().indexOf("/dev/") > 0) { + members.push(line.split("/dev/")[1]); + } + }); + return { + raid, + label, + uuid, + members + }; + } + function raidMatchLinux(data) { + let result2 = data; + try { + data.forEach((element) => { + if (element.type.startsWith("raid")) { + const lines = execSync(`mdadm --export --detail /dev/${element.name}`, util.execOptsLinux).toString().split("\n"); + const mdData = decodeMdabmData(lines); + element.label = mdData.label; + element.uuid = mdData.uuid; + if (mdData.members && mdData.members.length && mdData.raid === element.type) { + result2 = result2.map((blockdevice) => { + if (blockdevice.fsType === "linux_raid_member" && mdData.members.indexOf(blockdevice.name) >= 0) { + blockdevice.group = element.name; + } + return blockdevice; + }); + } + } + }); + } catch (e) { + util.noop(); + } + return result2; + } + function getDevicesLinux(data) { + const result2 = []; + data.forEach((element) => { + if (element.type.startsWith("disk")) { + result2.push(element.name); + } + }); + return result2; + } + function matchDevicesLinux(data) { + let result2 = data; + try { + const devices = getDevicesLinux(data); + result2 = result2.map((blockdevice) => { + if (blockdevice.type.startsWith("part") || blockdevice.type.startsWith("disk")) { + devices.forEach((element) => { + if (blockdevice.name.startsWith(element)) { + blockdevice.device = "/dev/" + element; + } + }); + } + return blockdevice; + }); + } catch (e) { + util.noop(); + } + return result2; + } + function getDevicesMac(data) { + const result2 = []; + data.forEach((element) => { + if (element.type.startsWith("disk")) { + result2.push({ name: element.name, model: element.model, device: element.name }); + } + if (element.type.startsWith("virtual")) { + let device = ""; + result2.forEach((e) => { + if (e.model === element.model) { + device = e.device; + } + }); + if (device) { + result2.push({ name: element.name, model: element.model, device }); + } + } + }); + return result2; + } + function matchDevicesMac(data) { + let result2 = data; + try { + const devices = getDevicesMac(data); + result2 = result2.map((blockdevice) => { + if (blockdevice.type.startsWith("part") || blockdevice.type.startsWith("disk") || blockdevice.type.startsWith("virtual")) { + devices.forEach((element) => { + if (blockdevice.name.startsWith(element.name)) { + blockdevice.device = element.device; + } + }); + } + return blockdevice; + }); + } catch (e) { + util.noop(); + } + return result2; + } + function getDevicesWin(diskDrives) { + const result2 = []; + diskDrives.forEach((element) => { + const lines = element.split("\r\n"); + const device = util.getValue(lines, "DeviceID", ":"); + let partitions = element.split("@{DeviceID="); + if (partitions.length > 1) { + partitions = partitions.slice(1); + partitions.forEach((partition) => { + result2.push({ name: partition.split(";")[0].toUpperCase(), device }); + }); + } + }); + return result2; + } + function matchDevicesWin(data, diskDrives) { + const devices = getDevicesWin(diskDrives); + data.map((element) => { + const filteresDevices = devices.filter((e) => { + return e.name === element.name.toUpperCase(); + }); + if (filteresDevices.length > 0) { + element.device = filteresDevices[0].device; + } + return element; + }); + return data; + } + function blkStdoutToObject(stdout) { + return stdout.toString().replace(/NAME=/g, '{"name":').replace(/FSTYPE=/g, ',"fsType":').replace(/TYPE=/g, ',"type":').replace(/SIZE=/g, ',"size":').replace(/MOUNTPOINT=/g, ',"mountpoint":').replace(/UUID=/g, ',"uuid":').replace(/ROTA=/g, ',"rota":').replace(/RO=/g, ',"ro":').replace(/RM=/g, ',"rm":').replace(/TRAN=/g, ',"tran":').replace(/SERIAL=/g, ',"serial":').replace(/LABEL=/g, ',"label":').replace(/MODEL=/g, ',"model":').replace(/OWNER=/g, ',"owner":').replace(/GROUP=/g, ',"group":').replace(/\n/g, "}\n"); + } + function blockDevices(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let data = []; + if (_linux) { + exec2("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER 2>/dev/null", { maxBuffer: 1024 * 1024 }, function(error, stdout) { + if (!error) { + let lines = blkStdoutToObject(stdout).split("\n"); + data = parseBlk(lines); + data = raidMatchLinux(data); + data = matchDevicesLinux(data); + if (callback) { + callback(data); + } + resolve(data); + } else { + exec2("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER 2>/dev/null", { maxBuffer: 1024 * 1024 }, function(error2, stdout2) { + if (!error2) { + let lines = blkStdoutToObject(stdout2).split("\n"); + data = parseBlk(lines); + data = raidMatchLinux(data); + } + if (callback) { + callback(data); + } + resolve(data); + }); + } + }); + } + if (_darwin) { + exec2("diskutil info -all", { maxBuffer: 1024 * 1024 }, function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + data = parseDevices(lines); + data = matchDevicesMac(data); + } + if (callback) { + callback(data); + } + resolve(data); + }); + } + if (_sunos) { + if (callback) { + callback(data); + } + resolve(data); + } + if (_windows) { + let drivetypes = ["Unknown", "NoRoot", "Removable", "Local", "Network", "CD/DVD", "RAM"]; + try { + const workload = []; + workload.push(util.powerShell("Get-CimInstance -ClassName Win32_LogicalDisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl")); + workload.push(util.powerShell("Get-WmiObject -Class Win32_diskdrive | Select-Object -Property PNPDeviceId,DeviceID, Model, Size, @{L='Partitions'; E={$_.GetRelated('Win32_DiskPartition').GetRelated('Win32_LogicalDisk') | Select-Object -Property DeviceID, VolumeName, Size, FreeSpace}} | fl")); + util.promiseAll( + workload + ).then((res) => { + let logicalDisks = res.results[0].toString().split(/\n\s*\n/); + let diskDrives = res.results[1].toString().split(/\n\s*\n/); + logicalDisks.forEach(function(device) { + let lines = device.split("\r\n"); + let drivetype = util.getValue(lines, "drivetype", ":"); + if (drivetype) { + data.push({ + name: util.getValue(lines, "name", ":"), + identifier: util.getValue(lines, "caption", ":"), + type: "disk", + fsType: util.getValue(lines, "filesystem", ":").toLowerCase(), + mount: util.getValue(lines, "caption", ":"), + size: util.getValue(lines, "size", ":"), + physical: drivetype >= 0 && drivetype <= 6 ? drivetypes[drivetype] : drivetypes[0], + uuid: util.getValue(lines, "volumeserialnumber", ":"), + label: util.getValue(lines, "volumename", ":"), + model: "", + serial: util.getValue(lines, "volumeserialnumber", ":"), + removable: drivetype === "2", + protocol: "", + group: "", + device: "" + }); + } + }); + data = matchDevicesWin(data, diskDrives); + if (callback) { + callback(data); + } + resolve(data); + }); + } catch (e) { + if (callback) { + callback(data); + } + resolve(data); + } + } + if (_freebsd || _openbsd || _netbsd) { + if (callback) { + callback(null); + } + resolve(null); + } + }); + }); + } + exports.blockDevices = blockDevices; + function calcFsSpeed(rx, wx) { + let result2 = { + rx: 0, + wx: 0, + tx: 0, + rx_sec: null, + wx_sec: null, + tx_sec: null, + ms: 0 + }; + if (_fs_speed && _fs_speed.ms) { + result2.rx = rx; + result2.wx = wx; + result2.tx = result2.rx + result2.wx; + result2.ms = Date.now() - _fs_speed.ms; + result2.rx_sec = (result2.rx - _fs_speed.bytes_read) / (result2.ms / 1e3); + result2.wx_sec = (result2.wx - _fs_speed.bytes_write) / (result2.ms / 1e3); + result2.tx_sec = result2.rx_sec + result2.wx_sec; + _fs_speed.rx_sec = result2.rx_sec; + _fs_speed.wx_sec = result2.wx_sec; + _fs_speed.tx_sec = result2.tx_sec; + _fs_speed.bytes_read = result2.rx; + _fs_speed.bytes_write = result2.wx; + _fs_speed.bytes_overall = result2.rx + result2.wx; + _fs_speed.ms = Date.now(); + _fs_speed.last_ms = result2.ms; + } else { + result2.rx = rx; + result2.wx = wx; + result2.tx = result2.rx + result2.wx; + _fs_speed.rx_sec = null; + _fs_speed.wx_sec = null; + _fs_speed.tx_sec = null; + _fs_speed.bytes_read = result2.rx; + _fs_speed.bytes_write = result2.wx; + _fs_speed.bytes_overall = result2.rx + result2.wx; + _fs_speed.ms = Date.now(); + _fs_speed.last_ms = 0; + } + return result2; + } + function fsStats(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + if (_windows || _freebsd || _openbsd || _netbsd || _sunos) { + return resolve(null); + } + let result2 = { + rx: 0, + wx: 0, + tx: 0, + rx_sec: null, + wx_sec: null, + tx_sec: null, + ms: 0 + }; + let rx = 0; + let wx = 0; + if (_fs_speed && !_fs_speed.ms || _fs_speed && _fs_speed.ms && Date.now() - _fs_speed.ms >= 500) { + if (_linux) { + exec2("lsblk -r 2>/dev/null | grep /", { maxBuffer: 1024 * 1024 }, function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + let fs_filter = []; + lines.forEach(function(line) { + if (line !== "") { + line = line.trim().split(" "); + if (fs_filter.indexOf(line[0]) === -1) { + fs_filter.push(line[0]); + } + } + }); + let output = fs_filter.join("|"); + exec2('cat /proc/diskstats | egrep "' + output + '"', { maxBuffer: 1024 * 1024 }, function(error2, stdout2) { + if (!error2) { + let lines2 = stdout2.toString().split("\n"); + lines2.forEach(function(line) { + line = line.trim(); + if (line !== "") { + line = line.replace(/ +/g, " ").split(" "); + rx += parseInt(line[5]) * 512; + wx += parseInt(line[9]) * 512; + } + }); + result2 = calcFsSpeed(rx, wx); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } + if (_darwin) { + exec2('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"', { maxBuffer: 1024 * 1024 }, function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + lines.forEach(function(line) { + line = line.trim(); + if (line !== "") { + line = line.split(","); + rx += parseInt(line[2]); + wx += parseInt(line[9]); + } + }); + result2 = calcFsSpeed(rx, wx); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + } else { + result2.ms = _fs_speed.last_ms; + result2.rx = _fs_speed.bytes_read; + result2.wx = _fs_speed.bytes_write; + result2.tx = _fs_speed.bytes_read + _fs_speed.bytes_write; + result2.rx_sec = _fs_speed.rx_sec; + result2.wx_sec = _fs_speed.wx_sec; + result2.tx_sec = _fs_speed.tx_sec; + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + } + exports.fsStats = fsStats; + function calcDiskIO(rIO, wIO, rWaitTime, wWaitTime, tWaitTime) { + let result2 = { + rIO: 0, + wIO: 0, + tIO: 0, + rIO_sec: null, + wIO_sec: null, + tIO_sec: null, + rWaitTime: 0, + wWaitTime: 0, + tWaitTime: 0, + rWaitPercent: null, + wWaitPercent: null, + tWaitPercent: null, + ms: 0 + }; + if (_disk_io && _disk_io.ms) { + result2.rIO = rIO; + result2.wIO = wIO; + result2.tIO = rIO + wIO; + result2.ms = Date.now() - _disk_io.ms; + result2.rIO_sec = (result2.rIO - _disk_io.rIO) / (result2.ms / 1e3); + result2.wIO_sec = (result2.wIO - _disk_io.wIO) / (result2.ms / 1e3); + result2.tIO_sec = result2.rIO_sec + result2.wIO_sec; + result2.rWaitTime = rWaitTime; + result2.wWaitTime = wWaitTime; + result2.tWaitTime = tWaitTime; + result2.rWaitPercent = (result2.rWaitTime - _disk_io.rWaitTime) * 100 / result2.ms; + result2.wWaitPercent = (result2.wWaitTime - _disk_io.wWaitTime) * 100 / result2.ms; + result2.tWaitPercent = (result2.tWaitTime - _disk_io.tWaitTime) * 100 / result2.ms; + _disk_io.rIO = rIO; + _disk_io.wIO = wIO; + _disk_io.rIO_sec = result2.rIO_sec; + _disk_io.wIO_sec = result2.wIO_sec; + _disk_io.tIO_sec = result2.tIO_sec; + _disk_io.rWaitTime = rWaitTime; + _disk_io.wWaitTime = wWaitTime; + _disk_io.tWaitTime = tWaitTime; + _disk_io.rWaitPercent = result2.rWaitPercent; + _disk_io.wWaitPercent = result2.wWaitPercent; + _disk_io.tWaitPercent = result2.tWaitPercent; + _disk_io.last_ms = result2.ms; + _disk_io.ms = Date.now(); + } else { + result2.rIO = rIO; + result2.wIO = wIO; + result2.tIO = rIO + wIO; + result2.rWaitTime = rWaitTime; + result2.wWaitTime = wWaitTime; + result2.tWaitTime = tWaitTime; + _disk_io.rIO = rIO; + _disk_io.wIO = wIO; + _disk_io.rIO_sec = null; + _disk_io.wIO_sec = null; + _disk_io.tIO_sec = null; + _disk_io.rWaitTime = rWaitTime; + _disk_io.wWaitTime = wWaitTime; + _disk_io.tWaitTime = tWaitTime; + _disk_io.rWaitPercent = null; + _disk_io.wWaitPercent = null; + _disk_io.tWaitPercent = null; + _disk_io.last_ms = 0; + _disk_io.ms = Date.now(); + } + return result2; + } + function disksIO(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + if (_windows) { + return resolve(null); + } + if (_sunos) { + return resolve(null); + } + let result2 = { + rIO: 0, + wIO: 0, + tIO: 0, + rIO_sec: null, + wIO_sec: null, + tIO_sec: null, + rWaitTime: 0, + wWaitTime: 0, + tWaitTime: 0, + rWaitPercent: null, + wWaitPercent: null, + tWaitPercent: null, + ms: 0 + }; + let rIO = 0; + let wIO = 0; + let rWaitTime = 0; + let wWaitTime = 0; + let tWaitTime = 0; + if (_disk_io && !_disk_io.ms || _disk_io && _disk_io.ms && Date.now() - _disk_io.ms >= 500) { + if (_linux || _freebsd || _openbsd || _netbsd) { + let cmd = 'for mount in `lsblk 2>/dev/null | grep " disk " | sed "s/[\u2502\u2514\u2500\u251C]//g" | awk \'{$1=$1};1\' | cut -d " " -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r "s/ +/;/g" | sed -r "s/^;//"; done'; + exec2(cmd, { maxBuffer: 1024 * 1024 }, function(error, stdout) { + if (!error) { + let lines = stdout.split("\n"); + lines.forEach(function(line) { + if (!line) { + return; + } + let stats = line.split(";"); + rIO += parseInt(stats[0]); + wIO += parseInt(stats[4]); + rWaitTime += parseInt(stats[3]); + wWaitTime += parseInt(stats[7]); + tWaitTime += parseInt(stats[10]); + }); + result2 = calcDiskIO(rIO, wIO, rWaitTime, wWaitTime, tWaitTime); + if (callback) { + callback(result2); + } + resolve(result2); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } + if (_darwin) { + exec2('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"', { maxBuffer: 1024 * 1024 }, function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + lines.forEach(function(line) { + line = line.trim(); + if (line !== "") { + line = line.split(","); + rIO += parseInt(line[10]); + wIO += parseInt(line[0]); + } + }); + result2 = calcDiskIO(rIO, wIO, rWaitTime, wWaitTime, tWaitTime); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + } else { + result2.rIO = _disk_io.rIO; + result2.wIO = _disk_io.wIO; + result2.tIO = _disk_io.rIO + _disk_io.wIO; + result2.ms = _disk_io.last_ms; + result2.rIO_sec = _disk_io.rIO_sec; + result2.wIO_sec = _disk_io.wIO_sec; + result2.tIO_sec = _disk_io.tIO_sec; + result2.rWaitTime = _disk_io.rWaitTime; + result2.wWaitTime = _disk_io.wWaitTime; + result2.tWaitTime = _disk_io.tWaitTime; + result2.rWaitPercent = _disk_io.rWaitPercent; + result2.wWaitPercent = _disk_io.wWaitPercent; + result2.tWaitPercent = _disk_io.tWaitPercent; + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + } + exports.disksIO = disksIO; + function diskLayout(callback) { + function getVendorFromModel(model) { + const diskManufacturers = [ + { pattern: "WESTERN.*", manufacturer: "Western Digital" }, + { pattern: "^WDC.*", manufacturer: "Western Digital" }, + { pattern: "WD.*", manufacturer: "Western Digital" }, + { pattern: "TOSHIBA.*", manufacturer: "Toshiba" }, + { pattern: "HITACHI.*", manufacturer: "Hitachi" }, + { pattern: "^IC.*", manufacturer: "Hitachi" }, + { pattern: "^HTS.*", manufacturer: "Hitachi" }, + { pattern: "SANDISK.*", manufacturer: "SanDisk" }, + { pattern: "KINGSTON.*", manufacturer: "Kingston Technology" }, + { pattern: "^SONY.*", manufacturer: "Sony" }, + { pattern: "TRANSCEND.*", manufacturer: "Transcend" }, + { pattern: "SAMSUNG.*", manufacturer: "Samsung" }, + { pattern: "^ST(?!I\\ ).*", manufacturer: "Seagate" }, + { pattern: "^STI\\ .*", manufacturer: "SimpleTech" }, + { pattern: "^D...-.*", manufacturer: "IBM" }, + { pattern: "^IBM.*", manufacturer: "IBM" }, + { pattern: "^FUJITSU.*", manufacturer: "Fujitsu" }, + { pattern: "^MP.*", manufacturer: "Fujitsu" }, + { pattern: "^MK.*", manufacturer: "Toshiba" }, + { pattern: "MAXTO.*", manufacturer: "Maxtor" }, + { pattern: "PIONEER.*", manufacturer: "Pioneer" }, + { pattern: "PHILIPS.*", manufacturer: "Philips" }, + { pattern: "QUANTUM.*", manufacturer: "Quantum Technology" }, + { pattern: "FIREBALL.*", manufacturer: "Quantum Technology" }, + { pattern: "^VBOX.*", manufacturer: "VirtualBox" }, + { pattern: "CORSAIR.*", manufacturer: "Corsair Components" }, + { pattern: "CRUCIAL.*", manufacturer: "Crucial" }, + { pattern: "ECM.*", manufacturer: "ECM" }, + { pattern: "INTEL.*", manufacturer: "INTEL" }, + { pattern: "EVO.*", manufacturer: "Samsung" }, + { pattern: "APPLE.*", manufacturer: "Apple" } + ]; + let result2 = ""; + if (model) { + model = model.toUpperCase(); + diskManufacturers.forEach((manufacturer) => { + const re = RegExp(manufacturer.pattern); + if (re.test(model)) { + result2 = manufacturer.manufacturer; + } + }); + } + return result2; + } + return new Promise((resolve) => { + process.nextTick(() => { + const commitResult = (res) => { + for (let i = 0; i < res.length; i++) { + delete res[i].BSDName; + } + if (callback) { + callback(res); + } + resolve(res); + }; + let result2 = []; + let cmd = ""; + if (_linux) { + let cmdFullSmart = ""; + exec2("export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL", { maxBuffer: 1024 * 1024 }, function(error, stdout) { + if (!error) { + try { + const out = stdout.toString().trim(); + let devices = []; + try { + const outJSON = JSON.parse(out); + if (outJSON && {}.hasOwnProperty.call(outJSON, "blockdevices")) { + devices = outJSON.blockdevices.filter((item) => { + return item.type === "disk" && item.size > 0 && (item.model !== null || item.mountpoint === null && item.label === null && item.fstype === null && item.parttype === null && item.path && item.path.indexOf("/ram") !== 0 && item.path.indexOf("/loop") !== 0 && item["disc-max"] && item["disc-max"] !== 0); + }); + } + } catch (e) { + try { + const out2 = execSync("export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL", util.execOptsLinux).toString(); + let lines = blkStdoutToObject(out2).split("\n"); + const data = parseBlk(lines); + devices = data.filter((item) => { + return item.type === "disk" && item.size > 0 && (item.model !== null && item.model !== "" || item.mount === "" && item.label === "" && item.fsType === ""); + }); + } catch (e2) { + util.noop(); + } + } + devices.forEach((device) => { + let mediumType = ""; + const BSDName = "/dev/" + device.name; + const logical = device.name; + try { + mediumType = execSync("cat /sys/block/" + logical + "/queue/rotational 2>/dev/null", util.execOptsLinux).toString().split("\n")[0]; + } catch (e) { + util.noop(); + } + let interfaceType = device.tran ? device.tran.toUpperCase().trim() : ""; + if (interfaceType === "NVME") { + mediumType = "2"; + interfaceType = "PCIe"; + } + result2.push({ + device: BSDName, + type: mediumType === "0" ? "SSD" : mediumType === "1" ? "HD" : mediumType === "2" ? "NVMe" : device.model && device.model.indexOf("SSD") > -1 ? "SSD" : device.model && device.model.indexOf("NVM") > -1 ? "NVMe" : "HD", + name: device.model || "", + vendor: getVendorFromModel(device.model) || (device.vendor ? device.vendor.trim() : ""), + size: device.size || 0, + bytesPerSector: null, + totalCylinders: null, + totalHeads: null, + totalSectors: null, + totalTracks: null, + tracksPerCylinder: null, + sectorsPerTrack: null, + firmwareRevision: device.rev ? device.rev.trim() : "", + serialNum: device.serial ? device.serial.trim() : "", + interfaceType, + smartStatus: "unknown", + temperature: null, + BSDName + }); + cmd += `printf " +${BSDName}|"; smartctl -H ${BSDName} | grep overall;`; + cmdFullSmart += `${cmdFullSmart ? 'printf ",";' : ""}smartctl -a -j ${BSDName};`; + }); + } catch (e) { + util.noop(); + } + } + if (cmdFullSmart) { + exec2(cmdFullSmart, { maxBuffer: 1024 * 1024 }, function(error2, stdout2) { + try { + const data = JSON.parse(`[${stdout2}]`); + data.forEach((disk) => { + const diskBSDName = disk.smartctl.argv[disk.smartctl.argv.length - 1]; + for (let i = 0; i < result2.length; i++) { + if (result2[i].BSDName === diskBSDName) { + result2[i].smartStatus = disk.smart_status.passed ? "Ok" : disk.smart_status.passed === false ? "Predicted Failure" : "unknown"; + if (disk.temperature && disk.temperature.current) { + result2[i].temperature = disk.temperature.current; + } + result2[i].smartData = disk; + } + } + }); + commitResult(result2); + } catch (e) { + if (cmd) { + cmd = cmd + 'printf "\n"'; + exec2(cmd, { maxBuffer: 1024 * 1024 }, function(error3, stdout3) { + let lines = stdout3.toString().split("\n"); + lines.forEach((line) => { + if (line) { + let parts = line.split("|"); + if (parts.length === 2) { + let BSDName = parts[0]; + parts[1] = parts[1].trim(); + let parts2 = parts[1].split(":"); + if (parts2.length === 2) { + parts2[1] = parts2[1].trim(); + let status = parts2[1].toLowerCase(); + for (let i = 0; i < result2.length; i++) { + if (result2[i].BSDName === BSDName) { + result2[i].smartStatus = status === "passed" ? "Ok" : status === "failed!" ? "Predicted Failure" : "unknown"; + } + } + } + } + } + }); + commitResult(result2); + }); + } else { + commitResult(result2); + } + } + }); + } else { + commitResult(result2); + } + }); + } + if (_freebsd || _openbsd || _netbsd) { + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_sunos) { + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_darwin) { + exec2("system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType", { maxBuffer: 1024 * 1024 }, function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + let linesSATA = []; + let linesNVMe = []; + let linesUSB = []; + let dataType = "SATA"; + lines.forEach((line) => { + if (line === "NVMExpress:") { + dataType = "NVMe"; + } else if (line === "USB:") { + dataType = "USB"; + } else if (line === "SATA/SATA Express:") { + dataType = "SATA"; + } else if (dataType === "SATA") { + linesSATA.push(line); + } else if (dataType === "NVMe") { + linesNVMe.push(line); + } else if (dataType === "USB") { + linesUSB.push(line); + } + }); + try { + let devices = linesSATA.join("\n").split(" Physical Interconnect: "); + devices.shift(); + devices.forEach(function(device) { + device = "InterfaceType: " + device; + let lines2 = device.split("\n"); + const mediumType = util.getValue(lines2, "Medium Type", ":", true).trim(); + const sizeStr = util.getValue(lines2, "capacity", ":", true).trim(); + const BSDName = util.getValue(lines2, "BSD Name", ":", true).trim(); + if (sizeStr) { + let sizeValue = 0; + if (sizeStr.indexOf("(") >= 0) { + sizeValue = parseInt(sizeStr.match(/\(([^)]+)\)/)[1].replace(/\./g, "").replace(/,/g, "").replace(/\s/g, "")); + } + if (!sizeValue) { + sizeValue = parseInt(sizeStr); + } + if (sizeValue) { + const smartStatusString = util.getValue(lines2, "S.M.A.R.T. status", ":", true).trim().toLowerCase(); + result2.push({ + device: BSDName, + type: mediumType.startsWith("Solid") ? "SSD" : "HD", + name: util.getValue(lines2, "Model", ":", true).trim(), + vendor: getVendorFromModel(util.getValue(lines2, "Model", ":", true).trim()) || util.getValue(lines2, "Manufacturer", ":", true), + size: sizeValue, + bytesPerSector: null, + totalCylinders: null, + totalHeads: null, + totalSectors: null, + totalTracks: null, + tracksPerCylinder: null, + sectorsPerTrack: null, + firmwareRevision: util.getValue(lines2, "Revision", ":", true).trim(), + serialNum: util.getValue(lines2, "Serial Number", ":", true).trim(), + interfaceType: util.getValue(lines2, "InterfaceType", ":", true).trim(), + smartStatus: smartStatusString === "verified" ? "OK" : smartStatusString || "unknown", + temperature: null, + BSDName + }); + cmd = cmd + 'printf "\n' + BSDName + '|"; diskutil info /dev/' + BSDName + " | grep SMART;"; + } + } + }); + } catch (e) { + util.noop(); + } + try { + let devices = linesNVMe.join("\n").split("\n\n Capacity:"); + devices.shift(); + devices.forEach(function(device) { + device = "!Capacity: " + device; + let lines2 = device.split("\n"); + const linkWidth = util.getValue(lines2, "link width", ":", true).trim(); + const sizeStr = util.getValue(lines2, "!capacity", ":", true).trim(); + const BSDName = util.getValue(lines2, "BSD Name", ":", true).trim(); + if (sizeStr) { + let sizeValue = 0; + if (sizeStr.indexOf("(") >= 0) { + sizeValue = parseInt(sizeStr.match(/\(([^)]+)\)/)[1].replace(/\./g, "").replace(/,/g, "").replace(/\s/g, "")); + } + if (!sizeValue) { + sizeValue = parseInt(sizeStr); + } + if (sizeValue) { + const smartStatusString = util.getValue(lines2, "S.M.A.R.T. status", ":", true).trim().toLowerCase(); + result2.push({ + device: BSDName, + type: "NVMe", + name: util.getValue(lines2, "Model", ":", true).trim(), + vendor: getVendorFromModel(util.getValue(lines2, "Model", ":", true).trim()), + size: sizeValue, + bytesPerSector: null, + totalCylinders: null, + totalHeads: null, + totalSectors: null, + totalTracks: null, + tracksPerCylinder: null, + sectorsPerTrack: null, + firmwareRevision: util.getValue(lines2, "Revision", ":", true).trim(), + serialNum: util.getValue(lines2, "Serial Number", ":", true).trim(), + interfaceType: ("PCIe " + linkWidth).trim(), + smartStatus: smartStatusString === "verified" ? "OK" : smartStatusString || "unknown", + temperature: null, + BSDName + }); + cmd = cmd + 'printf "\n' + BSDName + '|"; diskutil info /dev/' + BSDName + " | grep SMART;"; + } + } + }); + } catch (e) { + util.noop(); + } + try { + let devices = linesUSB.join("\n").replaceAll("Media:\n ", "Model:").split("\n\n Product ID:"); + devices.shift(); + devices.forEach(function(device) { + let lines2 = device.split("\n"); + const sizeStr = util.getValue(lines2, "Capacity", ":", true).trim(); + const BSDName = util.getValue(lines2, "BSD Name", ":", true).trim(); + if (sizeStr) { + let sizeValue = 0; + if (sizeStr.indexOf("(") >= 0) { + sizeValue = parseInt(sizeStr.match(/\(([^)]+)\)/)[1].replace(/\./g, "").replace(/,/g, "").replace(/\s/g, "")); + } + if (!sizeValue) { + sizeValue = parseInt(sizeStr); + } + if (sizeValue) { + const smartStatusString = util.getValue(lines2, "S.M.A.R.T. status", ":", true).trim().toLowerCase(); + result2.push({ + device: BSDName, + type: "USB", + name: util.getValue(lines2, "Model", ":", true).trim().replaceAll(":", ""), + vendor: getVendorFromModel(util.getValue(lines2, "Model", ":", true).trim()), + size: sizeValue, + bytesPerSector: null, + totalCylinders: null, + totalHeads: null, + totalSectors: null, + totalTracks: null, + tracksPerCylinder: null, + sectorsPerTrack: null, + firmwareRevision: util.getValue(lines2, "Revision", ":", true).trim(), + serialNum: util.getValue(lines2, "Serial Number", ":", true).trim(), + interfaceType: "USB", + smartStatus: smartStatusString === "verified" ? "OK" : smartStatusString || "unknown", + temperature: null, + BSDName + }); + cmd = cmd + 'printf "\n' + BSDName + '|"; diskutil info /dev/' + BSDName + " | grep SMART;"; + } + } + }); + } catch (e) { + util.noop(); + } + if (cmd) { + cmd = cmd + 'printf "\n"'; + exec2(cmd, { maxBuffer: 1024 * 1024 }, function(error2, stdout2) { + let lines2 = stdout2.toString().split("\n"); + lines2.forEach((line) => { + if (line) { + let parts = line.split("|"); + if (parts.length === 2) { + let BSDName = parts[0]; + parts[1] = parts[1].trim(); + let parts2 = parts[1].split(":"); + if (parts2.length === 2) { + parts2[1] = parts2[1].trim(); + let status = parts2[1].toLowerCase(); + for (let i = 0; i < result2.length; i++) { + if (result2[i].BSDName === BSDName) { + result2[i].smartStatus = status === "not supported" ? "not supported" : status === "verified" ? "Ok" : status === "failing" ? "Predicted Failure" : "unknown"; + } + } + } + } + } + }); + for (let i = 0; i < result2.length; i++) { + delete result2[i].BSDName; + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + for (let i = 0; i < result2.length; i++) { + delete result2[i].BSDName; + } + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + } + if (_windows) { + try { + const workload = []; + workload.push(util.powerShell("Get-CimInstance Win32_DiskDrive | select Caption,Size,Status,PNPDeviceId,DeviceId,BytesPerSector,TotalCylinders,TotalHeads,TotalSectors,TotalTracks,TracksPerCylinder,SectorsPerTrack,FirmwareRevision,SerialNumber,InterfaceType | fl")); + workload.push(util.powerShell("Get-PhysicalDisk | select BusType,MediaType,FriendlyName,Model,SerialNumber,Size | fl")); + if (util.smartMonToolsInstalled()) { + try { + const smartDev = JSON.parse(execSync("smartctl --scan -j").toString()); + if (smartDev && smartDev.devices && smartDev.devices.length > 0) { + smartDev.devices.forEach((dev) => { + workload.push(execPromiseSave(`smartctl -j -a ${dev.name}`, util.execOptsWin)); + }); + } + } catch (e) { + util.noop(); + } + } + util.promiseAll( + workload + ).then((data) => { + let devices = data.results[0].toString().split(/\n\s*\n/); + devices.forEach(function(device) { + let lines = device.split("\r\n"); + const size = util.getValue(lines, "Size", ":").trim(); + const status = util.getValue(lines, "Status", ":").trim().toLowerCase(); + if (size) { + result2.push({ + device: util.getValue(lines, "DeviceId", ":"), + // changed from PNPDeviceId to DeviceID (be be able to match devices) + type: device.indexOf("SSD") > -1 ? "SSD" : "HD", + // just a starting point ... better: MSFT_PhysicalDisk - Media Type ... see below + name: util.getValue(lines, "Caption", ":"), + vendor: getVendorFromModel(util.getValue(lines, "Caption", ":", true).trim()), + size: parseInt(size), + bytesPerSector: parseInt(util.getValue(lines, "BytesPerSector", ":")), + totalCylinders: parseInt(util.getValue(lines, "TotalCylinders", ":")), + totalHeads: parseInt(util.getValue(lines, "TotalHeads", ":")), + totalSectors: parseInt(util.getValue(lines, "TotalSectors", ":")), + totalTracks: parseInt(util.getValue(lines, "TotalTracks", ":")), + tracksPerCylinder: parseInt(util.getValue(lines, "TracksPerCylinder", ":")), + sectorsPerTrack: parseInt(util.getValue(lines, "SectorsPerTrack", ":")), + firmwareRevision: util.getValue(lines, "FirmwareRevision", ":").trim(), + serialNum: util.getValue(lines, "SerialNumber", ":").trim(), + interfaceType: util.getValue(lines, "InterfaceType", ":").trim(), + smartStatus: status === "ok" ? "Ok" : status === "degraded" ? "Degraded" : status === "pred fail" ? "Predicted Failure" : "Unknown", + temperature: null + }); + } + }); + devices = data.results[1].split(/\n\s*\n/); + devices.forEach(function(device) { + let lines = device.split("\r\n"); + const serialNum = util.getValue(lines, "SerialNumber", ":").trim(); + const name = util.getValue(lines, "FriendlyName", ":").trim().replace("Msft ", "Microsoft"); + const size = util.getValue(lines, "Size", ":").trim(); + const model = util.getValue(lines, "Model", ":").trim(); + const interfaceType = util.getValue(lines, "BusType", ":").trim(); + let mediaType = util.getValue(lines, "MediaType", ":").trim(); + if (mediaType === "3" || mediaType === "HDD") { + mediaType = "HD"; + } + if (mediaType === "4") { + mediaType = "SSD"; + } + if (mediaType === "5") { + mediaType = "SCM"; + } + if (mediaType === "Unspecified" && (model.toLowerCase().indexOf("virtual") > -1 || model.toLowerCase().indexOf("vbox") > -1)) { + mediaType = "Virtual"; + } + if (size) { + let i = util.findObjectByKey(result2, "serialNum", serialNum); + if (i === -1 || serialNum === "") { + i = util.findObjectByKey(result2, "name", name); + } + if (i != -1) { + result2[i].type = mediaType; + result2[i].interfaceType = interfaceType; + } + } + }); + data.results.shift(); + data.results.shift(); + if (data.results.length) { + data.results.forEach((smartStr) => { + try { + const smartData = JSON.parse(smartStr); + if (smartData.serial_number) { + const serialNum = smartData.serial_number; + let i = util.findObjectByKey(result2, "serialNum", serialNum); + if (i != -1) { + result2[i].smartStatus = smartData.smart_status && smartData.smart_status.passed ? "Ok" : smartData.smart_status && smartData.smart_status.passed === false ? "Predicted Failure" : "unknown"; + if (smartData.temperature && smartData.temperature.current) { + result2[i].temperature = smartData.temperature.current; + } + result2[i].smartData = smartData; + } + } + } catch (e) { + util.noop(); + } + }); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + exports.diskLayout = diskLayout; + } +}); + +// node_modules/systeminformation/lib/network.js +var require_network = __commonJS({ + "node_modules/systeminformation/lib/network.js"(exports) { + "use strict"; + var os2 = require("os"); + var exec2 = require("child_process").exec; + var execSync = require("child_process").execSync; + var fs = require("fs"); + var util = require_util2(); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + var _network = {}; + var _default_iface = ""; + var _ifaces = {}; + var _dhcpNics = []; + var _networkInterfaces = []; + var _mac = {}; + var pathToIp; + function getDefaultNetworkInterface() { + let ifacename = ""; + let ifacenameFirst = ""; + try { + let ifaces = os2.networkInterfaces(); + let scopeid = 9999; + for (let dev in ifaces) { + if ({}.hasOwnProperty.call(ifaces, dev)) { + ifaces[dev].forEach(function(details) { + if (details && details.internal === false) { + ifacenameFirst = ifacenameFirst || dev; + if (details.scopeid && details.scopeid < scopeid) { + ifacename = dev; + scopeid = details.scopeid; + } + } + }); + } + } + ifacename = ifacename || ifacenameFirst || ""; + if (_windows) { + let defaultIp = ""; + const cmd = "netstat -r"; + const result2 = execSync(cmd, util.execOptsWin); + const lines = result2.toString().split(os2.EOL); + lines.forEach((line) => { + line = line.replace(/\s+/g, " ").trim(); + if (line.indexOf("0.0.0.0 0.0.0.0") > -1 && !/[a-zA-Z]/.test(line)) { + const parts = line.split(" "); + if (parts.length >= 5) { + defaultIp = parts[parts.length - 2]; + } + } + }); + if (defaultIp) { + for (let dev in ifaces) { + if ({}.hasOwnProperty.call(ifaces, dev)) { + ifaces[dev].forEach(function(details) { + if (details && details.address && details.address === defaultIp) { + ifacename = dev; + } + }); + } + } + } + } + if (_linux) { + let cmd = "ip route 2> /dev/null | grep default"; + let result2 = execSync(cmd, util.execOptsLinux); + let parts = result2.toString().split("\n")[0].split(/\s+/); + if (parts[0] === "none" && parts[5]) { + ifacename = parts[5]; + } else if (parts[4]) { + ifacename = parts[4]; + } + if (ifacename.indexOf(":") > -1) { + ifacename = ifacename.split(":")[1].trim(); + } + } + if (_darwin || _freebsd || _openbsd || _netbsd || _sunos) { + let cmd = ""; + if (_linux) { + cmd = "ip route 2> /dev/null | grep default | awk '{print $5}'"; + } + if (_darwin) { + cmd = "route -n get default 2>/dev/null | grep interface: | awk '{print $2}'"; + } + if (_freebsd || _openbsd || _netbsd || _sunos) { + cmd = "route get 0.0.0.0 | grep interface:"; + } + let result2 = execSync(cmd); + ifacename = result2.toString().split("\n")[0]; + if (ifacename.indexOf(":") > -1) { + ifacename = ifacename.split(":")[1].trim(); + } + } + } catch (e) { + util.noop(); + } + if (ifacename) { + _default_iface = ifacename; + } + return _default_iface; + } + exports.getDefaultNetworkInterface = getDefaultNetworkInterface; + function getMacAddresses() { + let iface = ""; + let mac = ""; + let result2 = {}; + if (_linux || _freebsd || _openbsd || _netbsd) { + if (typeof pathToIp === "undefined") { + try { + const lines = execSync("which ip", util.execOptsLinux).toString().split("\n"); + if (lines.length && lines[0].indexOf(":") === -1 && lines[0].indexOf("/") === 0) { + pathToIp = lines[0]; + } else { + pathToIp = ""; + } + } catch (e) { + pathToIp = ""; + } + } + try { + const cmd = "export LC_ALL=C; " + (pathToIp ? pathToIp + " link show up" : "/sbin/ifconfig") + "; unset LC_ALL"; + let res = execSync(cmd, util.execOptsLinux); + const lines = res.toString().split("\n"); + for (let i = 0; i < lines.length; i++) { + if (lines[i] && lines[i][0] !== " ") { + if (pathToIp) { + let nextline = lines[i + 1].trim().split(" "); + if (nextline[0] === "link/ether") { + iface = lines[i].split(" ")[1]; + iface = iface.slice(0, iface.length - 1); + mac = nextline[1]; + } + } else { + iface = lines[i].split(" ")[0]; + mac = lines[i].split("HWaddr ")[1]; + } + if (iface && mac) { + result2[iface] = mac.trim(); + iface = ""; + mac = ""; + } + } + } + } catch (e) { + util.noop(); + } + } + if (_darwin) { + try { + const cmd = "/sbin/ifconfig"; + let res = execSync(cmd); + const lines = res.toString().split("\n"); + for (let i = 0; i < lines.length; i++) { + if (lines[i] && lines[i][0] !== " " && lines[i].indexOf(":") > 0) { + iface = lines[i].split(":")[0]; + } else if (lines[i].indexOf(" ether ") === 0) { + mac = lines[i].split(" ether ")[1]; + if (iface && mac) { + result2[iface] = mac.trim(); + iface = ""; + mac = ""; + } + } + } + } catch (e) { + util.noop(); + } + } + return result2; + } + function networkInterfaceDefault(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = getDefaultNetworkInterface(); + if (callback) { + callback(result2); + } + resolve(result2); + }); + }); + } + exports.networkInterfaceDefault = networkInterfaceDefault; + function parseLinesWindowsNics(sections, nconfigsections) { + let nics = []; + for (let i in sections) { + try { + if ({}.hasOwnProperty.call(sections, i)) { + if (sections[i].trim() !== "") { + let lines = sections[i].trim().split("\r\n"); + let linesNicConfig = null; + try { + linesNicConfig = nconfigsections && nconfigsections[i] ? nconfigsections[i].trim().split("\r\n") : []; + } catch (e) { + util.noop(); + } + let netEnabled = util.getValue(lines, "NetEnabled", ":"); + let adapterType = util.getValue(lines, "AdapterTypeID", ":") === "9" ? "wireless" : "wired"; + let ifacename = util.getValue(lines, "Name", ":").replace(/\]/g, ")").replace(/\[/g, "("); + let iface = util.getValue(lines, "NetConnectionID", ":").replace(/\]/g, ")").replace(/\[/g, "("); + if (ifacename.toLowerCase().indexOf("wi-fi") >= 0 || ifacename.toLowerCase().indexOf("wireless") >= 0) { + adapterType = "wireless"; + } + if (netEnabled !== "") { + const speed = parseInt(util.getValue(lines, "speed", ":").trim(), 10) / 1e6; + nics.push({ + mac: util.getValue(lines, "MACAddress", ":").toLowerCase(), + dhcp: util.getValue(linesNicConfig, "dhcpEnabled", ":").toLowerCase() === "true", + name: ifacename, + iface, + netEnabled: netEnabled === "TRUE", + speed: isNaN(speed) ? null : speed, + operstate: util.getValue(lines, "NetConnectionStatus", ":") === "2" ? "up" : "down", + type: adapterType + }); + } + } + } + } catch (e) { + util.noop(); + } + } + return nics; + } + function getWindowsNics() { + return new Promise((resolve) => { + process.nextTick(() => { + let cmd = "Get-CimInstance Win32_NetworkAdapter | fl *; echo '#-#-#-#';"; + cmd += "Get-CimInstance Win32_NetworkAdapterConfiguration | fl DHCPEnabled"; + try { + util.powerShell(cmd).then((data) => { + data = data.split("#-#-#-#"); + const nsections = (data[0] || "").split(/\n\s*\n/); + const nconfigsections = (data[1] || "").split(/\n\s*\n/); + resolve(parseLinesWindowsNics(nsections, nconfigsections)); + }); + } catch (e) { + resolve([]); + } + }); + }); + } + function getWindowsDNSsuffixes() { + let iface = {}; + let dnsSuffixes = { + primaryDNS: "", + exitCode: 0, + ifaces: [] + }; + try { + const ipconfig = execSync("ipconfig /all", util.execOptsWin); + const ipconfigArray = ipconfig.split("\r\n\r\n"); + ipconfigArray.forEach((element, index) => { + if (index == 1) { + const longPrimaryDNS = element.split("\r\n").filter((element2) => { + return element2.toUpperCase().includes("DNS"); + }); + const primaryDNS = longPrimaryDNS[0].substring(longPrimaryDNS[0].lastIndexOf(":") + 1); + dnsSuffixes.primaryDNS = primaryDNS.trim(); + if (!dnsSuffixes.primaryDNS) { + dnsSuffixes.primaryDNS = "Not defined"; + } + } + if (index > 1) { + if (index % 2 == 0) { + const name = element.substring(element.lastIndexOf(" ") + 1).replace(":", ""); + iface.name = name; + } else { + const connectionSpecificDNS = element.split("\r\n").filter((element2) => { + return element2.toUpperCase().includes("DNS"); + }); + const dnsSuffix = connectionSpecificDNS[0].substring(connectionSpecificDNS[0].lastIndexOf(":") + 1); + iface.dnsSuffix = dnsSuffix.trim(); + dnsSuffixes.ifaces.push(iface); + iface = {}; + } + } + }); + return dnsSuffixes; + } catch (error) { + return { + primaryDNS: "", + exitCode: 0, + ifaces: [] + }; + } + } + function getWindowsIfaceDNSsuffix(ifaces, ifacename) { + let dnsSuffix = ""; + const interfaceName = ifacename + "."; + try { + const connectionDnsSuffix = ifaces.filter((iface) => { + return interfaceName.includes(iface.name + "."); + }).map((iface) => iface.dnsSuffix); + if (connectionDnsSuffix[0]) { + dnsSuffix = connectionDnsSuffix[0]; + } + if (!dnsSuffix) { + dnsSuffix = ""; + } + return dnsSuffix; + } catch (error) { + return "Unknown"; + } + } + function getWindowsWiredProfilesInformation() { + try { + const result2 = execSync("netsh lan show profiles", util.execOptsWin); + const profileList = result2.split("\r\nProfile on interface"); + return profileList; + } catch (error) { + if (error.status === 1 && error.stdout.includes("AutoConfig")) { + return "Disabled"; + } + return []; + } + } + function getWindowsWirelessIfaceSSID(interfaceName) { + try { + const result2 = execSync(`netsh wlan show interface name="${interfaceName}" | findstr "SSID"`, util.execOptsWin); + const SSID = result2.split("\r\n").shift(); + const parseSSID = SSID.split(":").pop().trim(); + return parseSSID; + } catch (error) { + return "Unknown"; + } + } + function getWindowsIEEE8021x(connectionType, iface, ifaces) { + let i8021x = { + state: "Unknown", + protocol: "Unknown" + }; + if (ifaces === "Disabled") { + i8021x.state = "Disabled"; + i8021x.protocol = "Not defined"; + return i8021x; + } + if (connectionType == "wired" && ifaces.length > 0) { + try { + const iface8021xInfo = ifaces.find((element) => { + return element.includes(iface + "\r\n"); + }); + const arrayIface8021xInfo = iface8021xInfo.split("\r\n"); + const state8021x = arrayIface8021xInfo.find((element) => { + return element.includes("802.1x"); + }); + if (state8021x.includes("Disabled")) { + i8021x.state = "Disabled"; + i8021x.protocol = "Not defined"; + } else if (state8021x.includes("Enabled")) { + const protocol8021x = arrayIface8021xInfo.find((element) => { + return element.includes("EAP"); + }); + i8021x.protocol = protocol8021x.split(":").pop(); + i8021x.state = "Enabled"; + } + } catch (error) { + return i8021x; + } + } else if (connectionType == "wireless") { + let i8021xState = ""; + let i8021xProtocol = ""; + try { + const SSID = getWindowsWirelessIfaceSSID(iface); + if (SSID !== "Unknown") { + let ifaceSanitized = ""; + const s = util.isPrototypePolluted() ? "---" : util.sanitizeShellString(SSID); + const l = util.mathMin(s.length, 32); + for (let i = 0; i <= l; i++) { + if (s[i] !== void 0) { + ifaceSanitized = ifaceSanitized + s[i]; + } + } + i8021xState = execSync(`netsh wlan show profiles "${ifaceSanitized}" | findstr "802.1X"`, util.execOptsWin); + i8021xProtocol = execSync(`netsh wlan show profiles "${ifaceSanitized}" | findstr "EAP"`, util.execOptsWin); + } + if (i8021xState.includes(":") && i8021xProtocol.includes(":")) { + i8021x.state = i8021xState.split(":").pop(); + i8021x.protocol = i8021xProtocol.split(":").pop(); + } + } catch (error) { + if (error.status === 1 && error.stdout.includes("AutoConfig")) { + i8021x.state = "Disabled"; + i8021x.protocol = "Not defined"; + } + return i8021x; + } + } + return i8021x; + } + function splitSectionsNics(lines) { + const result2 = []; + let section = []; + lines.forEach(function(line) { + if (!line.startsWith(" ") && !line.startsWith(" ")) { + if (section.length) { + result2.push(section); + section = []; + } + } + section.push(line); + }); + if (section.length) { + result2.push(section); + } + return result2; + } + function parseLinesDarwinNics(sections) { + let nics = []; + sections.forEach((section) => { + let nic = { + iface: "", + mtu: null, + mac: "", + ip6: "", + ip4: "", + speed: null, + type: "", + operstate: "", + duplex: "", + internal: false + }; + const first = section[0]; + nic.iface = first.split(":")[0].trim(); + let parts = first.split("> mtu"); + nic.mtu = parts.length > 1 ? parseInt(parts[1], 10) : null; + if (isNaN(nic.mtu)) { + nic.mtu = null; + } + nic.internal = parts[0].toLowerCase().indexOf("loopback") > -1; + section.forEach((line) => { + if (line.trim().startsWith("ether ")) { + nic.mac = line.split("ether ")[1].toLowerCase().trim(); + } + if (line.trim().startsWith("inet6 ") && !nic.ip6) { + nic.ip6 = line.split("inet6 ")[1].toLowerCase().split("%")[0].split(" ")[0]; + } + if (line.trim().startsWith("inet ") && !nic.ip4) { + nic.ip4 = line.split("inet ")[1].toLowerCase().split(" ")[0]; + } + }); + let speed = util.getValue(section, "link rate"); + nic.speed = speed ? parseFloat(speed) : null; + if (nic.speed === null) { + speed = util.getValue(section, "uplink rate"); + nic.speed = speed ? parseFloat(speed) : null; + if (nic.speed !== null && speed.toLowerCase().indexOf("gbps") >= 0) { + nic.speed = nic.speed * 1e3; + } + } else { + if (speed.toLowerCase().indexOf("gbps") >= 0) { + nic.speed = nic.speed * 1e3; + } + } + nic.type = util.getValue(section, "type").toLowerCase().indexOf("wi-fi") > -1 ? "wireless" : "wired"; + const operstate = util.getValue(section, "status").toLowerCase(); + nic.operstate = operstate === "active" ? "up" : operstate === "inactive" ? "down" : "unknown"; + nic.duplex = util.getValue(section, "media").toLowerCase().indexOf("half-duplex") > -1 ? "half" : "full"; + if (nic.ip6 || nic.ip4 || nic.mac) { + nics.push(nic); + } + }); + return nics; + } + function getDarwinNics() { + const cmd = "/sbin/ifconfig -v"; + try { + const lines = execSync(cmd, { maxBuffer: 1024 * 2e4 }).toString().split("\n"); + const nsections = splitSectionsNics(lines); + return parseLinesDarwinNics(nsections); + } catch (e) { + return []; + } + } + function getLinuxIfaceConnectionName(interfaceName) { + const cmd = `nmcli device status 2>/dev/null | grep ${interfaceName}`; + try { + const result2 = execSync(cmd, util.execOptsLinux).toString(); + const resultFormat = result2.replace(/\s+/g, " ").trim(); + const connectionNameLines = resultFormat.split(" ").slice(3); + const connectionName = connectionNameLines.join(" "); + return connectionName != "--" ? connectionName : ""; + } catch (e) { + return ""; + } + } + function checkLinuxDCHPInterfaces(file) { + let result2 = []; + try { + let cmd = `cat ${file} 2> /dev/null | grep 'iface\\|source'`; + const lines = execSync(cmd, util.execOptsLinux).toString().split("\n"); + lines.forEach((line) => { + const parts = line.replace(/\s+/g, " ").trim().split(" "); + if (parts.length >= 4) { + if (line.toLowerCase().indexOf(" inet ") >= 0 && line.toLowerCase().indexOf("dhcp") >= 0) { + result2.push(parts[1]); + } + } + if (line.toLowerCase().includes("source")) { + let file2 = line.split(" ")[1]; + result2 = result2.concat(checkLinuxDCHPInterfaces(file2)); + } + }); + } catch (e) { + util.noop(); + } + return result2; + } + function getLinuxDHCPNics() { + let cmd = "ip a 2> /dev/null"; + let result2 = []; + try { + const lines = execSync(cmd, util.execOptsLinux).toString().split("\n"); + const nsections = splitSectionsNics(lines); + result2 = parseLinuxDHCPNics(nsections); + } catch (e) { + util.noop(); + } + try { + result2 = checkLinuxDCHPInterfaces("/etc/network/interfaces"); + } catch (e) { + util.noop(); + } + return result2; + } + function parseLinuxDHCPNics(sections) { + const result2 = []; + if (sections && sections.length) { + sections.forEach((lines) => { + if (lines && lines.length) { + const parts = lines[0].split(":"); + if (parts.length > 2) { + for (let line of lines) { + if (line.indexOf(" inet ") >= 0 && line.indexOf(" dynamic ") >= 0) { + const parts2 = line.split(" "); + const nic = parts2[parts2.length - 1].trim(); + result2.push(nic); + break; + } + } + } + } + }); + } + return result2; + } + function getLinuxIfaceDHCPstatus(iface, connectionName, DHCPNics) { + let result2 = false; + if (connectionName) { + const cmd = `nmcli connection show "${connectionName}" 2>/dev/null | grep ipv4.method;`; + try { + const lines = execSync(cmd, util.execOptsLinux).toString(); + const resultFormat = lines.replace(/\s+/g, " ").trim(); + let dhcStatus = resultFormat.split(" ").slice(1).toString(); + switch (dhcStatus) { + case "auto": + result2 = true; + break; + default: + result2 = false; + break; + } + return result2; + } catch (e) { + return DHCPNics.indexOf(iface) >= 0; + } + } else { + return DHCPNics.indexOf(iface) >= 0; + } + } + function getDarwinIfaceDHCPstatus(iface) { + let result2 = false; + const cmd = `ipconfig getpacket "${iface}" 2>/dev/null | grep lease_time;`; + try { + const lines = execSync(cmd).toString().split("\n"); + if (lines.length && lines[0].startsWith("lease_time")) { + result2 = true; + } + } catch (e) { + util.noop(); + } + return result2; + } + function getLinuxIfaceDNSsuffix(connectionName) { + if (connectionName) { + const cmd = `nmcli connection show "${connectionName}" 2>/dev/null | grep ipv4.dns-search;`; + try { + const result2 = execSync(cmd, util.execOptsLinux).toString(); + const resultFormat = result2.replace(/\s+/g, " ").trim(); + const dnsSuffix = resultFormat.split(" ").slice(1).toString(); + return dnsSuffix == "--" ? "Not defined" : dnsSuffix; + } catch (e) { + return "Unknown"; + } + } else { + return "Unknown"; + } + } + function getLinuxIfaceIEEE8021xAuth(connectionName) { + if (connectionName) { + const cmd = `nmcli connection show "${connectionName}" 2>/dev/null | grep 802-1x.eap;`; + try { + const result2 = execSync(cmd, util.execOptsLinux).toString(); + const resultFormat = result2.replace(/\s+/g, " ").trim(); + const authenticationProtocol = resultFormat.split(" ").slice(1).toString(); + return authenticationProtocol == "--" ? "" : authenticationProtocol; + } catch (e) { + return "Not defined"; + } + } else { + return "Not defined"; + } + } + function getLinuxIfaceIEEE8021xState(authenticationProtocol) { + if (authenticationProtocol) { + if (authenticationProtocol == "Not defined") { + return "Disabled"; + } + return "Enabled"; + } else { + return "Unknown"; + } + } + function testVirtualNic(iface, ifaceName, mac) { + const virtualMacs = ["00:00:00:00:00:00", "00:03:FF", "00:05:69", "00:0C:29", "00:0F:4B", "00:13:07", "00:13:BE", "00:15:5d", "00:16:3E", "00:1C:42", "00:21:F6", "00:24:0B", "00:50:56", "00:A0:B1", "00:E0:C8", "08:00:27", "0A:00:27", "18:92:2C", "16:DF:49", "3C:F3:92", "54:52:00", "FC:15:97"]; + if (mac) { + return virtualMacs.filter((item) => { + return mac.toUpperCase().toUpperCase().startsWith(item.substring(0, mac.length)); + }).length > 0 || iface.toLowerCase().indexOf(" virtual ") > -1 || ifaceName.toLowerCase().indexOf(" virtual ") > -1 || iface.toLowerCase().indexOf("vethernet ") > -1 || ifaceName.toLowerCase().indexOf("vethernet ") > -1 || iface.toLowerCase().startsWith("veth") || ifaceName.toLowerCase().startsWith("veth") || iface.toLowerCase().startsWith("vboxnet") || ifaceName.toLowerCase().startsWith("vboxnet"); + } else { + return false; + } + } + function networkInterfaces(callback, rescan, defaultString) { + if (typeof callback === "string") { + defaultString = callback; + rescan = true; + callback = null; + } + if (typeof callback === "boolean") { + rescan = callback; + callback = null; + defaultString = ""; + } + if (typeof rescan === "undefined") { + rescan = true; + } + defaultString = defaultString || ""; + defaultString = "" + defaultString; + return new Promise((resolve) => { + process.nextTick(() => { + let ifaces = os2.networkInterfaces(); + let result2 = []; + let nics = []; + let dnsSuffixes = []; + let nics8021xInfo = []; + if (_darwin || _freebsd || _openbsd || _netbsd) { + if (JSON.stringify(ifaces) === JSON.stringify(_ifaces) && !rescan) { + result2 = _networkInterfaces; + if (callback) { + callback(result2); + } + resolve(result2); + } else { + const defaultInterface = getDefaultNetworkInterface(); + _ifaces = JSON.parse(JSON.stringify(ifaces)); + nics = getDarwinNics(); + nics.forEach((nic) => { + if ({}.hasOwnProperty.call(ifaces, nic.iface)) { + ifaces[nic.iface].forEach(function(details) { + if (details.family === "IPv4" || details.family === 4) { + nic.ip4subnet = details.netmask; + } + if (details.family === "IPv6" || details.family === 6) { + nic.ip6subnet = details.netmask; + } + }); + } + let ifaceSanitized = ""; + const s = util.isPrototypePolluted() ? "---" : util.sanitizeShellString(nic.iface); + const l = util.mathMin(s.length, 2e3); + for (let i = 0; i <= l; i++) { + if (s[i] !== void 0) { + ifaceSanitized = ifaceSanitized + s[i]; + } + } + result2.push({ + iface: nic.iface, + ifaceName: nic.iface, + default: nic.iface === defaultInterface, + ip4: nic.ip4, + ip4subnet: nic.ip4subnet || "", + ip6: nic.ip6, + ip6subnet: nic.ip6subnet || "", + mac: nic.mac, + internal: nic.internal, + virtual: nic.internal ? false : testVirtualNic(nic.iface, nic.iface, nic.mac), + operstate: nic.operstate, + type: nic.type, + duplex: nic.duplex, + mtu: nic.mtu, + speed: nic.speed, + dhcp: getDarwinIfaceDHCPstatus(ifaceSanitized), + dnsSuffix: "", + ieee8021xAuth: "", + ieee8021xState: "", + carrierChanges: 0 + }); + }); + _networkInterfaces = result2; + if (defaultString.toLowerCase().indexOf("default") >= 0) { + result2 = result2.filter((item) => item.default); + if (result2.length > 0) { + result2 = result2[0]; + } else { + result2 = []; + } + } + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_linux) { + if (JSON.stringify(ifaces) === JSON.stringify(_ifaces) && !rescan) { + result2 = _networkInterfaces; + if (callback) { + callback(result2); + } + resolve(result2); + } else { + _ifaces = JSON.parse(JSON.stringify(ifaces)); + _dhcpNics = getLinuxDHCPNics(); + const defaultInterface = getDefaultNetworkInterface(); + for (let dev in ifaces) { + let ip4 = ""; + let ip4subnet = ""; + let ip6 = ""; + let ip6subnet = ""; + let mac = ""; + let duplex = ""; + let mtu = ""; + let speed = null; + let carrierChanges = 0; + let dhcp = false; + let dnsSuffix = ""; + let ieee8021xAuth = ""; + let ieee8021xState = ""; + let type = ""; + if ({}.hasOwnProperty.call(ifaces, dev)) { + let ifaceName = dev; + ifaces[dev].forEach(function(details) { + if (details.family === "IPv4" || details.family === 4) { + ip4 = details.address; + ip4subnet = details.netmask; + } + if (details.family === "IPv6" || details.family === 6) { + if (!ip6 || ip6.match(/^fe80::/i)) { + ip6 = details.address; + ip6subnet = details.netmask; + } + } + mac = details.mac; + const nodeMainVersion = parseInt(process.versions.node.split("."), 10); + if (mac.indexOf("00:00:0") > -1 && (_linux || _darwin) && !details.internal && nodeMainVersion >= 8 && nodeMainVersion <= 11) { + if (Object.keys(_mac).length === 0) { + _mac = getMacAddresses(); + } + mac = _mac[dev] || ""; + } + }); + let iface = dev.split(":")[0].trim().toLowerCase(); + let ifaceSanitized = ""; + const s = util.isPrototypePolluted() ? "---" : util.sanitizeShellString(iface); + const l = util.mathMin(s.length, 2e3); + for (let i = 0; i <= l; i++) { + if (s[i] !== void 0) { + ifaceSanitized = ifaceSanitized + s[i]; + } + } + const cmd = `echo -n "addr_assign_type: "; cat /sys/class/net/${ifaceSanitized}/addr_assign_type 2>/dev/null; echo; + echo -n "address: "; cat /sys/class/net/${ifaceSanitized}/address 2>/dev/null; echo; + echo -n "addr_len: "; cat /sys/class/net/${ifaceSanitized}/addr_len 2>/dev/null; echo; + echo -n "broadcast: "; cat /sys/class/net/${ifaceSanitized}/broadcast 2>/dev/null; echo; + echo -n "carrier: "; cat /sys/class/net/${ifaceSanitized}/carrier 2>/dev/null; echo; + echo -n "carrier_changes: "; cat /sys/class/net/${ifaceSanitized}/carrier_changes 2>/dev/null; echo; + echo -n "dev_id: "; cat /sys/class/net/${ifaceSanitized}/dev_id 2>/dev/null; echo; + echo -n "dev_port: "; cat /sys/class/net/${ifaceSanitized}/dev_port 2>/dev/null; echo; + echo -n "dormant: "; cat /sys/class/net/${ifaceSanitized}/dormant 2>/dev/null; echo; + echo -n "duplex: "; cat /sys/class/net/${ifaceSanitized}/duplex 2>/dev/null; echo; + echo -n "flags: "; cat /sys/class/net/${ifaceSanitized}/flags 2>/dev/null; echo; + echo -n "gro_flush_timeout: "; cat /sys/class/net/${ifaceSanitized}/gro_flush_timeout 2>/dev/null; echo; + echo -n "ifalias: "; cat /sys/class/net/${ifaceSanitized}/ifalias 2>/dev/null; echo; + echo -n "ifindex: "; cat /sys/class/net/${ifaceSanitized}/ifindex 2>/dev/null; echo; + echo -n "iflink: "; cat /sys/class/net/${ifaceSanitized}/iflink 2>/dev/null; echo; + echo -n "link_mode: "; cat /sys/class/net/${ifaceSanitized}/link_mode 2>/dev/null; echo; + echo -n "mtu: "; cat /sys/class/net/${ifaceSanitized}/mtu 2>/dev/null; echo; + echo -n "netdev_group: "; cat /sys/class/net/${ifaceSanitized}/netdev_group 2>/dev/null; echo; + echo -n "operstate: "; cat /sys/class/net/${ifaceSanitized}/operstate 2>/dev/null; echo; + echo -n "proto_down: "; cat /sys/class/net/${ifaceSanitized}/proto_down 2>/dev/null; echo; + echo -n "speed: "; cat /sys/class/net/${ifaceSanitized}/speed 2>/dev/null; echo; + echo -n "tx_queue_len: "; cat /sys/class/net/${ifaceSanitized}/tx_queue_len 2>/dev/null; echo; + echo -n "type: "; cat /sys/class/net/${ifaceSanitized}/type 2>/dev/null; echo; + echo -n "wireless: "; cat /proc/net/wireless 2>/dev/null | grep ${ifaceSanitized}; echo; + echo -n "wirelessspeed: "; iw dev ${ifaceSanitized} link 2>&1 | grep bitrate; echo;`; + let lines = []; + try { + lines = execSync(cmd, util.execOptsLinux).toString().split("\n"); + const connectionName = getLinuxIfaceConnectionName(ifaceSanitized); + dhcp = getLinuxIfaceDHCPstatus(ifaceSanitized, connectionName, _dhcpNics); + dnsSuffix = getLinuxIfaceDNSsuffix(connectionName); + ieee8021xAuth = getLinuxIfaceIEEE8021xAuth(connectionName); + ieee8021xState = getLinuxIfaceIEEE8021xState(ieee8021xAuth); + } catch (e) { + util.noop(); + } + duplex = util.getValue(lines, "duplex"); + duplex = duplex.startsWith("cat") ? "" : duplex; + mtu = parseInt(util.getValue(lines, "mtu"), 10); + let myspeed = parseInt(util.getValue(lines, "speed"), 10); + speed = isNaN(myspeed) ? null : myspeed; + let wirelessspeed = util.getValue(lines, "wirelessspeed").split("tx bitrate: "); + if (speed === null && wirelessspeed.length === 2) { + myspeed = parseFloat(wirelessspeed[1]); + speed = isNaN(myspeed) ? null : myspeed; + } + carrierChanges = parseInt(util.getValue(lines, "carrier_changes"), 10); + const operstate = util.getValue(lines, "operstate"); + type = operstate === "up" ? util.getValue(lines, "wireless").trim() ? "wireless" : "wired" : "unknown"; + if (ifaceSanitized === "lo" || ifaceSanitized.startsWith("bond")) { + type = "virtual"; + } + let internal = ifaces[dev] && ifaces[dev][0] ? ifaces[dev][0].internal : false; + if (dev.toLowerCase().indexOf("loopback") > -1 || ifaceName.toLowerCase().indexOf("loopback") > -1) { + internal = true; + } + const virtual = internal ? false : testVirtualNic(dev, ifaceName, mac); + result2.push({ + iface: ifaceSanitized, + ifaceName, + default: iface === defaultInterface, + ip4, + ip4subnet, + ip6, + ip6subnet, + mac, + internal, + virtual, + operstate, + type, + duplex, + mtu, + speed, + dhcp, + dnsSuffix, + ieee8021xAuth, + ieee8021xState, + carrierChanges + }); + } + } + _networkInterfaces = result2; + if (defaultString.toLowerCase().indexOf("default") >= 0) { + result2 = result2.filter((item) => item.default); + if (result2.length > 0) { + result2 = result2[0]; + } else { + result2 = []; + } + } + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_windows) { + if (JSON.stringify(ifaces) === JSON.stringify(_ifaces) && !rescan) { + result2 = _networkInterfaces; + if (callback) { + callback(result2); + } + resolve(result2); + } else { + _ifaces = JSON.parse(JSON.stringify(ifaces)); + const defaultInterface = getDefaultNetworkInterface(); + getWindowsNics().then(function(nics2) { + nics2.forEach((nic) => { + let found = false; + Object.keys(ifaces).forEach((key) => { + if (!found) { + ifaces[key].forEach((value) => { + if (Object.keys(value).indexOf("mac") >= 0) { + found = value["mac"] === nic.mac; + } + }); + } + }); + if (!found) { + ifaces[nic.name] = [{ mac: nic.mac }]; + } + }); + nics8021xInfo = getWindowsWiredProfilesInformation(); + dnsSuffixes = getWindowsDNSsuffixes(); + for (let dev in ifaces) { + let ifaceSanitized = ""; + const s = util.isPrototypePolluted() ? "---" : util.sanitizeShellString(dev); + const l = util.mathMin(s.length, 2e3); + for (let i = 0; i <= l; i++) { + if (s[i] !== void 0) { + ifaceSanitized = ifaceSanitized + s[i]; + } + } + let iface = dev; + let ip4 = ""; + let ip4subnet = ""; + let ip6 = ""; + let ip6subnet = ""; + let mac = ""; + let duplex = ""; + let mtu = ""; + let speed = null; + let carrierChanges = 0; + let operstate = "down"; + let dhcp = false; + let dnsSuffix = ""; + let ieee8021xAuth = ""; + let ieee8021xState = ""; + let type = ""; + if ({}.hasOwnProperty.call(ifaces, dev)) { + let ifaceName = dev; + ifaces[dev].forEach(function(details) { + if (details.family === "IPv4" || details.family === 4) { + ip4 = details.address; + ip4subnet = details.netmask; + } + if (details.family === "IPv6" || details.family === 6) { + if (!ip6 || ip6.match(/^fe80::/i)) { + ip6 = details.address; + ip6subnet = details.netmask; + } + } + mac = details.mac; + const nodeMainVersion = parseInt(process.versions.node.split("."), 10); + if (mac.indexOf("00:00:0") > -1 && (_linux || _darwin) && !details.internal && nodeMainVersion >= 8 && nodeMainVersion <= 11) { + if (Object.keys(_mac).length === 0) { + _mac = getMacAddresses(); + } + mac = _mac[dev] || ""; + } + }); + dnsSuffix = getWindowsIfaceDNSsuffix(dnsSuffixes.ifaces, ifaceSanitized); + let foundFirst = false; + nics2.forEach((detail) => { + if (detail.mac === mac && !foundFirst) { + iface = detail.iface || iface; + ifaceName = detail.name; + dhcp = detail.dhcp; + operstate = detail.operstate; + speed = operstate === "up" ? detail.speed : 0; + type = detail.type; + foundFirst = true; + } + }); + if (dev.toLowerCase().indexOf("wlan") >= 0 || ifaceName.toLowerCase().indexOf("wlan") >= 0 || ifaceName.toLowerCase().indexOf("802.11n") >= 0 || ifaceName.toLowerCase().indexOf("wireless") >= 0 || ifaceName.toLowerCase().indexOf("wi-fi") >= 0 || ifaceName.toLowerCase().indexOf("wifi") >= 0) { + type = "wireless"; + } + const IEEE8021x = getWindowsIEEE8021x(type, ifaceSanitized, nics8021xInfo); + ieee8021xAuth = IEEE8021x.protocol; + ieee8021xState = IEEE8021x.state; + let internal = ifaces[dev] && ifaces[dev][0] ? ifaces[dev][0].internal : false; + if (dev.toLowerCase().indexOf("loopback") > -1 || ifaceName.toLowerCase().indexOf("loopback") > -1) { + internal = true; + } + const virtual = internal ? false : testVirtualNic(dev, ifaceName, mac); + result2.push({ + iface, + ifaceName, + default: iface === defaultInterface, + ip4, + ip4subnet, + ip6, + ip6subnet, + mac, + internal, + virtual, + operstate, + type, + duplex, + mtu, + speed, + dhcp, + dnsSuffix, + ieee8021xAuth, + ieee8021xState, + carrierChanges + }); + } + } + _networkInterfaces = result2; + if (defaultString.toLowerCase().indexOf("default") >= 0) { + result2 = result2.filter((item) => item.default); + if (result2.length > 0) { + result2 = result2[0]; + } else { + result2 = []; + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + } + }); + }); + } + exports.networkInterfaces = networkInterfaces; + function calcNetworkSpeed(iface, rx_bytes, tx_bytes, operstate, rx_dropped, rx_errors, tx_dropped, tx_errors) { + let result2 = { + iface, + operstate, + rx_bytes, + rx_dropped, + rx_errors, + tx_bytes, + tx_dropped, + tx_errors, + rx_sec: null, + tx_sec: null, + ms: 0 + }; + if (_network[iface] && _network[iface].ms) { + result2.ms = Date.now() - _network[iface].ms; + result2.rx_sec = rx_bytes - _network[iface].rx_bytes >= 0 ? (rx_bytes - _network[iface].rx_bytes) / (result2.ms / 1e3) : 0; + result2.tx_sec = tx_bytes - _network[iface].tx_bytes >= 0 ? (tx_bytes - _network[iface].tx_bytes) / (result2.ms / 1e3) : 0; + _network[iface].rx_bytes = rx_bytes; + _network[iface].tx_bytes = tx_bytes; + _network[iface].rx_sec = result2.rx_sec; + _network[iface].tx_sec = result2.tx_sec; + _network[iface].ms = Date.now(); + _network[iface].last_ms = result2.ms; + _network[iface].operstate = operstate; + } else { + if (!_network[iface]) { + _network[iface] = {}; + } + _network[iface].rx_bytes = rx_bytes; + _network[iface].tx_bytes = tx_bytes; + _network[iface].rx_sec = null; + _network[iface].tx_sec = null; + _network[iface].ms = Date.now(); + _network[iface].last_ms = 0; + _network[iface].operstate = operstate; + } + return result2; + } + function networkStats(ifaces, callback) { + let ifacesArray = []; + return new Promise((resolve) => { + process.nextTick(() => { + if (util.isFunction(ifaces) && !callback) { + callback = ifaces; + ifacesArray = [getDefaultNetworkInterface()]; + } else { + if (typeof ifaces !== "string" && ifaces !== void 0) { + if (callback) { + callback([]); + } + return resolve([]); + } + ifaces = ifaces || getDefaultNetworkInterface(); + try { + ifaces.__proto__.toLowerCase = util.stringToLower; + ifaces.__proto__.replace = util.stringReplace; + ifaces.__proto__.toString = util.stringToString; + ifaces.__proto__.substr = util.stringSubstr; + ifaces.__proto__.substring = util.stringSubstring; + ifaces.__proto__.trim = util.stringTrim; + ifaces.__proto__.startsWith = util.stringStartWith; + } catch (e) { + Object.setPrototypeOf(ifaces, util.stringObj); + } + ifaces = ifaces.trim().toLowerCase().replace(/,+/g, "|"); + ifacesArray = ifaces.split("|"); + } + const result2 = []; + const workload = []; + if (ifacesArray.length && ifacesArray[0].trim() === "*") { + ifacesArray = []; + networkInterfaces(false).then((allIFaces) => { + for (let iface of allIFaces) { + ifacesArray.push(iface.iface); + } + networkStats(ifacesArray.join(",")).then((result3) => { + if (callback) { + callback(result3); + } + resolve(result3); + }); + }); + } else { + for (let iface of ifacesArray) { + workload.push(networkStatsSingle(iface.trim())); + } + if (workload.length) { + Promise.all( + workload + ).then((data) => { + if (callback) { + callback(data); + } + resolve(data); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + function networkStatsSingle(iface) { + function parseLinesWindowsPerfData(sections) { + let perfData = []; + for (let i in sections) { + if ({}.hasOwnProperty.call(sections, i)) { + if (sections[i].trim() !== "") { + let lines = sections[i].trim().split("\r\n"); + perfData.push({ + name: util.getValue(lines, "Name", ":").replace(/[()[\] ]+/g, "").replace(/#|\//g, "_").toLowerCase(), + rx_bytes: parseInt(util.getValue(lines, "BytesReceivedPersec", ":"), 10), + rx_errors: parseInt(util.getValue(lines, "PacketsReceivedErrors", ":"), 10), + rx_dropped: parseInt(util.getValue(lines, "PacketsReceivedDiscarded", ":"), 10), + tx_bytes: parseInt(util.getValue(lines, "BytesSentPersec", ":"), 10), + tx_errors: parseInt(util.getValue(lines, "PacketsOutboundErrors", ":"), 10), + tx_dropped: parseInt(util.getValue(lines, "PacketsOutboundDiscarded", ":"), 10) + }); + } + } + } + return perfData; + } + return new Promise((resolve) => { + process.nextTick(() => { + let ifaceSanitized = ""; + const s = util.isPrototypePolluted() ? "---" : util.sanitizeShellString(iface); + const l = util.mathMin(s.length, 2e3); + for (let i = 0; i <= l; i++) { + if (s[i] !== void 0) { + ifaceSanitized = ifaceSanitized + s[i]; + } + } + let result2 = { + iface: ifaceSanitized, + operstate: "unknown", + rx_bytes: 0, + rx_dropped: 0, + rx_errors: 0, + tx_bytes: 0, + tx_dropped: 0, + tx_errors: 0, + rx_sec: null, + tx_sec: null, + ms: 0 + }; + let operstate = "unknown"; + let rx_bytes = 0; + let tx_bytes = 0; + let rx_dropped = 0; + let rx_errors = 0; + let tx_dropped = 0; + let tx_errors = 0; + let cmd, lines, stats; + if (!_network[ifaceSanitized] || _network[ifaceSanitized] && !_network[ifaceSanitized].ms || _network[ifaceSanitized] && _network[ifaceSanitized].ms && Date.now() - _network[ifaceSanitized].ms >= 500) { + if (_linux) { + if (fs.existsSync("/sys/class/net/" + ifaceSanitized)) { + cmd = "cat /sys/class/net/" + ifaceSanitized + "/operstate; cat /sys/class/net/" + ifaceSanitized + "/statistics/rx_bytes; cat /sys/class/net/" + ifaceSanitized + "/statistics/tx_bytes; cat /sys/class/net/" + ifaceSanitized + "/statistics/rx_dropped; cat /sys/class/net/" + ifaceSanitized + "/statistics/rx_errors; cat /sys/class/net/" + ifaceSanitized + "/statistics/tx_dropped; cat /sys/class/net/" + ifaceSanitized + "/statistics/tx_errors; "; + exec2(cmd, function(error, stdout) { + if (!error) { + lines = stdout.toString().split("\n"); + operstate = lines[0].trim(); + rx_bytes = parseInt(lines[1], 10); + tx_bytes = parseInt(lines[2], 10); + rx_dropped = parseInt(lines[3], 10); + rx_errors = parseInt(lines[4], 10); + tx_dropped = parseInt(lines[5], 10); + tx_errors = parseInt(lines[6], 10); + result2 = calcNetworkSpeed(ifaceSanitized, rx_bytes, tx_bytes, operstate, rx_dropped, rx_errors, tx_dropped, tx_errors); + } + resolve(result2); + }); + } else { + resolve(result2); + } + } + if (_freebsd || _openbsd || _netbsd) { + cmd = "netstat -ibndI " + ifaceSanitized; + exec2(cmd, function(error, stdout) { + if (!error) { + lines = stdout.toString().split("\n"); + for (let i = 1; i < lines.length; i++) { + const line = lines[i].replace(/ +/g, " ").split(" "); + if (line && line[0] && line[7] && line[10]) { + rx_bytes = rx_bytes + parseInt(line[7]); + if (line[6].trim() !== "-") { + rx_dropped = rx_dropped + parseInt(line[6]); + } + if (line[5].trim() !== "-") { + rx_errors = rx_errors + parseInt(line[5]); + } + tx_bytes = tx_bytes + parseInt(line[10]); + if (line[12].trim() !== "-") { + tx_dropped = tx_dropped + parseInt(line[12]); + } + if (line[9].trim() !== "-") { + tx_errors = tx_errors + parseInt(line[9]); + } + operstate = "up"; + } + } + result2 = calcNetworkSpeed(ifaceSanitized, rx_bytes, tx_bytes, operstate, rx_dropped, rx_errors, tx_dropped, tx_errors); + } + resolve(result2); + }); + } + if (_darwin) { + cmd = "ifconfig " + ifaceSanitized + ' | grep "status"'; + exec2(cmd, function(error, stdout) { + result2.operstate = (stdout.toString().split(":")[1] || "").trim(); + result2.operstate = (result2.operstate || "").toLowerCase(); + result2.operstate = result2.operstate === "active" ? "up" : result2.operstate === "inactive" ? "down" : "unknown"; + cmd = "netstat -bdI " + ifaceSanitized; + exec2(cmd, function(error2, stdout2) { + if (!error2) { + lines = stdout2.toString().split("\n"); + if (lines.length > 1 && lines[1].trim() !== "") { + stats = lines[1].replace(/ +/g, " ").split(" "); + const offset = stats.length > 11 ? 1 : 0; + rx_bytes = parseInt(stats[offset + 5]); + rx_dropped = parseInt(stats[offset + 10]); + rx_errors = parseInt(stats[offset + 4]); + tx_bytes = parseInt(stats[offset + 8]); + tx_dropped = parseInt(stats[offset + 10]); + tx_errors = parseInt(stats[offset + 7]); + result2 = calcNetworkSpeed(ifaceSanitized, rx_bytes, tx_bytes, result2.operstate, rx_dropped, rx_errors, tx_dropped, tx_errors); + } + } + resolve(result2); + }); + }); + } + if (_windows) { + let perfData = []; + let ifaceName = ifaceSanitized; + util.powerShell("Get-CimInstance Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl").then((stdout, error) => { + if (!error) { + const psections = stdout.toString().split(/\n\s*\n/); + perfData = parseLinesWindowsPerfData(psections); + } + networkInterfaces(false).then((interfaces) => { + rx_bytes = 0; + tx_bytes = 0; + perfData.forEach((detail) => { + interfaces.forEach((det) => { + if ((det.iface.toLowerCase() === ifaceSanitized.toLowerCase() || det.mac.toLowerCase() === ifaceSanitized.toLowerCase() || det.ip4.toLowerCase() === ifaceSanitized.toLowerCase() || det.ip6.toLowerCase() === ifaceSanitized.toLowerCase() || det.ifaceName.replace(/[()[\] ]+/g, "").replace(/#|\//g, "_").toLowerCase() === ifaceSanitized.replace(/[()[\] ]+/g, "").replace("#", "_").toLowerCase()) && det.ifaceName.replace(/[()[\] ]+/g, "").replace(/#|\//g, "_").toLowerCase() === detail.name) { + ifaceName = det.iface; + rx_bytes = detail.rx_bytes; + rx_dropped = detail.rx_dropped; + rx_errors = detail.rx_errors; + tx_bytes = detail.tx_bytes; + tx_dropped = detail.tx_dropped; + tx_errors = detail.tx_errors; + operstate = det.operstate; + } + }); + }); + if (rx_bytes && tx_bytes) { + result2 = calcNetworkSpeed(ifaceName, parseInt(rx_bytes), parseInt(tx_bytes), operstate, rx_dropped, rx_errors, tx_dropped, tx_errors); + } + resolve(result2); + }); + }); + } + } else { + result2.rx_bytes = _network[ifaceSanitized].rx_bytes; + result2.tx_bytes = _network[ifaceSanitized].tx_bytes; + result2.rx_sec = _network[ifaceSanitized].rx_sec; + result2.tx_sec = _network[ifaceSanitized].tx_sec; + result2.ms = _network[ifaceSanitized].last_ms; + result2.operstate = _network[ifaceSanitized].operstate; + resolve(result2); + } + }); + }); + } + exports.networkStats = networkStats; + function getProcessName(processes, pid) { + let cmd = ""; + processes.forEach((line) => { + const parts = line.split(" "); + const id = parseInt(parts[0], 10) || -1; + if (id === pid) { + parts.shift(); + cmd = parts.join(" ").split(":")[0]; + } + }); + cmd = cmd.split(" -")[0]; + cmd = cmd.split(" /")[0]; + return cmd; + } + function networkConnections(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = []; + if (_linux || _freebsd || _openbsd || _netbsd) { + let cmd = 'export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL'; + if (_freebsd || _openbsd || _netbsd) { + cmd = 'export LC_ALL=C; netstat -na | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL'; + } + exec2(cmd, { maxBuffer: 1024 * 2e4 }, function(error, stdout) { + let lines = stdout.toString().split("\n"); + if (!error && (lines.length > 1 || lines[0] != "")) { + lines.forEach(function(line) { + line = line.replace(/ +/g, " ").split(" "); + if (line.length >= 7) { + let localip = line[3]; + let localport = ""; + let localaddress = line[3].split(":"); + if (localaddress.length > 1) { + localport = localaddress[localaddress.length - 1]; + localaddress.pop(); + localip = localaddress.join(":"); + } + let peerip = line[4]; + let peerport = ""; + let peeraddress = line[4].split(":"); + if (peeraddress.length > 1) { + peerport = peeraddress[peeraddress.length - 1]; + peeraddress.pop(); + peerip = peeraddress.join(":"); + } + let connstate = line[5]; + let proc = line[6].split("/"); + if (connstate) { + result2.push({ + protocol: line[0], + localAddress: localip, + localPort: localport, + peerAddress: peerip, + peerPort: peerport, + state: connstate, + pid: proc[0] && proc[0] !== "-" ? parseInt(proc[0], 10) : null, + process: proc[1] ? proc[1].split(" ")[0].split(":")[0] : "" + }); + } + } + }); + if (callback) { + callback(result2); + } + resolve(result2); + } else { + cmd = 'ss -tunap | grep "ESTAB\\|SYN-SENT\\|SYN-RECV\\|FIN-WAIT1\\|FIN-WAIT2\\|TIME-WAIT\\|CLOSE\\|CLOSE-WAIT\\|LAST-ACK\\|LISTEN\\|CLOSING"'; + exec2(cmd, { maxBuffer: 1024 * 2e4 }, function(error2, stdout2) { + if (!error2) { + let lines2 = stdout2.toString().split("\n"); + lines2.forEach(function(line) { + line = line.replace(/ +/g, " ").split(" "); + if (line.length >= 6) { + let localip = line[4]; + let localport = ""; + let localaddress = line[4].split(":"); + if (localaddress.length > 1) { + localport = localaddress[localaddress.length - 1]; + localaddress.pop(); + localip = localaddress.join(":"); + } + let peerip = line[5]; + let peerport = ""; + let peeraddress = line[5].split(":"); + if (peeraddress.length > 1) { + peerport = peeraddress[peeraddress.length - 1]; + peeraddress.pop(); + peerip = peeraddress.join(":"); + } + let connstate = line[1]; + if (connstate === "ESTAB") { + connstate = "ESTABLISHED"; + } + if (connstate === "TIME-WAIT") { + connstate = "TIME_WAIT"; + } + let pid = null; + let process2 = ""; + if (line.length >= 7 && line[6].indexOf("users:") > -1) { + let proc = line[6].replace('users:(("', "").replace(/"/g, "").split(","); + if (proc.length > 2) { + process2 = proc[0].split(" ")[0].split(":")[0]; + pid = parseInt(proc[1], 10); + } + } + if (connstate) { + result2.push({ + protocol: line[0], + localAddress: localip, + localPort: localport, + peerAddress: peerip, + peerPort: peerport, + state: connstate, + pid, + process: process2 + }); + } + } + }); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + }); + } + if (_darwin) { + let cmd = 'netstat -natvln | head -n2; netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"'; + const states = "ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT_1|FIN_WAIT2|FIN_WAIT_2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN".split("|"); + exec2(cmd, { maxBuffer: 1024 * 2e4 }, function(error, stdout) { + if (!error) { + exec2("ps -axo pid,command", { maxBuffer: 1024 * 2e4 }, function(err2, stdout2) { + let processes = stdout2.toString().split("\n"); + processes = processes.map((line) => { + return line.trim().replace(/ +/g, " "); + }); + let lines = stdout.toString().split("\n"); + lines.shift(); + let pidPos = 8; + if (lines.length > 1 && lines[0].indexOf("pid") > 0) { + const header = (lines.shift() || "").replace(/ Address/g, "_Address").replace(/ +/g, " ").split(" "); + pidPos = header.indexOf("pid"); + } + lines.forEach(function(line) { + line = line.replace(/ +/g, " ").split(" "); + if (line.length >= 8) { + let localip = line[3]; + let localport = ""; + let localaddress = line[3].split("."); + if (localaddress.length > 1) { + localport = localaddress[localaddress.length - 1]; + localaddress.pop(); + localip = localaddress.join("."); + } + let peerip = line[4]; + let peerport = ""; + let peeraddress = line[4].split("."); + if (peeraddress.length > 1) { + peerport = peeraddress[peeraddress.length - 1]; + peeraddress.pop(); + peerip = peeraddress.join("."); + } + const hasState = states.indexOf(line[5]) >= 0; + let connstate = hasState ? line[5] : "UNKNOWN"; + let pid = parseInt(line[pidPos + (hasState ? 0 : -1)], 10); + if (connstate) { + result2.push({ + protocol: line[0], + localAddress: localip, + localPort: localport, + peerAddress: peerip, + peerPort: peerport, + state: connstate, + pid, + process: getProcessName(processes, pid) + }); + } + } + }); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + }); + } + if (_windows) { + let cmd = "netstat -nao"; + try { + exec2(cmd, util.execOptsWin, function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\r\n"); + lines.forEach(function(line) { + line = line.trim().replace(/ +/g, " ").split(" "); + if (line.length >= 4) { + let localip = line[1]; + let localport = ""; + let localaddress = line[1].split(":"); + if (localaddress.length > 1) { + localport = localaddress[localaddress.length - 1]; + localaddress.pop(); + localip = localaddress.join(":"); + } + localip = localip.replace(/\[/g, "").replace(/\]/g, ""); + let peerip = line[2]; + let peerport = ""; + let peeraddress = line[2].split(":"); + if (peeraddress.length > 1) { + peerport = peeraddress[peeraddress.length - 1]; + peeraddress.pop(); + peerip = peeraddress.join(":"); + } + peerip = peerip.replace(/\[/g, "").replace(/\]/g, ""); + let pid = util.toInt(line[4]); + let connstate = line[3]; + if (connstate === "HERGESTELLT") { + connstate = "ESTABLISHED"; + } + if (connstate.startsWith("ABH")) { + connstate = "LISTEN"; + } + if (connstate === "SCHLIESSEN_WARTEN") { + connstate = "CLOSE_WAIT"; + } + if (connstate === "WARTEND") { + connstate = "TIME_WAIT"; + } + if (connstate === "SYN_GESENDET") { + connstate = "SYN_SENT"; + } + if (connstate === "LISTENING") { + connstate = "LISTEN"; + } + if (connstate === "SYN_RECEIVED") { + connstate = "SYN_RECV"; + } + if (connstate === "FIN_WAIT_1") { + connstate = "FIN_WAIT1"; + } + if (connstate === "FIN_WAIT_2") { + connstate = "FIN_WAIT2"; + } + if (line[0].toLowerCase() !== "udp" && connstate) { + result2.push({ + protocol: line[0].toLowerCase(), + localAddress: localip, + localPort: localport, + peerAddress: peerip, + peerPort: peerport, + state: connstate, + pid, + process: "" + }); + } else if (line[0].toLowerCase() === "udp") { + result2.push({ + protocol: line[0].toLowerCase(), + localAddress: localip, + localPort: localport, + peerAddress: peerip, + peerPort: peerport, + state: "", + pid: parseInt(line[3], 10), + process: "" + }); + } + } + }); + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + exports.networkConnections = networkConnections; + function networkGatewayDefault(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = ""; + if (_linux || _freebsd || _openbsd || _netbsd) { + let cmd = "ip route get 1"; + try { + exec2(cmd, { maxBuffer: 1024 * 2e4 }, function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + const line = lines && lines[0] ? lines[0] : ""; + let parts = line.split(" via "); + if (parts && parts[1]) { + parts = parts[1].split(" "); + result2 = parts[0]; + } + if (callback) { + callback(result2); + } + resolve(result2); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_darwin) { + let cmd = "route -n get default"; + try { + exec2(cmd, { maxBuffer: 1024 * 2e4 }, function(error, stdout) { + if (!error) { + const lines = stdout.toString().split("\n").map((line) => line.trim()); + result2 = util.getValue(lines, "gateway"); + } + if (!result2) { + cmd = "netstat -rn | awk '/default/ {print $2}'"; + exec2(cmd, { maxBuffer: 1024 * 2e4 }, function(error2, stdout2) { + const lines = stdout2.toString().split("\n").map((line) => line.trim()); + result2 = lines.find((line) => /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(line)); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_windows) { + try { + exec2("netstat -r", util.execOptsWin, function(error, stdout) { + const lines = stdout.toString().split(os2.EOL); + lines.forEach((line) => { + line = line.replace(/\s+/g, " ").trim(); + if (line.indexOf("0.0.0.0 0.0.0.0") > -1 && !/[a-zA-Z]/.test(line)) { + const parts = line.split(" "); + if (parts.length >= 5 && parts[parts.length - 3].indexOf(".") > -1) { + result2 = parts[parts.length - 3]; + } + } + }); + if (!result2) { + util.powerShell("Get-CimInstance -ClassName Win32_IP4RouteTable | Where-Object { $_.Destination -eq '0.0.0.0' -and $_.Mask -eq '0.0.0.0' }").then((data) => { + let lines2 = data.toString().split("\r\n"); + if (lines2.length > 1 && !result2) { + result2 = util.getValue(lines2, "NextHop"); + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + exports.networkGatewayDefault = networkGatewayDefault; + } +}); + +// node_modules/systeminformation/lib/wifi.js +var require_wifi = __commonJS({ + "node_modules/systeminformation/lib/wifi.js"(exports) { + "use strict"; + var os2 = require("os"); + var exec2 = require("child_process").exec; + var execSync = require("child_process").execSync; + var util = require_util2(); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + function wifiDBFromQuality(quality) { + const qual = parseFloat(quality); + if (qual < 0) { + return 0; + } + if (qual >= 100) { + return -50; + } + return qual / 2 - 100; + } + function wifiQualityFromDB(db) { + const result2 = 2 * (parseFloat(db) + 100); + return result2 <= 100 ? result2 : 100; + } + var _wifi_frequencies = { + 1: 2412, + 2: 2417, + 3: 2422, + 4: 2427, + 5: 2432, + 6: 2437, + 7: 2442, + 8: 2447, + 9: 2452, + 10: 2457, + 11: 2462, + 12: 2467, + 13: 2472, + 14: 2484, + 32: 5160, + 34: 5170, + 36: 5180, + 38: 5190, + 40: 5200, + 42: 5210, + 44: 5220, + 46: 5230, + 48: 5240, + 50: 5250, + 52: 5260, + 54: 5270, + 56: 5280, + 58: 5290, + 60: 5300, + 62: 5310, + 64: 5320, + 68: 5340, + 96: 5480, + 100: 5500, + 102: 5510, + 104: 5520, + 106: 5530, + 108: 5540, + 110: 5550, + 112: 5560, + 114: 5570, + 116: 5580, + 118: 5590, + 120: 5600, + 122: 5610, + 124: 5620, + 126: 5630, + 128: 5640, + 132: 5660, + 134: 5670, + 136: 5680, + 138: 5690, + 140: 5700, + 142: 5710, + 144: 5720, + 149: 5745, + 151: 5755, + 153: 5765, + 155: 5775, + 157: 5785, + 159: 5795, + 161: 5805, + 165: 5825, + 169: 5845, + 173: 5865, + 183: 4915, + 184: 4920, + 185: 4925, + 187: 4935, + 188: 4940, + 189: 4945, + 192: 4960, + 196: 4980 + }; + function wifiFrequencyFromChannel(channel) { + return {}.hasOwnProperty.call(_wifi_frequencies, channel) ? _wifi_frequencies[channel] : null; + } + function wifiChannelFromFrequencs(frequency) { + let channel = 0; + for (let key in _wifi_frequencies) { + if ({}.hasOwnProperty.call(_wifi_frequencies, key)) { + if (_wifi_frequencies[key] === frequency) { + channel = util.toInt(key); + } + } + } + return channel; + } + function ifaceListLinux() { + const result2 = []; + const cmd = "iw dev 2>/dev/null"; + try { + const all = execSync(cmd, util.execOptsLinux).toString().split("\n").map((line) => line.trim()).join("\n"); + const parts = all.split("\nInterface "); + parts.shift(); + parts.forEach((ifaceDetails) => { + const lines = ifaceDetails.split("\n"); + const iface = lines[0]; + const id = util.toInt(util.getValue(lines, "ifindex", " ")); + const mac = util.getValue(lines, "addr", " "); + const channel = util.toInt(util.getValue(lines, "channel", " ")); + result2.push({ + id, + iface, + mac, + channel + }); + }); + return result2; + } catch (e) { + try { + const all = execSync("nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null", util.execOptsLinux).toString(); + const parts = all.split("\n\n"); + let i = 1; + parts.forEach((ifaceDetails) => { + const lines = ifaceDetails.split("\n"); + const iface = util.getValue(lines, "GENERAL.DEVICE"); + const type = util.getValue(lines, "GENERAL.TYPE"); + const id = i++; + const mac = util.getValue(lines, "GENERAL.HWADDR"); + const channel = ""; + if (type.toLowerCase() === "wifi") { + result2.push({ + id, + iface, + mac, + channel + }); + } + }); + return result2; + } catch (e2) { + return []; + } + } + } + function nmiDeviceLinux(iface) { + const cmd = `nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${iface} 2> /dev/null`; + try { + const lines = execSync(cmd, util.execOptsLinux).toString().split("\n"); + const ssid = util.getValue(lines, "GENERAL.CONNECTION"); + return { + iface, + type: util.getValue(lines, "GENERAL.TYPE"), + vendor: util.getValue(lines, "GENERAL.VENDOR"), + product: util.getValue(lines, "GENERAL.PRODUCT"), + mac: util.getValue(lines, "GENERAL.HWADDR").toLowerCase(), + ssid: ssid !== "--" ? ssid : null + }; + } catch (e) { + return {}; + } + } + function nmiConnectionLinux(ssid) { + const cmd = `nmcli -t --show-secrets connection show ${ssid} 2>/dev/null`; + try { + const lines = execSync(cmd, util.execOptsLinux).toString().split("\n"); + const bssid = util.getValue(lines, "802-11-wireless.seen-bssids").toLowerCase(); + return { + ssid: ssid !== "--" ? ssid : null, + uuid: util.getValue(lines, "connection.uuid"), + type: util.getValue(lines, "connection.type"), + autoconnect: util.getValue(lines, "connection.autoconnect") === "yes", + security: util.getValue(lines, "802-11-wireless-security.key-mgmt"), + bssid: bssid !== "--" ? bssid : null + }; + } catch (e) { + return {}; + } + } + function wpaConnectionLinux(iface) { + if (!iface) { + return {}; + } + const cmd = `wpa_cli -i ${iface} status 2>&1`; + try { + const lines = execSync(cmd, util.execOptsLinux).toString().split("\n"); + const freq = util.toInt(util.getValue(lines, "freq", "=")); + return { + ssid: util.getValue(lines, "ssid", "="), + uuid: util.getValue(lines, "uuid", "="), + security: util.getValue(lines, "key_mgmt", "="), + freq, + channel: wifiChannelFromFrequencs(freq), + bssid: util.getValue(lines, "bssid", "=").toLowerCase() + }; + } catch (e) { + return {}; + } + } + function getWifiNetworkListNmi() { + const result2 = []; + const cmd = "nmcli -t -m multiline --fields active,ssid,bssid,mode,chan,freq,signal,security,wpa-flags,rsn-flags device wifi list 2>/dev/null"; + try { + const stdout = execSync(cmd, util.execOptsLinux); + const parts = stdout.toString().split("ACTIVE:"); + parts.shift(); + parts.forEach((part) => { + part = "ACTIVE:" + part; + const lines = part.split(os2.EOL); + const channel = util.getValue(lines, "CHAN"); + const frequency = util.getValue(lines, "FREQ").toLowerCase().replace("mhz", "").trim(); + const security = util.getValue(lines, "SECURITY").replace("(", "").replace(")", ""); + const wpaFlags = util.getValue(lines, "WPA-FLAGS").replace("(", "").replace(")", ""); + const rsnFlags = util.getValue(lines, "RSN-FLAGS").replace("(", "").replace(")", ""); + const quality = util.getValue(lines, "SIGNAL"); + result2.push({ + ssid: util.getValue(lines, "SSID"), + bssid: util.getValue(lines, "BSSID").toLowerCase(), + mode: util.getValue(lines, "MODE"), + channel: channel ? parseInt(channel, 10) : null, + frequency: frequency ? parseInt(frequency, 10) : null, + signalLevel: wifiDBFromQuality(quality), + quality: quality ? parseInt(quality, 10) : null, + security: security && security !== "none" ? security.split(" ") : [], + wpaFlags: wpaFlags && wpaFlags !== "none" ? wpaFlags.split(" ") : [], + rsnFlags: rsnFlags && rsnFlags !== "none" ? rsnFlags.split(" ") : [] + }); + }); + return result2; + } catch (e) { + return []; + } + } + function getWifiNetworkListIw(iface) { + const result2 = []; + try { + let iwlistParts = execSync(`export LC_ALL=C; iwlist ${iface} scan 2>&1; unset LC_ALL`, util.execOptsLinux).toString().split(" Cell "); + if (iwlistParts[0].indexOf("resource busy") >= 0) { + return -1; + } + if (iwlistParts.length > 1) { + iwlistParts.shift(); + iwlistParts.forEach((element) => { + const lines = element.split("\n"); + const channel = util.getValue(lines, "channel", ":", true); + const address = lines && lines.length && lines[0].indexOf("Address:") >= 0 ? lines[0].split("Address:")[1].trim().toLowerCase() : ""; + const mode = util.getValue(lines, "mode", ":", true); + const frequency = util.getValue(lines, "frequency", ":", true); + const qualityString = util.getValue(lines, "Quality", "=", true); + const dbParts = qualityString.toLowerCase().split("signal level="); + const db = dbParts.length > 1 ? util.toInt(dbParts[1]) : 0; + const quality = db ? wifiQualityFromDB(db) : 0; + const ssid = util.getValue(lines, "essid", ":", true); + const isWpa = element.indexOf(" WPA ") >= 0; + const isWpa2 = element.indexOf("WPA2 ") >= 0; + const security = []; + if (isWpa) { + security.push("WPA"); + } + if (isWpa2) { + security.push("WPA2"); + } + const wpaFlags = []; + let wpaFlag = ""; + lines.forEach(function(line) { + const l = line.trim().toLowerCase(); + if (l.indexOf("group cipher") >= 0) { + if (wpaFlag) { + wpaFlags.push(wpaFlag); + } + const parts = l.split(":"); + if (parts.length > 1) { + wpaFlag = parts[1].trim().toUpperCase(); + } + } + if (l.indexOf("pairwise cipher") >= 0) { + const parts = l.split(":"); + if (parts.length > 1) { + if (parts[1].indexOf("tkip")) { + wpaFlag = wpaFlag ? "TKIP/" + wpaFlag : "TKIP"; + } else if (parts[1].indexOf("ccmp")) { + wpaFlag = wpaFlag ? "CCMP/" + wpaFlag : "CCMP"; + } else if (parts[1].indexOf("proprietary")) { + wpaFlag = wpaFlag ? "PROP/" + wpaFlag : "PROP"; + } + } + } + if (l.indexOf("authentication suites") >= 0) { + const parts = l.split(":"); + if (parts.length > 1) { + if (parts[1].indexOf("802.1x")) { + wpaFlag = wpaFlag ? "802.1x/" + wpaFlag : "802.1x"; + } else if (parts[1].indexOf("psk")) { + wpaFlag = wpaFlag ? "PSK/" + wpaFlag : "PSK"; + } + } + } + }); + if (wpaFlag) { + wpaFlags.push(wpaFlag); + } + result2.push({ + ssid, + bssid: address, + mode, + channel: channel ? util.toInt(channel) : null, + frequency: frequency ? util.toInt(frequency.replace(".", "")) : null, + signalLevel: db, + quality, + security, + wpaFlags, + rsnFlags: [] + }); + }); + } + return result2; + } catch (e) { + return -1; + } + } + function parseWifiDarwin(wifiStr) { + const result2 = []; + try { + let wifiObj = JSON.parse(wifiStr); + wifiObj = wifiObj.SPAirPortDataType[0].spairport_airport_interfaces[0].spairport_airport_other_local_wireless_networks; + wifiObj.forEach(function(wifiItem) { + let security = []; + const sm = wifiItem.spairport_security_mode; + if (sm === "spairport_security_mode_wep") { + security.push("WEP"); + } else if (sm === "spairport_security_mode_wpa2_personal") { + security.push("WPA2"); + } else if (sm.startsWith("spairport_security_mode_wpa2_enterprise")) { + security.push("WPA2 EAP"); + } else if (sm.startsWith("pairport_security_mode_wpa3_transition")) { + security.push("WPA2/WPA3"); + } else if (sm.startsWith("pairport_security_mode_wpa3")) { + security.push("WPA3"); + } + const channel = parseInt(("" + wifiItem.spairport_network_channel).split(" ")[0]) || 0; + const signalLevel = wifiItem.spairport_signal_noise || null; + result2.push({ + ssid: wifiItem._name || "", + bssid: wifiItem.spairport_network_bssid || null, + mode: wifiItem.spairport_network_phymode, + channel, + frequency: wifiFrequencyFromChannel(channel), + signalLevel: signalLevel ? parseInt(signalLevel, 10) : null, + quality: wifiQualityFromDB(signalLevel), + security, + wpaFlags: [], + rsnFlags: [] + }); + }); + return result2; + } catch (e) { + return result2; + } + } + function wifiNetworks(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = []; + if (_linux) { + result2 = getWifiNetworkListNmi(); + if (result2.length === 0) { + try { + const iwconfigParts = execSync("export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL", util.execOptsLinux).toString().split("\n\n"); + let iface = ""; + iwconfigParts.forEach((element) => { + if (element.indexOf("no wireless") === -1 && element.trim() !== "") { + iface = element.split(" ")[0]; + } + }); + if (iface) { + let ifaceSanitized = ""; + const s = util.isPrototypePolluted() ? "---" : util.sanitizeShellString(iface, true); + const l = util.mathMin(s.length, 2e3); + for (let i = 0; i <= l; i++) { + if (s[i] !== void 0) { + ifaceSanitized = ifaceSanitized + s[i]; + } + } + const res = getWifiNetworkListIw(ifaceSanitized); + if (res === -1) { + setTimeout(function(iface2) { + const res2 = getWifiNetworkListIw(iface2); + if (res2 != -1) { + result2 = res2; + } + if (callback) { + callback(result2); + } + resolve(result2); + }, 4e3); + } else { + result2 = res; + if (callback) { + callback(result2); + } + resolve(result2); + } + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } else if (_darwin) { + let cmd = "system_profiler SPAirPortDataType -json 2>/dev/null"; + exec2(cmd, { maxBuffer: 1024 * 4e4 }, function(error, stdout) { + result2 = parseWifiDarwin(stdout.toString()); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else if (_windows) { + let cmd = "netsh wlan show networks mode=Bssid"; + util.powerShell(cmd).then((stdout) => { + const ssidParts = stdout.toString("utf8").split(os2.EOL + os2.EOL + "SSID "); + ssidParts.shift(); + ssidParts.forEach((ssidPart) => { + const ssidLines = ssidPart.split(os2.EOL); + if (ssidLines && ssidLines.length >= 8 && ssidLines[0].indexOf(":") >= 0) { + const bssidsParts = ssidPart.split(" BSSID"); + bssidsParts.shift(); + bssidsParts.forEach((bssidPart) => { + const bssidLines = bssidPart.split(os2.EOL); + const bssidLine = bssidLines[0].split(":"); + bssidLine.shift(); + const bssid = bssidLine.join(":").trim().toLowerCase(); + const channel = bssidLines[3].split(":").pop().trim(); + const quality = bssidLines[1].split(":").pop().trim(); + result2.push({ + ssid: ssidLines[0].split(":").pop().trim(), + bssid, + mode: "", + channel: channel ? parseInt(channel, 10) : null, + frequency: wifiFrequencyFromChannel(channel), + signalLevel: wifiDBFromQuality(quality), + quality: quality ? parseInt(quality, 10) : null, + security: [ssidLines[2].split(":").pop().trim()], + wpaFlags: [ssidLines[3].split(":").pop().trim()], + rsnFlags: [] + }); + }); + } + }); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + } + exports.wifiNetworks = wifiNetworks; + function getVendor(model) { + model = model.toLowerCase(); + let result2 = ""; + if (model.indexOf("intel") >= 0) { + result2 = "Intel"; + } else if (model.indexOf("realtek") >= 0) { + result2 = "Realtek"; + } else if (model.indexOf("qualcom") >= 0) { + result2 = "Qualcom"; + } else if (model.indexOf("broadcom") >= 0) { + result2 = "Broadcom"; + } else if (model.indexOf("cavium") >= 0) { + result2 = "Cavium"; + } else if (model.indexOf("cisco") >= 0) { + result2 = "Cisco"; + } else if (model.indexOf("marvel") >= 0) { + result2 = "Marvel"; + } else if (model.indexOf("zyxel") >= 0) { + result2 = "Zyxel"; + } else if (model.indexOf("melanox") >= 0) { + result2 = "Melanox"; + } else if (model.indexOf("d-link") >= 0) { + result2 = "D-Link"; + } else if (model.indexOf("tp-link") >= 0) { + result2 = "TP-Link"; + } else if (model.indexOf("asus") >= 0) { + result2 = "Asus"; + } else if (model.indexOf("linksys") >= 0) { + result2 = "Linksys"; + } + return result2; + } + function wifiConnections(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + const result2 = []; + if (_linux) { + const ifaces = ifaceListLinux(); + const networkList = getWifiNetworkListNmi(); + ifaces.forEach((ifaceDetail) => { + let ifaceSanitized = ""; + const s = util.isPrototypePolluted() ? "---" : util.sanitizeShellString(ifaceDetail.iface, true); + const ll = util.mathMin(s.length, 2e3); + for (let i = 0; i <= ll; i++) { + if (s[i] !== void 0) { + ifaceSanitized = ifaceSanitized + s[i]; + } + } + const nmiDetails = nmiDeviceLinux(ifaceSanitized); + const wpaDetails = wpaConnectionLinux(ifaceSanitized); + const ssid = nmiDetails.ssid || wpaDetails.ssid; + const network = networkList.filter((nw) => nw.ssid === ssid); + let ssidSanitized = ""; + const t = util.isPrototypePolluted() ? "---" : util.sanitizeShellString(ssid, true); + const l = util.mathMin(t.length, 32); + for (let i = 0; i <= l; i++) { + if (t[i] !== void 0) { + ssidSanitized = ssidSanitized + t[i]; + } + } + const nmiConnection = nmiConnectionLinux(ssidSanitized); + const channel = network && network.length && network[0].channel ? network[0].channel : wpaDetails.channel ? wpaDetails.channel : null; + const bssid = network && network.length && network[0].bssid ? network[0].bssid : wpaDetails.bssid ? wpaDetails.bssid : null; + const signalLevel = network && network.length && network[0].signalLevel ? network[0].signalLevel : null; + if (ssid && bssid) { + result2.push({ + id: ifaceDetail.id, + iface: ifaceDetail.iface, + model: nmiDetails.product, + ssid, + bssid: network && network.length && network[0].bssid ? network[0].bssid : wpaDetails.bssid ? wpaDetails.bssid : null, + channel, + frequency: channel ? wifiFrequencyFromChannel(channel) : null, + type: nmiConnection.type ? nmiConnection.type : "802.11", + security: nmiConnection.security ? nmiConnection.security : wpaDetails.security ? wpaDetails.security : null, + signalLevel, + quality: wifiQualityFromDB(signalLevel), + txRate: null + }); + } + }); + if (callback) { + callback(result2); + } + resolve(result2); + } else if (_darwin) { + let cmd = 'system_profiler SPNetworkDataType SPAirPortDataType -xml 2>/dev/null; echo "######" ; ioreg -n AppleBCMWLANSkywalkInterface -r 2>/dev/null'; + exec2(cmd, function(error, stdout) { + try { + const parts = stdout.toString().split("######"); + const profilerObj = util.plistParser(parts[0]); + const networkObj = profilerObj[0]._SPCommandLineArguments.indexOf("SPNetworkDataType") >= 0 ? profilerObj[0]._items : profilerObj[1]._items; + const airportObj = profilerObj[0]._SPCommandLineArguments.indexOf("SPAirPortDataType") >= 0 ? profilerObj[0]._items[0].spairport_airport_interfaces : profilerObj[1]._items[0].spairport_airport_interfaces; + let lines3 = []; + if (parts[1].indexOf(" | {") > 0 && parts[1].indexOf(" | }") > parts[1].indexOf(" | {")) { + lines3 = parts[1].split(" | {")[1].split(" | }")[0].replace(/ \| /g, "").replace(/"/g, "").split("\n"); + } + const networkWifiObj = networkObj.find((item) => { + return item._name === "Wi-Fi"; + }); + const airportWifiObj = airportObj[0].spairport_current_network_information; + const channel = parseInt(("" + airportWifiObj.spairport_network_channel).split(" ")[0]) || 0; + const signalLevel = airportWifiObj.spairport_signal_noise || null; + let security = []; + const sm = airportWifiObj.spairport_security_mode; + if (sm === "spairport_security_mode_wep") { + security.push("WEP"); + } else if (sm === "spairport_security_mode_wpa2_personal") { + security.push("WPA2"); + } else if (sm.startsWith("spairport_security_mode_wpa2_enterprise")) { + security.push("WPA2 EAP"); + } else if (sm.startsWith("pairport_security_mode_wpa3_transition")) { + security.push("WPA2/WPA3"); + } else if (sm.startsWith("pairport_security_mode_wpa3")) { + security.push("WPA3"); + } + result2.push({ + id: networkWifiObj._name || "Wi-Fi", + iface: networkWifiObj.interface || "", + model: networkWifiObj.hardware || "", + ssid: airportWifiObj._name || "", + bssid: airportWifiObj.spairport_network_bssid || "", + channel, + frequency: channel ? wifiFrequencyFromChannel(channel) : null, + type: airportWifiObj.spairport_network_phymode || "802.11", + security, + signalLevel: signalLevel ? parseInt(signalLevel, 10) : null, + quality: wifiQualityFromDB(signalLevel), + txRate: airportWifiObj.spairport_network_rate || null + }); + } catch (e) { + util.noop(); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else if (_windows) { + let cmd = "netsh wlan show interfaces"; + util.powerShell(cmd).then(function(stdout) { + const allLines = stdout.toString().split("\r\n"); + for (let i = 0; i < allLines.length; i++) { + allLines[i] = allLines[i].trim(); + } + const parts = allLines.join("\r\n").split(":\r\n\r\n"); + parts.shift(); + parts.forEach((part) => { + const lines = part.split("\r\n"); + if (lines.length >= 5) { + const iface = lines[0].indexOf(":") >= 0 ? lines[0].split(":")[1].trim() : ""; + const model = lines[1].indexOf(":") >= 0 ? lines[1].split(":")[1].trim() : ""; + const id = lines[2].indexOf(":") >= 0 ? lines[2].split(":")[1].trim() : ""; + const ssid = util.getValue(lines, "SSID", ":", true); + const bssid = util.getValue(lines, "BSSID", ":", true) || util.getValue(lines, "AP BSSID", ":", true); + const quality = util.getValue(lines, "Signal", ":", true); + const signalLevel = wifiDBFromQuality(quality); + const type = util.getValue(lines, "Radio type", ":", true) || util.getValue(lines, "Type de radio", ":", true) || util.getValue(lines, "Funktyp", ":", true) || null; + const security = util.getValue(lines, "authentication", ":", true) || util.getValue(lines, "Authentification", ":", true) || util.getValue(lines, "Authentifizierung", ":", true) || null; + const channel = util.getValue(lines, "Channel", ":", true) || util.getValue(lines, "Canal", ":", true) || util.getValue(lines, "Kanal", ":", true) || null; + const txRate = util.getValue(lines, "Transmit rate (mbps)", ":", true) || util.getValue(lines, "Transmission (mbit/s)", ":", true) || util.getValue(lines, "Empfangsrate (MBit/s)", ":", true) || null; + if (model && id && ssid && bssid) { + result2.push({ + id, + iface, + model, + ssid, + bssid, + channel: util.toInt(channel), + frequency: channel ? wifiFrequencyFromChannel(channel) : null, + type, + security, + signalLevel, + quality: quality ? parseInt(quality, 10) : null, + txRate: util.toInt(txRate) || null + }); + } + } + }); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + } + exports.wifiConnections = wifiConnections; + function wifiInterfaces(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + const result2 = []; + if (_linux) { + const ifaces = ifaceListLinux(); + ifaces.forEach((ifaceDetail) => { + const nmiDetails = nmiDeviceLinux(ifaceDetail.iface); + result2.push({ + id: ifaceDetail.id, + iface: ifaceDetail.iface, + model: nmiDetails.product ? nmiDetails.product : null, + vendor: nmiDetails.vendor ? nmiDetails.vendor : null, + mac: ifaceDetail.mac + }); + }); + if (callback) { + callback(result2); + } + resolve(result2); + } else if (_darwin) { + let cmd = "system_profiler SPNetworkDataType"; + exec2(cmd, function(error, stdout) { + const parts1 = stdout.toString().split("\n\n Wi-Fi:\n\n"); + if (parts1.length > 1) { + const lines = parts1[1].split("\n\n")[0].split("\n"); + const iface = util.getValue(lines, "BSD Device Name", ":", true); + const mac = util.getValue(lines, "MAC Address", ":", true); + const model = util.getValue(lines, "hardware", ":", true); + result2.push({ + id: "Wi-Fi", + iface, + model, + vendor: "", + mac + }); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else if (_windows) { + let cmd = "netsh wlan show interfaces"; + util.powerShell(cmd).then(function(stdout) { + const allLines = stdout.toString().split("\r\n"); + for (let i = 0; i < allLines.length; i++) { + allLines[i] = allLines[i].trim(); + } + const parts = allLines.join("\r\n").split(":\r\n\r\n"); + parts.shift(); + parts.forEach((part) => { + const lines = part.split("\r\n"); + if (lines.length >= 5) { + const iface = lines[0].indexOf(":") >= 0 ? lines[0].split(":")[1].trim() : ""; + const model = lines[1].indexOf(":") >= 0 ? lines[1].split(":")[1].trim() : ""; + const id = lines[2].indexOf(":") >= 0 ? lines[2].split(":")[1].trim() : ""; + const macParts = lines[3].indexOf(":") >= 0 ? lines[3].split(":") : []; + macParts.shift(); + const mac = macParts.join(":").trim(); + const vendor = getVendor(model); + if (iface && model && id && mac) { + result2.push({ + id, + iface, + model, + vendor, + mac + }); + } + } + }); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + } + exports.wifiInterfaces = wifiInterfaces; + } +}); + +// node_modules/systeminformation/lib/processes.js +var require_processes = __commonJS({ + "node_modules/systeminformation/lib/processes.js"(exports) { + "use strict"; + var os2 = require("os"); + var fs = require("fs"); + var path = require("path"); + var exec2 = require("child_process").exec; + var execSync = require("child_process").execSync; + var util = require_util2(); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + var _processes_cpu = { + all: 0, + all_utime: 0, + all_stime: 0, + list: {}, + ms: 0, + result: {} + }; + var _services_cpu = { + all: 0, + all_utime: 0, + all_stime: 0, + list: {}, + ms: 0, + result: {} + }; + var _process_cpu = { + all: 0, + all_utime: 0, + all_stime: 0, + list: {}, + ms: 0, + result: {} + }; + var _winStatusValues = { + "0": "unknown", + "1": "other", + "2": "ready", + "3": "running", + "4": "blocked", + "5": "suspended blocked", + "6": "suspended ready", + "7": "terminated", + "8": "stopped", + "9": "growing" + }; + function parseTimeUnix(time) { + let result2 = time; + let parts = time.replace(/ +/g, " ").split(" "); + if (parts.length === 5) { + result2 = parts[4] + "-" + ("0" + ("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(parts[1].toUpperCase()) / 3 + 1)).slice(-2) + "-" + ("0" + parts[2]).slice(-2) + " " + parts[3]; + } + return result2; + } + function parseElapsedTime(etime) { + let current = new Date(); + current = new Date(current.getTime() - current.getTimezoneOffset() * 6e4); + const elapsed = etime.split("-"); + const timeIndex = elapsed.length - 1; + const days = timeIndex > 0 ? parseInt(elapsed[timeIndex - 1]) : 0; + const timeStr = elapsed[timeIndex].split(":"); + const hours = timeStr.length === 3 ? parseInt(timeStr[0] || 0) : 0; + const mins = parseInt(timeStr[timeStr.length === 3 ? 1 : 0] || 0); + const secs = parseInt(timeStr[timeStr.length === 3 ? 2 : 1] || 0); + const ms = (((days * 24 + hours) * 60 + mins) * 60 + secs) * 1e3; + let res = new Date(current.getTime()); + let result2 = res.toISOString().substring(0, 10) + " " + res.toISOString().substring(11, 19); + try { + res = new Date(current.getTime() - ms); + result2 = res.toISOString().substring(0, 10) + " " + res.toISOString().substring(11, 19); + } catch (e) { + util.noop(); + } + return result2; + } + function services(srv, callback) { + if (util.isFunction(srv) && !callback) { + callback = srv; + srv = ""; + } + return new Promise((resolve) => { + process.nextTick(() => { + if (typeof srv !== "string") { + if (callback) { + callback([]); + } + return resolve([]); + } + if (srv) { + let srvString = ""; + try { + srvString.__proto__.toLowerCase = util.stringToLower; + srvString.__proto__.replace = util.stringReplace; + srvString.__proto__.toString = util.stringToString; + srvString.__proto__.substr = util.stringSubstr; + srvString.__proto__.substring = util.stringSubstring; + srvString.__proto__.trim = util.stringTrim; + srvString.__proto__.startsWith = util.stringStartWith; + } catch (e) { + Object.setPrototypeOf(srvString, util.stringObj); + } + const s = util.sanitizeShellString(srv); + const l = util.mathMin(s.length, 2e3); + for (let i = 0; i <= l; i++) { + if (s[i] !== void 0) { + srvString = srvString + s[i]; + } + } + srvString = srvString.trim().toLowerCase().replace(/, /g, "|").replace(/,+/g, "|"); + if (srvString === "") { + srvString = "*"; + } + if (util.isPrototypePolluted() && srvString !== "*") { + srvString = "------"; + } + let srvs = srvString.split("|"); + let result2 = []; + let dataSrv = []; + if (_linux || _freebsd || _openbsd || _netbsd || _darwin) { + if ((_linux || _freebsd || _openbsd || _netbsd) && srvString === "*") { + try { + const tmpsrv = execSync("systemctl --all --type=service --no-legend 2> /dev/null", util.execOptsLinux).toString().split("\n"); + srvs = []; + for (const s2 of tmpsrv) { + const name = s2.split(".service")[0]; + if (name && s2.indexOf(" not-found ") === -1) { + srvs.push(name.trim()); + } + } + srvString = srvs.join("|"); + } catch (d) { + try { + srvString = ""; + const tmpsrv = execSync("service --status-all 2> /dev/null", util.execOptsLinux).toString().split("\n"); + for (const s2 of tmpsrv) { + const parts = s2.split("]"); + if (parts.length === 2) { + srvString += (srvString !== "" ? "|" : "") + parts[1].trim(); + } + } + srvs = srvString.split("|"); + } catch (e) { + try { + const srvStr = execSync("ls /etc/init.d/ -m 2> /dev/null", util.execOptsLinux).toString().split("\n").join(""); + srvString = ""; + if (srvStr) { + const tmpsrv = srvStr.split(","); + for (const s2 of tmpsrv) { + const name = s2.trim(); + if (name) { + srvString += (srvString !== "" ? "|" : "") + name; + } + } + srvs = srvString.split("|"); + } + } catch (f) { + srvString = ""; + srvs = []; + } + } + } + } + if (_darwin && srvString === "*") { + if (callback) { + callback(result2); + } + resolve(result2); + } + let args = _darwin ? ["-caxo", "pcpu,pmem,pid,command"] : ["-axo", "pcpu,pmem,pid,command"]; + if (srvString !== "" && srvs.length > 0) { + util.execSafe("ps", args).then((stdout) => { + if (stdout) { + let lines = stdout.replace(/ +/g, " ").replace(/,+/g, ".").split("\n"); + srvs.forEach(function(srv2) { + let ps; + if (_darwin) { + ps = lines.filter(function(e) { + return e.toLowerCase().indexOf(srv2) !== -1; + }); + } else { + ps = lines.filter(function(e) { + return e.toLowerCase().indexOf(" " + srv2.toLowerCase() + ":") !== -1 || e.toLowerCase().indexOf("/" + srv2.toLowerCase()) !== -1; + }); + } + const pids = []; + for (const p of ps) { + const pid = p.trim().split(" ")[2]; + if (pid) { + pids.push(parseInt(pid, 10)); + } + } + result2.push({ + name: srv2, + running: ps.length > 0, + startmode: "", + pids, + cpu: parseFloat(ps.reduce(function(pv, cv) { + return pv + parseFloat(cv.trim().split(" ")[0]); + }, 0).toFixed(2)), + mem: parseFloat(ps.reduce(function(pv, cv) { + return pv + parseFloat(cv.trim().split(" ")[1]); + }, 0).toFixed(2)) + }); + }); + if (_linux) { + let cmd = 'cat /proc/stat | grep "cpu "'; + for (let i in result2) { + for (let j in result2[i].pids) { + cmd += ";cat /proc/" + result2[i].pids[j] + "/stat"; + } + } + exec2(cmd, { maxBuffer: 1024 * 2e4 }, function(error, stdout2) { + let curr_processes = stdout2.toString().split("\n"); + let all = parseProcStat(curr_processes.shift()); + let list_new = {}; + let resultProcess = {}; + curr_processes.forEach((element) => { + resultProcess = calcProcStatLinux(element, all, _services_cpu); + if (resultProcess.pid) { + let listPos = -1; + for (let i in result2) { + for (let j in result2[i].pids) { + if (parseInt(result2[i].pids[j]) === parseInt(resultProcess.pid)) { + listPos = i; + } + } + } + if (listPos >= 0) { + result2[listPos].cpu += resultProcess.cpuu + resultProcess.cpus; + } + list_new[resultProcess.pid] = { + cpuu: resultProcess.cpuu, + cpus: resultProcess.cpus, + utime: resultProcess.utime, + stime: resultProcess.stime, + cutime: resultProcess.cutime, + cstime: resultProcess.cstime + }; + } + }); + _services_cpu.all = all; + _services_cpu.list = Object.assign({}, list_new); + _services_cpu.ms = Date.now() - _services_cpu.ms; + _services_cpu.result = Object.assign({}, result2); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } else { + args = ["-o", "comm"]; + util.execSafe("ps", args).then((stdout2) => { + if (stdout2) { + let lines = stdout2.replace(/ +/g, " ").replace(/,+/g, ".").split("\n"); + srvs.forEach(function(srv2) { + let ps = lines.filter(function(e) { + return e.indexOf(srv2) !== -1; + }); + result2.push({ + name: srv2, + running: ps.length > 0, + startmode: "", + cpu: 0, + mem: 0 + }); + }); + if (callback) { + callback(result2); + } + resolve(result2); + } else { + srvs.forEach(function(srv2) { + result2.push({ + name: srv2, + running: false, + startmode: "", + cpu: 0, + mem: 0 + }); + }); + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_windows) { + try { + let wincommand = "Get-CimInstance Win32_Service"; + if (srvs[0] !== "*") { + wincommand += ' -Filter "'; + srvs.forEach((srv2) => { + wincommand += `Name='${srv2}' or `; + }); + wincommand = `${wincommand.slice(0, -4)}"`; + } + wincommand += " | select Name,Caption,Started,StartMode,ProcessId | fl"; + util.powerShell(wincommand).then((stdout, error) => { + if (!error) { + let serviceSections = stdout.split(/\n\s*\n/); + serviceSections.forEach((element) => { + if (element.trim() !== "") { + let lines = element.trim().split("\r\n"); + let srvName = util.getValue(lines, "Name", ":", true).toLowerCase(); + let srvCaption = util.getValue(lines, "Caption", ":", true).toLowerCase(); + let started = util.getValue(lines, "Started", ":", true); + let startMode = util.getValue(lines, "StartMode", ":", true); + let pid = util.getValue(lines, "ProcessId", ":", true); + if (srvString === "*" || srvs.indexOf(srvName) >= 0 || srvs.indexOf(srvCaption) >= 0) { + result2.push({ + name: srvName, + running: started.toLowerCase() === "true", + startmode: startMode, + pids: [pid], + cpu: 0, + mem: 0 + }); + dataSrv.push(srvName); + dataSrv.push(srvCaption); + } + } + }); + if (srvString !== "*") { + let srvsMissing = srvs.filter(function(e) { + return dataSrv.indexOf(e) === -1; + }); + srvsMissing.forEach(function(srvName) { + result2.push({ + name: srvName, + running: false, + startmode: "", + pids: [], + cpu: 0, + mem: 0 + }); + }); + } + if (callback) { + callback(result2); + } + resolve(result2); + } else { + srvs.forEach(function(srvName) { + result2.push({ + name: srvName, + running: false, + startmode: "", + cpu: 0, + mem: 0 + }); + }); + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + } else { + if (callback) { + callback([]); + } + resolve([]); + } + }); + }); + } + exports.services = services; + function parseProcStat(line) { + let parts = line.replace(/ +/g, " ").split(" "); + let user = parts.length >= 2 ? parseInt(parts[1]) : 0; + let nice = parts.length >= 3 ? parseInt(parts[2]) : 0; + let system = parts.length >= 4 ? parseInt(parts[3]) : 0; + let idle = parts.length >= 5 ? parseInt(parts[4]) : 0; + let iowait = parts.length >= 6 ? parseInt(parts[5]) : 0; + let irq = parts.length >= 7 ? parseInt(parts[6]) : 0; + let softirq = parts.length >= 8 ? parseInt(parts[7]) : 0; + let steal = parts.length >= 9 ? parseInt(parts[8]) : 0; + let guest = parts.length >= 10 ? parseInt(parts[9]) : 0; + let guest_nice = parts.length >= 11 ? parseInt(parts[10]) : 0; + return user + nice + system + idle + iowait + irq + softirq + steal + guest + guest_nice; + } + function calcProcStatLinux(line, all, _cpu_old) { + let statparts = line.replace(/ +/g, " ").split(")"); + if (statparts.length >= 2) { + let parts = statparts[1].split(" "); + if (parts.length >= 16) { + let pid = parseInt(statparts[0].split(" ")[0]); + let utime = parseInt(parts[12]); + let stime = parseInt(parts[13]); + let cutime = parseInt(parts[14]); + let cstime = parseInt(parts[15]); + let cpuu = 0; + let cpus = 0; + if (_cpu_old.all > 0 && _cpu_old.list[pid]) { + cpuu = (utime + cutime - _cpu_old.list[pid].utime - _cpu_old.list[pid].cutime) / (all - _cpu_old.all) * 100; + cpus = (stime + cstime - _cpu_old.list[pid].stime - _cpu_old.list[pid].cstime) / (all - _cpu_old.all) * 100; + } else { + cpuu = (utime + cutime) / all * 100; + cpus = (stime + cstime) / all * 100; + } + return { + pid, + utime, + stime, + cutime, + cstime, + cpuu, + cpus + }; + } else { + return { + pid: 0, + utime: 0, + stime: 0, + cutime: 0, + cstime: 0, + cpuu: 0, + cpus: 0 + }; + } + } else { + return { + pid: 0, + utime: 0, + stime: 0, + cutime: 0, + cstime: 0, + cpuu: 0, + cpus: 0 + }; + } + } + function calcProcStatWin(procStat, all, _cpu_old) { + let cpuu = 0; + let cpus = 0; + if (_cpu_old.all > 0 && _cpu_old.list[procStat.pid]) { + cpuu = (procStat.utime - _cpu_old.list[procStat.pid].utime) / (all - _cpu_old.all) * 100; + cpus = (procStat.stime - _cpu_old.list[procStat.pid].stime) / (all - _cpu_old.all) * 100; + } else { + cpuu = procStat.utime / all * 100; + cpus = procStat.stime / all * 100; + } + return { + pid: procStat.pid, + utime: procStat.utime, + stime: procStat.stime, + cpuu: cpuu > 0 ? cpuu : 0, + cpus: cpus > 0 ? cpus : 0 + }; + } + function processes(callback) { + let parsedhead = []; + function getName(command) { + command = command || ""; + let result2 = command.split(" ")[0]; + if (result2.substr(-1) === ":") { + result2 = result2.substr(0, result2.length - 1); + } + if (result2.substr(0, 1) !== "[") { + let parts = result2.split("/"); + if (isNaN(parseInt(parts[parts.length - 1]))) { + result2 = parts[parts.length - 1]; + } else { + result2 = parts[0]; + } + } + return result2; + } + function parseLine(line) { + let offset = 0; + let offset2 = 0; + function checkColumn(i) { + offset = offset2; + if (parsedhead[i]) { + offset2 = line.substring(parsedhead[i].to + offset, 1e4).indexOf(" "); + } else { + offset2 = 1e4; + } + } + checkColumn(0); + const pid = parseInt(line.substring(parsedhead[0].from + offset, parsedhead[0].to + offset2)); + checkColumn(1); + const ppid = parseInt(line.substring(parsedhead[1].from + offset, parsedhead[1].to + offset2)); + checkColumn(2); + const cpu = parseFloat(line.substring(parsedhead[2].from + offset, parsedhead[2].to + offset2).replace(/,/g, ".")); + checkColumn(3); + const mem = parseFloat(line.substring(parsedhead[3].from + offset, parsedhead[3].to + offset2).replace(/,/g, ".")); + checkColumn(4); + const priority = parseInt(line.substring(parsedhead[4].from + offset, parsedhead[4].to + offset2)); + checkColumn(5); + const vsz = parseInt(line.substring(parsedhead[5].from + offset, parsedhead[5].to + offset2)); + checkColumn(6); + const rss = parseInt(line.substring(parsedhead[6].from + offset, parsedhead[6].to + offset2)); + checkColumn(7); + const nice = parseInt(line.substring(parsedhead[7].from + offset, parsedhead[7].to + offset2)) || 0; + checkColumn(8); + const started = !_sunos ? parseElapsedTime(line.substring(parsedhead[8].from + offset, parsedhead[8].to + offset2).trim()) : parseTimeUnix(line.substring(parsedhead[8].from + offset, parsedhead[8].to + offset2).trim()); + checkColumn(9); + let state = line.substring(parsedhead[9].from + offset, parsedhead[9].to + offset2).trim(); + state = state[0] === "R" ? "running" : state[0] === "S" ? "sleeping" : state[0] === "T" ? "stopped" : state[0] === "W" ? "paging" : state[0] === "X" ? "dead" : state[0] === "Z" ? "zombie" : state[0] === "D" || state[0] === "U" ? "blocked" : "unknown"; + checkColumn(10); + let tty = line.substring(parsedhead[10].from + offset, parsedhead[10].to + offset2).trim(); + if (tty === "?" || tty === "??") { + tty = ""; + } + checkColumn(11); + const user = line.substring(parsedhead[11].from + offset, parsedhead[11].to + offset2).trim(); + checkColumn(12); + let cmdPath = ""; + let command = ""; + let params = ""; + let fullcommand = line.substring(parsedhead[12].from + offset, parsedhead[12].to + offset2).trim(); + if (fullcommand.substr(fullcommand.length - 1) === "]") { + fullcommand = fullcommand.slice(0, -1); + } + if (fullcommand.substr(0, 1) === "[") { + command = fullcommand.substring(1); + } else { + const p1 = fullcommand.indexOf("("); + const p2 = fullcommand.indexOf(")"); + const p3 = fullcommand.indexOf("/"); + const p4 = fullcommand.indexOf(":"); + if (p1 < p2 && p1 < p3 && p3 < p2) { + command = fullcommand.split(" ")[0]; + command = command.replace(/:/g, ""); + } else { + if (p4 > 0 && (p3 === -1 || p3 > 3)) { + command = fullcommand.split(" ")[0]; + command = command.replace(/:/g, ""); + } else { + let firstParamPos = fullcommand.indexOf(" -"); + let firstParamPathPos = fullcommand.indexOf(" /"); + firstParamPos = firstParamPos >= 0 ? firstParamPos : 1e4; + firstParamPathPos = firstParamPathPos >= 0 ? firstParamPathPos : 1e4; + const firstPos = Math.min(firstParamPos, firstParamPathPos); + let tmpCommand = fullcommand.substr(0, firstPos); + const tmpParams = fullcommand.substr(firstPos); + const lastSlashPos = tmpCommand.lastIndexOf("/"); + if (lastSlashPos >= 0) { + cmdPath = tmpCommand.substr(0, lastSlashPos); + tmpCommand = tmpCommand.substr(lastSlashPos + 1); + } + if (firstPos === 1e4 && tmpCommand.indexOf(" ") > -1) { + const parts = tmpCommand.split(" "); + if (fs.existsSync(path.join(cmdPath, parts[0]))) { + command = parts.shift(); + params = (parts.join(" ") + " " + tmpParams).trim(); + } else { + command = tmpCommand.trim(); + params = tmpParams.trim(); + } + } else { + command = tmpCommand.trim(); + params = tmpParams.trim(); + } + } + } + } + return { + pid, + parentPid: ppid, + name: _linux ? getName(command) : command, + cpu, + cpuu: 0, + cpus: 0, + mem, + priority, + memVsz: vsz, + memRss: rss, + nice, + started, + state, + tty, + user, + command, + params, + path: cmdPath + }; + } + function parseProcesses(lines) { + let result2 = []; + if (lines.length > 1) { + let head = lines[0]; + parsedhead = util.parseHead(head, 8); + lines.shift(); + lines.forEach(function(line) { + if (line.trim() !== "") { + result2.push(parseLine(line)); + } + }); + } + return result2; + } + function parseProcesses2(lines) { + function formatDateTime(time) { + const month = ("0" + (time.getMonth() + 1).toString()).slice(-2); + const year = time.getFullYear().toString(); + const day = ("0" + time.getDate().toString()).slice(-2); + const hours = ("0" + time.getHours().toString()).slice(-2); + const mins = ("0" + time.getMinutes().toString()).slice(-2); + const secs = ("0" + time.getSeconds().toString()).slice(-2); + return year + "-" + month + "-" + day + " " + hours + ":" + mins + ":" + secs; + } + function parseElapsed(etime) { + let started = ""; + if (etime.indexOf("d") >= 0) { + const elapsed_parts = etime.split("d"); + started = formatDateTime(new Date(Date.now() - (elapsed_parts[0] * 24 + elapsed_parts[1] * 1) * 60 * 60 * 1e3)); + } else if (etime.indexOf("h") >= 0) { + const elapsed_parts = etime.split("h"); + started = formatDateTime(new Date(Date.now() - (elapsed_parts[0] * 60 + elapsed_parts[1] * 1) * 60 * 1e3)); + } else if (etime.indexOf(":") >= 0) { + const elapsed_parts = etime.split(":"); + started = formatDateTime(new Date(Date.now() - (elapsed_parts.length > 1 ? (elapsed_parts[0] * 60 + elapsed_parts[1]) * 1e3 : elapsed_parts[0] * 1e3))); + } + return started; + } + let result2 = []; + lines.forEach(function(line) { + if (line.trim() !== "") { + line = line.trim().replace(/ +/g, " ").replace(/,+/g, "."); + const parts = line.split(" "); + const command = parts.slice(9).join(" "); + const pmem = parseFloat((1 * parseInt(parts[3]) * 1024 / os2.totalmem()).toFixed(1)); + const started = parseElapsed(parts[5]); + result2.push({ + pid: parseInt(parts[0]), + parentPid: parseInt(parts[1]), + name: getName(command), + cpu: 0, + cpuu: 0, + cpus: 0, + mem: pmem, + priority: 0, + memVsz: parseInt(parts[2]), + memRss: parseInt(parts[3]), + nice: parseInt(parts[4]), + started, + state: parts[6] === "R" ? "running" : parts[6] === "S" ? "sleeping" : parts[6] === "T" ? "stopped" : parts[6] === "W" ? "paging" : parts[6] === "X" ? "dead" : parts[6] === "Z" ? "zombie" : parts[6] === "D" || parts[6] === "U" ? "blocked" : "unknown", + tty: parts[7], + user: parts[8], + command + }); + } + }); + return result2; + } + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + all: 0, + running: 0, + blocked: 0, + sleeping: 0, + unknown: 0, + list: [] + }; + let cmd = ""; + if (_processes_cpu.ms && Date.now() - _processes_cpu.ms >= 500 || _processes_cpu.ms === 0) { + if (_linux || _freebsd || _openbsd || _netbsd || _darwin || _sunos) { + if (_linux) { + cmd = "export LC_ALL=C; ps -axo pid:11,ppid:11,pcpu:6,pmem:6,pri:5,vsz:11,rss:11,ni:5,etime:30,state:5,tty:15,user:20,command; unset LC_ALL"; + } + if (_freebsd || _openbsd || _netbsd) { + cmd = "export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,ni,etime,state,tty,user,command; unset LC_ALL"; + } + if (_darwin) { + cmd = "ps -axo pid,ppid,pcpu,pmem,pri,vsz=temp_title_1,rss=temp_title_2,nice,etime=temp_title_3,state,tty,user,command -r"; + } + if (_sunos) { + cmd = "ps -Ao pid,ppid,pcpu,pmem,pri,vsz,rss,nice,stime,s,tty,user,comm"; + } + exec2(cmd, { maxBuffer: 1024 * 2e4 }, function(error, stdout) { + if (!error && stdout.toString().trim()) { + result2.list = parseProcesses(stdout.toString().split("\n")).slice(); + result2.all = result2.list.length; + result2.running = result2.list.filter(function(e) { + return e.state === "running"; + }).length; + result2.blocked = result2.list.filter(function(e) { + return e.state === "blocked"; + }).length; + result2.sleeping = result2.list.filter(function(e) { + return e.state === "sleeping"; + }).length; + if (_linux) { + cmd = 'cat /proc/stat | grep "cpu "'; + result2.list.forEach((element) => { + cmd += ";cat /proc/" + element.pid + "/stat"; + }); + exec2(cmd, { maxBuffer: 1024 * 2e4 }, function(error2, stdout2) { + let curr_processes = stdout2.toString().split("\n"); + let all = parseProcStat(curr_processes.shift()); + let list_new = {}; + let resultProcess = {}; + curr_processes.forEach((element) => { + resultProcess = calcProcStatLinux(element, all, _processes_cpu); + if (resultProcess.pid) { + let listPos = result2.list.map(function(e) { + return e.pid; + }).indexOf(resultProcess.pid); + if (listPos >= 0) { + result2.list[listPos].cpu = resultProcess.cpuu + resultProcess.cpus; + result2.list[listPos].cpuu = resultProcess.cpuu; + result2.list[listPos].cpus = resultProcess.cpus; + } + list_new[resultProcess.pid] = { + cpuu: resultProcess.cpuu, + cpus: resultProcess.cpus, + utime: resultProcess.utime, + stime: resultProcess.stime, + cutime: resultProcess.cutime, + cstime: resultProcess.cstime + }; + } + }); + _processes_cpu.all = all; + _processes_cpu.list = Object.assign({}, list_new); + _processes_cpu.ms = Date.now() - _processes_cpu.ms; + _processes_cpu.result = Object.assign({}, result2); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } else { + cmd = "ps -o pid,ppid,vsz,rss,nice,etime,stat,tty,user,comm"; + if (_sunos) { + cmd = "ps -o pid,ppid,vsz,rss,nice,etime,s,tty,user,comm"; + } + exec2(cmd, { maxBuffer: 1024 * 2e4 }, function(error2, stdout2) { + if (!error2) { + let lines = stdout2.toString().split("\n"); + lines.shift(); + result2.list = parseProcesses2(lines).slice(); + result2.all = result2.list.length; + result2.running = result2.list.filter(function(e) { + return e.state === "running"; + }).length; + result2.blocked = result2.list.filter(function(e) { + return e.state === "blocked"; + }).length; + result2.sleeping = result2.list.filter(function(e) { + return e.state === "sleeping"; + }).length; + if (callback) { + callback(result2); + } + resolve(result2); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } + }); + } else if (_windows) { + try { + util.powerShell('Get-CimInstance Win32_Process | select-Object ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage, @{n="CreationDate";e={$_.CreationDate.ToString("yyyy-MM-dd HH:mm:ss")}} | fl').then((stdout, error) => { + if (!error) { + let processSections = stdout.split(/\n\s*\n/); + let procs = []; + let procStats = []; + let list_new = {}; + let allcpuu = 0; + let allcpus = 0; + processSections.forEach((element) => { + if (element.trim() !== "") { + let lines = element.trim().split("\r\n"); + let pid = parseInt(util.getValue(lines, "ProcessId", ":", true), 10); + let parentPid = parseInt(util.getValue(lines, "ParentProcessId", ":", true), 10); + let statusValue = util.getValue(lines, "ExecutionState", ":"); + let name = util.getValue(lines, "Caption", ":", true); + let commandLine = util.getValue(lines, "CommandLine", ":", true); + let additionalCommand = false; + lines.forEach((line) => { + if (additionalCommand && line.toLowerCase().startsWith(" ")) { + commandLine += " " + line.trim(); + } else { + additionalCommand = false; + } + if (line.toLowerCase().startsWith("commandline")) { + additionalCommand = true; + } + }); + let commandPath = util.getValue(lines, "ExecutablePath", ":", true); + let utime = parseInt(util.getValue(lines, "UserModeTime", ":", true), 10); + let stime = parseInt(util.getValue(lines, "KernelModeTime", ":", true), 10); + let memw = parseInt(util.getValue(lines, "WorkingSetSize", ":", true), 10); + allcpuu = allcpuu + utime; + allcpus = allcpus + stime; + result2.all++; + if (!statusValue) { + result2.unknown++; + } + if (statusValue === "3") { + result2.running++; + } + if (statusValue === "4" || statusValue === "5") { + result2.blocked++; + } + procStats.push({ + pid, + utime, + stime, + cpu: 0, + cpuu: 0, + cpus: 0 + }); + procs.push({ + pid, + parentPid, + name, + cpu: 0, + cpuu: 0, + cpus: 0, + mem: memw / os2.totalmem() * 100, + priority: parseInt(util.getValue(lines, "Priority", ":", true), 10), + memVsz: parseInt(util.getValue(lines, "PageFileUsage", ":", true), 10), + memRss: Math.floor(parseInt(util.getValue(lines, "WorkingSetSize", ":", true), 10) / 1024), + nice: 0, + started: util.getValue(lines, "CreationDate", ":", true), + state: !statusValue ? _winStatusValues[0] : _winStatusValues[statusValue], + tty: "", + user: "", + command: commandLine || name, + path: commandPath, + params: "" + }); + } + }); + result2.sleeping = result2.all - result2.running - result2.blocked - result2.unknown; + result2.list = procs; + procStats.forEach((element) => { + let resultProcess = calcProcStatWin(element, allcpuu + allcpus, _processes_cpu); + let listPos = result2.list.map(function(e) { + return e.pid; + }).indexOf(resultProcess.pid); + if (listPos >= 0) { + result2.list[listPos].cpu = resultProcess.cpuu + resultProcess.cpus; + result2.list[listPos].cpuu = resultProcess.cpuu; + result2.list[listPos].cpus = resultProcess.cpus; + } + list_new[resultProcess.pid] = { + cpuu: resultProcess.cpuu, + cpus: resultProcess.cpus, + utime: resultProcess.utime, + stime: resultProcess.stime + }; + }); + _processes_cpu.all = allcpuu + allcpus; + _processes_cpu.all_utime = allcpuu; + _processes_cpu.all_stime = allcpus; + _processes_cpu.list = Object.assign({}, list_new); + _processes_cpu.ms = Date.now() - _processes_cpu.ms; + _processes_cpu.result = Object.assign({}, result2); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } else { + if (callback) { + callback(_processes_cpu.result); + } + resolve(_processes_cpu.result); + } + }); + }); + } + exports.processes = processes; + function processLoad(proc, callback) { + if (util.isFunction(proc) && !callback) { + callback = proc; + proc = ""; + } + return new Promise((resolve) => { + process.nextTick(() => { + proc = proc || ""; + if (typeof proc !== "string") { + if (callback) { + callback([]); + } + return resolve([]); + } + let processesString = ""; + try { + processesString.__proto__.toLowerCase = util.stringToLower; + processesString.__proto__.replace = util.stringReplace; + processesString.__proto__.toString = util.stringToString; + processesString.__proto__.substr = util.stringSubstr; + processesString.__proto__.substring = util.stringSubstring; + processesString.__proto__.trim = util.stringTrim; + processesString.__proto__.startsWith = util.stringStartWith; + } catch (e) { + Object.setPrototypeOf(processesString, util.stringObj); + } + const s = util.sanitizeShellString(proc); + const l = util.mathMin(s.length, 2e3); + for (let i = 0; i <= l; i++) { + if (s[i] !== void 0) { + processesString = processesString + s[i]; + } + } + processesString = processesString.trim().toLowerCase().replace(/, /g, "|").replace(/,+/g, "|"); + if (processesString === "") { + processesString = "*"; + } + if (util.isPrototypePolluted() && processesString !== "*") { + processesString = "------"; + } + let processes2 = processesString.split("|"); + let result2 = []; + const procSanitized = util.isPrototypePolluted() ? "" : util.sanitizeShellString(proc) || "*"; + if (procSanitized && processes2.length && processes2[0] !== "------") { + if (_windows) { + try { + util.powerShell("Get-CimInstance Win32_Process | select ProcessId,Caption,UserModeTime,KernelModeTime,WorkingSetSize | fl").then((stdout, error) => { + if (!error) { + let processSections = stdout.split(/\n\s*\n/); + let procStats = []; + let list_new = {}; + let allcpuu = 0; + let allcpus = 0; + processSections.forEach((element) => { + if (element.trim() !== "") { + let lines = element.trim().split("\r\n"); + let pid = parseInt(util.getValue(lines, "ProcessId", ":", true), 10); + let name = util.getValue(lines, "Caption", ":", true); + let utime = parseInt(util.getValue(lines, "UserModeTime", ":", true), 10); + let stime = parseInt(util.getValue(lines, "KernelModeTime", ":", true), 10); + let mem = parseInt(util.getValue(lines, "WorkingSetSize", ":", true), 10); + allcpuu = allcpuu + utime; + allcpus = allcpus + stime; + procStats.push({ + pid, + name, + utime, + stime, + cpu: 0, + cpuu: 0, + cpus: 0, + mem + }); + let pname = ""; + let inList = false; + processes2.forEach(function(proc2) { + if (name.toLowerCase().indexOf(proc2.toLowerCase()) >= 0 && !inList) { + inList = true; + pname = proc2; + } + }); + if (processesString === "*" || inList) { + let processFound = false; + result2.forEach(function(item) { + if (item.proc.toLowerCase() === pname.toLowerCase()) { + item.pids.push(pid); + item.mem += mem / os2.totalmem() * 100; + processFound = true; + } + }); + if (!processFound) { + result2.push({ + proc: pname, + pid, + pids: [pid], + cpu: 0, + mem: mem / os2.totalmem() * 100 + }); + } + } + } + }); + if (processesString !== "*") { + let processesMissing = processes2.filter(function(name) { + return procStats.filter(function(item) { + return item.name.toLowerCase().indexOf(name) >= 0; + }).length === 0; + }); + processesMissing.forEach(function(procName) { + result2.push({ + proc: procName, + pid: null, + pids: [], + cpu: 0, + mem: 0 + }); + }); + } + procStats.forEach((element) => { + let resultProcess = calcProcStatWin(element, allcpuu + allcpus, _process_cpu); + let listPos = -1; + for (let j = 0; j < result2.length; j++) { + if (result2[j].pid === resultProcess.pid || result2[j].pids.indexOf(resultProcess.pid) >= 0) { + listPos = j; + } + } + if (listPos >= 0) { + result2[listPos].cpu += resultProcess.cpuu + resultProcess.cpus; + } + list_new[resultProcess.pid] = { + cpuu: resultProcess.cpuu, + cpus: resultProcess.cpus, + utime: resultProcess.utime, + stime: resultProcess.stime + }; + }); + _process_cpu.all = allcpuu + allcpus; + _process_cpu.all_utime = allcpuu; + _process_cpu.all_stime = allcpus; + _process_cpu.list = Object.assign({}, list_new); + _process_cpu.ms = Date.now() - _process_cpu.ms; + _process_cpu.result = JSON.parse(JSON.stringify(result2)); + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + if (_darwin || _linux || _freebsd || _openbsd || _netbsd) { + const params = ["-axo", "pid,ppid,pcpu,pmem,comm"]; + util.execSafe("ps", params).then((stdout) => { + if (stdout) { + let procStats = []; + let lines = stdout.toString().split("\n").filter(function(line) { + if (processesString === "*") { + return true; + } + if (line.toLowerCase().indexOf("grep") !== -1) { + return false; + } + let found = false; + processes2.forEach(function(item) { + found = found || line.toLowerCase().indexOf(item.toLowerCase()) >= 0; + }); + return found; + }); + lines.shift(); + lines.forEach(function(line) { + let data = line.trim().replace(/ +/g, " ").split(" "); + if (data.length > 4) { + const linuxName = data[4].indexOf("/") >= 0 ? data[4].substring(0, data[4].indexOf("/")) : data[4]; + const name = _linux ? linuxName : data[4].substring(data[4].lastIndexOf("/") + 1); + procStats.push({ + name, + pid: parseInt(data[0]) || 0, + ppid: parseInt(data[1]) || 0, + cpu: parseFloat(data[2].replace(",", ".")), + mem: parseFloat(data[3].replace(",", ".")) + }); + } + }); + procStats.forEach(function(item) { + let listPos = -1; + let inList = false; + let name = item.name; + for (let j = 0; j < result2.length; j++) { + if (item.name.toLowerCase().indexOf(result2[j].proc.toLowerCase()) >= 0) { + listPos = j; + } + } + processes2.forEach(function(proc2) { + if (item.name.toLowerCase().indexOf(proc2.toLowerCase()) >= 0 && !inList) { + inList = true; + name = proc2; + } + }); + if (processesString === "*" || inList) { + if (listPos < 0) { + if (name) { + result2.push({ + proc: name, + pid: item.pid, + pids: [item.pid], + cpu: item.cpu, + mem: item.mem + }); + } + } else { + if (item.ppid < 10) { + result2[listPos].pid = item.pid; + } + result2[listPos].pids.push(item.pid); + result2[listPos].cpu += item.cpu; + result2[listPos].mem += item.mem; + } + } + }); + if (processesString !== "*") { + let processesMissing = processes2.filter(function(name) { + return procStats.filter(function(item) { + return item.name.toLowerCase().indexOf(name) >= 0; + }).length === 0; + }); + processesMissing.forEach(function(procName) { + result2.push({ + proc: procName, + pid: null, + pids: [], + cpu: 0, + mem: 0 + }); + }); + } + if (_linux) { + result2.forEach(function(item) { + item.cpu = 0; + }); + let cmd = 'cat /proc/stat | grep "cpu "'; + for (let i in result2) { + for (let j in result2[i].pids) { + cmd += ";cat /proc/" + result2[i].pids[j] + "/stat"; + } + } + exec2(cmd, { maxBuffer: 1024 * 2e4 }, function(error, stdout2) { + let curr_processes = stdout2.toString().split("\n"); + let all = parseProcStat(curr_processes.shift()); + let list_new = {}; + let resultProcess = {}; + curr_processes.forEach((element) => { + resultProcess = calcProcStatLinux(element, all, _process_cpu); + if (resultProcess.pid) { + let resultItemId = -1; + for (let i in result2) { + if (result2[i].pids.indexOf(resultProcess.pid) >= 0) { + resultItemId = i; + } + } + if (resultItemId >= 0) { + result2[resultItemId].cpu += resultProcess.cpuu + resultProcess.cpus; + } + list_new[resultProcess.pid] = { + cpuu: resultProcess.cpuu, + cpus: resultProcess.cpus, + utime: resultProcess.utime, + stime: resultProcess.stime, + cutime: resultProcess.cutime, + cstime: resultProcess.cstime + }; + } + }); + result2.forEach(function(item) { + item.cpu = Math.round(item.cpu * 100) / 100; + }); + _process_cpu.all = all; + _process_cpu.list = Object.assign({}, list_new); + _process_cpu.ms = Date.now() - _process_cpu.ms; + _process_cpu.result = Object.assign({}, result2); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } + } + }); + }); + } + exports.processLoad = processLoad; + } +}); + +// node_modules/systeminformation/lib/users.js +var require_users = __commonJS({ + "node_modules/systeminformation/lib/users.js"(exports) { + "use strict"; + var exec2 = require("child_process").exec; + var util = require_util2(); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + function parseUsersLinux(lines, phase) { + let result2 = []; + let result_who = []; + let result_w = {}; + let w_first = true; + let w_header = []; + let w_pos = []; + let who_line = {}; + let is_whopart = true; + lines.forEach(function(line) { + if (line === "---") { + is_whopart = false; + } else { + let l = line.replace(/ +/g, " ").split(" "); + if (is_whopart) { + result_who.push({ + user: l[0], + tty: l[1], + date: l[2], + time: l[3], + ip: l && l.length > 4 ? l[4].replace(/\(/g, "").replace(/\)/g, "") : "" + }); + } else { + if (w_first) { + w_header = l; + w_header.forEach(function(item) { + w_pos.push(line.indexOf(item)); + }); + w_first = false; + } else { + result_w.user = line.substring(w_pos[0], w_pos[1] - 1).trim(); + result_w.tty = line.substring(w_pos[1], w_pos[2] - 1).trim(); + result_w.ip = line.substring(w_pos[2], w_pos[3] - 1).replace(/\(/g, "").replace(/\)/g, "").trim(); + result_w.command = line.substring(w_pos[7], 1e3).trim(); + who_line = result_who.filter(function(obj) { + return obj.user.substring(0, 8).trim() === result_w.user && obj.tty === result_w.tty; + }); + if (who_line.length === 1) { + result2.push({ + user: who_line[0].user, + tty: who_line[0].tty, + date: who_line[0].date, + time: who_line[0].time, + ip: who_line[0].ip, + command: result_w.command + }); + } + } + } + } + }); + if (result2.length === 0 && phase === 2) { + return result_who; + } else { + return result2; + } + } + function parseUsersDarwin(lines) { + let result2 = []; + let result_who = []; + let result_w = {}; + let who_line = {}; + let is_whopart = true; + lines.forEach(function(line) { + if (line === "---") { + is_whopart = false; + } else { + let l = line.replace(/ +/g, " ").split(" "); + if (is_whopart) { + let dt = "" + new Date().getFullYear() + "-" + ("0" + ("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + "-" + ("0" + l[3]).slice(-2); + try { + if (new Date(dt) > new Date()) { + dt = "" + (new Date().getFullYear() - 1) + "-" + ("0" + ("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + "-" + ("0" + l[3]).slice(-2); + } + } catch (e) { + util.noop(); + } + result_who.push({ + user: l[0], + tty: l[1], + date: dt, + time: l[4] + }); + } else { + result_w.user = l[0]; + result_w.tty = l[1]; + result_w.ip = l[2] !== "-" ? l[2] : ""; + result_w.command = l.slice(5, 1e3).join(" "); + who_line = result_who.filter(function(obj) { + return obj.user.substring(0, 10) === result_w.user.substring(0, 10) && (obj.tty.substring(3, 1e3) === result_w.tty || obj.tty === result_w.tty); + }); + if (who_line.length === 1) { + result2.push({ + user: who_line[0].user, + tty: who_line[0].tty, + date: who_line[0].date, + time: who_line[0].time, + ip: result_w.ip, + command: result_w.command + }); + } + } + } + }); + return result2; + } + function users(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = []; + if (_linux) { + exec2('export LC_ALL=C; who --ips; echo "---"; w; unset LC_ALL | tail -n +2', function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + result2 = parseUsersLinux(lines, 1); + if (result2.length === 0) { + exec2('who; echo "---"; w | tail -n +2', function(error2, stdout2) { + if (!error2) { + lines = stdout2.toString().split("\n"); + result2 = parseUsersLinux(lines, 2); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } + if (_freebsd || _openbsd || _netbsd) { + exec2('who; echo "---"; w -ih', function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + result2 = parseUsersDarwin(lines); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos) { + exec2('who; echo "---"; w -h', function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + result2 = parseUsersDarwin(lines); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_darwin) { + exec2('export LC_ALL=C; who; echo "---"; w -ih; unset LC_ALL', function(error, stdout) { + if (!error) { + let lines = stdout.toString().split("\n"); + result2 = parseUsersDarwin(lines); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_windows) { + try { + let cmd = `Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl; echo '#-#-#-#';`; + cmd += "Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ; echo '#-#-#-#';"; + cmd += `$process = (Get-CimInstance Win32_Process -Filter "name = 'explorer.exe'"); Invoke-CimMethod -InputObject $process[0] -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo '#-#-#-#';`; + cmd += "query user"; + util.powerShell(cmd).then((data) => { + if (data) { + data = data.split("#-#-#-#"); + let sessions = parseWinSessions((data[0] || "").split(/\n\s*\n/)); + let loggedons = parseWinLoggedOn((data[1] || "").split(/\n\s*\n/)); + let queryUser = parseWinUsersQuery((data[3] || "").split("\r\n")); + let users2 = parseWinUsers((data[2] || "").split(/\n\s*\n/), queryUser); + for (let id in loggedons) { + if ({}.hasOwnProperty.call(loggedons, id)) { + loggedons[id].dateTime = {}.hasOwnProperty.call(sessions, id) ? sessions[id] : ""; + } + } + users2.forEach((user) => { + let dateTime = ""; + for (let id in loggedons) { + if ({}.hasOwnProperty.call(loggedons, id)) { + if (loggedons[id].user === user.user && (!dateTime || dateTime < loggedons[id].dateTime)) { + dateTime = loggedons[id].dateTime; + } + } + } + result2.push({ + user: user.user, + tty: user.tty, + date: `${dateTime.substring(0, 10)}`, + time: `${dateTime.substring(11, 19)}`, + ip: "", + command: "" + }); + }); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + function parseWinSessions(sessionParts) { + const sessions = {}; + sessionParts.forEach((session) => { + const lines = session.split("\r\n"); + const id = util.getValue(lines, "LogonId"); + const starttime = util.getValue(lines, "starttime"); + if (id) { + sessions[id] = starttime; + } + }); + return sessions; + } + function fuzzyMatch(name1, name2) { + name1 = name1.toLowerCase(); + name2 = name2.toLowerCase(); + let eq = 0; + let len = name1.length; + if (name2.length > len) { + len = name2.length; + } + for (let i = 0; i < len; i++) { + const c1 = name1[i] || ""; + const c2 = name2[i] || ""; + if (c1 === c2) { + eq++; + } + } + return len > 10 ? eq / len > 0.9 : len > 0 ? eq / len > 0.8 : false; + } + function parseWinUsers(userParts, userQuery) { + const users2 = []; + userParts.forEach((user) => { + const lines = user.split("\r\n"); + const domain = util.getValue(lines, "domain", ":", true); + const username = util.getValue(lines, "user", ":", true); + const sessionid = util.getValue(lines, "sessionid", ":", true); + if (username) { + const quser = userQuery.filter((item) => fuzzyMatch(item.user, username)); + users2.push({ + domain, + user: username, + tty: quser && quser[0] && quser[0].tty ? quser[0].tty : sessionid + }); + } + }); + return users2; + } + function parseWinLoggedOn(loggedonParts) { + const loggedons = {}; + loggedonParts.forEach((loggedon) => { + const lines = loggedon.split("\r\n"); + const antecendent = util.getValue(lines, "antecedent", ":", true); + let parts = antecendent.split("="); + const name = parts.length > 2 ? parts[1].split(",")[0].replace(/"/g, "").trim() : ""; + const domain = parts.length > 2 ? parts[2].replace(/"/g, "").replace(/\)/g, "").trim() : ""; + const dependent = util.getValue(lines, "dependent", ":", true); + parts = dependent.split("="); + const id = parts.length > 1 ? parts[1].replace(/"/g, "").replace(/\)/g, "").trim() : ""; + if (id) { + loggedons[id] = { + domain, + user: name + }; + } + }); + return loggedons; + } + function parseWinUsersQuery(lines) { + lines = lines.filter((item) => item); + let result2 = []; + const header = lines[0]; + const headerDelimiter = []; + if (header) { + const start = header[0] === " " ? 1 : 0; + headerDelimiter.push(start - 1); + let nextSpace = 0; + for (let i = start + 1; i < header.length; i++) { + if (header[i] === " " && (header[i - 1] === " " || header[i - 1] === ".")) { + nextSpace = i; + } else { + if (nextSpace) { + headerDelimiter.push(nextSpace); + nextSpace = 0; + } + } + } + for (let i = 1; i < lines.length; i++) { + if (lines[i].trim()) { + const user = lines[i].substring(headerDelimiter[0] + 1, headerDelimiter[1]).trim() || ""; + const tty = lines[i].substring(headerDelimiter[1] + 1, headerDelimiter[2] - 2).trim() || ""; + result2.push({ + user, + tty + }); + } + } + } + return result2; + } + exports.users = users; + } +}); + +// node_modules/systeminformation/lib/internet.js +var require_internet = __commonJS({ + "node_modules/systeminformation/lib/internet.js"(exports) { + "use strict"; + var util = require_util2(); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + function inetChecksite(url, callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = { + url, + ok: false, + status: 404, + ms: null + }; + if (typeof url !== "string") { + if (callback) { + callback(result2); + } + return resolve(result2); + } + let urlSanitized = ""; + const s = util.sanitizeShellString(url, true); + const l = util.mathMin(s.length, 2e3); + for (let i = 0; i <= l; i++) { + if (s[i] !== void 0) { + try { + s[i].__proto__.toLowerCase = util.stringToLower; + } catch (e) { + Object.setPrototypeOf(s[i], util.stringObj); + } + const sl = s[i].toLowerCase(); + if (sl && sl[0] && !sl[1] && sl[0].length === 1) { + urlSanitized = urlSanitized + sl[0]; + } + } + } + result2.url = urlSanitized; + try { + if (urlSanitized && !util.isPrototypePolluted()) { + try { + urlSanitized.__proto__.startsWith = util.stringStartWith; + } catch (e) { + Object.setPrototypeOf(urlSanitized, util.stringObj); + } + if (urlSanitized.startsWith("file:") || urlSanitized.startsWith("gopher:") || urlSanitized.startsWith("telnet:") || urlSanitized.startsWith("mailto:") || urlSanitized.startsWith("news:") || urlSanitized.startsWith("nntp:")) { + if (callback) { + callback(result2); + } + return resolve(result2); + } + util.checkWebsite(urlSanitized).then((res) => { + result2.status = res.statusCode; + result2.ok = res.statusCode >= 200 && res.statusCode <= 399; + ; + result2.ms = result2.ok ? res.time : null; + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } catch (err) { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + } + exports.inetChecksite = inetChecksite; + function inetLatency(host, callback) { + if (util.isFunction(host) && !callback) { + callback = host; + host = ""; + } + host = host || "8.8.8.8"; + return new Promise((resolve) => { + process.nextTick(() => { + if (typeof host !== "string") { + if (callback) { + callback(null); + } + return resolve(null); + } + let hostSanitized = ""; + const s = (util.isPrototypePolluted() ? "8.8.8.8" : util.sanitizeShellString(host, true)).trim(); + const l = util.mathMin(s.length, 2e3); + for (let i = 0; i <= l; i++) { + if (!(s[i] === void 0)) { + try { + s[i].__proto__.toLowerCase = util.stringToLower; + } catch (e) { + Object.setPrototypeOf(s[i], util.stringObj); + } + const sl = s[i].toLowerCase(); + if (sl && sl[0] && !sl[1]) { + hostSanitized = hostSanitized + sl[0]; + } + } + } + try { + hostSanitized.__proto__.startsWith = util.stringStartWith; + } catch (e) { + Object.setPrototypeOf(hostSanitized, util.stringObj); + } + if (hostSanitized.startsWith("file:") || hostSanitized.startsWith("gopher:") || hostSanitized.startsWith("telnet:") || hostSanitized.startsWith("mailto:") || hostSanitized.startsWith("news:") || hostSanitized.startsWith("nntp:")) { + if (callback) { + callback(null); + } + return resolve(null); + } + let params; + if (_linux || _freebsd || _openbsd || _netbsd || _darwin) { + if (_linux) { + params = ["-c", "2", "-w", "3", hostSanitized]; + } + if (_freebsd || _openbsd || _netbsd) { + params = ["-c", "2", "-t", "3", hostSanitized]; + } + if (_darwin) { + params = ["-c2", "-t3", hostSanitized]; + } + util.execSafe("ping", params).then((stdout) => { + let result2 = null; + if (stdout) { + const lines = stdout.split("\n").filter((line2) => line2.indexOf("rtt") >= 0 || line2.indexOf("round-trip") >= 0 || line2.indexOf("avg") >= 0).join("\n"); + const line = lines.split("="); + if (line.length > 1) { + const parts = line[1].split("/"); + if (parts.length > 1) { + result2 = parseFloat(parts[1]); + } + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos) { + const params2 = ["-s", "-a", hostSanitized, "56", "2"]; + const filt = "avg"; + util.execSafe("ping", params2, { timeout: 3e3 }).then((stdout) => { + let result2 = null; + if (stdout) { + const lines = stdout.split("\n").filter((line2) => line2.indexOf(filt) >= 0).join("\n"); + const line = lines.split("="); + if (line.length > 1) { + const parts = line[1].split("/"); + if (parts.length > 1) { + result2 = parseFloat(parts[1].replace(",", ".")); + } + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_windows) { + let result2 = null; + try { + const params2 = [hostSanitized, "-n", "1"]; + util.execSafe("ping", params2, util.execOptsWin).then((stdout) => { + if (stdout) { + let lines = stdout.split("\r\n"); + lines.shift(); + lines.forEach(function(line) { + if ((line.toLowerCase().match(/ms/g) || []).length === 3) { + let l2 = line.replace(/ +/g, " ").split(" "); + if (l2.length > 6) { + result2 = parseFloat(l2[l2.length - 1]); + } + } + }); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + exports.inetLatency = inetLatency; + } +}); + +// node_modules/systeminformation/lib/dockerSocket.js +var require_dockerSocket = __commonJS({ + "node_modules/systeminformation/lib/dockerSocket.js"(exports, module2) { + "use strict"; + var net = require("net"); + var isWin = require("os").type() === "Windows_NT"; + var socketPath = isWin ? "//./pipe/docker_engine" : "/var/run/docker.sock"; + var DockerSocket = class { + getInfo(callback) { + try { + let socket = net.createConnection({ path: socketPath }); + let alldata = ""; + let data; + socket.on("connect", () => { + socket.write("GET http:/info HTTP/1.0\r\n\r\n"); + }); + socket.on("data", (data2) => { + alldata = alldata + data2.toString(); + }); + socket.on("error", () => { + socket = false; + callback({}); + }); + socket.on("end", () => { + let startbody = alldata.indexOf("\r\n\r\n"); + alldata = alldata.substring(startbody + 4); + socket = false; + try { + data = JSON.parse(alldata); + callback(data); + } catch (err) { + callback({}); + } + }); + } catch (err) { + callback({}); + } + } + listImages(all, callback) { + try { + let socket = net.createConnection({ path: socketPath }); + let alldata = ""; + let data; + socket.on("connect", () => { + socket.write("GET http:/images/json" + (all ? "?all=1" : "") + " HTTP/1.0\r\n\r\n"); + }); + socket.on("data", (data2) => { + alldata = alldata + data2.toString(); + }); + socket.on("error", () => { + socket = false; + callback({}); + }); + socket.on("end", () => { + let startbody = alldata.indexOf("\r\n\r\n"); + alldata = alldata.substring(startbody + 4); + socket = false; + try { + data = JSON.parse(alldata); + callback(data); + } catch (err) { + callback({}); + } + }); + } catch (err) { + callback({}); + } + } + inspectImage(id, callback) { + id = id || ""; + if (id) { + try { + let socket = net.createConnection({ path: socketPath }); + let alldata = ""; + let data; + socket.on("connect", () => { + socket.write("GET http:/images/" + id + "/json?stream=0 HTTP/1.0\r\n\r\n"); + }); + socket.on("data", (data2) => { + alldata = alldata + data2.toString(); + }); + socket.on("error", () => { + socket = false; + callback({}); + }); + socket.on("end", () => { + let startbody = alldata.indexOf("\r\n\r\n"); + alldata = alldata.substring(startbody + 4); + socket = false; + try { + data = JSON.parse(alldata); + callback(data); + } catch (err) { + callback({}); + } + }); + } catch (err) { + callback({}); + } + } else { + callback({}); + } + } + listContainers(all, callback) { + try { + let socket = net.createConnection({ path: socketPath }); + let alldata = ""; + let data; + socket.on("connect", () => { + socket.write("GET http:/containers/json" + (all ? "?all=1" : "") + " HTTP/1.0\r\n\r\n"); + }); + socket.on("data", (data2) => { + alldata = alldata + data2.toString(); + }); + socket.on("error", () => { + socket = false; + callback({}); + }); + socket.on("end", () => { + let startbody = alldata.indexOf("\r\n\r\n"); + alldata = alldata.substring(startbody + 4); + socket = false; + try { + data = JSON.parse(alldata); + callback(data); + } catch (err) { + callback({}); + } + }); + } catch (err) { + callback({}); + } + } + getStats(id, callback) { + id = id || ""; + if (id) { + try { + let socket = net.createConnection({ path: socketPath }); + let alldata = ""; + let data; + socket.on("connect", () => { + socket.write("GET http:/containers/" + id + "/stats?stream=0 HTTP/1.0\r\n\r\n"); + }); + socket.on("data", (data2) => { + alldata = alldata + data2.toString(); + }); + socket.on("error", () => { + socket = false; + callback({}); + }); + socket.on("end", () => { + let startbody = alldata.indexOf("\r\n\r\n"); + alldata = alldata.substring(startbody + 4); + socket = false; + try { + data = JSON.parse(alldata); + callback(data); + } catch (err) { + callback({}); + } + }); + } catch (err) { + callback({}); + } + } else { + callback({}); + } + } + getInspect(id, callback) { + id = id || ""; + if (id) { + try { + let socket = net.createConnection({ path: socketPath }); + let alldata = ""; + let data; + socket.on("connect", () => { + socket.write("GET http:/containers/" + id + "/json?stream=0 HTTP/1.0\r\n\r\n"); + }); + socket.on("data", (data2) => { + alldata = alldata + data2.toString(); + }); + socket.on("error", () => { + socket = false; + callback({}); + }); + socket.on("end", () => { + let startbody = alldata.indexOf("\r\n\r\n"); + alldata = alldata.substring(startbody + 4); + socket = false; + try { + data = JSON.parse(alldata); + callback(data); + } catch (err) { + callback({}); + } + }); + } catch (err) { + callback({}); + } + } else { + callback({}); + } + } + getProcesses(id, callback) { + id = id || ""; + if (id) { + try { + let socket = net.createConnection({ path: socketPath }); + let alldata = ""; + let data; + socket.on("connect", () => { + socket.write("GET http:/containers/" + id + "/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\r\n\r\n"); + }); + socket.on("data", (data2) => { + alldata = alldata + data2.toString(); + }); + socket.on("error", () => { + socket = false; + callback({}); + }); + socket.on("end", () => { + let startbody = alldata.indexOf("\r\n\r\n"); + alldata = alldata.substring(startbody + 4); + socket = false; + try { + data = JSON.parse(alldata); + callback(data); + } catch (err) { + callback({}); + } + }); + } catch (err) { + callback({}); + } + } else { + callback({}); + } + } + listVolumes(callback) { + try { + let socket = net.createConnection({ path: socketPath }); + let alldata = ""; + let data; + socket.on("connect", () => { + socket.write("GET http:/volumes HTTP/1.0\r\n\r\n"); + }); + socket.on("data", (data2) => { + alldata = alldata + data2.toString(); + }); + socket.on("error", () => { + socket = false; + callback({}); + }); + socket.on("end", () => { + let startbody = alldata.indexOf("\r\n\r\n"); + alldata = alldata.substring(startbody + 4); + socket = false; + try { + data = JSON.parse(alldata); + callback(data); + } catch (err) { + callback({}); + } + }); + } catch (err) { + callback({}); + } + } + }; + module2.exports = DockerSocket; + } +}); + +// node_modules/systeminformation/lib/docker.js +var require_docker = __commonJS({ + "node_modules/systeminformation/lib/docker.js"(exports) { + "use strict"; + var util = require_util2(); + var DockerSocket = require_dockerSocket(); + var _platform = process.platform; + var _windows = _platform === "win32"; + var _docker_container_stats = {}; + var _docker_socket; + var _docker_last_read = 0; + function dockerInfo(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + if (!_docker_socket) { + _docker_socket = new DockerSocket(); + } + const result2 = {}; + _docker_socket.getInfo((data) => { + result2.id = data.ID; + result2.containers = data.Containers; + result2.containersRunning = data.ContainersRunning; + result2.containersPaused = data.ContainersPaused; + result2.containersStopped = data.ContainersStopped; + result2.images = data.Images; + result2.driver = data.Driver; + result2.memoryLimit = data.MemoryLimit; + result2.swapLimit = data.SwapLimit; + result2.kernelMemory = data.KernelMemory; + result2.cpuCfsPeriod = data.CpuCfsPeriod; + result2.cpuCfsQuota = data.CpuCfsQuota; + result2.cpuShares = data.CPUShares; + result2.cpuSet = data.CPUSet; + result2.ipv4Forwarding = data.IPv4Forwarding; + result2.bridgeNfIptables = data.BridgeNfIptables; + result2.bridgeNfIp6tables = data.BridgeNfIp6tables; + result2.debug = data.Debug; + result2.nfd = data.NFd; + result2.oomKillDisable = data.OomKillDisable; + result2.ngoroutines = data.NGoroutines; + result2.systemTime = data.SystemTime; + result2.loggingDriver = data.LoggingDriver; + result2.cgroupDriver = data.CgroupDriver; + result2.nEventsListener = data.NEventsListener; + result2.kernelVersion = data.KernelVersion; + result2.operatingSystem = data.OperatingSystem; + result2.osType = data.OSType; + result2.architecture = data.Architecture; + result2.ncpu = data.NCPU; + result2.memTotal = data.MemTotal; + result2.dockerRootDir = data.DockerRootDir; + result2.httpProxy = data.HttpProxy; + result2.httpsProxy = data.HttpsProxy; + result2.noProxy = data.NoProxy; + result2.name = data.Name; + result2.labels = data.Labels; + result2.experimentalBuild = data.ExperimentalBuild; + result2.serverVersion = data.ServerVersion; + result2.clusterStore = data.ClusterStore; + result2.clusterAdvertise = data.ClusterAdvertise; + result2.defaultRuntime = data.DefaultRuntime; + result2.liveRestoreEnabled = data.LiveRestoreEnabled; + result2.isolation = data.Isolation; + result2.initBinary = data.InitBinary; + result2.productLicense = data.ProductLicense; + if (callback) { + callback(result2); + } + resolve(result2); + }); + }); + }); + } + exports.dockerInfo = dockerInfo; + function dockerImages(all, callback) { + if (util.isFunction(all) && !callback) { + callback = all; + all = false; + } + if (typeof all === "string" && all === "true") { + all = true; + } + if (typeof all !== "boolean" && all !== void 0) { + all = false; + } + all = all || false; + let result2 = []; + return new Promise((resolve) => { + process.nextTick(() => { + if (!_docker_socket) { + _docker_socket = new DockerSocket(); + } + const workload = []; + _docker_socket.listImages(all, (data) => { + let dockerImages2 = {}; + try { + dockerImages2 = data; + if (dockerImages2 && Object.prototype.toString.call(dockerImages2) === "[object Array]" && dockerImages2.length > 0) { + dockerImages2.forEach(function(element) { + if (element.Names && Object.prototype.toString.call(element.Names) === "[object Array]" && element.Names.length > 0) { + element.Name = element.Names[0].replace(/^\/|\/$/g, ""); + } + workload.push(dockerImagesInspect(element.Id.trim(), element)); + }); + if (workload.length) { + Promise.all( + workload + ).then((data2) => { + if (callback) { + callback(data2); + } + resolve(data2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } catch (err) { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + }); + } + function dockerImagesInspect(imageID, payload) { + return new Promise((resolve) => { + process.nextTick(() => { + imageID = imageID || ""; + if (typeof imageID !== "string") { + return resolve(); + } + const imageIDSanitized = (util.isPrototypePolluted() ? "" : util.sanitizeShellString(imageID, true)).trim(); + if (imageIDSanitized) { + if (!_docker_socket) { + _docker_socket = new DockerSocket(); + } + _docker_socket.inspectImage(imageIDSanitized.trim(), (data) => { + try { + resolve({ + id: payload.Id, + container: data.Container, + comment: data.Comment, + os: data.Os, + architecture: data.Architecture, + parent: data.Parent, + dockerVersion: data.DockerVersion, + size: data.Size, + sharedSize: payload.SharedSize, + virtualSize: data.VirtualSize, + author: data.Author, + created: data.Created ? Math.round(new Date(data.Created).getTime() / 1e3) : 0, + containerConfig: data.ContainerConfig ? data.ContainerConfig : {}, + graphDriver: data.GraphDriver ? data.GraphDriver : {}, + repoDigests: data.RepoDigests ? data.RepoDigests : {}, + repoTags: data.RepoTags ? data.RepoTags : {}, + config: data.Config ? data.Config : {}, + rootFS: data.RootFS ? data.RootFS : {} + }); + } catch (err) { + resolve(); + } + }); + } else { + resolve(); + } + }); + }); + } + exports.dockerImages = dockerImages; + function dockerContainers(all, callback) { + function inContainers(containers, id) { + let filtered = containers.filter((obj) => { + return obj.Id && obj.Id === id; + }); + return filtered.length > 0; + } + if (util.isFunction(all) && !callback) { + callback = all; + all = false; + } + if (typeof all === "string" && all === "true") { + all = true; + } + if (typeof all !== "boolean" && all !== void 0) { + all = false; + } + all = all || false; + let result2 = []; + return new Promise((resolve) => { + process.nextTick(() => { + if (!_docker_socket) { + _docker_socket = new DockerSocket(); + } + const workload = []; + _docker_socket.listContainers(all, (data) => { + let docker_containers = {}; + try { + docker_containers = data; + if (docker_containers && Object.prototype.toString.call(docker_containers) === "[object Array]" && docker_containers.length > 0) { + for (let key in _docker_container_stats) { + if ({}.hasOwnProperty.call(_docker_container_stats, key)) { + if (!inContainers(docker_containers, key)) { + delete _docker_container_stats[key]; + } + } + } + docker_containers.forEach(function(element) { + if (element.Names && Object.prototype.toString.call(element.Names) === "[object Array]" && element.Names.length > 0) { + element.Name = element.Names[0].replace(/^\/|\/$/g, ""); + } + workload.push(dockerContainerInspect(element.Id.trim(), element)); + }); + if (workload.length) { + Promise.all( + workload + ).then((data2) => { + if (callback) { + callback(data2); + } + resolve(data2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } catch (err) { + for (let key in _docker_container_stats) { + if ({}.hasOwnProperty.call(_docker_container_stats, key)) { + if (!inContainers(docker_containers, key)) { + delete _docker_container_stats[key]; + } + } + } + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + }); + } + function dockerContainerInspect(containerID, payload) { + return new Promise((resolve) => { + process.nextTick(() => { + containerID = containerID || ""; + if (typeof containerID !== "string") { + return resolve(); + } + const containerIdSanitized = (util.isPrototypePolluted() ? "" : util.sanitizeShellString(containerID, true)).trim(); + if (containerIdSanitized) { + if (!_docker_socket) { + _docker_socket = new DockerSocket(); + } + _docker_socket.getInspect(containerIdSanitized.trim(), (data) => { + try { + resolve({ + id: payload.Id, + name: payload.Name, + image: payload.Image, + imageID: payload.ImageID, + command: payload.Command, + created: payload.Created, + started: data.State && data.State.StartedAt ? Math.round(new Date(data.State.StartedAt).getTime() / 1e3) : 0, + finished: data.State && data.State.FinishedAt && !data.State.FinishedAt.startsWith("0001-01-01") ? Math.round(new Date(data.State.FinishedAt).getTime() / 1e3) : 0, + createdAt: data.Created ? data.Created : "", + startedAt: data.State && data.State.StartedAt ? data.State.StartedAt : "", + finishedAt: data.State && data.State.FinishedAt && !data.State.FinishedAt.startsWith("0001-01-01") ? data.State.FinishedAt : "", + state: payload.State, + restartCount: data.RestartCount || 0, + platform: data.Platform || "", + driver: data.Driver || "", + ports: payload.Ports, + mounts: payload.Mounts + // hostconfig: payload.HostConfig, + // network: payload.NetworkSettings + }); + } catch (err) { + resolve(); + } + }); + } else { + resolve(); + } + }); + }); + } + exports.dockerContainers = dockerContainers; + function docker_calcCPUPercent(cpu_stats, precpu_stats) { + if (!_windows) { + let cpuPercent = 0; + let cpuDelta = cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage; + let systemDelta = cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage; + if (systemDelta > 0 && cpuDelta > 0) { + if (precpu_stats.online_cpus) { + cpuPercent = cpuDelta / systemDelta * precpu_stats.online_cpus * 100; + } else { + cpuPercent = cpuDelta / systemDelta * cpu_stats.cpu_usage.percpu_usage.length * 100; + } + } + return cpuPercent; + } else { + let nanoSecNow = util.nanoSeconds(); + let cpuPercent = 0; + if (_docker_last_read > 0) { + let possIntervals = nanoSecNow - _docker_last_read; + let intervalsUsed = cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage; + if (possIntervals > 0) { + cpuPercent = 100 * intervalsUsed / possIntervals; + } + } + _docker_last_read = nanoSecNow; + return cpuPercent; + } + } + function docker_calcNetworkIO(networks) { + let rx; + let wx; + for (let key in networks) { + if (!{}.hasOwnProperty.call(networks, key)) { + continue; + } + let obj = networks[key]; + rx = +obj.rx_bytes; + wx = +obj.tx_bytes; + } + return { + rx, + wx + }; + } + function docker_calcBlockIO(blkio_stats) { + let result2 = { + r: 0, + w: 0 + }; + if (blkio_stats && blkio_stats.io_service_bytes_recursive && Object.prototype.toString.call(blkio_stats.io_service_bytes_recursive) === "[object Array]" && blkio_stats.io_service_bytes_recursive.length > 0) { + blkio_stats.io_service_bytes_recursive.forEach(function(element) { + if (element.op && element.op.toLowerCase() === "read" && element.value) { + result2.r += element.value; + } + if (element.op && element.op.toLowerCase() === "write" && element.value) { + result2.w += element.value; + } + }); + } + return result2; + } + function dockerContainerStats(containerIDs, callback) { + let containerArray = []; + return new Promise((resolve) => { + process.nextTick(() => { + if (util.isFunction(containerIDs) && !callback) { + callback = containerIDs; + containerArray = ["*"]; + } else { + containerIDs = containerIDs || "*"; + if (typeof containerIDs !== "string") { + if (callback) { + callback([]); + } + return resolve([]); + } + let containerIDsSanitized = ""; + try { + containerIDsSanitized.__proto__.toLowerCase = util.stringToLower; + containerIDsSanitized.__proto__.replace = util.stringReplace; + containerIDsSanitized.__proto__.toString = util.stringToString; + containerIDsSanitized.__proto__.substr = util.stringSubstr; + containerIDsSanitized.__proto__.substring = util.stringSubstring; + containerIDsSanitized.__proto__.trim = util.stringTrim; + containerIDsSanitized.__proto__.startsWith = util.stringStartWith; + } catch (e) { + Object.setPrototypeOf(containerIDsSanitized, util.stringObj); + } + containerIDsSanitized = containerIDs; + containerIDsSanitized = containerIDsSanitized.trim(); + if (containerIDsSanitized !== "*") { + containerIDsSanitized = ""; + const s = (util.isPrototypePolluted() ? "" : util.sanitizeShellString(containerIDs, true)).trim(); + const l = util.mathMin(s.length, 2e3); + for (let i = 0; i <= l; i++) { + if (s[i] !== void 0) { + s[i].__proto__.toLowerCase = util.stringToLower; + const sl = s[i].toLowerCase(); + if (sl && sl[0] && !sl[1]) { + containerIDsSanitized = containerIDsSanitized + sl[0]; + } + } + } + } + containerIDsSanitized = containerIDsSanitized.trim().toLowerCase().replace(/,+/g, "|"); + containerArray = containerIDsSanitized.split("|"); + } + const result2 = []; + const workload = []; + if (containerArray.length && containerArray[0].trim() === "*") { + containerArray = []; + dockerContainers().then((allContainers) => { + for (let container of allContainers) { + containerArray.push(container.id.substring(0, 12)); + } + if (containerArray.length) { + dockerContainerStats(containerArray.join(",")).then((result3) => { + if (callback) { + callback(result3); + } + resolve(result3); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + } else { + for (let containerID of containerArray) { + workload.push(dockerContainerStatsSingle(containerID.trim())); + } + if (workload.length) { + Promise.all( + workload + ).then((data) => { + if (callback) { + callback(data); + } + resolve(data); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } + }); + }); + } + function dockerContainerStatsSingle(containerID) { + containerID = containerID || ""; + let result2 = { + id: containerID, + memUsage: 0, + memLimit: 0, + memPercent: 0, + cpuPercent: 0, + pids: 0, + netIO: { + rx: 0, + wx: 0 + }, + blockIO: { + r: 0, + w: 0 + }, + restartCount: 0, + cpuStats: {}, + precpuStats: {}, + memoryStats: {}, + networks: {} + }; + return new Promise((resolve) => { + process.nextTick(() => { + if (containerID) { + if (!_docker_socket) { + _docker_socket = new DockerSocket(); + } + _docker_socket.getInspect(containerID, (dataInspect) => { + try { + _docker_socket.getStats(containerID, (data) => { + try { + let stats = data; + if (!stats.message) { + if (data.id) { + result2.id = data.id; + } + result2.memUsage = stats.memory_stats && stats.memory_stats.usage ? stats.memory_stats.usage : 0; + result2.memLimit = stats.memory_stats && stats.memory_stats.limit ? stats.memory_stats.limit : 0; + result2.memPercent = stats.memory_stats && stats.memory_stats.usage && stats.memory_stats.limit ? stats.memory_stats.usage / stats.memory_stats.limit * 100 : 0; + result2.cpuPercent = stats.cpu_stats && stats.precpu_stats ? docker_calcCPUPercent(stats.cpu_stats, stats.precpu_stats) : 0; + result2.pids = stats.pids_stats && stats.pids_stats.current ? stats.pids_stats.current : 0; + result2.restartCount = dataInspect.RestartCount ? dataInspect.RestartCount : 0; + if (stats.networks) { + result2.netIO = docker_calcNetworkIO(stats.networks); + } + if (stats.blkio_stats) { + result2.blockIO = docker_calcBlockIO(stats.blkio_stats); + } + result2.cpuStats = stats.cpu_stats ? stats.cpu_stats : {}; + result2.precpuStats = stats.precpu_stats ? stats.precpu_stats : {}; + result2.memoryStats = stats.memory_stats ? stats.memory_stats : {}; + result2.networks = stats.networks ? stats.networks : {}; + } + } catch (err) { + util.noop(); + } + resolve(result2); + }); + } catch (err) { + util.noop(); + } + }); + } else { + resolve(result2); + } + }); + }); + } + exports.dockerContainerStats = dockerContainerStats; + function dockerContainerProcesses(containerID, callback) { + let result2 = []; + return new Promise((resolve) => { + process.nextTick(() => { + containerID = containerID || ""; + if (typeof containerID !== "string") { + return resolve(result2); + } + const containerIdSanitized = (util.isPrototypePolluted() ? "" : util.sanitizeShellString(containerID, true)).trim(); + if (containerIdSanitized) { + if (!_docker_socket) { + _docker_socket = new DockerSocket(); + } + _docker_socket.getProcesses(containerIdSanitized, (data) => { + try { + if (data && data.Titles && data.Processes) { + let titles = data.Titles.map(function(value) { + return value.toUpperCase(); + }); + let pos_pid = titles.indexOf("PID"); + let pos_ppid = titles.indexOf("PPID"); + let pos_pgid = titles.indexOf("PGID"); + let pos_vsz = titles.indexOf("VSZ"); + let pos_time = titles.indexOf("TIME"); + let pos_elapsed = titles.indexOf("ELAPSED"); + let pos_ni = titles.indexOf("NI"); + let pos_ruser = titles.indexOf("RUSER"); + let pos_user = titles.indexOf("USER"); + let pos_rgroup = titles.indexOf("RGROUP"); + let pos_group = titles.indexOf("GROUP"); + let pos_stat = titles.indexOf("STAT"); + let pos_rss = titles.indexOf("RSS"); + let pos_command = titles.indexOf("COMMAND"); + data.Processes.forEach((process2) => { + result2.push({ + pidHost: pos_pid >= 0 ? process2[pos_pid] : "", + ppid: pos_ppid >= 0 ? process2[pos_ppid] : "", + pgid: pos_pgid >= 0 ? process2[pos_pgid] : "", + user: pos_user >= 0 ? process2[pos_user] : "", + ruser: pos_ruser >= 0 ? process2[pos_ruser] : "", + group: pos_group >= 0 ? process2[pos_group] : "", + rgroup: pos_rgroup >= 0 ? process2[pos_rgroup] : "", + stat: pos_stat >= 0 ? process2[pos_stat] : "", + time: pos_time >= 0 ? process2[pos_time] : "", + elapsed: pos_elapsed >= 0 ? process2[pos_elapsed] : "", + nice: pos_ni >= 0 ? process2[pos_ni] : "", + rss: pos_rss >= 0 ? process2[pos_rss] : "", + vsz: pos_vsz >= 0 ? process2[pos_vsz] : "", + command: pos_command >= 0 ? process2[pos_command] : "" + }); + }); + } + } catch (err) { + util.noop(); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + } + exports.dockerContainerProcesses = dockerContainerProcesses; + function dockerVolumes(callback) { + let result2 = []; + return new Promise((resolve) => { + process.nextTick(() => { + if (!_docker_socket) { + _docker_socket = new DockerSocket(); + } + _docker_socket.listVolumes((data) => { + let dockerVolumes2 = {}; + try { + dockerVolumes2 = data; + if (dockerVolumes2 && dockerVolumes2.Volumes && Object.prototype.toString.call(dockerVolumes2.Volumes) === "[object Array]" && dockerVolumes2.Volumes.length > 0) { + dockerVolumes2.Volumes.forEach(function(element) { + result2.push({ + name: element.Name, + driver: element.Driver, + labels: element.Labels, + mountpoint: element.Mountpoint, + options: element.Options, + scope: element.Scope, + created: element.CreatedAt ? Math.round(new Date(element.CreatedAt).getTime() / 1e3) : 0 + }); + }); + if (callback) { + callback(result2); + } + resolve(result2); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + } catch (err) { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + }); + } + exports.dockerVolumes = dockerVolumes; + function dockerAll(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + dockerContainers(true).then((result2) => { + if (result2 && Object.prototype.toString.call(result2) === "[object Array]" && result2.length > 0) { + let l = result2.length; + result2.forEach(function(element) { + dockerContainerStats(element.id).then((res) => { + element.memUsage = res[0].memUsage; + element.memLimit = res[0].memLimit; + element.memPercent = res[0].memPercent; + element.cpuPercent = res[0].cpuPercent; + element.pids = res[0].pids; + element.netIO = res[0].netIO; + element.blockIO = res[0].blockIO; + element.cpuStats = res[0].cpuStats; + element.precpuStats = res[0].precpuStats; + element.memoryStats = res[0].memoryStats; + element.networks = res[0].networks; + dockerContainerProcesses(element.id).then((processes) => { + element.processes = processes; + l -= 1; + if (l === 0) { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + }); + } else { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + }); + } + exports.dockerAll = dockerAll; + } +}); + +// node_modules/systeminformation/lib/virtualbox.js +var require_virtualbox = __commonJS({ + "node_modules/systeminformation/lib/virtualbox.js"(exports) { + "use strict"; + var os2 = require("os"); + var exec2 = require("child_process").exec; + var util = require_util2(); + function vboxInfo(callback) { + let result2 = []; + return new Promise((resolve) => { + process.nextTick(() => { + try { + exec2(util.getVboxmanage() + " list vms --long", function(error, stdout) { + let parts = (os2.EOL + stdout.toString()).split(os2.EOL + "Name:"); + parts.shift(); + parts.forEach((part) => { + const lines = ("Name:" + part).split(os2.EOL); + const state = util.getValue(lines, "State"); + const running = state.startsWith("running"); + const runningSinceString = running ? state.replace("running (since ", "").replace(")", "").trim() : ""; + let runningSince = 0; + try { + if (running) { + const sinceDateObj = new Date(runningSinceString); + const offset = sinceDateObj.getTimezoneOffset(); + runningSince = Math.round((Date.now() - Date.parse(sinceDateObj)) / 1e3) + offset * 60; + } + } catch (e) { + util.noop(); + } + const stoppedSinceString = !running ? state.replace("powered off (since", "").replace(")", "").trim() : ""; + let stoppedSince = 0; + try { + if (!running) { + const sinceDateObj = new Date(stoppedSinceString); + const offset = sinceDateObj.getTimezoneOffset(); + stoppedSince = Math.round((Date.now() - Date.parse(sinceDateObj)) / 1e3) + offset * 60; + } + } catch (e) { + util.noop(); + } + result2.push({ + id: util.getValue(lines, "UUID"), + name: util.getValue(lines, "Name"), + running, + started: runningSinceString, + runningSince, + stopped: stoppedSinceString, + stoppedSince, + guestOS: util.getValue(lines, "Guest OS"), + hardwareUUID: util.getValue(lines, "Hardware UUID"), + memory: parseInt(util.getValue(lines, "Memory size", " "), 10), + vram: parseInt(util.getValue(lines, "VRAM size"), 10), + cpus: parseInt(util.getValue(lines, "Number of CPUs"), 10), + cpuExepCap: util.getValue(lines, "CPU exec cap"), + cpuProfile: util.getValue(lines, "CPUProfile"), + chipset: util.getValue(lines, "Chipset"), + firmware: util.getValue(lines, "Firmware"), + pageFusion: util.getValue(lines, "Page Fusion") === "enabled", + configFile: util.getValue(lines, "Config file"), + snapshotFolder: util.getValue(lines, "Snapshot folder"), + logFolder: util.getValue(lines, "Log folder"), + hpet: util.getValue(lines, "HPET") === "enabled", + pae: util.getValue(lines, "PAE") === "enabled", + longMode: util.getValue(lines, "Long Mode") === "enabled", + tripleFaultReset: util.getValue(lines, "Triple Fault Reset") === "enabled", + apic: util.getValue(lines, "APIC") === "enabled", + x2Apic: util.getValue(lines, "X2APIC") === "enabled", + acpi: util.getValue(lines, "ACPI") === "enabled", + ioApic: util.getValue(lines, "IOAPIC") === "enabled", + biosApicMode: util.getValue(lines, "BIOS APIC mode"), + bootMenuMode: util.getValue(lines, "Boot menu mode"), + bootDevice1: util.getValue(lines, "Boot Device 1"), + bootDevice2: util.getValue(lines, "Boot Device 2"), + bootDevice3: util.getValue(lines, "Boot Device 3"), + bootDevice4: util.getValue(lines, "Boot Device 4"), + timeOffset: util.getValue(lines, "Time offset"), + rtc: util.getValue(lines, "RTC") + }); + }); + if (callback) { + callback(result2); + } + resolve(result2); + }); + } catch (e) { + if (callback) { + callback(result2); + } + resolve(result2); + } + }); + }); + } + exports.vboxInfo = vboxInfo; + } +}); + +// node_modules/systeminformation/lib/printer.js +var require_printer = __commonJS({ + "node_modules/systeminformation/lib/printer.js"(exports) { + "use strict"; + var exec2 = require("child_process").exec; + var util = require_util2(); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + var winPrinterStatus = { + 1: "Other", + 2: "Unknown", + 3: "Idle", + 4: "Printing", + 5: "Warmup", + 6: "Stopped Printing", + 7: "Offline" + }; + function parseLinuxCupsHeader(lines) { + const result2 = {}; + if (lines && lines.length) { + if (lines[0].indexOf(" CUPS v") > 0) { + const parts = lines[0].split(" CUPS v"); + result2.cupsVersion = parts[1]; + } + } + return result2; + } + function parseLinuxCupsPrinter(lines) { + const result2 = {}; + const printerId = util.getValue(lines, "PrinterId", " "); + result2.id = printerId ? parseInt(printerId, 10) : null; + result2.name = util.getValue(lines, "Info", " "); + result2.model = lines.length > 0 && lines[0] ? lines[0].split(" ")[0] : ""; + result2.uri = util.getValue(lines, "DeviceURI", " "); + result2.uuid = util.getValue(lines, "UUID", " "); + result2.status = util.getValue(lines, "State", " "); + result2.local = util.getValue(lines, "Location", " ").toLowerCase().startsWith("local"); + result2.default = null; + result2.shared = util.getValue(lines, "Shared", " ").toLowerCase().startsWith("yes"); + return result2; + } + function parseLinuxLpstatPrinter(lines, id) { + const result2 = {}; + result2.id = id; + result2.name = util.getValue(lines, "Description", ":", true); + result2.model = lines.length > 0 && lines[0] ? lines[0].split(" ")[0] : ""; + result2.uri = null; + result2.uuid = null; + result2.status = lines.length > 0 && lines[0] ? lines[0].indexOf(" idle") > 0 ? "idle" : lines[0].indexOf(" printing") > 0 ? "printing" : "unknown" : null; + result2.local = util.getValue(lines, "Location", ":", true).toLowerCase().startsWith("local"); + result2.default = null; + result2.shared = util.getValue(lines, "Shared", " ").toLowerCase().startsWith("yes"); + return result2; + } + function parseDarwinPrinters(printerObject, id) { + const result2 = {}; + const uriParts = printerObject.uri.split("/"); + result2.id = id; + result2.name = printerObject._name; + result2.model = uriParts.length ? uriParts[uriParts.length - 1] : ""; + result2.uri = printerObject.uri; + result2.uuid = null; + result2.status = printerObject.status; + result2.local = printerObject.printserver === "local"; + result2.default = printerObject.default === "yes"; + result2.shared = printerObject.shared === "yes"; + return result2; + } + function parseWindowsPrinters(lines, id) { + const result2 = {}; + const status = parseInt(util.getValue(lines, "PrinterStatus", ":"), 10); + result2.id = id; + result2.name = util.getValue(lines, "name", ":"); + result2.model = util.getValue(lines, "DriverName", ":"); + result2.uri = null; + result2.uuid = null; + result2.status = winPrinterStatus[status] ? winPrinterStatus[status] : null; + result2.local = util.getValue(lines, "Local", ":").toUpperCase() === "TRUE"; + result2.default = util.getValue(lines, "Default", ":").toUpperCase() === "TRUE"; + result2.shared = util.getValue(lines, "Shared", ":").toUpperCase() === "TRUE"; + return result2; + } + function printer(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = []; + if (_linux || _freebsd || _openbsd || _netbsd) { + let cmd = "cat /etc/cups/printers.conf 2>/dev/null"; + exec2(cmd, function(error, stdout) { + if (!error) { + const parts = stdout.toString().split(" { + if (!error) { + const parts = stdout.toString().split(/\n\s*\n/); + for (let i = 0; i < parts.length; i++) { + const printer2 = parseWindowsPrinters(parts[i].split("\n"), i); + if (printer2.name || printer2.model) { + result2.push(printer2); + } + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos) { + resolve(null); + } + }); + }); + } + exports.printer = printer; + } +}); + +// node_modules/systeminformation/lib/usb.js +var require_usb = __commonJS({ + "node_modules/systeminformation/lib/usb.js"(exports) { + "use strict"; + var exec2 = require("child_process").exec; + var util = require_util2(); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + function getLinuxUsbType(type, name) { + let result2 = type; + const str = (name + " " + type).toLowerCase(); + if (str.indexOf("camera") >= 0) { + result2 = "Camera"; + } else if (str.indexOf("hub") >= 0) { + result2 = "Hub"; + } else if (str.indexOf("keybrd") >= 0) { + result2 = "Keyboard"; + } else if (str.indexOf("keyboard") >= 0) { + result2 = "Keyboard"; + } else if (str.indexOf("mouse") >= 0) { + result2 = "Mouse"; + } else if (str.indexOf("stora") >= 0) { + result2 = "Storage"; + } else if (str.indexOf("microp") >= 0) { + result2 = "Microphone"; + } else if (str.indexOf("headset") >= 0) { + result2 = "Audio"; + } else if (str.indexOf("audio") >= 0) { + result2 = "Audio"; + } + return result2; + } + function parseLinuxUsb(usb2) { + const result2 = {}; + const lines = usb2.split("\n"); + if (lines && lines.length && lines[0].indexOf("Device") >= 0) { + const parts = lines[0].split(" "); + result2.bus = parseInt(parts[0], 10); + if (parts[2]) { + result2.deviceId = parseInt(parts[2], 10); + } else { + result2.deviceId = null; + } + } else { + result2.bus = null; + result2.deviceId = null; + } + const idVendor = util.getValue(lines, "idVendor", " ", true).trim(); + let vendorParts = idVendor.split(" "); + vendorParts.shift(); + const vendor = vendorParts.join(" "); + const idProduct = util.getValue(lines, "idProduct", " ", true).trim(); + let productParts = idProduct.split(" "); + productParts.shift(); + const product = productParts.join(" "); + const interfaceClass = util.getValue(lines, "bInterfaceClass", " ", true).trim(); + let interfaceClassParts = interfaceClass.split(" "); + interfaceClassParts.shift(); + const usbType = interfaceClassParts.join(" "); + const iManufacturer = util.getValue(lines, "iManufacturer", " ", true).trim(); + let iManufacturerParts = iManufacturer.split(" "); + iManufacturerParts.shift(); + const manufacturer = iManufacturerParts.join(" "); + const iSerial = util.getValue(lines, "iSerial", " ", true).trim(); + let iSerialParts = iSerial.split(" "); + iSerialParts.shift(); + const serial = iSerialParts.join(" "); + result2.id = (idVendor.startsWith("0x") ? idVendor.split(" ")[0].substr(2, 10) : "") + ":" + (idProduct.startsWith("0x") ? idProduct.split(" ")[0].substr(2, 10) : ""); + result2.name = product; + result2.type = getLinuxUsbType(usbType, product); + result2.removable = null; + result2.vendor = vendor; + result2.manufacturer = manufacturer; + result2.maxPower = util.getValue(lines, "MaxPower", " ", true); + result2.serialNumber = serial; + return result2; + } + function getDarwinUsbType(name) { + let result2 = ""; + if (name.indexOf("camera") >= 0) { + result2 = "Camera"; + } else if (name.indexOf("touch bar") >= 0) { + result2 = "Touch Bar"; + } else if (name.indexOf("controller") >= 0) { + result2 = "Controller"; + } else if (name.indexOf("headset") >= 0) { + result2 = "Audio"; + } else if (name.indexOf("keyboard") >= 0) { + result2 = "Keyboard"; + } else if (name.indexOf("trackpad") >= 0) { + result2 = "Trackpad"; + } else if (name.indexOf("sensor") >= 0) { + result2 = "Sensor"; + } else if (name.indexOf("bthusb") >= 0) { + result2 = "Bluetooth"; + } else if (name.indexOf("bth") >= 0) { + result2 = "Bluetooth"; + } else if (name.indexOf("rfcomm") >= 0) { + result2 = "Bluetooth"; + } else if (name.indexOf("usbhub") >= 0) { + result2 = "Hub"; + } else if (name.indexOf(" hub") >= 0) { + result2 = "Hub"; + } else if (name.indexOf("mouse") >= 0) { + result2 = "Mouse"; + } else if (name.indexOf("microp") >= 0) { + result2 = "Microphone"; + } else if (name.indexOf("removable") >= 0) { + result2 = "Storage"; + } + return result2; + } + function parseDarwinUsb(usb2, id) { + const result2 = {}; + result2.id = id; + usb2 = usb2.replace(/ \|/g, ""); + usb2 = usb2.trim(); + let lines = usb2.split("\n"); + lines.shift(); + try { + for (let i = 0; i < lines.length; i++) { + lines[i] = lines[i].trim(); + lines[i] = lines[i].replace(/=/g, ":"); + if (lines[i] !== "{" && lines[i] !== "}" && lines[i + 1] && lines[i + 1].trim() !== "}") { + lines[i] = lines[i] + ","; + } + lines[i] = lines[i].replace(":Yes,", ':"Yes",'); + lines[i] = lines[i].replace(": Yes,", ': "Yes",'); + lines[i] = lines[i].replace(": Yes", ': "Yes"'); + lines[i] = lines[i].replace(":No,", ':"No",'); + lines[i] = lines[i].replace(": No,", ': "No",'); + lines[i] = lines[i].replace(": No", ': "No"'); + lines[i] = lines[i].replace("((", "").replace("))", ""); + const match = /<(\w+)>/.exec(lines[i]); + if (match) { + const number = match[0]; + lines[i] = lines[i].replace(number, `"${number}"`); + } + } + const usbObj = JSON.parse(lines.join("\n")); + const removableDrive = (usbObj["Built-In"] ? usbObj["Built-In"].toLowerCase() !== "yes" : true) && (usbObj["non-removable"] ? usbObj["non-removable"].toLowerCase() === "no" : true); + result2.bus = null; + result2.deviceId = null; + result2.id = usbObj["USB Address"] || null; + result2.name = usbObj["kUSBProductString"] || usbObj["USB Product Name"] || null; + result2.type = getDarwinUsbType((usbObj["kUSBProductString"] || usbObj["USB Product Name"] || "").toLowerCase() + (removableDrive ? " removable" : "")); + result2.removable = usbObj["non-removable"] ? usbObj["non-removable"].toLowerCase() || false : true; + result2.vendor = usbObj["kUSBVendorString"] || usbObj["USB Vendor Name"] || null; + result2.manufacturer = usbObj["kUSBVendorString"] || usbObj["USB Vendor Name"] || null; + result2.maxPower = null; + result2.serialNumber = usbObj["kUSBSerialNumberString"] || null; + if (result2.name) { + return result2; + } else { + return null; + } + } catch (e) { + return null; + } + } + function getWindowsUsbTypeCreation(creationclass, name) { + let result2 = ""; + if (name.indexOf("storage") >= 0) { + result2 = "Storage"; + } else if (name.indexOf("speicher") >= 0) { + result2 = "Storage"; + } else if (creationclass.indexOf("usbhub") >= 0) { + result2 = "Hub"; + } else if (creationclass.indexOf("storage") >= 0) { + result2 = "Storage"; + } else if (creationclass.indexOf("usbcontroller") >= 0) { + result2 = "Controller"; + } else if (creationclass.indexOf("keyboard") >= 0) { + result2 = "Keyboard"; + } else if (creationclass.indexOf("pointing") >= 0) { + result2 = "Mouse"; + } else if (creationclass.indexOf("microp") >= 0) { + result2 = "Microphone"; + } else if (creationclass.indexOf("disk") >= 0) { + result2 = "Storage"; + } + return result2; + } + function parseWindowsUsb(lines, id) { + const usbType = getWindowsUsbTypeCreation(util.getValue(lines, "CreationClassName", ":").toLowerCase(), util.getValue(lines, "name", ":").toLowerCase()); + if (usbType) { + const result2 = {}; + result2.bus = null; + result2.deviceId = util.getValue(lines, "deviceid", ":"); + result2.id = id; + result2.name = util.getValue(lines, "name", ":"); + result2.type = usbType; + result2.removable = null; + result2.vendor = null; + result2.manufacturer = util.getValue(lines, "Manufacturer", ":"); + result2.maxPower = null; + result2.serialNumber = null; + return result2; + } else { + return null; + } + } + function usb(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = []; + if (_linux) { + const cmd = "export LC_ALL=C; lsusb -v 2>/dev/null; unset LC_ALL"; + exec2(cmd, { maxBuffer: 1024 * 1024 * 128 }, function(error, stdout) { + if (!error) { + const parts = ("\n\n" + stdout.toString()).split("\n\nBus "); + for (let i = 1; i < parts.length; i++) { + const usb2 = parseLinuxUsb(parts[i]); + result2.push(usb2); + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_darwin) { + let cmd = "ioreg -p IOUSB -c AppleUSBRootHubDevice -w0 -l"; + exec2(cmd, { maxBuffer: 1024 * 1024 * 128 }, function(error, stdout) { + if (!error) { + const parts = stdout.toString().split(" +-o "); + for (let i = 1; i < parts.length; i++) { + const usb2 = parseDarwinUsb(parts[i]); + if (usb2) { + result2.push(usb2); + } + } + if (callback) { + callback(result2); + } + resolve(result2); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_windows) { + util.powerShell('Get-CimInstance CIM_LogicalDevice | where { $_.Description -match "USB"} | select Name,CreationClassName,DeviceId,Manufacturer | fl').then((stdout, error) => { + if (!error) { + const parts = stdout.toString().split(/\n\s*\n/); + for (let i = 0; i < parts.length; i++) { + const usb2 = parseWindowsUsb(parts[i].split("\n"), i); + if (usb2 && result2.filter((x) => x.deviceId === usb2.deviceId).length === 0) { + result2.push(usb2); + } + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos || _freebsd || _openbsd || _netbsd) { + resolve(null); + } + }); + }); + } + exports.usb = usb; + } +}); + +// node_modules/systeminformation/lib/audio.js +var require_audio = __commonJS({ + "node_modules/systeminformation/lib/audio.js"(exports) { + "use strict"; + var exec2 = require("child_process").exec; + var execSync = require("child_process").execSync; + var util = require_util2(); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + function parseAudioType(str, input, output) { + str = str.toLowerCase(); + let result2 = ""; + if (str.indexOf("input") >= 0) { + result2 = "Microphone"; + } + if (str.indexOf("display audio") >= 0) { + result2 = "Speaker"; + } + if (str.indexOf("speak") >= 0) { + result2 = "Speaker"; + } + if (str.indexOf("laut") >= 0) { + result2 = "Speaker"; + } + if (str.indexOf("loud") >= 0) { + result2 = "Speaker"; + } + if (str.indexOf("head") >= 0) { + result2 = "Headset"; + } + if (str.indexOf("mic") >= 0) { + result2 = "Microphone"; + } + if (str.indexOf("mikr") >= 0) { + result2 = "Microphone"; + } + if (str.indexOf("phone") >= 0) { + result2 = "Phone"; + } + if (str.indexOf("controll") >= 0) { + result2 = "Controller"; + } + if (str.indexOf("line o") >= 0) { + result2 = "Line Out"; + } + if (str.indexOf("digital o") >= 0) { + result2 = "Digital Out"; + } + if (str.indexOf("smart sound technology") >= 0) { + result2 = "Digital Signal Processor"; + } + if (str.indexOf("high definition audio") >= 0) { + result2 = "Sound Driver"; + } + if (!result2 && output) { + result2 = "Speaker"; + } else if (!result2 && input) { + result2 = "Microphone"; + } + return result2; + } + function getLinuxAudioPci() { + let cmd = "lspci -v 2>/dev/null"; + let result2 = []; + try { + const parts = execSync(cmd, util.execOptsLinux).toString().split("\n\n"); + parts.forEach((element) => { + const lines = element.split("\n"); + if (lines && lines.length && lines[0].toLowerCase().indexOf("audio") >= 0) { + const audio2 = {}; + audio2.slotId = lines[0].split(" ")[0]; + audio2.driver = util.getValue(lines, "Kernel driver in use", ":", true) || util.getValue(lines, "Kernel modules", ":", true); + result2.push(audio2); + } + }); + return result2; + } catch (e) { + return result2; + } + } + function parseLinuxAudioPciMM(lines, audioPCI) { + const result2 = {}; + const slotId = util.getValue(lines, "Slot"); + const pciMatch = audioPCI.filter(function(item) { + return item.slotId === slotId; + }); + result2.id = slotId; + result2.name = util.getValue(lines, "SDevice"); + result2.manufacturer = util.getValue(lines, "SVendor"); + result2.revision = util.getValue(lines, "Rev"); + result2.driver = pciMatch && pciMatch.length === 1 && pciMatch[0].driver ? pciMatch[0].driver : ""; + result2.default = null; + result2.channel = "PCIe"; + result2.type = parseAudioType(result2.name, null, null); + result2.in = null; + result2.out = null; + result2.status = "online"; + return result2; + } + function parseDarwinChannel(str) { + let result2 = ""; + if (str.indexOf("builtin") >= 0) { + result2 = "Built-In"; + } + if (str.indexOf("extern") >= 0) { + result2 = "Audio-Jack"; + } + if (str.indexOf("hdmi") >= 0) { + result2 = "HDMI"; + } + if (str.indexOf("displayport") >= 0) { + result2 = "Display-Port"; + } + if (str.indexOf("usb") >= 0) { + result2 = "USB"; + } + if (str.indexOf("pci") >= 0) { + result2 = "PCIe"; + } + return result2; + } + function parseDarwinAudio(audioObject, id) { + const result2 = {}; + const channelStr = ((audioObject.coreaudio_device_transport || "") + " " + (audioObject._name || "")).toLowerCase(); + result2.id = id; + result2.name = audioObject._name; + result2.manufacturer = audioObject.coreaudio_device_manufacturer; + result2.revision = null; + result2.driver = null; + result2.default = !!(audioObject.coreaudio_default_audio_input_device || "") || !!(audioObject.coreaudio_default_audio_output_device || ""); + result2.channel = parseDarwinChannel(channelStr); + result2.type = parseAudioType(result2.name, !!(audioObject.coreaudio_device_input || ""), !!(audioObject.coreaudio_device_output || "")); + result2.in = !!(audioObject.coreaudio_device_input || ""); + result2.out = !!(audioObject.coreaudio_device_output || ""); + result2.status = "online"; + return result2; + } + function parseWindowsAudio(lines) { + const result2 = {}; + const status = util.getValue(lines, "StatusInfo", ":"); + result2.id = util.getValue(lines, "DeviceID", ":"); + result2.name = util.getValue(lines, "name", ":"); + result2.manufacturer = util.getValue(lines, "manufacturer", ":"); + result2.revision = null; + result2.driver = null; + result2.default = null; + result2.channel = null; + result2.type = parseAudioType(result2.name, null, null); + result2.in = null; + result2.out = null; + result2.status = status; + return result2; + } + function audio(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = []; + if (_linux || _freebsd || _openbsd || _netbsd) { + let cmd = "lspci -vmm 2>/dev/null"; + exec2(cmd, function(error, stdout) { + if (!error) { + const audioPCI = getLinuxAudioPci(); + const parts = stdout.toString().split("\n\n"); + parts.forEach((element) => { + const lines = element.split("\n"); + if (util.getValue(lines, "class", ":", true).toLowerCase().indexOf("audio") >= 0) { + const audio2 = parseLinuxAudioPciMM(lines, audioPCI); + result2.push(audio2); + } + }); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_darwin) { + let cmd = "system_profiler SPAudioDataType -json"; + exec2(cmd, function(error, stdout) { + if (!error) { + try { + const outObj = JSON.parse(stdout.toString()); + if (outObj.SPAudioDataType && outObj.SPAudioDataType.length && outObj.SPAudioDataType[0] && outObj.SPAudioDataType[0]["_items"] && outObj.SPAudioDataType[0]["_items"].length) { + for (let i = 0; i < outObj.SPAudioDataType[0]["_items"].length; i++) { + const audio2 = parseDarwinAudio(outObj.SPAudioDataType[0]["_items"][i], i); + result2.push(audio2); + } + } + } catch (e) { + util.noop(); + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_windows) { + util.powerShell("Get-CimInstance Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl").then((stdout, error) => { + if (!error) { + const parts = stdout.toString().split(/\n\s*\n/); + parts.forEach((element) => { + const lines = element.split("\n"); + if (util.getValue(lines, "name", ":")) { + result2.push(parseWindowsAudio(lines)); + } + }); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_sunos) { + resolve(null); + } + }); + }); + } + exports.audio = audio; + } +}); + +// node_modules/systeminformation/lib/bluetoothVendors.js +var require_bluetoothVendors = __commonJS({ + "node_modules/systeminformation/lib/bluetoothVendors.js"(exports, module2) { + "use strict"; + module2.exports = { + 0: "Ericsson Technology Licensing", + 1: "Nokia Mobile Phones", + 2: "Intel Corp.", + 3: "IBM Corp.", + 4: "Toshiba Corp.", + 5: "3Com", + 6: "Microsoft", + 7: "Lucent", + 8: "Motorola", + 9: "Infineon Technologies AG", + 10: "Cambridge Silicon Radio", + 11: "Silicon Wave", + 12: "Digianswer A/S", + 13: "Texas Instruments Inc.", + 14: "Ceva, Inc. (formerly Parthus Technologies, Inc.)", + 15: "Broadcom Corporation", + 16: "Mitel Semiconductor", + 17: "Widcomm, Inc", + 18: "Zeevo, Inc.", + 19: "Atmel Corporation", + 20: "Mitsubishi Electric Corporation", + 21: "RTX Telecom A/S", + 22: "KC Technology Inc.", + 23: "NewLogic", + 24: "Transilica, Inc.", + 25: "Rohde & Schwarz GmbH & Co. KG", + 26: "TTPCom Limited", + 27: "Signia Technologies, Inc.", + 28: "Conexant Systems Inc.", + 29: "Qualcomm", + 30: "Inventel", + 31: "AVM Berlin", + 32: "BandSpeed, Inc.", + 33: "Mansella Ltd", + 34: "NEC Corporation", + 35: "WavePlus Technology Co., Ltd.", + 36: "Alcatel", + 37: "NXP Semiconductors (formerly Philips Semiconductors)", + 38: "C Technologies", + 39: "Open Interface", + 40: "R F Micro Devices", + 41: "Hitachi Ltd", + 42: "Symbol Technologies, Inc.", + 43: "Tenovis", + 44: "Macronix International Co. Ltd.", + 45: "GCT Semiconductor", + 46: "Norwood Systems", + 47: "MewTel Technology Inc.", + 48: "ST Microelectronics", + 49: "Synopsis", + 50: "Red-M (Communications) Ltd", + 51: "Commil Ltd", + 52: "Computer Access Technology Corporation (CATC)", + 53: "Eclipse (HQ Espana) S.L.", + 54: "Renesas Electronics Corporation", + 55: "Mobilian Corporation", + 56: "Terax", + 57: "Integrated System Solution Corp.", + 58: "Matsushita Electric Industrial Co., Ltd.", + 59: "Gennum Corporation", + 60: "BlackBerry Limited (formerly Research In Motion)", + 61: "IPextreme, Inc.", + 62: "Systems and Chips, Inc.", + 63: "Bluetooth SIG, Inc.", + 64: "Seiko Epson Corporation", + 65: "Integrated Silicon Solution Taiwan, Inc.", + 66: "CONWISE Technology Corporation Ltd", + 67: "PARROT SA", + 68: "Socket Mobile", + 69: "Atheros Communications, Inc.", + 70: "MediaTek, Inc.", + 71: "Bluegiga", + 72: "Marvell Technology Group Ltd.", + 73: "3DSP Corporation", + 74: "Accel Semiconductor Ltd.", + 75: "Continental Automotive Systems", + 76: "Apple, Inc.", + 77: "Staccato Communications, Inc.", + 78: "Avago Technologies", + 79: "APT Licensing Ltd.", + 80: "SiRF Technology", + 81: "Tzero Technologies, Inc.", + 82: "J&M Corporation", + 83: "Free2move AB", + 84: "3DiJoy Corporation", + 85: "Plantronics, Inc.", + 86: "Sony Ericsson Mobile Communications", + 87: "Harman International Industries, Inc.", + 88: "Vizio, Inc.", + 89: "Nordic Semiconductor ASA", + 90: "EM Microelectronic-Marin SA", + 91: "Ralink Technology Corporation", + 92: "Belkin International, Inc.", + 93: "Realtek Semiconductor Corporation", + 94: "Stonestreet One, LLC", + 95: "Wicentric, Inc.", + 96: "RivieraWaves S.A.S", + 97: "RDA Microelectronics", + 98: "Gibson Guitars", + 99: "MiCommand Inc.", + 100: "Band XI International, LLC", + 101: "Hewlett-Packard Company", + 102: "9Solutions Oy", + 103: "GN Netcom A/S", + 104: "General Motors", + 105: "A&D Engineering, Inc.", + 106: "MindTree Ltd.", + 107: "Polar Electro OY", + 108: "Beautiful Enterprise Co., Ltd.", + 109: "BriarTek, Inc.", + 110: "Summit Data Communications, Inc.", + 111: "Sound ID", + 112: "Monster, LLC", + 113: "connectBlue AB", + 114: "ShangHai Super Smart Electronics Co. Ltd.", + 115: "Group Sense Ltd.", + 116: "Zomm, LLC", + 117: "Samsung Electronics Co. Ltd.", + 118: "Creative Technology Ltd.", + 119: "Laird Technologies", + 120: "Nike, Inc.", + 121: "lesswire AG", + 122: "MStar Semiconductor, Inc.", + 123: "Hanlynn Technologies", + 124: "A & R Cambridge", + 125: "Seers Technology Co. Ltd", + 126: "Sports Tracking Technologies Ltd.", + 127: "Autonet Mobile", + 128: "DeLorme Publishing Company, Inc.", + 129: "WuXi Vimicro", + 130: "Sennheiser Communications A/S", + 131: "TimeKeeping Systems, Inc.", + 132: "Ludus Helsinki Ltd.", + 133: "BlueRadios, Inc.", + 134: "equinox AG", + 135: "Garmin International, Inc.", + 136: "Ecotest", + 137: "GN ReSound A/S", + 138: "Jawbone", + 139: "Topcorn Positioning Systems, LLC", + 140: "Gimbal Inc. (formerly Qualcomm Labs, Inc. and Qualcomm Retail Solutions, Inc.)", + 141: "Zscan Software", + 142: "Quintic Corp.", + 143: "Stollman E+V GmbH", + 144: "Funai Electric Co., Ltd.", + 145: "Advanced PANMOBIL Systems GmbH & Co. KG", + 146: "ThinkOptics, Inc.", + 147: "Universal Electronics, Inc.", + 148: "Airoha Technology Corp.", + 149: "NEC Lighting, Ltd.", + 150: "ODM Technology, Inc.", + 151: "ConnecteDevice Ltd.", + 152: "zer01.tv GmbH", + 153: "i.Tech Dynamic Global Distribution Ltd.", + 154: "Alpwise", + 155: "Jiangsu Toppower Automotive Electronics Co., Ltd.", + 156: "Colorfy, Inc.", + 157: "Geoforce Inc.", + 158: "Bose Corporation", + 159: "Suunto Oy", + 160: "Kensington Computer Products Group", + 161: "SR-Medizinelektronik", + 162: "Vertu Corporation Limited", + 163: "Meta Watch Ltd.", + 164: "LINAK A/S", + 165: "OTL Dynamics LLC", + 166: "Panda Ocean Inc.", + 167: "Visteon Corporation", + 168: "ARP Devices Limited", + 169: "Magneti Marelli S.p.A", + 170: "CAEN RFID srl", + 171: "Ingenieur-Systemgruppe Zahn GmbH", + 172: "Green Throttle Games", + 173: "Peter Systemtechnik GmbH", + 174: "Omegawave Oy", + 175: "Cinetix", + 176: "Passif Semiconductor Corp", + 177: "Saris Cycling Group, Inc", + 178: "Bekey A/S", + 179: "Clarinox Technologies Pty. Ltd.", + 180: "BDE Technology Co., Ltd.", + 181: "Swirl Networks", + 182: "Meso international", + 183: "TreLab Ltd", + 184: "Qualcomm Innovation Center, Inc. (QuIC)", + 185: "Johnson Controls, Inc.", + 186: "Starkey Laboratories Inc.", + 187: "S-Power Electronics Limited", + 188: "Ace Sensor Inc", + 189: "Aplix Corporation", + 190: "AAMP of America", + 191: "Stalmart Technology Limited", + 192: "AMICCOM Electronics Corporation", + 193: "Shenzhen Excelsecu Data Technology Co.,Ltd", + 194: "Geneq Inc.", + 195: "adidas AG", + 196: "LG Electronics", + 197: "Onset Computer Corporation", + 198: "Selfly BV", + 199: "Quuppa Oy.", + 200: "GeLo Inc", + 201: "Evluma", + 202: "MC10", + 203: "Binauric SE", + 204: "Beats Electronics", + 205: "Microchip Technology Inc.", + 206: "Elgato Systems GmbH", + 207: "ARCHOS SA", + 208: "Dexcom, Inc.", + 209: "Polar Electro Europe B.V.", + 210: "Dialog Semiconductor B.V.", + 211: "Taixingbang\xA0Technology (HK) Co,. LTD.", + 212: "Kawantech", + 213: "Austco Communication Systems", + 214: "Timex Group USA, Inc.", + 215: "Qualcomm Technologies, Inc.", + 216: "Qualcomm Connected Experiences, Inc.", + 217: "Voyetra Turtle Beach", + 218: "txtr GmbH", + 219: "Biosentronics", + 220: "Procter & Gamble", + 221: "Hosiden Corporation", + 222: "Muzik LLC", + 223: "Misfit Wearables Corp", + 224: "Google", + 225: "Danlers Ltd", + 226: "Semilink Inc", + 227: "inMusic Brands, Inc", + 228: "L.S. Research Inc.", + 229: "Eden Software Consultants Ltd.", + 230: "Freshtemp", + 231: "KS Technologies", + 232: "ACTS Technologies", + 233: "Vtrack Systems", + 234: "Nielsen-Kellerman Company", + 235: "Server Technology, Inc.", + 236: "BioResearch Associates", + 237: "Jolly Logic, LLC", + 238: "Above Average Outcomes, Inc.", + 239: "Bitsplitters GmbH", + 240: "PayPal, Inc.", + 241: "Witron Technology Limited", + 242: "Aether Things\xA0Inc. (formerly Morse Project Inc.)", + 243: "Kent Displays Inc.", + 244: "Nautilus Inc.", + 245: "Smartifier Oy", + 246: "Elcometer Limited", + 247: "VSN Technologies Inc.", + 248: "AceUni Corp., Ltd.", + 249: "StickNFind", + 250: "Crystal Code AB", + 251: "KOUKAAM a.s.", + 252: "Delphi Corporation", + 253: "ValenceTech Limited", + 254: "Reserved", + 255: "Typo Products, LLC", + 256: "TomTom International BV", + 257: "Fugoo, Inc", + 258: "Keiser Corporation", + 259: "Bang & Olufsen A/S", + 260: "PLUS Locations Systems Pty Ltd", + 261: "Ubiquitous Computing Technology Corporation", + 262: "Innovative Yachtter Solutions", + 263: "William Demant Holding A/S", + 264: "Chicony Electronics Co., Ltd.", + 265: "Atus BV", + 266: "Codegate Ltd.", + 267: "ERi, Inc.", + 268: "Transducers Direct, LLC", + 269: "Fujitsu Ten Limited", + 270: "Audi AG", + 271: "HiSilicon Technologies Co., Ltd.", + 272: "Nippon Seiki Co., Ltd.", + 273: "Steelseries ApS", + 274: "vyzybl Inc.", + 275: "Openbrain Technologies, Co., Ltd.", + 276: "Xensr", + 277: "e.solutions", + 278: "1OAK Technologies", + 279: "Wimoto Technologies Inc", + 280: "Radius Networks, Inc.", + 281: "Wize Technology Co., Ltd.", + 282: "Qualcomm Labs, Inc.", + 283: "Aruba Networks", + 284: "Baidu", + 285: "Arendi AG", + 286: "Skoda Auto a.s.", + 287: "Volkswagon AG", + 288: "Porsche AG", + 289: "Sino Wealth Electronic Ltd.", + 290: "AirTurn, Inc.", + 291: "Kinsa, Inc.", + 292: "HID Global", + 293: "SEAT es", + 294: "Promethean Ltd.", + 295: "Salutica Allied Solutions", + 296: "GPSI Group Pty Ltd", + 297: "Nimble Devices Oy", + 298: "Changzhou Yongse Infotech Co., Ltd", + 299: "SportIQ", + 300: "TEMEC Instruments B.V.", + 301: "Sony Corporation", + 302: "ASSA ABLOY", + 303: "Clarion Co., Ltd.", + 304: "Warehouse Innovations", + 305: "Cypress Semiconductor Corporation", + 306: "MADS Inc", + 307: "Blue Maestro Limited", + 308: "Resolution Products, Inc.", + 309: "Airewear LLC", + 310: "Seed Labs, Inc. (formerly ETC sp. z.o.o.)", + 311: "Prestigio Plaza Ltd.", + 312: "NTEO Inc.", + 313: "Focus Systems Corporation", + 314: "Tencent Holdings Limited", + 315: "Allegion", + 316: "Murata Manufacuring Co., Ltd.", + 318: "Nod, Inc.", + 319: "B&B Manufacturing Company", + 320: "Alpine\xA0Electronics\xA0(China)\xA0Co.,\xA0Ltd", + 321: "FedEx Services", + 322: "Grape Systems Inc.", + 323: "Bkon Connect", + 324: "Lintech GmbH", + 325: "Novatel Wireless", + 326: "Ciright", + 327: "Mighty Cast, Inc.", + 328: "Ambimat Electronics", + 329: "Perytons Ltd.", + 330: "Tivoli Audio, LLC", + 331: "Master Lock", + 332: "Mesh-Net Ltd", + 333: "Huizhou Desay SV Automotive CO., LTD.", + 334: "Tangerine, Inc.", + 335: "B&W Group Ltd.", + 336: "Pioneer Corporation", + 337: "OnBeep", + 338: "Vernier Software & Technology", + 339: "ROL Ergo", + 340: "Pebble Technology", + 341: "NETATMO", + 342: "Accumulate AB", + 343: "Anhui Huami Information Technology Co., Ltd.", + 344: "Inmite s.r.o.", + 345: "ChefSteps, Inc.", + 346: "micas AG", + 347: "Biomedical Research Ltd.", + 348: "Pitius Tec S.L.", + 349: "Estimote, Inc.", + 350: "Unikey Technologies, Inc.", + 351: "Timer Cap Co.", + 352: "AwoX", + 353: "yikes", + 354: "MADSGlobal NZ Ltd.", + 355: "PCH International", + 356: "Qingdao Yeelink Information Technology Co., Ltd.", + 357: "Milwaukee Tool (formerly Milwaukee Electric Tools)", + 358: "MISHIK Pte Ltd", + 359: "Bayer HealthCare", + 360: "Spicebox LLC", + 361: "emberlight", + 362: "Cooper-Atkins Corporation", + 363: "Qblinks", + 364: "MYSPHERA", + 365: "LifeScan Inc", + 366: "Volantic AB", + 367: "Podo Labs, Inc", + 368: "Roche Diabetes Care AG", + 369: "Amazon Fulfillment Service", + 370: "Connovate Technology Private Limited", + 371: "Kocomojo, LLC", + 372: "Everykey LLC", + 373: "Dynamic Controls", + 374: "SentriLock", + 375: "I-SYST inc.", + 376: "CASIO COMPUTER CO., LTD.", + 377: "LAPIS Semiconductor Co., Ltd.", + 378: "Telemonitor, Inc.", + 379: "taskit GmbH", + 380: "Daimler AG", + 381: "BatAndCat", + 382: "BluDotz Ltd", + 383: "XTel ApS", + 384: "Gigaset Communications GmbH", + 385: "Gecko Health Innovations, Inc.", + 386: "HOP Ubiquitous", + 387: "To Be Assigned", + 388: "Nectar", + 389: "bel\u2019apps LLC", + 390: "CORE Lighting Ltd", + 391: "Seraphim Sense Ltd", + 392: "Unico RBC", + 393: "Physical Enterprises Inc.", + 394: "Able Trend Technology Limited", + 395: "Konica Minolta, Inc.", + 396: "Wilo SE", + 397: "Extron Design Services", + 398: "Fitbit, Inc.", + 399: "Fireflies Systems", + 400: "Intelletto Technologies Inc.", + 401: "FDK CORPORATION", + 402: "Cloudleaf, Inc", + 403: "Maveric Automation LLC", + 404: "Acoustic Stream Corporation", + 405: "Zuli", + 406: "Paxton Access Ltd", + 407: "WiSilica Inc", + 408: "Vengit Limited", + 409: "SALTO SYSTEMS S.L.", + 410: "TRON Forum (formerly T-Engine Forum)", + 411: "CUBETECH s.r.o.", + 412: "Cokiya Incorporated", + 413: "CVS Health", + 414: "Ceruus", + 415: "Strainstall Ltd", + 416: "Channel Enterprises (HK) Ltd.", + 417: "FIAMM", + 418: "GIGALANE.CO.,LTD", + 419: "EROAD", + 420: "Mine Safety Appliances", + 421: "Icon Health and Fitness", + 422: "Asandoo GmbH", + 423: "ENERGOUS CORPORATION", + 424: "Taobao", + 425: "Canon Inc.", + 426: "Geophysical Technology Inc.", + 427: "Facebook, Inc.", + 428: "Nipro Diagnostics, Inc.", + 429: "FlightSafety International", + 430: "Earlens Corporation", + 431: "Sunrise Micro Devices, Inc.", + 432: "Star Micronics Co., Ltd.", + 433: "Netizens Sp. z o.o.", + 434: "Nymi Inc.", + 435: "Nytec, Inc.", + 436: "Trineo Sp. z o.o.", + 437: "Nest Labs Inc.", + 438: "LM Technologies Ltd", + 439: "General Electric Company", + 440: "i+D3 S.L.", + 441: "HANA Micron", + 442: "Stages Cycling LLC", + 443: "Cochlear Bone Anchored Solutions AB", + 444: "SenionLab AB", + 445: "Syszone Co., Ltd", + 446: "Pulsate Mobile Ltd.", + 447: "Hong Kong HunterSun Electronic Limited", + 448: "pironex GmbH", + 449: "BRADATECH Corp.", + 450: "Transenergooil AG", + 451: "Bunch", + 452: "DME Microelectronics", + 453: "Bitcraze AB", + 454: "HASWARE Inc.", + 455: "Abiogenix Inc.", + 456: "Poly-Control ApS", + 457: "Avi-on", + 458: "Laerdal Medical AS", + 459: "Fetch My Pet", + 460: "Sam Labs Ltd.", + 461: "Chengdu Synwing Technology Ltd", + 462: "HOUWA SYSTEM DESIGN, k.k.", + 463: "BSH", + 464: "Primus Inter Pares Ltd", + 465: "August", + 466: "Gill Electronics", + 467: "Sky Wave Design", + 468: "Newlab S.r.l.", + 469: "ELAD srl", + 470: "G-wearables inc.", + 471: "Squadrone Systems Inc.", + 472: "Code Corporation", + 473: "Savant Systems LLC", + 474: "Logitech International SA", + 475: "Innblue Consulting", + 476: "iParking Ltd.", + 477: "Koninklijke Philips Electronics N.V.", + 478: "Minelab Electronics Pty Limited", + 479: "Bison Group Ltd.", + 480: "Widex A/S", + 481: "Jolla Ltd", + 482: "Lectronix, Inc.", + 483: "Caterpillar Inc", + 484: "Freedom Innovations", + 485: "Dynamic Devices Ltd", + 486: "Technology Solutions (UK) Ltd", + 487: "IPS Group Inc.", + 488: "STIR", + 489: "Sano, Inc", + 490: "Advanced Application Design, Inc.", + 491: "AutoMap LLC", + 492: "Spreadtrum Communications Shanghai Ltd", + 493: "CuteCircuit LTD", + 494: "Valeo Service", + 495: "Fullpower Technologies, Inc.", + 496: "KloudNation", + 497: "Zebra Technologies Corporation", + 498: "Itron, Inc.", + 499: "The University of Tokyo", + 500: "UTC Fire and Security", + 501: "Cool Webthings Limited", + 502: "DJO Global", + 503: "Gelliner Limited", + 504: "Anyka (Guangzhou) Microelectronics Technology Co, LTD", + 505: "Medtronic, Inc.", + 506: "Gozio, Inc.", + 507: "Form Lifting, LLC", + 508: "Wahoo Fitness, LLC", + 509: "Kontakt Micro-Location Sp. z o.o.", + 510: "Radio System Corporation", + 511: "Freescale Semiconductor, Inc.", + 512: "Verifone Systems PTe Ltd. Taiwan Branch", + 513: "AR Timing", + 514: "Rigado LLC", + 515: "Kemppi Oy", + 516: "Tapcentive Inc.", + 517: "Smartbotics Inc.", + 518: "Otter Products, LLC", + 519: "STEMP Inc.", + 520: "LumiGeek LLC", + 521: "InvisionHeart Inc.", + 522: "Macnica Inc. ", + 523: "Jaguar Land Rover Limited", + 524: "CoroWare Technologies, Inc", + 525: "Simplo Technology Co., LTD", + 526: "Omron Healthcare Co., LTD", + 527: "Comodule GMBH", + 528: "ikeGPS", + 529: "Telink Semiconductor Co. Ltd", + 530: "Interplan Co., Ltd", + 531: "Wyler AG", + 532: "IK Multimedia Production srl", + 533: "Lukoton Experience Oy", + 534: "MTI Ltd", + 535: "Tech4home, Lda", + 536: "Hiotech AB", + 537: "DOTT Limited", + 538: "Blue Speck Labs, LLC", + 539: "Cisco Systems, Inc", + 540: "Mobicomm Inc", + 541: "Edamic", + 542: "Goodnet, Ltd", + 543: "Luster Leaf Products Inc", + 544: "Manus Machina BV", + 545: "Mobiquity Networks Inc", + 546: "Praxis Dynamics", + 547: "Philip Morris Products S.A.", + 548: "Comarch SA", + 549: "Nestl Nespresso S.A.", + 550: "Merlinia A/S", + 551: "LifeBEAM Technologies", + 552: "Twocanoes Labs, LLC", + 553: "Muoverti Limited", + 554: "Stamer Musikanlagen GMBH", + 555: "Tesla Motors", + 556: "Pharynks Corporation", + 557: "Lupine", + 558: "Siemens AG", + 559: "Huami (Shanghai) Culture Communication CO., LTD", + 560: "Foster Electric Company, Ltd", + 561: "ETA SA", + 562: "x-Senso Solutions Kft", + 563: "Shenzhen SuLong Communication Ltd", + 564: "FengFan (BeiJing) Technology Co, Ltd", + 565: "Qrio Inc", + 566: "Pitpatpet Ltd", + 567: "MSHeli s.r.l.", + 568: "Trakm8 Ltd", + 569: "JIN CO, Ltd", + 570: "Alatech Tehnology", + 571: "Beijing CarePulse Electronic Technology Co, Ltd", + 572: "Awarepoint", + 573: "ViCentra B.V.", + 574: "Raven Industries", + 575: "WaveWare Technologies Inc.", + 576: "Argenox Technologies", + 577: "Bragi GmbH", + 578: "16Lab Inc", + 579: "Masimo Corp", + 580: "Iotera Inc", + 581: "Endress+Hauser", + 582: "ACKme Networks, Inc.", + 583: "FiftyThree Inc.", + 584: "Parker Hannifin Corp", + 585: "Transcranial Ltd", + 586: "Uwatec AG", + 587: "Orlan LLC", + 588: "Blue Clover Devices", + 589: "M-Way Solutions GmbH", + 590: "Microtronics Engineering GmbH", + 591: "Schneider Schreibgerte GmbH", + 592: "Sapphire Circuits LLC", + 593: "Lumo Bodytech Inc.", + 594: "UKC Technosolution", + 595: "Xicato Inc.", + 596: "Playbrush", + 597: "Dai Nippon Printing Co., Ltd.", + 598: "G24 Power Limited", + 599: "AdBabble Local Commerce Inc.", + 600: "Devialet SA", + 601: "ALTYOR", + 602: "University of Applied Sciences Valais/Haute Ecole Valaisanne", + 603: "Five Interactive, LLC dba Zendo", + 604: "NetEaseHangzhouNetwork co.Ltd.", + 605: "Lexmark International Inc.", + 606: "Fluke Corporation", + 607: "Yardarm Technologies", + 608: "SensaRx", + 609: "SECVRE GmbH", + 610: "Glacial Ridge Technologies", + 611: "Identiv, Inc.", + 612: "DDS, Inc.", + 613: "SMK Corporation", + 614: "Schawbel Technologies LLC", + 615: "XMI Systems SA", + 616: "Cerevo", + 617: "Torrox GmbH & Co KG", + 618: "Gemalto", + 619: "DEKA Research & Development Corp.", + 620: "Domster Tadeusz Szydlowski", + 621: "Technogym SPA", + 622: "FLEURBAEY BVBA", + 623: "Aptcode Solutions", + 624: "LSI ADL Technology", + 625: "Animas Corp", + 626: "Alps Electric Co., Ltd.", + 627: "OCEASOFT", + 628: "Motsai Research", + 629: "Geotab", + 630: "E.G.O. Elektro-Gertebau GmbH", + 631: "bewhere inc", + 632: "Johnson Outdoors Inc", + 633: "steute Schaltgerate GmbH & Co. KG", + 634: "Ekomini inc.", + 635: "DEFA AS", + 636: "Aseptika Ltd", + 637: "HUAWEI Technologies Co., Ltd. ( )", + 638: "HabitAware, LLC", + 639: "ruwido austria gmbh", + 640: "ITEC corporation", + 641: "StoneL", + 642: "Sonova AG", + 643: "Maven Machines, Inc.", + 644: "Synapse Electronics", + 645: "Standard Innovation Inc.", + 646: "RF Code, Inc.", + 647: "Wally Ventures S.L.", + 648: "Willowbank Electronics Ltd", + 649: "SK Telecom", + 650: "Jetro AS", + 651: "Code Gears LTD", + 652: "NANOLINK APS", + 653: "IF, LLC", + 654: "RF Digital Corp", + 655: "Church & Dwight Co., Inc", + 656: "Multibit Oy", + 657: "CliniCloud Inc", + 658: "SwiftSensors", + 659: "Blue Bite", + 660: "ELIAS GmbH", + 661: "Sivantos GmbH", + 662: "Petzl", + 663: "storm power ltd", + 664: "EISST Ltd", + 665: "Inexess Technology Simma KG", + 666: "Currant, Inc.", + 667: "C2 Development, Inc.", + 668: "Blue Sky Scientific, LLC", + 669: "ALOTTAZS LABS, LLC", + 670: "Kupson spol. s r.o.", + 671: "Areus Engineering GmbH", + 672: "Impossible Camera GmbH", + 673: "InventureTrack Systems", + 674: "LockedUp", + 675: "Itude", + 676: "Pacific Lock Company", + 677: "Tendyron Corporation ( )", + 678: "Robert Bosch GmbH", + 679: "Illuxtron international B.V.", + 680: "miSport Ltd.", + 681: "Chargelib", + 682: "Doppler Lab", + 683: "BBPOS Limited", + 684: "RTB Elektronik GmbH & Co. KG", + 685: "Rx Networks, Inc.", + 686: "WeatherFlow, Inc.", + 687: "Technicolor USA Inc.", + 688: "Bestechnic(Shanghai),Ltd", + 689: "Raden Inc", + 690: "JouZen Oy", + 691: "CLABER S.P.A.", + 692: "Hyginex, Inc.", + 693: "HANSHIN ELECTRIC RAILWAY CO.,LTD.", + 694: "Schneider Electric", + 695: "Oort Technologies LLC", + 696: "Chrono Therapeutics", + 697: "Rinnai Corporation", + 698: "Swissprime Technologies AG", + 699: "Koha.,Co.Ltd", + 700: "Genevac Ltd", + 701: "Chemtronics", + 702: "Seguro Technology Sp. z o.o.", + 703: "Redbird Flight Simulations", + 704: "Dash Robotics", + 705: "LINE Corporation", + 706: "Guillemot Corporation", + 707: "Techtronic Power Tools Technology Limited", + 708: "Wilson Sporting Goods", + 709: "Lenovo (Singapore) Pte Ltd. ( )", + 710: "Ayatan Sensors", + 711: "Electronics Tomorrow Limited", + 712: "VASCO Data Security International, Inc.", + 713: "PayRange Inc.", + 714: "ABOV Semiconductor", + 715: "AINA-Wireless Inc.", + 716: "Eijkelkamp Soil & Water", + 717: "BMA ergonomics b.v.", + 718: "Teva Branded Pharmaceutical Products R&D, Inc.", + 719: "Anima", + 720: "3M", + 721: "Empatica Srl", + 722: "Afero, Inc.", + 723: "Powercast Corporation", + 724: "Secuyou ApS", + 725: "OMRON Corporation", + 726: "Send Solutions", + 727: "NIPPON SYSTEMWARE CO.,LTD.", + 728: "Neosfar", + 729: "Fliegl Agrartechnik GmbH", + 730: "Gilvader", + 731: "Digi International Inc (R)", + 732: "DeWalch Technologies, Inc.", + 733: "Flint Rehabilitation Devices, LLC", + 734: "Samsung SDS Co., Ltd.", + 735: "Blur Product Development", + 736: "University of Michigan", + 737: "Victron Energy BV", + 738: "NTT docomo", + 739: "Carmanah Technologies Corp.", + 740: "Bytestorm Ltd.", + 741: "Espressif Incorporated ( () )", + 742: "Unwire", + 743: "Connected Yard, Inc.", + 744: "American Music Environments", + 745: "Sensogram Technologies, Inc.", + 746: "Fujitsu Limited", + 747: "Ardic Technology", + 748: "Delta Systems, Inc", + 749: "HTC Corporation", + 750: "Citizen Holdings Co., Ltd.", + 751: "SMART-INNOVATION.inc", + 752: "Blackrat Software", + 753: "The Idea Cave, LLC", + 754: "GoPro, Inc.", + 755: "AuthAir, Inc", + 756: "Vensi, Inc.", + 757: "Indagem Tech LLC", + 758: "Intemo Technologies", + 759: "DreamVisions co., Ltd.", + 760: "Runteq Oy Ltd", + 761: "IMAGINATION TECHNOLOGIES LTD", + 762: "CoSTAR TEchnologies", + 763: "Clarius Mobile Health Corp.", + 764: "Shanghai Frequen Microelectronics Co., Ltd.", + 765: "Uwanna, Inc.", + 766: "Lierda Science & Technology Group Co., Ltd.", + 767: "Silicon Laboratories", + 768: "World Moto Inc.", + 769: "Giatec Scientific Inc.", + 770: "Loop Devices, Inc", + 771: "IACA electronique", + 772: "Martians Inc", + 773: "Swipp ApS", + 774: "Life Laboratory Inc.", + 775: "FUJI INDUSTRIAL CO.,LTD.", + 776: "Surefire, LLC", + 777: "Dolby Labs", + 778: "Ellisys", + 779: "Magnitude Lighting Converters", + 780: "Hilti AG", + 781: "Devdata S.r.l.", + 782: "Deviceworx", + 783: "Shortcut Labs", + 784: "SGL Italia S.r.l.", + 785: "PEEQ DATA", + 786: "Ducere Technologies Pvt Ltd", + 787: "DiveNav, Inc.", + 788: "RIIG AI Sp. z o.o.", + 789: "Thermo Fisher Scientific", + 790: "AG Measurematics Pvt. Ltd.", + 791: "CHUO Electronics CO., LTD.", + 792: "Aspenta International", + 793: "Eugster Frismag AG", + 794: "Amber wireless GmbH", + 795: "HQ Inc", + 796: "Lab Sensor Solutions", + 797: "Enterlab ApS", + 798: "Eyefi, Inc.", + 799: "MetaSystem S.p.A.", + 800: "SONO ELECTRONICS. CO., LTD", + 801: "Jewelbots", + 802: "Compumedics Limited", + 803: "Rotor Bike Components", + 804: "Astro, Inc.", + 805: "Amotus Solutions", + 806: "Healthwear Technologies (Changzhou)Ltd", + 807: "Essex Electronics", + 808: "Grundfos A/S", + 809: "Eargo, Inc.", + 810: "Electronic Design Lab", + 811: "ESYLUX", + 812: "NIPPON SMT.CO.,Ltd", + 813: "BM innovations GmbH", + 814: "indoormap", + 815: "OttoQ Inc", + 816: "North Pole Engineering", + 817: "3flares Technologies Inc.", + 818: "Electrocompaniet A.S.", + 819: "Mul-T-Lock", + 820: "Corentium AS", + 821: "Enlighted Inc", + 822: "GISTIC", + 823: "AJP2 Holdings, LLC", + 824: "COBI GmbH", + 825: "Blue Sky Scientific, LLC", + 826: "Appception, Inc.", + 827: "Courtney Thorne Limited", + 828: "Virtuosys", + 829: "TPV Technology Limited", + 830: "Monitra SA", + 831: "Automation Components, Inc.", + 832: "Letsense s.r.l.", + 833: "Etesian Technologies LLC", + 834: "GERTEC BRASIL LTDA.", + 835: "Drekker Development Pty. Ltd.", + 836: "Whirl Inc", + 837: "Locus Positioning", + 838: "Acuity Brands Lighting, Inc", + 839: "Prevent Biometrics", + 840: "Arioneo", + 841: "VersaMe", + 842: "Vaddio", + 843: "Libratone A/S", + 844: "HM Electronics, Inc.", + 845: "TASER International, Inc.", + 846: "SafeTrust Inc.", + 847: "Heartland Payment Systems", + 848: "Bitstrata Systems Inc.", + 849: "Pieps GmbH", + 850: "iRiding(Xiamen)Technology Co.,Ltd.", + 851: "Alpha Audiotronics, Inc.", + 852: "TOPPAN FORMS CO.,LTD.", + 853: "Sigma Designs, Inc.", + 854: "Spectrum Brands, Inc.", + 855: "Polymap Wireless", + 856: "MagniWare Ltd.", + 857: "Novotec Medical GmbH", + 858: "Medicom Innovation Partner a/s", + 859: "Matrix Inc.", + 860: "Eaton Corporation", + 861: "KYS", + 862: "Naya Health, Inc.", + 863: "Acromag", + 864: "Insulet Corporation", + 865: "Wellinks Inc.", + 866: "ON Semiconductor", + 867: "FREELAP SA", + 868: "Favero Electronics Srl", + 869: "BioMech Sensor LLC", + 870: "BOLTT Sports technologies Private limited", + 871: "Saphe International", + 872: "Metormote AB", + 873: "littleBits", + 874: "SetPoint Medical", + 875: "BRControls Products BV", + 876: "Zipcar", + 877: "AirBolt Pty Ltd", + 878: "KeepTruckin Inc", + 879: "Motiv, Inc.", + 880: "Wazombi Labs O", + 881: "ORBCOMM", + 882: "Nixie Labs, Inc.", + 883: "AppNearMe Ltd", + 884: "Holman Industries", + 885: "Expain AS", + 886: "Electronic Temperature Instruments Ltd", + 887: "Plejd AB", + 888: "Propeller Health", + 889: "Shenzhen iMCO Electronic Technology Co.,Ltd", + 890: "Algoria", + 891: "Apption Labs Inc.", + 892: "Cronologics Corporation", + 893: "MICRODIA Ltd.", + 894: "lulabytes S.L.", + 895: "Nestec S.A.", + 896: "LLC MEGA - F service", + 897: "Sharp Corporation", + 898: "Precision Outcomes Ltd", + 899: "Kronos Incorporated", + 900: "OCOSMOS Co., Ltd.", + 901: "Embedded Electronic Solutions Ltd. dba e2Solutions", + 902: "Aterica Inc.", + 903: "BluStor PMC, Inc.", + 904: "Kapsch TrafficCom AB", + 905: "ActiveBlu Corporation", + 906: "Kohler Mira Limited", + 907: "Noke", + 908: "Appion Inc.", + 909: "Resmed Ltd", + 910: "Crownstone B.V.", + 911: "Xiaomi Inc.", + 912: "INFOTECH s.r.o.", + 913: "Thingsquare AB", + 914: "T&D", + 915: "LAVAZZA S.p.A.", + 916: "Netclearance Systems, Inc.", + 917: "SDATAWAY", + 918: "BLOKS GmbH", + 919: "LEGO System A/S", + 920: "Thetatronics Ltd", + 921: "Nikon Corporation", + 922: "NeST", + 923: "South Silicon Valley Microelectronics", + 924: "ALE International", + 925: "CareView Communications, Inc.", + 926: "SchoolBoard Limited", + 927: "Molex Corporation", + 928: "IVT Wireless Limited", + 929: "Alpine Labs LLC", + 930: "Candura Instruments", + 931: "SmartMovt Technology Co., Ltd", + 932: "Token Zero Ltd", + 933: "ACE CAD Enterprise Co., Ltd. (ACECAD)", + 934: "Medela, Inc", + 935: "AeroScout", + 936: "Esrille Inc.", + 937: "THINKERLY SRL", + 938: "Exon Sp. z o.o.", + 939: "Meizu Technology Co., Ltd.", + 940: "Smablo LTD", + 941: "XiQ", + 942: "Allswell Inc.", + 943: "Comm-N-Sense Corp DBA Verigo", + 944: "VIBRADORM GmbH", + 945: "Otodata Wireless Network Inc.", + 946: "Propagation Systems Limited", + 947: "Midwest Instruments & Controls", + 948: "Alpha Nodus, inc.", + 949: "petPOMM, Inc", + 950: "Mattel", + 951: "Airbly Inc.", + 952: "A-Safe Limited", + 953: "FREDERIQUE CONSTANT SA", + 954: "Maxscend Microelectronics Company Limited", + 955: "Abbott Diabetes Care", + 956: "ASB Bank Ltd", + 957: "amadas", + 958: "Applied Science, Inc.", + 959: "iLumi Solutions Inc.", + 960: "Arch Systems Inc.", + 961: "Ember Technologies, Inc.", + 962: "Snapchat Inc", + 963: "Casambi Technologies Oy", + 964: "Pico Technology Inc.", + 965: "St. Jude Medical, Inc.", + 966: "Intricon", + 967: "Structural Health Systems, Inc.", + 968: "Avvel International", + 969: "Gallagher Group", + 970: "In2things Automation Pvt. Ltd.", + 971: "SYSDEV Srl", + 972: "Vonkil Technologies Ltd", + 973: "Wynd Technologies, Inc.", + 974: "CONTRINEX S.A.", + 975: "MIRA, Inc.", + 976: "Watteam Ltd", + 977: "Density Inc.", + 978: "IOT Pot India Private Limited", + 979: "Sigma Connectivity AB", + 980: "PEG PEREGO SPA", + 981: "Wyzelink Systems Inc.", + 982: "Yota Devices LTD", + 983: "FINSECUR", + 984: "Zen-Me Labs Ltd", + 985: "3IWare Co., Ltd.", + 986: "EnOcean GmbH", + 987: "Instabeat, Inc", + 988: "Nima Labs", + 989: "Andreas Stihl AG & Co. KG", + 990: "Nathan Rhoades LLC", + 991: "Grob Technologies, LLC", + 992: "Actions (Zhuhai) Technology Co., Limited", + 993: "SPD Development Company Ltd", + 994: "Sensoan Oy", + 995: "Qualcomm Life Inc", + 996: "Chip-ing AG", + 997: "ffly4u", + 998: "IoT Instruments Oy", + 999: "TRUE Fitness Technology", + 1e3: "Reiner Kartengeraete GmbH & Co. KG.", + 1001: "SHENZHEN LEMONJOY TECHNOLOGY CO., LTD.", + 1002: "Hello Inc.", + 1003: "Evollve Inc.", + 1004: "Jigowatts Inc.", + 1005: "BASIC MICRO.COM,INC.", + 1006: "CUBE TECHNOLOGIES", + 1007: "foolography GmbH", + 1008: "CLINK", + 1009: "Hestan Smart Cooking Inc.", + 1010: "WindowMaster A/S", + 1011: "Flowscape AB", + 1012: "PAL Technologies Ltd", + 1013: "WHERE, Inc.", + 1014: "Iton Technology Corp.", + 1015: "Owl Labs Inc.", + 1016: "Rockford Corp.", + 1017: "Becon Technologies Co.,Ltd.", + 1018: "Vyassoft Technologies Inc", + 1019: "Nox Medical", + 1020: "Kimberly-Clark", + 1021: "Trimble Navigation Ltd.", + 1022: "Littelfuse", + 1023: "Withings", + 1024: "i-developer IT Beratung UG", + 1026: "Sears Holdings Corporation", + 1027: "Gantner Electronic GmbH", + 1028: "Authomate Inc", + 1029: "Vertex International, Inc.", + 1030: "Airtago", + 1031: "Swiss Audio SA", + 1032: "ToGetHome Inc.", + 1033: "AXIS", + 1034: "Openmatics", + 1035: "Jana Care Inc.", + 1036: "Senix Corporation", + 1037: "NorthStar Battery Company, LLC", + 1038: "SKF (U.K.) Limited", + 1039: "CO-AX Technology, Inc.", + 1040: "Fender Musical Instruments", + 1041: "Luidia Inc", + 1042: "SEFAM", + 1043: "Wireless Cables Inc", + 1044: "Lightning Protection International Pty Ltd", + 1045: "Uber Technologies Inc", + 1046: "SODA GmbH", + 1047: "Fatigue Science", + 1048: "Alpine Electronics Inc.", + 1049: "Novalogy LTD", + 1050: "Friday Labs Limited", + 1051: "OrthoAccel Technologies", + 1052: "WaterGuru, Inc.", + 1053: "Benning Elektrotechnik und Elektronik GmbH & Co. KG", + 1054: "Dell Computer Corporation", + 1055: "Kopin Corporation", + 1056: "TecBakery GmbH", + 1057: "Backbone Labs, Inc.", + 1058: "DELSEY SA", + 1059: "Chargifi Limited", + 1060: "Trainesense Ltd.", + 1061: "Unify Software and Solutions GmbH & Co. KG", + 1062: "Husqvarna AB", + 1063: "Focus fleet and fuel management inc", + 1064: "SmallLoop, LLC", + 1065: "Prolon Inc.", + 1066: "BD Medical", + 1067: "iMicroMed Incorporated", + 1068: "Ticto N.V.", + 1069: "Meshtech AS", + 1070: "MemCachier Inc.", + 1071: "Danfoss A/S", + 1072: "SnapStyk Inc.", + 1073: "Amyway Corporation", + 1074: "Silk Labs, Inc.", + 1075: "Pillsy Inc.", + 1076: "Hatch Baby, Inc.", + 1077: "Blocks Wearables Ltd.", + 1078: "Drayson Technologies (Europe) Limited", + 1079: "eBest IOT Inc.", + 1080: "Helvar Ltd", + 1081: "Radiance Technologies", + 1082: "Nuheara Limited", + 1083: "Appside co., ltd.", + 1084: "DeLaval", + 1085: "Coiler Corporation", + 1086: "Thermomedics, Inc.", + 1087: "Tentacle Sync GmbH", + 1088: "Valencell, Inc.", + 1089: "iProtoXi Oy", + 1090: "SECOM CO., LTD.", + 1091: "Tucker International LLC", + 1092: "Metanate Limited", + 1093: "Kobian Canada Inc.", + 1094: "NETGEAR, Inc.", + 1095: "Fabtronics Australia Pty Ltd", + 1096: "Grand Centrix GmbH", + 1097: "1UP USA.com llc", + 1098: "SHIMANO INC.", + 1099: "Nain Inc.", + 1100: "LifeStyle Lock, LLC", + 1101: "VEGA Grieshaber KG", + 1102: "Xtrava Inc.", + 1103: "TTS Tooltechnic Systems AG & Co. KG", + 1104: "Teenage Engineering AB", + 1105: "Tunstall Nordic AB", + 1106: "Svep Design Center AB", + 1107: "GreenPeak Technologies BV", + 1108: "Sphinx Electronics GmbH & Co KG", + 1109: "Atomation", + 1110: "Nemik Consulting Inc", + 1111: "RF INNOVATION", + 1112: "Mini Solution Co., Ltd.", + 1113: "Lumenetix, Inc", + 1114: "2048450 Ontario Inc", + 1115: "SPACEEK LTD", + 1116: "Delta T Corporation", + 1117: "Boston Scientific Corporation", + 1118: "Nuviz, Inc.", + 1119: "Real Time Automation, Inc.", + 1120: "Kolibree", + 1121: "vhf elektronik GmbH", + 1122: "Bonsai Systems GmbH", + 1123: "Fathom Systems Inc.", + 1124: "Bellman & Symfon", + 1125: "International Forte Group LLC", + 1126: "CycleLabs Solutions inc.", + 1127: "Codenex Oy", + 1128: "Kynesim Ltd", + 1129: "Palago AB", + 1130: "INSIGMA INC.", + 1131: "PMD Solutions", + 1132: "Qingdao Realtime Technology Co., Ltd.", + 1133: "BEGA Gantenbrink-Leuchten KG", + 1134: "Pambor Ltd.", + 65535: "SPECIAL USE/DEFAULT" + }; + } +}); + +// node_modules/systeminformation/lib/bluetooth.js +var require_bluetooth = __commonJS({ + "node_modules/systeminformation/lib/bluetooth.js"(exports) { + "use strict"; + var exec2 = require("child_process").exec; + var execSync = require("child_process").execSync; + var path = require("path"); + var util = require_util2(); + var bluetoothVendors = require_bluetoothVendors(); + var fs = require("fs"); + var _platform = process.platform; + var _linux = _platform === "linux" || _platform === "android"; + var _darwin = _platform === "darwin"; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + function parseBluetoothType(str) { + let result2 = ""; + if (str.indexOf("keyboard") >= 0) { + result2 = "Keyboard"; + } + if (str.indexOf("mouse") >= 0) { + result2 = "Mouse"; + } + if (str.indexOf("trackpad") >= 0) { + result2 = "Trackpad"; + } + if (str.indexOf("speaker") >= 0) { + result2 = "Speaker"; + } + if (str.indexOf("headset") >= 0) { + result2 = "Headset"; + } + if (str.indexOf("phone") >= 0) { + result2 = "Phone"; + } + if (str.indexOf("macbook") >= 0) { + result2 = "Computer"; + } + if (str.indexOf("imac") >= 0) { + result2 = "Computer"; + } + if (str.indexOf("ipad") >= 0) { + result2 = "Tablet"; + } + if (str.indexOf("watch") >= 0) { + result2 = "Watch"; + } + if (str.indexOf("headphone") >= 0) { + result2 = "Headset"; + } + return result2; + } + function parseBluetoothManufacturer(str) { + let result2 = str.split(" ")[0]; + str = str.toLowerCase(); + if (str.indexOf("apple") >= 0) { + result2 = "Apple"; + } + if (str.indexOf("ipad") >= 0) { + result2 = "Apple"; + } + if (str.indexOf("imac") >= 0) { + result2 = "Apple"; + } + if (str.indexOf("iphone") >= 0) { + result2 = "Apple"; + } + if (str.indexOf("magic mouse") >= 0) { + result2 = "Apple"; + } + if (str.indexOf("magic track") >= 0) { + result2 = "Apple"; + } + if (str.indexOf("macbook") >= 0) { + result2 = "Apple"; + } + return result2; + } + function parseBluetoothVendor(str) { + const id = parseInt(str); + if (!isNaN(id)) + return bluetoothVendors[id]; + } + function parseLinuxBluetoothInfo(lines, macAddr1, macAddr2) { + const result2 = {}; + result2.device = null; + result2.name = util.getValue(lines, "name", "="); + result2.manufacturer = null; + result2.macDevice = macAddr1; + result2.macHost = macAddr2; + result2.batteryPercent = null; + result2.type = parseBluetoothType(result2.name.toLowerCase()); + result2.connected = false; + return result2; + } + function parseDarwinBluetoothDevices(bluetoothObject, macAddr2) { + const result2 = {}; + const typeStr = ((bluetoothObject.device_minorClassOfDevice_string || bluetoothObject.device_majorClassOfDevice_string || bluetoothObject.device_minorType || "") + (bluetoothObject.device_name || "")).toLowerCase(); + result2.device = bluetoothObject.device_services || ""; + result2.name = bluetoothObject.device_name || ""; + result2.manufacturer = bluetoothObject.device_manufacturer || parseBluetoothVendor(bluetoothObject.device_vendorID) || parseBluetoothManufacturer(bluetoothObject.device_name || "") || ""; + result2.macDevice = (bluetoothObject.device_addr || bluetoothObject.device_address || "").toLowerCase().replace(/-/g, ":"); + result2.macHost = macAddr2; + result2.batteryPercent = bluetoothObject.device_batteryPercent || null; + result2.type = parseBluetoothType(typeStr); + result2.connected = bluetoothObject.device_isconnected === "attrib_Yes" || false; + return result2; + } + function parseWindowsBluetooth(lines) { + const result2 = {}; + result2.device = null; + result2.name = util.getValue(lines, "name", ":"); + result2.manufacturer = util.getValue(lines, "manufacturer", ":"); + result2.macDevice = null; + result2.macHost = null; + result2.batteryPercent = null; + result2.type = parseBluetoothType(result2.name.toLowerCase()); + result2.connected = null; + return result2; + } + function bluetoothDevices(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let result2 = []; + if (_linux) { + const btFiles = util.getFilesInPath("/var/lib/bluetooth/"); + btFiles.forEach((element) => { + const filename = path.basename(element); + const pathParts = element.split("/"); + const macAddr1 = pathParts.length >= 6 ? pathParts[pathParts.length - 2] : null; + const macAddr2 = pathParts.length >= 7 ? pathParts[pathParts.length - 3] : null; + if (filename === "info") { + const infoFile = fs.readFileSync(element, { encoding: "utf8" }).split("\n"); + result2.push(parseLinuxBluetoothInfo(infoFile, macAddr1, macAddr2)); + } + }); + try { + const hdicon = execSync("hcitool con", util.execOptsLinux).toString().toLowerCase(); + for (let i = 0; i < result2.length; i++) { + if (result2[i].macDevice && result2[i].macDevice.length > 10 && hdicon.indexOf(result2[i].macDevice.toLowerCase()) >= 0) { + result2[i].connected = true; + } + } + } catch (e) { + util.noop(); + } + if (callback) { + callback(result2); + } + resolve(result2); + } + if (_darwin) { + let cmd = "system_profiler SPBluetoothDataType -json"; + exec2(cmd, function(error, stdout) { + if (!error) { + try { + const outObj = JSON.parse(stdout.toString()); + if (outObj.SPBluetoothDataType && outObj.SPBluetoothDataType.length && outObj.SPBluetoothDataType[0] && outObj.SPBluetoothDataType[0]["device_title"] && outObj.SPBluetoothDataType[0]["device_title"].length) { + let macAddr2 = null; + if (outObj.SPBluetoothDataType[0]["local_device_title"] && outObj.SPBluetoothDataType[0].local_device_title.general_address) { + macAddr2 = outObj.SPBluetoothDataType[0].local_device_title.general_address.toLowerCase().replace(/-/g, ":"); + } + outObj.SPBluetoothDataType[0]["device_title"].forEach((element) => { + const obj = element; + const objKey = Object.keys(obj); + if (objKey && objKey.length === 1) { + const innerObject = obj[objKey[0]]; + innerObject.device_name = objKey[0]; + const bluetoothDevice = parseDarwinBluetoothDevices(innerObject, macAddr2); + result2.push(bluetoothDevice); + } + }); + } + if (outObj.SPBluetoothDataType && outObj.SPBluetoothDataType.length && outObj.SPBluetoothDataType[0] && outObj.SPBluetoothDataType[0]["device_connected"] && outObj.SPBluetoothDataType[0]["device_connected"].length) { + const macAddr2 = outObj.SPBluetoothDataType[0].controller_properties && outObj.SPBluetoothDataType[0].controller_properties.controller_address ? outObj.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g, ":") : null; + outObj.SPBluetoothDataType[0]["device_connected"].forEach((element) => { + const obj = element; + const objKey = Object.keys(obj); + if (objKey && objKey.length === 1) { + const innerObject = obj[objKey[0]]; + innerObject.device_name = objKey[0]; + innerObject.device_isconnected = "attrib_Yes"; + const bluetoothDevice = parseDarwinBluetoothDevices(innerObject, macAddr2); + result2.push(bluetoothDevice); + } + }); + } + if (outObj.SPBluetoothDataType && outObj.SPBluetoothDataType.length && outObj.SPBluetoothDataType[0] && outObj.SPBluetoothDataType[0]["device_not_connected"] && outObj.SPBluetoothDataType[0]["device_not_connected"].length) { + const macAddr2 = outObj.SPBluetoothDataType[0].controller_properties && outObj.SPBluetoothDataType[0].controller_properties.controller_address ? outObj.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g, ":") : null; + outObj.SPBluetoothDataType[0]["device_not_connected"].forEach((element) => { + const obj = element; + const objKey = Object.keys(obj); + if (objKey && objKey.length === 1) { + const innerObject = obj[objKey[0]]; + innerObject.device_name = objKey[0]; + innerObject.device_isconnected = "attrib_No"; + const bluetoothDevice = parseDarwinBluetoothDevices(innerObject, macAddr2); + result2.push(bluetoothDevice); + } + }); + } + } catch (e) { + util.noop(); + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_windows) { + util.powerShell("Get-CimInstance Win32_PNPEntity | select PNPClass, Name, Manufacturer | fl").then((stdout, error) => { + if (!error) { + const parts = stdout.toString().split(/\n\s*\n/); + parts.forEach((part) => { + if (util.getValue(part.split("\n"), "PNPClass", ":") === "Bluetooth") { + result2.push(parseWindowsBluetooth(part.split("\n"))); + } + }); + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + } + if (_freebsd || _netbsd || _openbsd || _sunos) { + resolve(null); + } + }); + }); + } + exports.bluetoothDevices = bluetoothDevices; + } +}); + +// node_modules/systeminformation/lib/index.js +var require_lib2 = __commonJS({ + "node_modules/systeminformation/lib/index.js"(exports) { + "use strict"; + var lib_version = require_package2().version; + var util = require_util2(); + var system = require_system(); + var osInfo = require_osinfo(); + var cpu = require_cpu(); + var memory = require_memory(); + var battery = require_battery(); + var graphics = require_graphics(); + var filesystem = require_filesystem(); + var network = require_network(); + var wifi = require_wifi(); + var processes = require_processes(); + var users = require_users(); + var internet = require_internet(); + var docker = require_docker(); + var vbox = require_virtualbox(); + var printer = require_printer(); + var usb = require_usb(); + var audio = require_audio(); + var bluetooth = require_bluetooth(); + var _platform = process.platform; + var _windows = _platform === "win32"; + var _freebsd = _platform === "freebsd"; + var _openbsd = _platform === "openbsd"; + var _netbsd = _platform === "netbsd"; + var _sunos = _platform === "sunos"; + if (_windows) { + util.getCodepage(); + util.getPowershell(); + } + function version() { + return lib_version; + } + function getStaticData(callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let data = {}; + data.version = version(); + Promise.all([ + system.system(), + system.bios(), + system.baseboard(), + system.chassis(), + osInfo.osInfo(), + osInfo.uuid(), + osInfo.versions(), + cpu.cpu(), + cpu.cpuFlags(), + graphics.graphics(), + network.networkInterfaces(), + memory.memLayout(), + filesystem.diskLayout() + ]).then((res) => { + data.system = res[0]; + data.bios = res[1]; + data.baseboard = res[2]; + data.chassis = res[3]; + data.os = res[4]; + data.uuid = res[5]; + data.versions = res[6]; + data.cpu = res[7]; + data.cpu.flags = res[8]; + data.graphics = res[9]; + data.net = res[10]; + data.memLayout = res[11]; + data.diskLayout = res[12]; + if (callback) { + callback(data); + } + resolve(data); + }); + }); + }); + } + function getDynamicData(srv, iface, callback) { + if (util.isFunction(iface)) { + callback = iface; + iface = ""; + } + if (util.isFunction(srv)) { + callback = srv; + srv = ""; + } + return new Promise((resolve) => { + process.nextTick(() => { + iface = iface || network.getDefaultNetworkInterface(); + srv = srv || ""; + let functionProcessed = function() { + let totalFunctions = 15; + if (_windows) { + totalFunctions = 13; + } + if (_freebsd || _openbsd || _netbsd) { + totalFunctions = 11; + } + if (_sunos) { + totalFunctions = 6; + } + return function() { + if (--totalFunctions === 0) { + if (callback) { + callback(data); + } + resolve(data); + } + }; + }(); + let data = {}; + data.time = osInfo.time(); + data.node = process.versions.node; + data.v8 = process.versions.v8; + cpu.cpuCurrentSpeed().then((res) => { + data.cpuCurrentSpeed = res; + functionProcessed(); + }); + users.users().then((res) => { + data.users = res; + functionProcessed(); + }); + processes.processes().then((res) => { + data.processes = res; + functionProcessed(); + }); + cpu.currentLoad().then((res) => { + data.currentLoad = res; + functionProcessed(); + }); + if (!_sunos) { + cpu.cpuTemperature().then((res) => { + data.temp = res; + functionProcessed(); + }); + } + if (!_openbsd && !_freebsd && !_netbsd && !_sunos) { + network.networkStats(iface).then((res) => { + data.networkStats = res; + functionProcessed(); + }); + } + if (!_sunos) { + network.networkConnections().then((res) => { + data.networkConnections = res; + functionProcessed(); + }); + } + memory.mem().then((res) => { + data.mem = res; + functionProcessed(); + }); + if (!_sunos) { + battery().then((res) => { + data.battery = res; + functionProcessed(); + }); + } + if (!_sunos) { + processes.services(srv).then((res) => { + data.services = res; + functionProcessed(); + }); + } + if (!_sunos) { + filesystem.fsSize().then((res) => { + data.fsSize = res; + functionProcessed(); + }); + } + if (!_windows && !_openbsd && !_freebsd && !_netbsd && !_sunos) { + filesystem.fsStats().then((res) => { + data.fsStats = res; + functionProcessed(); + }); + } + if (!_windows && !_openbsd && !_freebsd && !_netbsd && !_sunos) { + filesystem.disksIO().then((res) => { + data.disksIO = res; + functionProcessed(); + }); + } + if (!_openbsd && !_freebsd && !_netbsd && !_sunos) { + wifi.wifiNetworks().then((res) => { + data.wifiNetworks = res; + functionProcessed(); + }); + } + internet.inetLatency().then((res) => { + data.inetLatency = res; + functionProcessed(); + }); + }); + }); + } + function getAllData(srv, iface, callback) { + return new Promise((resolve) => { + process.nextTick(() => { + let data = {}; + if (iface && util.isFunction(iface) && !callback) { + callback = iface; + iface = ""; + } + if (srv && util.isFunction(srv) && !iface && !callback) { + callback = srv; + srv = ""; + iface = ""; + } + getStaticData().then((res) => { + data = res; + getDynamicData(srv, iface).then((res2) => { + for (let key in res2) { + if ({}.hasOwnProperty.call(res2, key)) { + data[key] = res2[key]; + } + } + if (callback) { + callback(data); + } + resolve(data); + }); + }); + }); + }); + } + function get(valueObject, callback) { + return new Promise((resolve) => { + process.nextTick(() => { + const allPromises = Object.keys(valueObject).filter((func) => ({}).hasOwnProperty.call(exports, func)).map((func) => { + const params = valueObject[func].substring(valueObject[func].lastIndexOf("(") + 1, valueObject[func].lastIndexOf(")")); + let funcWithoutParams = func.indexOf(")") >= 0 ? func.split(")")[1].trim() : func; + funcWithoutParams = func.indexOf("|") >= 0 ? func.split("|")[0].trim() : funcWithoutParams; + if (params) { + return exports[funcWithoutParams](params); + } else { + return exports[funcWithoutParams](""); + } + }); + Promise.all(allPromises).then((data) => { + const result2 = {}; + let i = 0; + for (let key in valueObject) { + if ({}.hasOwnProperty.call(valueObject, key) && {}.hasOwnProperty.call(exports, key) && data.length > i) { + if (valueObject[key] === "*" || valueObject[key] === "all") { + result2[key] = data[i]; + } else { + let keys = valueObject[key]; + let filter = ""; + let filterParts = []; + if (keys.indexOf(")") >= 0) { + keys = keys.split(")")[1].trim(); + } + if (keys.indexOf("|") >= 0) { + filter = keys.split("|")[1].trim(); + filterParts = filter.split(":"); + keys = keys.split("|")[0].trim(); + } + keys = keys.replace(/,/g, " ").replace(/ +/g, " ").split(" "); + if (data[i]) { + if (Array.isArray(data[i])) { + const partialArray = []; + data[i].forEach((element) => { + let partialRes = {}; + if (keys.length === 1 && (keys[0] === "*" || keys[0] === "all")) { + partialRes = element; + } else { + keys.forEach((k) => { + if ({}.hasOwnProperty.call(element, k)) { + partialRes[k] = element[k]; + } + }); + } + if (filter && filterParts.length === 2) { + if ({}.hasOwnProperty.call(partialRes, filterParts[0].trim())) { + const val = partialRes[filterParts[0].trim()]; + if (typeof val == "number") { + if (val === parseFloat(filterParts[1].trim())) { + partialArray.push(partialRes); + } + } else if (typeof val == "string") { + if (val.toLowerCase() === filterParts[1].trim().toLowerCase()) { + partialArray.push(partialRes); + } + } + } + } else { + partialArray.push(partialRes); + } + }); + result2[key] = partialArray; + } else { + const partialRes = {}; + keys.forEach((k) => { + if ({}.hasOwnProperty.call(data[i], k)) { + partialRes[k] = data[i][k]; + } + }); + result2[key] = partialRes; + } + } else { + result2[key] = {}; + } + } + i++; + } + } + if (callback) { + callback(result2); + } + resolve(result2); + }); + }); + }); + } + function observe(valueObject, interval, callback) { + let _data = null; + const result2 = setInterval(() => { + get(valueObject).then((data) => { + if (JSON.stringify(_data) !== JSON.stringify(data)) { + _data = Object.assign({}, data); + callback(data); + } + }); + }, interval); + return result2; + } + exports.version = version; + exports.system = system.system; + exports.bios = system.bios; + exports.baseboard = system.baseboard; + exports.chassis = system.chassis; + exports.time = osInfo.time; + exports.osInfo = osInfo.osInfo; + exports.versions = osInfo.versions; + exports.shell = osInfo.shell; + exports.uuid = osInfo.uuid; + exports.cpu = cpu.cpu; + exports.cpuFlags = cpu.cpuFlags; + exports.cpuCache = cpu.cpuCache; + exports.cpuCurrentSpeed = cpu.cpuCurrentSpeed; + exports.cpuTemperature = cpu.cpuTemperature; + exports.currentLoad = cpu.currentLoad; + exports.fullLoad = cpu.fullLoad; + exports.mem = memory.mem; + exports.memLayout = memory.memLayout; + exports.battery = battery; + exports.graphics = graphics.graphics; + exports.fsSize = filesystem.fsSize; + exports.fsOpenFiles = filesystem.fsOpenFiles; + exports.blockDevices = filesystem.blockDevices; + exports.fsStats = filesystem.fsStats; + exports.disksIO = filesystem.disksIO; + exports.diskLayout = filesystem.diskLayout; + exports.networkInterfaceDefault = network.networkInterfaceDefault; + exports.networkGatewayDefault = network.networkGatewayDefault; + exports.networkInterfaces = network.networkInterfaces; + exports.networkStats = network.networkStats; + exports.networkConnections = network.networkConnections; + exports.wifiNetworks = wifi.wifiNetworks; + exports.wifiInterfaces = wifi.wifiInterfaces; + exports.wifiConnections = wifi.wifiConnections; + exports.services = processes.services; + exports.processes = processes.processes; + exports.processLoad = processes.processLoad; + exports.users = users.users; + exports.inetChecksite = internet.inetChecksite; + exports.inetLatency = internet.inetLatency; + exports.dockerInfo = docker.dockerInfo; + exports.dockerImages = docker.dockerImages; + exports.dockerContainers = docker.dockerContainers; + exports.dockerContainerStats = docker.dockerContainerStats; + exports.dockerContainerProcesses = docker.dockerContainerProcesses; + exports.dockerVolumes = docker.dockerVolumes; + exports.dockerAll = docker.dockerAll; + exports.vboxInfo = vbox.vboxInfo; + exports.printer = printer.printer; + exports.usb = usb.usb; + exports.audio = audio.audio; + exports.bluetoothDevices = bluetooth.bluetoothDevices; + exports.getStaticData = getStaticData; + exports.getDynamicData = getDynamicData; + exports.getAllData = getAllData; + exports.get = get; + exports.observe = observe; + exports.powerShellStart = util.powerShellStart; + exports.powerShellRelease = util.powerShellRelease; + } +}); + +// src/main.ts +var main_exports = {}; +__export(main_exports, { + default: () => EditInNeovim +}); +module.exports = __toCommonJS(main_exports); +var import_obsidian3 = require("obsidian"); +var import_neovim2 = __toESM(require_lib()); + +// src/Neovim.ts +var import_obsidian = require("obsidian"); +var import_neovim = __toESM(require_lib()); +var child_process = __toESM(require("child_process")); + +// src/utils.ts +var import_node_path = require("path"); +var import_node_fs = require("fs"); +var os = __toESM(require("os")); +var import_systeminformation = __toESM(require_lib2()); +var windows = process.platform === "win32"; +var searchDirs = windows ? [] : [ + "/usr/local/bin", + "/usr/bin", + "/opt/homebrew/bin", + "/home/linuxbrew/.linuxbrew/bin", + "/snap/nvim/current/usr/bin" +]; +async function isPortInUse(port) { + const networkConnections = await import_systeminformation.default.networkConnections(); + return networkConnections.find((networkConnection) => { + return networkConnection.localPort === String(port); + }) !== void 0; +} +function normalizePath(path) { + return (0, import_node_path.normalize)(windows ? path.toLowerCase() : path); +} +function configureProcessSpawnArgs(spawnOptions, terminalName, terminalPath, nvimPath, port) { + if (!windows) { + spawnOptions.spawnArgs = ["-e", nvimPath, "--listen", port]; + spawnOptions.shell = os.userInfo().shell || true; + console.debug(`edit-in-neovim: +Process spawn config for macos/linux: ${JSON.stringify(spawnOptions, null, 2)}`); + return spawnOptions; + } + if (terminalName === "alacritty.exe" || terminalName === "wezterm.exe" || terminalName === "kitty.exe") { + spawnOptions.spawnArgs = ["-e", nvimPath, "--listen", port]; + console.debug(`edit-in-neovim: +Process spawn config for windows and ${terminalName}: ${JSON.stringify(spawnOptions, null, 2)}`); + return spawnOptions; + } + if (terminalName === "wt.exe") { + spawnOptions.spawnArgs = ["new-tab", "--title", "Neovim", nvimPath, "--listen", port]; + console.debug(`edit-in-neovim: +Process spawn config for windows terminal: ${JSON.stringify(spawnOptions, null, 2)}`); + return spawnOptions; + } + if (terminalName === "powershell.exe" || terminalName === "pwsh.exe") { + const command = `Start-Process -FilePath '${nvimPath}' -ArgumentList '--listen ${port}' -WindowStyle Normal`; + spawnOptions.spawnArgs = ["-ExecutionPolicy", "Bypass", "-NoProfile", "-NoExit", "-Command", command]; + spawnOptions.shell = true; + console.debug(`edit-in-neovim: +Process spawn config for powershell: ${JSON.stringify(spawnOptions, null, 2)}`); + return spawnOptions; + } + if (terminalName === "cmd.exe") { + spawnOptions.spawnArgs = ["/c", "start", `"Neovim"`, `"${nvimPath}"`, "--listen", port]; + spawnOptions.shell = true; + console.debug(`edit-in-neovim: +Process spawn config for ${terminalName}: ${JSON.stringify(spawnOptions, null, 2)}`); + return spawnOptions; + } + console.warn(`Unknown/unhandled Windows terminal: ${terminalPath}. Using fallback, this is likely to fail.`); + spawnOptions.spawnArgs = ["-e", nvimPath, "--listen", port]; + console.info(`edit-in-neovim: +Process spawn config for ${terminalName}: ${JSON.stringify(spawnOptions, null, 2)}`); + return spawnOptions; +} +function verifyPath(name) { + if (!(0, import_node_fs.existsSync)(name)) { + return void 0; + } + try { + (0, import_node_fs.accessSync)(name, import_node_fs.constants.X_OK); + return name; + } catch (e) { + console.log(`Could not find valid binary due to: ${e}, for name: ${name}`); + return void 0; + } +} +function searchForBinary(name) { + if ((0, import_node_path.isAbsolute)(name)) { + return verifyPath(name); + } + const paths = /* @__PURE__ */ new Set(); + const { PATH, USERPROFILE, LOCALAPPDATA, PROGRAMFILES, HOME } = process.env; + PATH == null ? void 0 : PATH.split(import_node_path.delimiter).forEach((p) => paths.add(normalizePath(p))); + if (windows) { + name = windows ? `${name}.exe` : name; + if (USERPROFILE) { + paths.add(normalizePath(`${USERPROFILE}/scoop/shims`)); + } + paths.add(normalizePath("C:/ProgramData/scoop/shims")); + if (LOCALAPPDATA) { + paths.add(normalizePath(`${LOCALAPPDATA}/Microsoft/WindowsApps`)); + paths.add(normalizePath(`${LOCALAPPDATA}/Microsoft/WinGet/Packages`)); + } + if (PROGRAMFILES) { + paths.add(normalizePath(`${PROGRAMFILES}/WinGet/Packages`)); + paths.add(normalizePath(`${PROGRAMFILES} (x86)/WinGet/Packages`)); + } + } else { + [ + "/usr/local/bin", + "/usr/bin", + "/opt/homebrew/bin", + "/home/linuxbrew/.linuxbrew/bin" + ].forEach((p) => paths.add(p)); + if (HOME) { + paths.add(normalizePath(`${HOME}/bin`)); + paths.add(normalizePath(`${HOME}/.linuxbrew/bin`)); + } + } + const allPaths = [...paths].map((p) => (0, import_node_path.join)(p, name)); + for (const path of allPaths) { + const verifiedPath = verifyPath(path); + if (verifiedPath) { + return verifiedPath; + } + } + return void 0; +} + +// src/Neovim.ts +var Neovim = class { + constructor(settings, adapter, apiKey) { + this.getBuffers = async () => { + if (!this.instance) + return []; + try { + return await this.instance.buffers; + } catch (error) { + new import_obsidian.Notice(`edit-in-neovim: +Unable to get Neovim buffers due to: ${error.message}`, 5e3); + return []; + } + }; + this.openFile = async (file) => { + var _a, _b, _c; + if (!file) + return; + if (!((_a = this.nvimBinary) == null ? void 0 : _a.path)) + return; + const isExcalidrawMd = file.extension === "md" && file.path.endsWith(".excalidraw.md"); + let isSupported = this.settings.supportedFileTypes.includes(file.extension); + isSupported = isSupported || isExcalidrawMd && this.settings.supportedFileTypes.includes("excalidraw"); + if (!isSupported) + return; + const port = this.settings.listenOn.split(":").at(-1); + if (!(this.instance && this.process) && !port) { + console.debug("No known neovim instance is running"); + return; + } + ; + try { + if (!(port && await isPortInUse(port))) { + console.debug("Port is either missing, or nothing was listening on it, skipping command"); + return; + } + } catch (error) { + console.error(`Error checking port ${port}: ${error.message}`); + } + const absolutePath = this.adapter.getFullPath(file.path); + const args = ["--server", this.settings.listenOn, "--remote", absolutePath]; + console.debug(`Opening ${absolutePath} in neovim`); + child_process.exec( + `${(_b = this.nvimBinary) == null ? void 0 : _b.path} --server ${this.settings.listenOn} --remote '${absolutePath}'` + ); + try { + child_process.execFile((_c = this.nvimBinary) == null ? void 0 : _c.path, args, (error, stdout, stderr) => { + var _a2; + if (error) { + let noticeMessage = `edit-in-neovim: +Error opening file in Neovim: ${error.message}`; + if (error.code === "ENOENT") { + noticeMessage = `edit-in-neovim: +Neovim executable not found at: ${(_a2 = this.nvimBinary) == null ? void 0 : _a2.path}`; + } else if (stderr && (stderr.includes("ECONNREFUSED") || stderr.includes("Connection refused"))) { + noticeMessage = `edit-in-neovim: +Could not connect to Neovim server at ${this.settings.listenOn}. Is it running?`; + } else if (stderr && stderr.includes("No such file or directory") && stderr.includes(absolutePath)) { + noticeMessage = `edit-in-neovim: +Neovim server reported error finding file: ${file.basename}`; + } else if (stderr) { + noticeMessage = `edit-in-neovim: +Error opening file in Neovim: ${stderr.split("\n")[0]}`; + } + new import_obsidian.Notice(noticeMessage, 1e4); + return; + } + if (stdout) + console.log(`Neovim --remote stdout: ${stdout}`); + if (stderr) + console.warn(`Neovim --remote stderr: ${stderr}`); + }); + } catch (execFileError) { + console.error("Error opening file in neovim", execFileError); + new import_obsidian.Notice(`Failed to run Neovim command: ${execFileError.message}`, 1e4); + } + }; + this.close = () => { + var _a, _b; + (_a = this.process) == null ? void 0 : _a.kill(); + (_b = this.instance) == null ? void 0 : _b.quit(); + this.instance = void 0; + this.process = void 0; + new import_obsidian.Notice("edit-in-neovim:\nNeovim instance closed.", 3e3); + }; + var _a, _b; + this.adapter = adapter; + this.settings = settings; + this.apiKey = apiKey; + this.termBinary = searchForBinary(settings.terminal); + this.nvimBinary = void 0; + if (!this.termBinary) { + console.warn(`Could find binary for ${settings.terminal}, double check it's on your PATH`); + } + if (this.settings.pathToBinary) { + this.nvimBinary = { path: this.settings.pathToBinary, nvimVersion: "manual_path" }; + console.log(`Neovim Information: + - Term Path: ${this.termBinary || "NOT FOUND"} + - Nvim Path: ${this.nvimBinary.path} + - Version: ${this.nvimBinary.nvimVersion} + - Error: ${(_a = this.nvimBinary.error) == null ? void 0 : _a.message} +`); + return; + } + const foundNvimBinaries = (0, import_neovim.findNvim)({ orderBy: "desc", paths: searchDirs }); + if (foundNvimBinaries.matches.length > 0) { + this.nvimBinary = foundNvimBinaries.matches[0]; + console.log(`Neovim Information: + - Term Path: ${this.termBinary || "NOT FOUND"} + - Nvim Path: ${this.nvimBinary.path} + - Version: ${this.nvimBinary.nvimVersion} + - Error: ${(_b = this.nvimBinary.error) == null ? void 0 : _b.message} +`); + return; + } + this.nvimBinary = { path: "", nvimVersion: void 0, error: new Error("Neovim binary not found, and no manual path specified") }; + console.warn("Using fallback neovim configuration, plugin will likely not function"); + if (!this.termBinary || !this.nvimBinary.nvimVersion || this.nvimBinary.error) { + new import_obsidian.Notice("edit-in-neovim:\nPotential issues in plugin config, check logs for more details", 5e3); + } + } + async newInstance(adapter) { + var _a, _b, _c, _d, _e, _f; + if (this.process) { + new import_obsidian.Notice("edit-in-neovim:\nInstance already running", 5e3); + return; + } + if (!this.termBinary) { + new import_obsidian.Notice("Terminal undefined, skipping command", 5e3); + return; + } + if (!this.nvimBinary || ((_a = this.nvimBinary) == null ? void 0 : _a.path) === "") { + new import_obsidian.Notice("No path to valid nvim binary has been found, skipping command", 5e3); + return; + } + const extraEnvVars = {}; + if (this.apiKey) + extraEnvVars["OBSIDIAN_REST_API_KEY"] = this.apiKey; + if (this.settings.appname !== "") + extraEnvVars["NVIM_APPNAME"] = this.settings.appname; + const terminalName = ((_b = this.termBinary.split("\\").pop()) == null ? void 0 : _b.toLowerCase()) || ""; + const defaultSpawnOptions = { + spawnArgs: [], + cwd: adapter.getBasePath(), + env: { ...process.env, ...extraEnvVars }, + shell: false, + detached: false + }; + const spawnOptions = configureProcessSpawnArgs(defaultSpawnOptions, terminalName, this.termBinary, this.nvimBinary.path, this.settings.listenOn); + console.debug(`Attempting to spawn process: + Platform: ${process.platform} + Executable: ${this.termBinary} + Arguments: ${JSON.stringify(spawnOptions.spawnArgs)} + Options: ${JSON.stringify(spawnOptions)}`); + try { + this.process = child_process.spawn(this.termBinary, spawnOptions.spawnArgs, spawnOptions); + if (!this.process || this.process.pid === void 0) { + new import_obsidian.Notice("Failed to create Neovim process", 5e3); + this.process = void 0; + return; + } + console.debug(`Neovim process running, PID: ${this.process.pid}`); + (_c = this.process) == null ? void 0 : _c.on("error", (err) => { + new import_obsidian.Notice("edit-in-neovim:\nNeovim ran into a error, see logs for details"); + console.error(`Neovim process ran into an error: ${JSON.stringify(err, null, 2)}`); + this.process = void 0; + this.instance = void 0; + }); + (_d = this.process) == null ? void 0 : _d.on("close", (code) => { + console.info(`nvim closed with code: ${code}`); + this.process = void 0; + this.instance = void 0; + }); + (_e = this.process) == null ? void 0 : _e.on("disconnect", () => { + console.info("nvim disconnected"); + this.process = void 0; + this.instance = void 0; + }); + (_f = this.process) == null ? void 0 : _f.on("exit", (code) => { + console.info(`nvim closed with code: ${code}`); + this.process = void 0; + this.instance = void 0; + }); + console.debug("Attaching to Neovim process..."); + this.instance = (0, import_neovim.attach)({ proc: this.process }); + setTimeout(async () => { + if (!this.instance) + return; + try { + await this.instance.eval("1"); + console.debug("Neovim RPC connection test successful."); + new import_obsidian.Notice("Neovim instance started and connected.", 3e3); + } catch (error) { + console.error("Neovim RPC connection failed after spawn:", error); + new import_obsidian.Notice(`Failed to establish RPC connection: ${error.message}`, 7e3); + this.close(); + } + }, 1500); + } catch (error) { + console.error("Error caught during child_process.spawn call itself:", error); + new import_obsidian.Notice(`Error trying to spawn Neovim: ${error.message}`, 1e4); + this.process = void 0; + this.instance = void 0; + } + } +}; + +// src/Settings.ts +var import_obsidian2 = require("obsidian"); +var DEFAULT_SETTINGS = { + terminal: process.env.TERMINAL || "alacritty", + listenOn: "127.0.0.1:2006", + openNeovimOnLoad: true, + supportedFileTypes: ["txt", "md", "css", "js", "ts", "tsx", "jsx", "json"], + pathToBinary: "", + appname: "" +}; +var EditInNeovimSettingsTab = class extends import_obsidian2.PluginSettingTab { + constructor(app, plugin) { + super(app, plugin); + this.plugin = plugin; + } + display() { + const { containerEl } = this; + containerEl.empty(); + new import_obsidian2.Setting(containerEl).setName("Terminal").setDesc( + "Which terminal emulator should I try and use for the neovim instance?" + ).addText( + (text) => text.setPlaceholder("E.g. alacritty, kitty, wezterm...").setValue(this.plugin.settings.terminal).onChange(async (value) => { + this.plugin.settings.terminal = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian2.Setting(containerEl).setName("Neovim server location").setDesc( + "The Neovim instance will be spawned using --listen and needs a socket or IP:PORT (not sure if sockets work so use at your own risk)" + ).addText( + (text) => text.setPlaceholder("127.0.0.1:2006").setValue(this.plugin.settings.listenOn).onChange(async (value) => { + this.plugin.settings.listenOn = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian2.Setting(containerEl).setName("Path to Neovim binary").setDesc( + "Manual override for detecting nvim binary. It's recommended you add nvim to your PATH instead. (requires reload)" + ).addText( + (text) => text.setPlaceholder("/path/to/nvim-bin/nvim").setValue(this.plugin.settings.pathToBinary).onChange(async (value) => { + this.plugin.settings.pathToBinary = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian2.Setting(containerEl).setName("NVIM_APPNAME").setDesc( + "If you have a specific neovim distro you'd like to use (lazyvim for example), leave blank to use your default neovim config." + ).addText( + (text) => text.setPlaceholder("lazyvim, my_writing_config, etc.").setValue(this.plugin.settings.appname).onChange(async (value) => { + this.plugin.settings.appname = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian2.Setting(containerEl).setName("Open on startup").setDesc("Open the Neovim instance when Obsidian opens").addToggle( + (toggle) => toggle.setValue(this.plugin.settings.openNeovimOnLoad).onChange(async (value) => { + this.plugin.settings.openNeovimOnLoad = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian2.Setting(containerEl).setName("Supported file types").setDesc( + "Which file extensions do you want this extension to try and open?" + ).addText( + (text) => text.setPlaceholder( + "Filetypes should be separated by spaces and not include the '.', E.g. 'txt md css html'" + ).setValue(this.plugin.settings.supportedFileTypes.join(" ")).onChange(async (value) => { + this.plugin.settings.supportedFileTypes = value.split(" "); + await this.plugin.saveSettings(); + }) + ); + } +}; + +// src/main.ts +var EditInNeovim = class extends import_obsidian3.Plugin { + async onload() { + var _a; + await this.loadSettings(); + this.pluginChecks(); + const adapter = this.app.vault.adapter; + this.neovim = new Neovim(this.settings, adapter, this.restAPIEnabled()); + if (this.settings.openNeovimOnLoad) + this.neovim.newInstance(adapter); + this.registerEvent( + this.app.workspace.on("file-open", this.neovim.openFile) + ); + this.registerEvent(this.app.workspace.on("quit", (_a = this.neovim) == null ? void 0 : _a.close)); + this.addSettingTab(new EditInNeovimSettingsTab(this.app, this)); + this.addCommand({ + id: "edit-in-neovim-new-instance", + name: "Open Neovim", + callback: async () => await this.neovim.newInstance(adapter).then( + () => setTimeout( + () => this.neovim.openFile(this.app.workspace.getActiveFile()), + 1e3 + ) + ) + }); + this.addCommand({ + id: "edit-in-neovim-close-instance", + name: "Close Neovim", + callback: async () => this.neovim.close + }); + } + onunload() { + var _a; + (_a = this.neovim) == null ? void 0 : _a.close(); + } + async loadSettings() { + this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); + } + async saveSettings() { + await this.saveData(this.settings); + } + pluginChecks() { + const found = (0, import_neovim2.findNvim)({ orderBy: "desc" }); + if (found.matches.length === 0) { + new import_obsidian3.Notice( + "Edit In Neovim: No Valid nvim binary found T_T \n\n make sure neovim is installed and on your PATH", + 5e3 + ); + } + if (!(this.app.vault.adapter instanceof import_obsidian3.FileSystemAdapter)) { + new import_obsidian3.Notice( + "Edit In Neovim: unknown adapter, unable to access vault files", + 5e3 + ); + } + } + restAPIEnabled() { + const plugins = this.app.plugins.plugins; + if (Object.keys(plugins).contains("obsidian-local-rest-api")) { + return plugins["obsidian-local-rest-api"].settings.apiKey; + } + return void 0; + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = {}); + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/edit-in-neovim/manifest.json b/.obsidian/plugins/edit-in-neovim/manifest.json new file mode 100644 index 0000000..c71eb1b --- /dev/null +++ b/.obsidian/plugins/edit-in-neovim/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "edit-in-neovim", + "name": "Edit in Neovim", + "version": "1.4.0", + "minAppVersion": "0.15.0", + "description": "Open a Neovim buffer for the currently open file", + "author": "Theseus", + "authorUrl": "https://github.com/TheseusGrey", + "isDesktopOnly": true +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/data.json b/.obsidian/plugins/obsidian-git/data.json new file mode 100644 index 0000000..300b09c --- /dev/null +++ b/.obsidian/plugins/obsidian-git/data.json @@ -0,0 +1,68 @@ +{ + "commitMessage": "vault backup: {{date}}", + "autoCommitMessage": "vault backup: {{date}}", + "commitMessageScript": "", + "commitDateFormat": "YYYY-MM-DD HH:mm:ss", + "autoSaveInterval": 0, + "autoPushInterval": 0, + "autoPullInterval": 0, + "autoPullOnBoot": false, + "autoCommitOnlyStaged": false, + "disablePush": false, + "pullBeforePush": true, + "disablePopups": false, + "showErrorNotices": true, + "disablePopupsForNoChanges": false, + "listChangedFilesInMessageBody": false, + "showStatusBar": true, + "updateSubmodules": false, + "syncMethod": "merge", + "mergeStrategy": "none", + "customMessageOnAutoBackup": false, + "autoBackupAfterFileChange": false, + "treeStructure": false, + "refreshSourceControl": true, + "basePath": "", + "differentIntervalCommitAndPush": false, + "changedFilesInStatusBar": false, + "showedMobileNotice": true, + "refreshSourceControlTimer": 7000, + "showBranchStatusBar": true, + "setLastSaveToLastCommit": false, + "submoduleRecurseCheckout": false, + "gitDir": "", + "showFileMenu": true, + "authorInHistoryView": "full", + "dateInHistoryView": true, + "diffStyle": "split", + "hunks": { + "showSigns": false, + "hunkCommands": false, + "statusBar": "disabled" + }, + "lineAuthor": { + "show": false, + "followMovement": "inactive", + "authorDisplay": "initials", + "showCommitHash": false, + "dateTimeFormatOptions": "date", + "dateTimeFormatCustomString": "YYYY-MM-DD HH:mm", + "dateTimeTimezone": "viewer-local", + "coloringMaxAge": "1y", + "colorNew": { + "r": 255, + "g": 150, + "b": 150 + }, + "colorOld": { + "r": 120, + "g": 160, + "b": 255 + }, + "textColorCss": "var(--text-muted)", + "ignoreWhitespace": false, + "gutterSpacingFallbackLength": 5, + "lastShownAuthorDisplay": "initials", + "lastShownDateTimeFormatOptions": "date" + } +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/main.js b/.obsidian/plugins/obsidian-git/main.js new file mode 100644 index 0000000..2a78f5b --- /dev/null +++ b/.obsidian/plugins/obsidian-git/main.js @@ -0,0 +1,452 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source visit the plugins github repository (https://github.com/denolehov/obsidian-git) +*/ + +var $D=Object.create;var pc=Object.defineProperty;var ID=Object.getOwnPropertyDescriptor;var FD=Object.getOwnPropertyNames;var OD=Object.getPrototypeOf,MD=Object.prototype.hasOwnProperty;var Bb=t=>{throw TypeError(t)};var DD=(t,e,r)=>e in t?pc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var LD=(t,e)=>()=>(t&&(e=t(t=0)),e);var I=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),BD=(t,e)=>{for(var r in e)pc(t,r,{get:e[r],enumerable:!0})},Nb=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of FD(e))!MD.call(t,n)&&n!==r&&pc(t,n,{get:()=>e[n],enumerable:!(i=ID(e,n))||i.enumerable});return t};var Mt=(t,e,r)=>(r=t!=null?$D(OD(t)):{},Nb(e||!t||!t.__esModule?pc(r,"default",{value:t,enumerable:!0}):r,t)),ND=t=>Nb(pc({},"__esModule",{value:!0}),t);var ze=(t,e,r)=>DD(t,typeof e!="symbol"?e+"":e,r),Am=(t,e,r)=>e.has(t)||Bb("Cannot "+r);var $=(t,e,r)=>(Am(t,e,"read from private field"),r?r.call(t):e.get(t)),pe=(t,e,r)=>e.has(t)?Bb("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),fe=(t,e,r,i)=>(Am(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),bt=(t,e,r)=>(Am(t,e,"access private method"),r);var Gb=I(Tf=>{"use strict";p();Tf.byteLength=UD;Tf.toByteArray=jD;Tf.fromByteArray=VD;var Qi=[],fi=[],HD=typeof Uint8Array!="undefined"?Uint8Array:Array,Tm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(oa=0,Hb=Tm.length;oa0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function UD(t){var e=Ub(t),r=e[0],i=e[1];return(r+i)*3/4-i}function GD(t,e,r){return(e+r)*3/4-r}function jD(t){var e,r=Ub(t),i=r[0],n=r[1],s=new HD(GD(t,i,n)),a=0,o=n>0?i-4:i,l;for(l=0;l>16&255,s[a++]=e>>8&255,s[a++]=e&255;return n===2&&(e=fi[t.charCodeAt(l)]<<2|fi[t.charCodeAt(l+1)]>>4,s[a++]=e&255),n===1&&(e=fi[t.charCodeAt(l)]<<10|fi[t.charCodeAt(l+1)]<<4|fi[t.charCodeAt(l+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}function qD(t){return Qi[t>>18&63]+Qi[t>>12&63]+Qi[t>>6&63]+Qi[t&63]}function zD(t,e,r){for(var i,n=[],s=e;so?o:a+s));return i===1?(e=t[r-1],n.push(Qi[e>>2]+Qi[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(Qi[e>>10]+Qi[e>>4&63]+Qi[e<<2&63]+"=")),n.join("")}});var jb=I(Cm=>{p();Cm.read=function(t,e,r,i,n){var s,a,o=n*8-i-1,l=(1<>1,u=-7,f=r?n-1:0,d=r?-1:1,h=t[e+f];for(f+=d,s=h&(1<<-u)-1,h>>=-u,u+=o;u>0;s=s*256+t[e+f],f+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=i;u>0;a=a*256+t[e+f],f+=d,u-=8);if(s===0)s=1-c;else{if(s===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-c}return(h?-1:1)*a*Math.pow(2,s-i)};Cm.write=function(t,e,r,i,n,s){var a,o,l,c=s*8-n-1,u=(1<>1,d=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,m=i?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+f>=1?e+=d/l:e+=d*Math.pow(2,1-f),e*l>=2&&(a++,l/=2),a+f>=u?(o=0,a=u):a+f>=1?(o=(e*l-1)*Math.pow(2,n),a=a+f):(o=e*Math.pow(2,f-1)*Math.pow(2,n),a=0));n>=8;t[r+h]=o&255,h+=m,o/=256,n-=8);for(a=a<0;t[r+h]=a&255,h+=m,a/=256,c-=8);t[r+h-m]|=g*128}});var Lm=I(Ao=>{"use strict";p();var Pm=Gb(),Eo=jb(),qb=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ao.Buffer=F;Ao.SlowBuffer=QD;Ao.INSPECT_MAX_BYTES=50;var Cf=2147483647;Ao.kMaxLength=Cf;F.TYPED_ARRAY_SUPPORT=WD();!F.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function WD(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(F.prototype,"parent",{enumerable:!0,get:function(){if(F.isBuffer(this))return this.buffer}});Object.defineProperty(F.prototype,"offset",{enumerable:!0,get:function(){if(F.isBuffer(this))return this.byteOffset}});function Ln(t){if(t>Cf)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,F.prototype),e}function F(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Fm(t)}return Yb(t,e,r)}F.poolSize=8192;function Yb(t,e,r){if(typeof t=="string")return XD(t,e);if(ArrayBuffer.isView(t))return ZD(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Ji(t,ArrayBuffer)||t&&Ji(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Ji(t,SharedArrayBuffer)||t&&Ji(t.buffer,SharedArrayBuffer)))return $m(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return F.from(i,e,r);let n=KD(t);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return F.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}F.from=function(t,e,r){return Yb(t,e,r)};Object.setPrototypeOf(F.prototype,Uint8Array.prototype);Object.setPrototypeOf(F,Uint8Array);function Xb(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function YD(t,e,r){return Xb(t),t<=0?Ln(t):e!==void 0?typeof r=="string"?Ln(t).fill(e,r):Ln(t).fill(e):Ln(t)}F.alloc=function(t,e,r){return YD(t,e,r)};function Fm(t){return Xb(t),Ln(t<0?0:Om(t)|0)}F.allocUnsafe=function(t){return Fm(t)};F.allocUnsafeSlow=function(t){return Fm(t)};function XD(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!F.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Zb(t,e)|0,i=Ln(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function Rm(t){let e=t.length<0?0:Om(t.length)|0,r=Ln(e);for(let i=0;i=Cf)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Cf.toString(16)+" bytes");return t|0}function QD(t){return+t!=t&&(t=0),F.alloc(+t)}F.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==F.prototype};F.compare=function(e,r){if(Ji(e,Uint8Array)&&(e=F.from(e,e.offset,e.byteLength)),Ji(r,Uint8Array)&&(r=F.from(r,r.offset,r.byteLength)),!F.isBuffer(e)||!F.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let s=0,a=Math.min(i,n);sn.length?(F.isBuffer(a)||(a=F.from(a)),a.copy(n,s)):Uint8Array.prototype.set.call(n,a,s);else if(F.isBuffer(a))a.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=a.length}return n};function Zb(t,e){if(F.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Ji(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Im(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return s_(t).length;default:if(n)return i?-1:Im(t).length;e=(""+e).toLowerCase(),n=!0}}F.byteLength=Zb;function JD(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return cL(this,e,r);case"utf8":case"utf-8":return Qb(this,e,r);case"ascii":return oL(this,e,r);case"latin1":case"binary":return lL(this,e,r);case"base64":return sL(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return uL(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}F.prototype._isBuffer=!0;function la(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}F.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;rr&&(e+=" ... "),""};qb&&(F.prototype[qb]=F.prototype.inspect);F.prototype.compare=function(e,r,i,n,s){if(Ji(e,Uint8Array)&&(e=F.from(e,e.offset,e.byteLength)),!F.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),r<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&r>=i)return 0;if(n>=s)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;let a=s-n,o=i-r,l=Math.min(a,o),c=this.slice(n,s),u=e.slice(r,i);for(let f=0;f2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Dm(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=F.from(e,i)),F.isBuffer(e))return e.length===0?-1:zb(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):zb(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function zb(t,e,r,i,n){let s=1,a=t.length,o=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,a/=2,o/=2,r/=2}function l(u,f){return s===1?u[f]:u.readUInt16BE(f*s)}let c;if(n){let u=-1;for(c=r;ca&&(r=a-o),c=r;c>=0;c--){let u=!0;for(let f=0;fn&&(i=n)):i=n;let s=e.length;i>s/2&&(i=s/2);let a;for(a=0;a>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-r;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return eL(this,e,r,i);case"utf8":case"utf-8":return tL(this,e,r,i);case"ascii":case"latin1":case"binary":return rL(this,e,r,i);case"base64":return iL(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nL(this,e,r,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}};F.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function sL(t,e,r){return e===0&&r===t.length?Pm.fromByteArray(t):Pm.fromByteArray(t.slice(e,r))}function Qb(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n239?4:s>223?3:s>191?2:1;if(n+o<=r){let l,c,u,f;switch(o){case 1:s<128&&(a=s);break;case 2:l=t[n+1],(l&192)===128&&(f=(s&31)<<6|l&63,f>127&&(a=f));break;case 3:l=t[n+1],c=t[n+2],(l&192)===128&&(c&192)===128&&(f=(s&15)<<12|(l&63)<<6|c&63,f>2047&&(f<55296||f>57343)&&(a=f));break;case 4:l=t[n+1],c=t[n+2],u=t[n+3],(l&192)===128&&(c&192)===128&&(u&192)===128&&(f=(s&15)<<18|(l&63)<<12|(c&63)<<6|u&63,f>65535&&f<1114112&&(a=f))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|a&1023),i.push(a),n+=o}return aL(i)}var Vb=4096;function aL(t){let e=t.length;if(e<=Vb)return String.fromCharCode.apply(String,t);let r="",i=0;for(;ii)&&(r=i);let n="";for(let s=e;si&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),rr)throw new RangeError("Trying to access beyond buffer length")}F.prototype.readUintLE=F.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Dt(e,r,this.length);let n=this[e],s=1,a=0;for(;++a>>0,r=r>>>0,i||Dt(e,r,this.length);let n=this[e+--r],s=1;for(;r>0&&(s*=256);)n+=this[e+--r]*s;return n};F.prototype.readUint8=F.prototype.readUInt8=function(e,r){return e=e>>>0,r||Dt(e,1,this.length),this[e]};F.prototype.readUint16LE=F.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Dt(e,2,this.length),this[e]|this[e+1]<<8};F.prototype.readUint16BE=F.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Dt(e,2,this.length),this[e]<<8|this[e+1]};F.prototype.readUint32LE=F.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Dt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};F.prototype.readUint32BE=F.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Dt(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};F.prototype.readBigUInt64LE=ws(function(e){e=e>>>0,ko(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&mc(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(s)<>>0,ko(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&mc(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<>>0,r=r>>>0,i||Dt(e,r,this.length);let n=this[e],s=1,a=0;for(;++a=s&&(n-=Math.pow(2,8*r)),n};F.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Dt(e,r,this.length);let n=r,s=1,a=this[e+--n];for(;n>0&&(s*=256);)a+=this[e+--n]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*r)),a};F.prototype.readInt8=function(e,r){return e=e>>>0,r||Dt(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};F.prototype.readInt16LE=function(e,r){e=e>>>0,r||Dt(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};F.prototype.readInt16BE=function(e,r){e=e>>>0,r||Dt(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};F.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Dt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};F.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Dt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};F.prototype.readBigInt64LE=ws(function(e){e=e>>>0,ko(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&mc(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<>>0,ko(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&mc(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,r||Dt(e,4,this.length),Eo.read(this,e,!0,23,4)};F.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Dt(e,4,this.length),Eo.read(this,e,!1,23,4)};F.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Dt(e,8,this.length),Eo.read(this,e,!0,52,8)};F.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Dt(e,8,this.length),Eo.read(this,e,!1,52,8)};function br(t,e,r,i,n,s){if(!F.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}F.prototype.writeUintLE=F.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let o=Math.pow(2,8*i)-1;br(this,e,r,i,o,0)}let s=1,a=0;for(this[r]=e&255;++a>>0,i=i>>>0,!n){let o=Math.pow(2,8*i)-1;br(this,e,r,i,o,0)}let s=i-1,a=1;for(this[r+s]=e&255;--s>=0&&(a*=256);)this[r+s]=e/a&255;return r+i};F.prototype.writeUint8=F.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,1,255,0),this[r]=e&255,r+1};F.prototype.writeUint16LE=F.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};F.prototype.writeUint16BE=F.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};F.prototype.writeUint32LE=F.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};F.prototype.writeUint32BE=F.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Jb(t,e,r,i,n){n_(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}function e_(t,e,r,i,n){n_(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}F.prototype.writeBigUInt64LE=ws(function(e,r=0){return Jb(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});F.prototype.writeBigUInt64BE=ws(function(e,r=0){return e_(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});F.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);br(this,e,r,i,l-1,-l)}let s=0,a=1,o=0;for(this[r]=e&255;++s>0)-o&255;return r+i};F.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);br(this,e,r,i,l-1,-l)}let s=i-1,a=1,o=0;for(this[r+s]=e&255;--s>=0&&(a*=256);)e<0&&o===0&&this[r+s+1]!==0&&(o=1),this[r+s]=(e/a>>0)-o&255;return r+i};F.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};F.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};F.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};F.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};F.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};F.prototype.writeBigInt64LE=ws(function(e,r=0){return Jb(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});F.prototype.writeBigInt64BE=ws(function(e,r=0){return e_(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function t_(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function r_(t,e,r,i,n){return e=+e,r=r>>>0,n||t_(t,e,r,4,34028234663852886e22,-34028234663852886e22),Eo.write(t,e,r,i,23,4),r+4}F.prototype.writeFloatLE=function(e,r,i){return r_(this,e,r,!0,i)};F.prototype.writeFloatBE=function(e,r,i){return r_(this,e,r,!1,i)};function i_(t,e,r,i,n){return e=+e,r=r>>>0,n||t_(t,e,r,8,17976931348623157e292,-17976931348623157e292),Eo.write(t,e,r,i,52,8),r+8}F.prototype.writeDoubleLE=function(e,r,i){return i_(this,e,r,!0,i)};F.prototype.writeDoubleBE=function(e,r,i){return i_(this,e,r,!1,i)};F.prototype.copy=function(e,r,i,n){if(!F.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let s;if(typeof e=="number")for(s=r;s2**32?n=Wb(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Wb(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Wb(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function fL(t,e,r){ko(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&mc(e,t.length-(r+1))}function n_(t,e,r,i,n,s){if(t>r||t3?e===0||e===BigInt(0)?o=`>= 0${a} and < 2${a} ** ${(s+1)*8}${a}`:o=`>= -(2${a} ** ${(s+1)*8-1}${a}) and < 2 ** ${(s+1)*8-1}${a}`:o=`>= ${e}${a} and <= ${r}${a}`,new So.ERR_OUT_OF_RANGE("value",o,t)}fL(i,n,s)}function ko(t,e){if(typeof t!="number")throw new So.ERR_INVALID_ARG_TYPE(e,"number",t)}function mc(t,e,r){throw Math.floor(t)!==t?(ko(t,r),new So.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new So.ERR_BUFFER_OUT_OF_BOUNDS:new So.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var dL=/[^+/0-9A-Za-z-_]/g;function hL(t){if(t=t.split("=")[0],t=t.trim().replace(dL,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Im(t,e){e=e||1/0;let r,i=t.length,n=null,s=[];for(let a=0;a55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function pL(t){let e=[];for(let r=0;r>8,n=r%256,s.push(n),s.push(i);return s}function s_(t){return Pm.toByteArray(hL(t))}function Pf(t,e,r,i){let n;for(n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function Ji(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Dm(t){return t!==t}var gL=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function ws(t){return typeof BigInt=="undefined"?vL:t}function vL(){throw new Error("BigInt not supported")}});var a_,Bm,Buffer,p=LD(()=>{a_=require("obsidian");a_.Platform.isMobileApp?Bm=Lm().Buffer:Bm=global.Buffer;Buffer=Bm});var l_=I((l7,o_)=>{"use strict";p();var Yr=function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if(typeof process=="undefined"||typeof process.domain=="undefined")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||Yr.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||Yr.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||Yr.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=Yr.DEFAULT_MAX_PENDING};Yr.DEFAULT_TIMEOUT=0;Yr.DEFAULT_MAX_OCCUPATION_TIME=0;Yr.DEFAULT_MAX_EXECUTION_TIME=0;Yr.DEFAULT_MAX_PENDING=1e3;Yr.prototype.acquire=function(t,e,r,i){if(Array.isArray(t))return this._acquireBatch(t,e,r,i);if(typeof e!="function")throw new Error("You must pass a function to execute");var n=null,s=null,a=null;typeof r!="function"&&(i=r,r=null,a=new this.Promise(function(b,k){n=b,s=k})),i=i||{};var o=!1,l=null,c=null,u=null,f=this,d=function(b,k,x){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),b&&(f.queues[t]&&f.queues[t].length===0&&delete f.queues[t],f.domainReentrant&&delete f.domains[t]),o||(a?k?s(k):n(x):typeof r=="function"&&r(k,x),o=!0),b&&f.queues[t]&&f.queues[t].length>0&&f.queues[t].shift()()},h=function(b){if(o)return d(b);l&&(clearTimeout(l),l=null),f.domainReentrant&&b&&(f.domains[t]=process.domain);var k=i.maxExecutionTime||f.maxExecutionTime;if(k&&(u=setTimeout(function(){f.queues[t]&&d(b,new Error("Maximum execution time is exceeded "+t))},k)),e.length===1){var x=!1;try{e(function(E,A){x||(x=!0,d(b,E,A))})}catch(E){x||(x=!0,d(b,E))}}else f._promiseTry(function(){return e()}).then(function(E){d(b,void 0,E)},function(E){d(b,E)})};f.domainReentrant&&process.domain&&(h=process.domain.bind(h));var m=i.maxPending||f.maxPending;if(!f.queues[t])f.queues[t]=[],h(!0);else if(f.domainReentrant&&process.domain&&process.domain===f.domains[t])h(!1);else if(f.queues[t].length>=m)d(!1,new Error("Too many pending tasks in queue "+t));else{var g=function(){h(!0)};i.skipQueue?f.queues[t].unshift(g):f.queues[t].push(g);var v=i.timeout||f.timeout;v&&(l=setTimeout(function(){l=null,d(!1,new Error("async-lock timed out in queue "+t))},v))}var w=i.maxOccupationTime||f.maxOccupationTime;if(w&&(c=setTimeout(function(){f.queues[t]&&d(!1,new Error("Maximum occupation time is exceeded in queue "+t))},w)),a)return a};Yr.prototype._acquireBatch=function(t,e,r,i){typeof r!="function"&&(i=r,r=null);var n=this,s=function(o,l){return function(c){n.acquire(o,l,c,i)}},a=t.reduceRight(function(o,l){return s(l,o)},e);if(typeof r=="function")a(r);else return new this.Promise(function(o,l){a.length===1?a(function(c,u){c?l(c):o(u)}):o(a())})};Yr.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0};Yr.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(e){return this.Promise.reject(e)}};o_.exports=Yr});var u_=I((u7,c_)=>{"use strict";p();c_.exports=l_()});var f_=I((d7,Nm)=>{p();typeof Object.create=="function"?Nm.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Nm.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var $f=I((Hm,h_)=>{p();var Rf=Lm(),en=Rf.Buffer;function d_(t,e){for(var r in t)e[r]=t[r]}en.from&&en.alloc&&en.allocUnsafe&&en.allocUnsafeSlow?h_.exports=Rf:(d_(Rf,Hm),Hm.Buffer=ca);function ca(t,e,r){return en(t,e,r)}ca.prototype=Object.create(en.prototype);d_(en,ca);ca.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return en(t,e,r)};ca.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=en(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};ca.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return en(t)};ca.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Rf.SlowBuffer(t)}});var If=I((m7,p_)=>{p();var wL={}.toString;p_.exports=Array.isArray||function(t){return wL.call(t)=="[object Array]"}});var _r=I((v7,m_)=>{"use strict";p();m_.exports=TypeError});var Ff=I((y7,g_)=>{"use strict";p();g_.exports=Object});var Um=I((_7,v_)=>{"use strict";p();v_.exports=Error});var y_=I((S7,w_)=>{"use strict";p();w_.exports=EvalError});var __=I((k7,b_)=>{"use strict";p();b_.exports=RangeError});var S_=I((T7,x_)=>{"use strict";p();x_.exports=ReferenceError});var Of=I((P7,E_)=>{"use strict";p();E_.exports=SyntaxError});var A_=I(($7,k_)=>{"use strict";p();k_.exports=URIError});var C_=I((F7,T_)=>{"use strict";p();T_.exports=Math.abs});var R_=I((M7,P_)=>{"use strict";p();P_.exports=Math.floor});var I_=I((L7,$_)=>{"use strict";p();$_.exports=Math.max});var O_=I((N7,F_)=>{"use strict";p();F_.exports=Math.min});var D_=I((U7,M_)=>{"use strict";p();M_.exports=Math.pow});var B_=I((j7,L_)=>{"use strict";p();L_.exports=Math.round});var H_=I((z7,N_)=>{"use strict";p();N_.exports=Number.isNaN||function(e){return e!==e}});var G_=I((W7,U_)=>{"use strict";p();var yL=H_();U_.exports=function(e){return yL(e)||e===0?e:e<0?-1:1}});var q_=I((X7,j_)=>{"use strict";p();j_.exports=Object.getOwnPropertyDescriptor});var ys=I((K7,z_)=>{"use strict";p();var Mf=q_();if(Mf)try{Mf([],"length")}catch(t){Mf=null}z_.exports=Mf});var gc=I((J7,V_)=>{"use strict";p();var Df=Object.defineProperty||!1;if(Df)try{Df({},"a",{value:1})}catch(t){Df=!1}V_.exports=Df});var vc=I((tY,W_)=>{"use strict";p();W_.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==n||o.enumerable!==!0)return!1}return!0}});var Lf=I((iY,X_)=>{"use strict";p();var Y_=typeof Symbol!="undefined"&&Symbol,bL=vc();X_.exports=function(){return typeof Y_!="function"||typeof Symbol!="function"||typeof Y_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:bL()}});var Gm=I((sY,Z_)=>{"use strict";p();Z_.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var jm=I((oY,K_)=>{"use strict";p();var _L=Ff();K_.exports=_L.getPrototypeOf||null});var ex=I((cY,J_)=>{"use strict";p();var xL="Function.prototype.bind called on incompatible ",SL=Object.prototype.toString,EL=Math.max,kL="[object Function]",Q_=function(e,r){for(var i=[],n=0;n{"use strict";p();var CL=ex();tx.exports=Function.prototype.bind||CL});var Bf=I((hY,rx)=>{"use strict";p();rx.exports=Function.prototype.call});var Nf=I((mY,ix)=>{"use strict";p();ix.exports=Function.prototype.apply});var sx=I((vY,nx)=>{"use strict";p();nx.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var qm=I((yY,ax)=>{"use strict";p();var PL=To(),RL=Nf(),$L=Bf(),IL=sx();ax.exports=IL||PL.call($L,RL)});var Hf=I((_Y,ox)=>{"use strict";p();var FL=To(),OL=_r(),ML=Bf(),DL=qm();ox.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new OL("a function is required");return DL(FL,ML,e)}});var hx=I((SY,dx)=>{"use strict";p();var LL=Hf(),lx=ys(),ux;try{ux=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var zm=!!ux&&lx&&lx(Object.prototype,"__proto__"),fx=Object,cx=fx.getPrototypeOf;dx.exports=zm&&typeof zm.get=="function"?LL([zm.get]):typeof cx=="function"?function(e){return cx(e==null?e:fx(e))}:!1});var Uf=I((kY,vx)=>{"use strict";p();var px=Gm(),mx=jm(),gx=hx();vx.exports=px?function(e){return px(e)}:mx?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return mx(e)}:gx?function(e){return gx(e)}:null});var Gf=I((TY,wx)=>{"use strict";p();var BL=Function.prototype.call,NL=Object.prototype.hasOwnProperty,HL=To();wx.exports=HL.call(BL,NL)});var tn=I((PY,Ex)=>{"use strict";p();var Ee,UL=Ff(),GL=Um(),jL=y_(),qL=__(),zL=S_(),$o=Of(),Ro=_r(),VL=A_(),WL=C_(),YL=R_(),XL=I_(),ZL=O_(),KL=D_(),QL=B_(),JL=G_(),xx=Function,Vm=function(t){try{return xx('"use strict"; return ('+t+").constructor;")()}catch(e){}},wc=ys(),eB=gc(),Wm=function(){throw new Ro},tB=wc?function(){try{return arguments.callee,Wm}catch(t){try{return wc(arguments,"callee").get}catch(e){return Wm}}}():Wm,Co=Lf()(),Lt=Uf(),rB=jm(),iB=Gm(),Sx=Nf(),yc=Bf(),Po={},nB=typeof Uint8Array=="undefined"||!Lt?Ee:Lt(Uint8Array),ua={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Ee:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Ee:ArrayBuffer,"%ArrayIteratorPrototype%":Co&&Lt?Lt([][Symbol.iterator]()):Ee,"%AsyncFromSyncIteratorPrototype%":Ee,"%AsyncFunction%":Po,"%AsyncGenerator%":Po,"%AsyncGeneratorFunction%":Po,"%AsyncIteratorPrototype%":Po,"%Atomics%":typeof Atomics=="undefined"?Ee:Atomics,"%BigInt%":typeof BigInt=="undefined"?Ee:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Ee:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Ee:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Ee:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":GL,"%eval%":eval,"%EvalError%":jL,"%Float16Array%":typeof Float16Array=="undefined"?Ee:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?Ee:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Ee:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Ee:FinalizationRegistry,"%Function%":xx,"%GeneratorFunction%":Po,"%Int8Array%":typeof Int8Array=="undefined"?Ee:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Ee:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Ee:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Co&&Lt?Lt(Lt([][Symbol.iterator]())):Ee,"%JSON%":typeof JSON=="object"?JSON:Ee,"%Map%":typeof Map=="undefined"?Ee:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Co||!Lt?Ee:Lt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":UL,"%Object.getOwnPropertyDescriptor%":wc,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Ee:Promise,"%Proxy%":typeof Proxy=="undefined"?Ee:Proxy,"%RangeError%":qL,"%ReferenceError%":zL,"%Reflect%":typeof Reflect=="undefined"?Ee:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Ee:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Co||!Lt?Ee:Lt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Ee:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Co&&Lt?Lt(""[Symbol.iterator]()):Ee,"%Symbol%":Co?Symbol:Ee,"%SyntaxError%":$o,"%ThrowTypeError%":tB,"%TypedArray%":nB,"%TypeError%":Ro,"%Uint8Array%":typeof Uint8Array=="undefined"?Ee:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Ee:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Ee:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Ee:Uint32Array,"%URIError%":VL,"%WeakMap%":typeof WeakMap=="undefined"?Ee:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Ee:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Ee:WeakSet,"%Function.prototype.call%":yc,"%Function.prototype.apply%":Sx,"%Object.defineProperty%":eB,"%Object.getPrototypeOf%":rB,"%Math.abs%":WL,"%Math.floor%":YL,"%Math.max%":XL,"%Math.min%":ZL,"%Math.pow%":KL,"%Math.round%":QL,"%Math.sign%":JL,"%Reflect.getPrototypeOf%":iB};if(Lt)try{null.error}catch(t){yx=Lt(Lt(t)),ua["%Error.prototype%"]=yx}var yx,sB=function t(e){var r;if(e==="%AsyncFunction%")r=Vm("async function () {}");else if(e==="%GeneratorFunction%")r=Vm("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Vm("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&Lt&&(r=Lt(n.prototype))}return ua[e]=r,r},bx={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bc=To(),jf=Gf(),aB=bc.call(yc,Array.prototype.concat),oB=bc.call(Sx,Array.prototype.splice),_x=bc.call(yc,String.prototype.replace),qf=bc.call(yc,String.prototype.slice),lB=bc.call(yc,RegExp.prototype.exec),cB=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,uB=/\\(\\)?/g,fB=function(e){var r=qf(e,0,1),i=qf(e,-1);if(r==="%"&&i!=="%")throw new $o("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new $o("invalid intrinsic syntax, expected opening `%`");var n=[];return _x(e,cB,function(s,a,o,l){n[n.length]=o?_x(l,uB,"$1"):a||s}),n},dB=function(e,r){var i=e,n;if(jf(bx,i)&&(n=bx[i],i="%"+n[0]+"%"),jf(ua,i)){var s=ua[i];if(s===Po&&(s=sB(i)),typeof s=="undefined"&&!r)throw new Ro("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new $o("intrinsic "+e+" does not exist!")};Ex.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Ro("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ro('"allowMissing" argument must be a boolean');if(lB(/^%?[^%]*%?$/,e)===null)throw new $o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=fB(e),n=i.length>0?i[0]:"",s=dB("%"+n+"%",r),a=s.name,o=s.value,l=!1,c=s.alias;c&&(n=c[0],oB(i,aB([0,1],c)));for(var u=1,f=!0;u=i.length){var g=wc(o,d);f=!!g,f&&"get"in g&&!("originalValue"in g.get)?o=g.get:o=o[d]}else f=jf(o,d),o=o[d];f&&!l&&(ua[a]=o)}}return o}});var Bt=I(($Y,Tx)=>{"use strict";p();var kx=tn(),Ax=Hf(),hB=Ax([kx("%String.prototype.indexOf%")]);Tx.exports=function(e,r){var i=kx(e,!!r);return typeof i=="function"&&hB(e,".prototype.")>-1?Ax([i]):i}});var $x=I((FY,Rx)=>{"use strict";p();var Px=Function.prototype.toString,Io=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Xm,zf;if(typeof Io=="function"&&typeof Object.defineProperty=="function")try{Xm=Object.defineProperty({},"length",{get:function(){throw zf}}),zf={},Io(function(){throw 42},null,Xm)}catch(t){t!==zf&&(Io=null)}else Io=null;var pB=/^\s*class\b/,Zm=function(e){try{var r=Px.call(e);return pB.test(r)}catch(i){return!1}},Ym=function(e){try{return Zm(e)?!1:(Px.call(e),!0)}catch(r){return!1}},Vf=Object.prototype.toString,mB="[object Object]",gB="[object Function]",vB="[object GeneratorFunction]",wB="[object HTMLAllCollection]",yB="[object HTML document.all class]",bB="[object HTMLCollection]",_B=typeof Symbol=="function"&&!!Symbol.toStringTag,xB=!(0 in[,]),Km=function(){return!1};typeof document=="object"&&(Cx=document.all,Vf.call(Cx)===Vf.call(document.all)&&(Km=function(e){if((xB||!e)&&(typeof e=="undefined"||typeof e=="object"))try{var r=Vf.call(e);return(r===wB||r===yB||r===bB||r===mB)&&e("")==null}catch(i){}return!1}));var Cx;Rx.exports=Io?function(e){if(Km(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Io(e,null,Xm)}catch(r){if(r!==zf)return!1}return!Zm(e)&&Ym(e)}:function(e){if(Km(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(_B)return Ym(e);if(Zm(e))return!1;var r=Vf.call(e);return r!==gB&&r!==vB&&!/^\[object HTML/.test(r)?!1:Ym(e)}});var Ox=I((MY,Fx)=>{"use strict";p();var SB=$x(),EB=Object.prototype.toString,Ix=Object.prototype.hasOwnProperty,kB=function(e,r,i){for(var n=0,s=e.length;n=3&&(n=i),CB(e)?kB(e,r,n):typeof e=="string"?AB(e,r,n):TB(e,r,n)}});var Dx=I((LY,Mx)=>{"use strict";p();Mx.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var Bx=I((NY,Lx)=>{"use strict";p();var Qm=Dx(),PB=typeof globalThis=="undefined"?global:globalThis;Lx.exports=function(){for(var e=[],r=0;r{"use strict";p();var Nx=gc(),RB=Of(),Fo=_r(),Hx=ys();Ux.exports=function(e,r,i){if(!e||typeof e!="object"&&typeof e!="function")throw new Fo("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Fo("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Fo("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Fo("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Fo("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Fo("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,l=!!Hx&&Hx(e,r);if(Nx)Nx(e,r,{configurable:a===null&&l?l.configurable:!a,enumerable:n===null&&l?l.enumerable:!n,value:i,writable:s===null&&l?l.writable:!s});else if(o||!n&&!s&&!a)e[r]=i;else throw new RB("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Yf=I((jY,jx)=>{"use strict";p();var Jm=gc(),Gx=function(){return!!Jm};Gx.hasArrayLengthDefineBug=function(){if(!Jm)return null;try{return Jm([],"length",{value:1}).length!==1}catch(e){return!0}};jx.exports=Gx});var Yx=I((zY,Wx)=>{"use strict";p();var $B=tn(),qx=Wf(),IB=Yf()(),zx=ys(),Vx=_r(),FB=$B("%Math.floor%");Wx.exports=function(e,r){if(typeof e!="function")throw new Vx("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||FB(r)!==r)throw new Vx("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in e&&zx){var a=zx(e,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(s=!1)}return(n||s||!i)&&(IB?qx(e,"length",r,!0,!0):qx(e,"length",r)),e}});var Zx=I((WY,Xx)=>{"use strict";p();var OB=To(),MB=Nf(),DB=qm();Xx.exports=function(){return DB(OB,MB,arguments)}});var fa=I((XY,Xf)=>{"use strict";p();var LB=Yx(),Kx=gc(),BB=Hf(),Qx=Zx();Xf.exports=function(e){var r=BB(arguments),i=e.length-(arguments.length-1);return LB(r,1+(i>0?i:0),!0)};Kx?Kx(Xf.exports,"apply",{value:Qx}):Xf.exports.apply=Qx});var bs=I((KY,Jx)=>{"use strict";p();var NB=vc();Jx.exports=function(){return NB()&&!!Symbol.toStringTag}});var ig=I((JY,i1)=>{"use strict";p();var Qf=Ox(),HB=Bx(),e1=fa(),tg=Bt(),Kf=ys(),Zf=Uf(),UB=tg("Object.prototype.toString"),r1=bs()(),t1=typeof globalThis=="undefined"?global:globalThis,eg=HB(),rg=tg("String.prototype.slice"),GB=tg("Array.prototype.indexOf",!0)||function(e,r){for(var i=0;i-1?r:r!=="Object"?!1:qB(e)}return Kf?jB(e):null}});var s1=I((tX,n1)=>{"use strict";p();var zB=ig();n1.exports=function(e){return!!zB(e)}});var o1=I((iX,a1)=>{"use strict";p();var VB=_r(),WB=Bt(),YB=WB("TypedArray.prototype.buffer",!0),XB=s1();a1.exports=YB||function(e){if(!XB(e))throw new VB("Not a Typed Array");return e.buffer}});var u1=I((sX,c1)=>{"use strict";p();var Ci=$f().Buffer,ZB=If(),KB=o1(),QB=ArrayBuffer.isView||function(e){try{return KB(e),!0}catch(r){return!1}},JB=typeof Uint8Array!="undefined",l1=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined",eN=l1&&(Ci.prototype instanceof Uint8Array||Ci.TYPED_ARRAY_SUPPORT);c1.exports=function(e,r){if(Ci.isBuffer(e))return e.constructor&&!("isBuffer"in e)?Ci.from(e):e;if(typeof e=="string")return Ci.from(e,r);if(l1&&QB(e)){if(e.byteLength===0)return Ci.alloc(0);if(eN){var i=Ci.from(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength===e.byteLength)return i}var n=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s=Ci.from(n);if(s.length===e.byteLength)return s}if(JB&&e instanceof Uint8Array)return Ci.from(e);var a=ZB(e);if(a)for(var o=0;o255||~~l!==l)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||Ci.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))return Ci.from(e);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var d1=I((oX,f1)=>{"use strict";p();var tN=$f().Buffer,rN=u1();function td(t,e){this._block=tN.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}td.prototype.update=function(t,e){t=rN(t,e||"utf8");for(var r=this._block,i=this._blockSize,n=t.length,s=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};td.prototype._update=function(){throw new Error("_update must be implemented by subclass")};f1.exports=td});var m1=I((cX,p1)=>{"use strict";p();var iN=f_(),h1=d1(),nN=$f().Buffer,sN=[1518500249,1859775393,-1894007588,-899497514],aN=new Array(80);function _c(){this.init(),this._w=aN,h1.call(this,64,56)}iN(_c,h1);_c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function oN(t){return t<<1|t>>>31}function lN(t){return t<<5|t>>>27}function cN(t){return t<<30|t>>>2}function uN(t,e,r,i){return t===0?e&r|~e&i:t===2?e&r|e&i|r&i:e^r^i}_c.prototype._update=function(t){for(var e=this._w,r=this._a|0,i=this._b|0,n=this._c|0,s=this._d|0,a=this._e|0,o=0;o<16;++o)e[o]=t.readInt32BE(o*4);for(;o<80;++o)e[o]=oN(e[o-3]^e[o-8]^e[o-14]^e[o-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=lN(r)+uN(c,i,n,s)+a+e[l]+sN[c]|0;a=s,s=n,n=cN(i),i=r,r=u}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};_c.prototype._hash=function(){var t=nN.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};p1.exports=_c});var v1=I(ng=>{p();var g1;(function(t){typeof DO_NOT_EXPORT_CRC=="undefined"?typeof ng=="object"?t(ng):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(g1={}):t(g1={})})(function(t){t.version="1.2.2";function e(){for(var y=0,S=new Array(256),_=0;_!=256;++_)y=_,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,S[_]=y;return typeof Int32Array!="undefined"?new Int32Array(S):S}var r=e();function i(y){var S=0,_=0,T=0,P=typeof Int32Array!="undefined"?new Int32Array(4096):new Array(4096);for(T=0;T!=256;++T)P[T]=y[T];for(T=0;T!=256;++T)for(_=y[T],S=256+T;S<4096;S+=256)_=P[S]=_>>>8^y[_&255];var D=[];for(T=1;T!=16;++T)D[T-1]=typeof Int32Array!="undefined"?P.subarray(T*256,T*256+256):P.slice(T*256,T*256+256);return D}var n=i(r),s=n[0],a=n[1],o=n[2],l=n[3],c=n[4],u=n[5],f=n[6],d=n[7],h=n[8],m=n[9],g=n[10],v=n[11],w=n[12],b=n[13],k=n[14];function x(y,S){for(var _=S^-1,T=0,P=y.length;T>>8^r[(_^y.charCodeAt(T++))&255];return~_}function E(y,S){for(var _=S^-1,T=y.length-15,P=0;P>8&255]^w[y[P++]^_>>16&255]^v[y[P++]^_>>>24]^g[y[P++]]^m[y[P++]]^h[y[P++]]^d[y[P++]]^f[y[P++]]^u[y[P++]]^c[y[P++]]^l[y[P++]]^o[y[P++]]^a[y[P++]]^s[y[P++]]^r[y[P++]];for(T+=15;P>>8^r[(_^y[P++])&255];return~_}function A(y,S){for(var _=S^-1,T=0,P=y.length,D=0,B=0;T>>8^r[(_^D)&255]:D<2048?(_=_>>>8^r[(_^(192|D>>6&31))&255],_=_>>>8^r[(_^(128|D&63))&255]):D>=55296&&D<57344?(D=(D&1023)+64,B=y.charCodeAt(T++)&1023,_=_>>>8^r[(_^(240|D>>8&7))&255],_=_>>>8^r[(_^(128|D>>2&63))&255],_=_>>>8^r[(_^(128|B>>6&15|(D&3)<<4))&255],_=_>>>8^r[(_^(128|B&63))&255]):(_=_>>>8^r[(_^(224|D>>12&15))&255],_=_>>>8^r[(_^(128|D>>6&63))&255],_=_>>>8^r[(_^(128|D&63))&255]);return~_}t.table=r,t.bstr=x,t.buf=E,t.str=A})});var Bn=I(fr=>{"use strict";p();var fN=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function dN(t,e){return Object.prototype.hasOwnProperty.call(t,e)}fr.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)dN(r,i)&&(t[i]=r[i])}}return t};fr.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var hN={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+i),n);return}for(var s=0;s{"use strict";p();var mN=Bn(),gN=4,w1=0,y1=1,vN=2;function Mo(t){for(var e=t.length;--e>=0;)t[e]=0}var wN=0,k1=1,yN=2,bN=3,_N=258,fg=29,Tc=256,Sc=Tc+1+fg,Oo=30,dg=19,A1=2*Sc+1,da=15,sg=16,xN=7,hg=256,T1=16,C1=17,P1=18,cg=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],rd=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],SN=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],R1=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],EN=512,Nn=new Array((Sc+2)*2);Mo(Nn);var xc=new Array(Oo*2);Mo(xc);var Ec=new Array(EN);Mo(Ec);var kc=new Array(_N-bN+1);Mo(kc);var pg=new Array(fg);Mo(pg);var id=new Array(Oo);Mo(id);function ag(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}var $1,I1,F1;function og(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function O1(t){return t<256?Ec[t]:Ec[256+(t>>>7)]}function Ac(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function xr(t,e,r){t.bi_valid>sg-r?(t.bi_buf|=e<>sg-t.bi_valid,t.bi_valid+=r-sg):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0);return r>>>1}function kN(t){t.bi_valid===16?(Ac(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function AN(t,e){var r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length,c,u,f,d,h,m,g=0;for(d=0;d<=da;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;cl&&(d=l,g++),r[u*2+1]=d,!(u>i)&&(t.bl_count[d]++,h=0,u>=o&&(h=a[u-o]),m=r[u*2],t.opt_len+=m*(d+h),s&&(t.static_len+=m*(n[u*2+1]+h)));if(g!==0){do{for(d=l-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[l]--,g-=2}while(g>0);for(d=l;d!==0;d--)for(u=t.bl_count[d];u!==0;)f=t.heap[--c],!(f>i)&&(r[f*2+1]!==d&&(t.opt_len+=(d-r[f*2+1])*r[f*2],r[f*2+1]=d),u--)}}function D1(t,e,r){var i=new Array(da+1),n=0,s,a;for(s=1;s<=da;s++)i[s]=n=n+r[s-1]<<1;for(a=0;a<=e;a++){var o=t[a*2+1];o!==0&&(t[a*2]=M1(i[o]++,o))}}function TN(){var t,e,r,i,n,s=new Array(da+1);for(r=0,i=0;i>=7;i8?Ac(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function CN(t,e,r,i){B1(t),i&&(Ac(t,r),Ac(t,~r)),mN.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function b1(t,e,r,i){var n=e*2,s=r*2;return t[n]>1;a>=1;a--)lg(t,r,a);c=s;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],lg(t,r,1),o=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=o,r[c*2]=r[a*2]+r[o*2],t.depth[c]=(t.depth[a]>=t.depth[o]?t.depth[a]:t.depth[o])+1,r[a*2+1]=r[o*2+1]=c,t.heap[1]=c++,lg(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],AN(t,e),D1(r,l,t.bl_count)}function x1(t,e,r){var i,n=-1,s,a=e[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)s=a,a=e[(i+1)*2+1],!(++o=3&&t.bl_tree[R1[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function RN(t,e,r,i){var n;for(xr(t,e-257,5),xr(t,r-1,5),xr(t,i-4,4),n=0;n>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return w1;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return y1;for(r=32;r0?(t.strm.data_type===vN&&(t.strm.data_type=$N(t)),ug(t,t.l_desc),ug(t,t.d_desc),a=PN(t),n=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=n&&(n=s)):n=s=r+5,r+4<=n&&e!==-1?N1(t,e,r,i):t.strategy===gN||s===n?(xr(t,(k1<<1)+(i?1:0),3),_1(t,Nn,xc)):(xr(t,(yN<<1)+(i?1:0),3),RN(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),_1(t,t.dyn_ltree,t.dyn_dtree)),L1(t),i&&B1(t)}function MN(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(kc[r]+Tc+1)*2]++,t.dyn_dtree[O1(e)*2]++),t.last_lit===t.lit_bufsize-1}Do._tr_init=IN;Do._tr_stored_block=N1;Do._tr_flush_block=ON;Do._tr_tally=MN;Do._tr_align=FN});var mg=I((vX,U1)=>{"use strict";p();function DN(t,e,r,i){for(var n=t&65535|0,s=t>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do n=n+e[i++]|0,s=s+n|0;while(--a);n%=65521,s%=65521}return n|s<<16|0}U1.exports=DN});var gg=I((yX,G1)=>{"use strict";p();function LN(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var BN=LN();function NN(t,e,r,i){var n=BN,s=i+r;t^=-1;for(var a=i;a>>8^n[(t^e[a])&255];return t^-1}G1.exports=NN});var nd=I((_X,j1)=>{"use strict";p();j1.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Q1=I(an=>{"use strict";p();var dr=Bn(),di=H1(),W1=mg(),_s=gg(),HN=nd(),ga=0,UN=1,GN=3,As=4,q1=5,sn=0,z1=1,hi=-2,jN=-3,vg=-5,qN=-1,zN=1,sd=2,VN=3,WN=4,YN=0,XN=2,cd=8,ZN=9,KN=15,QN=8,JN=29,eH=256,yg=eH+1+JN,tH=30,rH=19,iH=2*yg+1,nH=15,Ce=3,Es=258,Pi=Es+Ce+1,sH=32,ud=42,bg=69,ad=73,od=91,ld=103,ha=113,Pc=666,Ct=1,Rc=2,pa=3,No=4,aH=3;function ks(t,e){return t.msg=HN[e],e}function V1(t){return(t<<1)-(t>4?9:0)}function Ss(t){for(var e=t.length;--e>=0;)t[e]=0}function xs(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(dr.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function qt(t,e){di._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,xs(t.strm)}function Fe(t,e){t.pending_buf[t.pending++]=e}function Cc(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function oH(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,dr.arraySet(e,t.input,t.next_in,n,r),t.state.wrap===1?t.adler=W1(t.adler,e,n,r):t.state.wrap===2&&(t.adler=_s(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)}function Y1(t,e){var r=t.max_chain_length,i=t.strstart,n,s,a=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-Pi?t.strstart-(t.w_size-Pi):0,c=t.window,u=t.w_mask,f=t.prev,d=t.strstart+Es,h=c[i+a-1],m=c[i+a];t.prev_length>=t.good_match&&(r>>=2),o>t.lookahead&&(o=t.lookahead);do if(n=e,!(c[n+a]!==m||c[n+a-1]!==h||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&ia){if(t.match_start=e,a=s,s>=o)break;h=c[i+a-1],m=c[i+a]}}while((e=f[e&u])>l&&--r!==0);return a<=t.lookahead?a:t.lookahead}function ma(t){var e=t.w_size,r,i,n,s,a;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Pi)){dr.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,r=i;do n=t.head[--r],t.head[r]=n>=e?n-e:0;while(--i);i=e,r=i;do n=t.prev[--r],t.prev[r]=n>=e?n-e:0;while(--i);s+=e}if(t.strm.avail_in===0)break;if(i=oH(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=i,t.lookahead+t.insert>=Ce)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ma(t),t.lookahead===0&&e===ga)return Ct;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((t.strstart===0||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,qt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Pi&&(qt(t,!1),t.strm.avail_out===0))return Ct}return t.insert=0,e===As?(qt(t,!0),t.strm.avail_out===0?pa:No):(t.strstart>t.block_start&&(qt(t,!1),t.strm.avail_out===0),Ct)}function wg(t,e){for(var r,i;;){if(t.lookahead=Ce&&(t.ins_h=(t.ins_h<=Ce)if(i=di._tr_tally(t,t.strstart-t.match_start,t.match_length-Ce),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Ce){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=Ce&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=Ce-1)),t.prev_length>=Ce&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-Ce,i=di._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-Ce),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<=Ce&&t.strstart>0&&(n=t.strstart-1,i=a[n],i===a[++n]&&i===a[++n]&&i===a[++n])){s=t.strstart+Es;do;while(i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Ce?(r=di._tr_tally(t,1,t.match_length-Ce),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=di._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(qt(t,!1),t.strm.avail_out===0))return Ct}return t.insert=0,e===As?(qt(t,!0),t.strm.avail_out===0?pa:No):t.last_lit&&(qt(t,!1),t.strm.avail_out===0)?Ct:Rc}function uH(t,e){for(var r;;){if(t.lookahead===0&&(ma(t),t.lookahead===0)){if(e===ga)return Ct;break}if(t.match_length=0,r=di._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(qt(t,!1),t.strm.avail_out===0))return Ct}return t.insert=0,e===As?(qt(t,!0),t.strm.avail_out===0?pa:No):t.last_lit&&(qt(t,!1),t.strm.avail_out===0)?Ct:Rc}function nn(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}var Bo;Bo=[new nn(0,0,0,0,lH),new nn(4,4,8,4,wg),new nn(4,5,16,8,wg),new nn(4,6,32,32,wg),new nn(4,4,16,16,Lo),new nn(8,16,32,32,Lo),new nn(8,16,128,128,Lo),new nn(8,32,128,256,Lo),new nn(32,128,258,1024,Lo),new nn(32,258,258,4096,Lo)];function fH(t){t.window_size=2*t.w_size,Ss(t.head),t.max_lazy_match=Bo[t.level].max_lazy,t.good_match=Bo[t.level].good_length,t.nice_match=Bo[t.level].nice_length,t.max_chain_length=Bo[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Ce-1,t.match_available=0,t.ins_h=0}function dH(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=cd,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new dr.Buf16(iH*2),this.dyn_dtree=new dr.Buf16((2*tH+1)*2),this.bl_tree=new dr.Buf16((2*rH+1)*2),Ss(this.dyn_ltree),Ss(this.dyn_dtree),Ss(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new dr.Buf16(nH+1),this.heap=new dr.Buf16(2*yg+1),Ss(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new dr.Buf16(2*yg+1),Ss(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function X1(t){var e;return!t||!t.state?ks(t,hi):(t.total_in=t.total_out=0,t.data_type=XN,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ud:ha,t.adler=e.wrap===2?0:1,e.last_flush=ga,di._tr_init(e),sn)}function Z1(t){var e=X1(t);return e===sn&&fH(t.state),e}function hH(t,e){return!t||!t.state||t.state.wrap!==2?hi:(t.state.gzhead=e,sn)}function K1(t,e,r,i,n,s){if(!t)return hi;var a=1;if(e===qN&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),n<1||n>ZN||r!==cd||i<8||i>15||e<0||e>9||s<0||s>WN)return ks(t,hi);i===8&&(i=9);var o=new dH;return t.state=o,o.strm=t,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<q1||e<0)return t?ks(t,hi):hi;if(i=t.state,!t.output||!t.input&&t.avail_in!==0||i.status===Pc&&e!==As)return ks(t,t.avail_out===0?vg:hi);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===ud)if(i.wrap===2)t.adler=0,Fe(i,31),Fe(i,139),Fe(i,8),i.gzhead?(Fe(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Fe(i,i.gzhead.time&255),Fe(i,i.gzhead.time>>8&255),Fe(i,i.gzhead.time>>16&255),Fe(i,i.gzhead.time>>24&255),Fe(i,i.level===9?2:i.strategy>=sd||i.level<2?4:0),Fe(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(Fe(i,i.gzhead.extra.length&255),Fe(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=_s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=bg):(Fe(i,0),Fe(i,0),Fe(i,0),Fe(i,0),Fe(i,0),Fe(i,i.level===9?2:i.strategy>=sd||i.level<2?4:0),Fe(i,aH),i.status=ha);else{var a=cd+(i.w_bits-8<<4)<<8,o=-1;i.strategy>=sd||i.level<2?o=0:i.level<6?o=1:i.level===6?o=2:o=3,a|=o<<6,i.strstart!==0&&(a|=sH),a+=31-a%31,i.status=ha,Cc(i,a),i.strstart!==0&&(Cc(i,t.adler>>>16),Cc(i,t.adler&65535)),t.adler=1}if(i.status===bg)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=_s(t.adler,i.pending_buf,i.pending-n,n)),xs(t),n=i.pending,i.pending===i.pending_buf_size));)Fe(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=_s(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=ad)}else i.status=ad;if(i.status===ad)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=_s(t.adler,i.pending_buf,i.pending-n,n)),xs(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}i.gzindexn&&(t.adler=_s(t.adler,i.pending_buf,i.pending-n,n)),s===0&&(i.gzindex=0,i.status=od)}else i.status=od;if(i.status===od)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=_s(t.adler,i.pending_buf,i.pending-n,n)),xs(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}i.gzindexn&&(t.adler=_s(t.adler,i.pending_buf,i.pending-n,n)),s===0&&(i.status=ld)}else i.status=ld;if(i.status===ld&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&xs(t),i.pending+2<=i.pending_buf_size&&(Fe(i,t.adler&255),Fe(i,t.adler>>8&255),t.adler=0,i.status=ha)):i.status=ha),i.pending!==0){if(xs(t),t.avail_out===0)return i.last_flush=-1,sn}else if(t.avail_in===0&&V1(e)<=V1(r)&&e!==As)return ks(t,vg);if(i.status===Pc&&t.avail_in!==0)return ks(t,vg);if(t.avail_in!==0||i.lookahead!==0||e!==ga&&i.status!==Pc){var l=i.strategy===sd?uH(i,e):i.strategy===VN?cH(i,e):Bo[i.level].func(i,e);if((l===pa||l===No)&&(i.status=Pc),l===Ct||l===pa)return t.avail_out===0&&(i.last_flush=-1),sn;if(l===Rc&&(e===UN?di._tr_align(i):e!==q1&&(di._tr_stored_block(i,0,0,!1),e===GN&&(Ss(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),xs(t),t.avail_out===0))return i.last_flush=-1,sn}return e!==As?sn:i.wrap<=0?z1:(i.wrap===2?(Fe(i,t.adler&255),Fe(i,t.adler>>8&255),Fe(i,t.adler>>16&255),Fe(i,t.adler>>24&255),Fe(i,t.total_in&255),Fe(i,t.total_in>>8&255),Fe(i,t.total_in>>16&255),Fe(i,t.total_in>>24&255)):(Cc(i,t.adler>>>16),Cc(i,t.adler&65535)),xs(t),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?sn:z1)}function gH(t){var e;return!t||!t.state?hi:(e=t.state.status,e!==ud&&e!==bg&&e!==ad&&e!==od&&e!==ld&&e!==ha&&e!==Pc?ks(t,hi):(t.state=null,e===ha?ks(t,jN):sn))}function vH(t,e){var r=e.length,i,n,s,a,o,l,c,u;if(!t||!t.state||(i=t.state,a=i.wrap,a===2||a===1&&i.status!==ud||i.lookahead))return hi;for(a===1&&(t.adler=W1(t.adler,e,r,0)),i.wrap=0,r>=i.w_size&&(a===0&&(Ss(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new dr.Buf8(i.w_size),dr.arraySet(u,e,r-i.w_size,i.w_size,0),e=u,r=i.w_size),o=t.avail_in,l=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,ma(i);i.lookahead>=Ce;){n=i.strstart,s=i.lookahead-(Ce-1);do i.ins_h=(i.ins_h<{"use strict";p();var fd=Bn(),J1=!0,eS=!0;try{String.fromCharCode.apply(null,[0])}catch(t){J1=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){eS=!1}var $c=new fd.Buf8(256);for(Hn=0;Hn<256;Hn++)$c[Hn]=Hn>=252?6:Hn>=248?5:Hn>=240?4:Hn>=224?3:Hn>=192?2:1;var Hn;$c[254]=$c[254]=1;Ho.string2buf=function(t){var e,r,i,n,s,a=t.length,o=0;for(n=0;n>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e};function tS(t,e){if(e<65534&&(t.subarray&&eS||!t.subarray&&J1))return String.fromCharCode.apply(null,fd.shrinkBuf(t,e));for(var r="",i=0;i4){o[i++]=65533,r+=s-1;continue}for(n&=s===2?31:s===3?15:7;s>1&&r1){o[i++]=65533;continue}n<65536?o[i++]=n:(n-=65536,o[i++]=55296|n>>10&1023,o[i++]=56320|n&1023)}return tS(o,i)};Ho.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+$c[t[r]]>e?r:e}});var xg=I((TX,rS)=>{"use strict";p();function wH(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}rS.exports=wH});var aS=I(Oc=>{"use strict";p();var Ic=Q1(),Fc=Bn(),Eg=_g(),kg=nd(),yH=xg(),sS=Object.prototype.toString,bH=0,Sg=4,Uo=0,iS=1,nS=2,_H=-1,xH=0,SH=8;function va(t){if(!(this instanceof va))return new va(t);this.options=Fc.assign({level:_H,method:SH,chunkSize:16384,windowBits:15,memLevel:8,strategy:xH,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new yH,this.strm.avail_out=0;var r=Ic.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Uo)throw new Error(kg[r]);if(e.header&&Ic.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(typeof e.dictionary=="string"?i=Eg.string2buf(e.dictionary):sS.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=Ic.deflateSetDictionary(this.strm,i),r!==Uo)throw new Error(kg[r]);this._dict_set=!0}}va.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n,s;if(this.ended)return!1;s=e===~~e?e:e===!0?Sg:bH,typeof t=="string"?r.input=Eg.string2buf(t):sS.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Fc.Buf8(i),r.next_out=0,r.avail_out=i),n=Ic.deflate(r,s),n!==iS&&n!==Uo)return this.onEnd(n),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===Sg||s===nS))&&(this.options.to==="string"?this.onData(Eg.buf2binstring(Fc.shrinkBuf(r.output,r.next_out))):this.onData(Fc.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&n!==iS);return s===Sg?(n=Ic.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Uo):(s===nS&&(this.onEnd(Uo),r.avail_out=0),!0)};va.prototype.onData=function(t){this.chunks.push(t)};va.prototype.onEnd=function(t){t===Uo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Fc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Ag(t,e){var r=new va(e);if(r.push(t,!0),r.err)throw r.msg||kg[r.err];return r.result}function EH(t,e){return e=e||{},e.raw=!0,Ag(t,e)}function kH(t,e){return e=e||{},e.gzip=!0,Ag(t,e)}Oc.Deflate=va;Oc.deflate=Ag;Oc.deflateRaw=EH;Oc.gzip=kH});var lS=I(($X,oS)=>{"use strict";p();var dd=30,AH=12;oS.exports=function(e,r){var i,n,s,a,o,l,c,u,f,d,h,m,g,v,w,b,k,x,E,A,y,S,_,T,P;i=e.state,n=e.next_in,T=e.input,s=n+(e.avail_in-5),a=e.next_out,P=e.output,o=a-(r-e.avail_out),l=a+(e.avail_out-257),c=i.dmax,u=i.wsize,f=i.whave,d=i.wnext,h=i.window,m=i.hold,g=i.bits,v=i.lencode,w=i.distcode,b=(1<>>24,m>>>=E,g-=E,E=x>>>16&255,E===0)P[a++]=x&65535;else if(E&16){A=x&65535,E&=15,E&&(g>>=E,g-=E),g<15&&(m+=T[n++]<>>24,m>>>=E,g-=E,E=x>>>16&255,E&16){if(y=x&65535,E&=15,gc){e.msg="invalid distance too far back",i.mode=dd;break e}if(m>>>=E,g-=E,E=a-o,y>E){if(E=y-E,E>f&&i.sane){e.msg="invalid distance too far back",i.mode=dd;break e}if(S=0,_=h,d===0){if(S+=u-E,E2;)P[a++]=_[S++],P[a++]=_[S++],P[a++]=_[S++],A-=3;A&&(P[a++]=_[S++],A>1&&(P[a++]=_[S++]))}else{S=a-y;do P[a++]=P[S++],P[a++]=P[S++],P[a++]=P[S++],A-=3;while(A>2);A&&(P[a++]=P[S++],A>1&&(P[a++]=P[S++]))}}else if(E&64){e.msg="invalid distance code",i.mode=dd;break e}else{x=w[(x&65535)+(m&(1<>3,n-=A,g-=A<<3,m&=(1<{"use strict";p();var cS=Bn(),Go=15,uS=852,fS=592,dS=0,Tg=1,hS=2,TH=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],CH=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],PH=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],RH=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];pS.exports=function(e,r,i,n,s,a,o,l){var c=l.bits,u=0,f=0,d=0,h=0,m=0,g=0,v=0,w=0,b=0,k=0,x,E,A,y,S,_=null,T=0,P,D=new cS.Buf16(Go+1),B=new cS.Buf16(Go+1),N=null,ce=0,Pe,ve,se;for(u=0;u<=Go;u++)D[u]=0;for(f=0;f=1&&D[h]===0;h--);if(m>h&&(m=h),h===0)return s[a++]=1<<24|64<<16|0,s[a++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d0&&(e===dS||h!==1))return-1;for(B[1]=0,u=1;uuS||e===hS&&b>fS)return 1;for(;;){Pe=u-v,o[f]P?(ve=N[ce+o[f]],se=_[T+o[f]]):(ve=96,se=0),x=1<>v)+E]=Pe<<24|ve<<16|se|0;while(E!==0);for(x=1<>=1;if(x!==0?(k&=x-1,k+=x):k=0,f++,--D[u]===0){if(u===h)break;u=r[i+o[f]]}if(u>m&&(k&y)!==A){for(v===0&&(v=m),S+=d,g=u-v,w=1<uS||e===hS&&b>fS)return 1;A=k&y,s[A]=m<<24|g<<16|S-a|0}}return k!==0&&(s[S+k]=u-v<<24|64<<16|0),l.bits=m,0}});var ZS=I(Ri=>{"use strict";p();var Xr=Bn(),Fg=mg(),on=gg(),$H=lS(),Mc=mS(),IH=0,US=1,GS=2,gS=4,FH=5,hd=6,wa=0,OH=1,MH=2,pi=-2,jS=-3,Og=-4,DH=-5,vS=8,qS=1,wS=2,yS=3,bS=4,_S=5,xS=6,SS=7,ES=8,kS=9,AS=10,gd=11,Un=12,Cg=13,TS=14,Pg=15,CS=16,PS=17,RS=18,$S=19,pd=20,md=21,IS=22,FS=23,OS=24,MS=25,DS=26,Rg=27,LS=28,BS=29,tt=30,Mg=31,LH=32,BH=852,NH=592,HH=15,UH=HH;function NS(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function GH(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Xr.Buf16(320),this.work=new Xr.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function zS(t){var e;return!t||!t.state?pi:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=qS,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Xr.Buf32(BH),e.distcode=e.distdyn=new Xr.Buf32(NH),e.sane=1,e.back=-1,wa)}function VS(t){var e;return!t||!t.state?pi:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,zS(t))}function WS(t,e){var r,i;return!t||!t.state||(i=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?pi:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,VS(t))}function YS(t,e){var r,i;return t?(i=new GH,t.state=i,i.window=null,r=WS(t,e),r!==wa&&(t.state=null),r):pi}function jH(t){return YS(t,UH)}var HS=!0,$g,Ig;function qH(t){if(HS){var e;for($g=new Xr.Buf32(512),Ig=new Xr.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Mc(US,t.lens,0,288,$g,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Mc(GS,t.lens,0,32,Ig,0,t.work,{bits:5}),HS=!1}t.lencode=$g,t.lenbits=9,t.distcode=Ig,t.distbits=5}function XS(t,e,r,i){var n,s=t.state;return s.window===null&&(s.wsize=1<=s.wsize?(Xr.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),Xr.arraySet(s.window,e,r-i,n,s.wnext),i-=n,i?(Xr.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=on(r.check,_,2,0),c=0,u=0,r.mode=wS;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=tt;break}if((c&15)!==vS){t.msg="unknown compression method",r.mode=tt;break}if(c>>>=4,u-=4,y=(c&15)+8,r.wbits===0)r.wbits=y;else if(y>r.wbits){t.msg="invalid window size",r.mode=tt;break}r.dmax=1<>8&1),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=on(r.check,_,2,0)),c=0,u=0,r.mode=yS;case yS:for(;u<32;){if(o===0)break e;o--,c+=i[s++]<>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,r.check=on(r.check,_,4,0)),c=0,u=0,r.mode=bS;case bS:for(;u<16;){if(o===0)break e;o--,c+=i[s++]<>8),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=on(r.check,_,2,0)),c=0,u=0,r.mode=_S;case _S:if(r.flags&1024){for(;u<16;){if(o===0)break e;o--,c+=i[s++]<>>8&255,r.check=on(r.check,_,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=xS;case xS:if(r.flags&1024&&(h=r.length,h>o&&(h=o),h&&(r.head&&(y=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Xr.arraySet(r.head.extra,i,s,h,y)),r.flags&512&&(r.check=on(r.check,i,h,s)),o-=h,s+=h,r.length-=h),r.length))break e;r.length=0,r.mode=SS;case SS:if(r.flags&2048){if(o===0)break e;h=0;do y=i[s+h++],r.head&&y&&r.length<65536&&(r.head.name+=String.fromCharCode(y));while(y&&h>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Un;break;case AS:for(;u<32;){if(o===0)break e;o--,c+=i[s++]<>>=u&7,u-=u&7,r.mode=Rg;break}for(;u<3;){if(o===0)break e;o--,c+=i[s++]<>>=1,u-=1,c&3){case 0:r.mode=TS;break;case 1:if(qH(r),r.mode=pd,e===hd){c>>>=2,u-=2;break e}break;case 2:r.mode=PS;break;case 3:t.msg="invalid block type",r.mode=tt}c>>>=2,u-=2;break;case TS:for(c>>>=u&7,u-=u&7;u<32;){if(o===0)break e;o--,c+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=tt;break}if(r.length=c&65535,c=0,u=0,r.mode=Pg,e===hd)break e;case Pg:r.mode=CS;case CS:if(h=r.length,h){if(h>o&&(h=o),h>l&&(h=l),h===0)break e;Xr.arraySet(n,i,s,h,a),o-=h,s+=h,l-=h,a+=h,r.length-=h;break}r.mode=Un;break;case PS:for(;u<14;){if(o===0)break e;o--,c+=i[s++]<>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=tt;break}r.have=0,r.mode=RS;case RS:for(;r.have>>=3,u-=3}for(;r.have<19;)r.lens[D[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,T={bits:r.lenbits},S=Mc(IH,r.lens,0,19,r.lencode,0,r.work,T),r.lenbits=T.bits,S){t.msg="invalid code lengths set",r.mode=tt;break}r.have=0,r.mode=$S;case $S:for(;r.have>>24,b=v>>>16&255,k=v&65535,!(w<=u);){if(o===0)break e;o--,c+=i[s++]<>>=w,u-=w,r.lens[r.have++]=k;else{if(k===16){for(P=w+2;u>>=w,u-=w,r.have===0){t.msg="invalid bit length repeat",r.mode=tt;break}y=r.lens[r.have-1],h=3+(c&3),c>>>=2,u-=2}else if(k===17){for(P=w+3;u>>=w,u-=w,y=0,h=3+(c&7),c>>>=3,u-=3}else{for(P=w+7;u>>=w,u-=w,y=0,h=11+(c&127),c>>>=7,u-=7}if(r.have+h>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=tt;break}for(;h--;)r.lens[r.have++]=y}}if(r.mode===tt)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=tt;break}if(r.lenbits=9,T={bits:r.lenbits},S=Mc(US,r.lens,0,r.nlen,r.lencode,0,r.work,T),r.lenbits=T.bits,S){t.msg="invalid literal/lengths set",r.mode=tt;break}if(r.distbits=6,r.distcode=r.distdyn,T={bits:r.distbits},S=Mc(GS,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,T),r.distbits=T.bits,S){t.msg="invalid distances set",r.mode=tt;break}if(r.mode=pd,e===hd)break e;case pd:r.mode=md;case md:if(o>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=s,t.avail_in=o,r.hold=c,r.bits=u,$H(t,d),a=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,c=r.hold,u=r.bits,r.mode===Un&&(r.back=-1);break}for(r.back=0;v=r.lencode[c&(1<>>24,b=v>>>16&255,k=v&65535,!(w<=u);){if(o===0)break e;o--,c+=i[s++]<>x)],w=v>>>24,b=v>>>16&255,k=v&65535,!(x+w<=u);){if(o===0)break e;o--,c+=i[s++]<>>=x,u-=x,r.back+=x}if(c>>>=w,u-=w,r.back+=w,r.length=k,b===0){r.mode=DS;break}if(b&32){r.back=-1,r.mode=Un;break}if(b&64){t.msg="invalid literal/length code",r.mode=tt;break}r.extra=b&15,r.mode=IS;case IS:if(r.extra){for(P=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=FS;case FS:for(;v=r.distcode[c&(1<>>24,b=v>>>16&255,k=v&65535,!(w<=u);){if(o===0)break e;o--,c+=i[s++]<>x)],w=v>>>24,b=v>>>16&255,k=v&65535,!(x+w<=u);){if(o===0)break e;o--,c+=i[s++]<>>=x,u-=x,r.back+=x}if(c>>>=w,u-=w,r.back+=w,b&64){t.msg="invalid distance code",r.mode=tt;break}r.offset=k,r.extra=b&15,r.mode=OS;case OS:if(r.extra){for(P=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=tt;break}r.mode=MS;case MS:if(l===0)break e;if(h=d-l,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=tt;break}h>r.wnext?(h-=r.wnext,m=r.wsize-h):m=r.wnext-h,h>r.length&&(h=r.length),g=r.window}else g=n,m=a-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do n[a++]=g[m++];while(--h);r.length===0&&(r.mode=md);break;case DS:if(l===0)break e;n[a++]=r.length,l--,r.mode=md;break;case Rg:if(r.wrap){for(;u<32;){if(o===0)break e;o--,c|=i[s++]<{"use strict";p();KS.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var JS=I((NX,QS)=>{"use strict";p();function XH(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}QS.exports=XH});var tE=I(Lc=>{"use strict";p();var jo=ZS(),Dc=Bn(),vd=_g(),pt=Dg(),Lg=nd(),ZH=xg(),KH=JS(),eE=Object.prototype.toString;function ya(t){if(!(this instanceof ya))return new ya(t);this.options=Dc.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ZH,this.strm.avail_out=0;var r=jo.inflateInit2(this.strm,e.windowBits);if(r!==pt.Z_OK)throw new Error(Lg[r]);if(this.header=new KH,jo.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=vd.string2buf(e.dictionary):eE.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=jo.inflateSetDictionary(this.strm,e.dictionary),r!==pt.Z_OK)))throw new Error(Lg[r])}ya.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,s,a,o,l,c,u=!1;if(this.ended)return!1;a=e===~~e?e:e===!0?pt.Z_FINISH:pt.Z_NO_FLUSH,typeof t=="string"?r.input=vd.binstring2buf(t):eE.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Dc.Buf8(i),r.next_out=0,r.avail_out=i),s=jo.inflate(r,pt.Z_NO_FLUSH),s===pt.Z_NEED_DICT&&n&&(s=jo.inflateSetDictionary(this.strm,n)),s===pt.Z_BUF_ERROR&&u===!0&&(s=pt.Z_OK,u=!1),s!==pt.Z_STREAM_END&&s!==pt.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===pt.Z_STREAM_END||r.avail_in===0&&(a===pt.Z_FINISH||a===pt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(o=vd.utf8border(r.output,r.next_out),l=r.next_out-o,c=vd.buf2string(r.output,o),r.next_out=l,r.avail_out=i-l,l&&Dc.arraySet(r.output,r.output,o,l,0),this.onData(c)):this.onData(Dc.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&s!==pt.Z_STREAM_END);return s===pt.Z_STREAM_END&&(a=pt.Z_FINISH),a===pt.Z_FINISH?(s=jo.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===pt.Z_OK):(a===pt.Z_SYNC_FLUSH&&(this.onEnd(pt.Z_OK),r.avail_out=0),!0)};ya.prototype.onData=function(t){this.chunks.push(t)};ya.prototype.onEnd=function(t){t===pt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Dc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Bg(t,e){var r=new ya(e);if(r.push(t,!0),r.err)throw r.msg||Lg[r.err];return r.result}function QH(t,e){return e=e||{},e.raw=!0,Bg(t,e)}Lc.Inflate=ya;Lc.inflate=Bg;Lc.inflateRaw=QH;Lc.ungzip=Bg});var nE=I((jX,iE)=>{"use strict";p();var JH=Bn().assign,e3=aS(),t3=tE(),r3=Dg(),rE={};JH(rE,e3,t3,r3);iE.exports=rE});var oE=I((zX,aE)=>{"use strict";p();var sE=(t,e)=>function(...r){let i=e.promiseModule;return new i((n,s)=>{e.multiArgs?r.push((...a)=>{e.errorFirst?a[0]?s(a):(a.shift(),n(a)):n(a)}):e.errorFirst?r.push((a,o)=>{a?s(a):n(o)}):r.push(n),t.apply(this,r)})};aE.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);let r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);let i=s=>{let a=o=>typeof o=="string"?s===o:o.test(s);return e.include?e.include.some(a):!e.exclude.some(a)},n;r==="function"?n=function(...s){return e.excludeMain?t(...s):sE(t,e).apply(this,s)}:n=Object.create(Object.getPrototypeOf(t));for(let s in t){let a=t[s];n[s]=typeof a=="function"&&i(s)?sE(a,e):a}return n}});var gE=I((WX,mE)=>{p();function lE(t){return Array.isArray(t)?t:[t]}var Ug="",cE=" ",Ng="\\",i3=/^\s+$/,n3=/(?:[^\\]|^)\\$/,s3=/^\\!/,a3=/^\\#/,o3=/\r?\n/g,l3=/^\.*\/|^\.+$/,Hg="/",dE="node-ignore";typeof Symbol!="undefined"&&(dE=Symbol.for("node-ignore"));var uE=dE,c3=(t,e,r)=>Object.defineProperty(t,e,{value:r}),u3=/([0-z])-([0-z])/g,hE=()=>!1,f3=t=>t.replace(u3,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:Ug),d3=t=>{let{length:e}=t;return t.slice(0,e-e%2)},h3=[[/^\uFEFF/,()=>Ug],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?cE:Ug)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+cE}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Ng],[/\\\\/g,()=>Ng],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>e===Ng?`\\[${r}${d3(i)}${n}`:n==="]"&&i.length%2===0?`[${f3(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],fE=Object.create(null),p3=(t,e)=>{let r=fE[t];return r||(r=h3.reduce((i,[n,s])=>i.replace(n,s.bind(t)),t),fE[t]=r),e?new RegExp(r,"i"):new RegExp(r)},qg=t=>typeof t=="string",m3=t=>t&&qg(t)&&!i3.test(t)&&!n3.test(t)&&t.indexOf("#")!==0,g3=t=>t.split(o3),Gg=class{constructor(e,r,i,n){this.origin=e,this.pattern=r,this.negative=i,this.regex=n}},v3=(t,e)=>{let r=t,i=!1;t.indexOf("!")===0&&(i=!0,t=t.substr(1)),t=t.replace(s3,"!").replace(a3,"#");let n=p3(t,e);return new Gg(r,t,i,n)},w3=(t,e)=>{throw new e(t)},Gn=(t,e,r)=>qg(t)?t?Gn.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),pE=t=>l3.test(t);Gn.isNotRelative=pE;Gn.convert=t=>t;var jg=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){c3(this,uE,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[uE]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(m3(e)){let r=v3(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,lE(qg(e)?g3(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,r){let i=!1,n=!1;return this._rules.forEach(s=>{let{negative:a}=s;if(n===a&&i!==n||a&&!i&&!n&&!r)return;s.regex.test(e)&&(i=!a,n=a)}),{ignored:i,unignored:n}}_test(e,r,i,n){let s=e&&Gn.convert(e);return Gn(s,e,this._allowRelativePaths?hE:w3),this._t(s,r,i,n)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(Hg)),n.pop(),!n.length)return r[e]=this._testOne(e,i);let s=this._t(n.join(Hg)+Hg,r,i,n);return r[e]=s.ignored?s:this._testOne(e,i)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return lE(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},wd=t=>new jg(t),y3=t=>Gn(t&&Gn.convert(t),t,hE);wd.isPathValid=y3;wd.default=wd;mE.exports=wd;if(typeof process!="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Gn.convert=t;let e=/^[a-z]:\//i;Gn.isNotRelative=r=>e.test(r)||pE(r)}});var wE=I((XX,vE)=>{"use strict";p();function b3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ln(t,e,r){return e=e instanceof RegExp?e:new RegExp(b3(e),"g"),t.replace(e,r)}var _3={clean:function(e){if(typeof e!="string")throw new Error("Expected a string, received: "+e);return e=ln(e,"./","/"),e=ln(e,"..","."),e=ln(e," ","-"),e=ln(e,/^[~^:?*\\\-]/g,""),e=ln(e,/[~^:?*\\]/g,"-"),e=ln(e,/[~^:?*\\\-]$/g,""),e=ln(e,"@{","-"),e=ln(e,/\.$/g,""),e=ln(e,/\/$/g,""),e=ln(e,/\.lock$/g,""),e}};vE.exports=_3});var bE=I((KX,yE)=>{p();yE.exports=function(t,e){var r=t,i=e,n=r.length,s=i.length,a=!1,o=null,l=n+1,c=[],u=[],f=[],d="",h=-1,m=0,g=1,v,w,b=function(){n>=s&&(v=r,w=n,r=i,i=v,n=s,s=w,a=!0,l=n+1)},k=function(y,S,_){return{x:y,y:S,k:_}},x=function(y,S){return{elem:y,t:S}},E=function(y,S,_){var T,P,D;for(S>_?T=c[y-1+l]:T=c[y+1+l],D=Math.max(S,_),P=D-y;P=0;--D)for(;TP-T?(a?f[f.length]=new x(i[P],h):f[f.length]=new x(i[P],g),++_,++P):y[D].y-y[D].x=y+1;--N)_[N+l]=E(N,_[N-1+l]+1,_[N+1+l]);_[y+l]=E(y,_[y-1+l]+1,_[y+1+l])}while(_[y+l]!==s);for(o=y+2*T,P=c[y+l],D=[];P!==-1;)D[D.length]=new k(u[P].x,u[P].y,null),P=u[P].k;A(D)}}}});var SE=I((JX,xE)=>{p();var x3=bE();function S3(t,e){var r=new x3(t,e);r.compose();for(var i=r.getses(),n,s,a=t.length-1,o=e.length-1,l=i.length-1;l>=0;--l)i[l].t===r.SES_COMMON?(s?(s.chain={file1index:a,file2index:o,chain:null},s=s.chain):(n={file1index:a,file2index:o,chain:null},s=n),a--,o--):i[l].t===r.SES_DELETE?a--:i[l].t===r.SES_ADD&&o--;var c={file1index:-1,file2index:-1,chain:null};return s?(s.chain=c,n):c}function _E(t,e){for(var r=[],i=t.length,n=e.length,s=S3(t,e);s!==null;s=s.chain){var a=i-s.file1index-1,o=n-s.file2index-1;i=s.file1index,n=s.file2index,(a||o)&&r.push({file1:[i+1,a],file2:[n+1,o]})}return r.reverse(),r}function E3(t,e,r){var i,n=_E(e,t),s=_E(e,r),a=[];function o(B,N){a.push([B.file1[0],N,B.file1[1],B.file2[0],B.file2[1]])}for(i=0;ic&&(l.push([1,c,B-c]),c=B)}for(var f=0;fg)break;g=Math.max(g,w+v[2]),f++}if(u(m),d==f)h[4]>0&&l.push([h[1],h[3],h[4]]);else{var b={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=d;i<=f;i++){h=a[i];var k=h[1],x=b[k],E=h[0],A=E+h[2],y=h[3],S=y+h[4];x[0]=Math.min(y,x[0]),x[1]=Math.max(S,x[1]),x[2]=Math.min(E,x[2]),x[3]=Math.max(A,x[3])}var _=b[0][0]+(m-b[0][2]),T=b[0][1]+(g-b[0][3]),P=b[2][0]+(m-b[2][2]),D=b[2][1]+(g-b[2][3]);l.push([-1,_,T-_,m,g-m,P,D-P])}c=g}return u(e.length),l}function k3(t,e,r){var i=[],n=[t,e,r],s=E3(t,e,r),a=[];function o(){a.length&&i.push({ok:a}),a=[]}function l(h){for(var m=0;m{"use strict";p();Object.defineProperty(X,"__esModule",{value:!0});function Ms(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Nc=Ms(u_()),VE=Ms(m1()),A3=Ms(v1()),mv=Ms(nE()),yd=Ms(oE()),T3=Ms(gE()),Hc=Ms(wE()),C3=Ms(SE()),Re=class t extends Error{constructor(e){super(e),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(e){let r=new t(e.message);return r.code=e.code,r.data=e.data,r.caller=e.caller,r.stack=e.stack,r}get isIsomorphicGitError(){return!0}},Uc=class t extends Re{constructor(e){super(`Modifying the index is not possible because you have unmerged files: ${e.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=t.code,this.data={filepaths:e}}};Uc.code="UnmergedPathsError";var he=class t extends Re{constructor(e){super(`An internal error caused this command to fail. + +If you're not a developer, report the bug to the developers of the application you're using. If this is a bug in isomorphic-git then you should create a proper bug yourselves. The bug should include a minimal reproduction and details about the version and environment. + +Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${e}`),this.code=this.name=t.code,this.data={message:e}}};he.code="InternalError";var zo=class t extends Re{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=t.code,this.data={filepath:e}}};zo.code="UnsafeFilepathError";var mi=class{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let r=this.buffer.slice(this._start,this._start+e);return this._start+=e,r}toString(e,r){let i=this.buffer.toString(e,this._start,this._start+r);return this._start+=r,i}write(e,r,i){let n=this.buffer.write(e,this._start,r,i);return this._start+=r,n}copy(e,r,i){let n=e.copy(this.buffer,this._start,r,i);return this._start+=n,n}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let r=this.buffer.writeUInt8(e,this._start);return this._start+=1,r}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let r=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,r}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let r=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,r}};function Id(t,e){return-(te)}function WE(t,e){return Id(t.path,e.path)}function YE(t){let e=t>0?t>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let r=t&511;return r&73?r=493:r=420,e!==8&&(r=0),(e<<12)+r}var cn=2**32;function EE(t,e,r,i){if(t!==void 0&&e!==void 0)return[t,e];r===void 0&&(r=i.valueOf());let n=Math.floor(r/1e3),s=(r-n*1e3)*1e6;return[n,s]}function Vo(t){let[e,r]=EE(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[i,n]=EE(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%cn,ctimeNanoseconds:r%cn,mtimeSeconds:i%cn,mtimeNanoseconds:n%cn,dev:t.dev%cn,ino:t.ino%cn,mode:YE(t.mode%cn),uid:t.uid%cn,gid:t.gid%cn,size:t.size>-1?t.size%cn:0}}function P3(t){let e="";for(let r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}var zg=null;async function qn(t){return zg===null&&(zg=await $3()),zg?XE(t):R3(t)}function R3(t){return new VE().update(t).digest("hex")}async function XE(t){let e=await crypto.subtle.digest("SHA-1",t);return P3(e)}async function $3(){try{return await XE(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch(t){}return!1}function I3(t){return{assumeValid:!!(t&32768),extended:!!(t&16384),stage:(t&12288)>>12,nameLength:t&4095}}function F3(t){let e=t.flags;return e.extended=!1,e.nameLength=Math.min(Buffer.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}var iv=class t{constructor(e,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let r=this._entries.get(e.path);r||(this._entries.set(e.path,e),r=e),r.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(Buffer.isBuffer(e))return t.fromBuffer(e);if(e===null)return new t(null);throw new he("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new he("Index file is empty (.git/index)");let r=new t,i=new mi(e),n=i.toString("utf8",4);if(n!=="DIRC")throw new he(`Invalid dircache magic file number: ${n}`);let s=await qn(e.slice(0,-20)),a=e.slice(-20).toString("hex");if(a!==s)throw new he(`Invalid checksum in GitIndex buffer: expected ${a} but saw ${s}`);let o=i.readUInt32BE();if(o!==2)throw new he(`Unsupported dircache version: ${o}`);let l=i.readUInt32BE(),c=0;for(;!i.eof()&&ce.stages.length>1?e.stages.filter(r=>r):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:r,oid:i,stage:n=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),r=Vo(r);let s=Buffer.from(e),a={ctimeSeconds:r.ctimeSeconds,ctimeNanoseconds:r.ctimeNanoseconds,mtimeSeconds:r.mtimeSeconds,mtimeNanoseconds:r.mtimeNanoseconds,dev:r.dev,ino:r.ino,mode:r.mode||33188,uid:r.uid,gid:r.gid,size:r.size,path:e,oid:i,flags:{assumeValid:!1,extended:!1,stage:n,nameLength:s.length<4095?s.length:4095},stages:[]};this._addEntry(a),this._dirty=!0}delete({filepath:e}){if(this._entries.has(e))this._entries.delete(e);else for(let r of this._entries.keys())r.startsWith(e+"/")&&this._entries.delete(r);this._unmergedPaths.has(e)&&this._unmergedPaths.delete(e),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:e}){return this._entries.has(e)}render(){return this.entries.map(e=>`${e.mode.toString(8)} ${e.oid} ${e.path}`).join(` +`)}static async _entryToBuffer(e){let r=Buffer.from(e.path),i=Math.ceil((62+r.length+1)/8)*8,n=Buffer.alloc(i),s=new mi(n),a=Vo(e);return s.writeUInt32BE(a.ctimeSeconds),s.writeUInt32BE(a.ctimeNanoseconds),s.writeUInt32BE(a.mtimeSeconds),s.writeUInt32BE(a.mtimeNanoseconds),s.writeUInt32BE(a.dev),s.writeUInt32BE(a.ino),s.writeUInt32BE(a.mode),s.writeUInt32BE(a.uid),s.writeUInt32BE(a.gid),s.writeUInt32BE(a.size),s.write(e.oid,20,"hex"),s.writeUInt16BE(F3(e)),s.write(e.path,r.length,"utf8"),n}async toObject(){let e=Buffer.alloc(12),r=new mi(e);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let i=[];for(let o of this.entries)if(i.push(t._entryToBuffer(o)),o.stages.length>1)for(let l of o.stages)l&&l!==o&&i.push(t._entryToBuffer(l));i=await Promise.all(i);let n=Buffer.concat(i),s=Buffer.concat([e,n]),a=await qn(s);return Buffer.concat([s,Buffer.from(a,"hex")])}};function xd(t,e,r=!0,i=!0){let n=Vo(t),s=Vo(e);return r&&n.mode!==s.mode||n.mtimeSeconds!==s.mtimeSeconds||n.ctimeSeconds!==s.ctimeSeconds||n.uid!==s.uid||n.gid!==s.gid||i&&n.ino!==s.ino||n.size!==s.size}var Vg=null,Wg=Symbol("IndexCache");function O3(){return{map:new Map,stats:new Map}}async function M3(t,e,r){let[i,n]=await Promise.all([t.lstat(e),t.read(e)]),s=await iv.from(n);r.map.set(e,s),r.stats.set(e,i)}async function D3(t,e,r){let i=r.stats.get(e);if(i===void 0)return!0;if(i===null)return!1;let n=await t.lstat(e);return n===null?!1:xd(i,n)}var mt=class{static async acquire({fs:e,gitdir:r,cache:i,allowUnmerged:n=!0},s){i[Wg]||(i[Wg]=O3());let a=`${r}/index`;Vg===null&&(Vg=new Nc({maxPending:1/0}));let o,l=[];return await Vg.acquire(a,async()=>{let c=i[Wg];await D3(e,a,c)&&await M3(e,a,c);let u=c.map.get(a);if(l=u.unmergedPaths,l.length&&!n)throw new Uc(l);if(o=await s(u),u._dirty){let f=await u.toObject();await e.write(a,f),c.stats.set(a,await e.lstat(a)),u._dirty=!1}}),o}};function Sd(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function xa(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?".":e===0?"/":t.slice(0,e)}function ZE(t){let e=new Map,r=function(n){if(!e.has(n)){let s={type:"tree",fullpath:n,basename:Sd(n),metadata:{},children:[]};e.set(n,s),s.parent=r(xa(n)),s.parent&&s.parent!==s&&s.parent.children.push(s)}return e.get(n)},i=function(n,s){if(!e.has(n)){let a={type:"blob",fullpath:n,basename:Sd(n),metadata:s,parent:r(xa(n)),children:[]};a.parent&&a.parent.children.push(a),e.set(n,a)}return e.get(n)};r(".");for(let n of t)i(n.path,n);return e}function L3(t){switch(t){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new he(`Unexpected GitTree entry mode: ${t.toString(8)}`)}var nv=class{constructor({fs:e,gitdir:r,cache:i}){this.treePromise=mt.acquire({fs:e,gitdir:r,cache:i},async function(s){return ZE(s.entries)});let n=this;this.ConstructEntry=class{constructor(a){this._fullpath=a,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return n.type(this)}async mode(){return n.mode(this)}async stat(){return n.stat(this)}async content(){return n.content(this)}async oid(){return n.oid(this)}}}async readdir(e){let r=e._fullpath,n=(await this.treePromise).get(r);if(!n||n.type==="blob")return null;if(n.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${r}'`);let s=n.children.map(a=>a.fullpath);return s.sort(Id),s}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let i=(await this.treePromise).get(e._fullpath);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let n=i.type==="tree"?{}:Vo(i.metadata);e._type=i.type==="tree"?"tree":L3(n.mode),e._mode=n.mode,i.type==="tree"?e._stat=void 0:e._stat=n}return e._stat}async content(e){}async oid(e){if(e._oid===!1){let i=(await this.treePromise).get(e._fullpath);e._oid=i.metadata.oid}return e._oid}},Fd=Symbol("GitWalkSymbol");function Aa(){let t=Object.create(null);return Object.defineProperty(t,Fd,{value:function({fs:e,gitdir:r,cache:i}){return new nv({fs:e,gitdir:r,cache:i})}}),Object.freeze(t),t}var He=class t extends Re{constructor(e){super(`Could not find ${e}.`),this.code=this.name=t.code,this.data={what:e}}};He.code="NotFoundError";var hr=class t extends Re{constructor(e,r,i,n){super(`Object ${e} ${n?`at ${n}`:""}was anticipated to be a ${i} but it is a ${r}.`),this.code=this.name=t.code,this.data={oid:e,actual:r,expected:i,filepath:n}}};hr.code="ObjectTypeError";var Ps=class t extends Re{constructor(e){super(`Expected a 40-char hex object id but saw "${e}".`),this.code=this.name=t.code,this.data={value:e}}};Ps.code="InvalidOidError";var Gc=class t extends Re{constructor(e){super(`Could not find a fetch refspec for remote "${e}". Make sure the config file has an entry like the following: +[remote "${e}"] + fetch = +refs/heads/*:refs/remotes/origin/* +`),this.code=this.name=t.code,this.data={remote:e}}};Gc.code="NoRefspecError";var Ed=class t{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let r=null;this.parsedConfig=e.trim().split(` +`).map(i=>{if(/^\s*#/.test(i))return{line:i,comment:!0};let n=i.indexOf(" ");if(i.startsWith("^")){let s=i.slice(1);return this.refs.set(r+"^{}",s),{line:i,ref:r,peeled:s}}else{let s=i.slice(0,n);return r=i.slice(n+1),this.refs.set(r,s),{line:i,ref:r,oid:s}}})}return this}static from(e){return new t(e)}delete(e){this.parsedConfig=this.parsedConfig.filter(r=>r.ref!==e),this.refs.delete(e)}toString(){return this.parsedConfig.map(({line:e})=>e).join(` +`)+` +`}},kd=class t{constructor({remotePath:e,localPath:r,force:i,matchPrefix:n}){Object.assign(this,{remotePath:e,localPath:r,force:i,matchPrefix:n})}static from(e){let[r,i,n,s,a]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),o=r==="+",l=n==="*";if(l!==(a==="*"))throw new he("Invalid refspec");return new t({remotePath:i,localPath:s,force:o,matchPrefix:l})}translate(e){if(this.matchPrefix){if(e.startsWith(this.remotePath))return this.localPath+e.replace(this.remotePath,"")}else if(e===this.remotePath)return this.localPath;return null}reverseTranslate(e){if(this.matchPrefix){if(e.startsWith(this.localPath))return this.remotePath+e.replace(this.localPath,"")}else if(e===this.localPath)return this.remotePath;return null}},sv=class t{constructor(e=[]){this.rules=e}static from(e){let r=[];for(let i of e)r.push(kd.from(i));return new t(r)}add(e){let r=kd.from(e);this.rules.push(r)}translate(e){let r=[];for(let i of this.rules)for(let n of e){let s=i.translate(n);s&&r.push([n,s])}return r}translateOne(e){let r=null;for(let i of this.rules){let n=i.translate(e);n&&(r=n)}return r}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};function B3(t,e){let r=t.replace(/\^\{\}$/,""),i=e.replace(/\^\{\}$/,""),n=-(ri);return n===0?t.endsWith("^{}")?1:-1:n}function N3(t,e){let r="",i=0,n=-1,s=0,a="\0";for(let o=0;o<=t.length;++o){if(o2){let l=r.lastIndexOf("/");l===-1?(r="",i=0):(r=r.slice(0,l),i=r.length-1-r.lastIndexOf("/")),n=o,s=0;continue}else if(r.length!==0){r="",i=0,n=o,s=0;continue}}e&&(r+=r.length>0?"/..":"..",i=2)}else r.length>0?r+="/"+t.slice(n+1,o):r=t.slice(n+1,o),i=o-n-1;n=o,s=0}else a==="."&&s!==-1?++s:s=-1}return r}function H3(t){if(!t.length)return".";let e=t[0]==="/",r=t.at(-1)==="/";return t=N3(t,!e),t.length?(r&&(t+="/"),e?`/${t}`:t):e?"/":r?"./":"."}function O(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":H3(e)}var U3=t=>{if(typeof t=="number")return t;t=t.toLowerCase();let e=parseInt(t);return t.endsWith("k")&&(e*=1024),t.endsWith("m")&&(e*=1024*1024),t.endsWith("g")&&(e*=1024*1024*1024),e},Bc=t=>{if(typeof t=="boolean")return t;if(t=t.trim().toLowerCase(),t==="true"||t==="yes"||t==="on")return!0;if(t==="false"||t==="no"||t==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${t}`)},kE={core:{filemode:Bc,bare:Bc,logallrefupdates:Bc,symlinks:Bc,ignorecase:Bc,bigFileThreshold:U3}},G3=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,j3=/^[A-Za-z0-9-.]+$/,q3=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,z3=/^[A-Za-z][A-Za-z-]*$/,V3=/^(.*?)( *[#;].*)$/,W3=t=>{let e=G3.exec(t);if(e!=null){let[r,i]=e.slice(1);return[r,i]}return null},Y3=t=>{let e=q3.exec(t);if(e!=null){let[r,i="true"]=e.slice(1),n=X3(i),s=Z3(n);return[r,s]}return null},X3=t=>{let e=V3.exec(t);if(e==null)return t;let[r,i]=e.slice(1);return AE(r)&&AE(i)?`${r}${i}`:r},AE=t=>(t.match(/(?:^|[^\\])"/g)||[]).length%2!==0,Z3=t=>t.split("").reduce((e,r,i,n)=>{let s=r==='"'&&n[i-1]!=="\\",a=r==="\\"&&n[i+1]==='"';return s||a?e:e+r},""),TE=t=>t!=null?t.toLowerCase():null,av=(t,e,r)=>[TE(t),e,TE(r)].filter(i=>i!=null).join("."),CE=t=>{let e=t.split("."),r=e.shift(),i=e.pop(),n=e.length?e.join("."):void 0;return{section:r,subsection:n,name:i,path:av(r,n,i),sectionPath:av(r,n,null),isSection:!!r}},K3=(t,e)=>t.reduce((r,i,n)=>e(i)?n:r,-1),ov=class t{constructor(e){let r=null,i=null;this.parsedConfig=e?e.split(` +`).map(n=>{let s=null,a=null,o=n.trim(),l=W3(o),c=l!=null;if(c)[r,i]=l;else{let f=Y3(o);f!=null&&([s,a]=f)}let u=av(r,i,s);return{line:n,isSection:c,section:r,subsection:i,name:s,value:a,path:u}}):[]}static from(e){return new t(e)}async get(e,r=!1){let i=CE(e).path,n=this.parsedConfig.filter(s=>s.path===i).map(({section:s,name:a,value:o})=>{let l=kE[s]&&kE[s][a];return l?l(o):o});return r?n:n.pop()}async getall(e){return this.get(e,!0)}async getSubsections(e){return this.parsedConfig.filter(r=>r.isSection&&r.section===e).map(r=>r.subsection)}async deleteSection(e,r){this.parsedConfig=this.parsedConfig.filter(i=>!(i.section===e&&i.subsection===r))}async append(e,r){return this.set(e,r,!0)}async set(e,r,i=!1){let{section:n,subsection:s,name:a,path:o,sectionPath:l,isSection:c}=CE(e),u=K3(this.parsedConfig,f=>f.path===o);if(r==null)u!==-1&&this.parsedConfig.splice(u,1);else if(u!==-1){let f=this.parsedConfig[u],d=Object.assign({},f,{name:a,value:r,modified:!0});i?this.parsedConfig.splice(u+1,0,d):this.parsedConfig[u]=d}else{let f=this.parsedConfig.findIndex(h=>h.path===l),d={section:n,subsection:s,name:a,value:r,modified:!0,path:o};if(j3.test(n)&&z3.test(a))if(f>=0)this.parsedConfig.splice(f+1,0,d);else{let h={isSection:c,section:n,subsection:s,modified:!0,path:l};this.parsedConfig.push(h,d)}}}toString(){return this.parsedConfig.map(({line:e,section:r,subsection:i,name:n,value:s,modified:a=!1})=>a?n!=null&&s!=null?typeof s=="string"&&/[#;]/.test(s)?` ${n} = "${s}"`:` ${n} = ${s}`:i!=null?`[${r} "${i}"]`:`[${r}]`:e).join(` +`)}},ct=class{static async get({fs:e,gitdir:r}){let i=await e.read(`${r}/config`,{encoding:"utf8"});return ov.from(i)}static async save({fs:e,gitdir:r,config:i}){await e.write(`${r}/config`,i.toString(),{encoding:"utf8"})}},bd=t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],Q3=["config","description","index","shallow","commondir"],Yg;async function Ts(t,e){return Yg===void 0&&(Yg=new Nc),Yg.acquire(t,e)}var W=class t{static async updateRemoteRefs({fs:e,gitdir:r,remote:i,refs:n,symrefs:s,tags:a,refspecs:o=void 0,prune:l=!1,pruneTags:c=!1}){for(let v of n.values())if(!v.match(/[0-9a-f]{40}/))throw new Ps(v);let u=await ct.get({fs:e,gitdir:r});if(!o){if(o=await u.getall(`remote.${i}.fetch`),o.length===0)throw new Gc(i);o.unshift(`+HEAD:refs/remotes/${i}/HEAD`)}let f=sv.from(o),d=new Map;if(c){let v=await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"});await t.deleteRefs({fs:e,gitdir:r,refs:v.map(w=>`refs/tags/${w}`)})}if(a){for(let v of n.keys())if(v.startsWith("refs/tags")&&!v.endsWith("^{}")&&!await t.exists({fs:e,gitdir:r,ref:v})){let w=n.get(v);d.set(v,w)}}let h=f.translate([...n.keys()]);for(let[v,w]of h){let b=n.get(v);d.set(w,b)}let m=f.translate([...s.keys()]);for(let[v,w]of m){let b=s.get(v),k=f.translateOne(b);k&&d.set(w,`ref: ${k}`)}let g=[];if(l){for(let v of f.localNamespaces()){let w=(await t.listRefs({fs:e,gitdir:r,filepath:v})).map(b=>`${v}/${b}`);for(let b of w)d.has(b)||g.push(b)}g.length>0&&await t.deleteRefs({fs:e,gitdir:r,refs:g})}for(let[v,w]of d)await Ts(v,async()=>e.write(O(r,v),`${w.trim()} +`,"utf8"));return{pruned:g}}static async writeRef({fs:e,gitdir:r,ref:i,value:n}){if(!n.match(/[0-9a-f]{40}/))throw new Ps(n);await Ts(i,async()=>e.write(O(r,i),`${n.trim()} +`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:r,ref:i,value:n}){await Ts(i,async()=>e.write(O(r,i),`ref: ${n.trim()} +`,"utf8"))}static async deleteRef({fs:e,gitdir:r,ref:i}){return t.deleteRefs({fs:e,gitdir:r,refs:[i]})}static async deleteRefs({fs:e,gitdir:r,refs:i}){await Promise.all(i.map(o=>e.rm(O(r,o))));let n=await Ts("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"})),s=Ed.from(n),a=s.refs.size;for(let o of i)s.refs.has(o)&&s.delete(o);s.refs.sizee.write(`${r}/packed-refs`,n,{encoding:"utf8"})))}static async resolve({fs:e,gitdir:r,ref:i,depth:n=void 0}){if(n!==void 0&&(n--,n===-1))return i;if(i.startsWith("ref: "))return i=i.slice(5),t.resolve({fs:e,gitdir:r,ref:i,depth:n});if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let s=await t.packedRefs({fs:e,gitdir:r}),a=bd(i).filter(o=>!Q3.includes(o));for(let o of a){let l=await Ts(o,async()=>await e.read(`${r}/${o}`,{encoding:"utf8"})||s.get(o));if(l)return t.resolve({fs:e,gitdir:r,ref:l.trim(),depth:n})}throw new He(i)}static async exists({fs:e,gitdir:r,ref:i}){try{return await t.expand({fs:e,gitdir:r,ref:i}),!0}catch(n){return!1}}static async expand({fs:e,gitdir:r,ref:i}){if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let n=await t.packedRefs({fs:e,gitdir:r}),s=bd(i);for(let a of s)if(await Ts(a,async()=>e.exists(`${r}/${a}`))||n.has(a))return a;throw new He(i)}static async expandAgainstMap({ref:e,map:r}){let i=bd(e);for(let n of i)if(await r.has(n))return n;throw new He(e)}static resolveAgainstMap({ref:e,fullref:r=e,depth:i=void 0,map:n}){if(i!==void 0&&(i--,i===-1))return{fullref:r,oid:e};if(e.startsWith("ref: "))return e=e.slice(5),t.resolveAgainstMap({ref:e,fullref:r,depth:i,map:n});if(e.length===40&&/[0-9a-f]{40}/.test(e))return{fullref:r,oid:e};let s=bd(e);for(let a of s){let o=n.get(a);if(o)return t.resolveAgainstMap({ref:o.trim(),fullref:a,depth:i,map:n})}throw new He(e)}static async packedRefs({fs:e,gitdir:r}){let i=await Ts("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"}));return Ed.from(i).refs}static async listRefs({fs:e,gitdir:r,filepath:i}){let n=t.packedRefs({fs:e,gitdir:r}),s=null;try{s=await e.readdirDeep(`${r}/${i}`),s=s.map(a=>a.replace(`${r}/${i}/`,""))}catch(a){s=[]}for(let a of(await n).keys())a.startsWith(i)&&(a=a.replace(i+"/",""),s.includes(a)||s.push(a));return s.sort(B3),s}static async listBranches({fs:e,gitdir:r,remote:i}){return i?t.listRefs({fs:e,gitdir:r,filepath:`refs/remotes/${i}`}):t.listRefs({fs:e,gitdir:r,filepath:"refs/heads"})}static async listTags({fs:e,gitdir:r}){return(await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"})).filter(n=>!n.endsWith("^{}"))}};function J3(t,e){return Id(PE(t),PE(e))}function PE(t){return t.mode==="040000"?t.path+"/":t.path}function KE(t){switch(t){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new he(`Unexpected GitTree entry mode: ${t}`)}function e8(t){let e=[],r=0;for(;r`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(` +`)}toObject(){let e=[...this._entries];return e.sort(J3),Buffer.concat(e.map(r=>{let i=Buffer.from(r.mode.replace(/^0/,"")),n=Buffer.from(" "),s=Buffer.from(r.path,"utf8"),a=Buffer.from([0]),o=Buffer.from(r.oid,"hex");return Buffer.concat([i,n,s,a,o])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}},Rs=class{static wrap({type:e,object:r}){let i=`${e} ${r.length}\0`,n=i.length,s=n+r.length,a=new Uint8Array(s);for(let o=0;o>=1,n+=8;return i}function IE(t,e){let r=t.readUInt8(),i=128,n=15,s=112;if(r&i){let a=$E(t,r&n,4),o=$E(t,(r&s)>>4,3);return o===0&&(o=65536),e.slice(a,a+o)}else return t.slice(r)}function n8(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}function JE(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:n8(t)}var Ad=class{constructor(e){if(typeof Buffer=="undefined")throw new Error("Missing Buffer dependency");this.stream=JE(e),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(e){if(!this.eof())return this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e),this.buffer.slice(this.undoCursor,this.cursor)}async skip(e){this.eof()||(this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:e,value:r}=await this.stream.next();return e&&(this._ended=!0,!r)?Buffer.alloc(0):(r&&(r=Buffer.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(e){this.undoCursor=this.cursor,this.cursor+=e,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(e){if(this._ended)return;let r=[this.buffer];for(;this.cursor+e>s8(r);){let i=await this._next();if(this._ended)break;r.push(i)}this.buffer=Buffer.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}};function s8(t){return t.reduce((e,r)=>e+r.length,0)}async function a8(t,e){let r=new Ad(t),i=await r.read(4);if(i=i.toString("utf8"),i!=="PACK")throw new he(`Invalid PACK header '${i}'`);let n=await r.read(4);if(n=n.readUInt32BE(0),n!==2)throw new he(`Invalid packfile version: ${n}`);let s=await r.read(4);if(s=s.readUInt32BE(0),!(s<1))for(;!r.eof()&&s--;){let a=r.tell(),{type:o,length:l,ofs:c,reference:u}=await o8(r),f=new mv.Inflate;for(;!f.result;){let d=await r.chunk();if(!d)break;if(f.push(d,!1),f.err)throw new he(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==l)throw new he("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(d.length-f.strm.avail_in);let h=r.tell();await e({data:f.result,type:o,num:s,offset:a,end:h,reference:u,ofs:c})}}}}async function o8(t){let e=await t.byte(),r=e>>4&7,i=e&15;if(e&128){let a=4;do e=await t.byte(),i|=(e&127)<n+1<<7|s,-1)}function f8(t,e){let r=e,i=4,n=null;do n=t.readUInt8(),r|=(n&127)<2048*1024*1024)throw new he("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");i.seek(i.tell()+4*255);let a=i.readUInt32BE(),o=[];for(let u=0;u{u===null&&(u=x);let E=Math.floor((u-x)*100/u);E!==f&&i&&await i({phase:"Receiving objects",loaded:u-x,total:u}),f=E,w=n[w],["commit","tree","blob","tag"].includes(w)?s[k]={type:w,offset:k}:w==="ofs-delta"?s[k]={type:w,offset:k}:w==="ref-delta"&&(s[k]={type:w,offset:k})});let d=Object.keys(s).map(Number);for(let[v,w]of d.entries()){let b=v+1===d.length?e.byteLength-20:d[v+1],k=s[w],x=A3.buf(e.slice(w,b))>>>0;k.end=b,k.crc=x}let h=new t({pack:Promise.resolve(e),packfileSha:a,crcs:l,hashes:o,offsets:c,getExternalRefDelta:r});f=null;let m=0,g=[0,0,0,0,0,0,0,0,0,0,0,0];for(let v in s){v=Number(v);let w=Math.floor(m*100/u);w!==f&&i&&await i({phase:"Resolving deltas",loaded:m,total:u}),m++,f=w;let b=s[v];if(!b.oid)try{h.readDepth=0,h.externalReadDepth=0;let{type:k,object:x}=await h.readSlice({start:v});g[h.readDepth]+=1;let E=await qn(Rs.wrap({type:k,object:x}));b.oid=E,o.push(E),c.set(E,v),l[E]=b.crc}catch(k){continue}}return o.sort(),h}async toBuffer(){let e=[],r=(c,u)=>{e.push(Buffer.from(c,u))};r("ff744f63","hex"),r("00000002","hex");let i=new mi(Buffer.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(let f of this.hashes)parseInt(f.slice(0,2),16)<=c&&u++;i.writeUInt32BE(u)}e.push(i.buffer);for(let c of this.hashes)r(c,"hex");let n=new mi(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)n.writeUInt32BE(this.crcs[c]);e.push(n.buffer);let s=new mi(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)s.writeUInt32BE(this.offsets.get(c));e.push(s.buffer),r(this.packfileSha,"hex");let a=Buffer.concat(e),o=await qn(a),l=Buffer.alloc(20);return l.write(o,"hex"),Buffer.concat([a,l])}async load({pack:e}){this.pack=e}async unload(){this.pack=null}async read({oid:e}){if(!this.offsets.get(e)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(e);throw new he(`Could not read object ${e} from packfile`)}let r=this.offsets.get(e);return this.readSlice({start:r})}async readSlice({start:e}){if(this.offsetCache[e])return Object.assign({},this.offsetCache[e]);this.readDepth++;let r={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"};if(!this.pack)throw new he("Tried to read from a GitPackIndex with no packfile loaded into memory");let i=(await this.pack).slice(e),n=new mi(i),s=n.readUInt8(),a=s&112,o=r[a];if(o===void 0)throw new he("Unrecognized type: 0b"+a.toString(2));let l=s&15,c=l;s&128&&(c=f8(n,l));let f=null,d=null;if(o==="ofs_delta"){let m=u8(n),g=e-m;({object:f,type:o}=await this.readSlice({start:g}))}if(o==="ref_delta"){let m=n.slice(20).toString("hex");({object:f,type:o}=await this.read({oid:m}))}let h=i.slice(n.tell());if(d=Buffer.from(await ek(h)),d.byteLength!==c)throw new he(`Packfile told us object would have length ${c} but it had length ${d.byteLength}`);return f&&(d=Buffer.from(i8(d,f))),this.readDepth>3&&(this.offsetCache[e]={type:o,object:d}),{type:o,format:"content",object:d}}},_d=Symbol("PackfileCache");async function d8({fs:t,filename:e,getExternalRefDelta:r,emitter:i,emitterPrefix:n}){let s=await t.read(e);return jc.fromIdx({idx:s,getExternalRefDelta:r})}function gv({fs:t,cache:e,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:s}){e[_d]||(e[_d]=new Map);let a=e[_d].get(r);return a||(a=d8({fs:t,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:s}),e[_d].set(r,a)),a}async function h8({fs:t,cache:e,gitdir:r,oid:i,format:n="content",getExternalRefDelta:s}){let a=await t.readdir(O(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(let o of a){let l=`${r}/objects/pack/${o}`,c=await gv({fs:t,cache:e,filename:l,getExternalRefDelta:s});if(c.error)throw new he(c.error);if(c.offsets.has(i)){if(!c.pack){let f=l.replace(/idx$/,"pack");c.pack=t.read(f)}let u=await c.read({oid:i,getExternalRefDelta:s});return u.format="content",u.source=`objects/pack/${o.replace(/idx$/,"pack")}`,u}}return null}async function Ke({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let s=u=>Ke({fs:t,cache:e,gitdir:r,oid:u}),a;if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(a={format:"wrapped",object:Buffer.from("tree 0\0")}),a||(a=await QE({fs:t,gitdir:r,oid:i})),!a){if(a=await h8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:s}),!a)throw new He(i);return a}if(n==="deflated"||(a.format==="deflated"&&(a.object=Buffer.from(await ek(a.object)),a.format="wrapped"),n==="wrapped"))return a;let o=await qn(a.object);if(o!==i)throw new he(`SHA check failed! Expected ${i}, computed ${o}`);let{object:l,type:c}=Rs.unwrap(a.object);if(a.type=c,a.object=l,a.format="content",n==="content")return a;throw new he(`invalid requested format "${n}"`)}var $i=class t extends Re{constructor(e,r,i=!0){super(`Failed to create ${e} at ${r} because it already exists.${i?` (Hint: use 'force: true' parameter to overwrite existing ${e}.)`:""}`),this.code=this.name=t.code,this.data={noun:e,where:r,canForce:i}}};$i.code="AlreadyExistsError";var qc=class t extends Re{constructor(e,r,i){super(`Found multiple ${e} matching "${r}" (${i.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=t.code,this.data={nouns:e,short:r,matches:i}}};qc.code="AmbiguousError";var zc=class t extends Re{constructor(e){super(`Your local changes to the following files would be overwritten by checkout: ${e.join(", ")}`),this.code=this.name=t.code,this.data={filepaths:e}}};zc.code="CheckoutConflictError";var Vc=class t extends Re{constructor(e,r){super(`Failed to checkout "${e}" because commit ${r} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=t.code,this.data={ref:e,oid:r}}};Vc.code="CommitNotFetchedError";var Wc=class t extends Re{constructor(){super("Empty response from git server."),this.code=this.name=t.code,this.data={}}};Wc.code="EmptyServerResponseError";var Yc=class t extends Re{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=t.code,this.data={}}};Yc.code="FastForwardError";var Xc=class t extends Re{constructor(e,r){super(`One or more branches were not updated: ${e}`),this.code=this.name=t.code,this.data={prettyDetails:e,result:r}}};Xc.code="GitPushError";var Wo=class t extends Re{constructor(e,r,i){super(`HTTP Error: ${e} ${r}`),this.code=this.name=t.code,this.data={statusCode:e,statusMessage:r,response:i}}};Wo.code="HttpError";var $s=class t extends Re{constructor(e){let r="invalid filepath";e==="leading-slash"||e==="trailing-slash"?r='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':e==="directory"&&(r='"filepath" should not be a directory.'),super(r),this.code=this.name=t.code,this.data={reason:e}}};$s.code="InvalidFilepathError";var Ii=class t extends Re{constructor(e,r){super(`"${e}" would be an invalid git reference. (Hint: a valid alternative would be "${r}".)`),this.code=this.name=t.code,this.data={ref:e,suggestion:r}}};Ii.code="InvalidRefNameError";var Zc=class t extends Re{constructor(e){super(`Maximum search depth of ${e} exceeded.`),this.code=this.name=t.code,this.data={depth:e}}};Zc.code="MaxDepthError";var Yo=class t extends Re{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=t.code,this.data={}}};Yo.code="MergeNotSupportedError";var Xo=class t extends Re{constructor(e,r,i,n){super(`Automatic merge failed with one or more merge conflicts in the following files: ${e.toString()}. Fix conflicts then commit the result.`),this.code=this.name=t.code,this.data={filepaths:e,bothModified:r,deleteByUs:i,deleteByTheirs:n}}};Xo.code="MergeConflictError";var Jt=class t extends Re{constructor(e){super(`No name was provided for ${e} in the argument or in the .git/config file.`),this.code=this.name=t.code,this.data={role:e}}};Jt.code="MissingNameError";var Sr=class t extends Re{constructor(e){super(`The function requires a "${e}" parameter but none was provided.`),this.code=this.name=t.code,this.data={parameter:e}}};Sr.code="MissingParameterError";var Kc=class t extends Re{constructor(e){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=t.code,this.data={errors:e},this.errors=e}};Kc.code="MultipleGitError";var Sa=class t extends Re{constructor(e,r){super(`Expected "${e}" but received "${r}".`),this.code=this.name=t.code,this.data={expected:e,actual:r}}};Sa.code="ParseError";var Zo=class t extends Re{constructor(e){let r="";e==="not-fast-forward"?r=" because it was not a simple fast-forward":e==="tag-exists"&&(r=" because tag already exists"),super(`Push rejected${r}. Use "force: true" to override.`),this.code=this.name=t.code,this.data={reason:e}}};Zo.code="PushRejectedError";var Cs=class t extends Re{constructor(e,r){super(`Remote does not support the "${e}" so the "${r}" parameter cannot be used.`),this.code=this.name=t.code,this.data={capability:e,parameter:r}}};Cs.code="RemoteCapabilityError";var Qc=class t extends Re{constructor(e,r){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${e}`),this.code=this.name=t.code,this.data={preview:e,response:r}}};Qc.code="SmartHttpError";var Jc=class t extends Re{constructor(e,r,i){super(`Git remote "${e}" uses an unrecognized transport protocol: "${r}"`),this.code=this.name=t.code,this.data={url:e,transport:r,suggestion:i}}};Jc.code="UnknownTransportError";var eu=class t extends Re{constructor(e){super(`Cannot parse remote URL: "${e}"`),this.code=this.name=t.code,this.data={url:e}}};eu.code="UrlParseError";var Ko=class t extends Re{constructor(){super("The operation was canceled."),this.code=this.name=t.code,this.data={}}};Ko.code="UserCanceledError";var tu=class t extends Re{constructor(e){super(`Could not merge index: Entry for '${e}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=t.code,this.data={filepath:e}}};tu.code="IndexResetError";var ru=class t extends Re{constructor(e){super(`"${e}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=t.code,this.data={ref:e}}};ru.code="NoCommitError";var tk=Object.freeze({__proto__:null,AlreadyExistsError:$i,AmbiguousError:qc,CheckoutConflictError:zc,CommitNotFetchedError:Vc,EmptyServerResponseError:Wc,FastForwardError:Yc,GitPushError:Xc,HttpError:Wo,InternalError:he,InvalidFilepathError:$s,InvalidOidError:Ps,InvalidRefNameError:Ii,MaxDepthError:Zc,MergeNotSupportedError:Yo,MergeConflictError:Xo,MissingNameError:Jt,MissingParameterError:Sr,MultipleGitError:Kc,NoRefspecError:Gc,NotFoundError:He,ObjectTypeError:hr,ParseError:Sa,PushRejectedError:Zo,RemoteCapabilityError:Cs,SmartHttpError:Qc,UnknownTransportError:Jc,UnsafeFilepathError:zo,UrlParseError:eu,UserCanceledError:Ko,UnmergedPathsError:Uc,IndexResetError:tu,NoCommitError:ru});function lv({name:t,email:e,timestamp:r,timezoneOffset:i}){return i=p8(i),`${t} <${e}> ${r} ${i}`}function p8(t){let e=m8(g8(t));t=Math.abs(t);let r=Math.floor(t/60);t-=r*60;let i=String(r),n=String(t);return i.length<2&&(i="0"+i),n.length<2&&(n="0"+n),(e===-1?"-":"+")+i+n}function m8(t){return Math.sign(t)||(Object.is(t,-0)?-1:1)}function g8(t){return t===0?t:-t}function jn(t){return t=t.replace(/\r/g,""),t=t.replace(/^\n+/,""),t=t.replace(/\n+$/,"")+` +`,t}function Td(t){let[,e,r,i,n]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(i),timezoneOffset:v8(n)}}function v8(t){let[,e,r,i]=t.match(/(\+|-)(\d\d)(\d\d)/);return i=(e==="+"?1:-1)*(Number(r)*60+Number(i)),w8(i)}function w8(t){return t===0?t:-t}var Kr=class t{constructor(e){if(typeof e=="string")this._tag=e;else if(Buffer.isBuffer(e))this._tag=e.toString("utf8");else if(typeof e=="object")this._tag=t.render(e);else throw new he("invalid type passed to GitAnnotatedTag constructor")}static from(e){return new t(e)}static render(e){return`object ${e.object} +type ${e.type} +tag ${e.tag} +tagger ${lv(e.tagger)} + +${e.message} +${e.gpgsig?e.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(` + +`))}message(){let e=this.withoutSignature();return e.slice(e.indexOf(` + +`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let e=this.justHeaders().split(` +`),r=[];for(let n of e)n[0]===" "?r[r.length-1]+=` +`+n.slice(1):r.push(n);let i={};for(let n of r){let s=n.slice(0,n.indexOf(" ")),a=n.slice(n.indexOf(" ")+1);Array.isArray(i[s])?i[s].push(a):i[s]=a}return i.tagger&&(i.tagger=Td(i.tagger)),i.committer&&(i.committer=Td(i.committer)),i}withoutSignature(){let e=jn(this._tag);return e.indexOf(` +-----BEGIN PGP SIGNATURE-----`)===-1?e:e.slice(0,e.lastIndexOf(` +-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(` +-----BEGIN PGP SIGNATURE-----`)===-1)return;let e=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return jn(e)}payload(){return this.withoutSignature()+` +`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(e,r,i){let n=e.payload(),{signature:s}=await r({payload:n,secretKey:i});s=jn(s);let a=n+s;return t.from(a)}};function Zg(t){return t.trim().split(` +`).map(e=>" "+e).join(` +`)+` +`}function y8(t){return t.split(` +`).map(e=>e.replace(/^ /,"")).join(` +`)}var kr=class t{constructor(e){if(typeof e=="string")this._commit=e;else if(Buffer.isBuffer(e))this._commit=e.toString("utf8");else if(typeof e=="object")this._commit=t.render(e);else throw new he("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:e,signature:r}){let i=t.justHeaders(e),n=t.justMessage(e),s=jn(i+` +gpgsig`+Zg(r)+` +`+n);return new t(s)}static from(e){return new t(e)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return t.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(e){return jn(e.slice(e.indexOf(` + +`)+2))}static justHeaders(e){return e.slice(0,e.indexOf(` + +`))}parseHeaders(){let e=t.justHeaders(this._commit).split(` +`),r=[];for(let n of e)n[0]===" "?r[r.length-1]+=` +`+n.slice(1):r.push(n);let i={parent:[]};for(let n of r){let s=n.slice(0,n.indexOf(" ")),a=n.slice(n.indexOf(" ")+1);Array.isArray(i[s])?i[s].push(a):i[s]=a}return i.author&&(i.author=Td(i.author)),i.committer&&(i.committer=Td(i.committer)),i}static renderHeaders(e){let r="";if(e.tree?r+=`tree ${e.tree} +`:r+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 +`,e.parent){if(e.parent.length===void 0)throw new he("commit 'parent' property should be an array");for(let s of e.parent)r+=`parent ${s} +`}let i=e.author;r+=`author ${lv(i)} +`;let n=e.committer||e.author;return r+=`committer ${lv(n)} +`,e.gpgsig&&(r+="gpgsig"+Zg(e.gpgsig)),r}static render(e){return t.renderHeaders(e)+` +`+jn(e.message)}render(){return this._commit}withoutSignature(){let e=jn(this._commit);if(e.indexOf(` +gpgsig`)===-1)return e;let r=e.slice(0,e.indexOf(` +gpgsig`)),i=e.slice(e.indexOf(`-----END PGP SIGNATURE----- +`)+28);return jn(r+` +`+i)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return y8(e)}static async sign(e,r,i){let n=e.withoutSignature(),s=t.justMessage(e._commit),{signature:a}=await r({payload:n,secretKey:i});a=jn(a);let l=t.justHeaders(e._commit)+` +gpgsig`+Zg(a)+` +`+s;return t.from(l)}};async function Qo({fs:t,cache:e,gitdir:r,oid:i}){if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:Er.from([]),oid:i};let{type:n,object:s}=await Ke({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Kr.from(s).parse().object,Qo({fs:t,cache:e,gitdir:r,oid:i});if(n==="commit")return i=kr.from(s).parse().tree,Qo({fs:t,cache:e,gitdir:r,oid:i});if(n!=="tree")throw new hr(i,n,"tree");return{tree:Er.from(s),oid:i}}var cv=class{constructor({fs:e,gitdir:r,ref:i,cache:n}){this.fs=e,this.cache=n,this.gitdir=r,this.mapPromise=(async()=>{let a=new Map,o;try{o=await W.resolve({fs:e,gitdir:r,ref:i})}catch(c){c instanceof He&&(o="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let l=await Qo({fs:e,cache:this.cache,gitdir:r,oid:o});return l.type="tree",l.mode="40000",a.set(".",l),a})();let s=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:i,cache:n,gitdir:s}=this,a=await this.mapPromise,o=a.get(r);if(!o)throw new Error(`No obj for ${r}`);let l=o.oid;if(!l)throw new Error(`No oid for obj ${JSON.stringify(o)}`);if(o.type!=="tree")return null;let{type:c,object:u}=await Ke({fs:i,cache:n,gitdir:s,oid:l});if(c!==o.type)throw new hr(l,c,o.type);let f=Er.from(u);for(let d of f)a.set(O(r,d.path),d);return f.entries().map(d=>O(r,d.path))}async type(e){if(e._type===!1){let r=await this.mapPromise,{type:i}=r.get(e._fullpath);e._type=i}return e._type}async mode(e){if(e._mode===!1){let r=await this.mapPromise,{mode:i}=r.get(e._fullpath);e._mode=YE(parseInt(i,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let r=await this.mapPromise,{fs:i,cache:n,gitdir:s}=this,o=r.get(e._fullpath).oid,{type:l,object:c}=await Ke({fs:i,cache:n,gitdir:s,oid:o});l!=="blob"?e._content=void 0:e._content=new Uint8Array(c)}return e._content}async oid(e){if(e._oid===!1){let i=(await this.mapPromise).get(e._fullpath);e._oid=i.oid}return e._oid}};function Zr({ref:t="HEAD"}={}){let e=Object.create(null);return Object.defineProperty(e,Fd,{value:function({fs:r,gitdir:i,cache:n}){return new cv({fs:r,gitdir:i,ref:t,cache:n})}}),Object.freeze(e),e}var uv=class{constructor({fs:e,dir:r,gitdir:i,cache:n}){this.fs=e,this.cache=n,this.dir=r,this.gitdir=i,this.config=null;let s=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:i,dir:n}=this,s=await i.readdir(O(n,r));return s===null?null:s.map(a=>O(r,a))}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let{fs:r,dir:i}=this,n=await r.lstat(`${i}/${e._fullpath}`);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let s=n.isDirectory()?"tree":"blob";s==="blob"&&!n.isFile()&&!n.isSymbolicLink()&&(s="special"),e._type=s,n=Vo(n),e._mode=n.mode,n.size===-1&&e._actualSize&&(n.size=e._actualSize),e._stat=n}return e._stat}async content(e){if(e._content===!1){let{fs:r,dir:i,gitdir:n}=this;if(await e.type()==="tree")e._content=void 0;else{let s;if(await e.mode()>>12===10)s=await r.readlink(`${i}/${e._fullpath}`);else{let o=await(await this._getGitConfig(r,n)).get("core.autocrlf");s=await r.read(`${i}/${e._fullpath}`,{autocrlf:o})}e._actualSize=s.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(s)}}return e._content}async oid(e){if(e._oid===!1){let r=this,{fs:i,gitdir:n,cache:s}=this,a;await mt.acquire({fs:i,gitdir:n,cache:s},async function(o){let l=o.entriesMap.get(e._fullpath),c=await e.stat(),f=await(await r._getGitConfig(i,n)).get("core.filemode"),d=typeof process!="undefined"?process.platform!=="win32":!0;if(!l||xd(c,l,f,d)){let h=await e.content();h===void 0?a=void 0:(a=await qn(Rs.wrap({type:"blob",object:h})),l&&a===l.oid&&(!f||c.mode===l.mode)&&xd(c,l,f,d)&&o.insert({filepath:e._fullpath,stats:c,oid:a}))}else a=l.oid}),e._oid=a}return e._oid}async _getGitConfig(e,r){return this.config?this.config:(this.config=await ct.get({fs:e,gitdir:r}),this.config)}};function nl(){let t=Object.create(null);return Object.defineProperty(t,Fd,{value:function({fs:e,dir:r,gitdir:i,cache:n}){return new uv({fs:e,dir:r,gitdir:i,cache:n})}}),Object.freeze(t),t}function b8(t,e){let r=e-t;return Array.from({length:r},(i,n)=>t+n)}var rk=typeof Array.prototype.flat=="undefined"?t=>t.reduce((e,r)=>e.concat(r),[]):t=>t.flat(),fv=class{constructor(){this.value=null}consider(e){e!=null&&(this.value===null?this.value=e:ec,reduce:a=async(l,c)=>{let u=rk(c);return l!==void 0&&u.unshift(l),u},iterate:o=(l,c)=>Promise.all([...c].map(l))}){let l=n.map(h=>h[Fd]({fs:t,dir:r,gitdir:i,cache:e})),c=new Array(l.length).fill("."),u=b8(0,l.length),f=async h=>{u.forEach(v=>{let w=h[v];h[v]=w&&new l[v].ConstructEntry(w)});let g=(await Promise.all(u.map(v=>{let w=h[v];return w?l[v].readdir(w):[]}))).map(v=>(v===null?[]:v)[Symbol.iterator]());return{entries:h,children:_8(g)}},d=async h=>{let{entries:m,children:g}=await f(h),v=m.find(b=>b&&b._fullpath)._fullpath,w=await s(v,m);if(w!==null){let b=await o(d,g);return b=b.filter(k=>k!==void 0),a(w,b)}};return d(c)}async function dv(t,e){let r=await t.readdir(e);r==null?await t.rm(e):r.length?await Promise.all(r.map(i=>{let n=O(e,i);return t.lstat(n).then(s=>{if(s)return s.isDirectory()?dv(t,n):t.rm(n)})})).then(()=>t.rmdir(e)):await t.rmdir(e)}function x8(t){return S8(t)&&FE(t.then)&&FE(t.catch)}function S8(t){return t&&typeof t=="object"}function FE(t){return typeof t=="function"}function OE(t){return x8((r=>{try{return r.readFile().catch(i=>i)}catch(i){return i}})(t))}var ME=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function DE(t,e){if(OE(e))for(let r of ME)t[`_${r}`]=e[r].bind(e);else for(let r of ME)t[`_${r}`]=yd(e[r].bind(e));OE(e)?(e.cp&&(t._cp=e.cp.bind(e)),e.rm?t._rm=e.rm.bind(e):e.rmdir.length>1?t._rm=e.rmdir.bind(e):t._rm=dv.bind(null,t)):(e.cp&&(t._cp=yd(e.cp.bind(e))),e.rm?t._rm=yd(e.rm.bind(e)):e.rmdir.length>2?t._rm=yd(e.rmdir.bind(e)):t._rm=dv.bind(null,t))}var J=class{constructor(e){if(typeof e._original_unwrapped_fs!="undefined")return e;let r=Object.getOwnPropertyDescriptor(e,"promises");r&&r.enumerable?DE(this,e.promises):DE(this,e),this._original_unwrapped_fs=e}async exists(e,r={}){try{return await this._stat(e),!0}catch(i){if(i.code==="ENOENT"||i.code==="ENOTDIR"||(i.code||"").includes("ENS"))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',i),i}}async read(e,r={}){try{let i=await this._readFile(e,r);if(r.autocrlf==="true")try{i=new TextDecoder("utf8",{fatal:!0}).decode(i),i=i.replace(/\r\n/g,` +`),i=new TextEncoder().encode(i)}catch(n){}return typeof i!="string"&&(i=Buffer.from(i)),i}catch(i){return null}}async write(e,r,i={}){try{await this._writeFile(e,r,i)}catch(n){await this.mkdir(xa(e)),await this._writeFile(e,r,i)}}async mkdir(e,r=!1){try{await this._mkdir(e)}catch(i){if(i===null||i.code==="EEXIST")return;if(r)throw i;if(i.code==="ENOENT"){let n=xa(e);if(n==="."||n==="/"||n===e)throw i;await this.mkdir(n),await this.mkdir(e,!0)}}}async rm(e){try{await this._unlink(e)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(e,r){try{r&&r.recursive?await this._rm(e,r):await this._rmdir(e)}catch(i){if(i.code!=="ENOENT")throw i}}async readdir(e){try{let r=await this._readdir(e);return r.sort(Id),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let r=await this._readdir(e);return(await Promise.all(r.map(async n=>{let s=e+"/"+n;return(await this._stat(s)).isDirectory()?this.readdirDeep(s):s}))).reduce((n,s)=>n.concat(s),[])}async lstat(e){try{return await this._lstat(e)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async readlink(e,r={encoding:"buffer"}){try{let i=await this._readlink(e,r);return Buffer.isBuffer(i)?i:Buffer.from(i)}catch(i){if(i.code==="ENOENT"||(i.code||"").includes("ENS"))return null;throw i}}async writelink(e,r){return this._symlink(r.toString("utf8"),e)}};function C(t,e){if(e===void 0)throw new Sr(t)}async function ee({fsp:t,dotgit:e}){C("fsp",t),C("dotgit",e);let r=await t._stat(e).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return r.isDirectory()?e:r.isFile()?t._readFile(e,"utf8").then(i=>i.trimRight().substr(8)).then(i=>O(xa(e),i)):e}async function Cd(t,e){return!t&&!e?!1:t&&!e||!t&&e?!0:!(await t.type()==="tree"&&await e.type()==="tree"||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid())}async function ik({fs:t,dir:e,gitdir:r=O(e,".git"),commit:i="HEAD",cache:n={}}){try{C("fs",t),C("dir",e),C("gitdir",r);let s=new J(t),a=[Zr({ref:i}),nl(),Aa()],o=[],l=await ee({fsp:s,dotgit:r});await mt.acquire({fs:s,gitdir:l,cache:n},async function(u){o=u.unmergedPaths});let c=await Is({fs:s,cache:n,dir:e,gitdir:l,trees:a,map:async function(u,[f,d,h]){let m=!await Cd(d,h),g=o.includes(u),v=!await Cd(h,f);if(m||g)return f?{path:u,mode:await f.mode(),oid:await f.oid(),type:await f.type(),content:await f.content()}:void 0;if(v)return!1;throw new tu(u)}});await mt.acquire({fs:s,gitdir:l,cache:n},async function(u){for(let f of c)if(f!==!1){if(!f){await s.rmdir(`${e}/${f.path}`,{recursive:!0}),u.delete({filepath:f.path});continue}if(f.type==="blob"){let d=new TextDecoder().decode(f.content);await s.write(`${e}/${f.path}`,d,{mode:f.mode}),u.insert({filepath:f.path,oid:f.oid,stage:0})}}})}catch(s){throw s.caller="git.abortMerge",s}}var Fs=class{static async isIgnored({fs:e,dir:r,gitdir:i=O(r,".git"),filepath:n}){if(Sd(n)===".git")return!0;if(n===".")return!1;let s="",a=O(i,"info","exclude");await e.exists(a)&&(s=await e.read(a,"utf8"));let o=[{gitignore:O(r,".gitignore"),filepath:n}],l=n.split("/").filter(Boolean);for(let u=1;u{let f=await(await ct.get({fs:o,gitdir:l})).get("core.autocrlf");return hv({dir:e,gitdir:l,fs:o,filepath:i,index:c,force:s,parallel:a,autocrlf:f})})}catch(o){throw o.caller="git.add",o}}async function hv({dir:t,gitdir:e,fs:r,filepath:i,index:n,force:s,parallel:a,autocrlf:o}){i=Array.isArray(i)?i:[i];let l=i.map(async d=>{if(!s&&await Fs.isIgnored({fs:r,dir:t,gitdir:e,filepath:d}))return;let h=await r.lstat(O(t,d));if(!h)throw new He(d);if(h.isDirectory()){let m=await r.readdir(O(t,d));if(a){let g=m.map(v=>hv({dir:t,gitdir:e,fs:r,filepath:[O(d,v)],index:n,force:s,parallel:a,autocrlf:o}));await Promise.all(g)}else for(let g of m)await hv({dir:t,gitdir:e,fs:r,filepath:[O(d,g)],index:n,force:s,parallel:a,autocrlf:o})}else{let m=h.isSymbolicLink()?await r.readlink(O(t,d)).then(sk):await r.read(O(t,d),{autocrlf:o});if(m===null)throw new He(d);let g=await Ar({fs:r,gitdir:e,type:"blob",object:m});n.insert({filepath:d,stats:h,oid:g})}}),c=await Promise.allSettled(l),u=c.filter(d=>d.status==="rejected").map(d=>d.reason);if(u.length>1)throw new Kc(u);if(u.length===1)throw u[0];return c.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}async function iu({fs:t,gitdir:e,path:r}){return(await ct.get({fs:t,gitdir:e})).get(r)}function ok(t,...e){for(let r of e)if(r)for(let i of Object.keys(r)){let n=r[i];n!==void 0&&(t[i]=n)}return t}async function Os({fs:t,gitdir:e,author:r,commit:i}){let n=Math.floor(Date.now()/1e3),s={name:await iu({fs:t,gitdir:e,path:"user.name"}),email:await iu({fs:t,gitdir:e,path:"user.email"})||"",timestamp:n,timezoneOffset:new Date(n*1e3).getTimezoneOffset()},a=ok({},s,i?i.author:void 0,r);if(a.name!==void 0)return a}async function Jo({fs:t,gitdir:e,author:r,committer:i,commit:n}){let s=Math.floor(Date.now()/1e3),a={name:await iu({fs:t,gitdir:e,path:"user.name"}),email:await iu({fs:t,gitdir:e,path:"user.email"})||"",timestamp:s,timezoneOffset:new Date(s*1e3).getTimezoneOffset()},o=ok({},a,n?n.committer:void 0,r,i);if(o.name!==void 0)return o}async function lk({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await Ke({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Kr.from(s).parse().object,lk({fs:t,cache:e,gitdir:r,oid:i});if(n!=="commit")throw new hr(i,n,"commit");return{commit:kr.from(s),oid:i}}async function el({fs:t,cache:e,gitdir:r,oid:i}){let{commit:n,oid:s}=await lk({fs:t,cache:e,gitdir:r,oid:i});return{oid:s,commit:n.parse(),payload:n.withoutSignature()}}async function Od({fs:t,cache:e,onSign:r,gitdir:i,message:n,author:s,committer:a,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h}){let m=!1,g=!1;f||(g=!(await t.read(`${i}/HEAD`,{encoding:"utf8"})).startsWith("ref:"),f=await W.resolve({fs:t,gitdir:i,ref:"HEAD",depth:2}));let v,w;try{v=await W.resolve({fs:t,gitdir:i,ref:f}),w=await el({fs:t,gitdir:i,oid:v,cache:{}})}catch(x){m=!0}if(l&&m)throw new ru(f);let b=l?await Os({fs:t,gitdir:i,author:s,commit:w.commit}):await Os({fs:t,gitdir:i,author:s});if(!b)throw new Jt("author");let k=l?await Jo({fs:t,gitdir:i,author:b,committer:a,commit:w.commit}):await Jo({fs:t,gitdir:i,author:b,committer:a});if(!k)throw new Jt("committer");return mt.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async function(x){let A=ZE(x.entries).get(".");if(h||(h=await ck({fs:t,gitdir:i,inode:A,dryRun:c})),d?d=await Promise.all(d.map(_=>W.resolve({fs:t,gitdir:i,ref:_}))):l?d=w.commit.parent:d=v?[v]:[],!n)if(l)n=w.commit.message;else throw new Sr("message");let y=kr.from({tree:h,parent:d,author:b,committer:k,message:n});o&&(y=await kr.sign(y,r,o));let S=await Ar({fs:t,gitdir:i,type:"commit",object:y.toObject(),dryRun:c});return!u&&!c&&await W.writeRef({fs:t,gitdir:i,ref:g?"HEAD":f,value:S}),S})}async function ck({fs:t,gitdir:e,inode:r,dryRun:i}){let n=r.children;for(let l of n)l.type==="tree"&&(l.metadata.mode="040000",l.metadata.oid=await ck({fs:t,gitdir:e,inode:l,dryRun:i}));let s=n.map(l=>({mode:l.metadata.mode,path:l.basename,oid:l.metadata.oid,type:l.type})),a=Er.from(s);return await Ar({fs:t,gitdir:e,type:"tree",object:a.toObject(),dryRun:i})}async function su({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){if(n.startsWith("/"))throw new $s("leading-slash");if(n.endsWith("/"))throw new $s("trailing-slash");let s=i,a=await Qo({fs:t,cache:e,gitdir:r,oid:i}),o=a.tree;if(n==="")i=a.oid;else{let l=n.split("/");i=await uk({fs:t,cache:e,gitdir:r,tree:o,pathArray:l,oid:s,filepath:n})}return i}async function uk({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:s,filepath:a}){let o=n.shift();for(let l of i)if(l.path===o){if(n.length===0)return l.oid;{let{type:c,object:u}=await Ke({fs:t,cache:e,gitdir:r,oid:l.oid});if(c!=="tree")throw new hr(s,c,"tree",a);return i=Er.from(u),uk({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:s,filepath:a})}}throw new He(`file or directory found at "${s}:${a}"`)}async function sl({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){n!==void 0&&(i=await su({fs:t,cache:e,gitdir:r,oid:i,filepath:n}));let{tree:s,oid:a}=await Qo({fs:t,cache:e,gitdir:r,oid:i});return{oid:a,tree:s.entries()}}async function au({fs:t,gitdir:e,tree:r}){let i=Er.from(r).toObject();return await Ar({fs:t,gitdir:e,type:"tree",object:i,format:"content"})}async function T8({fs:t,cache:e,onSign:r,gitdir:i,ref:n,oid:s,note:a,force:o,author:l,committer:c,signingKey:u}){let f;try{f=await W.resolve({gitdir:i,fs:t,ref:n})}catch(w){if(!(w instanceof He))throw w}let h=(await sl({fs:t,cache:e,gitdir:i,oid:f||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(o)h=h.filter(w=>w.path!==s);else for(let w of h)if(w.path===s)throw new $i("note",s);typeof a=="string"&&(a=Buffer.from(a,"utf8"));let m=await Ar({fs:t,gitdir:i,type:"blob",object:a,format:"content"});h.push({mode:"100644",path:s,oid:m,type:"blob"});let g=await au({fs:t,gitdir:i,tree:h});return await Od({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:g,parent:f&&[f],message:`Note added by 'isomorphic-git addNote' +`,author:l,committer:c,signingKey:u})}async function fk({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),ref:n="refs/notes/commits",oid:s,note:a,force:o,author:l,committer:c,signingKey:u,cache:f={}}){try{C("fs",t),C("gitdir",i),C("oid",s),C("note",a),u&&C("onSign",e);let d=new J(t),h=await Os({fs:d,gitdir:i,author:l});if(!h)throw new Jt("author");let m=await Jo({fs:d,gitdir:i,author:h,committer:c});if(!m)throw new Jt("committer");let g=await ee({fsp:d,dotgit:i});return await T8({fs:d,cache:f,onSign:e,gitdir:g,ref:n,oid:s,note:a,force:o,author:h,committer:m,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}var C8=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function nu(t,e){if(typeof t!="string")throw new TypeError("Reference name must be a string");return!C8.test(t)&&(!!e||t.includes("/"))}async function dk({fs:t,gitdir:e,remote:r,url:i,force:n}){if(!nu(r,!0))throw new Ii(r,Hc.clean(r));let s=await ct.get({fs:t,gitdir:e});if(!n&&(await s.getSubsections("remote")).includes(r)&&i!==await s.get(`remote.${r}.url`))throw new $i("remote",r);await s.set(`remote.${r}.url`,i),await s.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await ct.save({fs:t,gitdir:e,config:s})}async function hk({fs:t,dir:e,gitdir:r=O(e,".git"),remote:i,url:n,force:s=!1}){try{C("fs",t),C("gitdir",r),C("remote",i),C("url",n);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await dk({fs:a,gitdir:o,remote:i,url:n,force:s})}catch(a){throw a.caller="git.addRemote",a}}async function P8({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tagger:s,message:a=n,gpgsig:o,object:l,signingKey:c,force:u=!1}){if(n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,!u&&await W.exists({fs:t,gitdir:i,ref:n}))throw new $i("tag",n);let f=await W.resolve({fs:t,gitdir:i,ref:l||"HEAD"}),{type:d}=await Ke({fs:t,cache:e,gitdir:i,oid:f}),h=Kr.from({object:f,type:d,tag:n.replace("refs/tags/",""),tagger:s,message:a,gpgsig:o});c&&(h=await Kr.sign(h,r,c));let m=await Ar({fs:t,gitdir:i,type:"tag",object:h.toObject()});await W.writeRef({fs:t,gitdir:i,ref:n,value:m})}async function pk({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),ref:n,tagger:s,message:a=n,gpgsig:o,object:l,signingKey:c,force:u=!1,cache:f={}}){try{C("fs",t),C("gitdir",i),C("ref",n),c&&C("onSign",e);let d=new J(t),h=await ee({fsp:d,dotgit:i}),m=await Os({fs:d,gitdir:h,author:s});if(!m)throw new Jt("tagger");return await P8({fs:d,cache:f,onSign:e,gitdir:h,ref:n,tagger:m,message:a,gpgsig:o,object:l,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}async function R8({fs:t,gitdir:e,ref:r,object:i,checkout:n=!1,force:s=!1}){if(!nu(r,!0))throw new Ii(r,Hc.clean(r));let a=`refs/heads/${r}`;if(!s&&await W.exists({fs:t,gitdir:e,ref:a}))throw new $i("branch",r,!1);let o;try{o=await W.resolve({fs:t,gitdir:e,ref:i||"HEAD"})}catch(l){}o&&await W.writeRef({fs:t,gitdir:e,ref:a,value:o}),n&&await W.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function mk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,object:n,checkout:s=!1,force:a=!1}){try{C("fs",t),C("gitdir",r),C("ref",i);let o=new J(t),l=await ee({fsp:o,dotgit:r});return await R8({fs:o,gitdir:l,ref:i,object:n,checkout:s,force:a})}catch(o){throw o.caller="git.branch",o}}var gk=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);async function vv({fs:t,cache:e,onProgress:r,onPostCheckout:i,dir:n,gitdir:s,remote:a,ref:o,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:f,force:d,track:h=!0,nonBlocking:m=!1,batchSize:g=100}){let v;if(i)try{v=await W.resolve({fs:t,gitdir:s,ref:"HEAD"})}catch(b){v="0000000000000000000000000000000000000000"}let w;try{w=await W.resolve({fs:t,gitdir:s,ref:o})}catch(b){if(o==="HEAD")throw b;let k=`${a}/${o}`;if(w=await W.resolve({fs:t,gitdir:s,ref:k}),h){let x=await ct.get({fs:t,gitdir:s});await x.set(`branch.${o}.remote`,a),await x.set(`branch.${o}.merge`,`refs/heads/${o}`),await ct.save({fs:t,gitdir:s,config:x})}await W.writeRef({fs:t,gitdir:s,ref:`refs/heads/${o}`,value:w})}if(!c){let b;try{b=await $8({fs:t,cache:e,onProgress:r,dir:n,gitdir:s,ref:o,force:d,filepaths:l})}catch(y){throw y instanceof He&&y.data.what===w?new Vc(o,w):y}let k=b.filter(([y])=>y==="conflict").map(([y,S])=>S);if(k.length>0)throw new zc(k);let x=b.filter(([y])=>y==="error").map(([y,S])=>S);if(x.length>0)throw new he(x.join(", "));if(f){i&&await i({previousHead:v,newHead:w,type:l!=null&&l.length>0?"file":"branch"});return}let E=0,A=b.length;if(await mt.acquire({fs:t,gitdir:s,cache:e},async function(y){await Promise.all(b.filter(([S])=>S==="delete"||S==="delete-index").map(async function([S,_]){let T=`${n}/${_}`;S==="delete"&&await t.rm(T),y.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++E,total:A})}))}),await mt.acquire({fs:t,gitdir:s,cache:e},async function(y){for(let[S,_]of b)if(S==="rmdir"||S==="rmdir-index"){let T=`${n}/${_}`;try{S==="rmdir"&&await t.rmdir(T),y.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++E,total:A})}catch(P){if(P.code==="ENOTEMPTY")console.log(`Did not delete ${_} because directory is not empty`);else throw P}}}),await Promise.all(b.filter(([y])=>y==="mkdir"||y==="mkdir-index").map(async function([y,S]){let _=`${n}/${S}`;await t.mkdir(_),r&&await r({phase:"Updating workdir",loaded:++E,total:A})})),m){let y=b.filter(([_])=>_==="create"||_==="create-index"||_==="update"||_==="mkdir-index"),S=await LE("Update Working Dir",y.map(([_,T,P,D,B])=>()=>F8({fs:t,cache:e,gitdir:s,dir:n},[_,T,P,D,B])),r,g);await mt.acquire({fs:t,gitdir:s,cache:e,allowUnmerged:!0},async function(_){await LE("Update Index",S.map(([T,P,D])=>()=>I8({index:_,fullpath:T,oid:P,stats:D})),r,g)})}else await mt.acquire({fs:t,gitdir:s,cache:e,allowUnmerged:!0},async function(y){await Promise.all(b.filter(([S])=>S==="create"||S==="create-index"||S==="update"||S==="mkdir-index").map(async function([S,_,T,P,D]){let B=`${n}/${_}`;try{if(S!=="create-index"&&S!=="mkdir-index"){let{object:ce}=await Ke({fs:t,cache:e,gitdir:s,oid:T});if(D&&await t.rm(B),P===33188)await t.write(B,ce);else if(P===33261)await t.write(B,ce,{mode:511});else if(P===40960)await t.writelink(B,ce);else throw new he(`Invalid mode 0o${P.toString(8)} detected in blob ${T}`)}let N=await t.lstat(B);P===33261&&(N.mode=493),S==="mkdir-index"&&(N.mode=57344),y.insert({filepath:_,stats:N,oid:T}),r&&await r({phase:"Updating workdir",loaded:++E,total:A})}catch(N){console.log(N)}}))});i&&await i({previousHead:v,newHead:w,type:l!=null&&l.length>0?"file":"branch"})}if(!u){let b=await W.expand({fs:t,gitdir:s,ref:o});b.startsWith("refs/heads")?await W.writeSymbolicRef({fs:t,gitdir:s,ref:"HEAD",value:b}):await W.writeRef({fs:t,gitdir:s,ref:"HEAD",value:w})}}async function $8({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,ref:s,force:a,filepaths:o}){let l=0;return Is({fs:t,cache:e,dir:i,gitdir:n,trees:[Zr({ref:s}),nl(),Aa()],map:async function(c,[u,f,d]){if(c===".")return;if(o&&!o.some(m=>gk(c,m)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++l}),[!!d,!!u,!!f].map(Number).join("")){case"000":return;case"001":return a&&o&&o.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await f.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await f.oid()?a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()]:["conflict",c]:await u.mode()!==await f.mode()?a?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await d.type()){case"tree":return["rmdir-index",c];case"blob":return await d.oid()!==await f.oid()?a?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await d.type()}`]}case"110":case"111":switch(`${await d.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await d.oid()===await u.oid()&&await d.mode()===await u.mode()&&!a)return;if(f){if(await f.oid()!==await d.oid()&&await f.oid()!==await u.oid())return a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()]:["conflict",c]}else if(a)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()];return await u.mode()!==await d.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await d.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await d.type()}-${await u.type()}`]}}},reduce:async function(c,u){return u=rk(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u}})}async function I8({index:t,fullpath:e,stats:r,oid:i}){try{t.insert({filepath:e,stats:r,oid:i})}catch(n){console.warn(`Error inserting ${e} into index:`,n)}}async function F8({fs:t,cache:e,gitdir:r,dir:i},[n,s,a,o,l]){let c=`${i}/${s}`;if(n!=="create-index"&&n!=="mkdir-index"){let{object:f}=await Ke({fs:t,cache:e,gitdir:r,oid:a});if(l&&await t.rm(c),o===33188)await t.write(c,f);else if(o===33261)await t.write(c,f,{mode:511});else if(o===40960)await t.writelink(c,f);else throw new he(`Invalid mode 0o${o.toString(8)} detected in blob ${a}`)}let u=await t.lstat(c);return o===33261&&(u.mode=493),n==="mkdir-index"&&(u.mode=57344),[s,a,u]}async function LE(t,e,r,i){let n=[];try{for(let s=0;sl());(await Promise.allSettled(a)).forEach(l=>{l.status==="fulfilled"&&n.push(l.value)}),r&&await r({phase:"Updating workdir",loaded:s+a.length,total:e.length})}return n}catch(s){console.error(`Error during ${t}: ${s}`)}return n}async function wv({fs:t,onProgress:e,onPostCheckout:r,dir:i,gitdir:n=O(i,".git"),remote:s="origin",ref:a,filepaths:o,noCheckout:l=!1,noUpdateHead:c=a===void 0,dryRun:u=!1,force:f=!1,track:d=!0,cache:h={},nonBlocking:m=!1,batchSize:g=100}){try{C("fs",t),C("dir",i),C("gitdir",n);let v=a||"HEAD",w=new J(t),b=await ee({fsp:w,dotgit:n});return await vv({fs:w,cache:h,onProgress:e,onPostCheckout:r,dir:i,gitdir:b,remote:s,ref:v,filepaths:o,noCheckout:l,noUpdateHead:c,dryRun:u,force:f,track:d,nonBlocking:m,batchSize:g})}catch(v){throw v.caller="git.checkout",v}}var O8=/^refs\/(heads\/|tags\/|remotes\/)?(.*)/;function _a(t){let e=O8.exec(t);return e?e[1]==="remotes/"&&t.endsWith("/HEAD")?e[2].slice(0,-5):e[2]:t}async function Ds({fs:t,gitdir:e,fullname:r=!1,test:i=!1}){let n=await W.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2});if(i)try{await W.resolve({fs:t,gitdir:e,ref:n})}catch(s){return}if(n.startsWith("refs/"))return r?n:_a(n)}function M8(t){return t=t.replace(/^git@([^:]+):/,"https://$1/"),t=t.replace(/^ssh:\/\//,"https://"),t}function vk({username:t="",password:e=""}){return`Basic ${Buffer.from(`${t}:${e}`).toString("base64")}`}async function ou(t,e){let r=JE(t);for(;;){let{value:i,done:n}=await r.next();if(i&&await e(i),n)break}r.return&&r.return()}async function Pd(t){let e=0,r=[];await ou(t,s=>{r.push(s),e+=s.byteLength});let i=new Uint8Array(e),n=0;for(let s of r)i.set(s,n),n+=s.byteLength;return i}function BE(t){let e=t.match(/^https?:\/\/([^/]+)@/);if(e==null)return{url:t,auth:{}};e=e[1];let[r,i]=e.split(":");return t=t.replace(`${e}@`,""),{url:t,auth:{username:r,password:i}}}function pv(t,e){let r=e.toString(16);return"0".repeat(t-r.length)+r}var at=class{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(e){typeof e=="string"&&(e=Buffer.from(e));let r=e.length+4,i=pv(4,r);return Buffer.concat([Buffer.from(i,"utf8"),e])}static streamReader(e){let r=new Ad(e);return async function(){try{let n=await r.read(4);if(n==null)return!0;if(n=parseInt(n.toString("utf8"),16),n===0||n===1)return null;let s=await r.read(n-4);return s==null?!0:s}catch(n){return e.error=n,!0}}}};async function NE(t){let e={},r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");let i=r.indexOf("=");if(i>-1){let n=r.slice(0,i),s=r.slice(i+1);e[n]=s}else e[r]=!0}return{protocolVersion:2,capabilities2:e}}async function HE(t,{service:e}){let r=new Set,i=new Map,n=new Map,s=at.streamReader(t),a=await s();for(;a===null;)a=await s();if(a===!0)throw new Wc;if(a.includes("version 2"))return NE(s);if(a.toString("utf8").replace(/\n$/,"")!==`# service=${e}`)throw new Sa(`# service=${e}\\n`,a.toString("utf8"));let o=await s();for(;o===null;)o=await s();if(o===!0)return{capabilities:r,refs:i,symrefs:n};if(o=o.toString("utf8"),o.includes("version 2"))return NE(s);let[l,c]=Qg(o,"\0","\\x00");if(c.split(" ").map(u=>r.add(u)),l!=="0000000000000000000000000000000000000000 capabilities^{}"){let[u,f]=Qg(l," "," ");for(i.set(f,u);;){let d=await s();if(d===!0)break;if(d!==null){let[h,m]=Qg(d.toString("utf8")," "," ");i.set(m,h)}}}for(let u of r)if(u.startsWith("symref=")){let f=u.match(/symref=([^:]+):(.*)/);f.length===3&&n.set(f[1],f[2])}return{protocolVersion:1,capabilities:r,refs:i,symrefs:n}}function Qg(t,e,r){let i=t.trim().split(e);if(i.length!==2)throw new Sa(`Two strings separated by '${r}'`,t.toString("utf8"));return i}var UE=(t,e)=>t.endsWith("?")?`${t}${e}`:`${t}/${e.replace(/^https?:\/\//,"")}`,GE=(t,e)=>{(e.username||e.password)&&(t.Authorization=vk(e)),e.headers&&Object.assign(t,e.headers)},Jg=async t=>{try{let e=Buffer.from(await Pd(t.body)),r=e.toString("utf8");return{preview:r.length<256?r:r.slice(0,256)+"...",response:r,data:e}}catch(e){return{}}},tl=class{static async capabilities(){return["discover","connect"]}static async discover({http:e,onProgress:r,onAuth:i,onAuthSuccess:n,onAuthFailure:s,corsProxy:a,service:o,url:l,headers:c,protocolVersion:u}){let{url:f,auth:d}=BE(l),h=a?UE(a,f):f;(d.username||d.password)&&(c.Authorization=vk(d)),u===2&&(c["Git-Protocol"]="version=2");let m,g,v=!1;do if(m=await e.request({onProgress:r,method:"GET",url:`${h}/info/refs?service=${o}`,headers:c}),g=!1,m.statusCode===401||m.statusCode===203){let w=v?s:i;if(w){if(d=await w(f,{...d,headers:{...c}}),d&&d.cancel)throw new Ko;d&&(GE(c,d),v=!0,g=!0)}}else m.statusCode===200&&v&&n&&await n(f,d);while(g);if(m.statusCode!==200){let{response:w}=await Jg(m);throw new Wo(m.statusCode,m.statusMessage,w)}if(m.headers["content-type"]===`application/x-${o}-advertisement`){let w=await HE(m.body,{service:o});return w.auth=d,w}else{let{preview:w,response:b,data:k}=await Jg(m);try{let x=await HE([k],{service:o});return x.auth=d,x}catch(x){throw new Qc(w,b)}}}static async connect({http:e,onProgress:r,corsProxy:i,service:n,url:s,auth:a,body:o,headers:l}){let c=BE(s);c&&(s=c.url),i&&(s=UE(i,s)),l["content-type"]=`application/x-${n}-request`,l.accept=`application/x-${n}-result`,GE(l,a);let u=await e.request({onProgress:r,method:"POST",url:`${s}/${n}`,body:o,headers:l});if(u.statusCode!==200){let{response:f}=Jg(u);throw new Wo(u.statusCode,u.statusMessage,f)}return u}},rl=class{static getRemoteHelperFor({url:e}){let r=new Map;r.set("http",tl),r.set("https",tl);let i=D8({url:e});if(!i)throw new eu(e);if(r.has(i.transport))return r.get(i.transport);throw new Jc(e,i.transport,i.transport==="ssh"?M8(e):void 0)}};function D8({url:t}){if(t.startsWith("git@"))return{transport:"ssh",address:t};let e=t.match(/(\w+)(:\/\/|::)(.*)/);if(e!==null){if(e[2]==="://")return{transport:e[1],address:e[0]};if(e[2]==="::")return{transport:e[1],address:e[3]}}}var ba=null,Ea=class{static async read({fs:e,gitdir:r}){ba===null&&(ba=new Nc);let i=O(r,"shallow"),n=new Set;return await ba.acquire(i,async function(){let s=await e.read(i,{encoding:"utf8"});if(s===null||s.trim()==="")return n;s.trim().split(` +`).map(a=>n.add(a))}),n}static async write({fs:e,gitdir:r,oids:i}){ba===null&&(ba=new Nc);let n=O(r,"shallow");if(i.size>0){let s=[...i].join(` +`)+` +`;await ba.acquire(n,async function(){await e.write(n,s,{encoding:"utf8"})})}else await ba.acquire(n,async function(){await e.rm(n)})}};async function L8({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`;return t.exists(`${e}/${i}`)}async function B8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let s=await t.readdir(O(r,"objects/pack"));s=s.filter(a=>a.endsWith(".idx"));for(let a of s){let o=`${r}/objects/pack/${a}`,l=await gv({fs:t,cache:e,filename:o,getExternalRefDelta:n});if(l.error)throw new he(l.error);if(l.offsets.has(i))return!0}return!1}async function jE({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let s=o=>Ke({fs:t,cache:e,gitdir:r,oid:o}),a=await L8({fs:t,gitdir:r,oid:i});return a||(a=await B8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:s})),a}function N8(t){let n="5041434b"+"00000002"+"00000000";return t.slice(0,12).toString("hex")===n}function wk(t,e){let r=t.map(i=>i.split("=",1)[0]);return e.filter(i=>{let n=i.split("=",1)[0];return r.includes(n)})}var Md={name:"isomorphic-git",version:"1.36.3",agent:"git/isomorphic-git@1.36.3"},qo=class{constructor(){this._queue=[]}write(e){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){let r=this._waiting;this._waiting=null,r({value:e})}else this._queue.push(e)}end(){if(this._ended=!0,this._waiting){let e=this._waiting;this._waiting=null,e({done:!0})}}destroy(e){this.error=e,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(e=>{this._waiting=e})}};function H8(t){let e=t.indexOf("\r"),r=t.indexOf(` +`);return e===-1&&r===-1?-1:e===-1?r+1:r===-1?e+1:r===e+1?r+1:Math.min(e,r)+1}function yk(t){let e=new qo,r="";return(async()=>(await ou(t,i=>{for(i=i.toString("utf8"),r+=i;;){let n=H8(r);if(n===-1)break;e.write(r.slice(0,n)),r=r.slice(n)}}),r.length>0&&e.write(r),e.end()))(),e}var Rd=class{static demux(e){let r=at.streamReader(e),i=new qo,n=new qo,s=new qo,a=async function(){let o=await r();if(o===null)return a();if(o===!0){i.end(),s.end(),e.error?n.destroy(e.error):n.end();return}switch(o[0]){case 1:{n.write(o.slice(1));break}case 2:{s.write(o.slice(1));break}case 3:{let l=o.slice(1);s.write(l),i.end(),s.end(),n.destroy(new Error(l.toString("utf8")));return}default:i.write(o)}a()};return a(),{packetlines:i,packfile:n,progress:s}}};async function U8(t){let{packetlines:e,packfile:r,progress:i}=Rd.demux(t),n=[],s=[],a=[],o=!1,l=!1;return new Promise((c,u)=>{ou(e,f=>{let d=f.toString("utf8").trim();if(d.startsWith("shallow")){let h=d.slice(-41).trim();h.length!==40&&u(new Ps(h)),n.push(h)}else if(d.startsWith("unshallow")){let h=d.slice(-41).trim();h.length!==40&&u(new Ps(h)),s.push(h)}else if(d.startsWith("ACK")){let[,h,m]=d.split(" ");a.push({oid:h,status:m}),m||(l=!0)}else d.startsWith("NAK")?(o=!0,l=!0):(l=!0,o=!0);l&&(t.error?u(t.error):c({shallows:n,unshallows:s,acks:a,nak:o,packfile:r,progress:i}))}).finally(()=>{l||(t.error?u(t.error):c({shallows:n,unshallows:s,acks:a,nak:o,packfile:r,progress:i}))})})}function G8({capabilities:t=[],wants:e=[],haves:r=[],shallows:i=[],depth:n=null,since:s=null,exclude:a=[]}){let o=[];e=[...new Set(e)];let l=` ${t.join(" ")}`;for(let c of e)o.push(at.encode(`want ${c}${l} +`)),l="";for(let c of i)o.push(at.encode(`shallow ${c} +`));n!==null&&o.push(at.encode(`deepen ${n} +`)),s!==null&&o.push(at.encode(`deepen-since ${Math.floor(s.valueOf()/1e3)} +`));for(let c of a)o.push(at.encode(`deepen-not ${c} +`));o.push(at.flush());for(let c of r)o.push(at.encode(`have ${c} +`));return o.push(at.encode(`done +`)),o}async function yv({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:l,ref:c,remoteRef:u,remote:f,url:d,corsProxy:h,depth:m=null,since:g=null,exclude:v=[],relative:w=!1,tags:b=!1,singleBranch:k=!1,headers:x={},prune:E=!1,pruneTags:A=!1}){let y=c||await Ds({fs:t,gitdir:l,test:!0}),S=await ct.get({fs:t,gitdir:l}),_=f||y&&await S.get(`branch.${y}.remote`)||"origin",T=d||await S.get(`remote.${_}.url`);if(typeof T=="undefined")throw new Sr("remote OR url");let P=u||y&&await S.get(`branch.${y}.merge`)||c||"HEAD";h===void 0&&(h=await S.get("http.corsProxy"));let D=rl.getRemoteHelperFor({url:T}),B=await D.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:h,service:"git-upload-pack",url:T,headers:x,protocolVersion:1}),N=B.auth,ce=B.refs;if(ce.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(m!==null&&!B.capabilities.has("shallow"))throw new Cs("shallow","depth");if(g!==null&&!B.capabilities.has("deepen-since"))throw new Cs("deepen-since","since");if(v.length>0&&!B.capabilities.has("deepen-not"))throw new Cs("deepen-not","exclude");if(w===!0&&!B.capabilities.has("deepen-relative"))throw new Cs("deepen-relative","relative");let{oid:Pe,fullref:ve}=W.resolveAgainstMap({ref:P,map:ce});for(let q of ce.keys())q===ve||q==="HEAD"||q.startsWith("refs/heads/")||b&&q.startsWith("refs/tags/")||ce.delete(q);let se=wk([...B.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Md.agent}`]);w&&se.push("deepen-relative");let xe=k?[Pe]:ce.values(),we=k?[y]:await W.listRefs({fs:t,gitdir:l,filepath:"refs"}),z=[];for(let q of we)try{q=await W.expand({fs:t,gitdir:l,ref:q});let Z=await W.resolve({fs:t,gitdir:l,ref:q});await jE({fs:t,cache:e,gitdir:l,oid:Z})&&z.push(Z)}catch(Z){}z=[...new Set(z)];let Q=await Ea.read({fs:t,gitdir:l}),j=B.capabilities.has("shallow")?[...Q]:[],Le=G8({capabilities:se,wants:xe,haves:z,shallows:j,depth:m,since:g,exclude:v}),lr=Buffer.from(await Pd(Le)),Ft=await D.connect({http:r,onProgress:i,corsProxy:h,service:"git-upload-pack",url:T,auth:N,body:[lr],headers:x}),Ie=await U8(Ft.body);Ft.headers&&(Ie.headers=Ft.headers);for(let q of Ie.shallows)if(!Q.has(q))try{let{object:Z}=await Ke({fs:t,cache:e,gitdir:l,oid:q}),L=new kr(Z),V=await Promise.all(L.headers().parent.map(qe=>jE({fs:t,cache:e,gitdir:l,oid:qe})));V.length===0||V.every(qe=>qe)||Q.add(q)}catch(Z){Q.add(q)}for(let q of Ie.unshallows)Q.delete(q);if(await Ea.write({fs:t,gitdir:l,oids:Q}),k){let q=new Map([[ve,Pe]]),Z=new Map,L=10,V=ve;for(;L--;){let Ot=B.symrefs.get(V);if(Ot===void 0)break;Z.set(V,Ot),V=Ot}let Te=ce.get(V);Te&&q.set(V,Te);let{pruned:qe}=await W.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:q,symrefs:Z,tags:b,prune:E});E&&(Ie.pruned=qe)}else{let{pruned:q}=await W.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:ce,symrefs:B.symrefs,tags:b,prune:E,pruneTags:A});E&&(Ie.pruned=q)}if(Ie.HEAD=B.symrefs.get("HEAD"),Ie.HEAD===void 0){let{oid:q}=W.resolveAgainstMap({ref:"HEAD",map:ce});for(let[Z,L]of ce.entries())if(Z!=="HEAD"&&L===q){Ie.HEAD=Z;break}}let At=ve.startsWith("refs/tags")?"tag":"branch";if(Ie.FETCH_HEAD={oid:Pe,description:`${At} '${_a(ve)}' of ${T}`},i||n){let q=yk(Ie.progress);ou(q,async Z=>{if(n&&await n(Z),i){let L=Z.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);L&&await i({phase:L[1].trim(),loaded:parseInt(L[2],10),total:parseInt(L[3],10)})}})}let Tt=Buffer.from(await Pd(Ie.packfile));if(Ft.body.error)throw Ft.body.error;let jt=Tt.slice(-20).toString("hex"),Ze={defaultBranch:Ie.HEAD,fetchHead:Ie.FETCH_HEAD.oid,fetchHeadDescription:Ie.FETCH_HEAD.description};if(Ie.headers&&(Ze.headers=Ie.headers),E&&(Ze.pruned=Ie.pruned),jt!==""&&!N8(Tt)){Ze.packfile=`objects/pack/pack-${jt}.pack`;let q=O(l,Ze.packfile);await t.write(q,Tt);let Z=V=>Ke({fs:t,cache:e,gitdir:l,oid:V}),L=await jc.fromPack({pack:Tt,getExternalRefDelta:Z,onProgress:i});await t.write(q.replace(/\.pack$/,".idx"),await L.toBuffer())}return Ze}async function bk({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:O(r,".git"),defaultBranch:n="master"}){if(await t.exists(i+"/config"))return;let s=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];s=s.map(a=>i+"/"+a);for(let a of s)await t.mkdir(a);await t.write(i+"/config",`[core] + repositoryformatversion = 0 + filemode = false + bare = ${e} +`+(e?"":` logallrefupdates = true +`)+` symlinks = false + ignorecase = true +`),await t.write(i+"/HEAD",`ref: refs/heads/${n} +`)}async function j8({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:l,dir:c,gitdir:u,url:f,corsProxy:d,ref:h,remote:m,depth:g,since:v,exclude:w,relative:b,singleBranch:k,noCheckout:x,noTags:E,headers:A,nonBlocking:y,batchSize:S=100}){try{if(await bk({fs:t,gitdir:u}),await dk({fs:t,gitdir:u,remote:m,url:f,force:!1}),d){let P=await ct.get({fs:t,gitdir:u});await P.set("http.corsProxy",d),await ct.save({fs:t,gitdir:u,config:P})}let{defaultBranch:_,fetchHead:T}=await yv({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:u,ref:h,remote:m,corsProxy:d,depth:g,since:v,exclude:w,relative:b,singleBranch:k,headers:A,tags:!E});if(T===null)return;h=h||_,h=h.replace("refs/heads/",""),await vv({fs:t,cache:e,onProgress:i,onPostCheckout:l,dir:c,gitdir:u,ref:h,remote:m,noCheckout:x,nonBlocking:y,batchSize:S})}catch(_){throw await t.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),_}}async function _k({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:c=O(l,".git"),url:u,corsProxy:f=void 0,ref:d=void 0,remote:h="origin",depth:m=void 0,since:g=void 0,exclude:v=[],relative:w=!1,singleBranch:b=!1,noCheckout:k=!1,noTags:x=!1,headers:E={},cache:A={},nonBlocking:y=!1,batchSize:S=100}){try{C("fs",t),C("http",e),C("gitdir",c),k||C("dir",l),C("url",u);let _=new J(t),T=await ee({fsp:_,dotgit:c});return await j8({fs:_,cache:A,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:T,url:u,corsProxy:f,ref:d,remote:h,depth:m,since:g,exclude:v,relative:w,singleBranch:b,noCheckout:k,noTags:x,headers:E,nonBlocking:y,batchSize:S})}catch(_){throw _.caller="git.clone",_}}async function xk({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),message:n,author:s,committer:a,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h,cache:m={}}){try{C("fs",t),l||C("message",n),o&&C("onSign",e);let g=new J(t),v=await ee({fsp:g,dotgit:i});return await Od({fs:g,cache:m,onSign:e,gitdir:v,message:n,author:s,committer:a,signingKey:o,amend:l,dryRun:c,noUpdateBranch:u,ref:f,parent:d,tree:h})}catch(g){throw g.caller="git.commit",g}}async function Sk({fs:t,dir:e,gitdir:r=O(e,".git"),fullname:i=!1,test:n=!1}){try{C("fs",t),C("gitdir",r);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await Ds({fs:s,gitdir:a,fullname:i,test:n})}catch(s){throw s.caller="git.currentBranch",s}}async function q8({fs:t,gitdir:e,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await W.exists({fs:t,gitdir:e,ref:r}))throw new He(r);let n=await W.expand({fs:t,gitdir:e,ref:r}),s=await Ds({fs:t,gitdir:e,fullname:!0});if(n===s){let l=await W.resolve({fs:t,gitdir:e,ref:n});await W.writeRef({fs:t,gitdir:e,ref:"HEAD",value:l})}await W.deleteRef({fs:t,gitdir:e,ref:n});let a=_a(r),o=await ct.get({fs:t,gitdir:e});await o.deleteSection("branch",a),await ct.save({fs:t,gitdir:e,config:o})}async function Ek({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i}){try{C("fs",t),C("ref",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await q8({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteBranch",n}}async function kk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i}){try{C("fs",t),C("ref",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});await W.deleteRef({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteRef",n}}async function z8({fs:t,gitdir:e,remote:r}){let i=await ct.get({fs:t,gitdir:e});await i.deleteSection("remote",r),await ct.save({fs:t,gitdir:e,config:i})}async function Ak({fs:t,dir:e,gitdir:r=O(e,".git"),remote:i}){try{C("fs",t),C("remote",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await z8({fs:n,gitdir:s,remote:i})}catch(n){throw n.caller="git.deleteRemote",n}}async function V8({fs:t,gitdir:e,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await W.deleteRef({fs:t,gitdir:e,ref:r})}async function Tk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i}){try{C("fs",t),C("ref",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await V8({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteTag",n}}async function W8({fs:t,gitdir:e,oid:r}){let i=r.slice(0,2);return(await t.readdir(`${e}/objects/${i}`)).map(s=>`${i}${s}`).filter(s=>s.startsWith(r))}async function Y8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let s=[],a=await t.readdir(O(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(let o of a){let l=`${r}/objects/pack/${o}`,c=await gv({fs:t,cache:e,filename:l,getExternalRefDelta:n});if(c.error)throw new he(c.error);for(let u of c.offsets.keys())u.startsWith(i)&&s.push(u)}return s}async function X8({fs:t,cache:e,gitdir:r,oid:i}){let n=o=>Ke({fs:t,cache:e,gitdir:r,oid:o}),s=await W8({fs:t,gitdir:r,oid:i}),a=await Y8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n});for(let o of a)s.indexOf(o)===-1&&s.push(o);if(s.length===1)return s[0];throw s.length>1?new qc("oids",i,s):new He(`an object matching "${i}"`)}async function Ck({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await X8({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.expandOid",s}}async function Pk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i}){try{C("fs",t),C("gitdir",r),C("ref",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await W.expand({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.expandRef",n}}async function bv({fs:t,cache:e,gitdir:r,oids:i}){let n={},s=i.length,a=i.map((o,l)=>({index:l,oid:o}));for(;a.length;){let o=new Set;for(let{oid:c,index:u}of a)n[c]||(n[c]=new Set),n[c].add(u),n[c].size===s&&o.add(c);if(o.size>0)return[...o];let l=new Map;for(let{oid:c,index:u}of a)try{let{object:f}=await Ke({fs:t,cache:e,gitdir:r,oid:c}),d=kr.from(f),{parent:h}=d.parseHeaders();for(let m of h)(!n[m]||!n[m].has(u))&&l.set(m+":"+u,{oid:m,index:u})}catch(f){}a=Array.from(l.values())}return[]}var ev=/^.*(\r?\n|$)/gm;function Z8({branches:t,contents:e}){let r=t[1],i=t[2],n=e[0],s=e[1],a=e[2],o=s.match(ev),l=n.match(ev),c=a.match(ev),u=C3(o,l,c),f=7,d="",h=!0;for(let m of u)m.ok&&(d+=m.ok.join("")),m.conflict&&(h=!1,d+=`${"<".repeat(f)} ${r} +`,d+=m.conflict.a.join(""),d+=`${"=".repeat(f)} +`,d+=m.conflict.b.join(""),d+=`${">".repeat(f)} ${i} +`);return{cleanMerge:h,mergedText:d}}async function K8({fs:t,cache:e,dir:r,gitdir:i=O(r,".git"),index:n,ourOid:s,baseOid:a,theirOid:o,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:f=!1,abortOnConflict:d=!0,mergeDriver:h}){let m=Zr({ref:s}),g=Zr({ref:a}),v=Zr({ref:o}),w=[],b=[],k=[],x=[],E=await Is({fs:t,cache:e,dir:r,gitdir:i,trees:[m,g,v],map:async function(A,[y,S,_]){let T=Sd(A),P=await Cd(y,S),D=await Cd(_,S);switch(`${P}-${D}`){case"false-false":return{mode:await S.mode(),path:T,oid:await S.oid(),type:await S.type()};case"false-true":return!_&&await y.type()==="tree"?{mode:await y.mode(),path:T,oid:await y.oid(),type:await y.type()}:_?{mode:await _.mode(),path:T,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return!y&&await _.type()==="tree"?{mode:await _.mode(),path:T,oid:await _.oid(),type:await _.type()}:y?{mode:await y.mode(),path:T,oid:await y.oid(),type:await y.type()}:void 0;case"true-true":{if(y&&_&&await y.type()==="tree"&&await _.type()==="tree")return{mode:await y.mode(),path:T,oid:await y.oid(),type:"tree"};if(y&&_&&await y.type()==="blob"&&await _.type()==="blob")return Q8({fs:t,gitdir:i,path:T,ours:y,base:S,theirs:_,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async B=>{if(B.cleanMerge)d||n.insert({filepath:A,oid:B.mergeResult.oid,stage:0});else if(w.push(A),b.push(A),!d){let N="";S&&await S.type()==="blob"&&(N=await S.oid());let ce=await y.oid(),Pe=await _.oid();n.delete({filepath:A}),N&&n.insert({filepath:A,oid:N,stage:1}),n.insert({filepath:A,oid:ce,stage:2}),n.insert({filepath:A,oid:Pe,stage:3})}return B.mergeResult});if(S&&!y&&_&&await S.type()==="blob"&&await _.type()==="blob"){if(w.push(A),k.push(A),!d){let B=await S.oid(),N=await _.oid();n.delete({filepath:A}),n.insert({filepath:A,oid:B,stage:1}),n.insert({filepath:A,oid:N,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:T}}if(S&&y&&!_&&await S.type()==="blob"&&await y.type()==="blob"){if(w.push(A),x.push(A),!d){let B=await S.oid(),N=await y.oid();n.delete({filepath:A}),n.insert({filepath:A,oid:B,stage:1}),n.insert({filepath:A,oid:N,stage:2})}return{mode:await y.mode(),oid:await y.oid(),type:"blob",path:T}}if(S&&!y&&!_&&(await S.type()==="blob"||await S.type()==="tree"))return;throw new Yo}}},reduce:w.length!==0&&(!r||d)?void 0:async(A,y)=>{let S=y.filter(Boolean);if(A&&!(A&&A.type==="tree"&&S.length===0&&A.path!==".")){if(S.length>0||A.path==="."&&S.length===0){let T=new Er(S).toObject(),P=await Ar({fs:t,gitdir:i,type:"tree",object:T,dryRun:f});A.oid=P}return A}}});return w.length!==0?(r&&!d&&await Is({fs:t,cache:e,dir:r,gitdir:i,trees:[Zr({ref:E.oid})],map:async function(A,[y]){let S=`${r}/${A}`;if(await y.type()==="blob"){let _=await y.mode(),T=new TextDecoder().decode(await y.content());await t.write(S,T,{mode:_})}return!0}}),new Xo(w,b,k,x)):E.oid}async function Q8({fs:t,gitdir:e,path:r,ours:i,base:n,theirs:s,ourName:a,theirName:o,baseName:l,dryRun:c,mergeDriver:u=Z8}){let f="blob",d="100755",h="",m="";n&&await n.type()==="blob"&&(d=await n.mode(),h=await n.oid(),m=Buffer.from(await n.content()).toString("utf8"));let g=d===await i.mode()?await s.mode():await i.mode();if(await i.oid()===await s.oid())return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:f}};if(await i.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await s.oid(),type:f}};if(await s.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:f}};let v=Buffer.from(await i.content()).toString("utf8"),w=Buffer.from(await s.content()).toString("utf8"),{mergedText:b,cleanMerge:k}=await u({branches:[l,a,o],contents:[m,v,w],path:r}),x=await Ar({fs:t,gitdir:e,type:"blob",object:Buffer.from(b,"utf8"),dryRun:c});return{cleanMerge:k,mergeResult:{mode:g,path:r,oid:x,type:f}}}async function Rk({fs:t,cache:e,dir:r,gitdir:i,ours:n,theirs:s,fastForward:a=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:m,onSign:g,mergeDriver:v,allowUnrelatedHistories:w=!1}){n===void 0&&(n=await Ds({fs:t,gitdir:i,fullname:!0})),n=await W.expand({fs:t,gitdir:i,ref:n}),s=await W.expand({fs:t,gitdir:i,ref:s});let b=await W.resolve({fs:t,gitdir:i,ref:n}),k=await W.resolve({fs:t,gitdir:i,ref:s}),x=await bv({fs:t,cache:e,gitdir:i,oids:[b,k]});if(x.length!==1)if(x.length===0&&w)x.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new Yo;let E=x[0];if(E===k)return{oid:b,alreadyMerged:!0};if(a&&E===b)return!l&&!c&&await W.writeRef({fs:t,gitdir:i,ref:n,value:k}),{oid:k,fastForward:!0};{if(o)throw new Yc;let A=await mt.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async S=>K8({fs:t,cache:e,dir:r,gitdir:i,index:S,ourOid:b,theirOid:k,baseOid:E,ourName:_a(n),baseName:"base",theirName:_a(s),dryRun:l,abortOnConflict:u,mergeDriver:v}));if(A instanceof Xo)throw A;return f||(f=`Merge branch '${_a(s)}' into ${_a(n)}`),{oid:await Od({fs:t,cache:e,gitdir:i,message:f,ref:n,tree:A,parent:[b,k],author:d,committer:h,signingKey:m,onSign:g,dryRun:l,noUpdateBranch:c}),tree:A,mergeCommit:!0}}}async function $k({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,dir:l,gitdir:c,ref:u,url:f,remote:d,remoteRef:h,prune:m,pruneTags:g,fastForward:v,fastForwardOnly:w,corsProxy:b,singleBranch:k,headers:x,author:E,committer:A,signingKey:y}){try{if(!u){let T=await Ds({fs:t,gitdir:c});if(!T)throw new Sr("ref");u=T}let{fetchHead:S,fetchHeadDescription:_}=await yv({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:c,corsProxy:b,ref:u,url:f,remote:d,remoteRef:h,singleBranch:k,headers:x,prune:m,pruneTags:g});await Rk({fs:t,cache:e,gitdir:c,ours:u,theirs:S,fastForward:v,fastForwardOnly:w,message:`Merge ${_}`,author:E,committer:A,signingKey:y,dryRun:!1,noUpdateBranch:!1}),await vv({fs:t,cache:e,onProgress:i,dir:l,gitdir:c,ref:u,remote:d,noCheckout:!1})}catch(S){throw S.caller="git.pull",S}}async function Ik({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:l=O(o,".git"),ref:c,url:u,remote:f,remoteRef:d,corsProxy:h,singleBranch:m,headers:g={},cache:v={}}){try{C("fs",t),C("http",e),C("gitdir",l);let w={name:"",email:"",timestamp:Date.now(),timezoneOffset:0},b=new J(t),k=await ee({fsp:b,dotgit:l});return await $k({fs:b,cache:v,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:k,ref:c,url:u,remote:f,remoteRef:d,fastForwardOnly:!0,corsProxy:h,singleBranch:m,headers:g,author:w,committer:w})}catch(w){throw w.caller="git.fastForward",w}}async function Fk({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:l=O(o,".git"),ref:c,remote:u,remoteRef:f,url:d,corsProxy:h,depth:m=null,since:g=null,exclude:v=[],relative:w=!1,tags:b=!1,singleBranch:k=!1,headers:x={},prune:E=!1,pruneTags:A=!1,cache:y={}}){try{C("fs",t),C("http",e),C("gitdir",l);let S=new J(t),_=await ee({fsp:S,dotgit:l});return await yv({fs:S,cache:y,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,gitdir:_,ref:c,remote:u,remoteRef:f,url:d,corsProxy:h,depth:m,since:g,exclude:v,relative:w,tags:b,singleBranch:k,headers:x,prune:E,pruneTags:A})}catch(S){throw S.caller="git.fetch",S}}async function Ok({fs:t,dir:e,gitdir:r=O(e,".git"),oids:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("oids",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await bv({fs:s,cache:n,gitdir:a,oids:i})}catch(s){throw s.caller="git.findMergeBase",s}}async function Mk({fs:t,filepath:e}){if(await t.exists(O(e,".git")))return e;{let r=xa(e);if(r===e)throw new He(`git root for ${e}`);return Mk({fs:t,filepath:r})}}async function Dk({fs:t,filepath:e}){try{return C("fs",t),C("filepath",e),await Mk({fs:new J(t),filepath:e})}catch(r){throw r.caller="git.findRoot",r}}async function Lk({fs:t,dir:e,gitdir:r=O(e,".git"),path:i}){try{C("fs",t),C("gitdir",r),C("path",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await iu({fs:n,gitdir:s,path:i})}catch(n){throw n.caller="git.getConfig",n}}async function J8({fs:t,gitdir:e,path:r}){return(await ct.get({fs:t,gitdir:e})).getall(r)}async function Bk({fs:t,dir:e,gitdir:r=O(e,".git"),path:i}){try{C("fs",t),C("gitdir",r),C("path",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await J8({fs:n,gitdir:s,path:i})}catch(n){throw n.caller="git.getConfigAll",n}}async function Nk({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1}){try{C("http",t),C("url",s);let c=await rl.getRemoteHelperFor({url:s}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(let[f,d]of c.refs){let h=f.split("/"),m=h.pop(),g=u;for(let v of h)g[v]=g[v]||{},g=g[v];g[m]=d}for(let[f,d]of c.symrefs){let h=f.split("/"),m=h.pop(),g=u;for(let v of h)g[v]=g[v]||{},g=g[v];g[m]=d}return u}catch(l){throw l.caller="git.getRemoteInfo",l}}function Hk(t,e,r,i){let n=[];for(let[s,a]of t.refs){if(e&&!s.startsWith(e))continue;if(s.endsWith("^{}")){if(i){let l=s.replace("^{}",""),c=n[n.length-1],u=c.ref===l?c:n.find(f=>f.ref===l);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=a}continue}let o={ref:s,oid:a};r&&t.symrefs.has(s)&&(o.target=t.symrefs.get(s)),n.push(o)}return n}async function Uk({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1,protocolVersion:l=2}){try{C("http",t),C("url",s);let u=await rl.getRemoteHelperFor({url:s}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:l});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};let f={};for(let d of u.capabilities){let[h,m]=d.split("=");m?f[h]=m:f[h]=!0}return{protocolVersion:1,capabilities:f,refs:Hk(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}async function e6({type:t,object:e,format:r="content",oid:i=void 0}){return r!=="deflated"&&(r!=="wrapped"&&(e=Rs.wrap({type:t,object:e})),i=await qn(e)),{oid:i,object:e}}async function Gk({object:t}){try{C("object",t),typeof t=="string"?t=Buffer.from(t,"utf8"):t instanceof Uint8Array||(t=new Uint8Array(t));let e="blob",{oid:r,object:i}=await e6({type:e,format:"content",object:t});return{oid:r,type:e,object:i,format:"wrapped"}}catch(e){throw e.caller="git.hashBlob",e}}async function t6({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,filepath:s}){try{s=O(i,s);let a=await t.read(s),o=c=>Ke({fs:t,cache:e,gitdir:n,oid:c}),l=await jc.fromPack({pack:a,getExternalRefDelta:o,onProgress:r});return await t.write(s.replace(/\.pack$/,".idx"),await l.toBuffer()),{oids:[...l.hashes]}}catch(a){throw a.caller="git.indexPack",a}}async function jk({fs:t,onProgress:e,dir:r,gitdir:i=O(r,".git"),filepath:n,cache:s={}}){try{C("fs",t),C("dir",r),C("gitdir",r),C("filepath",n);let a=new J(t),o=await ee({fsp:a,dotgit:i});return await t6({fs:a,cache:s,onProgress:e,dir:r,gitdir:o,filepath:n})}catch(a){throw a.caller="git.indexPack",a}}async function qk({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:O(r,".git"),defaultBranch:n="master"}){try{C("fs",t),C("gitdir",i),e||C("dir",r);let s=new J(t),a=await ee({fsp:s,dotgit:i});return await bk({fs:s,bare:e,dir:r,gitdir:a,defaultBranch:n})}catch(s){throw s.caller="git.init",s}}async function zk({fs:t,cache:e,gitdir:r,oid:i,ancestor:n,depth:s}){let a=await Ea.read({fs:t,gitdir:r});if(!i)throw new Sr("oid");if(!n)throw new Sr("ancestor");if(i===n)return!1;let o=[i],l=new Set,c=0;for(;o.length;){if(c++===s)throw new Zc(s);let u=o.shift(),{type:f,object:d}=await Ke({fs:t,cache:e,gitdir:r,oid:u});if(f!=="commit")throw new hr(u,f,"commit");let h=kr.from(d).parse();for(let m of h.parent)if(m===n)return!0;if(!a.has(u))for(let m of h.parent)l.has(m)||(o.push(m),l.add(m))}return!1}async function Vk({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,ancestor:n,depth:s=-1,cache:a={}}){try{C("fs",t),C("gitdir",r),C("oid",i),C("ancestor",n);let o=new J(t),l=await ee({fsp:o,dotgit:r});return await zk({fs:o,cache:a,gitdir:l,oid:i,ancestor:n,depth:s})}catch(o){throw o.caller="git.isDescendent",o}}async function Wk({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i}){try{C("fs",t),C("dir",e),C("gitdir",r),C("filepath",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return Fs.isIgnored({fs:n,dir:e,gitdir:s,filepath:i})}catch(n){throw n.caller="git.isIgnored",n}}async function Yk({fs:t,dir:e,gitdir:r=O(e,".git"),remote:i}){try{C("fs",t),C("gitdir",r);let n=new J(t),s=await ee({fsp:n,dotgit:r});return W.listBranches({fs:n,gitdir:s,remote:i})}catch(n){throw n.caller="git.listBranches",n}}async function r6({fs:t,gitdir:e,ref:r,cache:i}){if(r){let n=await W.resolve({gitdir:e,fs:t,ref:r}),s=[];return await Xk({fs:t,cache:i,gitdir:e,oid:n,filenames:s,prefix:""}),s}else return mt.acquire({fs:t,gitdir:e,cache:i},async function(n){return n.entries.map(s=>s.path)})}async function Xk({fs:t,cache:e,gitdir:r,oid:i,filenames:n,prefix:s}){let{tree:a}=await sl({fs:t,cache:e,gitdir:r,oid:i});for(let o of a)o.type==="tree"?await Xk({fs:t,cache:e,gitdir:r,oid:o.oid,filenames:n,prefix:O(s,o.path)}):n.push(O(s,o.path))}async function Zk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,cache:n={}}){try{C("fs",t),C("gitdir",r);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await r6({fs:s,cache:n,gitdir:a,ref:i})}catch(s){throw s.caller="git.listFiles",s}}async function i6({fs:t,cache:e,gitdir:r,ref:i}){let n;try{n=await W.resolve({gitdir:r,fs:t,ref:i})}catch(o){if(o instanceof He)return[]}return(await sl({fs:t,cache:e,gitdir:r,oid:n})).tree.map(o=>({target:o.path,note:o.oid}))}async function Kk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i="refs/notes/commits",cache:n={}}){try{C("fs",t),C("gitdir",r),C("ref",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await i6({fs:s,cache:n,gitdir:a,ref:i})}catch(s){throw s.caller="git.listNotes",s}}async function Qk({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i}){try{C("fs",t),C("gitdir",r);let n=new J(t),s=await ee({fsp:n,dotgit:r});return W.listRefs({fs:n,gitdir:s,filepath:i})}catch(n){throw n.caller="git.listRefs",n}}async function n6({fs:t,gitdir:e}){let r=await ct.get({fs:t,gitdir:e}),i=await r.getSubsections("remote");return Promise.all(i.map(async s=>{let a=await r.get(`remote.${s}.url`);return{remote:s,url:a}}))}async function Jk({fs:t,dir:e,gitdir:r=O(e,".git")}){try{C("fs",t),C("gitdir",r);let i=new J(t),n=await ee({fsp:i,dotgit:r});return await n6({fs:i,gitdir:n})}catch(i){throw i.caller="git.listRemotes",i}}async function s6(t){let e=at.streamReader(t),r=[],i;for(;i=await e(),i!==!0;){if(i===null)continue;i=i.toString("utf8").replace(/\n$/,"");let[n,s,...a]=i.split(" "),o={ref:s,oid:n};for(let l of a){let[c,u]=l.split(":");c==="symref-target"?o.target=u:c==="peeled"&&(o.peeled=u)}r.push(o)}return r}async function a6({prefix:t,symrefs:e,peelTags:r}){let i=[];return i.push(at.encode(`command=ls-refs +`)),i.push(at.encode(`agent=${Md.agent} +`)),(r||e||t)&&i.push(at.delim()),r&&i.push(at.encode("peel")),e&&i.push(at.encode("symrefs")),t&&i.push(at.encode(`ref-prefix ${t}`)),i.push(at.flush()),i}async function eA({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{C("http",t),C("url",s);let d=await tl.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:l});if(d.protocolVersion===1)return Hk(d,c,u,f);let h=await a6({prefix:c,symrefs:u,peelTags:f}),m=await tl.connect({http:t,auth:d.auth,headers:a,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,body:h});return s6(m.body)}catch(d){throw d.caller="git.listServerRefs",d}}async function tA({fs:t,dir:e,gitdir:r=O(e,".git")}){try{C("fs",t),C("gitdir",r);let i=new J(t),n=await ee({fsp:i,dotgit:r});return W.listTags({fs:i,gitdir:n})}catch(i){throw i.caller="git.listTags",i}}function o6(t,e){return t.committer.timestamp-e.committer.timestamp}var l6="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function qE({fs:t,cache:e,gitdir:r,oid:i,fileId:n}){if(n===l6)return;let s=i,a,o=await Qo({fs:t,cache:e,gitdir:r,oid:i}),l=o.tree;return n===o.oid?a=o.path:(a=await rA({fs:t,cache:e,gitdir:r,tree:l,fileId:n,oid:s}),Array.isArray(a)&&(a.length===0?a=void 0:a.length===1&&(a=a[0]))),a}async function rA({fs:t,cache:e,gitdir:r,tree:i,fileId:n,oid:s,filepaths:a=[],parentPath:o=""}){let l=i.entries().map(function(c){let u;return c.oid===n?(u=O(o,c.path),a.push(u)):c.type==="tree"&&(u=Ke({fs:t,cache:e,gitdir:r,oid:c.oid}).then(function({object:f}){return rA({fs:t,cache:e,gitdir:r,tree:Er.from(f),fileId:n,oid:s,filepaths:a,parentPath:O(o,c.path)})})),u});return await Promise.all(l),a}async function c6({fs:t,cache:e,gitdir:r,filepath:i,ref:n,depth:s,since:a,force:o,follow:l}){let c=typeof a=="undefined"?void 0:Math.floor(a.valueOf()/1e3),u=[],f=await Ea.read({fs:t,gitdir:r}),d=await W.resolve({fs:t,gitdir:r,ref:n}),h=[await el({fs:t,cache:e,gitdir:r,oid:d})],m,g,v;function w(b){v&&i&&u.push(b)}for(;h.length>0;){let b=h.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(i){let k;try{k=await su({fs:t,cache:e,gitdir:r,oid:b.commit.tree,filepath:i}),g&&m!==k&&u.push(g),m=k,g=b,v=!0}catch(x){if(x instanceof He){let E=l&&m;if(E&&(E=await qE({fs:t,cache:e,gitdir:r,oid:b.commit.tree,fileId:m}),E))if(Array.isArray(E)){if(g){let A=await qE({fs:t,cache:e,gitdir:r,oid:g.commit.tree,fileId:m});if(Array.isArray(A))if(E=E.filter(y=>A.indexOf(y)===-1),E.length===1)E=E[0],i=E,g&&u.push(g);else{E=!1,g&&u.push(g);break}}}else i=E,g&&u.push(g);if(!E){if(v&&m&&(u.push(g),!o))break;if(!o&&!l)throw x}g=b,v=!1}else throw x}}else u.push(b);if(s!==void 0&&u.length===s){w(b);break}if(!f.has(b.oid))for(let k of b.commit.parent){let x=await el({fs:t,cache:e,gitdir:r,oid:k});h.map(E=>E.oid).includes(x.oid)||h.push(x)}h.length===0&&w(b),h.sort((k,x)=>o6(k.commit,x.commit))}return u}async function iA({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,ref:n="HEAD",depth:s,since:a,force:o,follow:l,cache:c={}}){try{C("fs",t),C("gitdir",r),C("ref",n);let u=new J(t),f=await ee({fsp:u,dotgit:r});return await c6({fs:u,cache:c,gitdir:f,filepath:i,ref:n,depth:s,since:a,force:o,follow:l})}catch(u){throw u.caller="git.log",u}}async function nA({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),ours:n,theirs:s,fastForward:a=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:m,cache:g={},mergeDriver:v,allowUnrelatedHistories:w=!1}){try{C("fs",t),m&&C("onSign",e);let b=new J(t),k=await ee({fsp:b,dotgit:i}),x=await Os({fs:b,gitdir:k,author:d});if(!x&&(!o||!a))throw new Jt("author");let E=await Jo({fs:b,gitdir:k,author:x,committer:h});if(!E&&(!o||!a))throw new Jt("committer");return await Rk({fs:b,cache:g,dir:r,gitdir:k,ours:n,theirs:s,fastForward:a,fastForwardOnly:o,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:f,author:x,committer:E,signingKey:m,onSign:e,mergeDriver:v,allowUnrelatedHistories:w})}catch(b){throw b.caller="git.merge",b}}var u6={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function sA({fs:t,cache:e,dir:r,gitdir:i=O(r,".git"),oids:n}){let s=new VE,a=[];function o(u,f){let d=Buffer.from(u,f);a.push(d),s.update(d)}async function l({stype:u,object:f}){let d=u6[u],h=f.length,m=h>15?128:0,g=h&15;h=h>>>4;let v=(m|d|g).toString(16);for(o(v,"hex");m;)m=h>127?128:0,v=m|h&127,o(pv(2,v),"hex"),h=h>>>7;o(Buffer.from(await nk(f)))}o("PACK"),o("00000002","hex"),o(pv(8,n.length),"hex");for(let u of n){let{type:f,object:d}=await Ke({fs:t,cache:e,gitdir:i,oid:u});await l({write:o,object:d,stype:f})}let c=s.digest();return a.push(c),a}async function f6({fs:t,cache:e,gitdir:r,oids:i,write:n}){let s=await sA({fs:t,cache:e,gitdir:r,oids:i}),a=Buffer.from(await Pd(s)),l=`pack-${a.slice(-20).toString("hex")}.pack`;return n?(await t.write(O(r,`objects/pack/${l}`),a),{filename:l}):{filename:l,packfile:new Uint8Array(a)}}async function aA({fs:t,dir:e,gitdir:r=O(e,".git"),oids:i,write:n=!1,cache:s={}}){try{C("fs",t),C("gitdir",r),C("oids",i);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await f6({fs:a,cache:s,gitdir:o,oids:i,write:n})}catch(a){throw a.caller="git.packObjects",a}}async function oA({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:l=O(o,".git"),ref:c,url:u,remote:f,remoteRef:d,prune:h=!1,pruneTags:m=!1,fastForward:g=!0,fastForwardOnly:v=!1,corsProxy:w,singleBranch:b,headers:k={},author:x,committer:E,signingKey:A,cache:y={}}){try{C("fs",t),C("gitdir",l);let S=new J(t),_=await ee({fsp:S,dotgit:l}),T=await Os({fs:S,gitdir:_,author:x});if(!T)throw new Jt("author");let P=await Jo({fs:S,gitdir:_,author:T,committer:E});if(!P)throw new Jt("committer");return await $k({fs:S,cache:y,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:_,ref:c,url:u,remote:f,remoteRef:d,fastForward:g,fastForwardOnly:v,corsProxy:w,singleBranch:b,headers:k,author:T,committer:P,signingKey:A,prune:h,pruneTags:m})}catch(S){throw S.caller="git.pull",S}}async function d6({fs:t,cache:e,dir:r,gitdir:i=O(r,".git"),start:n,finish:s}){let a=await Ea.read({fs:t,gitdir:i}),o=new Set,l=new Set;for(let f of n)o.add(await W.resolve({fs:t,gitdir:i,ref:f}));for(let f of s)try{let d=await W.resolve({fs:t,gitdir:i,ref:f});l.add(d)}catch(d){}let c=new Set;async function u(f){c.add(f);let{type:d,object:h}=await Ke({fs:t,cache:e,gitdir:i,oid:f});if(d==="tag"){let g=Kr.from(h).headers().object;return u(g)}if(d!=="commit")throw new hr(f,d,"commit");if(!a.has(f)){let g=kr.from(h).headers().parent;for(f of g)!l.has(f)&&!c.has(f)&&await u(f)}}for(let f of o)await u(f);return c}async function tv({fs:t,cache:e,dir:r,gitdir:i=O(r,".git"),oids:n}){let s=new Set;async function a(o){if(s.has(o))return;s.add(o);let{type:l,object:c}=await Ke({fs:t,cache:e,gitdir:i,oid:o});if(l==="tag"){let f=Kr.from(c).headers().object;await a(f)}else if(l==="commit"){let f=kr.from(c).headers().tree;await a(f)}else if(l==="tree"){let u=Er.from(c);for(let f of u)f.type==="blob"&&s.add(f.oid),f.type==="tree"&&await a(f.oid)}}for(let o of n)await a(o);return s}async function h6(t){let e={},r="",i=at.streamReader(t),n=await i();for(;n!==!0;)n!==null&&(r+=n.toString("utf8")+` +`),n=await i();let s=r.toString("utf8").split(` +`);if(n=s.shift(),!n.startsWith("unpack "))throw new Sa('unpack ok" or "unpack [error message]',n);e.ok=n==="unpack ok",e.ok||(e.error=n.slice(7)),e.refs={};for(let a of s){if(a.trim()==="")continue;let o=a.slice(0,2),l=a.slice(3),c=l.indexOf(" ");c===-1&&(c=l.length);let u=l.slice(0,c),f=l.slice(c+1);e.refs[u]={ok:o==="ok",error:f}}return e}async function p6({capabilities:t=[],triplets:e=[]}){let r=[],i=`\0 ${t.join(" ")}`;for(let n of e)r.push(at.encode(`${n.oldoid} ${n.oid} ${n.fullRef}${i} +`)),i="";return r.push(at.flush()),r}async function m6({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,onPrePush:l,gitdir:c,ref:u,remoteRef:f,remote:d,url:h,force:m=!1,delete:g=!1,corsProxy:v,headers:w={}}){let b=u||await Ds({fs:t,gitdir:c});if(typeof b=="undefined")throw new Sr("ref");let k=await ct.get({fs:t,gitdir:c});d=d||await k.get(`branch.${b}.pushRemote`)||await k.get("remote.pushDefault")||await k.get(`branch.${b}.remote`)||"origin";let x=h||await k.get(`remote.${d}.pushurl`)||await k.get(`remote.${d}.url`);if(typeof x=="undefined")throw new Sr("remote OR url");let E=f||await k.get(`branch.${b}.merge`);if(typeof x=="undefined")throw new Sr("remoteRef");v===void 0&&(v=await k.get("http.corsProxy"));let A=await W.expand({fs:t,gitdir:c,ref:b}),y=g?"0000000000000000000000000000000000000000":await W.resolve({fs:t,gitdir:c,ref:A}),S=rl.getRemoteHelperFor({url:x}),_=await S.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:v,service:"git-receive-pack",url:x,headers:w,protocolVersion:1}),T=_.auth,P;if(!E)P=A;else try{P=await W.expandAgainstMap({ref:E,map:_.refs})}catch(Q){if(Q instanceof He)P=E.startsWith("refs/")?E:`refs/heads/${E}`;else throw Q}let D=_.refs.get(P)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:d,url:x,localRef:{ref:g?"(delete)":A,oid:y},remoteRef:{ref:P,oid:D}}))throw new Ko;let B=!_.capabilities.has("no-thin"),N=new Set;if(!g){let Q=[..._.refs.values()],j=new Set;if(D!=="0000000000000000000000000000000000000000"){let Le=await bv({fs:t,cache:e,gitdir:c,oids:[y,D]});for(let lr of Le)Q.push(lr);B&&(j=await tv({fs:t,cache:e,gitdir:c,oids:Le}))}if(!Q.includes(y)){let Le=await d6({fs:t,cache:e,gitdir:c,start:[y],finish:Q});N=await tv({fs:t,cache:e,gitdir:c,oids:Le})}if(B){try{let Le=await W.resolve({fs:t,gitdir:c,ref:`refs/remotes/${d}/HEAD`,depth:2}),{oid:lr}=await W.resolveAgainstMap({ref:Le.replace(`refs/remotes/${d}/`,""),fullref:Le,map:_.refs}),Ft=[lr];for(let Ie of await tv({fs:t,cache:e,gitdir:c,oids:Ft}))j.add(Ie)}catch(Le){}for(let Le of j)N.delete(Le)}if(y===D&&(m=!0),!m){if(A.startsWith("refs/tags")&&D!=="0000000000000000000000000000000000000000")throw new Zo("tag-exists");if(y!=="0000000000000000000000000000000000000000"&&D!=="0000000000000000000000000000000000000000"&&!await zk({fs:t,cache:e,gitdir:c,oid:y,ancestor:D,depth:-1}))throw new Zo("not-fast-forward")}}let ce=wk([..._.capabilities],["report-status","side-band-64k",`agent=${Md.agent}`]),Pe=await p6({capabilities:ce,triplets:[{oldoid:D,oid:y,fullRef:P}]}),ve=g?[]:await sA({fs:t,cache:e,gitdir:c,oids:[...N]}),se=await S.connect({http:r,onProgress:i,corsProxy:v,service:"git-receive-pack",url:x,auth:T,headers:w,body:[...Pe,...ve]}),{packfile:xe,progress:we}=await Rd.demux(se.body);if(n){let Q=yk(we);ou(Q,async j=>{await n(j)})}let z=await h6(xe);if(se.headers&&(z.headers=se.headers),d&&z.ok&&z.refs[P].ok&&!A.startsWith("refs/tags")){let Q=`refs/remotes/${d}/${P.replace("refs/heads","")}`;g?await W.deleteRef({fs:t,gitdir:c,ref:Q}):await W.writeRef({fs:t,gitdir:c,ref:Q,value:y})}if(z.ok&&Object.values(z.refs).every(Q=>Q.ok))return z;{let Q=Object.entries(z.refs).filter(([j,Le])=>!Le.ok).map(([j,Le])=>` + - ${j}: ${Le.error}`).join("");throw new Xc(Q,z)}}async function lA({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,dir:l,gitdir:c=O(l,".git"),ref:u,remoteRef:f,remote:d="origin",url:h,force:m=!1,delete:g=!1,corsProxy:v,headers:w={},cache:b={}}){try{C("fs",t),C("http",e),C("gitdir",c);let k=new J(t),x=await ee({fsp:k,dotgit:c});return await m6({fs:k,cache:b,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,gitdir:x,ref:u,remoteRef:f,remote:d,url:h,force:m,delete:g,corsProxy:v,headers:w})}catch(k){throw k.caller="git.push",k}}async function cA({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await Ke({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Kr.from(s).parse().object,cA({fs:t,cache:e,gitdir:r,oid:i});if(n!=="blob")throw new hr(i,n,"blob");return{oid:i,blob:new Uint8Array(s)}}async function uA({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){return n!==void 0&&(i=await su({fs:t,cache:e,gitdir:r,oid:i,filepath:n})),await cA({fs:t,cache:e,gitdir:r,oid:i})}async function fA({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,filepath:n,cache:s={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await uA({fs:a,cache:s,gitdir:o,oid:i,filepath:n})}catch(a){throw a.caller="git.readBlob",a}}async function _v({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await el({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.readCommit",s}}async function g6({fs:t,cache:e,gitdir:r,ref:i="refs/notes/commits",oid:n}){let s=await W.resolve({gitdir:r,fs:t,ref:i}),{blob:a}=await uA({fs:t,cache:e,gitdir:r,oid:s,filepath:n});return a}async function dA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i="refs/notes/commits",oid:n,cache:s={}}){try{C("fs",t),C("gitdir",r),C("ref",i),C("oid",n);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await g6({fs:a,cache:s,gitdir:o,ref:i,oid:n})}catch(a){throw a.caller="git.readNote",a}}async function hA({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,format:n="parsed",filepath:s=void 0,encoding:a=void 0,cache:o={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let l=new J(t),c=await ee({fsp:l,dotgit:r});s!==void 0&&(i=await su({fs:l,cache:o,gitdir:c,oid:i,filepath:s}));let f=await Ke({fs:l,cache:o,gitdir:c,oid:i,format:n==="parsed"?"content":n});if(f.oid=i,n==="parsed")switch(f.format="parsed",f.type){case"commit":f.object=kr.from(f.object).parse();break;case"tree":f.object=Er.from(f.object).entries();break;case"blob":a?f.object=f.object.toString(a):(f.object=new Uint8Array(f.object),f.format="content");break;case"tag":f.object=Kr.from(f.object).parse();break;default:throw new hr(f.oid,f.type,"blob|commit|tag|tree")}else(f.format==="deflated"||f.format==="wrapped")&&(f.type=f.format);return f}catch(l){throw l.caller="git.readObject",l}}async function v6({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await Ke({fs:t,cache:e,gitdir:r,oid:i,format:"content"});if(n!=="tag")throw new hr(i,n,"tag");let a=Kr.from(s);return{oid:i,tag:a.parse(),payload:a.payload()}}async function pA({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await v6({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.readTag",s}}async function mA({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,filepath:n=void 0,cache:s={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await sl({fs:a,cache:s,gitdir:o,oid:i,filepath:n})}catch(a){throw a.caller="git.readTree",a}}async function gA({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("filepath",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});await mt.acquire({fs:s,gitdir:a,cache:n},async function(o){o.delete({filepath:i})})}catch(s){throw s.caller="git.remove",s}}async function w6({fs:t,cache:e,onSign:r,gitdir:i,ref:n="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l}){let c;try{c=await W.resolve({gitdir:i,fs:t,ref:n})}catch(m){if(!(m instanceof He))throw m}let f=(await sl({fs:t,cache:e,gitdir:i,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(m=>m.path!==s);let d=await au({fs:t,gitdir:i,tree:f});return await Od({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:d,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote' +`,author:a,committer:o,signingKey:l})}async function vA({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),ref:n="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l,cache:c={}}){try{C("fs",t),C("gitdir",i),C("oid",s);let u=new J(t),f=await ee({fsp:u,dotgit:i}),d=await Os({fs:u,gitdir:f,author:a});if(!d)throw new Jt("author");let h=await Jo({fs:u,gitdir:f,author:d,committer:o});if(!h)throw new Jt("committer");return await w6({fs:u,cache:c,onSign:e,gitdir:f,ref:n,oid:s,author:d,committer:h,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function y6({fs:t,gitdir:e,oldref:r,ref:i,checkout:n=!1}){if(!nu(i,!0))throw new Ii(i,Hc.clean(i));if(!nu(r,!0))throw new Ii(r,Hc.clean(r));let s=`refs/heads/${r}`,a=`refs/heads/${i}`;if(await W.exists({fs:t,gitdir:e,ref:a}))throw new $i("branch",i,!1);let l=await W.resolve({fs:t,gitdir:e,ref:s,depth:1});await W.writeRef({fs:t,gitdir:e,ref:a,value:l}),await W.deleteRef({fs:t,gitdir:e,ref:s});let u=await Ds({fs:t,gitdir:e,fullname:!0})===s;(n||u)&&await W.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function wA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,oldref:n,checkout:s=!1}){try{C("fs",t),C("gitdir",r),C("ref",i),C("oldref",n);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await y6({fs:a,gitdir:o,ref:i,oldref:n,checkout:s})}catch(a){throw a.caller="git.renameBranch",a}}async function yA({gitdir:t,type:e,object:r}){return qn(Rs.wrap({type:e,object:r}))}async function bA({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,ref:n,cache:s={}}){try{C("fs",t),C("gitdir",r),C("filepath",i);let a=new J(t),o=await ee({fsp:a,dotgit:r}),l,c;try{l=await W.resolve({fs:a,gitdir:o,ref:n||"HEAD"})}catch(d){if(n)throw d}if(l)try{l=await su({fs:a,cache:s,gitdir:o,oid:l,filepath:i})}catch(d){l=null}let u={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},f=e&&await a.read(O(e,i));f&&(c=await yA({gitdir:o,type:"blob",object:f}),l===c&&(u=await a.lstat(O(e,i)))),await mt.acquire({fs:a,gitdir:o,cache:s},async function(d){d.delete({filepath:i}),l&&d.insert({filepath:i,stats:u,oid:l})})}catch(a){throw a.caller="git.reset",a}}async function _A({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,depth:n}){try{C("fs",t),C("gitdir",r),C("ref",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await W.resolve({fs:s,gitdir:a,ref:i,depth:n})}catch(s){throw s.caller="git.resolveRef",s}}async function xA({fs:t,dir:e,gitdir:r=O(e,".git"),path:i,value:n,append:s=!1}){try{C("fs",t),C("gitdir",r),C("path",i);let a=new J(t),o=await ee({fsp:a,dotgit:r}),l=await ct.get({fs:a,gitdir:o});s?await l.append(i,n):await l.set(i,n),await ct.save({fs:a,gitdir:o,config:l})}catch(a){throw a.caller="git.setConfig",a}}async function SA({fs:t,gitdir:e,commit:r}){let i=kr.from(r).toObject();return await Ar({fs:t,gitdir:e,type:"commit",object:i,format:"content"})}var $d=class t{static get timezoneOffsetForRefLogEntry(){let e=new Date().getTimezoneOffset(),r=Math.abs(Math.floor(e/60)),i=Math.abs(e%60).toString().padStart(2,"0");return`${e>0?"-":"+"}${r.toString().padStart(2,"0")}${i}`}static createStashReflogEntry(e,r,i){let n=e.name.replace(/\s/g,""),s="0000000000000000000000000000000000000000",a=Math.floor(Date.now()/1e3),o=t.timezoneOffsetForRefLogEntry;return`${s} ${r} ${n} ${e.email} ${a} ${o} ${i} +`}static getStashReflogEntry(e,r=!1){return e.split(` +`).filter(s=>s).reverse().map((s,a)=>r?`stash@{${a}}: ${s.split(" ")[1]}`:s)}},b6={stage:Aa,workdir:nl},rv;async function il(t,e){return rv===void 0&&(rv=new Nc),rv.acquire(t,e)}async function _6(t,e,r,i,n=null){let s=O(r,i),a=await t.lstat(s);if(!a)throw new He(s);if(a.isDirectory())throw new he(`${s}: file expected, but found directory`);let o=n?await QE({fs:t,gitdir:e,oid:n}):void 0,l=o?n:void 0;return o||await il({fs:t,gitdir:e,currentFilepath:s},async()=>{let c=a.isSymbolicLink()?await t.readlink(s).then(sk):await t.read(s);if(c===null)throw new He(s);l=await Ar({fs:t,gitdir:e,type:"blob",object:c})}),l}async function x6({fs:t,dir:e,gitdir:r,entries:i}){async function n(s){if(s.type==="tree"){if(!s.oid){let a=await Promise.all(s.children.map(n));s.oid=await au({fs:t,gitdir:r,tree:a}),s.mode=16384}}else s.type==="blob"&&(s.oid=await _6(t,r,e,s.path,s.oid),s.mode=33188);return s.path=s.path.split("/").pop(),s}return Promise.all(i.map(n))}async function zE({fs:t,dir:e,gitdir:r,treePair:i}){let n=i[1]==="stage",s=i.map(h=>typeof h=="string"?b6[h]():h),a=[],u=await Is({fs:t,cache:{},dir:e,gitdir:r,trees:s,map:async(h,[m,g])=>{if(!(h==="."||await Fs.isIgnored({fs:t,dir:e,gitdir:r,filepath:h}))&&g)return(!m||await m.oid()!==await g.oid()&&await g.oid()!==void 0)&&a.push([m,g]),{mode:await g.mode(),path:h,oid:await g.oid(),type:await g.type()}},reduce:async(h,m)=>(m=m.filter(Boolean),h?(h.children=m,h):m.length>0?m:void 0),iterate:async(h,m)=>{let g=[];for(let v of m){let[w,b]=v;n?b&&(await t.exists(`${e}/${b.toString()}`)?g.push(v):a.push([null,b])):w&&(b?g.push(v):a.push([w,null]))}return g.length?Promise.all(g.map(h)):[]}});if(a.length===0||u.length===0)return null;let d=(await x6({fs:t,dir:e,gitdir:r,entries:u})).filter(Boolean).map(h=>({mode:h.mode,path:h.path,oid:h.oid,type:h.type}));return au({fs:t,gitdir:r,tree:d})}async function S6({fs:t,dir:e,gitdir:r,stashCommit:i,parentCommit:n,wasStaged:s}){let a=[],o=[],l=await Is({fs:t,cache:{},dir:e,gitdir:r,trees:[Zr({ref:n}),Zr({ref:i})],map:async(c,[u,f])=>{if(c==="."||await Fs.isIgnored({fs:t,dir:e,gitdir:r,filepath:c}))return;let d=f?await f.type():await u.type();if(d!=="tree"&&d!=="blob")return;if(!f&&u){let m=d==="tree"?"rmdir":"rm";return d==="tree"&&a.push(c),d==="blob"&&s&&o.push({filepath:c,oid:await u.oid()}),{method:m,filepath:c}}let h=await f.oid();if(!u||await u.oid()!==h)return d==="tree"?{method:"mkdir",filepath:c}:(s&&o.push({filepath:c,oid:h,stats:await t.lstat(O(e,c))}),{method:"write",filepath:c,oid:h})}});await il({fs:t,gitdir:r,dirRemoved:a,ops:l},async()=>{for(let c of l){let u=O(e,c.filepath);switch(c.method){case"rmdir":await t.rmdir(u);break;case"mkdir":await t.mkdir(u);break;case"rm":await t.rm(u);break;case"write":if(!a.some(f=>u.startsWith(f))){let{object:f}=await Ke({fs:t,cache:{},gitdir:r,oid:c.oid});await t.exists(u)&&await t.rm(u),await t.write(u,f)}break}}}),await mt.acquire({fs:t,gitdir:r,cache:{}},async c=>{o.forEach(({filepath:u,stats:f,oid:d})=>{c.insert({filepath:u,stats:f,oid:d})})})}var ka=class t{constructor({fs:e,dir:r,gitdir:i=O(r,".git")}){Object.assign(this,{fs:e,dir:r,gitdir:i,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return O(this.gitdir,t.refStash)}get refLogsStashPath(){return O(this.gitdir,t.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await Os({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Jt("author");return this._author}async getStashSHA(e,r){return await this.fs.exists(this.refStashPath)?(r||await this.readStashReflogs({parsed:!1}))[e].split(" ")[1]:null}async writeStashCommit({message:e,tree:r,parent:i}){return SA({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:r,parent:i,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(e){let r=await this.readStashReflogs({parsed:!1});if(e!==0&&(e<0||e>r.length-1))throw new Ii(`stash@${e}`,"number that is in range of [0, num of stash pushed]");let i=await this.getStashSHA(e,r);return i?el({fs:this.fs,cache:{},gitdir:this.gitdir,oid:i}):{}}async writeStashRef(e){return W.writeRef({fs:this.fs,gitdir:this.gitdir,ref:t.refStash,value:e})}async writeStashReflogEntry({stashCommit:e,message:r}){let i=await this.getAuthor(),n=$d.createStashReflogEntry(i,e,r),s=this.refLogsStashPath;await il({filepath:s,entry:n},async()=>{let a=await this.fs.exists(s)?await this.fs.read(s,"utf8"):"";await this.fs.write(s,a+n,"utf8")})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let r=await this.fs.read(this.refLogsStashPath,"utf8");return $d.getStashReflogEntry(r,e)}};async function EA({fs:t,dir:e,gitdir:r,message:i=""}){let n=new ka({fs:t,dir:e,gitdir:r});await n.getAuthor();let s=await Ds({fs:t,gitdir:r,fullname:!1}),a=await W.resolve({fs:t,gitdir:r,ref:"HEAD"}),l=(await _v({fs:t,dir:e,gitdir:r,oid:a})).commit.message,c=[a],u=null,f=Zr({ref:"HEAD"}),d=await zE({fs:t,dir:e,gitdir:r,treePair:[Zr({ref:"HEAD"}),"stage"]});if(d){let v=await n.writeStashCommit({message:`stash-Index: WIP on ${s} - ${new Date().toISOString()}`,tree:d,parent:c});c.push(v),u=d,f=Aa()}let h=await zE({fs:t,dir:e,gitdir:r,treePair:[f,"workdir"]});if(h){let v=await n.writeStashCommit({message:`stash-WorkDir: WIP on ${s} - ${new Date().toISOString()}`,tree:h,parent:[c[c.length-1]]});c.push(v),u=h}if(!u||!d&&!h)throw new He("changes, nothing to stash");let m=(i.trim()||`WIP on ${s}`)+`: ${a.substring(0,7)} ${l}`;return{stashCommit:await n.writeStashCommit({message:m,tree:u,parent:c}),stashMsg:m,branch:s,stashMgr:n}}async function E6({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n,stashMsg:s,branch:a,stashMgr:o}=await EA({fs:t,dir:e,gitdir:r,message:i});return await o.writeStashRef(n),await o.writeStashReflogEntry({stashCommit:n,message:s}),await wv({fs:t,dir:e,gitdir:r,ref:a,track:!1,force:!0}),n}async function k6({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n}=await EA({fs:t,dir:e,gitdir:r,message:i});return n}async function kA({fs:t,dir:e,gitdir:r,refIdx:i=0}){let s=await new ka({fs:t,dir:e,gitdir:r}).readStashCommit(i),{parent:a=null}=s.commit?s.commit:{};if(!(!a||!Array.isArray(a)))for(let o=0;o{await t.exists(a)&&await t.rm(a)});let o=await n.readStashReflogs({parsed:!1});if(!o.length)return;o.splice(i,1);let l=n.refLogsStashPath;await il({reflogEntries:o,stashReflogPath:l,stashMgr:n},async()=>{if(o.length){await t.write(l,o.reverse().join(` +`)+` +`,"utf8");let c=o[o.length-1].split(" ")[1];await n.writeStashRef(c)}else await t.rm(l)})}async function A6({fs:t,dir:e,gitdir:r}){return new ka({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}async function T6({fs:t,dir:e,gitdir:r}){let i=new ka({fs:t,dir:e,gitdir:r}),n=[i.refStashPath,i.refLogsStashPath];await il(n,async()=>{await Promise.all(n.map(async s=>{if(await t.exists(s))return t.rm(s)}))})}async function C6({fs:t,dir:e,gitdir:r,refIdx:i=0}){await kA({fs:t,dir:e,gitdir:r,refIdx:i}),await AA({fs:t,dir:e,gitdir:r,refIdx:i})}async function TA({fs:t,dir:e,gitdir:r=O(e,".git"),op:i="push",message:n="",refIdx:s=0}){C("fs",t),C("dir",e),C("gitdir",r),C("op",i);let a={push:E6,apply:kA,drop:AA,list:A6,clear:T6,pop:C6,create:k6},o=["apply","drop","pop"];try{let l=new J(t),c=await ee({fsp:l,dotgit:r});["refs","logs","logs/refs"].map(d=>O(c,d)).forEach(async d=>{await l.exists(d)||await l.mkdir(d)});let f=a[i];if(f){if(o.includes(i)&&s<0)throw new Ii(`stash@${s}`,"number that is in range of [0, num of stash pushed]");return await f({fs:l,dir:e,gitdir:c,message:n,refIdx:s})}throw new Error(`To be implemented: ${i}`)}catch(l){throw l.caller="git.stash",l}}async function CA({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("filepath",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});if(await Fs.isIgnored({fs:s,gitdir:a,dir:e,filepath:i}))return"ignored";let l=await P6({fs:s,cache:n,gitdir:a}),c=await PA({fs:s,cache:n,gitdir:a,tree:l,path:i}),u=await mt.acquire({fs:s,gitdir:a,cache:n},async function(v){for(let w of v)if(w.path===i)return w;return null}),f=await s.lstat(O(e,i)),d=c!==null,h=u!==null,m=f!==null,g=async()=>{if(h&&!xd(u,f))return u.oid;{let v=await s.read(O(e,i)),w=await yA({gitdir:a,type:"blob",object:v});return h&&u.oid===w&&f.size!==-1&&mt.acquire({fs:s,gitdir:a,cache:n},async function(b){b.insert({filepath:i,stats:f,oid:w})}),w}};if(!d&&!m&&!h)return"absent";if(!d&&!m&&h)return"*absent";if(!d&&m&&!h)return"*added";if(!d&&m&&h)return await g()===u.oid?"added":"*added";if(d&&!m&&!h)return"deleted";if(d&&!m&&h)return c===u.oid,"*deleted";if(d&&m&&!h)return await g()===c?"*undeleted":"*undeletemodified";if(d&&m&&h){let v=await g();return v===c?v===u.oid?"unmodified":"*unmodified":v===u.oid?"modified":"*modified"}}catch(s){throw s.caller="git.status",s}}async function PA({fs:t,cache:e,gitdir:r,tree:i,path:n}){typeof n=="string"&&(n=n.split("/"));let s=n.shift();for(let a of i)if(a.path===s){if(n.length===0)return a.oid;let{type:o,object:l}=await Ke({fs:t,cache:e,gitdir:r,oid:a.oid});if(o==="tree"){let c=Er.from(l);return PA({fs:t,cache:e,gitdir:r,tree:c,path:n})}if(o==="blob")throw new hr(a.oid,o,"blob",n.join("/"))}return null}async function P6({fs:t,cache:e,gitdir:r}){let i;try{i=await W.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(s){if(s instanceof He)return[]}let{tree:n}=await sl({fs:t,cache:e,gitdir:r,oid:i});return n}async function RA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i="HEAD",filepaths:n=["."],filter:s,cache:a={},ignored:o=!1}){try{C("fs",t),C("gitdir",r),C("ref",i);let l=new J(t),c=await ee({fsp:l,dotgit:r});return await Is({fs:l,cache:a,dir:e,gitdir:c,trees:[Zr({ref:i}),nl(),Aa()],map:async function(u,[f,d,h]){if(!f&&!h&&d&&!o&&await Fs.isIgnored({fs:l,dir:e,filepath:u})||!n.some(y=>gk(u,y)))return null;if(s&&!s(u))return;let[m,g,v]=await Promise.all([f&&f.type(),d&&d.type(),h&&h.type()]),w=[m,g,v].includes("blob");if((m==="tree"||m==="special")&&!w)return;if(m==="commit")return null;if((g==="tree"||g==="special")&&!w)return;if(v==="commit")return null;if((v==="tree"||v==="special")&&!w)return;let b=m==="blob"?await f.oid():void 0,k=v==="blob"?await h.oid():void 0,x;m!=="blob"&&g==="blob"&&v!=="blob"?x="42":g==="blob"&&(x=await d.oid());let E=[void 0,b,x,k],A=E.map(y=>E.indexOf(y));return A.shift(),[u,...A]}})}catch(l){throw l.caller="git.statusMatrix",l}}async function $A({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,object:n,force:s=!1}){try{C("fs",t),C("gitdir",r),C("ref",i);let a=new J(t);if(i===void 0)throw new Sr("ref");i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`;let o=await ee({fsp:a,dotgit:r}),l=await W.resolve({fs:a,gitdir:o,ref:n||"HEAD"});if(!s&&await W.exists({fs:a,gitdir:o,ref:i}))throw new $i("tag",i);await W.writeRef({fs:a,gitdir:o,ref:i,value:l})}catch(a){throw a.caller="git.tag",a}}async function IA({fs:t,dir:e,gitdir:r=O(e,".git"),cache:i={},filepath:n,oid:s,mode:a,add:o,remove:l,force:c}){try{C("fs",t),C("gitdir",r),C("filepath",n);let u=new J(t),f=await ee({fsp:u,dotgit:r});if(l)return await mt.acquire({fs:u,gitdir:f,cache:i},async function(h){if(!c){let m=await u.lstat(O(e,n));if(m){if(m.isDirectory())throw new $s("directory");return}}h.has({filepath:n})&&h.delete({filepath:n})});let d;if(!s){if(d=await u.lstat(O(e,n)),!d)throw new He(`file at "${n}" on disk and "remove" not set`);if(d.isDirectory())throw new $s("directory")}return await mt.acquire({fs:u,gitdir:f,cache:i},async function(h){if(!o&&!h.has({filepath:n}))throw new He(`file at "${n}" in index and "add" not set`);let m;if(s)m={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:a,uid:0,gid:0,size:0};else{m=d;let g=m.isSymbolicLink()?await u.readlink(O(e,n)):await u.read(O(e,n));s=await Ar({fs:u,gitdir:f,type:"blob",format:"content",object:g})}return h.insert({filepath:n,oid:s,stats:m}),s})}catch(u){throw u.caller="git.updateIndex",u}}function FA(){try{return Md.version}catch(t){throw t.caller="git.version",t}}async function OA({fs:t,dir:e,gitdir:r=O(e,".git"),trees:i,map:n,reduce:s,iterate:a,cache:o={}}){try{C("fs",t),C("gitdir",r),C("trees",i);let l=new J(t),c=await ee({fsp:l,dotgit:r});return await Is({fs:l,cache:o,dir:e,gitdir:c,trees:i,map:n,reduce:s,iterate:a})}catch(l){throw l.caller="git.walk",l}}async function MA({fs:t,dir:e,gitdir:r=O(e,".git"),blob:i}){try{C("fs",t),C("gitdir",r),C("blob",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await Ar({fs:n,gitdir:s,type:"blob",object:i,format:"content"})}catch(n){throw n.caller="git.writeBlob",n}}async function DA({fs:t,dir:e,gitdir:r=O(e,".git"),commit:i}){try{C("fs",t),C("gitdir",r),C("commit",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await SA({fs:n,gitdir:s,commit:i})}catch(n){throw n.caller="git.writeCommit",n}}async function LA({fs:t,dir:e,gitdir:r=O(e,".git"),type:i,object:n,format:s="parsed",oid:a,encoding:o=void 0}){try{let l=new J(t),c=await ee({fsp:l,dotgit:r});if(s==="parsed"){switch(i){case"commit":n=kr.from(n).toObject();break;case"tree":n=Er.from(n).toObject();break;case"blob":n=Buffer.from(n,o);break;case"tag":n=Kr.from(n).toObject();break;default:throw new hr(a||"",i,"blob|commit|tag|tree")}s="content"}return a=await Ar({fs:l,gitdir:c,type:i,object:n,oid:a,format:s}),a}catch(l){throw l.caller="git.writeObject",l}}async function BA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,value:n,force:s=!1,symbolic:a=!1}){try{C("fs",t),C("gitdir",r),C("ref",i),C("value",n);let o=new J(t);if(!nu(i,!0))throw new Ii(i,Hc.clean(i));let l=await ee({fsp:o,dotgit:r});if(!s&&await W.exists({fs:o,gitdir:l,ref:i}))throw new $i("ref",i);a?await W.writeSymbolicRef({fs:o,gitdir:l,ref:i,value:n}):(n=await W.resolve({fs:o,gitdir:l,ref:n}),await W.writeRef({fs:o,gitdir:l,ref:i,value:n}))}catch(o){throw o.caller="git.writeRef",o}}async function R6({fs:t,gitdir:e,tag:r}){let i=Kr.from(r).toObject();return await Ar({fs:t,gitdir:e,type:"tag",object:i,format:"content"})}async function NA({fs:t,dir:e,gitdir:r=O(e,".git"),tag:i}){try{C("fs",t),C("gitdir",r),C("tag",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await R6({fs:n,gitdir:s,tag:i})}catch(n){throw n.caller="git.writeTag",n}}async function HA({fs:t,dir:e,gitdir:r=O(e,".git"),tree:i}){try{C("fs",t),C("gitdir",r),C("tree",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await au({fs:n,gitdir:s,tree:i})}catch(n){throw n.caller="git.writeTree",n}}var $6={Errors:tk,STAGE:Aa,TREE:Zr,WORKDIR:nl,add:ak,abortMerge:ik,addNote:fk,addRemote:hk,annotatedTag:pk,branch:mk,checkout:wv,clone:_k,commit:xk,getConfig:Lk,getConfigAll:Bk,setConfig:xA,currentBranch:Sk,deleteBranch:Ek,deleteRef:kk,deleteRemote:Ak,deleteTag:Tk,expandOid:Ck,expandRef:Pk,fastForward:Ik,fetch:Fk,findMergeBase:Ok,findRoot:Dk,getRemoteInfo:Nk,getRemoteInfo2:Uk,hashBlob:Gk,indexPack:jk,init:qk,isDescendent:Vk,isIgnored:Wk,listBranches:Yk,listFiles:Zk,listNotes:Kk,listRefs:Qk,listRemotes:Jk,listServerRefs:eA,listTags:tA,log:iA,merge:nA,packObjects:aA,pull:oA,push:lA,readBlob:fA,readCommit:_v,readNote:dA,readObject:hA,readTag:pA,readTree:mA,remove:gA,removeNote:vA,renameBranch:wA,resetIndex:bA,updateIndex:IA,resolveRef:_A,status:CA,statusMatrix:RA,tag:$A,version:FA,walk:OA,writeBlob:MA,writeCommit:DA,writeObject:LA,writeRef:BA,writeTag:NA,writeTree:HA,stash:TA};X.Errors=tk;X.STAGE=Aa;X.TREE=Zr;X.WORKDIR=nl;X.abortMerge=ik;X.add=ak;X.addNote=fk;X.addRemote=hk;X.annotatedTag=pk;X.branch=mk;X.checkout=wv;X.clone=_k;X.commit=xk;X.currentBranch=Sk;X.default=$6;X.deleteBranch=Ek;X.deleteRef=kk;X.deleteRemote=Ak;X.deleteTag=Tk;X.expandOid=Ck;X.expandRef=Pk;X.fastForward=Ik;X.fetch=Fk;X.findMergeBase=Ok;X.findRoot=Dk;X.getConfig=Lk;X.getConfigAll=Bk;X.getRemoteInfo=Nk;X.getRemoteInfo2=Uk;X.hashBlob=Gk;X.indexPack=jk;X.init=qk;X.isDescendent=Vk;X.isIgnored=Wk;X.listBranches=Yk;X.listFiles=Zk;X.listNotes=Kk;X.listRefs=Qk;X.listRemotes=Jk;X.listServerRefs=eA;X.listTags=tA;X.log=iA;X.merge=nA;X.packObjects=aA;X.pull=oA;X.push=lA;X.readBlob=fA;X.readCommit=_v;X.readNote=dA;X.readObject=hA;X.readTag=pA;X.readTree=mA;X.remove=gA;X.removeNote=vA;X.renameBranch=wA;X.resetIndex=bA;X.resolveRef=_A;X.setConfig=xA;X.stash=TA;X.status=CA;X.statusMatrix=RA;X.tag=$A;X.updateIndex=IA;X.version=FA;X.walk=OA;X.writeBlob=MA;X.writeCommit=DA;X.writeObject=LA;X.writeRef=BA;X.writeTag=NA;X.writeTree=HA});var QA=I((HZ,KA)=>{"use strict";p();KA.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var eT=I((GZ,JA)=>{p();var Dv={px:{px:1,cm:37.79527559055118,mm:3.7795275590551185,in:96,pt:1.3333333333333333,pc:16},cm:{px:.026458333333333334,cm:1,mm:.1,in:2.54,pt:.035277777777777776,pc:.42333333333333334},mm:{px:.26458333333333334,cm:10,mm:1,in:25.4,pt:.35277777777777775,pc:4.233333333333333},in:{px:.010416666666666666,cm:.39370078740157477,mm:.03937007874015748,in:1,pt:.013888888888888888,pc:.16666666666666666},pt:{px:.75,cm:28.346456692913385,mm:2.834645669291339,in:72,pt:1,pc:12},pc:{px:.0625,cm:2.3622047244094486,mm:.2362204724409449,in:6,pt:.08333333333333333,pc:1},deg:{deg:1,grad:.9,rad:180/Math.PI,turn:360},grad:{deg:1.1111111111111112,grad:1,rad:200/Math.PI,turn:400},rad:{deg:Math.PI/180,grad:Math.PI/200,rad:1,turn:Math.PI*2},turn:{deg:.002777777777777778,grad:.0025,rad:.5/Math.PI,turn:1},s:{s:1,ms:.001},ms:{s:1e3,ms:1},Hz:{Hz:1,kHz:1e3},kHz:{Hz:.001,kHz:1},dpi:{dpi:1,dpcm:.39370078740157477,dppx:.010416666666666666},dpcm:{dpi:2.54,dpcm:1,dppx:.026458333333333334},dppx:{dpi:96,dpcm:37.79527559055118,dppx:1}};JA.exports=function(t,e,r,i){if(!Dv.hasOwnProperty(r))throw new Error("Cannot convert to "+r);if(!Dv[r].hasOwnProperty(e))throw new Error("Cannot convert from "+e+" to "+r);var n=Dv[r][e]*t;return i!==!1?(i=Math.pow(10,parseInt(i)||5),Math.round(n*i)/i):n}});var pT=I(Vn=>{"use strict";p();Object.defineProperty(Vn,"__esModule",{value:!0});Vn.fromRgba=ul;Vn.fromRgb=Lv;Vn.fromHsla=zd;Vn.fromHsl=dT;Vn.fromString=hT;Vn.default=void 0;var tT=nT(QA()),H6=nT(eT());function nT(t){return t&&t.__esModule?t:{default:t}}function U6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rT(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,i=new Array(e);r-1}function W6(t,e,r){var i=t/255,n=e/255,s=r/255,a=Math.max(i,n,s),o=Math.min(i,n,s),l=a-o,c=(a+o)/2;if(l===0)return[0,0,c*100];var u=l/(1-Math.abs(2*c-1)),f=function(){switch(a){case i:return(n-s)/l%6;case n:return(s-i)/l+2;default:return(i-n)/l+4}}();return[f*60,u*100,c*100]}function Y6(t,e,r){var i=t/60,n=e/100,s=r/100,a=(1-Math.abs(2*s-1))*n,o=a*(1-Math.abs(i%2-1)),l=s-a/2,c=function(){return i<1?[a,o,0]:i<2?[o,a,0]:i<3?[0,a,o]:i<4?[0,o,a]:i<5?[o,0,a]:[a,0,o]}(),u=pr(c,3),f=u[0],d=u[1],h=u[2];return[(f+l)*255,(d+l)*255,(h+l)*255]}var X6=function(){function t(e){var r=pr(e,4),i=r[0],n=r[1],s=r[2],a=r[3];U6(this,t),this.values=[Math.max(Math.min(parseInt(i,10),255),0),Math.max(Math.min(parseInt(n,10),255),0),Math.max(Math.min(parseInt(s,10),255),0),a==null?1:Math.max(Math.min(parseFloat(a),255),0)]}return G6(t,[{key:"toRgbString",value:function(){var r=pr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3];return a===1?"rgb(".concat(i,", ").concat(n,", ").concat(s,")"):"rgba(".concat(i,", ").concat(n,", ").concat(s,", ").concat(a,")")}},{key:"toHslString",value:function(){var r=this.toHslaArray(),i=pr(r,4),n=i[0],s=i[1],a=i[2],o=i[3];return o===1?"hsl(".concat(n,", ").concat(s,"%, ").concat(a,"%)"):"hsla(".concat(n,", ").concat(s,"%, ").concat(a,"%, ").concat(o,")")}},{key:"toHexString",value:function(){var r=pr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3];return i=Number(i).toString(16).padStart(2,"0"),n=Number(n).toString(16).padStart(2,"0"),s=Number(s).toString(16).padStart(2,"0"),a=a<1?parseInt(a*255,10).toString(16).padStart(2,"0"):"","#".concat(i).concat(n).concat(s).concat(a)}},{key:"toRgbaArray",value:function(){return this.values}},{key:"toHslaArray",value:function(){var r=pr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3],o=W6(i,n,s),l=pr(o,3),c=l[0],u=l[1],f=l[2];return[c,u,f,a]}}]),t}();function ul(t){var e=pr(t,4),r=e[0],i=e[1],n=e[2],s=e[3];return new X6([r,i,n,s])}function Lv(t){var e=pr(t,3),r=e[0],i=e[1],n=e[2];return ul([r,i,n,1])}function zd(t){var e=pr(t,4),r=e[0],i=e[1],n=e[2],s=e[3],a=Y6(r,i,n),o=pr(a,3),l=o[0],c=o[1],u=o[2];return ul([l,c,u,s])}function dT(t){var e=pr(t,3),r=e[0],i=e[1],n=e[2];return zd([r,i,n,1])}function Z6(t){var e=sT.exec(t)||aT.exec(t),r=pr(e,5),i=r[1],n=r[2],s=r[3],a=r[4];return i=parseInt(i.length<2?i.repeat(2):i,16),n=parseInt(n.length<2?n.repeat(2):n,16),s=parseInt(s.length<2?s.repeat(2):s,16),a=a&&(parseInt(a.length<2?a.repeat(2):a,16)/255).toPrecision(1)||1,ul([i,n,s,a])}function K6(t){var e=oT.exec(t)||cT.exec(t)||lT.exec(t)||uT.exec(t),r=pr(e,5),i=r[1],n=r[2],s=r[3],a=r[4];return i=uu(i,"%")?parseInt(i,10)*255/100:parseInt(i,10),n=uu(n,"%")?parseInt(n,10)*255/100:parseInt(n,10),s=uu(s,"%")>0?parseInt(s,10)*255/100:parseInt(s,10),a=a===void 0?1:parseFloat(a)/(uu(a,"%")?100:1),ul([i,n,s,a])}function Q6(t){var e=fT.exec(t),r=pr(e,6),i=r[1],n=r[2],s=r[3],a=r[4],o=r[5];return n=n||"deg",i=(0,H6.default)(parseFloat(i),n,"deg"),s=parseFloat(s),a=parseFloat(a),o=o===void 0?1:parseFloat(o)/(uu(o,"%")?100:1),zd([i,s,a,o])}function hT(t){return tT.default[t]?Lv(tT.default[t]):sT.test(t)||aT.test(t)?Z6(t):oT.test(t)||cT.test(t)||lT.test(t)||uT.test(t)?K6(t):fT.test(t)?Q6(t):null}var J6={fromString:hT,fromRgb:Lv,fromRgba:ul,fromHsl:dT,fromHsla:zd};Vn.default=J6});var Bv=I((VZ,gT)=>{"use strict";p();var mT=Object.prototype.toString;gT.exports=function(e){var r=mT.call(e),i=r==="[object Arguments]";return i||(i=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&mT.call(e.callee)==="[object Function]"),i}});var kT=I((YZ,ET)=>{"use strict";p();var ST;Object.keys||(fu=Object.prototype.hasOwnProperty,Nv=Object.prototype.toString,vT=Bv(),Hv=Object.prototype.propertyIsEnumerable,wT=!Hv.call({toString:null},"toString"),yT=Hv.call(function(){},"prototype"),du=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Vd=function(t){var e=t.constructor;return e&&e.prototype===t},bT={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},_T=function(){if(typeof window=="undefined")return!1;for(var t in window)try{if(!bT["$"+t]&&fu.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{Vd(window[t])}catch(e){return!0}}catch(e){return!0}return!1}(),xT=function(t){if(typeof window=="undefined"||!_T)return Vd(t);try{return Vd(t)}catch(e){return!1}},ST=function(e){var r=e!==null&&typeof e=="object",i=Nv.call(e)==="[object Function]",n=vT(e),s=r&&Nv.call(e)==="[object String]",a=[];if(!r&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var o=yT&&i;if(s&&e.length>0&&!fu.call(e,0))for(var l=0;l0)for(var c=0;c{"use strict";p();var e5=Array.prototype.slice,t5=Bv(),AT=Object.keys,Wd=AT?function(e){return AT(e)}:kT(),TT=Object.keys;Wd.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(i){return t5(i)?TT(e5.call(i)):TT(i)})}else Object.keys=Wd;return Object.keys||Wd};CT.exports=Wd});var Ns=I((QZ,IT)=>{"use strict";p();var r5=Yd(),i5=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",n5=Object.prototype.toString,s5=Array.prototype.concat,PT=Wf(),a5=function(t){return typeof t=="function"&&n5.call(t)==="[object Function]"},RT=Yf()(),o5=function(t,e,r,i){if(e in t){if(i===!0){if(t[e]===r)return}else if(!a5(i)||!i())return}RT?PT(t,e,r,!0):PT(t,e,r)},$T=function(t,e){var r=arguments.length>2?arguments[2]:{},i=r5(e);i5&&(i=s5.call(i,Object.getOwnPropertySymbols(e)));for(var n=0;n{"use strict";p();var l5=Yd(),OT=vc()(),MT=Bt(),Xd=Ff(),c5=MT("Array.prototype.push"),FT=MT("Object.prototype.propertyIsEnumerable"),u5=OT?Xd.getOwnPropertySymbols:null;DT.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var i=Xd(e);if(arguments.length===1)return i;for(var n=1;n{"use strict";p();var Gv=Uv(),f5=function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},i=0;i{"use strict";p();var h5=Ns(),p5=jv();BT.exports=function(){var e=p5();return h5(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e}});var jT=I((aK,GT)=>{"use strict";p();var m5=Ns(),g5=fa(),v5=Uv(),HT=jv(),w5=NT(),y5=g5.apply(HT()),UT=function(e,r){return y5(Object,arguments)};m5(UT,{getPolyfill:HT,implementation:v5,shim:w5});GT.exports=UT});var qv=I((lK,VT)=>{"use strict";p();var qT=tn(),zT=fa(),b5=zT(qT("String.prototype.indexOf"));VT.exports=function(e,r){var i=qT(e,!!r);return typeof i=="function"&&b5(e,".prototype.")>-1?zT(i):i}});var YT=I((uK,WT)=>{"use strict";p();var pu=function(){return typeof function(){}.name=="string"},hu=Object.getOwnPropertyDescriptor;if(hu)try{hu([],"length")}catch(t){hu=null}pu.functionsHaveConfigurableNames=function(){if(!pu()||!hu)return!1;var e=hu(function(){},"name");return!!e&&!!e.configurable};var _5=Function.prototype.bind;pu.boundFunctionsHaveNames=function(){return pu()&&typeof _5=="function"&&function(){}.bind().name!==""};WT.exports=pu});var KT=I((dK,ZT)=>{"use strict";p();var XT=Wf(),x5=Yf()(),S5=YT().functionsHaveConfigurableNames(),E5=_r();ZT.exports=function(e,r){if(typeof e!="function")throw new E5("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||S5)&&(x5?XT(e,"name",r,!0,!0):XT(e,"name",r)),e}});var zv=I((pK,QT)=>{"use strict";p();var k5=KT(),A5=_r(),T5=Object;QT.exports=k5(function(){if(this==null||this!==T5(this))throw new A5("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0)});var Vv=I((gK,JT)=>{"use strict";p();var C5=zv(),P5=Ns().supportsDescriptors,R5=Object.getOwnPropertyDescriptor;JT.exports=function(){if(P5&&/a/mig.flags==="gim"){var e=R5(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var r="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(i,"sticky",{get:function(){r+="y"}}),e.get.call(i),r==="dy")return e.get}}return C5}});var rC=I((wK,tC)=>{"use strict";p();var $5=Ns().supportsDescriptors,I5=Vv(),F5=ys(),O5=Object.defineProperty,M5=Um(),eC=Uf(),D5=/a/;tC.exports=function(){if(!$5||!eC)throw new M5("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=I5(),r=eC(D5),i=F5(r,"flags");return(!i||i.get!==e)&&O5(r,"flags",{configurable:!0,enumerable:!1,get:e}),e}});var aC=I((bK,sC)=>{"use strict";p();var L5=Ns(),B5=fa(),N5=zv(),iC=Vv(),H5=rC(),nC=B5(iC());L5(nC,{getPolyfill:iC,implementation:N5,shim:H5});sC.exports=nC});var Yv=I((xK,lC)=>{"use strict";p();var U5=bs()(),G5=Bt(),Wv=G5("Object.prototype.toString"),Zd=function(e){return U5&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Wv(e)==="[object Arguments]"},oC=function(e){return Zd(e)?!0:e!==null&&typeof e=="object"&&"length"in e&&typeof e.length=="number"&&e.length>=0&&Wv(e)!=="[object Array]"&&"callee"in e&&Wv(e.callee)==="[object Function]"},j5=function(){return Zd(arguments)}();Zd.isLegacyArguments=oC;lC.exports=j5?Zd:oC});var cC=I(()=>{p()});var yu=I((TK,PC)=>{p();var nw=typeof Map=="function"&&Map.prototype,Xv=Object.getOwnPropertyDescriptor&&nw?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Qd=nw&&Xv&&typeof Xv.get=="function"?Xv.get:null,uC=nw&&Map.prototype.forEach,sw=typeof Set=="function"&&Set.prototype,Zv=Object.getOwnPropertyDescriptor&&sw?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Jd=sw&&Zv&&typeof Zv.get=="function"?Zv.get:null,fC=sw&&Set.prototype.forEach,q5=typeof WeakMap=="function"&&WeakMap.prototype,gu=q5?WeakMap.prototype.has:null,z5=typeof WeakSet=="function"&&WeakSet.prototype,vu=z5?WeakSet.prototype.has:null,V5=typeof WeakRef=="function"&&WeakRef.prototype,dC=V5?WeakRef.prototype.deref:null,W5=Boolean.prototype.valueOf,Y5=Object.prototype.toString,X5=Function.prototype.toString,Z5=String.prototype.match,aw=String.prototype.slice,Hs=String.prototype.replace,K5=String.prototype.toUpperCase,hC=String.prototype.toLowerCase,xC=RegExp.prototype.test,pC=Array.prototype.concat,fn=Array.prototype.join,Q5=Array.prototype.slice,mC=Math.floor,Jv=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Kv=Object.getOwnPropertySymbols,ew=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,fl=typeof Symbol=="function"&&typeof Symbol.iterator=="object",wu=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===fl||!0)?Symbol.toStringTag:null,SC=Object.prototype.propertyIsEnumerable,gC=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function vC(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||xC.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var i=t<0?-mC(-t):mC(t);if(i!==t){var n=String(i),s=aw.call(e,n.length+1);return Hs.call(n,r,"$&_")+"."+Hs.call(Hs.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Hs.call(e,r,"$&_")}var tw=cC(),wC=tw.custom,yC=AC(wC)?wC:null,EC={__proto__:null,double:'"',single:"'"},J5={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};PC.exports=function t(e,r,i,n){var s=r||{};if(Wn(s,"quoteStyle")&&!Wn(EC,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Wn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Wn(s,"customInspect")?s.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Wn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Wn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=s.numericSeparator;if(typeof e=="undefined")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return CC(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return o?vC(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return o?vC(e,c):c}var u=typeof s.depth=="undefined"?5:s.depth;if(typeof i=="undefined"&&(i=0),i>=u&&u>0&&typeof e=="object")return rw(e)?"[Array]":"[Object]";var f=v4(s,i);if(typeof n=="undefined")n=[];else if(TC(n,e)>=0)return"[Circular]";function d(B,N,ce){if(N&&(n=Q5.call(n),n.push(N)),ce){var Pe={depth:s.depth};return Wn(s,"quoteStyle")&&(Pe.quoteStyle=s.quoteStyle),t(B,Pe,i+1,n)}return t(B,s,i+1,n)}if(typeof e=="function"&&!bC(e)){var h=l4(e),m=Kd(e,d);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(m.length>0?" { "+fn.call(m,", ")+" }":"")}if(AC(e)){var g=fl?Hs.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):ew.call(e);return typeof e=="object"&&!fl?mu(g):g}if(p4(e)){for(var v="<"+hC.call(String(e.nodeName)),w=e.attributes||[],b=0;b",v}if(rw(e)){if(e.length===0)return"[]";var k=Kd(e,d);return f&&!g4(k)?"["+iw(k,f)+"]":"[ "+fn.call(k,", ")+" ]"}if(r4(e)){var x=Kd(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!SC.call(e,"cause")?"{ ["+String(e)+"] "+fn.call(pC.call("[cause]: "+d(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+fn.call(x,", ")+" }"}if(typeof e=="object"&&a){if(yC&&typeof e[yC]=="function"&&tw)return tw(e,{depth:u-i});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(c4(e)){var E=[];return uC&&uC.call(e,function(B,N){E.push(d(N,e,!0)+" => "+d(B,e))}),_C("Map",Qd.call(e),E,f)}if(d4(e)){var A=[];return fC&&fC.call(e,function(B){A.push(d(B,e))}),_C("Set",Jd.call(e),A,f)}if(u4(e))return Qv("WeakMap");if(h4(e))return Qv("WeakSet");if(f4(e))return Qv("WeakRef");if(n4(e))return mu(d(Number(e)));if(a4(e))return mu(d(Jv.call(e)));if(s4(e))return mu(W5.call(e));if(i4(e))return mu(d(String(e)));if(typeof window!="undefined"&&e===window)return"{ [object Window] }";if(typeof globalThis!="undefined"&&e===globalThis||typeof global!="undefined"&&e===global)return"{ [object globalThis] }";if(!t4(e)&&!bC(e)){var y=Kd(e,d),S=gC?gC(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",T=!S&&wu&&Object(e)===e&&wu in e?aw.call(Us(e),8,-1):_?"Object":"",P=S||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",D=P+(T||_?"["+fn.call(pC.call([],T||[],_||[]),": ")+"] ":"");return y.length===0?D+"{}":f?D+"{"+iw(y,f)+"}":D+"{ "+fn.call(y,", ")+" }"}return String(e)};function kC(t,e,r){var i=r.quoteStyle||e,n=EC[i];return n+t+n}function e4(t){return Hs.call(String(t),/"/g,""")}function Ca(t){return!wu||!(typeof t=="object"&&(wu in t||typeof t[wu]!="undefined"))}function rw(t){return Us(t)==="[object Array]"&&Ca(t)}function t4(t){return Us(t)==="[object Date]"&&Ca(t)}function bC(t){return Us(t)==="[object RegExp]"&&Ca(t)}function r4(t){return Us(t)==="[object Error]"&&Ca(t)}function i4(t){return Us(t)==="[object String]"&&Ca(t)}function n4(t){return Us(t)==="[object Number]"&&Ca(t)}function s4(t){return Us(t)==="[object Boolean]"&&Ca(t)}function AC(t){if(fl)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!ew)return!1;try{return ew.call(t),!0}catch(e){}return!1}function a4(t){if(!t||typeof t!="object"||!Jv)return!1;try{return Jv.call(t),!0}catch(e){}return!1}var o4=Object.prototype.hasOwnProperty||function(t){return t in this};function Wn(t,e){return o4.call(t,e)}function Us(t){return Y5.call(t)}function l4(t){if(t.name)return t.name;var e=Z5.call(X5.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function TC(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return CC(aw.call(t,0,e.maxStringLength),e)+i}var n=J5[e.quoteStyle||"single"];n.lastIndex=0;var s=Hs.call(Hs.call(t,n,"\\$1"),/[\x00-\x1f]/g,m4);return kC(s,"single",e)}function m4(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+K5.call(e.toString(16))}function mu(t){return"Object("+t+")"}function Qv(t){return t+" { ? }"}function _C(t,e,r,i){var n=i?iw(r,i):fn.call(r,", ");return t+" ("+e+") {"+n+"}"}function g4(t){for(var e=0;e=0)return!1;return!0}function v4(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=fn.call(Array(t.indent+1)," ");else return null;return{base:r,prev:fn.call(Array(e+1),r)}}function iw(t,e){if(t.length===0)return"";var r=` +`+e.prev+e.base;return r+fn.call(t,","+r)+` +`+e.prev}function Kd(t,e){var r=rw(t),i=[];if(r){i.length=t.length;for(var n=0;n{"use strict";p();var w4=yu(),y4=_r(),eh=function(t,e,r){for(var i=t,n;(n=i.next)!=null;i=n)if(n.key===e)return i.next=n.next,r||(n.next=t.next,t.next=n),n},b4=function(t,e){if(t){var r=eh(t,e);return r&&r.value}},_4=function(t,e,r){var i=eh(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}},x4=function(t,e){return t?!!eh(t,e):!1},S4=function(t,e){if(t)return eh(t,e,!0)};RC.exports=function(){var e,r={assert:function(i){if(!r.has(i))throw new y4("Side channel does not contain "+w4(i))},delete:function(i){var n=e&&e.next,s=S4(e,i);return s&&n&&n===s&&(e=void 0),!!s},get:function(i){return b4(e,i)},has:function(i){return x4(e,i)},set:function(i,n){e||(e={next:void 0}),_4(e,i,n)}};return r}});var ow=I(($K,FC)=>{"use strict";p();var E4=tn(),bu=Bt(),k4=yu(),A4=_r(),IC=E4("%Map%",!0),T4=bu("Map.prototype.get",!0),C4=bu("Map.prototype.set",!0),P4=bu("Map.prototype.has",!0),R4=bu("Map.prototype.delete",!0),$4=bu("Map.prototype.size",!0);FC.exports=!!IC&&function(){var e,r={assert:function(i){if(!r.has(i))throw new A4("Side channel does not contain "+k4(i))},delete:function(i){if(e){var n=R4(e,i);return $4(e)===0&&(e=void 0),n}return!1},get:function(i){if(e)return T4(e,i)},has:function(i){return e?P4(e,i):!1},set:function(i,n){e||(e=new IC),C4(e,i,n)}};return r}});var MC=I((FK,OC)=>{"use strict";p();var I4=tn(),rh=Bt(),F4=yu(),th=ow(),O4=_r(),dl=I4("%WeakMap%",!0),M4=rh("WeakMap.prototype.get",!0),D4=rh("WeakMap.prototype.set",!0),L4=rh("WeakMap.prototype.has",!0),B4=rh("WeakMap.prototype.delete",!0);OC.exports=dl?function(){var e,r,i={assert:function(n){if(!i.has(n))throw new O4("Side channel does not contain "+F4(n))},delete:function(n){if(dl&&n&&(typeof n=="object"||typeof n=="function")){if(e)return B4(e,n)}else if(th&&r)return r.delete(n);return!1},get:function(n){return dl&&n&&(typeof n=="object"||typeof n=="function")&&e?M4(e,n):r&&r.get(n)},has:function(n){return dl&&n&&(typeof n=="object"||typeof n=="function")&&e?L4(e,n):!!r&&r.has(n)},set:function(n,s){dl&&n&&(typeof n=="object"||typeof n=="function")?(e||(e=new dl),D4(e,n,s)):th&&(r||(r=th()),r.set(n,s))}};return i}:th});var lw=I((MK,DC)=>{"use strict";p();var N4=_r(),H4=yu(),U4=$C(),G4=ow(),j4=MC(),q4=j4||G4||U4;DC.exports=function(){var e,r={assert:function(i){if(!r.has(i))throw new N4("Side channel does not contain "+H4(i))},delete:function(i){return!!e&&e.delete(i)},get:function(i){return e&&e.get(i)},has:function(i){return!!e&&e.has(i)},set:function(i,n){e||(e=q4()),e.set(i,n)}};return r}});var BC=I((LK,LC)=>{"use strict";p();var z4=Gf(),_u=lw()(),Yn=_r(),cw={assert:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Yn("`O` is not an object");if(typeof e!="string")throw new Yn("`slot` must be a string");if(_u.assert(t),!cw.has(t,e))throw new Yn("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Yn("`O` is not an object");if(typeof e!="string")throw new Yn("`slot` must be a string");var r=_u.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Yn("`O` is not an object");if(typeof e!="string")throw new Yn("`slot` must be a string");var r=_u.get(t);return!!r&&z4(r,"$"+e)},set:function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new Yn("`O` is not an object");if(typeof e!="string")throw new Yn("`slot` must be a string");var i=_u.get(t);i||(i={},_u.set(t,i)),i["$"+e]=r}};Object.freeze&&Object.freeze(cw);LC.exports=cw});var UC=I((NK,HC)=>{"use strict";p();var xu=BC(),V4=Of(),NC=typeof StopIteration=="object"?StopIteration:null;HC.exports=function(e){if(!NC)throw new V4("this environment lacks StopIteration");xu.set(e,"[[Done]]",!1);var r={next:function(){var n=xu.get(this,"[[Iterator]]"),s=!!xu.get(n,"[[Done]]");try{return{done:s,value:s?void 0:n.next()}}catch(a){if(xu.set(n,"[[Done]]",!0),a!==NC)throw a;return{done:!0,value:void 0}}}};return xu.set(r,"[[Iterator]]",e),r}});var uw=I((UK,jC)=>{"use strict";p();var GC=Bt(),W4=GC("String.prototype.valueOf"),Y4=function(e){try{return W4(e),!0}catch(r){return!1}},X4=GC("Object.prototype.toString"),Z4="[object String]",K4=bs()();jC.exports=function(e){return typeof e=="string"?!0:!e||typeof e!="object"?!1:K4?Y4(e):X4(e)===Z4}});var dw=I((jK,VC)=>{"use strict";p();var fw=typeof Map=="function"&&Map.prototype?Map:null,Q4=typeof Set=="function"&&Set.prototype?Set:null,ih;fw||(ih=function(e){return!1});var zC=fw?Map.prototype.has:null,qC=Q4?Set.prototype.has:null;!ih&&!zC&&(ih=function(e){return!1});VC.exports=ih||function(e){if(!e||typeof e!="object")return!1;try{if(zC.call(e),qC)try{qC.call(e)}catch(r){return!0}return e instanceof fw}catch(r){}return!1}});var pw=I((zK,XC)=>{"use strict";p();var J4=typeof Map=="function"&&Map.prototype?Map:null,hw=typeof Set=="function"&&Set.prototype?Set:null,nh;hw||(nh=function(e){return!1});var WC=J4?Map.prototype.has:null,YC=hw?Set.prototype.has:null;!nh&&!YC&&(nh=function(e){return!1});XC.exports=nh||function(e){if(!e||typeof e!="object")return!1;try{if(YC.call(e),WC)try{WC.call(e)}catch(r){return!0}return e instanceof hw}catch(r){}return!1}});var o2=I((WK,oh)=>{"use strict";p();var ZC=Yv(),KC=UC();Lf()()||vc()()?(sh=Symbol.iterator,oh.exports=function(e){if(e!=null&&typeof e[sh]!="undefined")return e[sh]();if(ZC(e))return Array.prototype[sh].call(e)}):(QC=If(),JC=uw(),mw=tn(),e2=mw("%Map%",!0),t2=mw("%Set%",!0),vi=qv(),gw=vi("Array.prototype.push"),vw=vi("String.prototype.charCodeAt"),r2=vi("String.prototype.slice"),i2=function(e,r){var i=e.length;if(r+1>=i)return r+1;var n=vw(e,r);if(n<55296||n>56319)return r+1;var s=vw(e,r+1);return s<56320||s>57343?r+1:r+2},ah=function(e){var r=0;return{next:function(){var n=r>=e.length,s;return n||(s=e[r],r+=1),{done:n,value:s}}}},ww=function(e,r){if(QC(e)||ZC(e))return ah(e);if(JC(e)){var i=0;return{next:function(){var s=i2(e,i),a=r2(e,i,s);return i=s,{done:s>e.length,value:a}}}}if(r&&typeof e["_es6-shim iterator_"]!="undefined")return e["_es6-shim iterator_"]()},!e2&&!t2?oh.exports=function(e){if(e!=null)return ww(e,!0)}:(n2=dw(),s2=pw(),yw=vi("Map.prototype.forEach",!0),bw=vi("Set.prototype.forEach",!0),(typeof process=="undefined"||!process.versions||!process.versions.node)&&(_w=vi("Map.prototype.iterator",!0),xw=vi("Set.prototype.iterator",!0)),Sw=vi("Map.prototype.@@iterator",!0)||vi("Map.prototype._es6-shim iterator_",!0),Ew=vi("Set.prototype.@@iterator",!0)||vi("Set.prototype._es6-shim iterator_",!0),a2=function(e){if(n2(e)){if(_w)return KC(_w(e));if(Sw)return Sw(e);if(yw){var r=[];return yw(e,function(n,s){gw(r,[s,n])}),ah(r)}}if(s2(e)){if(xw)return KC(xw(e));if(Ew)return Ew(e);if(bw){var i=[];return bw(e,function(n){gw(i,n)}),ah(i)}}},oh.exports=function(e){return a2(e)||ww(e)}));var sh,QC,JC,mw,e2,t2,vi,gw,vw,r2,i2,ah,ww,n2,s2,yw,bw,_w,xw,Sw,Ew,a2});var kw=I((XK,c2)=>{"use strict";p();var l2=function(t){return t!==t};c2.exports=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||l2(e)&&l2(r))}});var Aw=I((KK,u2)=>{"use strict";p();var eU=kw();u2.exports=function(){return typeof Object.is=="function"?Object.is:eU}});var d2=I((JK,f2)=>{"use strict";p();var tU=Aw(),rU=Ns();f2.exports=function(){var e=tU();return rU(Object,{is:e},{is:function(){return Object.is!==e}}),e}});var g2=I((tQ,m2)=>{"use strict";p();var iU=Ns(),nU=fa(),sU=kw(),h2=Aw(),aU=d2(),p2=nU(h2(),Object);iU(p2,{getPolyfill:h2,implementation:sU,shim:aU});m2.exports=p2});var Cw=I((iQ,b2)=>{"use strict";p();var oU=fa(),y2=Bt(),lU=tn(),Tw=lU("%ArrayBuffer%",!0),lh=y2("ArrayBuffer.prototype.byteLength",!0),cU=y2("Object.prototype.toString"),v2=!!Tw&&!lh&&new Tw(0).slice,w2=!!v2&&oU(v2);b2.exports=lh||w2?function(e){if(!e||typeof e!="object")return!1;try{return lh?lh(e):w2(e,0),!0}catch(r){return!1}}:Tw?function(e){return cU(e)==="[object ArrayBuffer]"}:function(e){return!1}});var S2=I((sQ,x2)=>{"use strict";p();var _2=Bt(),uU=_2("Date.prototype.getDay"),fU=function(e){try{return uU(e),!0}catch(r){return!1}},dU=_2("Object.prototype.toString"),hU="[object Date]",pU=bs()();x2.exports=function(e){return typeof e!="object"||e===null?!1:pU?fU(e):dU(e)===hU}});var Iw=I((oQ,C2)=>{"use strict";p();var E2=Bt(),mU=bs()(),gU=Gf(),vU=ys(),$w;mU?(k2=E2("RegExp.prototype.exec"),Pw={},ch=function(){throw Pw},Rw={toString:ch,valueOf:ch},typeof Symbol.toPrimitive=="symbol"&&(Rw[Symbol.toPrimitive]=ch),$w=function(e){if(!e||typeof e!="object")return!1;var r=vU(e,"lastIndex"),i=r&&gU(r,"value");if(!i)return!1;try{k2(e,Rw)}catch(n){return n===Pw}}):(A2=E2("Object.prototype.toString"),T2="[object RegExp]",$w=function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:A2(e)===T2});var k2,Pw,ch,Rw,A2,T2;C2.exports=$w});var $2=I((cQ,R2)=>{"use strict";p();var wU=Bt(),P2=wU("SharedArrayBuffer.prototype.byteLength",!0);R2.exports=P2?function(e){if(!e||typeof e!="object")return!1;try{return P2(e),!0}catch(r){return!1}}:function(e){return!1}});var O2=I((fQ,F2)=>{"use strict";p();var I2=Bt(),yU=I2("Number.prototype.toString"),bU=function(e){try{return yU(e),!0}catch(r){return!1}},_U=I2("Object.prototype.toString"),xU="[object Number]",SU=bs()();F2.exports=function(e){return typeof e=="number"?!0:!e||typeof e!="object"?!1:SU?bU(e):_U(e)===xU}});var L2=I((hQ,D2)=>{"use strict";p();var M2=Bt(),EU=M2("Boolean.prototype.toString"),kU=M2("Object.prototype.toString"),AU=function(e){try{return EU(e),!0}catch(r){return!1}},TU="[object Boolean]",CU=bs()();D2.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:CU?AU(e):kU(e)===TU}});var N2=I((mQ,B2)=>{"use strict";p();var PU=Bt(),RU=Iw(),$U=PU("RegExp.prototype.exec"),IU=_r();B2.exports=function(e){if(!RU(e))throw new IU("`regex` must be a RegExp");return function(i){return $U(e,i)!==null}}});var q2=I((vQ,Fw)=>{"use strict";p();var j2=Bt(),FU=j2("Object.prototype.toString"),OU=Lf()(),MU=N2();OU?(H2=j2("Symbol.prototype.toString"),U2=MU(/^Symbol\(.*\)$/),G2=function(e){return typeof e.valueOf()!="symbol"?!1:U2(H2(e))},Fw.exports=function(e){if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||FU(e)!=="[object Symbol]")return!1;try{return G2(e)}catch(r){return!1}}):Fw.exports=function(e){return!1};var H2,U2,G2});var W2=I((yQ,V2)=>{"use strict";p();var z2=typeof BigInt!="undefined"&&BigInt;V2.exports=function(){return typeof z2=="function"&&typeof BigInt=="function"&&typeof z2(42)=="bigint"&&typeof BigInt(42)=="bigint"}});var Z2=I((_Q,Ow)=>{"use strict";p();var DU=W2()();DU?(Y2=BigInt.prototype.valueOf,X2=function(e){try{return Y2.call(e),!0}catch(r){}return!1},Ow.exports=function(e){return e===null||typeof e=="undefined"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:X2(e)}):Ow.exports=function(e){return!1};var Y2,X2});var Q2=I((SQ,K2)=>{"use strict";p();var LU=uw(),BU=O2(),NU=L2(),HU=q2(),UU=Z2();K2.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(LU(e))return"String";if(BU(e))return"Number";if(NU(e))return"Boolean";if(HU(e))return"Symbol";if(UU(e))return"BigInt"}});var tP=I((kQ,eP)=>{"use strict";p();var uh=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,J2=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,fh;uh||(fh=function(e){return!1});var Dw=uh?uh.prototype.has:null,Mw=J2?J2.prototype.has:null;!fh&&!Dw&&(fh=function(e){return!1});eP.exports=fh||function(e){if(!e||typeof e!="object")return!1;try{if(Dw.call(e,Dw),Mw)try{Mw.call(e,Mw)}catch(r){return!0}return e instanceof uh}catch(r){}return!1}});var iP=I((TQ,Bw)=>{"use strict";p();var GU=tn(),rP=Bt(),jU=GU("%WeakSet%",!0),Lw=rP("WeakSet.prototype.has",!0);Lw?(dh=rP("WeakMap.prototype.has",!0),Bw.exports=function(e){if(!e||typeof e!="object")return!1;try{if(Lw(e,Lw),dh)try{dh(e,dh)}catch(r){return!0}return e instanceof jU}catch(r){}return!1}):Bw.exports=function(e){return!1};var dh});var sP=I((PQ,nP)=>{"use strict";p();var qU=dw(),zU=pw(),VU=tP(),WU=iP();nP.exports=function(e){if(e&&typeof e=="object"){if(qU(e))return"Map";if(zU(e))return"Set";if(VU(e))return"WeakMap";if(WU(e))return"WeakSet"}return!1}});var lP=I(($Q,oP)=>{"use strict";p();var YU=Bt(),aP=YU("ArrayBuffer.prototype.byteLength",!0),XU=Cw();oP.exports=function(e){return XU(e)?aP?aP(e):e.byteLength:NaN}});var FP=I((FQ,IP)=>{"use strict";p();var PP=jT(),dn=qv(),cP=aC(),ZU=tn(),hl=o2(),KU=lw(),uP=g2(),fP=Yv(),dP=If(),hP=Cw(),pP=S2(),mP=Iw(),gP=$2(),vP=Yd(),wP=Q2(),yP=sP(),bP=ig(),_P=lP(),xP=dn("SharedArrayBuffer.prototype.byteLength",!0),SP=dn("Date.prototype.getTime"),Nw=Object.getPrototypeOf,EP=dn("Object.prototype.toString"),ph=ZU("%Set%",!0),Hw=dn("Map.prototype.has",!0),mh=dn("Map.prototype.get",!0),kP=dn("Map.prototype.size",!0),gh=dn("Set.prototype.add",!0),RP=dn("Set.prototype.delete",!0),vh=dn("Set.prototype.has",!0),hh=dn("Set.prototype.size",!0);function AP(t,e,r,i){for(var n=hl(t),s;(s=n.next())&&!s.done;)if(Oi(e,s.value,r,i))return RP(t,s.value),!0;return!1}function $P(t){if(typeof t=="undefined")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function QU(t,e,r,i,n,s){var a=$P(r);if(a!=null)return a;var o=mh(e,a),l=PP({},n,{strict:!1});return typeof o=="undefined"&&!Hw(e,a)||!Oi(i,o,l,s)?!1:!Hw(t,a)&&Oi(i,o,l,s)}function JU(t,e,r){var i=$P(r);return i!=null?i:vh(e,i)&&!vh(t,i)}function TP(t,e,r,i,n,s){for(var a=hl(t),o,l;(o=a.next())&&!o.done;)if(l=o.value,Oi(r,l,n,s)&&Oi(i,mh(e,l),n,s))return RP(t,l),!0;return!1}function Oi(t,e,r,i){var n=r||{};if(n.strict?uP(t,e):t===e)return!0;var s=wP(t),a=wP(e);if(s!==a)return!1;if(!t||!e||typeof t!="object"&&typeof e!="object")return n.strict?uP(t,e):t==e;var o=i.has(t),l=i.has(e),c;if(o&&l){if(i.get(t)===i.get(e))return!0}else c={};return o||i.set(t,c),l||i.set(e,c),rG(t,e,n,i)}function CP(t){return!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function eG(t,e,r,i){if(hh(t)!==hh(e))return!1;for(var n=hl(t),s=hl(e),a,o,l;(a=n.next())&&!a.done;)if(a.value&&typeof a.value=="object")l||(l=new ph),gh(l,a.value);else if(!vh(e,a.value)){if(r.strict||!JU(t,e,a.value))return!1;l||(l=new ph),gh(l,a.value)}if(l){for(;(o=s.next())&&!o.done;)if(o.value&&typeof o.value=="object"){if(!AP(l,o.value,r.strict,i))return!1}else if(!r.strict&&!vh(t,o.value)&&!AP(l,o.value,r.strict,i))return!1;return hh(l)===0}return!0}function tG(t,e,r,i){if(kP(t)!==kP(e))return!1;for(var n=hl(t),s=hl(e),a,o,l,c,u,f;(a=n.next())&&!a.done;)if(c=a.value[0],u=a.value[1],c&&typeof c=="object")l||(l=new ph),gh(l,c);else if(f=mh(e,c),typeof f=="undefined"&&!Hw(e,c)||!Oi(u,f,r,i)){if(r.strict||!QU(t,e,c,u,r,i))return!1;l||(l=new ph),gh(l,c)}if(l){for(;(o=s.next())&&!o.done;)if(c=o.value[0],f=o.value[1],c&&typeof c=="object"){if(!TP(l,t,c,f,r,i))return!1}else if(!r.strict&&(!t.has(c)||!Oi(mh(t,c),f,r,i))&&!TP(l,t,c,f,PP({},r,{strict:!1}),i))return!1;return hh(l)===0}return!0}function rG(t,e,r,i){var n,s;if(typeof t!=typeof e||t==null||e==null||EP(t)!==EP(e)||fP(t)!==fP(e))return!1;var a=dP(t),o=dP(e);if(a!==o)return!1;var l=t instanceof Error,c=e instanceof Error;if(l!==c||(l||c)&&(t.name!==e.name||t.message!==e.message))return!1;var u=mP(t),f=mP(e);if(u!==f||(u||f)&&(t.source!==e.source||cP(t)!==cP(e)))return!1;var d=pP(t),h=pP(e);if(d!==h||(d||h)&&SP(t)!==SP(e)||r.strict&&Nw&&Nw(t)!==Nw(e))return!1;var m=bP(t),g=bP(e);if(m!==g)return!1;if(m||g){if(t.length!==e.length)return!1;for(n=0;n=0;n--)if(A[n]!=y[n])return!1;for(n=A.length-1;n>=0;n--)if(s=A[n],!Oi(t[s],e[s],r,i))return!1;var S=yP(t),_=yP(e);return S!==_?!1:S==="Set"||_==="Set"?eG(t,e,r,i):S==="Map"?tG(t,e,r,i):!0}IP.exports=function(e,r,i){return Oi(e,r,i,KU())}});var WP=I((GQ,VP)=>{p();VP.exports=function(t,e){var r=t,i=e,n=r.length,s=i.length,a=!1,o=n+1,l=[],c=[],u,f,d=function(){n>=s&&(u=r,f=n,r=i,i=u,n=s,s=f,a=!0,o=n+1)},h=function(g,v,w,b,k){return{startX:g,startY:v,endX:w,endY:b,r:k}},m=function(g,v,w){var b,k,x,E,A;for(v>w?b=l[g-1+o]:b=l[g+1+o],A=x=Math.max(v,w),E=k=x-g;k=g+1;--E)w[E+o]=m(E,w[E-1+o]+1,w[E+1+o]);w[g+o]=m(g,w[g-1+o]+1,w[g+1+o])}while(w[g+o]!==s);for(ed=g+2*b,k=l[g+o],A=n,y=s,S=[];k!==-1;){let _=c[k];(n!=_.endX||s!=_.endY)&&S.push({file1:[a?_.endY:_.endX,a?y-_.endY:A-_.endX],file2:[a?_.endX:_.endY,a?A-_.endX:y-_.endY]}),A=_.startX,y=_.startY,k=c[k].r}return(A!=0||y!=0)&&S.push({file1:[0,a?y:A],file2:[0,a?A:y]}),S.reverse(),S}}}});var ZP=I((qQ,XP)=>{p();var YP=WP();function nG(t,e,r){var i,n=new YP(e,t).compose(),s=new YP(e,r).compose(),a=[];function o(B,N){a.push([B.file1[0],N,B.file1[1],B.file2[0],B.file2[1]])}for(i=0;ic&&(l.push([1,c,B-c]),c=B)}for(var f=0;fg)break;g=Math.max(g,w+v[2]),f++}if(u(m),d==f)h[4]>0&&l.push([h[1],h[3],h[4]]);else{var b={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=d;i<=f;i++){h=a[i];var k=h[1],x=b[k],E=h[0],A=E+h[2],y=h[3],S=y+h[4];x[0]=Math.min(y,x[0]),x[1]=Math.max(S,x[1]),x[2]=Math.min(E,x[2]),x[3]=Math.max(A,x[3])}var _=b[0][0]+(m-b[0][2]),T=b[0][1]+(g-b[0][3]),P=b[2][0]+(m-b[2][2]),D=b[2][1]+(g-b[2][3]);l.push([-1,_,T-_,m,g-m,P,D-P])}c=g}return u(e.length),l}function sG(t,e,r){var i=[],n=[t,e,r],s=nG(t,e,r),a=[];function o(){a.length&&i.push({ok:a}),a=[]}function l(h){for(var m=0;m{p();var wl=1e3,yl=wl*60,bl=yl*60,Ra=bl*24,lG=Ra*7,cG=Ra*365.25;QP.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return uG(t);if(r==="number"&&isFinite(t))return e.long?dG(t):fG(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function uG(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*cG;case"weeks":case"week":case"w":return r*lG;case"days":case"day":case"d":return r*Ra;case"hours":case"hour":case"hrs":case"hr":case"h":return r*bl;case"minutes":case"minute":case"mins":case"min":case"m":return r*yl;case"seconds":case"second":case"secs":case"sec":case"s":return r*wl;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function fG(t){var e=Math.abs(t);return e>=Ra?Math.round(t/Ra)+"d":e>=bl?Math.round(t/bl)+"h":e>=yl?Math.round(t/yl)+"m":e>=wl?Math.round(t/wl)+"s":t+"ms"}function dG(t){var e=Math.abs(t);return e>=Ra?bh(t,e,Ra,"day"):e>=bl?bh(t,e,bl,"hour"):e>=yl?bh(t,e,yl,"minute"):e>=wl?bh(t,e,wl,"second"):t+" ms"}function bh(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var tR=I((rJ,eR)=>{p();function hG(t){r.debug=r,r.default=r,r.coerce=l,r.disable=a,r.enable=n,r.enabled=o,r.humanize=JP(),r.destroy=c,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let f=0;for(let d=0;d{if(A==="%%")return"%";x++;let S=r.formatters[y];if(typeof S=="function"){let _=v[x];A=S.call(w,_),v.splice(x,1),x--}return A}),r.formatArgs.call(w,v),(w.log||r.log).apply(w,v)}return g.namespace=u,g.useColors=r.useColors(),g.color=r.selectColor(u),g.extend=i,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(h!==r.namespaces&&(h=r.namespaces,m=r.enabled(u)),m),set:v=>{d=v}}),typeof r.init=="function"&&r.init(g),g}function i(u,f){let d=r(this.namespace+(typeof f=="undefined"?":":f)+u);return d.log=this.log,d}function n(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of f)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function s(u,f){let d=0,h=0,m=-1,g=0;for(;d"-"+f)].join(",");return r.enable(""),u}function o(u){for(let f of r.skips)if(s(u,f))return!1;for(let f of r.names)if(s(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}eR.exports=hG});var xh=I((Tr,_h)=>{p();Tr.formatArgs=mG;Tr.save=gG;Tr.load=vG;Tr.useColors=pG;Tr.storage=wG();Tr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Tr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function pG(){if(typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function mG(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+_h.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(i=r))}),t.splice(i,0,e)}Tr.log=console.debug||console.log||(()=>{});function gG(t){try{t?Tr.storage.setItem("debug",t):Tr.storage.removeItem("debug")}catch(e){}}function vG(){let t;try{t=Tr.storage.getItem("debug")||Tr.storage.getItem("DEBUG")}catch(e){}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function wG(){try{return localStorage}catch(t){}}_h.exports=tR()(Tr);var{formatters:yG}=_h.exports;yG.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var rR=I(Qr=>{"use strict";p();var bG=Qr&&Qr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qr,"__esModule",{value:!0});var _G=require("fs"),xG=bG(xh()),_l=xG.default("@kwsites/file-exists");function SG(t,e,r){_l("checking %s",t);try{let i=_G.statSync(t);return i.isFile()&&e?(_l("[OK] path represents a file"),!0):i.isDirectory()&&r?(_l("[OK] path represents a directory"),!0):(_l("[FAIL] path represents something other than a file or directory"),!1)}catch(i){if(i.code==="ENOENT")return _l("[FAIL] path is not accessible: %o",i),!1;throw _l("[FATAL] %o",i),i}}function EG(t,e=Qr.READABLE){return SG(t,(e&Qr.FILE)>0,(e&Qr.FOLDER)>0)}Qr.exists=EG;Qr.FILE=1;Qr.FOLDER=2;Qr.READABLE=Qr.FILE+Qr.FOLDER});var iR=I(Sh=>{"use strict";p();function kG(t){for(var e in t)Sh.hasOwnProperty(e)||(Sh[e]=t[e])}Object.defineProperty(Sh,"__esModule",{value:!0});kG(rR())});var Ww=I($a=>{"use strict";p();Object.defineProperty($a,"__esModule",{value:!0});$a.createDeferred=$a.deferred=void 0;function Vw(){let t,e,r="pending";return{promise:new Promise((n,s)=>{t=n,e=s}),done(n){r==="pending"&&(r="resolved",t(n))},fail(n){r==="pending"&&(r="rejected",e(n))},get fulfilled(){return r!=="pending"},get status(){return r}}}$a.deferred=Vw;$a.createDeferred=Vw;$a.default=Vw});var B0=I((exports,module)=>{p();(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,e){return function(r){return new Sha256(e,!0).update(r)[t]()}},createMethod=function(t){var e=createOutputMethod("hex",t);NODE_JS&&(e=nodeWrap(e,t)),e.create=function(){return new Sha256(t)},e.update=function(n){return e.create().update(n)};for(var r=0;r>2]|=t[n]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|i&63)<=57344?(o[s>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|i&63)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|i&63)<=64?(this.block=o[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[e&3],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t=this.h0,e=this.h1,r=this.h2,i=this.h3,n=this.h4,s=this.h5,a=this.h6,o=this.h7,l=this.blocks,c,u,f,d,h,m,g,v,w,b,k;for(c=16;c<64;++c)h=l[c-15],u=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,h=l[c-2],f=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,l[c]=l[c-16]+u+l[c-7]+f<<0;for(k=e&r,c=0;c<64;c+=4)this.first?(this.is224?(v=300032,h=l[0]-1413257819,o=h-150054599<<0,i=h+24177077<<0):(v=704751109,h=l[0]-210244248,o=h-1521486534<<0,i=h+143694565<<0),this.first=!1):(u=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),f=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),v=t&e,d=v^t&r^k,g=n&s^~n&a,h=o+f+g+K[c]+l[c],m=u+d,o=i+h<<0,i=h+m<<0),u=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),f=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),w=i&t,d=w^i&e^v,g=o&n^~o&s,h=a+f+g+K[c+1]+l[c+1],m=u+d,a=r+h<<0,r=h+m<<0,u=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),f=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),b=r&i,d=b^r&t^w,g=a&o^~a&n,h=s+f+g+K[c+2]+l[c+2],m=u+d,s=e+h<<0,e=h+m<<0,u=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),f=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),k=e&r,d=k^e&i^b,g=s&a^~s&o,h=n+f+g+K[c+3]+l[c+3],m=u+d,n=t+h<<0,t=h+m<<0;this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+r<<0,this.h3=this.h3+i<<0,this.h4=this.h4+n<<0,this.h5=this.h5+s<<0,this.h6=this.h6+a<<0,this.h7=this.h7+o<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,i=this.h3,n=this.h4,s=this.h5,a=this.h6,o=this.h7,l=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15];return this.is224||(l+=HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]),l},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,i=this.h3,n=this.h4,s=this.h5,a=this.h6,o=this.h7,l=[t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,r>>24&255,r>>16&255,r>>8&255,r&255,i>>24&255,i>>16&255,i>>8&255,i&255,n>>24&255,n>>16&255,n>>8&255,n&255,s>>24&255,s>>16&255,s>>8&255,s&255,a>>24&255,a>>16&255,a>>8&255,a&255];return this.is224||l.push(o>>24&255,o>>16&255,o>>8&255,o&255),l},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t};function HmacSha256(t,e,r){var i,n=typeof t;if(n==="string"){var s=[],a=t.length,o=0,l;for(i=0;i>6,s[o++]=128|l&63):l<55296||l>=57344?(s[o++]=224|l>>12,s[o++]=128|l>>6&63,s[o++]=128|l&63):(l=65536+((l&1023)<<10|t.charCodeAt(++i)&1023),s[o++]=240|l>>18,s[o++]=128|l>>12&63,s[o++]=128|l>>6&63,s[o++]=128|l&63);t=s}else if(n==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);t.length>64&&(t=new Sha256(e,!0).update(t).array());var c=[],u=[];for(i=0;i<64;++i){var f=t[i]||0;c[i]=92^f,u[i]=54^f}Sha256.call(this,e,r),this.update(u),this.oKeyPad=c,this.inner=!0,this.sharedMemory=r}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var wO=I(vy=>{p();(function(t){var e=/\S/,r=/\"/g,i=/\n/g,n=/\r/g,s=/\\/g,a=/\u2028/,o=/\u2029/;t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(S,_){var T=S.length,P=0,D=1,B=2,N=P,ce=null,Pe=null,ve="",se=[],xe=!1,we=0,z=0,Q="{{",j="}}";function Le(){ve.length>0&&(se.push({tag:"_t",text:new String(ve)}),ve="")}function lr(){for(var At=!0,Tt=z;Tt"&&(Ze.indent=se[jt].text.toString()),se.splice(jt,1));else Tt||se.push({tag:` +`});xe=!1,z=se.length}function Ie(At,Tt){var jt="="+j,Ze=At.indexOf(jt,Tt),q=c(At.substring(At.indexOf("=",Tt)+1,Ze)).split(" ");return Q=q[0],j=q[q.length-1],Ze+jt.length-1}for(_&&(_=_.split(" "),Q=_[0],j=_[1]),we=0;we0;){if(N=y.shift(),B&&B.tag=="<"&&!(N.tag in f))throw new Error("Illegal content in < super tag.");if(t.tags[N.tag]<=t.tags.$||h(N,T))_.push(N),N.nodes=d(y,N.tag,_,T);else if(N.tag=="/"){if(_.length===0)throw new Error("Closing tag without opener: /"+N.n);if(D=_.pop(),N.n!=D.n&&!m(N.n,D.n,T))throw new Error("Nesting error: "+D.n+" vs. "+N.n);return D.end=N.i,P}else N.tag==` +`&&(N.last=y.length==0||y[0].tag==` +`);P.push(N)}if(_.length>0)throw new Error("missing closing tag: "+_.pop().n);return P}function h(y,S){for(var _=0,T=S.length;_":x,"<":function(y,S){var _={partials:{},code:"",subs:{},inPartial:!0};t.walk(y.nodes,_);var T=S.partials[x(y,S)];T.subs=_.subs,T.partials=_.partials},$:function(y,S){var _={subs:{},code:"",partials:S.partials,prefix:y.n};t.walk(y.nodes,_),S.subs[y.n]=_.code,S.inPartial||(S.code+='t.sub("'+b(y.n)+'",c,p,i);')},"\n":function(y,S){S.code+=A('"\\n"'+(y.last?"":" + i"))},_v:function(y,S){S.code+="t.b(t.v(t."+k(y.n)+'("'+b(y.n)+'",c,p,0)));'},_t:function(y,S){S.code+=A('"'+b(y.text)+'"')},"{":E,"&":E};function E(y,S){S.code+="t.b(t.t(t."+k(y.n)+'("'+b(y.n)+'",c,p,0)));'}function A(y){return"t.b("+y+");"}t.walk=function(y,S){for(var _,T=0,P=y.length;T{p();var UV={};(function(t){t.Template=function(d,h,m,g){d=d||{},this.r=d.code||this.r,this.c=m,this.options=g||{},this.text=h||"",this.partials=d.partials||{},this.subs=d.subs||{},this.buf=""},t.Template.prototype={r:function(d,h,m){return""},v:u,t:c,render:function(h,m,g){return this.ri([h],m||{},g)},ri:function(d,h,m){return this.r(d,h,m)},ep:function(d,h){var m=this.partials[d],g=h[m.name];if(m.instance&&m.base==g)return m.instance;if(typeof g=="string"){if(!this.c)throw new Error("No compiler available.");g=this.c.compile(g,this.options)}if(!g)return null;if(this.partials[d].base=g,m.subs){h.stackText||(h.stackText={});for(key in m.subs)h.stackText[key]||(h.stackText[key]=this.activeSub!==void 0&&h.stackText[this.activeSub]?h.stackText[this.activeSub]:this.text);g=r(g,m.subs,m.partials,this.stackSubs,this.stackPartials,h.stackText)}return this.partials[d].instance=g,g},rp:function(d,h,m,g){var v=this.ep(d,m);return v?v.ri(h,m,g):""},rs:function(d,h,m){var g=d[d.length-1];if(!f(g)){m(d,h,this);return}for(var v=0;v=0;x--)if(w=h[x],v=e(d,w,k),v!==void 0){b=!0;break}return b?(!g&&typeof v=="function"&&(v=this.mv(v,h,m)),v):g?!1:""},ls:function(d,h,m,g,v,w){var b=this.options.delimiters;return this.options.delimiters=w,this.b(this.ct(c(d.call(h,v,m)),h,g)),this.options.delimiters=b,!1},ct:function(d,h,m){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(d,this.options).render(h,m)},b:function(d){this.buf+=d},fl:function(){var d=this.buf;return this.buf="",d},ms:function(d,h,m,g,v,w,b){var k,x=h[h.length-1],E=d.call(x);return typeof E=="function"?g?!0:(k=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(E,x,h,m,k.substring(v,w),b)):E},mv:function(d,h,m){var g=h[h.length-1],v=d.call(g);return typeof v=="function"?this.ct(c(v.call(g)),g,m):v},sub:function(d,h,m,g){var v=this.subs[d];v&&(this.activeSub=d,v(h,m,this,g),this.activeSub=!1)}};function e(d,h,m){var g;return h&&typeof h=="object"&&(h[d]!==void 0?g=h[d]:m&&h.get&&typeof h.get=="function"&&(g=h.get(d))),g}function r(d,h,m,g,v,w){function b(){}b.prototype=d;function k(){}k.prototype=d.subs;var x,E=new b;E.subs=new k,E.subsText={},E.buf="",g=g||{},E.stackSubs=g,E.subsText=w;for(x in h)g[x]||(g[x]=h[x]);for(x in g)E.subs[x]=g[x];v=v||{},E.stackPartials=v;for(x in m)v[x]||(v[x]=m[x]);for(x in v)E.partials[x]=v[x];return E}var i=/&/g,n=//g,a=/\'/g,o=/\"/g,l=/[&<>\"\']/;function c(d){return String(d==null?"":d)}function u(d){return d=c(d),l.test(d)?d.replace(i,"&").replace(n,"<").replace(s,">").replace(a,"'").replace(o,"""):d}var f=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"}})(typeof wy!="undefined"?wy:UV)});var yy=I((vre,bO)=>{p();var yp=wO();yp.Template=yO().Template;yp.template=yp.Template;bO.exports=yp});var SO=I(bi=>{"use strict";p();Object.defineProperty(bi,"__esModule",{value:!0});bi.ColorSchemeType=bi.DiffStyleType=bi.LineMatchingType=bi.OutputFormatType=bi.LineType=void 0;var _O;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(_O||(bi.LineType=_O={}));bi.OutputFormatType={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"};bi.LineMatchingType={LINES:"lines",WORDS:"words",NONE:"none"};bi.DiffStyleType={WORD:"word",CHAR:"char"};var xO;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(xO||(bi.ColorSchemeType=xO={}))});var Q9={};BD(Q9,{default:()=>Sm});module.exports=ND(Q9);p();var gD=Mt(xv()),_e=require("obsidian"),vD=Mt(require("path"));p();var Fi={};p();var Dd=class{constructor(e){this.plugin=e;this.tasks=[]}addTask(e,r){this.tasks.push({task:e,onFinished:r!=null?r:()=>{}}),this.tasks.length===1&&this.handleTask()}handleTask(){if(this.tasks.length>0){let e=this.tasks[0];e.task().then(r=>{e.onFinished(r),this.tasks.shift(),this.handleTask()},r=>{this.plugin.displayError(r),e.onFinished(void 0),this.tasks.shift(),this.handleTask()})}}clear(){this.tasks=[]}};p();var U=require("obsidian");p();var UA=require("obsidian"),Ld="YYYY-MM-DD",Sv=`${Ld} HH:mm`,Ev=`${Ld} HH:mm:ss`,Bd=40,al="conflict-files-obsidian-git.md",rt={commitMessage:"vault backup: {{date}}",autoCommitMessage:"vault backup: {{date}}",commitMessageScript:"",commitDateFormat:Ev,autoSaveInterval:0,autoPushInterval:0,autoPullInterval:0,autoPullOnBoot:!1,autoCommitOnlyStaged:!1,disablePush:!1,pullBeforePush:!0,disablePopups:!1,showErrorNotices:!0,disablePopupsForNoChanges:!1,listChangedFilesInMessageBody:!1,showStatusBar:!0,updateSubmodules:!1,syncMethod:"merge",mergeStrategy:"none",customMessageOnAutoBackup:!1,autoBackupAfterFileChange:!1,treeStructure:!1,refreshSourceControl:UA.Platform.isDesktopApp,basePath:"",differentIntervalCommitAndPush:!1,changedFilesInStatusBar:!1,showedMobileNotice:!1,refreshSourceControlTimer:7e3,showBranchStatusBar:!0,setLastSaveToLastCommit:!1,submoduleRecurseCheckout:!1,gitDir:"",showFileMenu:!0,authorInHistoryView:"hide",dateInHistoryView:!1,diffStyle:"split",hunks:{showSigns:!1,hunkCommands:!1,statusBar:"disabled"},lineAuthor:{show:!1,followMovement:"inactive",authorDisplay:"initials",showCommitHash:!1,dateTimeFormatOptions:"date",dateTimeFormatCustomString:Sv,dateTimeTimezone:"viewer-local",coloringMaxAge:"1y",colorNew:{r:255,g:150,b:150},colorOld:{r:120,g:160,b:255},textColorCss:"var(--text-muted)",ignoreWhitespace:!1,gutterSpacingFallbackLength:5}},zt={type:"git-view",name:"Source Control",icon:"git-pull-request"},gi={type:"git-history-view",name:"History",icon:"history"},Ls={type:"split-diff-view",name:"Diff view",icon:"diff"},Bs={type:"diff-view",name:"Diff View",icon:"git-pull-request"},Nd="C:\\Program Files\\Git\\cmd\\git.exe",Hd=".git_credentials_input",Ta="obsidian_askpass.sh",GA=`#!/bin/sh + +PROMPT="$1" +TEMP_FILE="$OBSIDIAN_GIT_CREDENTIALS_INPUT" + +cleanup() { + rm -f "$TEMP_FILE" "$TEMP_FILE.response" +} +trap cleanup EXIT + +echo "$PROMPT" > "$TEMP_FILE" + +while [ ! -e "$TEMP_FILE.response" ]; do + if [ ! -e "$TEMP_FILE" ]; then + echo "Trigger file got removed: Abort" >&2 + exit 1 + fi + sleep 0.1 +done + +RESPONSE=$(cat "$TEMP_FILE.response") + +echo "$RESPONSE" +`,jA=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];p();p();p();var un=class{diff(e,r,i={}){let n;typeof i=="function"?(n=i,i={}):"callback"in i&&(n=i.callback);let s=this.castInput(e,i),a=this.castInput(r,i),o=this.removeEmpty(this.tokenize(s,i)),l=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,l,i,n)}diffWithOptionsObj(e,r,i,n){var s;let a=b=>{if(b=this.postProcess(b,i),n){setTimeout(function(){n(b)},0);return}else return b},o=r.length,l=e.length,c=1,u=o+l;i.maxEditLength!=null&&(u=Math.min(u,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,d=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(h[0],r,e,0,i);if(h[0].oldPos+1>=l&&m+1>=o)return a(this.buildValues(h[0].lastComponent,r,e));let g=-1/0,v=1/0,w=()=>{for(let b=Math.max(g,-c);b<=Math.min(v,c);b+=2){let k,x=h[b-1],E=h[b+1];x&&(h[b-1]=void 0);let A=!1;if(E){let S=E.oldPos-b;A=E&&0<=S&&S=l&&m+1>=o)return a(this.buildValues(k.lastComponent,r,e))||!0;h[b]=k,k.oldPos+1>=l&&(v=Math.min(v,b-1)),m+1>=o&&(g=Math.max(g,b+1))}c++};if(n)(function b(){setTimeout(function(){if(c>u||Date.now()>d)return n(void 0);w()||b()},0)})();else for(;c<=u&&Date.now()<=d;){let b=w();if(b)return b}}addToPath(e,r,i,n,s){let a=e.lastComponent;return a&&!s.oneChangePerToken&&a.added===r&&a.removed===i?{oldPos:e.oldPos+n,lastComponent:{count:a.count+1,added:r,removed:i,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:r,removed:i,previousComponent:a}}}extractCommon(e,r,i,n,s){let a=r.length,o=i.length,l=e.oldPos,c=l-n,u=0;for(;c+1d.length?m:d}),u.value=this.join(f)}else u.value=this.join(r.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return n}};p();var kv=class extends un{},qA=new kv;function Av(t,e,r){return qA.diff(t,e,r)}p();p();function Tv(t,e){let r;for(r=0;re.length&&(r=t.length-e.length);let i=e.length;t.length0&&e[a]!=e[s];)s=n[s];e[a]==e[s]&&s++}s=0;for(let a=r;a0&&t[a]!=e[s];)s=n[s];t[a]==e[s]&&s++}return s}function ll(t){let e;for(e=t.length-1;e>=0&&t[e].match(/\s/);e--);return t.substring(e+1)}function zn(t){let e=t.match(/^\s*/);return e?e[0]:""}var jd="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",F6=new RegExp(`[${jd}]+|\\s+|[^${jd}]`,"ug"),Rv=class extends un{equals(e,r,i){return i.ignoreCase&&(e=e.toLowerCase(),r=r.toLowerCase()),e.trim()===r.trim()}tokenize(e,r={}){let i;if(r.intlSegmenter){let a=r.intlSegmenter;if(a.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');i=[];for(let o of Array.from(a.segment(e))){let l=o.segment;i.length&&/\s/.test(i[i.length-1])&&/\s/.test(l)?i[i.length-1]+=l:i.push(l)}}else i=e.match(F6)||[];let n=[],s=null;return i.forEach(a=>{/\s/.test(a)?s==null?n.push(a):n.push(n.pop()+a):s!=null&&/\s/.test(s)?n[n.length-1]==s?n.push(n.pop()+a):n.push(s+a):n.push(a),s=a}),n}join(e){return e.map((r,i)=>i==0?r:r.replace(/^\s+/,"")).join("")}postProcess(e,r){if(!e||r.oneChangePerToken)return e;let i=null,n=null,s=null;return e.forEach(a=>{a.added?n=a:a.removed?s=a:((n||s)&&zA(i,s,n,a),i=a,n=null,s=null)}),(n||s)&&zA(i,s,n,null),e}},O6=new Rv;function zA(t,e,r,i){if(e&&r){let n=zn(e.value),s=ll(e.value),a=zn(r.value),o=ll(r.value);if(t){let l=Tv(n,a);t.value=Gd(t.value,a,l),e.value=ol(e.value,l),r.value=ol(r.value,l)}if(i){let l=Cv(s,o);i.value=Ud(i.value,o,l),e.value=lu(e.value,l),r.value=lu(r.value,l)}}else if(r){if(t){let n=zn(r.value);r.value=r.value.substring(n.length)}if(i){let n=zn(i.value);i.value=i.value.substring(n.length)}}else if(t&&i){let n=zn(i.value),s=zn(e.value),a=ll(e.value),o=Tv(n,s);e.value=ol(e.value,o);let l=Cv(ol(n,o),a);e.value=lu(e.value,l),i.value=Ud(i.value,n,l),t.value=Gd(t.value,n,n.slice(0,n.length-l.length))}else if(i){let n=zn(i.value),s=ll(e.value),a=Pv(s,n);e.value=lu(e.value,a)}else if(t){let n=ll(t.value),s=zn(e.value),a=Pv(n,s);e.value=ol(e.value,a)}}var $v=class extends un{tokenize(e){let r=new RegExp(`(\\r?\\n)|[${jd}]+|[^\\S\\n\\r]+|[^${jd}]`,"ug");return e.match(r)||[]}},VA=new $v;function Iv(t,e,r){return VA.diff(t,e,r)}p();var Fv=class extends un{constructor(){super(...arguments),this.tokenize=D6}equals(e,r,i){return i.ignoreWhitespace?((!i.newlineIsToken||!e.includes(` +`))&&(e=e.trim()),(!i.newlineIsToken||!r.includes(` +`))&&(r=r.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(e.endsWith(` +`)&&(e=e.slice(0,-1)),r.endsWith(` +`)&&(r=r.slice(0,-1))),super.equals(e,r,i)}},M6=new Fv;function Ov(t,e,r){return M6.diff(t,e,r)}function D6(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,` +`));let r=[],i=t.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let n=0;n{let d=c(f);u(d)}}))}else return c(Ov(r,i,o));function c(u){if(!u)return;u.push({value:"",lines:[]});function f(b){return b.map(function(k){return" "+k})}let d=[],h=0,m=0,g=[],v=1,w=1;for(let b=0;b0?f(E.lines.slice(-l)):[],h-=g.length,m-=g.length)}for(let E of x)g.push((k.added?"+":"-")+E);k.added?w+=x.length:v+=x.length}else{if(h)if(x.length<=l*2&&b1&&!e.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(i=>qd(i,e)).join(` +`)}let r=[];e.includeIndex&&t.oldFileName==t.newFileName&&r.push("Index: "+t.oldFileName),e.includeUnderline&&r.push("==================================================================="),e.includeFileHeaders&&(r.push("--- "+t.oldFileName+(typeof t.oldHeader=="undefined"?"":" "+t.oldHeader)),r.push("+++ "+t.newFileName+(typeof t.newHeader=="undefined"?"":" "+t.newHeader)));for(let i=0;i{o(l?qd(l,a.headerOptions):void 0)}}))}else{let o=Mv(t,e,r,i,n,s,a);return o?qd(o,a==null?void 0:a.headerOptions):void 0}}function cu(t,e,r,i,n,s){return YA(t,t,e,r,i,n,s)}function L6(t){let e=t.endsWith(` +`),r=t.split(` +`).map(i=>i+` +`);return e?r.pop():r.push(r.pop().slice(0,-1)),r}var re=Mt(xv()),Pa=require("obsidian");p();function XA(t,e){let r=Object.assign({},t.lineAuthor,e.lineAuthor);return Object.assign({},t,e,{lineAuthor:r})}var cl=class extends Error{constructor(r){super("No network connection available");this.originalError=r}};p();var ZA=require("obsidian"),N6={options:[],placeholder:"",allowEmpty:!1,onlySelection:!1,initialValue:void 0,obscure:!1},Qe=class extends ZA.SuggestModal{constructor(e,r){if(super(e.app),this.config={...N6,...r},this.setPlaceholder(this.config.placeholder),this.config.obscure){this.inputEl.type="password";let i=this.containerEl.querySelector(".prompt-input-container");i.addClass("git-obscure-prompt"),i.setAttr("git-is-obscured","true");let n=i==null?void 0:i.createDiv({cls:"search-input-clear-button"});n.style.marginRight="32px",n.id="git-show-password",n.addEventListener("click",()=>{i.getAttr("git-is-obscured")==="true"?(this.inputEl.type="text",i.setAttr("git-is-obscured","false")):(this.inputEl.type="password",i.setAttr("git-is-obscured","true"))})}}openAndGetResult(){return new Promise(e=>{this.resolve=e,this.open(),this.config.initialValue!=null&&(this.inputEl.value=this.config.initialValue,this.inputEl.dispatchEvent(new Event("input")))})}onClose(){new Promise(e=>setTimeout(e,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(e){return this.config.onlySelection?this.config.options:this.config.allowEmpty?[e.length>0?e:" ",...this.config.options]:[e.length>0?e:"...",...this.config.options]}renderSuggestion(e,r){this.config.obscure?r.hide():r.setText(e)}onChooseSuggestion(e,r){if(this.resolve){let i;this.config.allowEmpty&&e===" "?i="":e==="..."?i=void 0:i=e,this.resolve(i)}}};p();var OP=Mt(pT()),MP=require("child_process"),DP=Mt(FP()),Xn=require("obsidian");function wh(t){throw new Error(`Unexpected object: ${t}`)}function Su(t,e,r){return t===1?`${t} ${e}`:`${t} ${r!=null?r:e+"s"}`}var Uw=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);function Mi(t,e){let r;if(e){if(e.button===0||e.button===1){let i=Xn.Keymap.isModEvent(e);r=t.workspace.getLeaf(i)}}else r=t.workspace.getLeaf(!1);return r}function hn(t,e,r,i,n){if(e.button==2){let s=t.vault.getAbstractFileByPath(r);if(s!=null){let a=new Xn.Menu;t.workspace.trigger("file-menu",a,s,n,i),a.showAtPosition({x:e.pageX,y:e.pageY})}else{let a=new Xn.Menu;t.workspace.trigger("obsidian-git:menu",a,r,n,i),a.showAtPosition({x:e.pageX,y:e.pageY})}}}function Gs(t){throw new Error("Impossible branch: "+t)}function Gw(t){return`rgb(${t.r},${t.g},${t.b})`}function LP(t){var s;let e=(s=OP.fromString(t))==null?void 0:s.toRgbaArray();if(e===void 0)return;let[r,i,n]=e;return{r,g:i,b:n}}function BP(t){return t.diff(Xn.moment.unix(0),"seconds")}function NP(t){if(t.length!==0)return t.slice().sort()[Math.floor(t.length/2)]}function HP(t,e){return(0,DP.default)(t,e,{strict:!0})}function Eu(t,e){return new Proxy(t,{get(r,i){return i==="length"?Math.min(e,r.length):r[i]}})}function UP(t,e,r){return t.length<=e?new Array(e-t.length).fill(r).join("")+t:t.substring(t.length-e)}function GP(t,e){if(e<=0)return t;let r=new Array(e).fill(" ").join(""),i=t.substring(e,t.length);return r+i}function jw(t,e,r){return t<=e&&e<=r}function Zn(t){let[e,...r]=t.split("/");return[e,r.length===0?void 0:r.join("/")]}function pn(t){return t.endsWith("/")?t:t.split("/").last().replace(/\.md$/,"")}function jP(t){return t===1?"1 minute":`${t} minutes`}function iG(t){let e=t.lastIndexOf(".");return t.substring(e+1)}function pl(t){if(t.endsWith(".md"))return!1;let e=iG(t);return jA.includes(e)}function qw(t){return(t.startsWith("https://github.com/")||t.startsWith("https://gitlab.com/"))&&(t.endsWith(".git")||(t=t+".git")),t}function ml(t,e){let r=e.vault.getAbstractFileByPath(t);if(!(r instanceof Xn.TFile))return!1;try{return!!e.viewRegistry.getTypeByExtension(r.extension)}catch(i){return!0}}function qP({isFolder:t,gitRelativePath:e}){let r="/";return r+=e,t&&(r+="/"),r.replace(/([\\!#*?[\]])/g,String.raw`\$1`).replace(/\s(?=\s*$)/g,String.raw`\ `)}function gl(t,e,r,i){let n=e.target;t.workspace.trigger("hover-link",{event:e,source:r.getViewType(),hoverParent:r,targetEl:n,linktext:i})}function ku(t,e,r={}){return new Promise((i,n)=>{let s=(0,MP.spawn)(t,e,r),a="",o="";s.stdout.on("data",l=>{a+=l.toString()}),s.stderr.on("data",l=>{o+=l.toString()}),s.on("error",l=>{i({error:new Error(l.message),stdout:a,stderr:a,code:1})}),s.on("close",l=>{i({stdout:a,stderr:o,code:l!=null?l:1,error:void 0})})})}p();var zP=require("obsidian"),vl=class{constructor(e){this.plugin=e,this.app=e.app}getRelativeVaultPath(e){return this.plugin.settings.basePath?this.plugin.settings.basePath+"/"+e:e}getRelativeRepoPath(e,r=!0){return r&&this.plugin.settings.basePath.length>0?e.substring(this.plugin.settings.basePath.length+1):e}unload(){}_getTreeStructure(e,r=0){let i=[];for(e=[...e];e.length>0;){let n=e.first(),s=n.path.substring(r);if(s.contains("/")){let a=s.substring(0,s.indexOf("/")),o=e.filter(c=>c.path.substring(r).startsWith(a+"/"));o.forEach(c=>e.remove(c));let l=n.path.substring(0,s.indexOf("/")+r);i.push({title:a,path:l,vaultPath:this.getRelativeVaultPath(l),children:this._getTreeStructure(o,(r>0?r+a.length:a.length)+1)})}else i.push({title:s,data:n,path:n.path,vaultPath:this.getRelativeVaultPath(n.path)}),e.remove(n)}return i}simplify(e){var r,i,n,s;for(let a of e){for(;;){let o=((r=a.children)==null?void 0:r.length)==1,l=((n=(i=a.children)==null?void 0:i.first())==null?void 0:n.data)==null;if(!(a.children!=null&&o&&l))break;let c=a.children.first();a.title+="/"+c.title,a.data=c.data,a.path=c.path,a.vaultPath=c.vaultPath,a.children=c.children}a.children!=null&&this.simplify(a.children),(s=a.children)==null||s.sort((o,l)=>{let c=(l.data==null?1:0)-(o.data==null?1:0);return c!=0?c:o.title.localeCompare(l.title)})}return e.sort((a,o)=>{let l=(o.data==null?1:0)-(a.data==null?1:0);return l!=0?l:a.title.localeCompare(o.title)})}getTreeStructure(e){let r=this._getTreeStructure(e);return this.simplify(r)}async formatCommitMessage(e){let r;if(e.includes("{{numFiles}}")){r=await this.status();let i=r.staged.length;e=e.replace("{{numFiles}}",String(i))}if(e.includes("{{hostname}}")){let i=this.plugin.localStorage.getHostname()||"";e=e.replace("{{hostname}}",i)}if(e.includes("{{files}}")){r=r!=null?r:await this.status();let i={},n="";if(r.staged.length<100){r.staged.forEach(a=>{a.index in i?i[a.index].push(a.path):i[a.index]=[a.path]});let s=[];for(let[a,o]of Object.entries(i))s.push(a+" "+o.join(" "));n=s.join(", ")}else n="Too many files to list";e=e.replace("{{files}}",n)}if(e=e.replace("{{date}}",(0,zP.moment)().format(this.plugin.settings.commitDateFormat)),this.plugin.settings.listChangedFilesInMessageBody){let i=r!=null?r:await this.status(),n="";i.staged.length<100?n=i.staged.map(s=>s.path).join(` +`):n="Too many files to list",e=e+` + +Affected files: +`+n}return e}};p();var js=require("obsidian"),yh=class{constructor(e,r){this.plugin=r;this.promises={};this.adapter=e.adapter,this.vault=e,this.lastBasePath=this.plugin.settings.basePath,this.promises.readFile=this.readFile.bind(this),this.promises.writeFile=this.writeFile.bind(this),this.promises.readdir=this.readdir.bind(this),this.promises.mkdir=this.mkdir.bind(this),this.promises.rmdir=this.rmdir.bind(this),this.promises.stat=this.stat.bind(this),this.promises.unlink=this.unlink.bind(this),this.promises.lstat=this.lstat.bind(this),this.promises.readlink=this.readlink.bind(this),this.promises.symlink=this.symlink.bind(this)}async readFile(e,r){var i;if(this.maybeLog("Read: "+e+JSON.stringify(r)),r=="utf8"||r.encoding=="utf8"){let n=this.vault.getAbstractFileByPath(e);return n instanceof js.TFile?(this.maybeLog("Reuse"),this.vault.read(n)):this.adapter.read(e)}else{if(e.endsWith(this.gitDir+"/index"))return this.plugin.settings.basePath!=this.lastBasePath?(this.clearIndex(),this.lastBasePath=this.plugin.settings.basePath,this.adapter.readBinary(e)):(i=this.index)!=null?i:this.adapter.readBinary(e);let n=this.vault.getAbstractFileByPath(e);return n instanceof js.TFile?(this.maybeLog("Reuse"),this.vault.readBinary(n)):this.adapter.readBinary(e)}}async writeFile(e,r){if(this.maybeLog("Write: "+e),typeof r=="string"){let i=this.vault.getAbstractFileByPath(e);return i instanceof js.TFile?this.vault.modify(i,r):this.adapter.write(e,r)}else if(e.endsWith(this.gitDir+"/index"))this.index=r,this.indexmtime=Date.now();else{let i=this.vault.getAbstractFileByPath(e);return i instanceof js.TFile?this.vault.modifyBinary(i,r):this.adapter.writeBinary(e,r)}}async readdir(e){e==="."&&(e="/");let r=await this.adapter.list(e),i=[...r.files,...r.folders],n;return e!=="/"?n=i.map(s=>(0,js.normalizePath)(s.substring(e.length))):n=i,n}async mkdir(e){return this.adapter.mkdir(e)}async rmdir(e,r){var i,n;return this.adapter.rmdir(e,(n=(i=r==null?void 0:r.options)==null?void 0:i.recursive)!=null?n:!1)}async stat(e){if(e.endsWith(this.gitDir+"/index")){if(this.index!==void 0&&this.indexctime!=null&&this.indexmtime!=null)return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:this.index.byteLength,type:"file",ctimeMs:this.indexctime,mtimeMs:this.indexmtime};{let i=await this.adapter.stat(e);if(i==null)throw{code:"ENOENT"};return this.indexctime=i.ctime,this.indexmtime=i.mtime,{ctimeMs:i.ctime,mtimeMs:i.mtime,size:i.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}}}e==="."&&(e="/");let r=this.vault.getAbstractFileByPath(e);if(this.maybeLog("Stat: "+e),r instanceof js.TFile)return this.maybeLog("Reuse stat"),{ctimeMs:r.stat.ctime,mtimeMs:r.stat.mtime,size:r.stat.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1};{let i=await this.adapter.stat(e);if(i)return{ctimeMs:i.ctime,mtimeMs:i.mtime,size:i.size,type:i.type==="folder"?"directory":i.type,isFile:()=>i.type==="file",isDirectory:()=>i.type==="folder",isSymbolicLink:()=>!1};throw{code:"ENOENT"}}}async unlink(e){return this.adapter.remove(e)}async lstat(e){return this.stat(e)}async readlink(e){throw new Error(`readlink of (${e}) is not implemented.`)}async symlink(e){throw new Error(`symlink of (${e}) is not implemented.`)}async saveAndClear(){this.index!==void 0&&await this.adapter.writeBinary(this.plugin.gitManager.getRelativeVaultPath(this.gitDir+"/index"),this.index,{ctime:this.indexctime,mtime:this.indexmtime}),this.clearIndex()}clearIndex(){this.index=void 0,this.indexctime=void 0,this.indexmtime=void 0}get gitDir(){return this.plugin.settings.gitDir||".git"}maybeLog(e){}};var KP=Mt(ZP()),Di=class extends vl{constructor(r){super(r);this.FILE=0;this.HEAD=1;this.WORKDIR=2;this.STAGE=3;this.status_mapping={"000":" ","003":"AD","020":"??","022":"A ","023":"AM",100:"D ",101:" D",103:"MD",110:"DA",111:" ",113:"MM",120:"DA",121:" M",122:"M ",123:"MM"};this.noticeLength=999999;this.fs=new yh(this.app.vault,this.plugin)}getRepo(){return{fs:this.fs,dir:this.plugin.settings.basePath,gitdir:this.plugin.settings.gitDir||void 0,onAuth:()=>{var r,i;return{username:(r=this.plugin.localStorage.getUsername())!=null?r:void 0,password:(i=this.plugin.localStorage.getPassword())!=null?i:void 0}},onAuthFailure:async()=>{new Pa.Notice("Authentication failed. Please try with different credentials");let r=await new Qe(this.plugin,{placeholder:"Specify your username"}).openAndGetResult();if(r){let i=await new Qe(this.plugin,{placeholder:"Specify your password/personal access token",obscure:!0}).openAndGetResult();if(i)return this.plugin.localStorage.setUsername(r),this.plugin.localStorage.setPassword(i),{username:r,password:i}}return{cancel:!0}},http:{async request({url:r,method:i,headers:n,body:s}){let a;s&&(a=await oG(s));let o=await(0,Pa.requestUrl)({url:r,method:i,headers:n,body:a,throw:!1});return{url:r,method:i,headers:o.headers,body:aG(o.arrayBuffer),statusCode:o.status,statusMessage:o.status.toString()}}}}}async wrapFS(r){try{let i=await r;return await this.fs.saveAndClear(),i}catch(i){throw await this.fs.saveAndClear(),i}}async status(r){let i,n=window.setTimeout(()=>{i=new Pa.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{this.plugin.setPluginState({gitAction:1});let s={...this.getRepo()};(r==null?void 0:r.path)!=null&&(s.filepaths=[`${r.path}/`]);let a=(await this.wrapFS(re.default.statusMatrix(s))).map(f=>this.getFileStatusResult(f)),o=[],l=[],c=[];for(let f of a)f.workingDir!==" "&&o.push(f),f.index!==" "&&f.index!=="U"&&l.push(f),(f.index!=" "||f.workingDir!=" ")&&c.push(f);let u=[];return window.clearTimeout(n),i==null||i.hide(),{all:c,changed:o,staged:l,conflicted:u}}catch(s){throw window.clearTimeout(n),i==null||i.hide(),this.plugin.displayError(s),s}}async commitAll({message:r,status:i,unstagedFiles:n}){try{return await this.checkAuthorInfo(),await this.stageAll({status:i,unstagedFiles:n}),this.commit({message:r})}catch(s){throw this.plugin.displayError(s),s}}async commit({message:r}){try{await this.checkAuthorInfo(),this.plugin.setPluginState({gitAction:4});let i=await this.formatCommitMessage(r),n=this.plugin.localStorage.getConflict(),s;if(n){let a=await this.branchInfo();s=[a.current,a.tracking]}await this.wrapFS(re.default.commit({...this.getRepo(),message:i,parent:s})),this.plugin.localStorage.setConflict(!1);return}catch(i){throw this.plugin.displayError(i),i}}async stage(r,i){let n=this.getRelativeRepoPath(r,i),s;i?s=r:s=this.getRelativeVaultPath(r);try{this.plugin.setPluginState({gitAction:3}),await this.app.vault.adapter.exists(s)?await this.wrapFS(re.default.add({...this.getRepo(),filepath:n})):await this.wrapFS(re.default.remove({...this.getRepo(),filepath:n}))}catch(a){throw this.plugin.displayError(a),a}}async stageAll({dir:r,status:i,unstagedFiles:n}){try{if(i)await Promise.all(i.changed.map(s=>s.workingDir!=="D"?this.wrapFS(re.default.add({...this.getRepo(),filepath:s.path})):re.default.remove({...this.getRepo(),filepath:s.path})));else{let s=n!=null?n:await this.getUnstagedFiles(r!=null?r:".");await Promise.all(s.map(({path:a,type:o})=>o=="D"?re.default.remove({...this.getRepo(),filepath:a}):this.wrapFS(re.default.add({...this.getRepo(),filepath:a}))))}}catch(s){throw this.plugin.displayError(s),s}}async unstage(r,i){try{this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.wrapFS(re.default.resetIndex({...this.getRepo(),filepath:r}))}catch(n){throw this.plugin.displayError(n),n}}async unstageAll({dir:r,status:i}){try{let n;i?n=i.staged.map(s=>s.path):n=(await this.getStagedFiles(r!=null?r:".")).map(({path:a})=>a),await this.wrapFS(Promise.all(n.map(s=>re.default.resetIndex({...this.getRepo(),filepath:s}))))}catch(n){throw this.plugin.displayError(n),n}}async discard(r){try{this.plugin.setPluginState({gitAction:3}),await this.wrapFS(re.default.checkout({...this.getRepo(),filepaths:[r],force:!0}))}catch(i){throw this.plugin.displayError(i),i}}async discardAll({dir:r,status:i}){let n=[];i?r!=null?n=i.changed.filter(s=>s.workingDir!="U"&&s.path.startsWith(r)).map(s=>s.path):n=i.changed.filter(s=>s.workingDir!="U").map(s=>s.path):n=(await this.getUnstagedFiles(r)).filter(s=>s.type!="A").map(({path:s})=>s);try{await this.wrapFS(re.default.checkout({...this.getRepo(),filepaths:n,force:!0}))}catch(s){throw this.plugin.displayError(s),s}}async getUntrackedPaths(r){let i=[];if(r.status)for(let n of r.status.changed)n.index=="U"&&n.workingDir==="U"&&n.path.startsWith(r.path!=null?`${r.path}/`:"")&&i.push(n.path);else{let n=await this.status({path:r==null?void 0:r.path});for(let s of n.changed)s.index==="U"&&s.workingDir==="U"&&i.push(s.path)}return i}getProgressText(r,i){let n=`${r} progress:`;return i.phase&&(n=`${n} ${i.phase}:`),i.loaded&&(n=`${n} ${i.loaded}`,i.total&&(n=`${n} of ${i.total}`)),n}resolveRef(r){return this.wrapFS(re.default.resolveRef({...this.getRepo(),ref:r}))}async pull(){let r=this.showNotice("Initializing pull");try{this.plugin.setPluginState({gitAction:2});let i=await this.resolveRef("HEAD");await this.fetch();let n=await this.branchInfo();await this.checkAuthorInfo(),(await this.wrapFS(re.default.merge({...this.getRepo(),ours:n.current,theirs:n.tracking,abortOnConflict:!1,mergeDriver:this.plugin.settings.mergeStrategy!=="none"?({contents:l})=>{var b,k,x;let c=l[0],u=l[1],f=l[2],d=/^.*(\r?\n|$)/gm,h=(b=u.match(d))!=null?b:[],m=(k=c.match(d))!=null?k:[],g=(x=f.match(d))!=null?x:[],v=(0,KP.default)(h,m,g),w="";for(let E of v)E.ok&&(w+=E.ok.join("")),E.conflict&&(w+=this.plugin.settings.mergeStrategy==="ours"?E.conflict.a.join(""):E.conflict.b.join(""));return{cleanMerge:!0,mergedText:w}}:void 0}))).alreadyMerged||await this.wrapFS(re.default.checkout({...this.getRepo(),ref:n.current,onProgress:l=>{r!==void 0&&(r.noticeEl.innerText=this.getProgressText("Checkout",l))},remote:n.remote})),r==null||r.hide();let a=await this.resolveRef("HEAD"),o=await this.getFileChangesCount(i,a);return this.showNotice("Finished pull",!1),o.map(l=>({path:l.path,workingDir:"P",index:"P",vaultPath:this.getRelativeVaultPath(l.path)}))}catch(i){throw r==null||r.hide(),i instanceof re.Errors.MergeConflictError&&await this.plugin.handleConflict(i.data.filepaths.map(n=>this.getRelativeVaultPath(n))),this.plugin.displayError(i),i}}async push(){if(!await this.canPush())return 0;let r=this.showNotice("Initializing push");try{this.plugin.setPluginState({gitAction:1});let i=await this.branchInfo(),n=i.tracking,s=i.current,a=(await this.getFileChangesCount(s,n)).length;this.plugin.setPluginState({gitAction:5});let o=await this.getCurrentRemote();return await this.wrapFS(re.default.push({...this.getRepo(),remote:o,onProgress:l=>{r!==void 0&&(r.noticeEl.innerText=this.getProgressText("Pushing",l))}})),r==null||r.hide(),a}catch(i){throw r==null||r.hide(),this.plugin.displayError(i),i}}async getUnpushedCommits(){let r=await this.branchInfo(),i=r.tracking,n=r.current;if(i==null||n==null)return 0;let s=await this.resolveRef(n),a=await this.resolveRef(i);return(await this.getFileChangesCount(s,a)).length}async canPush(){let r=await this.branchInfo(),i=r.tracking,n=r.current,s=await this.resolveRef(n),a=await this.resolveRef(i);return s!=a}async checkRequirements(){return await this.plugin.app.vault.adapter.exists(`${this.getRepo().dir}/.git/HEAD`)?"valid":"missing-repo"}async branchInfo(){var r,i;try{let n=await re.default.currentBranch(this.getRepo())||"",s=await re.default.listBranches(this.getRepo()),a=(r=await this.getConfig(`branch.${n}.remote`))!=null?r:"origin",o=(i=await this.getConfig(`branch.${n}.merge`))==null?void 0:i.split("refs/heads")[1],l=o?a+o:void 0;return{current:n,tracking:l,branches:s,remote:a}}catch(n){throw this.plugin.displayError(n),n}}async getCurrentRemote(){var n;let r=await re.default.currentBranch(this.getRepo())||"";return(n=await this.getConfig(`branch.${r}.remote`))!=null?n:"origin"}async checkout(r,i){try{return this.wrapFS(re.default.checkout({...this.getRepo(),ref:r,force:!!i,remote:i}))}catch(n){throw this.plugin.displayError(n),n}}async createBranch(r){try{await this.wrapFS(re.default.branch({...this.getRepo(),ref:r,checkout:!0}))}catch(i){throw this.plugin.displayError(i),i}}async deleteBranch(r){try{await this.wrapFS(re.default.deleteBranch({...this.getRepo(),ref:r}))}catch(i){throw this.plugin.displayError(i),i}}branchIsMerged(r){return Promise.resolve(!0)}async init(){try{await this.wrapFS(re.default.init(this.getRepo()))}catch(r){throw this.plugin.displayError(r),r}}async clone(r,i,n){let s=this.showNotice("Initializing clone");try{await this.wrapFS(re.default.clone({...this.getRepo(),dir:i,url:r,depth:n,onProgress:a=>{s!==void 0&&(s.noticeEl.innerText=this.getProgressText("Cloning",a))}})),s==null||s.hide()}catch(a){throw s==null||s.hide(),this.plugin.displayError(a),a}}async setConfig(r,i){try{return this.wrapFS(re.default.setConfig({...this.getRepo(),path:r,value:i}))}catch(n){throw this.plugin.displayError(n),n}}async getConfig(r){try{return this.wrapFS(re.default.getConfig({...this.getRepo(),path:r}))}catch(i){throw this.plugin.displayError(i),i}}async fetch(r){let i=this.showNotice("Initializing fetch");try{let n={...this.getRepo(),onProgress:s=>{i!==void 0&&(i.noticeEl.innerText=this.getProgressText("Fetching",s))},remote:r!=null?r:await this.getCurrentRemote()};await this.wrapFS(re.default.fetch(n)),i==null||i.hide()}catch(n){throw this.plugin.displayError(n),i==null||i.hide(),n}}async setRemote(r,i){try{await this.wrapFS(re.default.addRemote({...this.getRepo(),remote:r,url:i,force:!0}))}catch(n){throw this.plugin.displayError(n),n}}async getRemoteBranches(r){let i=[];return i.push(...await this.wrapFS(re.default.listBranches({...this.getRepo(),remote:r}))),i.remove("HEAD"),i=i.map(n=>`${r}/${n}`),i}async getRemotes(){return(await this.wrapFS(re.default.listRemotes({...this.getRepo()}))).map(r=>r.remote)}async removeRemote(r){await this.wrapFS(re.default.deleteRemote({...this.getRepo(),remote:r}))}async getRemoteUrl(r){var i;return(i=(await this.wrapFS(re.default.listRemotes({...this.getRepo()}))).filter(n=>n.remote==r)[0])==null?void 0:i.url}async log(r,i=!0,n,s){let a=await this.wrapFS(re.default.log({...this.getRepo(),depth:n,ref:s}));return Promise.all(a.map(async o=>{let l=o.commit.message.split(` + +`);return{message:l[0],author:{name:o.commit.author.name,email:o.commit.author.email},body:l.slice(1).join(` + +`),date:new Date(o.commit.committer.timestamp).toDateString(),diff:{changed:0,files:(await this.getFileChangesCount(o.commit.parent.first(),o.oid)).map(c=>({path:c.path,status:c.type,vaultPath:this.getRelativeVaultPath(c.path),hash:o.oid}))},hash:o.oid,refs:[]}}))}updateBasePath(r){return this.getRepo().dir=r,Promise.resolve()}async updateUpstreamBranch(r){let[i,n]=Zn(r),s=await this.branchInfo();await this.wrapFS(re.default.push({...this.getRepo(),remote:i,remoteRef:n})),await this.setConfig(`branch.${s.current}.merge`,`refs/heads/${n}`)}updateGitPath(r){return Promise.resolve()}async getFileChangesCount(r,i){return this.walkDifference({walkers:[re.default.TREE({ref:r}),re.default.TREE({ref:i})]})}async walkDifference({walkers:r,dir:i}){return await this.wrapFS(re.default.walk({...this.getRepo(),trees:r,map:async function(s,[a,o]){if(!Uw(s,i))return null;if(await(a==null?void 0:a.type())==="tree"||await(o==null?void 0:o.type())==="tree")return;let l=await(a==null?void 0:a.oid()),c=await(o==null?void 0:o.oid()),u="equal";if(l!==c&&(u="M"),l===void 0&&(u="A"),c===void 0&&(u="D"),l===void 0&&c===void 0&&(console.log("Something weird happened:"),console.log(a),console.log(o)),u!=="equal")return{path:s,type:u}}}))}async getStagedFiles(r="."){return(await this.walkDifference({walkers:[re.default.TREE({ref:"HEAD"}),re.default.STAGE()],dir:r})).map(n=>({vaultPath:this.getRelativeVaultPath(n.path),path:n.path}))}async getUnstagedFiles(r="."){let i,n=window.setTimeout(()=>{i=new Pa.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{let s=this.getRepo(),a=await this.wrapFS(re.default.walk({...s,trees:[re.default.WORKDIR(),re.default.STAGE()],map:async function(o,[l,c]){if(!c&&l&&await re.default.isIgnored({...s,filepath:o})||!Uw(o,r))return null;let[u,f]=await Promise.all([l&&l.type(),c&&c.type()]),d=[u,f].includes("blob");if((u==="tree"||u==="special")&&!d)return;if(f==="commit")return null;if((f==="tree"||f==="special")&&!d)return;let h=f==="blob"?await c.oid():void 0,m;return u==="blob"&&f!=="blob"?m="42":u==="blob"&&(m=await l.oid()),m?h?m!==h?{path:o,type:"M"}:null:{path:o,type:"A"}:{path:o,type:"D"}}}));return window.clearTimeout(n),i==null||i.hide(),a}catch(s){throw window.clearTimeout(n),i==null||i.hide(),this.plugin.displayError(s),s}}async getDiffString(r,i=!1,n){let s=this.getRelativeVaultPath(r),a=async(c,[u])=>{if(r==c){let f=await u.oid();return(await re.default.readBlob({...this.getRepo(),oid:f})).blob}};if(n){let c=await(0,re.readBlob)({...this.getRepo(),filepath:r,oid:n}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof re.default.Errors.NotFoundError))throw h}),u=await re.default.readCommit({...this.getRepo(),oid:n}),f=await(0,re.readBlob)({...this.getRepo(),filepath:r,oid:u.commit.parent.first()}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof re.default.Errors.NotFoundError))throw h});return cu(s,f!=null?f:"",c!=null?c:"")}let o=(await re.default.walk({...this.getRepo(),trees:[re.default.STAGE()],map:a})).first(),l=new TextDecoder().decode(o);if(i){let c=await this.resolveRef("HEAD").then(f=>(0,re.readBlob)({...this.getRepo(),filepath:r,oid:f})).then(f=>new TextDecoder().decode(f.blob)).catch(f=>{if(!(f instanceof re.default.Errors.NotFoundError))throw f});return cu(s,c!=null?c:"",l)}else{let c;return await this.app.vault.adapter.exists(s)?c=await this.app.vault.adapter.read(s):c="",cu(s,l,c)}}async getLastCommitTime(){let r=this.getRepo(),i=await this.resolveRef("HEAD"),s=(await re.default.readCommit({...r,oid:i})).commit.committer.timestamp;return new Date(s*1e3)}getFileStatusResult(r){let i=this.status_mapping[`${r[this.HEAD]}${r[this.WORKDIR]}${r[this.STAGE]}`];return{index:i[0]=="?"?"U":i[0],workingDir:i[1]=="?"?"U":i[1],path:r[this.FILE],vaultPath:this.getRelativeVaultPath(r[this.FILE])}}async checkAuthorInfo(){let r=await this.getConfig("user.name"),i=await this.getConfig("user.email");if(!r||!i)throw Error("Git author name and email are not set. Please set both fields in the settings.")}showNotice(r,i=!0){if(!this.plugin.settings.disablePopups)return new Pa.Notice(r,i?this.noticeLength:void 0)}};async function*aG(t){yield new Uint8Array(t)}async function oG(t){let e=new ReadableStream({async start(i){for await(let n of t)i.enqueue(n);i.close()}});return await new Response(e).arrayBuffer()}p();var UI=Mt(xh()),ei=Mt(require("fs/promises")),Qn=require("obsidian"),Ge=Mt(require("path")),Mu=require("path");p();var Oh=Mt(iR(),1),$h=Mt(xh(),1),C$=require("child_process"),fI=Mt(Ww(),1),xl=Mt(Ww(),1),LI=require("node:events"),h0=Object.defineProperty,AG=Object.getOwnPropertyDescriptor,p0=Object.getOwnPropertyNames,TG=Object.prototype.hasOwnProperty,Y=(t,e)=>function(){return t&&(e=(0,t[p0(t)[0]])(t=0)),e},CG=(t,e)=>function(){return e||(0,t[p0(t)[0]])((e={exports:{}}).exports,e),e.exports},vt=(t,e)=>{for(var r in e)h0(t,r,{get:e[r],enumerable:!0})},PG=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of p0(e))!TG.call(t,n)&&n!==r&&h0(t,n,{get:()=>e[n],enumerable:!(i=AG(e,n))||i.enumerable});return t},ut=t=>PG(h0({},"__esModule",{value:!0}),t);function RG(...t){let e=new String(t);return Fh.set(e,t),e}function Ch(t){return t instanceof String&&Fh.has(t)}function nR(t){return Fh.get(t)||[]}var Fh,Pu=Y({"src/lib/args/pathspec.ts"(){"use strict";Fh=new WeakMap}}),Rr,zs=Y({"src/lib/errors/git-error.ts"(){"use strict";Rr=class extends Error{constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),Ru,El=Y({"src/lib/errors/git-response-error.ts"(){"use strict";zs(),Ru=class extends Rr{constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),MR,DR=Y({"src/lib/errors/task-configuration-error.ts"(){"use strict";zs(),MR=class extends Rr{constructor(t){super(void 0,t)}}}});function LR(t){return typeof t!="function"?Ma:t}function BR(t){return typeof t=="function"&&t!==Ma}function NR(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}function HR(t,e=0){return UR(t)&&t.length>e?t[e]:void 0}function Oa(t,e=0){if(UR(t)&&t.length>e)return t[t.length-1-e]}function UR(t){return!!(t&&typeof t.length=="number")}function $u(t="",e=!0,r=` +`){return t.split(r).reduce((i,n)=>{let s=e?n.trim():n;return s&&i.push(s),i},[])}function m0(t,e){return $u(t,!0).map(r=>e(r))}function g0(t){return(0,Oh.exists)(t,Oh.FOLDER)}function Oe(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function GR(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function Mh(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}function mn(t){return Array.isArray(t)?t:[t]}function jR(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}function qR(t){return mn(t).map(String)}function Ve(t,e=0){if(t==null)return e;let r=parseInt(t,10);return isNaN(r)?e:r}function Tu(t,e){let r=[];for(let i=0,n=t.length;ir in t?{[r]:t[r]}:{}))}function e0(t=0){return new Promise(e=>setTimeout(e,t))}function t0(t){if(t!==!1)return t}var Sl,Ma,Iu,Dh=Y({"src/lib/utils/util.ts"(){"use strict";Sl="\0",Ma=()=>{},Iu=Object.prototype.toString.call.bind(Object.prototype.toString)}});function gn(t,e,r){return e(t)?t:arguments.length>2?r:void 0}function r0(t,e){let r=Ch(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}function Lh(t){return!!t&&Iu(t)==="[object Object]"}function VR(t){return typeof t=="function"}var Fu,er,WR,Ph,v0,YR=Y({"src/lib/utils/argument-filters.ts"(){"use strict";Dh(),Pu(),Fu=t=>Array.isArray(t),er=t=>typeof t=="string",WR=t=>Array.isArray(t)&&t.every(er),Ph=t=>er(t)||Array.isArray(t)&&t.every(er),v0=t=>t==null||"number|boolean|function".includes(typeof t)?!1:Array.isArray(t)||typeof t=="string"||typeof t.length=="number"}}),i0,$G=Y({"src/lib/utils/exit-codes.ts"(){"use strict";i0=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(i0||{})}}),Rh,IG=Y({"src/lib/utils/git-output-streams.ts"(){"use strict";Rh=class XR{constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new XR(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),me,qs,FG=Y({"src/lib/utils/line-parser.ts"(){"use strict";me=class{constructor(t,e){this.matches=[],this.parse=(r,i)=>(this.resetMatches(),this._regExp.every((n,s)=>this.addMatch(n,s,r(s)))?this.useMatches(i,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}useMatches(t,e){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let i=r&&t.exec(r);return i&&this.pushMatch(e,i),!!i}pushMatch(t,e){this.matches.push(...e.slice(1))}},qs=class extends me{addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function ZR(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...KR},...t.filter(i=>typeof i=="object"&&i));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}var KR,OG=Y({"src/lib/utils/simple-git-options.ts"(){"use strict";KR={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function w0(t,e=[]){return Lh(t)?Object.keys(t).reduce((r,i)=>{let n=t[i];if(Ch(n))r.push(n);else if(r0(n,["boolean"]))r.push(i+"="+n);else if(Array.isArray(n))for(let s of n)r0(s,["string","number"])||r.push(i+"="+s);else r.push(i);return r},e):e}function Cr(t,e=0,r=!1){let i=[];for(let n=0,s=e<0?t.length:e;n{for(let s=$u(n,i),a=0,o=s.length;a{if(!(a+c>=o))return s[a+c]};e.some(({parse:c})=>c(l,t))}}),t}var LG=Y({"src/lib/utils/task-parser.ts"(){"use strict";Dh()}}),QR={};vt(QR,{ExitCodes:()=>i0,GitOutputStreams:()=>Rh,LineParser:()=>me,NOOP:()=>Ma,NULL:()=>Sl,RemoteLineParser:()=>qs,append:()=>Oe,appendTaskOptions:()=>w0,asArray:()=>mn,asCamelCase:()=>jR,asFunction:()=>LR,asNumber:()=>Ve,asStringArray:()=>qR,bufferToString:()=>Cu,callTaskParser:()=>n0,createInstanceConfig:()=>ZR,delay:()=>e0,filterArray:()=>Fu,filterFunction:()=>VR,filterHasLength:()=>v0,filterPlainObject:()=>Lh,filterPrimitives:()=>r0,filterString:()=>er,filterStringArray:()=>WR,filterStringOrStringArray:()=>Ph,filterType:()=>gn,first:()=>HR,folderExists:()=>g0,forEachLineWithContent:()=>m0,getTrailingOptions:()=>Cr,including:()=>GR,isUserFunction:()=>BR,last:()=>Oa,objectToString:()=>Iu,orVoid:()=>t0,parseStringResponse:()=>$r,pick:()=>zR,prefixedArray:()=>Tu,remove:()=>Mh,splitOn:()=>NR,toLinesWithContent:()=>$u,trailingFunctionArgument:()=>ft,trailingOptionsArgument:()=>y0});var de=Y({"src/lib/utils/index.ts"(){"use strict";YR(),$G(),IG(),FG(),OG(),DG(),LG(),Dh()}}),JR={};vt(JR,{CheckRepoActions:()=>s0,checkIsBareRepoTask:()=>t$,checkIsRepoRootTask:()=>e$,checkIsRepoTask:()=>BG});function BG(t){switch(t){case"bare":return t$();case"root":return e$()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:Bh,parser:b0}}function e$(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:Bh,parser(e){return/^\.(git)?$/.test(e.trim())}}}function t$(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:Bh,parser:b0}}function NG(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}var s0,Bh,b0,r$=Y({"src/lib/tasks/check-is-repo.ts"(){"use strict";de(),s0=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(s0||{}),Bh=({exitCode:t},e,r,i)=>{if(t===128&&NG(e))return r(Buffer.from("false"));i(e)},b0=t=>t.trim()==="true"}});function HG(t,e){let r=new i$(t),i=t?s$:n$;return $u(e).forEach(n=>{let s=n.replace(i,"");r.paths.push(s),(a$.test(s)?r.folders:r.files).push(s)}),r}var i$,n$,s$,a$,UG=Y({"src/lib/responses/CleanSummary.ts"(){"use strict";de(),i$=class{constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},n$=/^[a-z]+\s*/i,s$=/^[a-z]+\s+[a-z]+\s*/i,a$=/\/$/}}),a0={};vt(a0,{EMPTY_COMMANDS:()=>Nh,adhocExecTask:()=>o$,configurationErrorTask:()=>Pr,isBufferTask:()=>c$,isEmptyTask:()=>u$,straightThroughBufferTask:()=>l$,straightThroughStringTask:()=>mr});function o$(t){return{commands:Nh,format:"empty",parser:t}}function Pr(t){return{commands:Nh,format:"empty",parser(){throw typeof t=="string"?new MR(t):t}}}function mr(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}function l$(t){return{commands:t,format:"buffer",parser(e){return e}}}function c$(t){return t.format==="buffer"}function u$(t){return t.format==="empty"||!t.commands.length}var Nh,gt=Y({"src/lib/tasks/task.ts"(){"use strict";DR(),Nh=[]}}),f$={};vt(f$,{CONFIG_ERROR_INTERACTIVE_MODE:()=>_0,CONFIG_ERROR_MODE_REQUIRED:()=>x0,CONFIG_ERROR_UNKNOWN_OPTION:()=>S0,CleanOptions:()=>Fa,cleanTask:()=>d$,cleanWithOptionsTask:()=>GG,isCleanOptionsArray:()=>jG});function GG(t,e){let{cleanMode:r,options:i,valid:n}=qG(t);return r?n.options?(i.push(...e),i.some(WG)?Pr(_0):d$(r,i)):Pr(S0+JSON.stringify(t)):Pr(x0)}function d$(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(i){return HG(t==="n",i)}}}function jG(t){return Array.isArray(t)&&t.every(e=>E0.has(e))}function qG(t){let e,r=[],i={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(n=>{zG(n)?(e=n,i.cleanMode=!0):i.options=i.options&&VG(r[r.length]=`-${n}`)}),{cleanMode:e,options:r,valid:i}}function zG(t){return t==="f"||t==="n"}function VG(t){return/^-[a-z]$/i.test(t)&&E0.has(t.charAt(1))}function WG(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}var _0,x0,S0,Fa,E0,h$=Y({"src/lib/tasks/clean.ts"(){"use strict";UG(),de(),gt(),_0="Git clean interactive mode is not supported",x0='Git clean mode parameter ("n" or "f") is required',S0="Git clean unknown option found in: ",Fa=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(Fa||{}),E0=new Set(["i",...qR(Object.values(Fa))])}});function YG(t){let e=new m$;for(let r of p$(t))e.addValue(r.file,String(r.key),r.value);return e}function XG(t,e){let r=null,i=[],n=new Map;for(let s of p$(t,e))s.key===e&&(i.push(r=s.value),n.has(s.file)||n.set(s.file,[]),n.get(s.file).push(r));return{key:e,paths:Array.from(n.keys()),scopes:n,value:r,values:i}}function ZG(t){return t.replace(/^(file):/,"")}function*p$(t,e=null){let r=t.split("\0");for(let i=0,n=r.length-1;iObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=Oa(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let i=this.addFile(t);i.hasOwnProperty(e)?Array.isArray(i[e])?i[e].push(r):i[e]=[i[e],r]:i[e]=r,this._all=void 0}}}});function Yw(t,e){return typeof t=="string"&&o0.hasOwnProperty(t)?t:e}function QG(t,e,r,i){let n=["config",`--${i}`];return r&&n.push("--add"),n.push(t,e),{commands:n,format:"utf-8",parser(s){return s}}}function JG(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(i){return XG(i,t)}}}function ej(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return YG(r)}}}function tj(){return{addConfig(t,e,...r){return this._runTask(QG(t,e,r[0]===!0,Yw(r[1],"local")),ft(arguments))},getConfig(t,e){return this._runTask(JG(t,Yw(e,void 0)),ft(arguments))},listConfig(...t){return this._runTask(ej(Yw(t[0],void 0)),ft(arguments))}}}var o0,g$=Y({"src/lib/tasks/config.ts"(){"use strict";KG(),de(),o0=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(o0||{})}});function rj(t){return v$.has(t)}var Xw,v$,w$=Y({"src/lib/tasks/diff-name-status.ts"(){"use strict";Xw=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(Xw||{}),v$=new Set(Object.values(Xw))}});function ij(...t){return new b$().param(...t)}function nj(t){let e=new Set,r={};return m0(t,i=>{let[n,s,a]=i.split(Sl);e.add(n),(r[n]=r[n]||[]).push({line:Ve(s),path:n,preview:a})}),{paths:e,results:r}}function sj(){return{grep(t){let e=ft(arguments),r=Cr(arguments);for(let n of y$)if(r.includes(n))return this._runTask(Pr(`git.grep: use of "${n}" is not supported.`),e);typeof t=="string"&&(t=ij().param(t));let i=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:i,format:"utf-8",parser(n){return nj(n)}},e)}}}var y$,Au,sR,b$,_$=Y({"src/lib/tasks/grep.ts"(){"use strict";de(),gt(),y$=["-h"],Au=Symbol("grepQuery"),b$=class{constructor(){this[sR]=[]}*[(sR=Au,Symbol.iterator)](){for(let t of this[Au])yield t}and(...t){return t.length&&this[Au].push("--and","(",...Tu(t,"-e"),")"),this}param(...t){return this[Au].push(...Tu(t,"-e")),this}}}}),x$={};vt(x$,{ResetMode:()=>kh,getResetMode:()=>oj,resetTask:()=>aj});function aj(t,e){let r=["reset"];return S$(t)&&r.push(`--${t}`),r.push(...e),mr(r)}function oj(t){if(S$(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function S$(t){return E$.includes(t)}var kh,E$,k$=Y({"src/lib/tasks/reset.ts"(){"use strict";gt(),kh=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(kh||{}),E$=Array.from(Object.values(kh))}});function lj(){return(0,$h.default)("simple-git")}function aR(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(i,...n)=>{t(i,...n),r(i,...n)}:t:(i,...n)=>{t(`%s ${i}`,e,...n),r&&r(i,...n)}}function cj(t,e,{namespace:r}){if(typeof t=="string")return t;let i=e&&e.namespace||"";return i.startsWith(r)?i.substr(r.length+1):i||r}function k0(t,e,r,i=lj()){let n=t&&`[${t}]`||"",s=[],a=typeof e=="string"?i.extend(e):e,o=cj(gn(e,er),a,i);return c(r);function l(u,f){return Oe(s,k0(t,o.replace(/^[^:]+/,u),f,i))}function c(u){let f=u&&`[${u}]`||"",d=a&&aR(a,f)||Ma,h=aR(i,`${n} ${f}`,d);return Object.assign(a?d:h,{label:t,sibling:l,info:h,step:c})}}var A$=Y({"src/lib/git-logger.ts"(){"use strict";de(),$h.default.formatters.L=t=>String(v0(t)?t.length:"-"),$h.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Iu(t)}}),T$,uj=Y({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";var t;zs(),A$(),T$=(t=class{constructor(r="GitExecutor"){this.logLabel=r,this._queue=new Map}withProgress(r){return this._queue.get(r)}createProgress(r){let i=t.getName(r.commands[0]),n=k0(this.logLabel,i);return{task:r,logger:n,name:i}}push(r){let i=this.createProgress(r);return i.logger("Adding task to the queue, commands = %o",r.commands),this._queue.set(r,i),i}fatal(r){for(let[i,{logger:n}]of Array.from(this._queue.entries()))i===r.task?(n.info("Failed %o",r),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",r.message),this.complete(i);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(r){this.withProgress(r)&&this._queue.delete(r)}attempt(r){let i=this.withProgress(r);if(!i)throw new Rr(void 0,"TasksPendingQueue: attempt called for an unknown task");return i.logger("Starting task"),i}static getName(r="empty"){return`task:${r}:${++t.counter}`}},t.counter=0,t)}});function Ia(t,e){return{method:HR(t.commands)||"",commands:e}}function fj(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}function oR(t,e,r,i){return n=>{r("%s received %L bytes",e,n),i("%B",n),t.push(n)}}var l0,dj=Y({"src/lib/runners/git-executor-chain.ts"(){"use strict";zs(),gt(),de(),uj(),l0=class{constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new T$}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),r=()=>this._queue.complete(t);try{let{logger:i}=this._queue.attempt(t);return await(u$(t)?this.attemptEmptyTask(t,i):this.attemptRemoteTask(t,i))}catch(i){throw this.onFatalException(t,i)}finally{r(),e()}}onFatalException(t,e){let r=e instanceof Rr?Object.assign(e,{task:t}):new Rr(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(t,e){let r=this._plugins.exec("spawn.binary","",Ia(t,t.commands)),i=this._plugins.exec("spawn.args",[...t.commands],Ia(t,t.commands)),n=await this.gitResponse(t,r,i,this.outputHandler,e.step("SPAWN")),s=await this.handleTaskData(t,i,n,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),c$(t)?n0(t.parser,s):n0(t.parser,s.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,r,i){let{exitCode:n,rejection:s,stdOut:a,stdErr:o}=r;return new Promise((l,c)=>{i("Preparing to handle process response exitCode=%d stdOut=",n);let{error:u}=this._plugins.exec("task.error",{error:s},{...Ia(t,e),...r});if(u&&t.onError)return i.info("exitCode=%s handling with custom error handler"),t.onError(r,u,f=>{i.info("custom error handler treated as success"),i("custom error returned a %s",Iu(f)),l(new Rh(Array.isArray(f)?Buffer.concat(f):f,Buffer.concat(o)))},c);if(u)return i.info("handling as error: exitCode=%s stdErr=%s rejection=%o",n,o.length,s),c(u);i.info("retrieving task output complete"),l(new Rh(Buffer.concat(a),Buffer.concat(o)))})}async gitResponse(t,e,r,i,n){let s=n.sibling("output"),a=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Ia(t,t.commands));return new Promise(o=>{let l=[],c=[];n.info("%s %o",e,r),n("%O",a);let u=this._beforeSpawn(t,r);if(u)return o({stdOut:l,stdErr:c,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,{...Ia(t,r),kill(d){u=d||u}});let f=(0,C$.spawn)(e,r,a);f.stdout.on("data",oR(l,"stdOut",n,s.step("stdOut"))),f.stderr.on("data",oR(c,"stdErr",n,s.step("stdErr"))),f.on("error",fj(c,n)),i&&(n("Passing child process stdOut/stdErr to custom outputHandler"),i(e,f.stdout,f.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...Ia(t,r),spawned:f,close(d,h){o({stdOut:l,stdErr:c,exitCode:d,rejection:u||h})},kill(d){f.killed||(u=d,f.kill("SIGINT"))}})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,{...Ia(t,e),kill(i){r=i||r}}),r}}}}),P$={};vt(P$,{GitExecutor:()=>R$});var R$,hj=Y({"src/lib/runners/git-executor.ts"(){"use strict";dj(),R$=class{constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new l0(this,this._scheduler,this._plugins)}chain(){return new l0(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function pj(t,e,r=Ma){let i=s=>{r(null,s)},n=s=>{(s==null?void 0:s.task)===t&&r(s instanceof Ru?mj(s):s,void 0)};e.then(i,n)}function mj(t){let e=i=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${i} should be GitResponseError.git.${i}, this will no longer be available in version 3`),e=Ma};return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(i,n){return n in t||(i[n]={enumerable:!1,configurable:!1,get(){return e(n),t.git[n]}}),i}}var gj=Y({"src/lib/task-callback.ts"(){"use strict";El(),de()}});function lR(t,e){return o$(r=>{if(!g0(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}var vj=Y({"src/lib/tasks/change-working-directory.ts"(){"use strict";de(),gt()}});function Zw(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=Mh(e,"-B")),mr(e)}function wj(){return{checkout(){return this._runTask(Zw(Cr(arguments,1)),ft(arguments))},checkoutBranch(t,e){return this._runTask(Zw(["-b",t,e,...Cr(arguments)]),ft(arguments))},checkoutLocalBranch(t){return this._runTask(Zw(["-b",t,...Cr(arguments)]),ft(arguments))}}}var yj=Y({"src/lib/tasks/checkout.ts"(){"use strict";de(),gt()}});function bj(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function _j(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return $r(bj(),[$$],t)}})}}}var $$,xj=Y({"src/lib/tasks/count-objects.ts"(){"use strict";de(),$$=new me(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let i=jR(e);t.hasOwnProperty(i)&&(t[i]=Ve(r))})}});function Sj(t){return $r({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},I$,t)}var I$,Ej=Y({"src/lib/parsers/parse-commit.ts"(){"use strict";de(),I$=[new me(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,i])=>{t.branch=e,t.commit=i,t.root=!!r}),new me(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),i=r.pop();!i||!i.includes("@")||(t.author={email:i.substr(0,i.length-1),name:r.join("<").trim()})}),new me(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,i])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(i,10)||0}),new me(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,i])=>{t.summary.changes=parseInt(e,10)||0;let n=parseInt(r,10)||0;i==="-"?t.summary.deletions=n:i==="+"&&(t.summary.insertions=n)})]}});function kj(t,e,r){return{commands:["-c","core.abbrev=40","commit",...Tu(t,"-m"),...e,...r],format:"utf-8",parser:Sj}}function Aj(){return{commit(e,...r){let i=ft(arguments),n=t(e)||kj(mn(e),mn(gn(r[0],Ph,[])),[...gn(r[1],Fu,[]),...Cr(arguments,0,!0)]);return this._runTask(n,i)}};function t(e){return!Ph(e)&&Pr("git.commit: requires the commit message to be supplied as a string/string[]")}}var Tj=Y({"src/lib/tasks/commit.ts"(){"use strict";Ej(),de(),gt()}});function Cj(){return{firstCommit(){return this._runTask(mr(["rev-list","--max-parents=0","HEAD"],!0),ft(arguments))}}}var Pj=Y({"src/lib/tasks/first-commit.ts"(){"use strict";de(),gt()}});function Rj(t,e){let r=["hash-object",t];return e&&r.push("-w"),mr(r,!0)}var $j=Y({"src/lib/tasks/hash-object.ts"(){"use strict";gt()}});function Ij(t,e,r){let i=String(r).trim(),n;if(n=F$.exec(i))return new Ah(t,e,!1,n[1]);if(n=O$.exec(i))return new Ah(t,e,!0,n[1]);let s="",a=i.split(" ");for(;a.length;)if(a.shift()==="in"){s=a.join(" ");break}return new Ah(t,e,/^re/i.test(i),s)}var Ah,F$,O$,Fj=Y({"src/lib/responses/InitSummary.ts"(){"use strict";Ah=class{constructor(t,e,r,i){this.bare=t,this.path=e,this.existing=r,this.gitDir=i}},F$=/^Init.+ repository in (.+)$/,O$=/^Rein.+ in (.+)$/}});function Oj(t){return t.includes(A0)}function Mj(t=!1,e,r){let i=["init",...r];return t&&!Oj(i)&&i.splice(1,0,A0),{commands:i,format:"utf-8",parser(n){return Ij(i.includes("--bare"),e,n)}}}var A0,Dj=Y({"src/lib/tasks/init.ts"(){"use strict";Fj(),A0="--bare"}});function T0(t){for(let e=0;e$r(new M$,e,r,!1)}var Kw,cR,uR,fR,L$,B$=Y({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Ou(),Bj(),w$(),de(),Kw=[new me(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,i=""])=>{t.files.push({file:e.trim(),changes:Ve(r),insertions:i.replace(/[^+]/g,"").length,deletions:i.replace(/[^-]/g,"").length,binary:!1})}),new me(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,i])=>{t.files.push({file:e.trim(),before:Ve(r),after:Ve(i),binary:!0})}),new me(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let i=/(\d+) i/.exec(r),n=/(\d+) d/.exec(r);t.changed=Ve(e),t.insertions=Ve(i==null?void 0:i[1]),t.deletions=Ve(n==null?void 0:n[1])})],cR=[new me(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,i])=>{let n=Ve(e),s=Ve(r);t.changed++,t.insertions+=n,t.deletions+=s,t.files.push({file:i,changes:n+s,insertions:n,deletions:s,binary:!1})}),new me(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],uR=[new me(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],fR=[new me(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,i,n,s])=>{t.changed++,t.files.push({file:s!=null?s:i,changes:0,insertions:0,deletions:0,binary:!1,status:t0(rj(e)&&e),from:t0(!!s&&i!==s&&i),similarity:Ve(r)})})],L$={"":Kw,"--stat":Kw,"--numstat":cR,"--name-status":fR,"--name-only":uR}}});function Nj(t,e){return e.reduce((r,i,n)=>(r[i]=t[n]||"",r),Object.create({diff:null}))}function N$(t=$0,e=H$,r=""){let i=D$(r);return function(n){let s=$u(n.trim(),!1,P0).map(function(a){let o=a.split(R0),l=Nj(o[0].split(t),e);return o.length>1&&o[1].trim()&&(l.diff=i(o[1])),l});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}var P0,R0,$0,H$,U$=Y({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";de(),B$(),Ou(),P0="\xF2\xF2\xF2\xF2\xF2\xF2 ",R0=" \xF2\xF2",$0=" \xF2 ",H$=["hash","date","message","refs","author_name","author_email"]}}),G$={};vt(G$,{diffSummaryTask:()=>Hj,validateLogFormatConfig:()=>Hh});function Hj(t){let e=T0(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),Hh(r)||{commands:r,format:"utf-8",parser:D$(e)}}function Hh(t){let e=t.filter(Lj);if(e.length>1)return Pr(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return Pr(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}var I0=Y({"src/lib/tasks/diff.ts"(){"use strict";Ou(),B$(),gt()}});function Uj(t,e){let r=[],i=[];return Object.keys(t).forEach(n=>{r.push(n),i.push(String(t[n]))}),[r,i.join(e)]}function Gj(t){return Object.keys(t).reduce((e,r)=>(r in c0||(e[r]=t[r]),e),{})}function j$(t={},e=[]){let r=gn(t.splitter,er,$0),i=Lh(t.format)?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[n,s]=Uj(i,r),a=[],o=[`--pretty=format:${P0}${s}${R0}`,...e],l=t.n||t["max-count"]||t.maxCount;if(l&&o.push(`--max-count=${l}`),t.from||t.to){let c=t.symmetric!==!1?"...":"..";a.push(`${t.from||""}${c}${t.to||""}`)}return er(t.file)&&o.push("--follow",RG(t.file)),w0(Gj(t),o),{fields:n,splitter:r,commands:[...o,...a]}}function jj(t,e,r){let i=N$(t,e,T0(r));return{commands:["log",...r],format:"utf-8",parser:i}}function qj(){return{log(...r){let i=ft(arguments),n=j$(y0(arguments),gn(arguments[0],Fu)),s=e(...r)||Hh(n.commands)||t(n);return this._runTask(s,i)}};function t(r){return jj(r.splitter,r.fields,r.commands)}function e(r,i){return er(r)&&er(i)&&Pr("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var c0,q$=Y({"src/lib/tasks/log.ts"(){"use strict";Ou(),Pu(),U$(),de(),gt(),I0(),c0=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(c0||{})}}),Th,z$,zj=Y({"src/lib/responses/MergeSummary.ts"(){"use strict";Th=class{constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},z$=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),u0,V$,Vj=Y({"src/lib/responses/PullSummary.ts"(){"use strict";u0=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},V$=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Qw(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function dR(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:Ve(e&&e[1]||"0"),delta:Ve(r&&r[1]||"0")}}var W$,Wj=Y({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";de(),W$=[new qs(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let i=e.toLowerCase(),n=Qw(t.remoteMessages);Object.assign(n,{[i]:Ve(r)})}),new qs(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let i=e.toLowerCase(),n=Qw(t.remoteMessages);Object.assign(n,{[i]:Ve(r)})}),new qs(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,i])=>{let n=Qw(t.remoteMessages);n.total=dR(e),n.reused=dR(r),n.packReused=Ve(i)})]}});function Y$(t,e){return $r({remoteMessages:new Z$},X$,e)}var X$,Z$,K$=Y({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";de(),Wj(),X$=[new qs(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...W$,new qs([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new qs([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,i])=>{t.remoteMessages.vulnerabilities={count:Ve(e),summary:r,url:i}})],Z$=class{constructor(){this.all=[]}}}});function Yj(t,e){let r=$r(new V$,Q$,[t,e]);return r.message&&r}var hR,pR,mR,gR,Q$,vR,F0,J$=Y({"src/lib/parsers/parse-pull.ts"(){"use strict";Vj(),de(),K$(),hR=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,pR=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,mR=/^(create|delete) mode \d+ (.+)/,gR=[new me(hR,(t,[e,r,i])=>{t.files.push(e),r&&(t.insertions[e]=r.length),i&&(t.deletions[e]=i.length)}),new me(pR,(t,[e,,r,,i])=>r!==void 0||i!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+i||0,!0):!1),new me(mR,(t,[e,r])=>{Oe(t.files,r),Oe(e==="create"?t.created:t.deleted,r)})],Q$=[new me(/^from\s(.+)$/i,(t,[e])=>void(t.remote=e)),new me(/^fatal:\s(.+)$/,(t,[e])=>void(t.message=e)),new me(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,i,n])=>{t.branch.local=i,t.hash.local=e,t.branch.remote=n,t.hash.remote=r})],vR=(t,e)=>$r(new u0,gR,[t,e]),F0=(t,e)=>Object.assign(new u0,vR(t,e),Y$(t,e))}}),wR,eI,yR,Xj=Y({"src/lib/parsers/parse-merge.ts"(){"use strict";zj(),de(),J$(),wR=[new me(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new me(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new Th(e,r))}),new me(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,i])=>{t.conflicts.push(new Th(e,r,{deleteRef:i}))}),new me(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new Th(e,null))}),new me(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],eI=(t,e)=>Object.assign(yR(t,e),F0(t,e)),yR=t=>$r(new z$,wR,t)}});function bR(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let i=eI(e,r);if(i.failed)throw new Ru(i);return i}}:Pr("Git.merge requires at least one option")}var Zj=Y({"src/lib/tasks/merge.ts"(){"use strict";El(),Xj(),gt()}});function Kj(t,e,r){let i=r.includes("deleted"),n=r.includes("tag")||/^refs\/tags/.test(t),s=!r.includes("new");return{deleted:i,tag:n,branch:!n,new:!s,alreadyUpdated:s,local:t,remote:e}}var _R,tI,xR,Qj=Y({"src/lib/parsers/parse-push.ts"(){"use strict";de(),K$(),_R=[new me(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new me(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new me(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,i])=>{t.pushed.push(Kj(e,r,i))}),new me(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,i])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:i}}),new me(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,i,n])=>{t.update={head:{local:e,remote:r},hash:{from:i,to:n}}})],tI=(t,e)=>{let r=xR(t,e),i=Y$(t,e);return{...r,...i}},xR=(t,e)=>$r({pushed:[]},_R,[t,e])}}),rI={};vt(rI,{pushTagsTask:()=>Jj,pushTask:()=>O0});function Jj(t={},e){return Oe(e,"--tags"),O0(t,e)}function O0(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),Mh(r,"-v"),Oe(r,"--verbose"),Oe(r,"--porcelain"),{commands:r,format:"utf-8",parser:tI}}var iI=Y({"src/lib/tasks/push.ts"(){"use strict";Qj(),de()}});function eq(){return{showBuffer(){let t=["show",...Cr(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(l$(t),ft(arguments))},show(){let t=["show",...Cr(arguments,1)];return this._runTask(mr(t),ft(arguments))}}}var tq=Y({"src/lib/tasks/show.ts"(){"use strict";de(),gt()}}),SR,nI,rq=Y({"src/lib/responses/FileStatusSummary.ts"(){"use strict";SR=/^(.+)\0(.+)$/,nI=class{constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let i=SR.exec(t)||[null,t,t];this.from=i[2]||"",this.path=i[1]||""}}}}});function ER(t){let[e,r]=t.split(Sl);return{from:r||e,to:e}}function Jr(t,e,r){return[`${t}${e}`,r]}function Jw(t,...e){return e.map(r=>Jr(t,r,(i,n)=>Oe(i.conflicted,n)))}function iq(t,e){let r=e.trim();switch(" "){case r.charAt(2):return i(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return i(" ",r.charAt(0),r.substr(2));default:return}function i(n,s,a){let o=`${n}${s}`,l=sI.get(o);l&&l(t,a),o!=="##"&&o!=="!!"&&t.files.push(new nI(a,n,s))}}var kR,sI,aI,nq=Y({"src/lib/responses/StatusSummary.ts"(){"use strict";de(),rq(),kR=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},sI=new Map([Jr(" ","A",(t,e)=>Oe(t.created,e)),Jr(" ","D",(t,e)=>Oe(t.deleted,e)),Jr(" ","M",(t,e)=>Oe(t.modified,e)),Jr("A"," ",(t,e)=>Oe(t.created,e)&&Oe(t.staged,e)),Jr("A","M",(t,e)=>Oe(t.created,e)&&Oe(t.staged,e)&&Oe(t.modified,e)),Jr("D"," ",(t,e)=>Oe(t.deleted,e)&&Oe(t.staged,e)),Jr("M"," ",(t,e)=>Oe(t.modified,e)&&Oe(t.staged,e)),Jr("M","M",(t,e)=>Oe(t.modified,e)&&Oe(t.staged,e)),Jr("R"," ",(t,e)=>{Oe(t.renamed,ER(e))}),Jr("R","M",(t,e)=>{let r=ER(e);Oe(t.renamed,r),Oe(t.modified,r.to)}),Jr("!","!",(t,e)=>{Oe(t.ignored=t.ignored||[],e)}),Jr("?","?",(t,e)=>Oe(t.not_added,e)),...Jw("A","A","U"),...Jw("D","D","U"),...Jw("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,i=/behind (\d+)/,n=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,a=/\son\s([\S]+)$/,o;o=r.exec(e),t.ahead=o&&+o[1]||0,o=i.exec(e),t.behind=o&&+o[1]||0,o=n.exec(e),t.current=o&&o[1],o=s.exec(e),t.tracking=o&&o[1],o=a.exec(e),t.current=o&&o[1]||t.current,t.detached=/\(no branch\)/.test(e)}]]),aI=function(t){let e=t.split(Sl),r=new kR;for(let i=0,n=e.length;i!oI.includes(r))],parser(r){return aI(r)}}}var oI,aq=Y({"src/lib/tasks/status.ts"(){"use strict";nq(),oI=["--null","-z"]}});function Ih(t=0,e=0,r=0,i="",n=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:i,installed:n},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function oq(){return Ih(0,0,0,"",!1)}function lq(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:cq,onError(t,e,r,i){if(t.exitCode===-2)return r(Buffer.from(M0));i(e)}})}}}function cq(t){return t===M0?oq():$r(Ih(0,0,0,t),lI,t)}var M0,lI,uq=Y({"src/lib/tasks/version.ts"(){"use strict";de(),M0="installed=false",lI=[new me(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,i,n=""])=>{Object.assign(t,Ih(Ve(e),Ve(r),Ve(i),n))}),new me(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,i,n=""])=>{Object.assign(t,Ih(Ve(e),Ve(r),i,n))})]}}),cI={};vt(cI,{SimpleGitApi:()=>f0});var f0,fq=Y({"src/lib/simple-git-api.ts"(){"use strict";gj(),vj(),yj(),xj(),Tj(),g$(),Pj(),_$(),$j(),Dj(),q$(),Zj(),iI(),tq(),aq(),gt(),uq(),de(),f0=class{constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),i=r.push(t);return e&&pj(t,i,e),Object.create(this,{then:{value:i.then.bind(i)},catch:{value:i.catch.bind(i)},_executor:{value:r}})}add(t){return this._runTask(mr(["add",...mn(t)]),ft(arguments))}cwd(t){let e=ft(arguments);return typeof t=="string"?this._runTask(lR(t,this._executor),e):typeof(t==null?void 0:t.path)=="string"?this._runTask(lR(t.path,t.root&&this._executor||void 0),e):this._runTask(Pr("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(Rj(t,e===!0),ft(arguments))}init(t){return this._runTask(Mj(t===!0,this._executor.cwd,Cr(arguments)),ft(arguments))}merge(){return this._runTask(bR(Cr(arguments)),ft(arguments))}mergeFromTo(t,e){return er(t)&&er(e)?this._runTask(bR([t,e,...Cr(arguments)]),ft(arguments,!1)):this._runTask(Pr("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=O0({remote:gn(arguments[0],er),branch:gn(arguments[1],er)},Cr(arguments));return this._runTask(t,ft(arguments))}stash(){return this._runTask(mr(["stash",...Cr(arguments)]),ft(arguments))}status(){return this._runTask(sq(Cr(arguments)),ft(arguments))}},Object.assign(f0.prototype,wj(),Aj(),tj(),_j(),Cj(),sj(),qj(),eq(),lq())}}),uI={};vt(uI,{Scheduler:()=>dI});var AR,dI,dq=Y({"src/lib/runners/scheduler.ts"(){"use strict";de(),A$(),AR=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,fI.createDeferred)();return{promise:e,done:r,id:t}}})(),dI=class{constructor(t=2){this.concurrency=t,this.logger=k0("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=Oe(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),Mh(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=Oe(this.pending,AR());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),hI={};vt(hI,{applyPatchTask:()=>hq});function hq(t,e){return mr(["apply",...e,...t])}var pq=Y({"src/lib/tasks/apply-patch.ts"(){"use strict";gt()}});function mq(t,e){return{branch:t,hash:e,success:!0}}function gq(t){return{branch:t,hash:null,success:!1}}var pI,vq=Y({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";pI=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function mI(t,e){return e===1&&d0.test(t)}var TR,d0,CR,Uh,wq=Y({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";vq(),de(),TR=/(\S+)\s+\(\S+\s([^)]+)\)/,d0=/^error[^']+'([^']+)'/m,CR=[new me(TR,(t,[e,r])=>{let i=mq(e,r);t.all.push(i),t.branches[e]=i}),new me(d0,(t,[e])=>{let r=gq(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],Uh=(t,e)=>$r(new pI,CR,[t,e])}}),gI,yq=Y({"src/lib/responses/BranchSummary.ts"(){"use strict";gI=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,i,n){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:i,label:n}}}}});function PR(t){return t?t.charAt(0):""}function vI(t){return $r(new gI,wI,t)}var wI,bq=Y({"src/lib/parsers/parse-branch.ts"(){"use strict";yq(),de(),wI=[new me(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,i,n])=>{t.push(PR(e),!0,r,i,n)}),new me(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,i,n])=>{t.push(PR(e),!1,r,i,n)})]}}),yI={};vt(yI,{branchLocalTask:()=>xq,branchTask:()=>_q,containsDeleteBranchCommand:()=>bI,deleteBranchTask:()=>Eq,deleteBranchesTask:()=>Sq});function bI(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}function _q(t){let e=bI(t),r=["branch",...t];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(i,n){return e?Uh(i,n).all[0]:vI(i)}}}function xq(){return{format:"utf-8",commands:["branch","-v"],parser:vI}}function Sq(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,i){return Uh(r,i)},onError({exitCode:r,stdOut:i},n,s,a){if(!mI(String(n),r))return a(n);s(i)}}}function Eq(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(i,n){return Uh(i,n).branches[t]},onError({exitCode:i,stdErr:n,stdOut:s},a,o,l){if(!mI(String(a),i))return l(a);throw new Ru(r.parser(Cu(s),Cu(n)),String(a))}};return r}var kq=Y({"src/lib/tasks/branch.ts"(){"use strict";El(),wq(),bq(),de()}}),_I,Aq=Y({"src/lib/responses/CheckIgnore.ts"(){"use strict";_I=t=>t.split(/\n/g).map(e=>e.trim()).filter(e=>!!e)}}),xI={};vt(xI,{checkIgnoreTask:()=>Tq});function Tq(t){return{commands:["check-ignore",...t],format:"utf-8",parser:_I}}var Cq=Y({"src/lib/tasks/check-ignore.ts"(){"use strict";Aq()}}),SI={};vt(SI,{cloneMirrorTask:()=>Rq,cloneTask:()=>EI});function Pq(t){return/^--upload-pack(=|$)/.test(t)}function EI(t,e,r){let i=["clone",...r];return er(t)&&i.push(t),er(e)&&i.push(e),i.find(Pq)?Pr("git.fetch: potential exploit argument blocked."):mr(i)}function Rq(t,e,r){return Oe(r,"--mirror"),EI(t,e,r)}var $q=Y({"src/lib/tasks/clone.ts"(){"use strict";gt(),de()}});function Iq(t,e){return $r({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},kI,[t,e])}var kI,Fq=Y({"src/lib/parsers/parse-fetch.ts"(){"use strict";de(),kI=[new me(/From (.+)$/,(t,[e])=>{t.remote=e}),new me(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new me(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new me(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new me(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,i,n])=>{t.updated.push({name:i,tracking:n,to:r,from:e})})]}}),AI={};vt(AI,{fetchTask:()=>Mq});function Oq(t){return/^--upload-pack(=|$)/.test(t)}function Mq(t,e,r){let i=["fetch",...r];return t&&e&&i.push(t,e),i.find(Oq)?Pr("git.fetch: potential exploit argument blocked."):{commands:i,format:"utf-8",parser:Iq}}var Dq=Y({"src/lib/tasks/fetch.ts"(){"use strict";Fq(),gt()}});function Lq(t){return $r({moves:[]},TI,t)}var TI,Bq=Y({"src/lib/parsers/parse-move.ts"(){"use strict";de(),TI=[new me(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),CI={};vt(CI,{moveTask:()=>Nq});function Nq(t,e){return{commands:["mv","-v",...mn(t),e],format:"utf-8",parser:Lq}}var Hq=Y({"src/lib/tasks/move.ts"(){"use strict";Bq(),de()}}),PI={};vt(PI,{pullTask:()=>Uq});function Uq(t,e,r){let i=["pull",...r];return t&&e&&i.splice(1,0,t,e),{commands:i,format:"utf-8",parser(n,s){return F0(n,s)},onError(n,s,a,o){let l=Yj(Cu(n.stdOut),Cu(n.stdErr));if(l)return o(new Ru(l));o(s)}}}var Gq=Y({"src/lib/tasks/pull.ts"(){"use strict";El(),J$(),de()}});function jq(t){let e={};return RI(t,([r])=>e[r]={name:r}),Object.values(e)}function qq(t){let e={};return RI(t,([r,i,n])=>{e.hasOwnProperty(r)||(e[r]={name:r,refs:{fetch:"",push:""}}),n&&i&&(e[r].refs[n.replace(/[^a-z]/g,"")]=i)}),Object.values(e)}function RI(t,e){m0(t,r=>e(r.split(/\s+/)))}var zq=Y({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";de()}}),$I={};vt($I,{addRemoteTask:()=>Vq,getRemotesTask:()=>Wq,listRemotesTask:()=>Yq,remoteTask:()=>Xq,removeRemoteTask:()=>Zq});function Vq(t,e,r){return mr(["remote","add",...r,t,e])}function Wq(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?qq:jq}}function Yq(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),mr(e)}function Xq(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),mr(e)}function Zq(t){return mr(["remote","remove",t])}var Kq=Y({"src/lib/tasks/remote.ts"(){"use strict";zq(),gt()}}),II={};vt(II,{stashListTask:()=>Qq});function Qq(t={},e){let r=j$(t),i=["stash","list",...r.commands,...e],n=N$(r.splitter,r.fields,T0(i));return Hh(i)||{commands:i,format:"utf-8",parser:n}}var Jq=Y({"src/lib/tasks/stash-list.ts"(){"use strict";Ou(),U$(),I0(),q$()}}),FI={};vt(FI,{addSubModuleTask:()=>ez,initSubModuleTask:()=>tz,subModuleTask:()=>Gh,updateSubModuleTask:()=>rz});function ez(t,e){return Gh(["add",t,e])}function tz(t){return Gh(["init",...t])}function Gh(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),mr(e)}function rz(t){return Gh(["update",...t])}var iz=Y({"src/lib/tasks/sub-module.ts"(){"use strict";gt()}});function nz(t,e){let r=isNaN(t),i=isNaN(e);return r!==i?r?1:-1:r?OI(t,e):0}function OI(t,e){return t===e?0:t>e?1:-1}function sz(t){return t.trim()}function Eh(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}var RR,MI,az=Y({"src/lib/responses/TagList.ts"(){"use strict";RR=class{constructor(t,e){this.all=t,this.latest=e}},MI=function(t,e=!1){let r=t.split(` +`).map(sz).filter(Boolean);e||r.sort(function(n,s){let a=n.split("."),o=s.split(".");if(a.length===1||o.length===1)return nz(Eh(a[0]),Eh(o[0]));for(let l=0,c=Math.max(a.length,o.length);ln.indexOf(".")>=0);return new RR(r,i)}}}),DI={};vt(DI,{addAnnotatedTagTask:()=>cz,addTagTask:()=>lz,tagListTask:()=>oz});function oz(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return MI(r,e)}}}function lz(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function cz(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var uz=Y({"src/lib/tasks/tag.ts"(){"use strict";az()}}),fz=CG({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(hj(),ut(P$)),{SimpleGitApi:i}=(fq(),ut(cI)),{Scheduler:n}=(dq(),ut(uI)),{configurationErrorTask:s}=(gt(),ut(a0)),{asArray:a,filterArray:o,filterPrimitives:l,filterString:c,filterStringOrStringArray:u,filterType:f,getTrailingOptions:d,trailingFunctionArgument:h,trailingOptionsArgument:m}=(de(),ut(QR)),{applyPatchTask:g}=(pq(),ut(hI)),{branchTask:v,branchLocalTask:w,deleteBranchesTask:b,deleteBranchTask:k}=(kq(),ut(yI)),{checkIgnoreTask:x}=(Cq(),ut(xI)),{checkIsRepoTask:E}=(r$(),ut(JR)),{cloneTask:A,cloneMirrorTask:y}=($q(),ut(SI)),{cleanWithOptionsTask:S,isCleanOptionsArray:_}=(h$(),ut(f$)),{diffSummaryTask:T}=(I0(),ut(G$)),{fetchTask:P}=(Dq(),ut(AI)),{moveTask:D}=(Hq(),ut(CI)),{pullTask:B}=(Gq(),ut(PI)),{pushTagsTask:N}=(iI(),ut(rI)),{addRemoteTask:ce,getRemotesTask:Pe,listRemotesTask:ve,remoteTask:se,removeRemoteTask:xe}=(Kq(),ut($I)),{getResetMode:we,resetTask:z}=(k$(),ut(x$)),{stashListTask:Q}=(Jq(),ut(II)),{addSubModuleTask:j,initSubModuleTask:Le,subModuleTask:lr,updateSubModuleTask:Ft}=(iz(),ut(FI)),{addAnnotatedTagTask:Ie,addTagTask:At,tagListTask:Tt}=(uz(),ut(DI)),{straightThroughBufferTask:jt,straightThroughStringTask:Ze}=(gt(),ut(a0));function q(L,V){this._plugins=V,this._executor=new r(L.baseDir,new n(L.maxConcurrentProcesses),V),this._trimmed=L.trimmed}(q.prototype=Object.create(i.prototype)).constructor=q,q.prototype.customBinary=function(L){return this._plugins.reconfigure("binary",L),this},q.prototype.env=function(L,V){return arguments.length===1&&typeof L=="object"?this._executor.env=L:(this._executor.env=this._executor.env||{})[L]=V,this},q.prototype.stashList=function(L){return this._runTask(Q(m(arguments)||{},o(L)&&L||[]),h(arguments))};function Z(L,V,Te,qe){return typeof Te!="string"?s(`git.${L}() requires a string 'repoPath'`):V(Te,f(qe,c),d(arguments))}q.prototype.clone=function(){return this._runTask(Z("clone",A,...arguments),h(arguments))},q.prototype.mirror=function(){return this._runTask(Z("mirror",y,...arguments),h(arguments))},q.prototype.mv=function(L,V){return this._runTask(D(L,V),h(arguments))},q.prototype.checkoutLatestTag=function(L){var V=this;return this.pull(function(){V.tags(function(Te,qe){V.checkout(qe.latest,L)})})},q.prototype.pull=function(L,V,Te,qe){return this._runTask(B(f(L,c),f(V,c),d(arguments)),h(arguments))},q.prototype.fetch=function(L,V){return this._runTask(P(f(L,c),f(V,c),d(arguments)),h(arguments))},q.prototype.silent=function(L){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},q.prototype.tags=function(L,V){return this._runTask(Tt(d(arguments)),h(arguments))},q.prototype.rebase=function(){return this._runTask(Ze(["rebase",...d(arguments)]),h(arguments))},q.prototype.reset=function(L){return this._runTask(z(we(L),d(arguments)),h(arguments))},q.prototype.revert=function(L){let V=h(arguments);return typeof L!="string"?this._runTask(s("Commit must be a string"),V):this._runTask(Ze(["revert",...d(arguments,0,!0),L]),V)},q.prototype.addTag=function(L){let V=typeof L=="string"?At(L):s("Git.addTag requires a tag name");return this._runTask(V,h(arguments))},q.prototype.addAnnotatedTag=function(L,V){return this._runTask(Ie(L,V),h(arguments))},q.prototype.deleteLocalBranch=function(L,V,Te){return this._runTask(k(L,typeof V=="boolean"?V:!1),h(arguments))},q.prototype.deleteLocalBranches=function(L,V,Te){return this._runTask(b(L,typeof V=="boolean"?V:!1),h(arguments))},q.prototype.branch=function(L,V){return this._runTask(v(d(arguments)),h(arguments))},q.prototype.branchLocal=function(L){return this._runTask(w(),h(arguments))},q.prototype.raw=function(L){let V=!Array.isArray(L),Te=[].slice.call(V?arguments:L,0);for(let Ot=0;Ott.removeEventListener("abort",s))}}]:void 0}function pz(t){return typeof t=="string"&&t.trim().toLowerCase()==="-c"}function mz(t,e){if(pz(t)&&/^\s*protocol(.[a-z]+)?.allow/.test(e))throw new Kn(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function gz(t,e){if(/^\s*--(upload|receive)-pack/.test(t))throw new Kn(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(e==="clone"&&/^\s*-u\b/.test(t))throw new Kn(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(e==="push"&&/^\s*--exec\b/.test(t))throw new Kn(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function vz({allowUnsafeProtocolOverride:t=!1,allowUnsafePack:e=!1}={}){return{type:"spawn.args",action(r,i){return r.forEach((n,s)=>{let a=se0(n))).then(a.done)}return{type:"spawn.after",async action(n,{spawned:s,close:a}){var u,f;let o=r(),l=!0,c=()=>void(l=!1);(u=s.stdout)==null||u.on("data",c),(f=s.stderr)==null||f.on("data",c),s.on("error",c),s.on("close",d=>o.close(d)),s.on("exit",d=>o.exit(d));try{await o.result,l&&await e0(50),a(o.exitCode)}catch(d){a(o.exitCode,d)}}}}de();var bz="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",IR="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function _z(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(t)}function FR(t,e){if(t.length<1||t.length>2)throw new Kn(void 0,"binary",bz);if(t.some(_z))if(e)console.warn(IR);else throw new Kn(void 0,"binary",IR);let[i,n]=t;return{binary:i,prefix:n}}function xz(t,e=["git"],r=!1){let i=FR(mn(e),r);t.on("binary",n=>{i=FR(mn(n),r)}),t.append("spawn.binary",()=>i.binary),t.append("spawn.args",n=>i.prefix?[i.prefix,...n]:n)}zs();function Sz(t){return!!(t.exitCode&&t.stdErr.length)}function Ez(t){return Buffer.concat([...t.stdOut,...t.stdErr])}function kz(t=!1,e=Sz,r=Ez){return(i,n)=>!t&&i||!e(n)?i:r(n)}function OR(t){return{type:"task.error",action(e,r){let i=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(i)?{error:new Rr(void 0,i.toString("utf-8"))}:{error:i}}}}de();var Az=class{constructor(){this.plugins=new Set,this.events=new LI.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=Oe(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return mn(t).forEach(r=>r&&this.plugins.add(Oe(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let i=e,n=Object.freeze(Object.create(r));for(let s of this.plugins)s.type===t&&(i=s.action(i,n));return i}};de();function Tz(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,a){return r.includes(a.method)?GR(s,e):s}},{type:"spawn.after",action(s,a){var o;a.commands.includes(e)&&((o=a.spawned.stderr)==null||o.on("data",l=>{let c=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));c&&t({method:a.method,stage:Cz(c[1]),progress:Ve(c[2]),processed:Ve(c[3]),total:Ve(c[4])})}))}}]}function Cz(t){return String(t.toLowerCase().split(" ",1))||"unknown"}de();function Pz(t){let e=zR(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}function Rz({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(i,n){var c,u;let s;function a(){s&&clearTimeout(s),s=setTimeout(l,t)}function o(){var f,d;(f=n.spawned.stdout)==null||f.off("data",a),(d=n.spawned.stderr)==null||d.off("data",a),n.spawned.off("exit",o),n.spawned.off("close",o),s&&clearTimeout(s)}function l(){o(),n.kill(new Kn(void 0,"timeout","block timeout reached"))}r&&((c=n.spawned.stdout)==null||c.on("data",a)),e&&((u=n.spawned.stderr)==null||u.on("data",a)),n.spawned.on("exit",o),n.spawned.on("close",o),a()}}}Pu();function $z(){return{type:"spawn.args",action(t){let e=[],r;function i(n){(r=r||[]).push(...n)}for(let n=0;nCh(a)&&nR(a)||a));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}de();var Iz=fz();function Fz(t,e){var n;let r=new Az,i=ZR(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!g0(i.baseDir))throw new dz(i,"Cannot use simple-git on a directory that does not exist");return Array.isArray(i.config)&&r.add(wz(i.config)),r.add(vz(i.unsafe)),r.add($z()),r.add(yz(i.completion)),i.abort&&r.add(hz(i.abort)),i.progress&&r.add(Tz(i.progress)),i.timeout&&r.add(Rz(i.timeout)),i.spawnOptions&&r.add(Pz(i.spawnOptions)),r.add(OR(kz(!0))),i.errors&&r.add(OR(i.errors)),xz(r,i.binary,(n=i.unsafe)==null?void 0:n.allowUnsafeCustomBinary),new Iz(i,r)}El();var BI=Fz;var Se=class extends vl{constructor(r){super(r);this.useDefaultWindowsGitPath=!1}async setGitInstance(r=!1){var i;if(await this.isGitInstalled()){let n=this.app.vault.adapter,s=n.getBasePath(),a=s;this.plugin.settings.basePath&&(await n.exists((0,Qn.normalizePath)(this.plugin.settings.basePath))?a=Ge.join(s,this.plugin.settings.basePath):r||new Qn.Notice("ObsidianGit: Base path does not exist")),this.absoluteRepoPath=a,this.git=BI({baseDir:a,binary:this.plugin.localStorage.getGitPath()||(this.useDefaultWindowsGitPath?Nd:void 0),config:["core.quotepath=off"],unsafe:{allowUnsafeCustomBinary:!0}});let o=this.plugin.localStorage.getPATHPaths(),l=this.plugin.localStorage.getEnvVars(),c=this.plugin.settings.gitDir;if(o.length>0){let v=o.join(":")+":"+process.env.PATH;process.env.PATH=v}c&&(process.env.GIT_DIR=c);for(let v of l){let[w,b]=v.split("=");process.env[w]=b}let u="simple-git",f=",",h=((i=localStorage.debug)!=null?i:"").split(f);if(!h.includes(u)&&!h.includes(`-${u}`)&&(h.push(u),UI.default.enable(h.join(f))),await this.git.checkIsRepo()){let v=await this.git.revparse("--show-cdup"),w=(0,Mu.resolve)(a+Mu.sep+v);this.absoluteRepoPath=w,await this.git.cwd(w)}let m=Ge.join(s,this.app.vault.configDir,"plugins","obsidian-git"),g=Ge.join(m,Ta);process.env.SSH_ASKPASS==null&&(process.env.SSH_ASKPASS=g),process.env.SSH_ASKPASS_REQUIRE="force",process.env.OBSIDIAN_GIT_CREDENTIALS_INPUT=Ge.join(m,Hd),process.env.SSH_ASKPASS==g&&this.askpass().catch(v=>this.plugin.displayError(v))}}getRelativeVaultPath(r){let n=this.app.vault.adapter.getBasePath(),s=Ge.join(this.absoluteRepoPath,r),a=Ge.relative(n,s);return Qn.Platform.isWin&&(a=a.replace(/\\/g,"/")),a}getRelativeRepoPath(r,i=!0){if(i){let s=this.plugin.app.vault.adapter.getBasePath(),a=this.absoluteRepoPath,o=Ge.join(s,r),l=Ge.relative(a,o);return Qn.Platform.isWin&&(l=l.replace(/\\/g,"/")),l}return r}get absPluginConfigPath(){let i=this.app.vault.adapter.getBasePath();return Ge.join(i,this.app.vault.configDir,"plugins","obsidian-git")}get relPluginConfigPath(){return Ge.join(this.app.vault.configDir,"plugins","obsidian-git")}async askpass(){let r=this.app.vault.adapter,i=this.app.vault.configDir+"/plugins/obsidian-git/";await this.addAskPassScriptToExclude(),await ei.writeFile(Ge.join(this.absPluginConfigPath,Ta),GA),await ei.chmod(Ge.join(this.absPluginConfigPath,Ta),493),this.watchAbortController=new AbortController;let{signal:n}=this.watchAbortController;try{let s=ei.watch(this.absPluginConfigPath,{signal:n});for await(let a of s){if(a.filename!=Hd)continue;let o=i+Hd;if(await new Promise(f=>setTimeout(f,200)),!await r.exists(o))continue;let l=await r.read(o),c;l.length>60&&(c=new Qn.Notice(l,999999));let u=await new Qe(this.plugin,{allowEmpty:!0,obscure:!0,placeholder:l.length>60?"Enter a response to the message.":l}).openAndGetResult();c==null||c.hide(),await r.exists(o)&&await r.write(`${o}.response`,u!=null?u:"")}}catch(s){this.plugin.displayError(s),await ei.rm(Ge.join(this.absPluginConfigPath,Ta),{force:!0}),await ei.rm(Ge.join(this.absPluginConfigPath,`${Ta}.response`),{force:!0}),await new Promise(a=>setTimeout(a,5e3)),this.plugin.log("Retry watch for ask pass"),await this.askpass()}}async addAskPassScriptToExclude(){try{if(!await this.git.checkIsRepo())return;let r=await this.git.revparse(["--path-format=absolute","--git-path","info/exclude"]),i=Ge.join(this.app.vault.configDir,"plugins","obsidian-git",Ta),n=this.getRelativeRepoPath(i,!0);(await ei.readFile(r,"utf-8")).split(` +`).some(l=>l.contains(n))||await ei.appendFile(r,n+` +`)}catch(r){console.error("Error while adding askpass script to exclude file:",r)}}unload(){var r;(r=this.watchAbortController)==null||r.abort()}async status(r){let i=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let n=await this.git.status(i!=null?["--",i]:[]);this.plugin.setPluginState({gitAction:0});let s=n.files.map(a=>{let o=this.formatPath(a);return{path:o.path,from:o.from,index:a.index==="?"?"U":a.index,workingDir:a.working_dir==="?"?"U":a.working_dir,vaultPath:this.getRelativeVaultPath(o.path)}});return{all:s,changed:s.filter(a=>a.workingDir!==" "),staged:s.filter(a=>a.index!==" "&&a.index!="U"),conflicted:n.conflicted.map(a=>this.formatPath({path:a}).path)}}async submoduleAwareHeadRevisonInContainingDirectory(r){let i=this.getRelativeRepoPath(r),s=["-C",Ge.dirname(i),"rev-parse","HEAD"],a=this.git.raw(s);return a.catch(o=>console.warn("obsidian-git: rev-parse error:",o)),(await a).trim()}async getSubmodulePaths(){return new Promise(r=>{this.git.outputHandler((i,n,s,a)=>{if(!(a.contains("submodule")&&a.contains("foreach")))return;let o="",l=this.app.vault.adapter.getBasePath()+(this.plugin.settings.basePath?"/"+this.plugin.settings.basePath:"");n.on("data",c=>{o+=c.toString("utf8")}),n.on("end",()=>{let u=o.split(` +`).map(f=>{let d=f.match(/'([^']*)'/);if(d!=null)return l+"/"+d[1]+Mu.sep}).filter(f=>!!f);u.reverse(),r(u)})}),this.git.subModule(["foreach","--recursive",""]).then(()=>{this.git.outputHandler(()=>{})},i=>this.plugin.displayError(i))})}formatPath(r){function i(n){if(n!=null)return n.startsWith('"')&&n.endsWith('"')?n.substring(1,n.length-1):n}return r.from!=null?{from:i(r.from),path:i(r.path)}:{path:i(r.path)}}async blame(r,i,n){if(r=this.getRelativeRepoPath(r),!await this.isTracked(r))return"untracked";let s=await this.getSubmoduleOfFile(r),a=s?["-C",s.submodule]:[],o=s?s.relativeFilepath:r;a.push("blame","--porcelain"),n&&a.push("-w");let l=`-C${Bd}`;switch(i){case"inactive":break;case"same-commit":a.push("-C",l);break;case"all-commits":a.push("-C","-C",l);break;default:Gs(i)}a.push("--",o);let c=await this.git.raw(a);return Oz(c)}async isTracked(r){let i=await this.getSubmoduleOfFile(r),n=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:r;return n.push("ls-files","--",s),this.git.raw(n).then(a=>a.trim()!=="")}async commitAll({message:r}){if(this.plugin.settings.updateSubmodules){this.plugin.setPluginState({gitAction:4});let n=await this.getSubmodulePaths();for(let s of n)await this.git.cwd({path:s,root:!1}).add("-A"),await this.git.cwd({path:s,root:!1}).commit(await this.formatCommitMessage(r))}this.plugin.setPluginState({gitAction:3}),await this.git.add("-A"),this.plugin.setPluginState({gitAction:4});let i=await this.git.commit(await this.formatCommitMessage(r));return this.app.workspace.trigger("obsidian-git:head-change"),i.summary.changes}async commit({message:r,amend:i}){this.plugin.setPluginState({gitAction:4});let n=(await this.git.commit(await this.formatCommitMessage(r),i?["--amend"]:[])).summary.changes;return this.app.workspace.trigger("obsidian-git:head-change"),this.plugin.setPluginState({gitAction:0}),n}async stage(r,i){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.git.add(["--",r]),this.plugin.setPluginState({gitAction:0})}async stageAll({dir:r}){this.plugin.setPluginState({gitAction:3}),await this.git.add(r!=null?r:"-A"),this.plugin.setPluginState({gitAction:0})}async unstageAll({dir:r}){this.plugin.setPluginState({gitAction:3}),await this.git.reset(r!=null?["--",r]:[]),this.plugin.setPluginState({gitAction:0})}async unstage(r,i){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.git.reset(["--",r]),this.plugin.setPluginState({gitAction:0})}async discard(r){this.plugin.setPluginState({gitAction:3}),await this.isTracked(r)&&await this.git.checkout(["--",r]),this.plugin.setPluginState({gitAction:0})}async applyPatch(r){let i=Ge.join(this.relPluginConfigPath,"patch");await this.app.vault.adapter.write(i,r),await this.git.applyPatch(i,{"--cached":null,"--unidiff-zero":null,"--whitespace":"nowarn"}),await this.app.vault.adapter.remove(i)}async getUntrackedPaths(r){let i=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let n=[];i!=null&&n.push("--",i);let s=await this.git.clean(Fa.RECURSIVE+Fa.DRY_RUN,n);return this.plugin.setPluginState({gitAction:0}),s.paths}async hashObject(r){r=this.getRelativeRepoPath(r);let i=await this.getSubmoduleOfFile(r),n=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:r;return n.push("hash-object","--",s),this.git.raw(n)}async discardAll({dir:r}){return this.discard(r!=null?r:".")}async pull(){this.plugin.setPluginState({gitAction:2});try{this.plugin.settings.updateSubmodules&&await this.git.subModule(["update","--remote","--merge","--recursive"]);let r=await this.branchInfo(),i=await this.git.revparse([r.current]);if(!r.tracking&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring pull of main repo and updating submodules only.");return}await this.git.fetch();let n=await this.git.revparse([r.tracking]);if(i!==n){if(this.plugin.settings.syncMethod==="merge"||this.plugin.settings.syncMethod==="rebase")try{let o=[r.tracking];switch(this.plugin.settings.mergeStrategy!=="none"&&o.push(`--strategy-option=${this.plugin.settings.mergeStrategy}`),this.plugin.settings.syncMethod){case"merge":await this.git.merge(o);break;case"rebase":await this.git.rebase(o)}}catch(o){this.plugin.displayError(`Pull failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`);return}else if(this.plugin.settings.syncMethod==="reset")try{await this.git.raw(["update-ref",`refs/heads/${r.current}`,n]),await this.unstageAll({})}catch(o){this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`)}this.app.workspace.trigger("obsidian-git:head-change");let s=await this.git.revparse([r.current]);return(await this.git.diff([`${i}..${s}`,"--name-only"])).split(/\r\n|\r|\n/).filter(o=>o.length>0).map(o=>({path:o,workingDir:"P",vaultPath:this.getRelativeVaultPath(o)}))}else return[]}catch(r){this.convertErrors(r)}}async push(){this.plugin.setPluginState({gitAction:5});try{if(this.plugin.settings.updateSubmodules){let a=await this.git.env({...process.env,OBSIDIAN_GIT:1}).subModule(["foreach","--recursive",`tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`]);console.log(a)}let r=await this.git.status(),i=r.tracking,n=r.current;if(!i&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring push of main repo and updating submodules only.");return}let s=null;return i&&(s=(await this.git.diffSummary([n,i,"--"])).changed),await this.git.env({...process.env,OBSIDIAN_GIT:1}).push(),s}catch(r){this.convertErrors(r)}}async getUnpushedCommits(){let r=await this.git.status(),i=r.tracking,n=r.current;if(i==null||n==null)return 0;let[s,a]=Zn(i);return(await this.getRemoteBranches(s)).includes(i)?(await this.git.diffSummary([n,i,"--"])).changed:(this.plugin.log(`Tracking branch ${i} does not exist on remote ${s}.`),0)}async canPush(){if(this.plugin.settings.updateSubmodules===!0)return!0;let r=await this.git.status(),i=r.tracking,n=r.current;return i?(await this.git.diffSummary([n,i,"--"])).changed!==0:!1}async checkRequirements(){return await this.isGitInstalled()?await this.git.checkIsRepo()?"valid":"missing-repo":"missing-git"}async branchInfo(){let r=await this.git.status(),i=await this.git.branch(["--no-color"]);return{current:r.current||void 0,tracking:r.tracking||void 0,branches:i.all}}async getRemoteUrl(r){try{return await this.git.remote(["get-url",r])||void 0}catch(i){if(String(i).contains(r))return;throw i}}async log(r,i=!0,n,s){let a;r&&(a=this.getRelativeRepoPath(r,i));let o={file:a,maxCount:n,"--diff-merges":"first-parent","--name-status":null};return s&&(o[s]=null),(await this.git.log(o)).all.map(c=>{var u,f,d,h;return{...c,author:{name:c.author_name,email:c.author_email},refs:c.refs.split(", ").filter(m=>m.length>0),diff:{...c.diff,files:(f=(u=c.diff)==null?void 0:u.files.map(m=>({...m,status:m.status,path:m.file,hash:c.hash,vaultPath:this.getRelativeVaultPath(m.file),fromPath:m.from,fromVaultPath:m.from!=null?this.getRelativeVaultPath(m.from):void 0,binary:m.binary})))!=null?f:[]},fileName:(h=(d=c.diff)==null?void 0:d.files.first())==null?void 0:h.file}})}async show(r,i,n=!0){let s=this.getRelativeRepoPath(i,n);return this.git.show([r+":"+s])}async checkout(r,i){if(i&&(r=`${i}/${r}`),await this.git.checkout(r),this.plugin.settings.submoduleRecurseCheckout){let n=await this.getSubmodulePaths();for(let s of n){let a=await this.git.cwd({path:s,root:!1}).branch();Object.keys(a.branches).includes(r)&&await this.git.cwd({path:s,root:!1}).checkout(r)}}}async createBranch(r){await this.git.checkout(["-b",r])}async deleteBranch(r,i){await this.git.branch([i?"-D":"-d",r])}async branchIsMerged(r){return!(await this.git.branch(["--no-merged"])).all.contains(r)}async init(){await this.git.init(!1)}async clone(r,i,n){await this.git.clone(r,Ge.join(this.app.vault.adapter.getBasePath(),i),n?["--depth",`${n}`]:[]),await this.setGitInstance()}async setConfig(r,i){i==null?await this.git.raw(["config","--local","--unset",r]):await this.git.addConfig(r,i)}async getConfig(r,i="local"){let n;i=="all"?n=await this.git.listConfig():n=await this.git.listConfig(i);let s=n.all[r.toLowerCase()];if(typeof s=="string"||s==null)return s;throw new Error("Config value is not a string")}async fetch(r){await this.git.fetch(r!=null?[r]:[])}async setRemote(r,i){(await this.getRemotes()).includes(r)?await this.git.remote(["set-url",r,i]):await this.git.remote(["add",r,i])}async getRemoteBranches(r){let i=await this.git.branch(["-r","--list",`${r}*`]),n=[];for(let s in i.branches)n.push(i.branches[s].name);return n}async getRemotes(){let r=await this.git.remote([]);return r?r.trim().split(` +`):[]}async removeRemote(r){await this.git.removeRemote(r)}async updateUpstreamBranch(r){try{await this.git.branch(["--set-upstream-to",r])}catch(i){try{await this.git.branch(["--set-upstream",r])}catch(n){let[s,a]=Zn(r),o=await this.branchInfo();await this.git.push(["--set-upstream",s,`${o.current}:${a}`])}}}updateGitPath(r){return this.setGitInstance()}updateBasePath(r){return this.setGitInstance(!0)}async getDiffString(r,i=!1,n){return i?await this.git.diff(["--cached","--",r]):n?await this.git.show([`${n}`,"--",r]):await this.git.diff(["--",r])}async diff(r,i,n){return await this.git.diff([`${i}..${n}`,"--",r])}async rawCommand(r){let i=r.split(" ");return await this.git.raw(i[0],...i.slice(1))}async getSubmoduleOfFile(r){if(!await this.app.vault.adapter.exists(Ge.dirname(r)))return;let i=await this.git.raw(["-C",Ge.dirname(r),"rev-parse","--show-toplevel"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message));if(i=i.trim(),(await this.git.raw(["-C",Ge.dirname(r),"rev-parse","--show-superproject-working-tree"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message))).trim()==="")return;let a=this.app.vault.adapter.getFullPath(Ge.normalize(r)),o=Ge.relative(i,a);return{submodule:i,relativeFilepath:o}}async getLastCommitTime(){try{let r=await this.git.log({n:1});if(r!=null&&r.latest!=null)return new Date(r.latest.date)}catch(r){if(r instanceof Rr){if(r.message.contains("does not have any commits yet"))return}else throw r}}async isGitInstalled(){let r=this.plugin.localStorage.getGitPath(),i=await ku(r||"git",["--version"],{});if(i.error)if(Qn.Platform.isWin&&!r){this.plugin.log(`Git not found in PATH. Checking standard installation path(${Nd}) of Git for Windows.`);let n=await ku(Nd,["--version"]);if(n.error)return console.error(n.error),!1;this.useDefaultWindowsGitPath=!0}else return console.error(i.error),!1;else this.useDefaultWindowsGitPath=!1;return!0}convertErrors(r){if(r instanceof Rr){let i=String(r.message);if(i.contains("Could not resolve host")||i.contains("Unable to resolve host")||i.contains("Unable to open connection")||i.match(/ssh: connect to host .*? port .*?: Operation timed out/)!=null||i.match(/ssh: connect to host .*? port .*?: Network is unreachable/)!=null||i.match(/ssh: connect to host .*? port .*?: Undefined error: 0/)!=null)throw new cl(i)}throw r}async isFileTrackedByLFS(r){try{return(await this.git.raw(["check-attr","filter",r])).includes("filter: lfs")}catch(i){let n=i instanceof Error?i.message:String(i);return this.plugin.displayError(`Error checking LFS status: ${n}`),!1}}},GI={hash:"000000",isZeroCommit:!0,summary:""};function Oz(t){let r=t.replace(`\r +`,` +`).split(` +`),i={commits:new Map,hashPerLine:[void 0],originalFileLineNrPerLine:[void 0],finalFileLineNrPerLine:[void 0],groupSizePerStartingLine:new Map},n=1;for(let s=0;s=4&&r.groupSizePerStartingLine.set(e,parseInt(t[3])),parseInt(t[2])!==e)throw Error(`git-blame output is out of order: ${e} vs ${t[2]}`);return i}function Dz(t,e,r){let i=t[0],n=t.slice(1).join(" "),s=e.hashPerLine[r],a=e.commits.get(s)||{hash:s,author:{},committer:{},previous:{}};switch(i){case"summary":a.summary=n;break;case"author":a.author.name=n;break;case"author-mail":a.author.email=HI(n);break;case"author-time":a.author.epochSeconds=parseInt(n);break;case"author-tz":a.author.tz=n;break;case"committer":a.committer.name=n;break;case"committer-mail":a.committer.email=HI(n);break;case"committer-time":a.committer.epochSeconds=parseInt(n);break;case"committer-tz":a.committer.tz=n;break;case"previous":a.previous.commitHash=n;break;case"filename":a.previous.filename=n;break}e.commits.set(s,a)}function Lz(t){if(t.summary===void 0)throw Error(`Summary not provided for commit: ${t.hash}`);D0(t.author)&&(t.author=void 0),D0(t.committer)&&(t.committer=void 0),D0(t.previous)&&(t.previous=void 0),t.isZeroCommit=!!t.hash.match(/^0*$/)}function D0(t){return!t||Object.keys(t).length===0}function NI(t){return t.length>0&&t[0].trim()===t[0]}function HI(t){let e=t.startsWith("<")?t.substring(1):t;return e.endsWith(">")?e.substring(0,e.length-1):e}p();var hF=require("@codemirror/state");p();var L0=class{constructor(){this.eventsPerFilepath=new Map;this.startRemoveStalesSubscribersInterval()}ifFilepathDefinedTransformSubscribers(e,r){if(e)return this.ensureInitialized(e),r(this.eventsPerFilepath.get(e))}forEachSubscriber(e){this.eventsPerFilepath.forEach(r=>r.forEach(e))}ensureInitialized(e){this.eventsPerFilepath.get(e)||this.eventsPerFilepath.set(e,new Set)}startRemoveStalesSubscribersInterval(){this.removeStalesSubscribersTimer=window.setInterval(()=>this==null?void 0:this.forEachSubscriber(e=>e==null?void 0:e.removeIfStale()),6e4)}clear(){window.clearInterval(this.removeStalesSubscribersTimer),this.eventsPerFilepath.clear()}},Jn=new L0;p();var qh=require("@codemirror/state"),jI=Mt(B0());function qI(t,e,r){if(!(t===void 0||e===void 0||r===void 0))return`head${t}-obj${e}-path${r}`}var zI=qh.StateEffect.define();function VI(t,e,r){return r.update({effects:zI.of({key:t,la:e,lineOffsetsFromUnsavedChanges:new Map})})}var kl=qh.StateField.define({create:t=>{},update:(t,e)=>{for(let r of e.effects)if(r.is(zI))return r.value;return Bz(e,t)},compare:(t,e)=>(t==null?void 0:t.key)===(e==null?void 0:e.key)});function zh(t){var s;let e=jI.sha256.create();if(!t)return e;let{la:r,key:i,lineOffsetsFromUnsavedChanges:n}=t;e.update(r==="untracked"?"t":"f"),e.update(i);for(let[a,o]of(s=n.entries())!=null?s:[])e.update([a,o]);return e}var wi={get:void 0,save:void 0};function WI(t,e){wi.get=t,wi.save=e}function Vh(t){var e,r;return(r=(e=jh(t.coloringMaxAge))==null?void 0:e.asDays())!=null?r:jh(rt.lineAuthor.coloringMaxAge).asDays()}function Bz(t,e){if(e)return t.changes.empty||t.changes.iterChanges((r,i,n,s)=>{var m;let a=t.startState.doc,{newDoc:o}=t,l=a.lineAt(r).number,c=a.lineAt(i).number,u=o.lineAt(n).number,f=o.lineAt(s).number,d=c-l+1,h=f-u+1;for(let g=u;g<=f;g++){let v=(m=e.lineOffsetsFromUnsavedChanges.get(g))!=null?m:0,w=f===g,b=h-d;w&&(v+=b),e.lineOffsetsFromUnsavedChanges.set(g,v)}}),e}p();function YI(){Al=void 0,N0=[],Wh=0,Xh.clear(),Zh.clear(),Tl.clear()}var Al,Yh=()=>Al;function XI(t,e){var n;let r=e.length;if(r<((n=Al==null?void 0:Al.length)!=null?n:0))return;Al={gutter:t,length:r,text:e};let i=wi.get();r!==i.gutterSpacingFallbackLength&&(i.gutterSpacingFallbackLength=r,wi.save(i))}var N0=[],Nz=15,Wh=0;function ZI(t){N0[Wh]=t,Wh=(Wh+1)%Nz}function KI(){return NP(N0)}var Xh=new Map,Zh=new Map,Tl=new Set;p();var uF=require("@codemirror/state"),fF=require("@codemirror/view");p();var j0=require("@codemirror/view"),aF=Mt(B0()),Cl=require("obsidian");p();p();var Kh={x:-10,y:-10};function QI(){Kh.x===-10&&window.addEventListener("mousedown",t=>{Kh.x=t.clientX,Kh.y=t.clientY})}function JI(){for(let t of Tl)if(Hz(t,Kh))return t}function Hz(t,e){let{x:r,y:i,width:n,height:s}=t.getBoundingClientRect();return r<=e.x&&e.x<=r+n&&i<=e.y&&e.y<=i+s}var eF="data-commit";function tF(t,e,r){if(e.hasFocus())return;let i=JI();if(!i)return;let n=Gz(i);n&&(!n.isZeroCommit&&!n.isWaitingGutter&&Uz(n,t),H0("showCommitHash",t),H0("authorDisplay",t),H0("dateTimeFormatOptions",t))}function Uz(t,e){e.addItem(r=>r.setTitle("Copy commit hash").setIcon("copy").setSection("obs-git-line-author-copy").onClick(i=>navigator.clipboard.writeText(t.hash)))}function H0(t,e){var l,c;let r,i,n=Fi.plugin.settings.lineAuthor,s=n[t],a=typeof s=="boolean"?s:s!=="hide",o=rt.lineAuthor[t];if(t==="showCommitHash")r="Show commit hash",i=s;else if(t==="authorDisplay"){let u=(l=n.lastShownAuthorDisplay)!=null?l:o;r="Show author "+(a?s:u),i=a?"hide":u}else if(t==="dateTimeFormatOptions"){let u=(c=n.lastShownDateTimeFormatOptions)!=null?c:o;r="Show "+(a?s:u),r+=r.contains("date")?"":" date",i=a?"hide":u}else Gs(t);e.addItem(u=>u.setTitle(r).setSection("obs-git-line-author-configure").setChecked(a).onClick(f=>{var d,h;return(h=(d=Fi.plugin)==null?void 0:d.settingsTab)==null?void 0:h.lineAuthorSettingHandler(t,i)}))}function rF(t,e,r){r.setAttr(eF,JSON.stringify({hash:t.hash,isZeroCommit:t.isZeroCommit,isWaitingGutter:e}))}function Gz(t){let e=t.getAttr(eF);return e?JSON.parse(e):void 0}p();function Jh(t,e){return t==="oldest"?Qh(0,!1,e).color:Qh(void 0,!0,e).color}function Qh(t,e,r){let i=Vh(r),n=Date.now()/1e3,s=t!=null?t:0,o=(e?0:n-s)/60/60/24,l=Math.pow(Math.clamp(o/i,0,1),1/2.3),c=jz(),u=r.colorNew,f=r.colorOld,d=c?.4:1,h=U0(u.r,f.r,l)*d,m=U0(u.g,f.g,l)*d,g=U0(u.b,f.b,l)*d;return{color:`rgba(${h},${m},${g},${c?.75:.25})`,daysSinceCommit:o}}function U0(t,e,r){return t+(e-t)*r}function jz(){var t;return((t=window.app)==null?void 0:t.getTheme())==="obsidian"}function iF(t){document.body.style.setProperty("--obs-git-gutter-text",t.textColorCss)}p();function nF(t,e,r){let i;for(let n=e;n<=r;n++){let s=t.hashPerLine[n],a=t.commits.get(s);(!i||a.isZeroCommit||qz(a,i))&&(i=a)}return i}function qz(t,e){var n,s,a,o;let r=(s=(n=t.author)==null?void 0:n.epochSeconds)!=null?s:0,i=(o=(a=e.author)==null?void 0:a.epochSeconds)!=null?o:0;return r>i}var sF="-",zz="+",Vz=3,Wz="*",Yz=/\S/g,Xz="%",Pl=class t extends j0.GutterMarker{constructor(r){super();this.text=r}eq(r){return r instanceof t&&this.text===r.text}toDOM(){return document.createTextNode(this.text)}destroy(r){}},G0=class extends j0.GutterMarker{constructor(r,i,n,s,a,o){super();this.lineAuthoring=r;this.startLine=i;this.endLine=n;this.key=s;this.settings=a;this.options=o;this.point=!1;this.elementClass="obs-git-blame-gutter"}eq(r){return this.key===(r==null?void 0:r.key)&&this.startLine===(r==null?void 0:r.startLine)&&this.endLine===(r==null?void 0:r.endLine)&&(this==null?void 0:this.options)===(r==null?void 0:r.options)}toDOM(){var r;return this.precomputedDomProvider=(r=this.precomputedDomProvider)!=null?r:this.computeDom(),this.precomputedDomProvider()}destroy(r){r&&(document.body.contains(r)||Tl.delete(r))}computeDom(){let r=nF(this.lineAuthoring,this.startLine,this.endLine),i=r.isZeroCommit?"":this.renderNonZeroCommit(r);return!r.isZeroCommit&&this.options!=="waiting-for-result"?XI(this,i):i=this.adaptTextForFakeCommit(r,i,this.options),this.createHtmlNode(r,i,this.options==="waiting-for-result")}createHtmlNode(r,i,n){var c,u,f,d,h,m;let s=window.createDiv();s.setText(i);let{color:a,daysSinceCommit:o}=Qh((c=r==null?void 0:r.author)==null?void 0:c.epochSeconds,r==null?void 0:r.isZeroCommit,this.settings);s.style.backgroundColor=a,s.setAttribute("data-author",(f=(u=r==null?void 0:r.author)==null?void 0:u.name)!=null?f:""),s.setAttribute("data-author-email",(h=(d=r==null?void 0:r.author)==null?void 0:d.email)!=null?h:""),(0,Cl.setTooltip)(s,(m=r==null?void 0:r.summary)!=null?m:""),rF(r,n,s);function l(){let g=s.cloneNode(!0);return Tl.add(g),n||ZI(o),g}return l}renderNonZeroCommit(r){let i=this.settings.showCommitHash?this.renderHash(r):"",n=this.settings.authorDisplay==="hide"?"":`${this.renderAuthorName(r,this.settings.authorDisplay)}`,s=this.settings.dateTimeFormatOptions==="hide"?"":`${this.renderAuthoringDate(r,this.settings.dateTimeFormatOptions,this.settings.dateTimeFormatCustomString,this.settings.dateTimeTimezone)}`;return[i,n,s].filter(o=>o.length>=1).join(" ")}renderHash(r){return r.hash.substring(0,6)}renderAuthorName(r,i){var o,l,c,u;let n=(l=(o=r==null?void 0:r.author)==null?void 0:o.name)!=null?l:"",s=n.split(" ").filter(f=>f.length>=1),a;switch(i){case"initials":a=s.map(f=>f[0].toUpperCase()).join("");break;case"first name":a=(c=s.first())!=null?c:sF;break;case"last name":a=(u=s.last())!=null?u:sF;break;case"full":a=n;break;default:return Gs(i)}return HP(r==null?void 0:r.author,r==null?void 0:r.committer)||(a=a+Wz),a}renderAuthoringDate(r,i,n,s){var c;let a="?";if(((c=r==null?void 0:r.author)==null?void 0:c.epochSeconds)===void 0)return a;let o;switch(i){case"date":o=Ld;break;case"datetime":o=Sv;break;case"custom":o=n;break;case"natural language":o=u=>{let f=u.diff((0,Cl.moment)());return Cl.moment.duration(f).humanize(!0)};break;default:return Gs(i)}let l=Cl.moment.unix(r.author.epochSeconds);switch(s){case"viewer-local":break;case"author-local":l=l.utcOffset(r.author.tz),typeof o=="string"&&(o+=" Z");break;case"utc0000":l=l.utc(),typeof o=="string"&&(o+="[Z]");break;default:return Gs(s)}return typeof o=="string"?l.format(o):o(l)}adaptTextForFakeCommit(r,i,n){var l,c,u,f;let s=(c=(l=Yh())==null?void 0:l.text)!=null?c:i,a=n!=="waiting-for-result"&&r.isZeroCommit?zz:Xz;i=s.replace(Yz,a);let o=(f=(u=wi.get())==null?void 0:u.gutterSpacingFallbackLength)!=null?f:i.length;if(i=UP(i,o,a),n!=="waiting-for-result"&&r.isZeroCommit){let d=Math.min(o,Vz);i=GP(i,o-d)}return i}};function Da(t,e,r,i,n,s){let a=aF.sha256.create();a.update(JSON.stringify(n)),a.update(`s${e}-e${r}-k${i}-o${s}`);let o=a.hex(),l=Xh.get(o);if(l)return l;let c=new G0(t,e,r,i,n,s);return Xh.set(o,c),c}p();var oF=require("obsidian");function q0(){var e,r;let t=(r=(e=wi.get())==null?void 0:e.gutterSpacingFallbackLength)!=null?r:rt.lineAuthor.gutterSpacingFallbackLength;return new Pl(Array(t).fill("-").join(""))}function z0(t){let{lineAuthoring:e,ageForInitialRender:r}=Zz(t);return Da(e,1,1,"initialGutter"+r,t,"waiting-for-result")}function Zz(t){var s;let e=(s=KI())!=null?s:Vh(t)*.25,r=(0,oF.moment)().add(-e,"days"),i={name:"",epochSeconds:BP(r),tz:"+0000"},n={hash:"waiting-for-result",author:i,committer:i,isZeroCommit:!1};return{lineAuthoring:{hashPerLine:[void 0,"waiting-for-result"],commits:new Map([["waiting-for-result",n]])},ageForInitialRender:e}}p();function lF(t,e){return Da({hashPerLine:[void 0,"000000"],commits:new Map([["000000",GI]])},1,1,t,e)}var V0=new Pl(""),dF=(0,fF.gutter)({class:"line-author-gutter-container",markers(t){let e=t.state.field(kl,!1);return Kz(t,e)},lineMarkerChange(t){let e=zh(t.state.field(kl));return zh(t.startState.field(kl))!==e},renderEmptyElements:!0,initialSpacer:t=>(cF(t),q0()),updateSpacer:(t,e)=>{var r,i;return cF(e.view),(i=(r=Yh())==null?void 0:r.gutter)!=null?i:q0()}});function Kz(t,e){let r=zh(e),i=t.state.doc,n=new Map;for(let u=1;u<=i.lines;u++){let f=i.line(u).from,d=t.lineBlockAt(f).to;n.set(u,[f,d]),r.update([f,d,0])}let s=wi.get();r.update("s"+Object.values(wi).join(","));let a=r.hex(),o=Zh.get(a);if(o)return o;let{result:l,allowCache:c}=Qz(i,n,s,e);return c&&Zh.set(a,l),l}function Qz(t,e,r,i){let n=!0,s=t.lines,a=[];function o(f,d,h){return a.push(h.range(f,d))}let l=Jz(s,i),c=t.length===0,u=t.iterLines(s,s+1).next().value==="";for(let f=1;f<=s;f++){let[d,h]=e.get(f),m=t.lineAt(h).number;if(c){o(d,h,V0);continue}if(f===s&&u){o(d,h,V0);continue}if(i===void 0){o(d,h,z0(r)),n=!1;continue}let{key:g,la:v}=i;if(v==="untracked"){o(d,h,lF(v,r));continue}let w=v.hashPerLine.length-1,b=l[f],k=l[m];if(k&&k>w&&o(d,h,V0),b!==void 0&&jw(1,b,w)&&k!==void 0&&jw(1,k,w)){o(d,h,Da(v,b,k,g,r));continue}if(w<1){o(d,h,z0(r)),n=!1;continue}let x=Math.clamp(b!=null?b:f,1,w),E=Math.clamp(k!=null?k:m,1,w);o(d,h,Da(v,x,E,g+"computing",r,"waiting-for-result"))}return{result:uF.RangeSet.of(a,!0),allowCache:n}}function Jz(t,e){if(!(e!=null&&e.lineOffsetsFromUnsavedChanges))return Array.from(new Array(t+1),n=>n);let r=[void 0],i=0;for(let n=1;n<=t;n++){let s=e.lineOffsetsFromUnsavedChanges.get(n);i+=s!=null?s:0,r[n]=s===void 0?n-i:void 0}return r}function cF(t){t.dom.querySelectorAll(".cm-gutters").forEach(r=>{r!=null&&r.style&&(r.style.marginLeft||(r.style.marginLeft="unset"))})}var ep=class{constructor(e){this.plugin=e;this.lineAuthorings=new Map}async trackChanged(e){return this.trackChangedHelper(e).catch(r=>(console.warn("Git: Error in trackChanged."+r),Promise.reject(r)))}async trackChangedHelper(e){if(e){if(e.path===void 0){console.warn("Git: Attempted to track change of undefined filepath. Unforeseen situation.");return}return this.computeLineAuthorInfo(e.path)}}destroy(){this.lineAuthorings.clear(),YI()}async computeLineAuthorInfo(e){let r=this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform().gitManager,i=await r.submoduleAwareHeadRevisonInContainingDirectory(e),n=await r.hashObject(e),s=qI(i,n,e);if(s!==void 0){if(!this.lineAuthorings.has(s)){let a=await r.blame(e,this.plugin.settings.lineAuthor.followMovement,this.plugin.settings.lineAuthor.ignoreWhitespace);this.lineAuthorings.set(s,a)}this.notifyComputationResultToSubscribers(e,s)}}notifyComputationResultToSubscribers(e,r){Jn.ifFilepathDefinedTransformSubscribers(e,i=>i.forEach(n=>n.notifyLineAuthoring(r,this.lineAuthorings.get(r))))}},pF=hF.Prec.high([kl,dF]);var eV="https://momentjs.com/docs/#/parsing/string-format/",tV="https://publish.obsidian.md/git-doc/Line+Authoring",tp=class extends U.PluginSettingTab{constructor(r,i){super(r,i);this.plugin=i;this.lineAuthorColorSettings=new Map;this.icon="git-pull-request"}get settings(){return this.plugin.settings}display(){let{containerEl:r}=this,i=this.plugin,n;i.settings.differentIntervalCommitAndPush?n="commit":n="commit-and-sync";let s=i.gitReady;r.empty(),s||(r.createEl("p",{text:"Git is not ready. When all settings are correct you can configure commit-sync, etc."}),r.createEl("br"));let a;if(s){new U.Setting(r).setName("Automatic").setHeading(),new U.Setting(r).setName("Split timers for automatic commit and sync").setDesc("Enable to use one interval for commit and another for sync.").addToggle(f=>f.setValue(i.settings.differentIntervalCommitAndPush).onChange(async d=>{i.settings.differentIntervalCommitAndPush=d,await i.saveSettings(),i.automaticsManager.reload("commit","push"),this.refreshDisplayWithDelay()})),new U.Setting(r).setName(`Auto ${n} interval (minutes)`).setDesc(`${i.settings.differentIntervalCommitAndPush?"Commit":"Commit and sync"} changes every X minutes. Set to 0 (default) to disable. (See below setting for further configuration!)`).addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoSaveInterval"}),f.setPlaceholder(String(rt.autoSaveInterval)),f.onChange(async d=>{d!==""?i.settings.autoSaveInterval=Number(d):i.settings.autoSaveInterval=rt.autoSaveInterval,await i.saveSettings(),i.automaticsManager.reload("commit")})}),a=new U.Setting(r).setName(`Auto ${n} after stopping file edits`).setDesc(`Requires the ${n} interval not to be 0. + If turned on, do auto ${n} every ${jP(i.settings.autoSaveInterval)} after stopping file edits. + This also prevents auto ${n} while editing a file. If turned off, it's independent from the last file edit.`).addToggle(f=>f.setValue(i.settings.autoBackupAfterFileChange).onChange(async d=>{i.settings.autoBackupAfterFileChange=d,this.refreshDisplayWithDelay(),await i.saveSettings(),i.automaticsManager.reload("commit")})),this.mayDisableSetting(a,i.settings.setLastSaveToLastCommit),a=new U.Setting(r).setName(`Auto ${n} after latest commit`).setDesc(`If turned on, sets last auto ${n} timestamp to the latest commit timestamp. This reduces the frequency of auto ${n} when doing manual commits.`).addToggle(f=>f.setValue(i.settings.setLastSaveToLastCommit).onChange(async d=>{i.settings.setLastSaveToLastCommit=d,await i.saveSettings(),i.automaticsManager.reload("commit"),this.refreshDisplayWithDelay()})),this.mayDisableSetting(a,i.settings.autoBackupAfterFileChange),a=new U.Setting(r).setName("Auto push interval (minutes)").setDesc("Push commits every X minutes. Set to 0 (default) to disable.").addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoPushInterval"}),f.setPlaceholder(String(rt.autoPushInterval)),f.onChange(async d=>{d!==""?i.settings.autoPushInterval=Number(d):i.settings.autoPushInterval=rt.autoPushInterval,await i.saveSettings(),i.automaticsManager.reload("push")})}),this.mayDisableSetting(a,!i.settings.differentIntervalCommitAndPush),new U.Setting(r).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoPullInterval"}),f.setPlaceholder(String(rt.autoPullInterval)),f.onChange(async d=>{d!==""?i.settings.autoPullInterval=Number(d):i.settings.autoPullInterval=rt.autoPullInterval,await i.saveSettings(),i.automaticsManager.reload("pull")})}),new U.Setting(r).setName(`Auto ${n} only staged files`).setDesc(`If turned on, only staged files are committed on ${n}. If turned off, all changed files are committed.`).addToggle(f=>f.setValue(i.settings.autoCommitOnlyStaged).onChange(async d=>{i.settings.autoCommitOnlyStaged=d,await i.saveSettings()})),new U.Setting(r).setName(`Specify custom commit message on auto ${n}`).setDesc("You will get a pop up to specify your message.").addToggle(f=>f.setValue(i.settings.customMessageOnAutoBackup).onChange(async d=>{i.settings.customMessageOnAutoBackup=d,await i.saveSettings(),this.refreshDisplayWithDelay()})),a=new U.Setting(r).setName(`Commit message on auto ${n}`).setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(f=>{f.setPlaceholder(rt.autoCommitMessage).onChange(async d=>{d===""?i.settings.autoCommitMessage=rt.autoCommitMessage:i.settings.autoCommitMessage=d,await i.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"autoCommitMessage"})}),this.mayDisableSetting(a,i.settings.customMessageOnAutoBackup),new U.Setting(r).setName("Commit message").setHeading();let c=new U.Setting(r).setName("Commit message on manual commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message). Leave empty to require manual input on each commit.");c.addTextArea(f=>{c.addButton(d=>{d.setIcon("reset").setTooltip(`Set to default: "${rt.commitMessage}"`).onClick(()=>{f.setValue(rt.commitMessage),f.onChanged()})}),f.setValue(i.settings.commitMessage),f.onChange(async d=>{i.settings.commitMessage=d,await i.saveSettings()})}),new U.Setting(r).setName("Commit message script").setDesc("A script that is run using 'sh -c' to generate the commit message. May be used to generate commit messages using AI tools. Available placeholders: {{hostname}}, {{date}}.").addText(f=>{f.onChange(async d=>{d===""?i.settings.commitMessageScript=rt.commitMessageScript:i.settings.commitMessageScript=d,await i.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"commitMessageScript"})});let u=new U.Setting(r).setName("{{date}} placeholder format").addMomentFormat(f=>f.setDefaultFormat(i.settings.commitDateFormat).setValue(i.settings.commitDateFormat).onChange(async d=>{i.settings.commitDateFormat=d,await i.saveSettings()}));u.descEl.innerHTML=` + Specify custom date format. E.g. "${Ev}. See Moment.js for more formats.`,new U.Setting(r).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText(f=>{var d;return f.setValue((d=i.localStorage.getHostname())!=null?d:"").onChange(h=>{i.localStorage.setHostname(h)})}),new U.Setting(r).setName("Preview commit message").addButton(f=>f.setButtonText("Preview").onClick(async()=>{let d=await i.gitManager.formatCommitMessage(i.settings.commitMessage);new U.Notice(`${d}`)})),new U.Setting(r).setName("List filenames affected by commit in the commit body").addToggle(f=>f.setValue(i.settings.listChangedFilesInMessageBody).onChange(async d=>{i.settings.listChangedFilesInMessageBody=d,await i.saveSettings()})),new U.Setting(r).setName("Pull").setHeading(),i.gitManager instanceof Se&&new U.Setting(r).setName("Merge strategy").setDesc("Decide how to integrate commits from your remote branch into your local branch.").addDropdown(f=>{let d={merge:"Merge",rebase:"Rebase",reset:"Other sync service (Only updates the HEAD without touching the working directory)"};f.addOptions(d),f.setValue(i.settings.syncMethod),f.onChange(async h=>{i.settings.syncMethod=h,await i.saveSettings()})}),new U.Setting(r).setName("Merge strategy on conflicts").setDesc("Decide how to solve conflicts when pulling remote changes. This can be used to favor your local changes or the remote changes automatically.").addDropdown(f=>{let d={none:"None (git default)",ours:"Our changes",theirs:"Their changes"};f.addOptions(d),f.setValue(i.settings.mergeStrategy),f.onChange(async h=>{i.settings.mergeStrategy=h,await i.saveSettings()})}),new U.Setting(r).setName("Pull on startup").setDesc("Automatically pull commits when Obsidian starts.").addToggle(f=>f.setValue(i.settings.autoPullOnBoot).onChange(async d=>{i.settings.autoPullOnBoot=d,await i.saveSettings()})),new U.Setting(r).setName("Commit-and-sync").setDesc("Commit-and-sync with default settings means staging everything -> committing -> pulling -> pushing. Ideally this is a single action that you do regularly to keep your local and remote repository in sync.").setHeading(),a=new U.Setting(r).setName("Push on commit-and-sync").setDesc(`Most of the time you want to push after committing. Turning this off turns a commit-and-sync action into commit ${i.settings.pullBeforePush?"and pull ":""}only. It will still be called commit-and-sync.`).addToggle(f=>f.setValue(!i.settings.disablePush).onChange(async d=>{i.settings.disablePush=!d,this.refreshDisplayWithDelay(),await i.saveSettings()})),new U.Setting(r).setName("Pull on commit-and-sync").setDesc(`On commit-and-sync, pull commits as well. Turning this off turns a commit-and-sync action into commit ${i.settings.disablePush?"":"and push "}only.`).addToggle(f=>f.setValue(i.settings.pullBeforePush).onChange(async d=>{i.settings.pullBeforePush=d,this.refreshDisplayWithDelay(),await i.saveSettings()})),i.gitManager instanceof Se&&(new U.Setting(r).setName("Hunk management").setDesc("Hunks are sections of grouped line changes right in your editor.").setHeading(),new U.Setting(r).setName("Signs").setDesc("This allows you to see your changes right in your editor via colored markers and stage/reset/preview individual hunks.").addToggle(f=>f.setValue(i.settings.hunks.showSigns).onChange(async d=>{i.settings.hunks.showSigns=d,await i.saveSettings(),i.editorIntegration.refreshSignsSettings()})),new U.Setting(r).setName("Hunk commands").setDesc("Adds commands to stage/reset individual Git diff hunks and navigate between them via 'Go to next/prev hunk' commands.").addToggle(f=>f.setValue(i.settings.hunks.hunkCommands).onChange(async d=>{i.settings.hunks.hunkCommands=d,await i.saveSettings(),i.editorIntegration.refreshSignsSettings()})),new U.Setting(r).setName("Status bar with summary of line changes").addDropdown(f=>f.addOptions({disabled:"Disabled",colored:"Colored",monochrome:"Monochrome"}).setValue(i.settings.hunks.statusBar).onChange(async d=>{i.settings.hunks.statusBar=d,await i.saveSettings(),i.editorIntegration.refreshSignsSettings()})),new U.Setting(r).setName("Line author information").setHeading(),this.addLineAuthorInfoSettings())}new U.Setting(r).setName("History view").setHeading(),new U.Setting(r).setName("Show Author").setDesc("Show the author of the commit in the history view.").addDropdown(c=>{let u={hide:"Hide",full:"Full",initials:"Initials"};c.addOptions(u),c.setValue(i.settings.authorInHistoryView),c.onChange(async f=>{i.settings.authorInHistoryView=f,await i.saveSettings(),await i.refresh()})}),new U.Setting(r).setName("Show Date").setDesc("Show the date of the commit in the history view. The {{date}} placeholder format is used to display the date.").addToggle(c=>c.setValue(i.settings.dateInHistoryView).onChange(async u=>{i.settings.dateInHistoryView=u,await i.saveSettings(),await i.refresh()})),new U.Setting(r).setName("Source control view").setHeading(),new U.Setting(r).setName("Automatically refresh source control view on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option.").addToggle(c=>c.setValue(i.settings.refreshSourceControl).onChange(async u=>{i.settings.refreshSourceControl=u,await i.saveSettings()})),new U.Setting(r).setName("Source control view refresh interval").setDesc("Milliseconds to wait after file change before refreshing the Source Control View.").addText(c=>{c.inputEl.type="number",this.setNonDefaultValue({text:c,settingsProperty:"refreshSourceControlTimer"}),c.setPlaceholder(String(rt.refreshSourceControlTimer)),c.onChange(async f=>{f!==""&&Number.isInteger(Number(f))?i.settings.refreshSourceControlTimer=Math.max(Number(f),500):i.settings.refreshSourceControlTimer=rt.refreshSourceControlTimer,await i.saveSettings(),i.setRefreshDebouncer()})}),new U.Setting(r).setName("Miscellaneous").setHeading(),i.gitManager instanceof Se&&new U.Setting(r).setName("Diff view style").setDesc('Set the style for the diff view. Note that the actual diff in "Split" mode is not generated by Git, but the editor itself instead so it may differ from the diff generated by Git. One advantage of this is that you can edit the text in that view.').addDropdown(c=>{let u={split:"Split",git_unified:"Unified"};c.addOptions(u),c.setValue(i.settings.diffStyle),c.onChange(async f=>{i.settings.diffStyle=f,await i.saveSettings()})}),new U.Setting(r).setName("Disable informative notifications").setDesc("Disable informative notifications for git operations to minimize distraction (refer to status bar for updates).").addToggle(c=>c.setValue(i.settings.disablePopups).onChange(async u=>{i.settings.disablePopups=u,this.refreshDisplayWithDelay(),await i.saveSettings()})),new U.Setting(r).setName("Disable error notifications").setDesc("Disable error notifications of any kind to minimize distraction (refer to status bar for updates).").addToggle(c=>c.setValue(!i.settings.showErrorNotices).onChange(async u=>{i.settings.showErrorNotices=!u,await i.saveSettings()})),i.settings.disablePopups||new U.Setting(r).setName("Hide notifications for no changes").setDesc("Don't show notifications when there are no changes to commit or push.").addToggle(c=>c.setValue(i.settings.disablePopupsForNoChanges).onChange(async u=>{i.settings.disablePopupsForNoChanges=u,await i.saveSettings()})),new U.Setting(r).setName("Show status bar").setDesc("Obsidian must be restarted for the changes to take affect.").addToggle(c=>c.setValue(i.settings.showStatusBar).onChange(async u=>{i.settings.showStatusBar=u,await i.saveSettings()})),new U.Setting(r).setName("File menu integration").setDesc('Add "Stage", "Unstage" and "Add to .gitignore" actions to the file menu.').addToggle(c=>c.setValue(i.settings.showFileMenu).onChange(async u=>{i.settings.showFileMenu=u,await i.saveSettings()})),new U.Setting(r).setName("Show branch status bar").setDesc("Obsidian must be restarted for the changes to take affect.").addToggle(c=>c.setValue(i.settings.showBranchStatusBar).onChange(async u=>{i.settings.showBranchStatusBar=u,await i.saveSettings()})),new U.Setting(r).setName("Show the count of modified files in the status bar").addToggle(c=>c.setValue(i.settings.changedFilesInStatusBar).onChange(async u=>{i.settings.changedFilesInStatusBar=u,await i.saveSettings()})),i.gitManager instanceof Di?new U.Setting(r).setName("Authentication/commit author").setHeading():new U.Setting(r).setName("Commit author").setHeading(),i.gitManager instanceof Di&&new U.Setting(r).setName("Username on your git server. E.g. your username on GitHub").addText(c=>{var u;c.setValue((u=i.localStorage.getUsername())!=null?u:""),c.onChange(f=>{i.localStorage.setUsername(f)})}),i.gitManager instanceof Di&&new U.Setting(r).setName("Password/Personal access token").setDesc("Type in your password. You won't be able to see it again.").addText(c=>{c.inputEl.autocapitalize="off",c.inputEl.autocomplete="off",c.inputEl.spellcheck=!1,c.onChange(u=>{i.localStorage.setPassword(u)})}),i.gitReady&&new U.Setting(r).setName("Author name for commit").addText(async c=>{var u;c.setValue((u=await i.gitManager.getConfig("user.name"))!=null?u:""),c.onChange(async f=>{await i.gitManager.setConfig("user.name",f==""?void 0:f)})}),i.gitReady&&new U.Setting(r).setName("Author email for commit").addText(async c=>{var u;c.setValue((u=await i.gitManager.getConfig("user.email"))!=null?u:""),c.onChange(async f=>{await i.gitManager.setConfig("user.email",f==""?void 0:f)})}),new U.Setting(r).setName("Advanced").setDesc("These settings usually don't need to be changed, but may be required for special setups.").setHeading(),i.gitManager instanceof Se&&(new U.Setting(r).setName("Update submodules").setDesc('"Commit-and-sync" and "pull" takes care of submodules. Missing features: Conflicted files, count of pulled/pushed/committed files. Tracking branch needs to be set for each submodule.').addToggle(c=>c.setValue(i.settings.updateSubmodules).onChange(async u=>{i.settings.updateSubmodules=u,await i.saveSettings()})),i.settings.updateSubmodules&&new U.Setting(r).setName("Submodule recurse checkout/switch").setDesc("Whenever a checkout happens on the root repository, recurse the checkout on the submodules (if the branches exist).").addToggle(c=>c.setValue(i.settings.submoduleRecurseCheckout).onChange(async u=>{i.settings.submoduleRecurseCheckout=u,await i.saveSettings()}))),i.gitManager instanceof Se&&new U.Setting(r).setName("Custom Git binary path").setDesc("Specify the path to the Git binary/executable. Git should already be in your PATH. Should only be necessary for a custom Git installation.").addText(c=>{var u;c.setValue((u=i.localStorage.getGitPath())!=null?u:""),c.setPlaceholder("git"),c.onChange(f=>{i.localStorage.setGitPath(f),i.gitManager.updateGitPath(f||"git").catch(d=>i.displayError(d))})}),i.gitManager instanceof Se&&new U.Setting(r).setName("Additional environment variables").setDesc("Use each line for a new environment variable in the format KEY=VALUE .").addTextArea(c=>{c.setPlaceholder("GIT_DIR=/path/to/git/dir"),c.setValue(i.localStorage.getEnvVars().join(` +`)),c.onChange(u=>{i.localStorage.setEnvVars(u.split(` +`))})}),i.gitManager instanceof Se&&new U.Setting(r).setName("Additional PATH environment variable paths").setDesc("Use each line for one path").addTextArea(c=>{c.setValue(i.localStorage.getPATHPaths().join(` +`)),c.onChange(u=>{i.localStorage.setPATHPaths(u.split(` +`))})}),i.gitManager instanceof Se&&new U.Setting(r).setName("Reload with new environment variables").setDesc("Removing previously added environment variables will not take effect until Obsidian is restarted.").addButton(c=>{c.setButtonText("Reload"),c.setCta(),c.onClick(async()=>{await i.gitManager.setGitInstance()})}),new U.Setting(r).setName("Custom base path (Git repository path)").setDesc(` + Sets the relative path to the vault from which the Git binary should be executed. + Mostly used to set the path to the Git repository, which is only required if the Git repository is below the vault root directory. Use "\\" instead of "/" on Windows. + `).addText(c=>{c.setValue(i.settings.basePath),c.setPlaceholder("directory/directory-with-git-repo"),c.onChange(async u=>{i.settings.basePath=u,await i.saveSettings(),i.gitManager.updateBasePath(u||"").catch(f=>i.displayError(f))})}),new U.Setting(r).setName("Custom Git directory path (Instead of '.git')").setDesc('Corresponds to the GIT_DIR environment variable. Requires restart of Obsidian to take effect. Use "\\" instead of "/" on Windows.').addText(c=>{c.setValue(i.settings.gitDir),c.setPlaceholder(".git"),c.onChange(async u=>{i.settings.gitDir=u,await i.saveSettings()})}),new U.Setting(r).setName("Disable on this device").setDesc("Disables the plugin on this device. This setting is not synced.").addToggle(c=>c.setValue(i.localStorage.getPluginDisabled()).onChange(u=>{i.localStorage.setPluginDisabled(u),u?i.unloadPlugin():i.init({fromReload:!0}).catch(f=>i.displayError(f)),new U.Notice("Obsidian must be restarted for the changes to take affect.")})),new U.Setting(r).setName("Support").setHeading(),new U.Setting(r).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton(c=>{c.buttonEl.outerHTML="Buy Me a Coffee at ko-fi.com"});let o=r.createDiv();o.setAttr("align","center"),o.setAttr("style","margin: var(--size-4-2)");let l=o.createEl("button");if(l.setText("Copy Debug Information"),l.onclick=async()=>{await window.navigator.clipboard.writeText(JSON.stringify({settings:this.plugin.settings,pluginVersion:this.plugin.manifest.version},null,4)),new U.Notice("Debug information copied to clipboard. May contain sensitive information!")},U.Platform.isDesktopApp){let c=r.createDiv();c.setAttr("align","center"),c.setText(`Debugging and logging: +You can always see the logs of this and every other plugin by opening the console with`);let u=r.createDiv();u.setAttr("align","center"),u.addClass("obsidian-git-shortcuts"),U.Platform.isMacOS===!0?u.createEl("kbd",{text:"CMD (\u2318) + OPTION (\u2325) + I"}):u.createEl("kbd",{text:"CTRL + SHIFT + I"})}}mayDisableSetting(r,i){i&&(r.setDisabled(i),r.setClass("obsidian-git-disabled"))}configureLineAuthorShowStatus(r){this.settings.lineAuthor.show=r,this.plugin.saveSettings(),r?this.plugin.editorIntegration.activateLineAuthoring():this.plugin.editorIntegration.deactiveLineAuthoring()}async lineAuthorSettingHandler(r,i){this.settings.lineAuthor[r]=i,await this.plugin.saveSettings(),this.plugin.editorIntegration.lineAuthoringFeature.refreshLineAuthorViews()}beforeSaveSettings(){let r=this.settings.lineAuthor;r.authorDisplay!=="hide"&&(r.lastShownAuthorDisplay=r.authorDisplay),r.dateTimeFormatOptions!=="hide"&&(r.lastShownDateTimeFormatOptions=r.dateTimeFormatOptions)}addLineAuthorInfoSettings(){let r=new U.Setting(this.containerEl).setName("Show commit authoring information next to each line");if(this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform()||r.setDesc("Only available on desktop currently.").setDisabled(!0),r.descEl.innerHTML=` + Feature guide and quick examples
+ The commit hash, author name and authoring date can all be individually toggled.
Hide everything, to only show the age-colored sidebar.`,r.addToggle(i=>i.setValue(this.settings.lineAuthor.show).onChange(n=>{this.configureLineAuthorShowStatus(n),this.refreshDisplayWithDelay()})),this.settings.lineAuthor.show){let i=new U.Setting(this.containerEl).setName("Follow movement and copies across files and commits").setDesc("").addDropdown(s=>{s.addOptions({inactive:"Do not follow (default)","same-commit":"Follow within same commit","all-commits":"Follow within all commits (maybe slow)"}),s.setValue(this.settings.lineAuthor.followMovement),s.onChange(a=>this.lineAuthorSettingHandler("followMovement",a))});if(i.descEl.innerHTML=` + By default (deactivated), each line only shows the newest commit where it was changed. +
+ With same commit, cut-copy-paste-ing of text is followed within the same commit and the original commit of authoring will be shown. +
+ With all commits, cut-copy-paste-ing text inbetween multiple commits will be detected. +
+ It uses git-blame and + for matches (at least ${Bd} characters) within the same (or all) commit(s), the originating commit's information is shown.`,new U.Setting(this.containerEl).setName("Show commit hash").addToggle(s=>{s.setValue(this.settings.lineAuthor.showCommitHash),s.onChange(a=>this.lineAuthorSettingHandler("showCommitHash",a))}),new U.Setting(this.containerEl).setName("Author name display").setDesc("If and how the author is displayed").addDropdown(s=>{let a={hide:"Hide",initials:"Initials (default)","first name":"First name","last name":"Last name",full:"Full name"};s.addOptions(a),s.setValue(this.settings.lineAuthor.authorDisplay),s.onChange(async o=>this.lineAuthorSettingHandler("authorDisplay",o))}),new U.Setting(this.containerEl).setName("Authoring date display").setDesc("If and how the date and time of authoring the line is displayed").addDropdown(s=>{let a={hide:"Hide",date:"Date (default)",datetime:"Date and time","natural language":"Natural language",custom:"Custom"};s.addOptions(a),s.setValue(this.settings.lineAuthor.dateTimeFormatOptions),s.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatOptions",o),this.refreshDisplayWithDelay()})}),this.settings.lineAuthor.dateTimeFormatOptions==="custom"){let s=new U.Setting(this.containerEl);s.setName("Custom authoring date format").addText(a=>{a.setValue(this.settings.lineAuthor.dateTimeFormatCustomString),a.setPlaceholder("YYYY-MM-DD HH:mm"),a.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatCustomString",o),s.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(o)})}),s.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(this.settings.lineAuthor.dateTimeFormatCustomString)}new U.Setting(this.containerEl).setName("Authoring date display timezone").addDropdown(s=>{let a={"viewer-local":"My local (default)","author-local":"Author's local",utc0000:"UTC+0000/Z"};s.addOptions(a),s.setValue(this.settings.lineAuthor.dateTimeTimezone),s.onChange(async o=>this.lineAuthorSettingHandler("dateTimeTimezone",o))}).descEl.innerHTML=` + The time-zone in which the authoring date should be shown. + Either your local time-zone (default), + the author's time-zone during commit creation or + UTC\xB100:00. + `;let n=new U.Setting(this.containerEl).setName("Oldest age in coloring");n.descEl.innerHTML=this.previewOldestAgeDescriptionHtml(this.settings.lineAuthor.coloringMaxAge)[0],n.addText(s=>{s.setPlaceholder("1y"),s.setValue(this.settings.lineAuthor.coloringMaxAge),s.onChange(async a=>{let[o,l]=this.previewOldestAgeDescriptionHtml(a);n.descEl.innerHTML=o,l&&(await this.lineAuthorSettingHandler("coloringMaxAge",a),this.refreshColorSettingsName("oldest"))})}),this.createColorSetting("newest"),this.createColorSetting("oldest"),new U.Setting(this.containerEl).setName("Text color").addText(s=>{s.setValue(this.settings.lineAuthor.textColorCss),s.onChange(async a=>{await this.lineAuthorSettingHandler("textColorCss",a)})}).descEl.innerHTML=` + The CSS color of the gutter text.
+ + It is highly recommended to use + + CSS variables + defined by themes + (e.g.
var(--text-muted)
or +
var(--text-on-accent)
, + because they automatically adapt to theme changes.
+ + See: + List of available CSS variables in Obsidian + + `,new U.Setting(this.containerEl).setName("Ignore whitespace and newlines in changes").addToggle(s=>{s.setValue(this.settings.lineAuthor.ignoreWhitespace),s.onChange(a=>this.lineAuthorSettingHandler("ignoreWhitespace",a))}).descEl.innerHTML=` + Whitespace and newlines are interpreted as + part of the document and in changes + by default (hence not ignored). + This makes the last line being shown as 'changed' + when a new subsequent line is added, + even if the previously last line's text is the same. +
+ If you don't care about purely-whitespace changes + (e.g. list nesting / quote indentation changes), + then activating this will provide more meaningful change detection. + `}}createColorSetting(r){let i=new U.Setting(this.containerEl).setName("").addText(n=>{let s=W0(r,this.settings.lineAuthor),a=W0(r,rt.lineAuthor);n.setPlaceholder(Gw(a)),n.setValue(Gw(s)),n.onChange(async o=>{let l=LP(o);if(l!==void 0){let c=r==="newest"?"colorNew":"colorOld";await this.lineAuthorSettingHandler(c,l)}this.refreshColorSettingsDesc(r,l)})});this.lineAuthorColorSettings.set(r,i),this.refreshColorSettingsName(r),this.refreshColorSettingsDesc(r,W0(r,this.settings.lineAuthor))}refreshColorSettingsName(r){let i=this.lineAuthorColorSettings.get(r);if(i){let n=r==="oldest"?`oldest (${this.settings.lineAuthor.coloringMaxAge} or older)`:"newest";i.nameEl.innerText=`Color for ${n} commits`}}refreshColorSettingsDesc(r,i){let n=this.lineAuthorColorSettings.get(r);n&&(n.descEl.innerHTML=this.colorSettingPreviewDescHtml(r,this.settings.lineAuthor,i!==void 0))}colorSettingPreviewDescHtml(r,i,n){let s=n?Jh(r,i):"rgba(127,127,127,0.3)",a=U.moment.unix(U.moment.now()/1e3).format("YYYY-MM-DD"),o=n?`abcdef Author Name ${a}`:"invalid color";return`Supports 'rgb(r,g,b)', 'hsl(h,s,l)', hex (#) and + named colors (e.g. 'black', 'purple'). Color preview: ${`
${o}
`}`}previewCustomDateTimeDescriptionHtml(r){let i=(0,U.moment)().format(r);return`
Format string to display the authoring date.
Currently: ${i}`}previewOldestAgeDescriptionHtml(r){let i=jh(r);return[`The oldest age in the line author coloring. Everything older will have the same color. +
Smallest valid age is "1d". Currently: ${i!==void 0?`${i.asDays()} days`:"invalid!"}`,i]}setNonDefaultValue({settingsProperty:r,text:i}){let n=this.plugin.settings[r];rt[r]!==n&&(typeof n=="string"||typeof n=="number"||typeof n=="boolean"?i.setValue(String(n)):i.setValue(JSON.stringify(n)))}refreshDisplayWithDelay(r=80){setTimeout(()=>this.display(),r)}};function W0(t,e){return t==="oldest"?e.colorOld:e.colorNew}function jh(t){let e=U.moment.duration("P"+t.toUpperCase());return e.isValid()&&e.asDays()&&e.asDays()>=1?e:void 0}p();var ti=require("obsidian");var rp=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;this.messages=[];this.base="obsidian-git-statusbar-";this.statusBarEl.setAttribute("data-tooltip-position","top"),r.registerEvent(r.app.workspace.on("obsidian-git:refreshed",()=>{this.refreshCommitTimestamp().catch(console.error)}))}displayMessage(e,r){this.messages.push({message:`Git: ${e.slice(0,100)}`,timeout:r}),this.display()}display(){this.messages.length>0&&!this.currentMessage?(this.currentMessage=this.messages.shift(),this.statusBarEl.addClass(this.base+"message"),this.statusBarEl.ariaLabel="",this.statusBarEl.setText(this.currentMessage.message),this.lastMessageTimestamp=Date.now()):this.currentMessage?Date.now()-this.lastMessageTimestamp>=this.currentMessage.timeout&&(this.currentMessage=null,this.lastMessageTimestamp=null):this.displayState()}displayState(){switch((this.statusBarEl.getText().length>3||!this.statusBarEl.hasChildNodes())&&(this.statusBarEl.empty(),this.conflictEl=this.statusBarEl.createDiv(),this.conflictEl.setAttribute("data-tooltip-position","top"),this.conflictEl.style.float="left",this.pausedEl=this.statusBarEl.createDiv(),this.pausedEl.setAttribute("data-tooltip-position","top"),this.pausedEl.style.float="left",this.iconEl=this.statusBarEl.createDiv(),this.iconEl.style.float="left",this.textEl=this.statusBarEl.createDiv(),this.textEl.style.float="right",this.textEl.style.marginLeft="5px"),this.plugin.localStorage.getConflict()?((0,ti.setIcon)(this.conflictEl,"alert-circle"),this.conflictEl.ariaLabel="You have merge conflicts. Resolve them and commit afterwards.",this.conflictEl.style.marginRight="5px",this.conflictEl.addClass(this.base+"conflict")):(this.conflictEl.empty(),this.conflictEl.style.marginRight=""),this.plugin.localStorage.getPausedAutomatics()?((0,ti.setIcon)(this.pausedEl,"pause-circle"),this.pausedEl.ariaLabel="Automatic routines are currently paused.",this.pausedEl.style.marginRight="5px",this.pausedEl.addClass(this.base+"paused")):(this.pausedEl.empty(),this.pausedEl.style.marginRight=""),this.plugin.state.gitAction){case 0:this.displayFromNow();break;case 1:this.statusBarEl.ariaLabel="Checking repository status...",(0,ti.setIcon)(this.iconEl,"refresh-cw"),this.statusBarEl.addClass(this.base+"status");break;case 3:this.statusBarEl.ariaLabel="Adding files...",(0,ti.setIcon)(this.iconEl,"archive"),this.statusBarEl.addClass(this.base+"add");break;case 4:this.statusBarEl.ariaLabel="Committing changes...",(0,ti.setIcon)(this.iconEl,"git-commit"),this.statusBarEl.addClass(this.base+"commit");break;case 5:this.statusBarEl.ariaLabel="Pushing changes...",(0,ti.setIcon)(this.iconEl,"upload"),this.statusBarEl.addClass(this.base+"push");break;case 2:this.statusBarEl.ariaLabel="Pulling changes...",(0,ti.setIcon)(this.iconEl,"download"),this.statusBarEl.addClass(this.base+"pull");break;default:this.statusBarEl.ariaLabel="Failed on initialization!",(0,ti.setIcon)(this.iconEl,"alert-triangle"),this.statusBarEl.addClass(this.base+"failed-init");break}}displayFromNow(){var i;let e=this.lastCommitTimestamp,r=this.plugin.state.offlineMode;if(e){let n=(0,ti.moment)(e).fromNow();this.statusBarEl.ariaLabel=`${r?"Offline: ":""}Last Commit: ${n}`,(i=this.unPushedCommits)!=null&&i&&(this.statusBarEl.ariaLabel+=` +(${this.unPushedCommits} unpushed commits)`)}else this.statusBarEl.ariaLabel=r?"Git is offline":"Git is ready";r?(0,ti.setIcon)(this.iconEl,"globe"):(0,ti.setIcon)(this.iconEl,"check"),this.plugin.settings.changedFilesInStatusBar&&this.plugin.cachedStatus&&this.textEl.setText(this.plugin.cachedStatus.changed.length.toString()),this.statusBarEl.addClass(this.base+"idle")}async refreshCommitTimestamp(){this.lastCommitTimestamp=await this.plugin.gitManager.getLastCommitTime(),this.unPushedCommits=await this.plugin.gitManager.getUnpushedCommits()}remove(){this.statusBarEl.remove()}};p();var np=require("obsidian"),ip=class extends np.SuggestModal{constructor(r){super(r.app);this.plugin=r;this.resolve=null;this.setPlaceholder("Type your message and select optional the version with the added date.")}openAndGetResult(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(r){let i=(0,np.moment)().format(this.plugin.settings.commitDateFormat);return r==""&&(r="..."),[r,`${i}: ${r}`,`${r}: ${i}`]}renderSuggestion(r,i){i.innerText=r}onChooseSuggestion(r,i){this.resolve&&this.resolve(r)}};p();var mF=require("obsidian"),Du=class{constructor(e){this.plugin=e}saveLastAuto(e,r){r==="backup"?this.plugin.localStorage.setLastAutoBackup(e.toString()):r==="pull"?this.plugin.localStorage.setLastAutoPull(e.toString()):r==="push"&&this.plugin.localStorage.setLastAutoPush(e.toString())}loadLastAuto(){var e,r,i;return{backup:new Date((e=this.plugin.localStorage.getLastAutoBackup())!=null?e:""),pull:new Date((r=this.plugin.localStorage.getLastAutoPull())!=null?r:""),push:new Date((i=this.plugin.localStorage.getLastAutoPush())!=null?i:"")}}async init(){await this.setUpAutoCommitAndSync();let e=this.loadLastAuto();if(this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0){let r=this.diff(this.plugin.settings.autoPushInterval,e.push);this.startAutoPush(r)}if(this.plugin.settings.autoPullInterval>0){let r=this.diff(this.plugin.settings.autoPullInterval,e.pull);this.startAutoPull(r)}}unload(){this.clearAutoPull(),this.clearAutoPush(),this.clearAutoCommitAndSync()}reload(...e){this.plugin.localStorage.getPausedAutomatics()||(e.contains("commit")&&(this.clearAutoCommitAndSync(),this.plugin.settings.autoSaveInterval>0&&this.startAutoCommitAndSync(this.plugin.settings.autoSaveInterval)),e.contains("push")&&(this.clearAutoPush(),this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0&&this.startAutoPush(this.plugin.settings.autoPushInterval)),e.contains("pull")&&(this.clearAutoPull(),this.plugin.settings.autoPullInterval>0&&this.startAutoPull(this.plugin.settings.autoPullInterval)))}async setUpAutoCommitAndSync(){if(this.plugin.settings.setLastSaveToLastCommit){this.clearAutoCommitAndSync();let e=await this.plugin.gitManager.getLastCommitTime();e&&this.saveLastAuto(e,"backup")}if(!this.timeoutIDCommitAndSync&&!this.plugin.autoCommitDebouncer){let e=this.loadLastAuto();if(this.plugin.settings.autoSaveInterval>0){let r=this.diff(this.plugin.settings.autoSaveInterval,e.backup);this.startAutoCommitAndSync(r)}}}startAutoCommitAndSync(e){let r=(e!=null?e:this.plugin.settings.autoSaveInterval)*6e4;this.plugin.settings.autoBackupAfterFileChange?e===0?this.doAutoCommitAndSync():this.plugin.autoCommitDebouncer=(0,mF.debounce)(()=>this.doAutoCommitAndSync(),r,!0):(r>2147483647&&(r=2147483647),this.timeoutIDCommitAndSync=window.setTimeout(()=>this.doAutoCommitAndSync(),r))}doAutoCommitAndSync(){this.plugin.promiseQueue.addTask(async()=>{if(this.plugin.settings.setLastSaveToLastCommit){let r=await this.plugin.gitManager.getLastCommitTime();if(r){this.saveLastAuto(r,"backup");let i=this.diff(this.plugin.settings.autoSaveInterval,r);if(i>0)return this.startAutoCommitAndSync(i),!1}}let e=this.plugin.settings.autoCommitOnlyStaged;return this.plugin.settings.differentIntervalCommitAndPush?await this.plugin.commit({fromAuto:!0,onlyStaged:e}):await this.plugin.commitAndSync({fromAutoBackup:!0,onlyStaged:e}),!0},e=>{e!==!1&&(this.saveLastAuto(new Date,"backup"),this.startAutoCommitAndSync())})}startAutoPull(e){let r=(e!=null?e:this.plugin.settings.autoPullInterval)*6e4;r>2147483647&&(r=2147483647),this.timeoutIDPull=window.setTimeout(()=>this.doAutoPull(),r)}doAutoPull(){this.plugin.promiseQueue.addTask(()=>this.plugin.pullChangesFromRemote(),()=>{this.saveLastAuto(new Date,"pull"),this.startAutoPull()})}startAutoPush(e){let r=(e!=null?e:this.plugin.settings.autoPushInterval)*6e4;r>2147483647&&(r=2147483647),this.timeoutIDPush=window.setTimeout(()=>this.doAutoPush(),r)}doAutoPush(){this.plugin.promiseQueue.addTask(()=>this.plugin.push(),()=>{this.saveLastAuto(new Date,"push"),this.startAutoPush()})}clearAutoCommitAndSync(){var r;let e=!1;return this.timeoutIDCommitAndSync&&(window.clearTimeout(this.timeoutIDCommitAndSync),this.timeoutIDCommitAndSync=void 0,e=!0),this.plugin.autoCommitDebouncer&&((r=this.plugin.autoCommitDebouncer)==null||r.cancel(),this.plugin.autoCommitDebouncer=void 0,e=!0),e}clearAutoPull(){return this.timeoutIDPull?(window.clearTimeout(this.timeoutIDPull),this.timeoutIDPull=void 0,!0):!1}clearAutoPush(){return this.timeoutIDPush?(window.clearTimeout(this.timeoutIDPush),this.timeoutIDPush=void 0,!0):!1}diff(e,r){let n=e-Math.round((new Date().getTime()-r.getTime())/1e3/60);return Math.max(0,n)}};p();var Ni=require("obsidian");p();var Lu=require("obsidian");async function gF(t,e,r){let i=await wF(e,r);if(i.result==="failure"){new Lu.Notice(i.reason);return}let{isGitHub:n,branch:s,repo:a,user:o,filePath:l}=i;if(n){let c=t.getCursor("from").line+1,u=t.getCursor("to").line+1;c===u?window.open(`https://github.com/${o}/${a}/blob/${s}/${l}?plain=1#L${c}`):window.open(`https://github.com/${o}/${a}/blob/${s}/${l}?plain=1#L${c}-L${u}`)}else new Lu.Notice("It seems like you are not using GitHub")}async function vF(t,e){let r=await wF(t,e);if(r.result==="failure"){new Lu.Notice(r.reason);return}let{isGitHub:i,branch:n,repo:s,user:a,filePath:o}=r;i?window.open(`https://github.com/${a}/${s}/commits/${n}/${o}`):new Lu.Notice("It seems like you are not using GitHub")}async function wF(t,e){let r=await e.branchInfo(),i=r.tracking,n=r.current,s,a=e.getRelativeRepoPath(t.path);if(e instanceof Se){let l=await e.getSubmoduleOfFile(e.getRelativeRepoPath(t.path));if(l){a=l.relativeFilepath;let c=await e.git.cwd({path:l.submodule,root:!1}).status();if(i=c.tracking||void 0,n=c.current||void 0,i){let u=i.substring(0,i.indexOf("/")),f=await e.git.cwd({path:l.submodule,root:!1}).getConfig(`remote.${u}.url`,"local");if(f.value!=null)s=f.value;else return{result:"failure",reason:"Failed to get remote url of submodule"}}}}if(i==null)return{result:"failure",reason:"Remote branch is not configured"};if(n==null)return{result:"failure",reason:"Failed to get current branch name"};if(s==null){let l=i.substring(0,i.indexOf("/"));if(s=await e.getConfig(`remote.${l}.url`),s==null)return{result:"failure",reason:"Failed to get remote url"}}let o=s.match(/(?:^https:\/\/github\.com\/(.+)\/(.+?)(?:\.git)?$)|(?:^[a-zA-Z]+@github\.com:(.+)\/(.+?)(?:\.git)?$)/);if(o==null)return{result:"failure",reason:"Could not parse remote url"};{let[l,c,u,f,d]=o;return{result:"success",isGitHub:!!l,repo:u||d,user:c||f,branch:n,filePath:a}}}p();var yF=require("obsidian"),sp=class extends yF.FuzzySuggestModal{constructor(e,r){super(e.app),this.plugin=e,this.changedFiles=r,this.setPlaceholder("Not supported files will be opened by default app!")}getItems(){return this.changedFiles}getItemText(e){if(e.index=="U"&&e.workingDir=="U")return`Untracked | ${e.vaultPath}`;let r="",i="";return e.workingDir!=" "&&(r=`Working Dir: ${e.workingDir} `),e.index!=" "&&(i=`Index: ${e.index}`),`${r}${i} | ${e.vaultPath}`}onChooseItem(e,r){this.plugin.app.metadataCache.getFirstLinkpathDest(e.vaultPath,"")==null?this.app.openWithDefaultApp(e.vaultPath):this.plugin.app.workspace.openLinkText(e.vaultPath,"/")}};p();var bF=require("obsidian"),ap=class extends bF.Modal{constructor(r,i){super(r);this.content=i;this.resolve=null}openAndGetReslt(){return new Promise(r=>{this.resolve=r,this.open()})}onOpen(){let{contentEl:r,titleEl:i}=this;i.setText("Edit .gitignore");let n=r.createDiv(),s=n.createEl("textarea",{text:this.content,cls:["obsidian-git-textarea"],attr:{rows:10,cols:30,wrap:"off"}});n.createEl("button",{cls:["mod-cta","obsidian-git-center-button"],text:"Save"}).addEventListener("click",()=>{this.resolve(s.value),this.close()})}onClose(){let{contentEl:r}=this;r.empty(),this.resolve&&this.resolve(void 0)}};p();var Wu=require("@codemirror/state"),_p=require("@codemirror/view");p();var Il=require("@codemirror/state");p();var Nt=class t{static createHunk(e,r,i,n){return{removed:{start:e,count:r,lines:[]},added:{start:i,count:n,lines:[]},head:`@@ -${e}${r>0?`,${r}`:""} +${i}${n>0?`,${n}`:""} @@`,vend:i+Math.max(n-1,0),type:n===0?"delete":r===0?"add":"change"}}static createPartialHunk(e,r,i){let n=r,s=i-r+1,a=0;for(let o of e){let l=o.added.count-o.removed.count,c=0;if(o.added.start>=r&&o.vend<=i)c=l;else{let u=Math.max(0,i+1-(o.added.start+o.removed.count)),f=Math.max(0,r-(o.added.start+o.removed.count));o.added.start>=r&&o.added.start<=i?c=u:o.vend>=r&&o.vend<=i?(c=l-f,n=n-f):o.added.start<=r&&o.vend>=i?(c=u-f,n=n-f):a++,r>o.vend&&(n=n-l)}s=s-c}if(a!==e.length)return s===0&&(n=n-1),this.createHunk(n,s,r,i-r+1)}patchLines(e,r=!1){let i=[];for(let n of e.removed.lines)i.push("-"+n);for(let n of e.added.lines)i.push("+"+n);return r?i.map(n=>n.replace(/\r$/,"")):i}static parseDiffLine(e){let n=e.split("@@")[1].trim().split(" "),s=n[0].substring(1).split(","),a=n[1].substring(1).split(","),o=this.createHunk(parseInt(s[0]),parseInt(s[1]||"1"),parseInt(a[0]),parseInt(a[1]||"1"));return o.head=e,o}static changeEnd(e){return e.added.count===0?e.added.start:e.removed.count===0?e.added.start+e.added.count-1:e.added.start+Math.min(e.added.count,e.removed.count)-1}static calcSigns(e,r,i,n=1,s=1/0,a){if(a&&r.type!=="add")return console.error(`Invalid hunk with untracked=${a} hunk="${r.head}"`),[];n=Math.max(1,n);let{start:o,added:l,removed:c}={start:r.added.start,added:r.added.count,removed:r.removed.count},u=this.changeEnd(r),f=r.type==="delete"&&(o===0||e&&this.changeEnd(e)===o)&&(!i||i.added.start!==o+1);f&&n===1&&(n=0);let d=[];for(let h=Math.max(o,n);h<=Math.min(u,s);h++){let m=r.type==="change"&&(c>l&&h===u||e&&e.added.start===0);d.push({type:f?"topdelete":m?"changedelete":a?"untracked":r.type,count:h===o?r.type==="add"?l:c:void 0,lnum:h+(f?1:0)})}if(r.type==="change"&&l>c&&r.vend>=n&&u<=s)for(let h=Math.max(u,n);h<=Math.min(r.vend,s);h++)d.push({type:"add",count:h===r.vend?l-c:void 0,lnum:h});return d}static createPatch(e,r,i,n=!1){let s=[`diff --git a/${e} b/${e}`,`index 000000..000000 ${i}`,`--- a/${e}`,`+++ b/${e}`],a=0;r=structuredClone(r);for(let o of r){let l=o.removed.start,c=o.removed.count,u=o.added.count;o.type==="add"&&(l=l+1);let f=o.removed.lines,d=o.added.lines;n&&([c,u]=[u,c],[f,d]=[d,f]),s.push(`@@ -${l},${c} +${l+a},${u} @@`);for(let h of f)s.push("-"+h);(n?o.added:o.removed).no_nl_at_eof&&s.push("\\ No newline at end of file");for(let h of d)s.push("+"+h);(n?o.removed:o.added).no_nl_at_eof&&s.push("\\ No newline at end of file"),o.removed.start=l+a,a=a+(u-c)}return s}getSummary(e){let r={added:0,changed:0,removed:0};for(let i of e)if(i.type==="add")r.added+=i.added.count;else if(i.type==="delete")r.removed+=i.removed.count;else if(i.type==="change"){let n=i.added.count,s=i.removed.count,a=Math.min(n,s);r.changed+=a,r.added+=n-a,r.removed+=s-a}return r}static findHunk(e,r){if(!r)return[void 0,void 0];for(let i=0;i=e)return[n,i]}return[void 0,void 0]}static findNearestHunk(e,r,i,n){if(r.length!==0){if(i==="first")return 0;if(i==="last")return r.length-1;if(i==="next"){if(r[0].added.start>e)return 0;for(let s=r.length-1;s>=0;s--)if(r[s].added.start<=e){if(s+1e)return s+1;if(n)return 0}}else if(i==="prev"){if(Math.max(r[r.length-1].vend)0&&Math.max(r[s-1].vend,1)l.added.start?n++:o.added.starta.map(v=>g.replace(/&/,v))).reduce((g,v)=>g.concat(v)),m,l);else if(m&&typeof m=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");s(n(h),m,u,d)}else m!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+m+";")}(u.length||d)&&l.push((i&&!f&&!c?a.map(i):a).join(", ")+" {"+u.join(" ")+"}")}for(let a in e)s(n(a),e[a],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=xF[_F]||1;return xF[_F]=e+1,Y0+e.toString(36)}static mount(e,r,i){let n=e[X0],s=i&&i.nonce;n?s&&n.setNonce(s):n=new Z0(e,s),n.mount(Array.isArray(r)?r:[r],e)}},SF=new Map,Z0=class{constructor(e,r){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=SF.get(i);if(s)return e[X0]=s;this.sheet=new n.CSSStyleSheet,SF.set(i,this)}else this.styleTag=i.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[X0]=this}mount(e,r){let i=this.sheet,n=0,s=0;for(let a=0;a-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),i)for(let c=0;cc){let f=t.slice(e,r).indexOf(i.slice(n,s));if(f>-1)return[new _t(e,e+f,n,n),new _t(e+f+c,r,s,s)]}else if(c>l){let f=i.slice(n,s).indexOf(t.slice(e,r));if(f>-1)return[new _t(e,e,n,n+f),new _t(r,r,n+f+l,s)]}if(l==1||c==1)return[new _t(e,r,n,s)];let u=jF(t,e,r,i,n,s);if(u){let[f,d,h]=u;return Ba(t,e,f,i,n,d).concat(Ba(t,f+h,r,i,d+h,s))}return iV(t,e,r,i,n,s)}var Bu=1e9,Nu=0,iy=!1;function iV(t,e,r,i,n,s){let a=r-e,o=s-n;if(Bu<1e9&&Math.min(a,o)>Bu*16||Nu>0&&Date.now()>Nu)return Math.min(a,o)>Bu*64?[new _t(e,r,n,s)]:EF(t,e,r,i,n,s);let l=Math.ceil((a+o)/2);K0.reset(l),Q0.reset(l);let c=(h,m)=>t.charCodeAt(e+h)==i.charCodeAt(n+m),u=(h,m)=>t.charCodeAt(r-h-1)==i.charCodeAt(s-m-1),f=(a-o)%2!=0?Q0:null,d=f?null:K0;for(let h=0;hBu||Nu>0&&!(h&63)&&Date.now()>Nu)return EF(t,e,r,i,n,s);let m=K0.advance(h,a,o,l,f,!1,c)||Q0.advance(h,a,o,l,d,!0,u);if(m)return nV(t,e,r,e+m[0],i,n,s,n+m[1])}return[new _t(e,r,n,s)]}var dp=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let r=0;rr)this.end+=2;else if(f>i)this.start+=2;else if(s){let d=n+(r-i)-l;if(d>=0&&d=r-u)return[h,n+h-d]}else{let h=r-s.vec[d];if(u>=h)return[u,f]}}}return null}},K0=new dp,Q0=new dp;function nV(t,e,r,i,n,s,a,o){let l=!1;return!$l(t,i)&&++i==r&&(l=!0),!$l(n,o)&&++o==a&&(l=!0),l?[new _t(e,r,s,a)]:Ba(t,e,i,n,s,o).concat(Ba(t,i,r,n,o,a))}function GF(t,e){let r=1,i=Math.min(t,e);for(;rr||u>s||t.slice(o,c)!=i.slice(l,u)){if(a==1)return o-e-($l(t,o)?0:1);a=a>>1}else{if(c==r||u==s)return c-e;o=c,l=u}}}function sy(t,e,r,i,n,s){if(e==r||n==s||t.charCodeAt(r-1)!=i.charCodeAt(s-1))return 0;let a=GF(r-e,s-n);for(let o=r,l=s;;){let c=o-a,u=l-a;if(c>1}else{if(c==e||u==n)return r-c;o=c,l=u}}}function J0(t,e,r,i,n,s,a,o){let l=i.slice(n,s),c=null;for(;;){if(c||a=r)break;let d=t.slice(u,f),h=-1;for(;(h=l.indexOf(d,h+1))!=-1;){let m=ny(t,f,r,i,n+h+d.length,s),g=sy(t,e,u,i,n,n+h),v=d.length+m+g;(!c||c[2]>1}}function jF(t,e,r,i,n,s){let a=r-e,o=s-n;if(an.fromA-e&&i.toB>n.fromB-e&&(t[r-1]=new _t(i.fromA,n.toA,i.fromB,n.toB),t.splice(r--,1))}}function sV(t,e,r){for(;;){qF(r,1);let i=!1;for(let n=0;n3||o>3){let l=n==t.length-1?e.length:t[n+1].fromA,c=s.fromA-i,u=l-s.toA,f=AF(e,s.fromA,c),d=kF(e,s.toA,u),h=s.fromA-f,m=d-s.toA;if((!a||!o)&&h&&m){let g=Math.max(a,o),[v,w,b]=a?[e,s.fromA,s.toA]:[r,s.fromB,s.toB];g>h&&e.slice(f,s.fromA)==v.slice(b-h,b)?(s=t[n]=new _t(f,f+a,s.fromB-h,s.toB-h),f=s.fromA,d=kF(e,s.toA,l-s.toA)):g>m&&e.slice(s.toA,d)==v.slice(w,w+m)&&(s=t[n]=new _t(d-a,d,s.fromB+m,s.toB+m),d=s.toA,f=AF(e,s.fromA,s.fromA-i)),h=s.fromA-f,m=d-s.toA}if(h||m)s=t[n]=new _t(s.fromA-h,s.toA+m,s.fromB-h,s.toB+m);else if(a){if(!o){let g=CF(e,s.fromA,s.toA),v,w=g<0?-1:TF(e,s.toA,s.fromA);g>-1&&(v=g-s.fromA)<=u&&e.slice(s.fromA,g)==e.slice(s.toA,s.toA+v)?s=t[n]=s.offset(v):w>-1&&(v=s.toA-w)<=c&&e.slice(s.fromA-v,s.fromA)==e.slice(w,s.toA)&&(s=t[n]=s.offset(-v))}}else{let g=CF(r,s.fromB,s.toB),v,w=g<0?-1:TF(r,s.toB,s.fromB);g>-1&&(v=g-s.fromB)<=u&&r.slice(s.fromB,g)==r.slice(s.toB,s.toB+v)?s=t[n]=s.offset(v):w>-1&&(v=s.toB-w)<=c&&r.slice(s.fromB-v,s.fromB)==r.slice(w,s.toB)&&(s=t[n]=s.offset(-v))}}i=s.toA}return qF(t,3),t}var La;try{La=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch(t){}function zF(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function VF(t,e){if(e==t.length)return 0;let r=t.charCodeAt(e);return r<192?zF(r)?1:0:La?!XF(r)||e==t.length-1?La.test(String.fromCharCode(r))?1:0:La.test(t.slice(e,e+2))?2:0:0}function WF(t,e){if(!e)return 0;let r=t.charCodeAt(e-1);return r<192?zF(r)?1:0:La?!ZF(r)||e==1?La.test(String.fromCharCode(r))?1:0:La.test(t.slice(e-2,e))?2:0:0}var YF=8;function kF(t,e,r){if(e==t.length||!WF(t,e))return e;for(let i=e,n=e+r,s=0;sn)return i;i+=a}return e}function AF(t,e,r){if(!e||!VF(t,e))return e;for(let i=e,n=e-r,s=0;st>=55296&&t<=56319,ZF=t=>t>=56320&&t<=57343;function $l(t,e){return!e||e==t.length||!XF(t.charCodeAt(e-1))||!ZF(t.charCodeAt(e))}function oV(t,e,r){var i;let n=r==null?void 0:r.override;return n?n(t,e):(Bu=((i=r==null?void 0:r.scanLimit)!==null&&i!==void 0?i:1e9)>>1,Nu=r!=null&&r.timeout?Date.now()+r.timeout:0,iy=!1,sV(t,e,Ba(t,0,t.length,e,0,e.length)))}function KF(){return!iy}function QF(t,e,r){return aV(oV(t,e,r),t,e)}var Li=$e.Facet.define({combine:t=>t[0]}),ey=$e.StateEffect.define(),lV=$e.Facet.define(),Na=$e.StateField.define({create(t){return null},update(t,e){for(let r of e.effects)r.is(ey)&&(t=r.value);for(let r of e.state.facet(lV))t=r(t,e);return t}});function ay(t){let e=t.field(Na,!1);if(!e)return null;let r=t.facet(Li);return{chunks:e,side:r?r.side:null}}var es=class t{constructor(e,r,i,n,s,a=!0){this.changes=e,this.fromA=r,this.toA=i,this.fromB=n,this.toB=s,this.precise=a}offset(e,r){return e||r?new t(this.changes,this.fromA+e,this.toA+e,this.fromB+r,this.toB+r,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,r,i){let n=QF(e.toString(),r.toString(),i);return JF(n,e,r,0,0,KF())}static updateA(e,r,i,n,s){return FF(IF(e,n,!0,i.length),e,r,i,s)}static updateB(e,r,i,n,s){return FF(IF(e,n,!1,r.length),e,r,i,s)}};function PF(t,e,r,i){let n=r.lineAt(t),s=i.lineAt(e);return n.to==t&&s.to==e&&tf+1&&v>d+1)break;h.push(m.offset(-c+i,-u+n)),[f,d]=RF(m.toA+i,m.toB+n,e,r),o++}a.push(new es(h,c,Math.max(c,f),u,Math.max(u,d),s))}return a}var lp=1e3;function $F(t,e,r,i){let n=0,s=t.length;for(;;){if(n==s){let u=0,f=0;n&&({toA:u,toB:f}=t[n-1]);let d=e-(r?u:f);return[u+d,f+d]}let a=n+s>>1,o=t[a],[l,c]=r?[o.fromA,o.toA]:[o.fromB,o.toB];if(l>e)s=a;else if(c<=e)n=a+1;else return i?[o.fromA,o.fromB]:[o.toA,o.toB]}}function IF(t,e,r,i){let n=[];return e.iterChangedRanges((s,a,o,l)=>{let c=0,u=r?e.length:i,f=0,d=r?i:e.length;s>lp&&([c,f]=$F(t,s-lp,r,!0)),a=c?n[n.length-1]={fromA:m.fromA,fromB:m.fromB,toA:u,toB:d,diffA:m.diffA+g,diffB:m.diffB+v}:n.push({fromA:c,toA:u,fromB:f,toB:d,diffA:g,diffB:v})}),n}function FF(t,e,r,i,n){if(!t.length)return e;let s=[];for(let a=0,o=0,l=0,c=0;;a++){let u=a==t.length?null:t[a],f=u?u.fromA+o:r.length,d=u?u.fromB+l:i.length;for(;cf||v.endB+l>d)break;s.push(v.offset(o,l)),c++}if(!u)break;let h=u.toA+o+u.diffA,m=u.toB+l+u.diffB,g=QF(r.sliceString(f,h),i.sliceString(d,m),n);for(let v of JF(g,r,i,f,d,KF()))s.push(v);for(o+=u.diffA,l+=u.diffB;ch&&v.fromB+l>m)break;c++}}return s}var cV={scanLimit:500},eO=Me.ViewPlugin.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=DF(t))}update(t){(t.docChanged||t.viewportChanged||uV(t.startState,t.state)||fV(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=DF(t.view))}},{decorations:t=>t.deco}),cp=$e.Prec.low((0,Me.gutter)({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(eO))===null||e===void 0?void 0:e.gutter)||$e.RangeSet.empty}}));function uV(t,e){return t.field(Na,!1)!=e.field(Na,!1)}function fV(t,e){return t.facet(Li)!=e.facet(Li)}var OF=Me.Decoration.line({class:"cm-changedLine"}),dV=Me.Decoration.mark({class:"cm-changedText"}),hV=Me.Decoration.mark({tagName:"ins",class:"cm-insertedLine"}),pV=Me.Decoration.mark({tagName:"del",class:"cm-deletedLine"}),MF=new class extends Me.GutterMarker{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function mV(t,e,r,i,n,s){let a=r?t.fromA:t.fromB,o=r?t.toA:t.toB,l=0;if(a!=o){n.add(a,a,OF),n.add(a,o,r?pV:hV),s&&s.add(a,a,MF);for(let c=e.iterRange(a,o-1),u=a;!c.next().done;){if(c.lineBreak){u++,n.add(u,u,OF),s&&s.add(u,u,MF);continue}let f=u+c.value.length;if(i)for(;l=u)break;(a?f.toA:f.toB)>c&&(!s||!s(t.state,f,o,l))&&mV(f,t.state.doc,a,i,o,l)}return{deco:o.finish(),gutter:l&&l.finish()}}var Rl=class extends Me.WidgetType{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},hp=$e.StateEffect.define({map:(t,e)=>t.map(e)}),Hu=$e.StateField.define({create:()=>Me.Decoration.none,update:(t,e)=>{for(let r of e.effects)if(r.is(hp))return r.value;return t.map(e.changes)},provide:t=>Me.EditorView.decorations.from(t)}),up=.01;function LF(t,e){if(t.size!=e.size)return!1;let r=t.iter(),i=e.iter();for(;r.value;){if(r.from!=i.from||Math.abs(r.value.spec.widget.height-i.value.spec.widget.height)>1)return!1;r.next(),i.next()}return!0}function gV(t,e,r){let i=new $e.RangeSetBuilder,n=new $e.RangeSetBuilder,s=t.state.field(Hu).iter(),a=e.state.field(Hu).iter(),o=0,l=0,c=0,u=0,f=t.viewport,d=e.viewport;for(let v=0;;v++){let w=vup&&(u+=A,n.add(l,l,Me.Decoration.widget({widget:new Rl(A),block:!0,side:-1})))}if(b>o+1e3&&of.from&&ld.from){let x=Math.min(f.from-o,d.from-l);o+=x,l+=x,v--}else if(w)o=w.toA,l=w.toB;else break;for(;s.value&&s.fromup&&n.add(e.state.doc.length,e.state.doc.length,Me.Decoration.widget({widget:new Rl(h),block:!0,side:1}));let m=i.finish(),g=n.finish();LF(m,t.state.field(Hu))||t.dispatch({effects:hp.of(m)}),LF(g,e.state.field(Hu))||e.dispatch({effects:hp.of(g)})}var ty=$e.StateEffect.define({map:(t,e)=>e.mapPos(t)});var ry=class extends Me.WidgetType{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let r=document.createElement("div");return r.className="cm-collapsedLines",r.textContent=e.state.phrase("$ unchanged lines",this.lines),r.addEventListener("click",i=>{let n=e.posAtDOM(i.target);e.dispatch({effects:ty.of(n)});let{side:s,sibling:a}=e.state.facet(Li);a&&a().dispatch({effects:ty.of(vV(n,e.state.field(Na),s=="a"))})}),r}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}};function vV(t,e,r){let i=0,n=0;for(let s=0;;s++){let a=s=t)return n+(t-i);[i,n]=r?[a.toA,a.toB]:[a.toB,a.toA]}}var wV=$e.StateField.define({create(t){return Me.Decoration.none},update(t,e){t=t.map(e.changes);for(let r of e.effects)r.is(ty)&&(t=t.update({filter:i=>i!=r.value}));return t},provide:t=>Me.EditorView.decorations.from(t)});function BF({margin:t=3,minSize:e=4}){return wV.init(r=>yV(r,t,e))}function yV(t,e,r){let i=new $e.RangeSetBuilder,n=t.facet(Li).side=="a",s=t.field(Na),a=1;for(let o=0;;o++){let l=o=r&&i.add(t.doc.line(c).from,t.doc.line(u).to,Me.Decoration.replace({widget:new ry(f),block:!0})),!l)break;a=t.doc.lineAt(Math.min(t.doc.length,n?l.toA:l.toB)).number}return i.finish()}var bV=Me.EditorView.styleModule.of(new op({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),_V=Me.EditorView.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"\u299A"',marginInlineEnd:"7px"},"&:after":{content:'"\u299A"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),NF=new $e.Compartment,fp=new $e.Compartment,pp=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||cV;let r=[$e.Prec.low(eO),_V,bV,Hu,Me.EditorView.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(d=>d.effects.some(h=>h.is(hp)))&&this.measure()})],i=[Li.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(cp);let n=$e.EditorState.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],Me.EditorView.editorAttributes.of({class:"cm-merge-a"}),fp.of(i),r]}),s=[Li.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&s.push(cp);let a=$e.EditorState.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],Me.EditorView.editorAttributes.of({class:"cm-merge-b"}),fp.of(s),r]});this.chunks=es.build(n.doc,a.doc,this.diffConf);let o=[Na.init(()=>this.chunks),NF.of(e.collapseUnchanged?BF(e.collapseUnchanged):[])];n=n.update({effects:$e.StateEffect.appendConfig.of(o)}).state,a=a.update({effects:$e.StateEffect.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let l=e.orientation||"a-b",c=document.createElement("div");c.className="cm-mergeViewEditor";let u=document.createElement("div");u.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?c:u),this.editorDOM.appendChild(l=="a-b"?u:c),this.a=new Me.EditorView({state:n,parent:c,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new Me.EditorView({state:a,parent:u,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,r){if(e.some(i=>i.docChanged)){let i=e[e.length-1],n=e.reduce((a,o)=>a.compose(o.changes),$e.ChangeSet.empty(e[0].startState.doc.length));this.chunks=r==this.a?es.updateA(this.chunks,i.newDoc,this.b.state.doc,n,this.diffConf):es.updateB(this.chunks,this.a.state.doc,i.newDoc,n,this.diffConf),r.update([...e,i.state.update({effects:ey.of(this.chunks)})]);let s=r==this.a?this.b:this.a;s.update([s.state.update({effects:ey.of(this.chunks)})]),this.scheduleMeasure()}else r.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let s=e.orientation!="b-a";if(s!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let a=this.a.dom.parentNode,o=this.b.dom.parentNode;a.remove(),o.remove(),this.editorDOM.insertBefore(s?a:o,this.editorDOM.firstChild),this.editorDOM.appendChild(s?o:a),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let s=!!this.revertDOM,a=this.revertToA,o=this.renderRevert;"revertControls"in e&&(s=!!e.revertControls,a=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(s,a,o)}let r="highlightChanges"in e,i="gutter"in e,n="collapseUnchanged"in e;if(r||i||n){let s=[],a=[];if(r||i){let o=this.a.state.facet(Li),l=i?e.gutter!==!1:o.markGutter,c=r?e.highlightChanges!==!1:o.highlightChanges;s.push(fp.reconfigure([Li.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:l}),l?cp:[]])),a.push(fp.reconfigure([Li.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:l}),l?cp:[]]))}if(n){let o=NF.reconfigure(e.collapseUnchanged?BF(e.collapseUnchanged):[]);s.push(o),a.push(o)}this.a.dispatch({effects:s}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,r,i){this.revertToA=r,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=i,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",n=>this.revertClicked(n)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){gV(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,r=e.firstChild,i=this.a.viewport,n=this.b.viewport;for(let s=0;si.to||a.fromB>n.to)break;if(a.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function HF(t){let e=t.nextSibling;return t.remove(),e}var oy=require("@codemirror/state");function ly(t,e,r){let i=[],n=t.split(` +`),s=e.split(` +`);for(let a of r){let{oldStart:o,oldLines:l,newStart:c,newLines:u}=a,f=Nt.createHunk(o,l,c,u);if(a.oldLines>0){for(let d=o;dn.length&&n.last()!=""&&(f.removed.no_nl_at_eof=!0)}if(a.newLines>0){for(let d=c;ds.length&&s.last()!=""&&(f.added.no_nl_at_eof=!0)}i.push(f)}return i}function cy(t,e,r){let i=e.lineAt(t.fromA).number,n=t.fromA==t.toA?0:mp(e,t.endA)-i+1,s=r.lineAt(t.fromB).number,a=t.fromB==t.toB?0:mp(r,t.endB)-s+1,o={oldStart:i,oldLines:n,newStart:s,newLines:a};return o.oldLines==0&&(o.oldStart-=1),o.newLines==0&&(o.newStart-=1),o}var tO={scanLimit:1e3,timeout:200};function xV(t,e,r,i){let n=oy.Text.of(t.split(` +`)),s=oy.Text.of(e.split(` +`)),a=r&&i?es.updateB(r,n,s,i,tO):es.build(n,s,tO),o=[];for(let l=0;lh.vend&&(f=f-(h.added.count-h.removed.count)),o>h.vend&&(d=d-(h.added.count-h.removed.count));c.added.lines=u.compareText.split(` +`).slice(f-1,d),u.compareTextHead?c.removed.lines=u.compareTextHead.split(` +`).slice(c.removed.start-1,c.removed.start-1+c.removed.count):c.removed.lines=[]}else c.added.lines=e.doc.toString().split(` +`).slice(a-1,o),o===e.doc.lines&&!e.doc.toString().endsWith(` +`)&&(c.added.no_nl_at_eof=!0),c.removed.lines=u.compareText.split(` +`).slice(c.removed.start-1,c.removed.start-1+c.removed.count),c.removed.start+c.removed.count-1===u.compareText.split(` +`).length&&!u.compareText.endsWith(` +`)&&(c.removed.no_nl_at_eof=!0);return c}},Ir=Il.StateField.define({create:t=>{},update:(t,e)=>{let r=t?{...t}:{maxDiffTimeMs:0,hunks:[],stagedHunks:[],chunks:void 0,isDirty:!1},i=!1;for(let n of e.effects)n.is(Ol)&&(r.compareText=n.value.compareText,r.compareTextHead=n.value.compareTextHead,i=(t==null?void 0:t.compareText)!==n.value.compareText,i&&(r.chunks=void 0)),n.is(Uu)&&iO(r,n.value,e.state);if(r.compareText!==void 0){if(i||e.docChanged){r.isDirty=!0;let n=SV(e,r.compareText,r.chunks,r.maxDiffTimeMs);n&&iO(r,n,e.state)}}else r.compareText=void 0,r.compareTextHead=void 0,r.chunks=void 0,r.hunks=[],r.stagedHunks=[],r.isDirty=!1;return r}});function iO(t,e,r){var n,s;t.hunks=e.hunks,t.chunks=e.chunks,t.isDirty=!1,t.maxDiffTimeMs=Math.max(.95*t.maxDiffTimeMs,e.diffDuration);let i=r.field(Fl.editorInfoField).file;(s=(n=Fi.plugin)==null?void 0:n.editorIntegration.signsFeature.changeStatusBar)==null||s.display(t.hunks,i)}var uy=Il.StateField.define({create:()=>({debouncer:(0,Fl.debounce)(t=>{let{state:e,compareText:r,previousChunks:i,changeDesc:n}=t,s=nO(e,r,i,n);e.field(Fl.editorEditorField).dispatch({effects:Uu.of(s)})},1e3,!0),maxDiffTimeMs:0}),update:(t,e)=>{var r;for(let i of e.effects)if(i.is(Uu))return t.changeDesc=void 0,t;return!t.changeDesc&&e.changes?t.changeDesc=e.changes:t.changeDesc=(r=t.changeDesc)==null?void 0:r.composeDesc(e.changes),t}});function nO(t,e,r,i){let n=t.doc.toString(),s=performance.now(),{hunks:a,chunks:o}=rO(e,n,r,i),l=performance.now()-s;return{hunks:a,chunks:o,diffDuration:l}}function SV(t,e,r,i){let n=t.state,s=Math.abs(t.changes.length-t.changes.newLength),a=n.field(uy);if(s>1e3||i>16)a.debouncer({state:n,compareText:e,previousChunks:r,changeDesc:a.changeDesc});else return a.changeDesc=void 0,nO(n,e,r,t.changes)}var Ol=Il.StateEffect.define(),Uu=Il.StateEffect.define();function sO(t,e){return e.update({effects:Ol.of(t)})}p();p();p();var it;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(it||(it={}));var aO={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},oO={LINES:"lines",WORDS:"words",NONE:"none"},lO={WORD:"word",CHAR:"char"},Ha;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(Ha||(Ha={}));p();var EV=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],kV=RegExp("["+EV.join("\\")+"]","g");function cO(t){return t.replace(kV,"\\$&")}function fy(t){return t&&t.replace(/\\/g,"/")}function uO(t){let e,r,i,n=0;for(e=0,i=t.length;e1?r[r.length-1]:e}function dO(t,e){return e.reduce((r,i)=>r||t.startsWith(i),!1)}var hO=["a/","b/","i/","w/","c/","o/"];function Vs(t,e,r){let i=r!==void 0?[...hO,r]:hO,n=e?new RegExp(`^${cO(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,s=""]=n.exec(t)||[],a=i.find(l=>s.indexOf(l)===0);return(a?s.slice(a.length):s).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function AV(t,e){return Vs(t,"---",e)}function TV(t,e){return Vs(t,"+++",e)}function pO(t,e={}){let r=[],i=null,n=null,s=null,a=null,o=null,l=null,c=null,u="--- ",f="+++ ",d="@@",h=/^old mode (\d{6})/,m=/^new mode (\d{6})/,g=/^deleted file mode (\d{6})/,v=/^new file mode (\d{6})/,w=/^copy from "?(.+)"?/,b=/^copy to "?(.+)"?/,k=/^rename from "?(.+)"?/,x=/^rename to "?(.+)"?/,E=/^similarity index (\d+)%/,A=/^dissimilarity index (\d+)%/,y=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,S=/^Binary files (.*) and (.*) differ/,_=/^GIT binary patch/,T=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,P=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,D=/^new file mode (\d{6})/,B=/^deleted file mode (\d{6}),(\d{6})/,N=t.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,` +`).split(` +`);function ce(){n!==null&&i!==null&&(i.blocks.push(n),n=null)}function Pe(){i!==null&&(!i.oldName&&l!==null&&(i.oldName=l),!i.newName&&c!==null&&(i.newName=c),i.newName&&(r.push(i),i=null)),l=null,c=null}function ve(){ce(),Pe(),i={blocks:[],deletedLines:0,addedLines:0}}function se(z){ce();let Q;i!==null&&((Q=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(z))?(i.isCombined=!1,s=parseInt(Q[1],10),o=parseInt(Q[2],10)):(Q=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(z))?(i.isCombined=!0,s=parseInt(Q[1],10),a=parseInt(Q[2],10),o=parseInt(Q[3],10)):(z.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),s=0,o=0,i.isCombined=!1)),n={lines:[],oldStartLine:s,oldStartLine2:a,newStartLine:o,header:z}}function xe(z){if(i===null||n===null||s===null||o===null)return;let Q={content:z},j=i.isCombined?["+ "," +","++"]:["+"],Le=i.isCombined?["- "," -","--"]:["-"];dO(z,j)?(i.addedLines++,Q.type=it.INSERT,Q.oldNumber=void 0,Q.newNumber=o++):dO(z,Le)?(i.deletedLines++,Q.type=it.DELETE,Q.oldNumber=s++,Q.newNumber=void 0):(Q.type=it.CONTEXT,Q.oldNumber=s++,Q.newNumber=o++),n.lines.push(Q)}function we(z,Q){let j=Q;for(;j{if(!z||z.startsWith("*"))return;let j,Le=N[Q-1],lr=N[Q+1],Ft=N[Q+2];if(z.startsWith("diff --git")||z.startsWith("diff --combined")){if(ve(),(j=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(z))&&(l=Vs(j[1],void 0,e.dstPrefix),c=Vs(j[2],void 0,e.srcPrefix)),i===null)throw new Error("Where is my file !!!");i.isGitDiff=!0;return}if(z.startsWith("Binary files")&&!(i!=null&&i.isGitDiff)){if(ve(),(j=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(z))&&(l=Vs(j[1],void 0,e.dstPrefix),c=Vs(j[2],void 0,e.srcPrefix)),i===null)throw new Error("Where is my file !!!");i.isBinary=!0;return}if((!i||!i.isGitDiff&&i&&z.startsWith(u)&&lr.startsWith(f)&&Ft.startsWith(d))&&ve(),i!=null&&i.isTooBig)return;if(i&&(typeof e.diffMaxChanges=="number"&&i.addedLines+i.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&z.length>e.diffMaxLineLength)){i.isTooBig=!0,i.addedLines=0,i.deletedLines=0,i.blocks=[],n=null;let At=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(r.length):"Diff too big to be displayed";se(At);return}if(z.startsWith(u)&&lr.startsWith(f)||z.startsWith(f)&&Le.startsWith(u)){if(i&&!i.oldName&&z.startsWith("--- ")&&(j=AV(z,e.srcPrefix))){i.oldName=j,i.language=fO(i.oldName,i.language);return}if(i&&!i.newName&&z.startsWith("+++ ")&&(j=TV(z,e.dstPrefix))){i.newName=j,i.language=fO(i.newName,i.language);return}}if(i&&(z.startsWith(d)||i.isGitDiff&&i.oldName&&i.newName&&!n)){se(z);return}if(n&&(z.startsWith("+")||z.startsWith("-")||z.startsWith(" "))){xe(z);return}let Ie=!we(z,Q);if(i===null)throw new Error("Where is my file !!!");(j=h.exec(z))?i.oldMode=j[1]:(j=m.exec(z))?i.newMode=j[1]:(j=g.exec(z))?(i.deletedFileMode=j[1],i.isDeleted=!0):(j=v.exec(z))?(i.newFileMode=j[1],i.isNew=!0):(j=w.exec(z))?(Ie&&(i.oldName=j[1]),i.isCopy=!0):(j=b.exec(z))?(Ie&&(i.newName=j[1]),i.isCopy=!0):(j=k.exec(z))?(Ie&&(i.oldName=j[1]),i.isRename=!0):(j=x.exec(z))?(Ie&&(i.newName=j[1]),i.isRename=!0):(j=S.exec(z))?(i.isBinary=!0,i.oldName=Vs(j[1],void 0,e.srcPrefix),i.newName=Vs(j[2],void 0,e.dstPrefix),se("Binary file")):_.test(z)?(i.isBinary=!0,se(z)):(j=E.exec(z))?i.unchangedPercentage=parseInt(j[1],10):(j=A.exec(z))?i.changedPercentage=parseInt(j[1],10):(j=y.exec(z))?(i.checksumBefore=j[1],i.checksumAfter=j[2],j[3]&&(i.mode=j[3])):(j=T.exec(z))?(i.checksumBefore=[j[2],j[3]],i.checksumAfter=j[1]):(j=P.exec(z))?(i.oldMode=[j[2],j[3]],i.newMode=j[1]):(j=D.exec(z))?(i.newFileMode=j[1],i.isNew=!0):(j=B.exec(z))&&(i.deletedFileMode=j[1],i.isDeleted=!0)}),ce(),Pe(),r}p();p();p();function PV(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],i;for(i=0;i<=e.length;i++)r[i]=[i];let n;for(n=0;n<=t.length;n++)r[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?r[i][n]=r[i-1][n-1]:r[i][n]=Math.min(r[i-1][n-1]+1,Math.min(r[i][n-1]+1,r[i-1][n]+1));return r[e.length][t.length]}function Ml(t){return(e,r)=>{let i=t(e).trim(),n=t(r).trim();return PV(i,n)/(i.length+n.length)}}function Dl(t){function e(i,n,s=new Map){let a=1/0,o;for(let l=0;l0||o.indexB>0)&&(k=v.concat(k)),(i.length>d||n.length>h)&&(k=k.concat(b)),k}return r}var Vt={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},Ua={matching:oO.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:lO.WORD,colorScheme:Ha.LIGHT},vn="/",mO=Ml(t=>t.value),RV=Dl(mO);function hy(t){return t.indexOf("dev/null")!==-1}function $V(t){return t.replace(/(]*>((.|\n)*?)<\/ins>)/g,"")}function IV(t){return t.replace(/(]*>((.|\n)*?)<\/del>)/g,"")}function Ll(t){switch(t){case it.CONTEXT:return Vt.CONTEXT;case it.INSERT:return Vt.INSERTS;case it.DELETE:return Vt.DELETES}}function Bl(t){switch(t){case Ha.DARK:return"d2h-dark-color-scheme";case Ha.AUTO:return"d2h-auto-color-scheme";case Ha.LIGHT:default:return"d2h-light-color-scheme"}}function FV(t){return t?2:1}function Ws(t){return t.slice(0).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function yi(t,e,r=!0){let i=FV(e);return{prefix:t.substring(0,i),content:r?Ws(t.substring(i)):t.substring(i)}}function Ga(t){let e=fy(t.oldName),r=fy(t.newName);if(e!==r&&!hy(e)&&!hy(r)){let i=[],n=[],s=e.split(vn),a=r.split(vn),o=s.length,l=a.length,c=0,u=o-1,f=l-1;for(;cc&&f>c&&s[u]===a[f];)n.unshift(a[f]),u-=1,f-=1;let d=i.join(vn),h=n.join(vn),m=s.slice(c,u+1).join(vn),g=a.slice(c,f+1).join(vn);return d.length&&h.length?d+vn+"{"+m+" \u2192 "+g+"}"+vn+h:d.length?d+vn+"{"+m+" \u2192 "+g+"}":h.length?"{"+m+" \u2192 "+g+"}"+vn+h:e+" \u2192 "+r}else return hy(r)?e:r}function Nl(t){return`d2h-${uO(Ga(t)).toString().slice(-6)}`}function Hl(t){let e="file-changed";return t.isRename||t.isCopy?e="file-renamed":t.isNew?e="file-added":t.isDeleted?e="file-deleted":t.newName!==t.oldName&&(e="file-renamed"),e}function vp(t,e,r,i={}){let{matching:n,maxLineLengthHighlight:s,matchWordsThreshold:a,diffStyle:o}=Object.assign(Object.assign({},Ua),i),l=yi(t,r,!1),c=yi(e,r,!1);if(l.content.length>s||c.content.length>s)return{oldLine:{prefix:l.prefix,content:Ws(l.content)},newLine:{prefix:c.prefix,content:Ws(c.content)}};let u=o==="char"?Av(l.content,c.content):Iv(l.content,c.content),f=[];if(o==="word"&&n==="words"){let h=u.filter(v=>v.removed),m=u.filter(v=>v.added);RV(m,h).forEach(v=>{v[0].length===1&&v[1].length===1&&mO(v[0][0],v[1][0]){let g=m.added?"ins":m.removed?"del":null,v=f.indexOf(m)>-1?' class="d2h-change"':"",w=Ws(m.value);return g!==null?`${h}<${g}${v}>${w}`:`${h}${w}`},"");return{oldLine:{prefix:l.prefix,content:$V(d)},newLine:{prefix:c.prefix,content:IV(d)}}}var gO="file-summary",OV="icon",MV={colorScheme:Ua.colorScheme},wp=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},MV),r)}render(e){let r=e.map(i=>this.hoganUtils.render(gO,"line",{fileHtmlId:Nl(i),oldName:i.oldName,newName:i.newName,fileName:Ga(i),deletedLines:"-"+i.deletedLines,addedLines:"+"+i.addedLines},{fileIcon:this.hoganUtils.template(OV,Hl(i))})).join(` +`);return this.hoganUtils.render(gO,"wrapper",{colorScheme:Bl(this.config.colorScheme),filesNumber:e.length,files:r})}};p();var my=Object.assign(Object.assign({},Ua),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Gu="generic",vO="line-by-line",DV="icon",LV="tag",ju=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},my),r)}render(e){let r=e.map(i=>{let n;return i.blocks.length?n=this.generateFileHtml(i):n=this.generateEmptyDiff(),this.makeFileDiffHtml(i,n)}).join(` +`);return this.hoganUtils.render(Gu,"wrapper",{colorScheme:Bl(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let i=this.hoganUtils.template(vO,"file-diff"),n=this.hoganUtils.template(Gu,"file-path"),s=this.hoganUtils.template(DV,"file"),a=this.hoganUtils.template(LV,Hl(e));return i.render({file:e,fileHtmlId:Nl(e),diffs:r,filePath:n.render({fileDiffName:Ga(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return this.hoganUtils.render(Gu,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:Vt})}generateFileHtml(e){let r=Dl(Ml(i=>yi(i.content,e.isCombined).content));return e.blocks.map(i=>{let n=this.hoganUtils.render(Gu,"block-header",{CSSLineClass:Vt,blockHeader:e.isTooBig?i.header:Ws(i.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(i).forEach(([s,a,o])=>{if(a.length&&o.length&&!s.length)this.applyRematchMatching(a,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e,e.isCombined,l,c);n+=u,n+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=yi(l.content,e.isCombined);n+=this.generateSingleLineHtml(e,{type:Vt.CONTEXT,prefix:c,content:u,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e,e.isCombined,a,o);n+=l,n+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),n}).join(` +`)}applyLineGroupping(e){let r=[],i=[],n=[];for(let s=0;s0)&&(r.push([[],i,n]),i=[],n=[]),a.type===it.CONTEXT?r.push([[a],[],[]]):a.type===it.INSERT&&i.length===0?r.push([[],[],[a]]):a.type===it.INSERT&&i.length>0?n.push(a):a.type===it.DELETE&&i.push(a)}return(i.length||n.length)&&(r.push([[],i,n]),i=[],n=[]),r}applyRematchMatching(e,r,i){let n=e.length*r.length,s=gp(e.concat(r).map(o=>o.content.length));return n{let n;return i.blocks.length?n=this.generateFileHtml(i):n=this.generateEmptyDiff(),this.makeFileDiffHtml(i,n)}).join(` +`);return this.hoganUtils.render(qu,"wrapper",{colorScheme:Bl(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let i=this.hoganUtils.template(BV,"file-diff"),n=this.hoganUtils.template(qu,"file-path"),s=this.hoganUtils.template(NV,"file"),a=this.hoganUtils.template(HV,Hl(e));return i.render({file:e,fileHtmlId:Nl(e),diffs:r,filePath:n.render({fileDiffName:Ga(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(qu,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:Vt})}}generateFileHtml(e){let r=Dl(Ml(i=>yi(i.content,e.isCombined).content));return e.blocks.map(i=>{let n={left:this.makeHeaderHtml(i.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(i).forEach(([s,a,o])=>{if(a.length&&o.length&&!s.length)this.applyRematchMatching(a,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e.isCombined,l,c);n.left+=u,n.right+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=yi(l.content,e.isCombined),{left:f,right:d}=this.generateLineHtml({type:Vt.CONTEXT,prefix:c,content:u,number:l.oldNumber},{type:Vt.CONTEXT,prefix:c,content:u,number:l.newNumber});n.left+=f,n.right+=d});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e.isCombined,a,o);n.left+=l,n.right+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),n}).reduce((i,n)=>({left:i.left+n.left,right:i.right+n.right}),{left:"",right:""})}applyLineGroupping(e){let r=[],i=[],n=[];for(let s=0;s0)&&(r.push([[],i,n]),i=[],n=[]),a.type===it.CONTEXT?r.push([[a],[],[]]):a.type===it.INSERT&&i.length===0?r.push([[],[],[a]]):a.type===it.INSERT&&i.length>0?n.push(a):a.type===it.DELETE&&i.push(a)}return(i.length||n.length)&&(r.push([[],i,n]),i=[],n=[]),r}applyRematchMatching(e,r,i){let n=e.length*r.length,s=gp(e.concat(r).map(o=>o.content.length));return n'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(i.rp("'),i.b(i.v(i.f("fileName",t,e,0))),i.b(""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(i.v(i.f("addedLines",t,e,0))),i.b(""),i.b(` +`+r),i.b(' '),i.b(i.v(i.f("deletedLines",t,e,0))),i.b(""),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{"'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' Files changed ('),i.b(i.v(i.f("filesNumber",t,e,0))),i.b(")"),i.b(` +`+r),i.b(' hide'),i.b(` +`+r),i.b(' show'),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
    '),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("files",t,e,0))),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});wt["generic-block-header"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b(""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b('
'),i.s(i.f("blockHeader",t,e,1),t,e,0,156,173,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(a.t(a.f("blockHeader",n,s,0)))}),t.pop()),i.s(i.f("blockHeader",t,e,1),t,e,1,0,0,"")||i.b(" "),i.b("
"),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});wt["generic-empty-diff"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b(""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(" File without changes"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});wt["generic-file-path"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b(''),i.b(` +`+r),i.b(i.rp("'),i.b(i.v(i.f("fileDiffName",t,e,0))),i.b(""),i.b(` +`+r),i.b(i.rp(""),i.b(` +`+r),i.b('"),i.fl()},partials:{""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("lineNumber",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.s(i.f("prefix",t,e,1),t,e,0,162,238,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(' '),a.b(a.t(a.f("prefix",n,s,0))),a.b(""),a.b(` +`+r)}),t.pop()),i.s(i.f("prefix",t,e,1),t,e,1,0,0,"")||(i.b('  '),i.b(` +`+r)),i.s(i.f("content",t,e,1),t,e,0,371,445,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(' '),a.b(a.t(a.f("content",n,s,0))),a.b(""),a.b(` +`+r)}),t.pop()),i.s(i.f("content",t,e,1),t,e,1,0,0,"")||(i.b('
'),i.b(` +`+r)),i.b("
"),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});wt["generic-wrapper"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("content",t,e,0))),i.b(` +`+r),i.b("
"),i.fl()},partials:{},subs:{}});wt["icon-file-added"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});wt["icon-file-changed"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});wt["icon-file-deleted"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});wt["icon-file-renamed"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});wt["icon-file"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});wt["line-by-line-file-diff"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("filePath",t,e,0))),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("diffs",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.fl()},partials:{},subs:{}});wt["line-by-line-numbers"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(i.v(i.f("oldNumber",t,e,0))),i.b("
"),i.b(` +`+r),i.b('
'),i.b(i.v(i.f("newNumber",t,e,0))),i.b("
"),i.fl()},partials:{},subs:{}});wt["side-by-side-file-diff"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("filePath",t,e,0))),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.d("diffs.left",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.d("diffs.right",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.fl()},partials:{},subs:{}});wt["tag-file-added"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('ADDED'),i.fl()},partials:{},subs:{}});wt["tag-file-changed"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('CHANGED'),i.fl()},partials:{},subs:{}});wt["tag-file-deleted"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('DELETED'),i.fl()},partials:{},subs:{}});wt["tag-file-renamed"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('RENAMED'),i.fl()},partials:{},subs:{}});var Vu=class{constructor({compiledTemplates:e={},rawTemplates:r={}}){let i=Object.entries(r).reduce((n,[s,a])=>{let o=by.compile(a,{asString:!1});return Object.assign(Object.assign({},n),{[s]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},wt),e),i)}static compile(e){return by.compile(e,{asString:!1})}render(e,r,i,n,s){let a=this.templateKey(e,r);try{return this.preCompiledTemplates[a].render(i,n,s)}catch(o){throw new Error(`Could not find template to render '${a}'`)}}template(e,r){return this.preCompiledTemplates[this.templateKey(e,r)]}templateKey(e,r){return`${e}-${r}`}};var GV=Object.assign(Object.assign(Object.assign({},my),gy),{outputFormat:aO.LINE_BY_LINE,drawFileList:!0});function bp(t,e={}){let r=Object.assign(Object.assign({},GV),e),i=typeof t=="string"?pO(t,r):t,n=new Vu(r),{colorScheme:s}=r,a={colorScheme:s},o=r.drawFileList?new wp(n,a).render(i):"",l=r.outputFormat==="side-by-side"?new zu(n,r).render(i):new ju(n,r).render(i);return o+l}var kO=Mt(SO());var ja=require("obsidian"),_y=Wu.StateEffect.define();function Ys(t,e){let r=t.state,i=r.field(xp),n=r.field(Ir),s=r.doc.lineAt(e!=null?e:r.selection.main.head).number,a=Nt.findHunk(s,n==null?void 0:n.hunks)[0];if(!a)return;let o=r.doc.line(Math.max(1,a.added.start)).from,l=i.has(o);return r.field(ja.editorEditorField).dispatch({effects:_y.of({pos:o,add:!l})})}var xp=Wu.StateField.define({create:()=>new Set,update(t,e){let r=new Set;for(let i of e.effects)i.is(_y)&&(i.value.add?t.add(i.value.pos):t.delete(i.value.pos));for(let i of t)r.add(e.changes.mapPos(i));return r}}),AO=Wu.StateField.define({create:t=>EO(t),update(t,e){return e.docChanged||e.effects.some(r=>r.is(Ol)||r.is(_y))?EO(e.state):t},provide:t=>_p.showTooltip.computeN([t],e=>e.field(t))}),TO=_p.EditorView.baseTheme({".cm-tooltip.git-diff-tooltip":{"z-index":"var(--layer-popover)",backgroundColor:"var(--background-primary-alt)",border:"var(--border-width) solid var(--background-primary-alt)",borderRadius:"var(--radius-s)"},".cm-tooltip.git-diff-tooltip .tooltip-toolbar":{display:"flex",padding:"var(--size-2-1)"}});function EO(t){let e=t.field(Ir);return e?[...t.field(xp)].map(i=>{let n=t.doc.lineAt(i),s=Nt.findHunk(n.number,e.hunks)[0];if(s)return{pos:i,above:!1,arrow:!1,strictSide:!0,clip:!1,create:()=>jV(s,t,i)}}).filter(i=>i!==void 0):[]}function jV(t,e,r){var g,v;let i=Nt.createPatch("file",[t],"10064",!1).join(` +`)+` +`,n=bp(i,{colorScheme:kO.ColorSchemeType.AUTO,diffStyle:"word",drawFileList:!1}),s=new DOMParser().parseFromString(n,"text/html").querySelector(".d2h-file-diff"),a=document.createElement("div"),o=document.createElement("div");o.addClass("tooltip-toolbar");let l=(w,b)=>{let k=document.createElement("div");return(0,ja.setIcon)(k,w),k.setAttr("aria-label",b),k.addClass("clickable-icon"),k},c=l("x","Close hunk"),u=l("plus","Stage hunk"),f=l("undo","Reset hunk");o.appendChild(c),o.appendChild(u),o.appendChild(f),a.appendChild(o),a.appendChild(s),a.addClass("git-diff-tooltip","git-diff");let d=e.field(ja.editorEditorField);c.onclick=()=>{Ys(d,r)},u.onclick=()=>{let w=Fi.plugin;w&&(w.promiseQueue.addTask(()=>w.hunkActions.stageHunk(r)),Ys(d,r))},f.onclick=()=>{let w=Fi.plugin;w&&(w.hunkActions.resetHunk(r),Ys(d,r))};let h=(v=(g=Fi.plugin)==null?void 0:g.app.workspace.getActiveViewOfType(ja.MarkdownView))==null?void 0:v.scope,m=h==null?void 0:h.register(null,"Escape",(w,b)=>{Ys(d,r)});return{dom:a,destroy:()=>{m&&(h==null||h.unregister(m))},update:w=>{r=w.changes.mapPos(r)}}}function CO(t){let e=t.app;t.addCommand({id:"edit-gitignore",name:"Edit .gitignore",callback:async()=>{let r=t.gitManager.getRelativeVaultPath(".gitignore");await e.vault.adapter.exists(r)||await e.vault.adapter.write(r,"");let i=await e.vault.adapter.read(r),s=await new ap(e,i).openAndGetReslt();s!==void 0&&(await e.vault.adapter.write(r,s),await t.refresh())}}),t.addCommand({id:"open-git-view",name:"Open source control view",callback:async()=>{var n;let r=e.workspace.getLeavesOfType(zt.type),i;r.length===0?(i=(n=e.workspace.getRightLeaf(!1))!=null?n:e.workspace.getLeaf(),await i.setViewState({type:zt.type})):i=r.first(),await e.workspace.revealLeaf(i),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-history-view",name:"Open history view",callback:async()=>{var n;let r=e.workspace.getLeavesOfType(gi.type),i;r.length===0?(i=(n=e.workspace.getRightLeaf(!1))!=null?n:e.workspace.getLeaf(),await i.setViewState({type:gi.type})):i=r.first(),await e.workspace.revealLeaf(i),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-diff-view",name:"Open diff view",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;{let n=t.gitManager.getRelativeRepoPath(i.path,!0);t.tools.openDiff({aFile:n,aRef:""})}}}),t.addCommand({id:"view-file-on-github",name:"Open file on GitHub",editorCallback:(r,{file:i})=>{if(i)return gF(r,i,t.gitManager)}}),t.addCommand({id:"view-history-on-github",name:"Open file history on GitHub",editorCallback:(r,{file:i})=>{if(i)return vF(i,t.gitManager)}}),t.addCommand({id:"pull",name:"Pull",callback:()=>t.promiseQueue.addTask(()=>t.pullChangesFromRemote())}),t.addCommand({id:"fetch",name:"Fetch",callback:()=>t.promiseQueue.addTask(()=>t.fetch())}),t.addCommand({id:"switch-to-remote-branch",name:"Switch to remote branch",callback:()=>t.promiseQueue.addTask(()=>t.switchRemoteBranch())}),t.addCommand({id:"add-to-gitignore",name:"Add file to .gitignore",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.addFileToGitignore(i.path,i instanceof Ni.TFolder).catch(n=>t.displayError(n))}}),t.addCommand({id:"push",name:"Commit-and-sync",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync({fromAutoBackup:!1}))}),t.addCommand({id:"backup-and-close",name:"Commit-and-sync and then close Obsidian",callback:()=>t.promiseQueue.addTask(async()=>{await t.commitAndSync({fromAutoBackup:!1}),window.close()})}),t.addCommand({id:"commit-push-specified-message",name:"Commit-and-sync with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync({fromAutoBackup:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit",name:"Commit all changes",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1}))}),t.addCommand({id:"commit-specified-message",name:"Commit all changes with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit-smart",name:"Commit",callback:()=>t.promiseQueue.addTask(async()=>{let i=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!1,onlyStaged:i})})}),t.addCommand({id:"commit-staged",name:"Commit staged",checkCallback:function(r){if(r)return!1;t.promiseQueue.addTask(async()=>t.commit({fromAuto:!1,requestCustomMessage:!1}))}}),Ni.Platform.isDesktopApp&&t.addCommand({id:"commit-amend-staged-specified-message",name:"Amend staged",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0,amend:!0}))}),t.addCommand({id:"commit-smart-specified-message",name:"Commit with specific message",callback:()=>t.promiseQueue.addTask(async()=>{let i=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:i})})}),t.addCommand({id:"commit-staged-specified-message",name:"Commit staged with specific message",checkCallback:function(r){return r?!1:t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0}))}}),t.addCommand({id:"push2",name:"Push",callback:()=>t.promiseQueue.addTask(()=>t.push())}),t.addCommand({id:"stage-current-file",name:"Stage current file",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.promiseQueue.addTask(()=>t.stageFile(i))}}),t.addCommand({id:"unstage-current-file",name:"Unstage current file",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.promiseQueue.addTask(()=>t.unstageFile(i))}}),t.addCommand({id:"edit-remotes",name:"Edit remotes",callback:()=>t.editRemotes().catch(r=>t.displayError(r))}),t.addCommand({id:"remove-remote",name:"Remove remote",callback:()=>t.removeRemote().catch(r=>t.displayError(r))}),t.addCommand({id:"set-upstream-branch",name:"Set upstream branch",callback:()=>t.setUpstreamBranch().catch(r=>t.displayError(r))}),t.addCommand({id:"delete-repo",name:"CAUTION: Delete repository",callback:async()=>{await e.vault.adapter.exists(`${t.settings.basePath}/.git`)?await new Qe(t,{options:["NO","YES"],placeholder:"Do you really want to delete the repository (.git directory)? plugin action cannot be undone.",onlySelection:!0}).openAndGetResult()==="YES"&&(await e.vault.adapter.rmdir(`${t.settings.basePath}/.git`,!0),new Ni.Notice("Successfully deleted repository. Reloading plugin..."),t.unloadPlugin(),await t.init({fromReload:!0})):new Ni.Notice("No repository found")}}),t.addCommand({id:"init-repo",name:"Initialize a new repo",callback:()=>t.createNewRepo().catch(r=>t.displayError(r))}),t.addCommand({id:"clone-repo",name:"Clone an existing remote repo",callback:()=>t.cloneNewRepo().catch(r=>t.displayError(r))}),t.addCommand({id:"list-changed-files",name:"List changed files",callback:async()=>{if(await t.isAllInitialized())try{let r=await t.updateCachedStatus();if(r.changed.length+r.staged.length>500){t.displayError("Too many changes to display");return}new sp(t,r.all).open()}catch(r){t.displayError(r)}}}),t.addCommand({id:"switch-branch",name:"Switch branch",callback:()=>{t.switchBranch().catch(r=>t.displayError(r))}}),t.addCommand({id:"create-branch",name:"Create new branch",callback:()=>{t.createBranch().catch(r=>t.displayError(r))}}),t.addCommand({id:"delete-branch",name:"Delete branch",callback:()=>{t.deleteBranch().catch(r=>t.displayError(r))}}),t.addCommand({id:"discard-all",name:"CAUTION: Discard all changes",callback:async()=>{let r=await t.discardAll();switch(r){case"discard":new Ni.Notice("Discarded all changes in tracked files.");break;case"delete":new Ni.Notice("Discarded all files.");break;case!1:break;default:wh(r)}}}),t.addCommand({id:"pause-automatic-routines",name:"Pause/Resume automatic routines",callback:()=>{let r=!t.localStorage.getPausedAutomatics();t.localStorage.setPausedAutomatics(r),r?(t.automaticsManager.unload(),new Ni.Notice("Paused automatic routines.")):(t.automaticsManager.reload("commit","push","pull"),new Ni.Notice("Resumed automatic routines."))}}),t.addCommand({id:"raw-command",name:"Raw command",checkCallback:r=>{let i=t.gitManager;if(r)return i instanceof Se;t.tools.runRawCommand().catch(n=>t.displayError(n))}}),t.addCommand({id:"toggle-line-author-info",name:"Toggle line author information",callback:()=>{var r;return(r=t.settingsTab)==null?void 0:r.configureLineAuthorShowStatus(!t.settings.lineAuthor.show)}}),t.addCommand({id:"reset-hunk",name:"Reset hunk",editorCheckCallback(r,i,n){if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.hunkActions.resetHunk()}}),t.addCommand({id:"stage-hunk",name:"Stage hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.promiseQueue.addTask(()=>t.hunkActions.stageHunk())}}),t.addCommand({id:"preview-hunk",name:"Preview hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;let s=t.hunkActions.editor.editor;Ys(s)}}),t.addCommand({id:"next-hunk",name:"Go to next hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.hunkActions.goToHunk("next")}}),t.addCommand({id:"prev-hunk",name:"Go to previous hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.hunkActions.goToHunk("prev")}})}p();var Sp=class{constructor(e){this.plugin=e;this.prefix=this.plugin.manifest.id+":",this.app=e.app}migrate(){let e=["password","hostname","conflict","lastAutoPull","lastAutoBackup","lastAutoPush","gitPath","pluginDisabled"];for(let r of e){let i=localStorage.getItem(this.prefix+r);this.app.loadLocalStorage(this.prefix+r)==null&&i!=null&&i!=null&&(this.app.saveLocalStorage(this.prefix+r,i),localStorage.removeItem(this.prefix+r))}}getPassword(){return this.app.loadLocalStorage(this.prefix+"password")}setPassword(e){return this.app.saveLocalStorage(this.prefix+"password",e)}getUsername(){return this.app.loadLocalStorage(this.prefix+"username")}setUsername(e){return this.app.saveLocalStorage(this.prefix+"username",e)}getHostname(){return this.app.loadLocalStorage(this.prefix+"hostname")}setHostname(e){return this.app.saveLocalStorage(this.prefix+"hostname",e)}getConflict(){return this.app.loadLocalStorage(this.prefix+"conflict")=="true"}setConflict(e){return this.app.saveLocalStorage(this.prefix+"conflict",`${e}`)}getLastAutoPull(){return this.app.loadLocalStorage(this.prefix+"lastAutoPull")}setLastAutoPull(e){return this.app.saveLocalStorage(this.prefix+"lastAutoPull",e)}getLastAutoBackup(){return this.app.loadLocalStorage(this.prefix+"lastAutoBackup")}setLastAutoBackup(e){return this.app.saveLocalStorage(this.prefix+"lastAutoBackup",e)}getLastAutoPush(){return this.app.loadLocalStorage(this.prefix+"lastAutoPush")}setLastAutoPush(e){return this.app.saveLocalStorage(this.prefix+"lastAutoPush",e)}getGitPath(){return this.app.loadLocalStorage(this.prefix+"gitPath")}setGitPath(e){return this.app.saveLocalStorage(this.prefix+"gitPath",e)}getPATHPaths(){var e,r;return(r=(e=this.app.loadLocalStorage(this.prefix+"PATHPaths"))==null?void 0:e.split(":"))!=null?r:[]}setPATHPaths(e){return this.app.saveLocalStorage(this.prefix+"PATHPaths",e.join(":"))}getEnvVars(){var e;return JSON.parse((e=this.app.loadLocalStorage(this.prefix+"envVars"))!=null?e:"[]")}setEnvVars(e){return this.app.saveLocalStorage(this.prefix+"envVars",JSON.stringify(e))}getPluginDisabled(){return this.app.loadLocalStorage(this.prefix+"pluginDisabled")=="true"}setPluginDisabled(e){return this.app.saveLocalStorage(this.prefix+"pluginDisabled",`${e}`)}getPausedAutomatics(){return this.app.loadLocalStorage(this.prefix+"pausedAutomatics")=="true"}setPausedAutomatics(e){return this.app.saveLocalStorage(this.prefix+"pausedAutomatics",`${e}`)}};p();var Ul=require("obsidian");var Yu=class{constructor(e){this.plugin=e}async hasTooBigFiles(e){let r=await this.plugin.gitManager.branchInfo(),i=r.tracking?Zn(r.tracking)[0]:null;if(!i)return!1;let n=await this.plugin.gitManager.getRemoteUrl(i);if(n!=null&&n.includes("github.com")){let s=[],a=this.plugin.gitManager;for(let o of e){let l=this.plugin.app.vault.getAbstractFileByPath(o.vaultPath),c=!1;if(l instanceof Ul.TFile)l.stat.size>=1e8&&(c=!0);else{let u=await this.plugin.app.vault.adapter.stat(o.vaultPath);u&&u.size>=1e8&&(c=!0)}if(c){let u=!1;a instanceof Se&&(u=await a.isFileTrackedByLFS(o.path)),u||s.push(o)}}if(s.length>0)return this.plugin.displayError(`Aborted commit, because the following files are too big: +- ${s.map(o=>o.vaultPath).join(` +- `)} +Please remove them or add to .gitignore.`),!0}return!1}async writeAndOpenFile(e){e!==void 0&&await this.plugin.app.vault.adapter.write(al,e);let r=!1;this.plugin.app.workspace.iterateAllLeaves(i=>{i.getDisplayText()!=""&&al.startsWith(i.getDisplayText())&&(r=!0)}),r||await this.plugin.app.workspace.openLinkText(al,"/",!0)}openDiff({aFile:e,bFile:r,aRef:i,bRef:n,event:s}){var l,c;let a=this.plugin.settings.diffStyle;Ul.Platform.isMobileApp&&(a="git_unified");let o={aFile:e,bFile:r!=null?r:e,aRef:i,bRef:n};a=="split"?(l=Mi(this.plugin.app,s))==null||l.setViewState({type:Ls.type,active:!0,state:o}):a=="git_unified"&&((c=Mi(this.plugin.app,s))==null||c.setViewState({type:Bs.type,active:!0,state:o}))}async runRawCommand(){let e=this.plugin.gitManager;if(!(e instanceof Se))return;let i=await new Qe(this.plugin,{placeholder:"push origin master",allowEmpty:!1}).openAndGetResult();i!==void 0&&this.plugin.promiseQueue.addTask(async()=>{let n=new Ul.Notice(`Running '${i}'...`,999999);try{let s=await e.rawCommand(i);s?(n.setMessage(s),window.setTimeout(()=>n.hide(),5e3)):n.hide()}catch(s){throw n.hide(),s}})}};p();var Ep=require("obsidian");var qa=class extends Ep.ItemView{constructor(r,i){super(r);this.plugin=i;this.gettingDiff=!1;this.parser=new DOMParser,this.navigation=!0,this.contentEl.addClass("git-diff"),this.gitRefreshRef=this.app.workspace.on("obsidian-git:status-changed",()=>{this.refresh().catch(console.error)})}getViewType(){return Bs.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let i=this.state.bFile.split("/").last();return i!=null&&i.endsWith(".md")&&(i=i.slice(0,-3)),`Diff: ${i}`}return Bs.name}getIcon(){return Bs.icon}async setState(r,i){this.state=r,Ep.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await this.refresh()}getState(){return this.state}onClose(){return this.app.workspace.offref(this.gitRefreshRef),this.app.workspace.offref(this.gitViewRefreshRef),super.onClose()}async onOpen(){return await this.refresh(),super.onOpen()}async refresh(){var r;if((r=this.state)!=null&&r.bFile&&!this.gettingDiff&&this.plugin.gitManager){this.gettingDiff=!0;try{let i=await this.plugin.gitManager.getDiffString(this.state.bFile,this.state.aRef=="HEAD",this.state.bRef);this.contentEl.empty();let n=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);if(!i){if(this.plugin.gitManager instanceof Se&&await this.plugin.gitManager.isTracked(this.state.bFile))i=[`--- ${this.state.aFile}`,`+++ ${this.state.bFile}`,""].join(` +`);else if(await this.app.vault.adapter.exists(n)){let s=await this.app.vault.adapter.read(n);i=[...`--- /dev/null ++++ ${this.state.bFile} +@@ -0,0 +1,${s.split(` +`).length} @@`.split(` +`),...s.split(` +`).map(o=>`+${o}`)].join(` +`)}}if(i){let s=this.parser.parseFromString(bp(i),"text/html").querySelector(".d2h-file-diff");this.contentEl.append(s)}else{let s=this.contentEl.createDiv({cls:"obsidian-git-center"});s.createSpan({text:"\u26A0\uFE0F",attr:{style:"font-size: 2em"}}),s.createEl("br"),s.createSpan({text:"File not found: "+this.state.bFile})}}finally{this.gettingDiff=!1}}}};p();var ts=require("obsidian");var jl=require("@codemirror/commands");var kp=require("@codemirror/search"),Gl=require("@codemirror/state"),_i=require("@codemirror/view");var za=class extends ts.ItemView{constructor(r,i){super(r);this.plugin=i;this.refreshing=!1;this.ignoreNextModification=!1;this.navigation=!0,this.registerEvent(this.app.workspace.on("obsidian-git:status-changed",()=>{this.mergeView?this.updateRefEditors().catch(console.error):this.createMergeView().catch(console.error)})),this.intervalRef=window.setInterval(()=>{this.mergeView&&this.updateRefEditors().catch(console.error)},30*1e3),this.registerEvent(this.app.vault.on("modify",n=>{this.state.bRef==null&&n.path===this.state.bFile&&(this.ignoreNextModification?this.ignoreNextModification=!1:this.updateModifiableEditor().catch(console.error))})),this.registerEvent(this.app.vault.on("delete",n=>{this.state.bRef==null&&n.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("create",n=>{this.state.bRef==null&&n.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("rename",(n,s)=>{this.state.bRef==null&&(n.path===this.state.bFile||s===this.state.bFile)&&this.createMergeView().catch(console.error)})),this.fileSaveDebouncer=(0,ts.debounce)(n=>{let s=this.state.bFile;s&&(this.ignoreNextModification=!0,this.plugin.app.vault.adapter.write(this.plugin.gitManager.getRelativeVaultPath(s),n).catch(a=>this.plugin.displayError(a)))},1e3,!1)}getViewType(){return Ls.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let i=this.state.bFile.split("/").last();i!=null&&i.endsWith(".md")&&(i=i.slice(0,-3));let n;return this.state.bRef==null?n=" (Working Tree)":this.state.bRef==""?n=" (Index)":n="("+this.state.bRef.substring(0,7)+")",`Diff: ${i} ${n}`}return Ls.name}getIcon(){return Ls.icon}async setState(r,i){this.state=r,ts.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await super.setState(r,i),await this.createMergeView()}getState(){return this.state}onClose(){return window.clearInterval(this.intervalRef),super.onClose()}async onOpen(){return await this.createMergeView(),super.onOpen()}async gitShow(r,i){try{return await this.plugin.gitManager.show(r,i,!1)}catch(n){if(n instanceof Rr&&(n.message.includes("does not exist")||n.message.includes("unknown revision or path")||n.message.includes("exists on disk, but not in")||n.message.includes("fatal: bad object")))return n.message.includes("fatal: bad object")&&this.plugin.displayError(n.message),"";throw n}}async bShouldBeEditable(){if(this.state.bRef!=null)return!1;let r=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);return await this.app.vault.adapter.exists(r)}async updateModifiableEditor(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.b;this.refreshing=!0;let i=await this.app.vault.adapter.read(this.state.bFile);if(i!=r.state.doc.toString()){let n=r.state.update({changes:{from:0,to:r.state.doc.length,insert:i},annotations:[Gl.Transaction.remote.of(!0)]});r.dispatch(n)}this.refreshing=!1}async updateRefEditors(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.a,i=this.mergeView.b;this.refreshing=!0;let n=await this.gitShow(this.state.aRef,this.state.aFile),s;if(this.state.bRef!=null&&(s=await this.gitShow(this.state.bRef,this.state.bFile)),n!=r.state.doc.toString()){let a=r.state.update({changes:{from:0,to:r.state.doc.length,insert:n}});r.dispatch(a)}if(s!=null&&s!=i.state.doc.toString()){let a=i.state.update({changes:{from:0,to:i.state.doc.length,insert:s}});i.dispatch(a)}this.refreshing=!1}renderButtons(){let r=document.createElement("div"),i=r.createDiv();if(i.addClass("clickable-icon"),i.setAttr("aria-label",this.state.bRef==null?"Stage hunk":"Unstage hunk"),(0,ts.setIcon)(i,this.state.bRef==null?"plus":"minus"),i.onmousedown=async n=>{var h;let s=this.mergeView.b,a=this.mergeView.a,o=ay(s.state),l=(h=r.parentElement)==null?void 0:h.indexOf(r),c=o.chunks[l],u=cy(c,a.state.doc,s.state.doc),f=ly(this.mergeView.a.state.doc.toString(),this.mergeView.b.state.doc.toString(),[u])[0],d=Nt.createPatch(this.state.bFile,[f],"100644",this.state.bRef!=null).join(` +`)+` +`;await this.plugin.gitManager.applyPatch(d),this.plugin.app.workspace.trigger("obsidian-git:refresh")},this.state.bRef==null){let n=r.createDiv();n.addClass("clickable-icon"),n.setAttr("aria-label","Reset hunk"),(0,ts.setIcon)(n,"undo"),n.onmousedown=s=>{var f;let a=this.mergeView.a,o=this.mergeView.b,l=ay(o.state),c=(f=r.parentElement)==null?void 0:f.indexOf(r),u=l.chunks[c];if(u){let d=u.fromA,h=u.toA,m=u.fromB,g=u.toB,v=a.state.sliceDoc(d,Math.max(d,h-1));d!=h&&g<=o.state.doc.length&&(v+=a.state.lineBreak),o.dispatch({changes:{from:m,to:Math.min(o.state.doc.length,g),insert:v},userEvent:"revert"})}}}return r.onmousedown=n=>{n.preventDefault(),n.stopPropagation()},r}async createMergeView(){var r,i,n;if((r=this.state)!=null&&r.aFile&&((i=this.state)!=null&&i.bFile)&&!this.refreshing&&this.plugin.gitManager){this.refreshing=!0,(n=this.mergeView)==null||n.destroy();let s=this.containerEl.children[1];s.empty(),this.contentEl.addClass("git-split-diff-view","git-diff"),this.bIsEditable=await this.bShouldBeEditable();let a=await this.gitShow(this.state.aRef,this.state.aFile),o;if(this.state.bRef!=null)o=await this.gitShow(this.state.bRef,this.state.bFile);else{let g=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);await this.app.vault.adapter.exists(g)?o=await this.app.vault.adapter.read(g):o=""}let l=[(0,_i.lineNumbers)(),(0,kp.highlightSelectionMatches)(),(0,_i.drawSelection)(),_i.keymap.of([...jl.standardKeymap,jl.indentWithTab]),(0,jl.history)(),(0,kp.search)(),_i.EditorView.lineWrapping],c=this,u=_i.ViewPlugin.define(g=>({update(v){if(v.docChanged&&!v.transactions.some(w=>w.annotation(Gl.Transaction.remote))){let w=g.state.doc.toString();c.fileSaveDebouncer(w)}}})),f={doc:a,extensions:[...l,_i.EditorView.editable.of(!1),Gl.EditorState.readOnly.of(!0)]},d=[...l];this.bIsEditable?d.push(u):d.push(_i.EditorView.editable.of(!1),Gl.EditorState.readOnly.of(!0));let h={doc:o,extensions:d};s.addClasses(["cm-s-obsidian","mod-cm6","markdown-source-view","cm-content"]);let m=this.plugin.gitManager instanceof Se&&(this.state.bRef===void 0||this.state.bRef==="");this.mergeView=new pp({b:h,a:f,collapseUnchanged:{minSize:6,margin:4},renderRevertControl:m?()=>this.renderButtons():void 0,revertControls:m?"a-to-b":void 0,diffConfig:{scanLimit:this.bIsEditable?1e3:1e4},parent:s}),this.refreshing=!1}}};p();var sD=require("obsidian");p();p();p();var PO="5";var RO,$O,IO;typeof window!="undefined"&&((IO=($O=(RO=window.__svelte)!=null?RO:window.__svelte={}).v)!=null?IO:$O.v=new Set).add(PO);p();p();p();var Xu="[",wn="[!",Va="]",rs={};var Je=Symbol(),xi=Symbol("filename"),FO=Symbol("hmr"),OO="http://www.w3.org/1999/xhtml";p();p();p();p();var Ap=!0;p();var M=!1;p();var is=Array.isArray,MO=Array.prototype.indexOf,Hi=Array.prototype.includes,ql=Array.from,xy=Object.keys,tr=Object.defineProperty,Fr=Object.getOwnPropertyDescriptor,Sy=Object.getOwnPropertyDescriptors,Ey=Object.prototype,DO=Array.prototype,zl=Object.getPrototypeOf,ky=Object.isExtensible;function Ay(t){return typeof t=="function"}var Or=()=>{};function Tp(t){for(var e=0;e{t=i,e=n});return{promise:r,resolve:t,reject:e}}p();p();var Wt=Symbol("$state"),Zu=Symbol("legacy props"),LO=Symbol(""),Pp=Symbol("proxy path"),yn=new class extends Error{constructor(){super(...arguments);ze(this,"name","StaleReactionError");ze(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Vl=3,Mr=8;p();p();function Rp(t){if(M){let e=new Error(`lifecycle_outside_component +\`${t}(...)\` can only be used during component initialisation +https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function BO(){if(M){let t=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ty(){if(M){let t=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function NO(){if(M){let t=new Error(`derived_references_self +A derived value cannot reference itself recursively +https://svelte.dev/e/derived_references_self`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/derived_references_self")}function Cy(t,e,r){if(M){let i=new Error(`each_key_duplicate +${r?`Keyed each block has duplicate key \`${r}\` at indexes ${t} and ${e}`:`Keyed each block has duplicate key at indexes ${t} and ${e}`} +https://svelte.dev/e/each_key_duplicate`);throw i.name="Svelte error",i}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function HO(t){if(M){let e=new Error(`effect_in_teardown +\`${t}\` cannot be used inside an effect cleanup function +https://svelte.dev/e/effect_in_teardown`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function UO(){if(M){let t=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function GO(t){if(M){let e=new Error(`effect_orphan +\`${t}\` can only be used inside an effect (e.g. during component initialisation) +https://svelte.dev/e/effect_orphan`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_orphan")}function jO(){if(M){let t=new Error(`effect_update_depth_exceeded +Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state +https://svelte.dev/e/effect_update_depth_exceeded`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function qO(){if(M){let t=new Error(`hydration_failed +Failed to hydrate the application +https://svelte.dev/e/hydration_failed`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/hydration_failed")}function zO(t){if(M){let e=new Error(`props_invalid_value +Cannot do \`bind:${t}={undefined}\` when \`${t}\` has a fallback value +https://svelte.dev/e/props_invalid_value`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/props_invalid_value")}function VO(t){if(M){let e=new Error(`rune_outside_svelte +The \`${t}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files +https://svelte.dev/e/rune_outside_svelte`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function WO(){if(M){let t=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function YO(){if(M){let t=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function XO(){if(M){let t=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ZO(){if(M){let t=new Error("svelte_boundary_reset_onerror\nA `` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}p();p();p();var Xs="font-weight: bold",Zs="font-weight: normal";function KO(t,e){M?console.warn(`%c[svelte] await_waterfall +%cAn async derived, \`${t}\` (${e}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app +https://svelte.dev/e/await_waterfall`,Xs,Zs):console.warn("https://svelte.dev/e/await_waterfall")}function QO(t,e,r){M?console.warn(`%c[svelte] hydration_attribute_changed +%cThe \`${t}\` attribute on \`${e}\` changed its value between server and client renders. The client value, \`${r}\`, will be ignored in favour of the server value +https://svelte.dev/e/hydration_attribute_changed`,Xs,Zs):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Wa(t){M?console.warn(`%c[svelte] hydration_mismatch +%c${t?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${t}`:"Hydration failed because the initial UI does not match what was rendered on the server"} +https://svelte.dev/e/hydration_mismatch`,Xs,Zs):console.warn("https://svelte.dev/e/hydration_mismatch")}function JO(){M?console.warn(`%c[svelte] lifecycle_double_unmount +%cTried to unmount a component that was not mounted +https://svelte.dev/e/lifecycle_double_unmount`,Xs,Zs):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function $p(t){M?console.warn(`%c[svelte] state_proxy_equality_mismatch +%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${t}\` will produce unexpected results +https://svelte.dev/e/state_proxy_equality_mismatch`,Xs,Zs):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function eM(){M?console.warn(`%c[svelte] state_proxy_unmount +%cTried to unmount a state proxy, rather than a component +https://svelte.dev/e/state_proxy_unmount`,Xs,Zs):console.warn("https://svelte.dev/e/state_proxy_unmount")}function tM(){M?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Xs,Zs):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function rM(t){M?console.warn(`%c[svelte] transition_slide_display +%cThe \`slide\` transition does not work correctly for elements with \`display: ${t}\` +https://svelte.dev/e/transition_slide_display`,Xs,Zs):console.warn("https://svelte.dev/e/transition_slide_display")}var ie=!1;function Ht(t){ie=t}var ge;function je(t){if(t===null)throw Wa(),rs;return ge=t}function rr(){return je(Zt(ge))}function H(t){if(ie){if(Zt(ge)!==null)throw Wa(),rs;ge=t}}function Ya(t=1){if(ie){for(var e=t,r=ge;e--;)r=Zt(r);ge=r}}function ns(t=!0){for(var e=0,r=ge;;){if(r.nodeType===Mr){var i=r.data;if(i===Va){if(e===0)return r;e-=1}else(i===Xu||i===wn)&&(e+=1)}var n=Zt(r);t&&r.remove(),r=n}}function Ip(t){if(!t||t.nodeType!==Mr)throw Wa(),rs;return t.data}p();p();p();p();function Fp(t){return t===this.v}function Py(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Op(t){return!Py(t,this.v)}p();var ir=!1,ss=!1,Ui=!1;p();p();p();var Ku=null;function Dr(t,e){return t.label=e,Mp(t.v,e),t}function Mp(t,e){var r;return(r=t==null?void 0:t[Pp])==null||r.call(t,e),t}p();function bn(t){let e=new Error,r=zV();return r.length===0?null:(r.unshift(` +`),tr(e,"stack",{value:r.join(` +`)}),tr(e,"name",{value:t}),e)}function zV(){let t=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let e=new Error().stack;if(Error.stackTraceLimit=t,!e)return[];let r=e.split(` +`),i=[];for(let n=0;n{e===Xa&&nM()})}Xa.push(t)}function sM(){for(;Xa.length>0;)nM()}p();var Iy=new WeakMap;function Lp(t){var e=ne;if(e===null)return le.f|=8388608,t;if(M&&t instanceof Error&&!Iy.has(t)&&Iy.set(t,VV(t,e)),e.f&32768)En(t,e);else{if(!(e.f&128))throw M&&!e.parent&&t instanceof Error&&aM(t),t;e.b.error(t)}}function En(t,e){for(;e!==null;){if(e.f&128)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw M&&t instanceof Error&&aM(t),t}function VV(t,e){var a,o,l;let r=Fr(t,"message");if(!(r&&!r.configurable)){for(var i=Qu?" ":" ",n=` +${i}in ${((a=e.fn)==null?void 0:a.name)||""}`,s=e.ctx;s!==null;)n+=` +${i}in ${(o=s.function)==null?void 0:o[xi].split("/").pop()}`,s=s.p;return{message:t.message+` +${n} +`,stack:(l=t.stack)==null?void 0:l.split(` +`).filter(c=>!c.includes("svelte/src/internal")).join(` +`)}}}function aM(t){let e=Iy.get(t);e&&(tr(t,"message",{value:e.message}),tr(t,"stack",{value:e.stack}))}p();p();var WV=-7169;function Be(t,e){t.f=t.f&WV|e}function Xl(t){t.f&512||t.deps===null?Be(t,1024):Be(t,4096)}function oM(t){if(t!==null)for(let e of t)!(e.f&2)||!(e.f&32768)||(e.f^=32768,oM(e.deps))}function Bp(t,e,r){t.f&2048?e.add(t):t.f&4096&&r.add(t),oM(t.deps),Be(t,1024)}var Zl=new Set,ye=null,tf=null,Rt=null,Br=[],Hp=null,Fy=!1,Za=!1,Kl,Ql,Ka,Jl,rf,nf,Qa,os,ec,kn,Oy,My,cM,Ly=class Ly{constructor(){pe(this,kn);ze(this,"committed",!1);ze(this,"current",new Map);ze(this,"previous",new Map);pe(this,Kl,new Set);pe(this,Ql,new Set);pe(this,Ka,0);pe(this,Jl,0);pe(this,rf,null);pe(this,nf,new Set);pe(this,Qa,new Set);pe(this,os,new Map);ze(this,"is_fork",!1);pe(this,ec,!1)}is_deferred(){return this.is_fork||$(this,Jl)>0}skip_effect(e){$(this,os).has(e)||$(this,os).set(e,{d:[],m:[]})}unskip_effect(e){var r=$(this,os).get(e);if(r){$(this,os).delete(e);for(var i of r.d)Be(i,2048),vr(i);for(i of r.m)Be(i,4096),vr(i)}}process(e){var n;Br=[],this.apply();var r=[],i=[];for(let s of e)bt(this,kn,Oy).call(this,s,r,i);if(this.is_deferred()){bt(this,kn,My).call(this,i),bt(this,kn,My).call(this,r);for(let[s,a]of $(this,os))dM(s,a)}else{for(let s of $(this,Kl))s();$(this,Kl).clear(),$(this,Ka)===0&&bt(this,kn,cM).call(this),tf=this,ye=null,lM(i),lM(r),tf=null,(n=$(this,rf))==null||n.resolve()}Rt=null}capture(e,r){r!==Je&&!this.previous.has(e)&&this.previous.set(e,r),e.f&8388608||(this.current.set(e,e.v),Rt==null||Rt.set(e,e.v))}activate(){ye=this,this.apply()}deactivate(){ye===this&&(ye=null,Rt=null)}flush(){if(this.activate(),Br.length>0){if(Dy(),ye!==null&&ye!==this)return}else $(this,Ka)===0&&this.process([]);this.deactivate()}discard(){for(let e of $(this,Ql))e(this);$(this,Ql).clear()}increment(e){fe(this,Ka,$(this,Ka)+1),e&&fe(this,Jl,$(this,Jl)+1)}decrement(e){fe(this,Ka,$(this,Ka)-1),e&&fe(this,Jl,$(this,Jl)-1),!$(this,ec)&&(fe(this,ec,!0),yt(()=>{fe(this,ec,!1),this.is_deferred()?Br.length>0&&this.flush():this.revive()}))}revive(){for(let e of $(this,nf))$(this,Qa).delete(e),Be(e,2048),vr(e);for(let e of $(this,Qa))Be(e,4096),vr(e);this.flush()}oncommit(e){$(this,Kl).add(e)}ondiscard(e){$(this,Ql).add(e)}settled(){var e;return((e=$(this,rf))!=null?e:fe(this,rf,Cp())).promise}static ensure(){if(ye===null){let e=ye=new Ly;Zl.add(ye),Za||yt(()=>{ye===e&&e.flush()})}return ye}apply(){if(!(!ir||!this.is_fork&&Zl.size===1)){Rt=new Map(this.current);for(let e of Zl)if(e!==this)for(let[r,i]of e.previous)Rt.has(r)||Rt.set(r,i)}}};Kl=new WeakMap,Ql=new WeakMap,Ka=new WeakMap,Jl=new WeakMap,rf=new WeakMap,nf=new WeakMap,Qa=new WeakMap,os=new WeakMap,ec=new WeakMap,kn=new WeakSet,Oy=function(e,r,i){var d;e.f^=1024;for(var n=e.first,s=null;n!==null;){var a=n.f,o=(a&96)!==0,l=o&&(a&1024)!==0,c=l||(a&8192)!==0||$(this,os).has(n);if(ir&&s===null&&a&128&&((d=n.b)!=null&&d.is_pending)&&(s=n),!c&&n.fn!==null){o?n.f^=1024:s!==null&&a&16777228?s.b.defer_effect(n):a&4?r.push(n):ir&&a&16777224?i.push(n):ea(n)&&(a&16&&$(this,Qa).add(n),Js(n));var u=n.first;if(u!==null){n=u;continue}}var f=n.parent;for(n=n.next;n===null&&f!==null;)f===s&&(s=null),n=f.next,f=f.parent}},My=function(e){for(var r=0;r1){this.previous.clear();var e=Rt,r=!0;for(let s of Zl){if(s===this){r=!1;continue}let a=[];for(let[l,c]of this.current){if(s.current.has(l))if(r&&c!==s.current.get(l))s.current.set(l,c);else continue;a.push(l)}if(a.length===0)continue;let o=[...s.current.keys()].filter(l=>!this.current.has(l));if(o.length>0){var i=Br;Br=[];let l=new Set,c=new Map;for(let u of a)uM(u,o,l,c);if(Br.length>0){ye=s,s.apply();for(let u of Br)bt(n=s,kn,Oy).call(n,u,[],[]);s.deactivate()}Br=i}}ye=null,Rt=e}this.committed=!0,Zl.delete(this)};var Hr=Ly;function Ja(t){var e=Za;Za=!0;try{var r;for(t&&(ye!==null&&Dy(),r=t());;){if(sM(),Br.length===0&&(ye==null||ye.flush(),Br.length===0))return Hp=null,r;Dy()}}finally{Za=e}}function Dy(){var s;Fy=!0;var t=M?new Set:null;try{for(var e=0;Br.length>0;){var r=Hr.ensure();if(e++>1e3){if(M){var i=new Map;for(let a of r.current.keys())for(let[o,l]of(s=a.updated)!=null?s:[]){var n=i.get(o);n||(n={error:l.error,count:0},i.set(o,n)),n.count+=l.count}for(let a of i.values())a.error&&console.error(a.error)}XV()}if(r.process(Br),An.clear(),M)for(let a of r.current.keys())t.add(a)}}finally{if(Br=[],Fy=!1,Hp=null,M)for(let a of t)a.updated=null}}function XV(){try{jO()}catch(t){M&&tr(t,"stack",{value:""}),En(t,Hp)}}var Lr=null;function lM(t){var e=t.length;if(e!==0){for(var r=0;r0)){An.clear();for(let n of Lr){if(n.f&24576)continue;let s=[n],a=n.parent;for(;a!==null;)Lr.has(a)&&(Lr.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){let l=s[o];l.f&24576||Js(l)}}Lr.clear()}}Lr=null}}function uM(t,e,r,i){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(let n of t.reactions){let s=n.f;s&2?uM(n,e,r,i):s&4194320&&!(s&2048)&&fM(n,e,i)&&(Be(n,2048),vr(n))}}function fM(t,e,r){let i=r.get(t);if(i!==void 0)return i;if(t.deps!==null)for(let n of t.deps){if(Hi.call(e,n))return!0;if(n.f&2&&fM(n,e,r))return r.set(n,!0),!0}return r.set(t,!1),!1}function vr(t){for(var e=Hp=t;e.parent!==null;){e=e.parent;var r=e.f;if(Fy&&e===ne&&r&16&&!(r&262144))return;if(r&96){if(!(r&1024))return;e.f^=1024}}Br.push(e)}function dM(t,e){if(!(t.f&32&&t.f&1024)){t.f&2048?e.d.push(t):t.f&4096&&e.m.push(t),Be(t,1024);for(var r=t.first;r!==null;)dM(r,e),r=r.next}}p();p();p();function pM(t){let e=0,r=sr(0),i;return M&&Dr(r,"createSubscriber version"),()=>{Qs()&&(R(r),Kt(()=>(e===0&&(i=We(()=>t(()=>eo(r)))),e+=1,()=>{yt(()=>{e-=1,e===0&&(i==null||i(),i=void 0,eo(r))})})))}}var KV=589952;function Gy(t,e,r){new Ny(t,e,r)}var ri,sf,Tn,to,Cn,Si,Gr,Pn,ls,ta,ro,cs,nc,io,sc,ac,Rn,zp,St,mM,gM,Hy,jp,qp,Uy,Ny=class{constructor(e,r,i){pe(this,St);ze(this,"parent");ze(this,"is_pending",!1);pe(this,ri);pe(this,sf,ie?ge:null);pe(this,Tn);pe(this,to);pe(this,Cn);pe(this,Si,null);pe(this,Gr,null);pe(this,Pn,null);pe(this,ls,null);pe(this,ta,null);pe(this,ro,0);pe(this,cs,0);pe(this,nc,!1);pe(this,io,!1);pe(this,sc,new Set);pe(this,ac,new Set);pe(this,Rn,null);pe(this,zp,pM(()=>(fe(this,Rn,sr($(this,ro))),M&&Dr($(this,Rn),"$effect.pending()"),()=>{fe(this,Rn,null)})));fe(this,ri,e),fe(this,Tn,r),fe(this,to,i),this.parent=ne.b,this.is_pending=!!$(this,Tn).pending,fe(this,Cn,ii(()=>{if(ne.b=this,ie){let s=$(this,sf);rr(),s.nodeType===Mr&&s.data===wn?bt(this,St,gM).call(this):(bt(this,St,mM).call(this),$(this,cs)===0&&(this.is_pending=!1))}else{var n=bt(this,St,Hy).call(this);try{fe(this,Si,Ut(()=>i(n)))}catch(s){this.error(s)}$(this,cs)>0?bt(this,St,qp).call(this):this.is_pending=!1}return()=>{var s;(s=$(this,ta))==null||s.remove()}},KV)),ie&&fe(this,ri,ge)}defer_effect(e){Bp(e,$(this,sc),$(this,ac))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!$(this,Tn).pending}update_pending_count(e){bt(this,St,Uy).call(this,e),fe(this,ro,$(this,ro)+e),!(!$(this,Rn)||$(this,nc))&&(fe(this,nc,!0),yt(()=>{fe(this,nc,!1),$(this,Rn)&&Vi($(this,Rn),$(this,ro))}))}get_effect_pending(){return $(this,zp).call(this),R($(this,Rn))}error(e){var r=$(this,Tn).onerror;let i=$(this,Tn).failed;if($(this,io)||!r&&!i)throw e;$(this,Si)&&(dt($(this,Si)),fe(this,Si,null)),$(this,Gr)&&(dt($(this,Gr)),fe(this,Gr,null)),$(this,Pn)&&(dt($(this,Pn)),fe(this,Pn,null)),ie&&(je($(this,sf)),Ya(),je(ns()));var n=!1,s=!1;let a=()=>{if(n){tM();return}n=!0,s&&ZO(),Hr.ensure(),fe(this,ro,0),$(this,Pn)!==null&&$n($(this,Pn),()=>{fe(this,Pn,null)}),this.is_pending=this.has_pending_snippet(),fe(this,Si,bt(this,St,jp).call(this,()=>(fe(this,io,!1),Ut(()=>$(this,to).call(this,$(this,ri)))))),$(this,cs)>0?bt(this,St,qp).call(this):this.is_pending=!1};yt(()=>{try{s=!0,r==null||r(e,a),s=!1}catch(o){En(o,$(this,Cn)&&$(this,Cn).parent)}i&&fe(this,Pn,bt(this,St,jp).call(this,()=>{Hr.ensure(),fe(this,io,!0);try{return Ut(()=>{i($(this,ri),()=>e,()=>a)})}catch(o){return En(o,$(this,Cn).parent),null}finally{fe(this,io,!1)}}))})}};ri=new WeakMap,sf=new WeakMap,Tn=new WeakMap,to=new WeakMap,Cn=new WeakMap,Si=new WeakMap,Gr=new WeakMap,Pn=new WeakMap,ls=new WeakMap,ta=new WeakMap,ro=new WeakMap,cs=new WeakMap,nc=new WeakMap,io=new WeakMap,sc=new WeakMap,ac=new WeakMap,Rn=new WeakMap,zp=new WeakMap,St=new WeakSet,mM=function(){try{fe(this,Si,Ut(()=>$(this,to).call(this,$(this,ri))))}catch(e){this.error(e)}},gM=function(){let e=$(this,Tn).pending;e&&(fe(this,Gr,Ut(()=>e($(this,ri)))),yt(()=>{var r=bt(this,St,Hy).call(this);fe(this,Si,bt(this,St,jp).call(this,()=>(Hr.ensure(),Ut(()=>$(this,to).call(this,r))))),$(this,cs)>0?bt(this,St,qp).call(this):($n($(this,Gr),()=>{fe(this,Gr,null)}),this.is_pending=!1)}))},Hy=function(){var e=$(this,ri);return this.is_pending&&(fe(this,ta,It()),$(this,ri).before($(this,ta)),e=$(this,ta)),e},jp=function(e){var r=ne,i=le,n=ke;Gt($(this,Cn)),$t($(this,Cn)),as($(this,Cn).ctx);try{return e()}catch(s){return Lp(s),null}finally{Gt(r),$t(i),as(n)}},qp=function(){let e=$(this,Tn).pending;$(this,Si)!==null&&(fe(this,ls,document.createDocumentFragment()),$(this,ls).append($(this,ta)),Vp($(this,Si),$(this,ls))),$(this,Gr)===null&&fe(this,Gr,Ut(()=>e($(this,ri))))},Uy=function(e){var r;if(!this.has_pending_snippet()){this.parent&&bt(r=this.parent,St,Uy).call(r,e);return}if(fe(this,cs,$(this,cs)+e),$(this,cs)===0){this.is_pending=!1;for(let i of $(this,sc))Be(i,2048),vr(i);for(let i of $(this,ac))Be(i,4096),vr(i);$(this,sc).clear(),$(this,ac).clear(),$(this,Gr)&&$n($(this,Gr),()=>{fe(this,Gr,null)}),$(this,ls)&&($(this,ri).before($(this,ls)),fe(this,ls,null))}};p();function Wp(t,e,r,i){let n=xn()?no:so;var s=t.filter(d=>!d.settled);if(r.length===0&&s.length===0){i(e.map(n));return}var a=ye,o=ne,l=vM(),c=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(d=>d.promise)):null;function u(d){l();try{i(d)}catch(h){o.f&16384||En(h,o)}a==null||a.deactivate(),af()}if(r.length===0){c.then(()=>u(e.map(n)));return}function f(){l(),Promise.all(r.map(d=>qy(d))).then(d=>u([...e.map(n),...d])).catch(d=>En(d,o))}c?c.then(f):f()}function vM(){var t=ne,e=le,r=ke,i=ye;if(M)var n=_n;return function(a=!0){Gt(t),$t(e),as(r),a&&(i==null||i.activate()),M&&(jy(null),Wl(n))}}function af(){Gt(null),$t(null),as(null),M&&(jy(null),Wl(null))}var of=null;function jy(t){of=t}var lf=new Set;function no(t){var e=2050,r=le!==null&&le.f&2?le:null;ne!==null&&(ne.f|=524288);let i={ctx:ke,deps:null,effects:null,equals:Fp,f:e,fn:t,reactions:null,rv:0,v:Je,wv:0,parent:r!=null?r:ne,ac:null};return M&&Ui&&(i.created=bn("created at")),i}function qy(t,e,r){let i=ne;i===null&&BO();var n=i.b,s=void 0,a=sr(Je);M&&(a.label=e);var o=!le,l=new Map;return wM(()=>{var h;M&&(of=ne);var c=Cp();s=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).then(()=>{u===ye&&u.committed&&u.deactivate(),af()})}catch(m){c.reject(m),af()}M&&(of=null);var u=ye;if(o){var f=n.is_rendered();n.update_pending_count(1),u.increment(f),(h=l.get(u))==null||h.reject(yn),l.delete(u),l.set(u,c)}let d=(m,g=void 0)=>{if(of=null,u.activate(),g)g!==yn&&(a.f|=8388608,Vi(a,g));else{a.f&8388608&&(a.f^=8388608),Vi(a,m);for(let[v,w]of l){if(l.delete(v),v===u)break;w.reject(yn)}M&&r!==void 0&&(lf.add(a),setTimeout(()=>{lf.has(a)&&(KO(a.label,r),lf.delete(a))}))}o&&(n.update_pending_count(-1),u.decrement(f))};c.promise.then(d,m=>d(null,m||"unknown"))}),ar(()=>{for(let c of l.values())c.reject(yn)}),M&&(a.f|=4194304),new Promise(c=>{function u(f){function d(){f===s?c(a):u(s)}f.then(d,d)}u(s)})}function Et(t){let e=no(t);return ir||Zp(e),e}function so(t){let e=no(t);return e.equals=Op,e}function Yp(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r5){let l=bn("updated at");if(l!==null){let c=t.updated.get(l.stack);c||(c={error:l,count:0},t.updated.set(l.stack,c)),c.count++}}}ne!==null&&(t.set_during_effect=!0)}if(t.f&2){let o=t;t.f&2048&&cf(o),Xl(o)}t.wv=ic(),bM(t,2048),xn()&&ne!==null&&ne.f&1024&&!(ne.f&96)&&(si===null?_M([t]):si.push(t)),!i.is_fork&&ao.size>0&&!Wy&&Gp()}return e}function Gp(){Wy=!1;for(let t of ao)t.f&1024&&Be(t,4096),ea(t)&&Js(t);ao.clear()}function eo(t){ae(t,t.v+1)}function bM(t,e){var u;var r=t.reactions;if(r!==null)for(var i=xn(),n=r.length,s=0;s{if(ra===a)return f();var d=le,h=ra;$t(null),Yy(a);var m=f();return $t(d),Yy(h),m};i&&(r.set("length",De(t.length,s)),M&&(t=iW(t)));var l="";let c=!1;function u(f){if(!c){c=!0,l=f,Dr(n,`${l} version`);for(let[d,h]of r)Dr(h,lo(l,d));c=!1}}return new Proxy(t,{defineProperty(f,d,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&WO();var m=r.get(d);return m===void 0?m=o(()=>{var g=De(h.value,s);return r.set(d,g),M&&typeof d=="string"&&Dr(g,lo(l,d)),g}):ae(m,h.value,!0),!0},deleteProperty(f,d){var h=r.get(d);if(h===void 0){if(d in f){let m=o(()=>De(Je,s));r.set(d,m),eo(n),M&&Dr(m,lo(l,d))}}else ae(h,Je),eo(n);return!0},get(f,d,h){var w;if(d===Wt)return t;if(M&&d===Pp)return u;var m=r.get(d),g=d in f;if(m===void 0&&(!g||(w=Fr(f,d))!=null&&w.writable)&&(m=o(()=>{var b=Xe(g?f[d]:Je),k=De(b,s);return M&&Dr(k,lo(l,d)),k}),r.set(d,m)),m!==void 0){var v=R(m);return v===Je?void 0:v}return Reflect.get(f,d,h)},getOwnPropertyDescriptor(f,d){var h=Reflect.getOwnPropertyDescriptor(f,d);if(h&&"value"in h){var m=r.get(d);m&&(h.value=R(m))}else if(h===void 0){var g=r.get(d),v=g==null?void 0:g.v;if(g!==void 0&&v!==Je)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return h},has(f,d){var v;if(d===Wt)return!0;var h=r.get(d),m=h!==void 0&&h.v!==Je||Reflect.has(f,d);if(h!==void 0||ne!==null&&(!m||(v=Fr(f,d))!=null&&v.writable)){h===void 0&&(h=o(()=>{var w=m?Xe(f[d]):Je,b=De(w,s);return M&&Dr(b,lo(l,d)),b}),r.set(d,h));var g=R(h);if(g===Je)return!1}return m},set(f,d,h,m){var y;var g=r.get(d),v=d in f;if(i&&d==="length")for(var w=h;wDe(Je,s)),r.set(w+"",b),M&&Dr(b,lo(l,w)))}if(g===void 0)(!v||(y=Fr(f,d))!=null&&y.writable)&&(g=o(()=>De(void 0,s)),M&&Dr(g,lo(l,d)),ae(g,Xe(h)),r.set(d,g));else{v=g.v!==Je;var k=o(()=>Xe(h));ae(g,k)}var x=Reflect.getOwnPropertyDescriptor(f,d);if(x!=null&&x.set&&x.set.call(m,h),!v){if(i&&typeof d=="string"){var E=r.get("length"),A=Number(d);Number.isInteger(A)&&A>=E.v&&ae(E,A+1)}eo(n)}return!0},ownKeys(f){R(n);var d=Reflect.ownKeys(f).filter(g=>{var v=r.get(g);return v===void 0||v.v!==Je});for(var[h,m]of r)m.v!==Je&&!(h in f)&&d.push(h);return d},setPrototypeOf(){YO()}})}function lo(t,e){var r;return typeof e=="symbol"?`${t}[Symbol(${(r=e.description)!=null?r:""})]`:tW.test(e)?`${t}.${e}`:/^\d+$/.test(e)?`${t}[${e}]`:`${t}['${e}']`}function Kp(t){try{if(t!==null&&typeof t=="object"&&Wt in t)return t[Wt]}catch(e){}return t}var rW=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function iW(t){return new Proxy(t,{get(e,r,i){var n=Reflect.get(e,r,i);return rW.has(r)?function(...s){yM();var a=n.apply(this,s);return Gp(),a}:n}})}function xM(){let t=Array.prototype,e=Array.__svelte_cleanup;e&&e();let{indexOf:r,lastIndexOf:i,includes:n}=t;t.indexOf=function(s,a){let o=r.call(this,s,a);if(o===-1){for(let l=a!=null?a:0;l{t.indexOf=r,t.lastIndexOf=i,t.includes=n}}var Xy,SM,Qu,EM,kM;function Qp(){if(Xy===void 0){Xy=window,SM=document,Qu=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;EM=Fr(e,"firstChild").get,kM=Fr(e,"nextSibling").get,ky(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),ky(r)&&(r.__t=void 0),M&&(t.__svelte_meta=null,xM())}}function It(t=""){return document.createTextNode(t)}function Qt(t){return EM.call(t)}function Zt(t){return kM.call(t)}function G(t,e){if(!ie)return Qt(t);var r=Qt(ge);if(r===null)r=ge.appendChild(It());else if(e&&r.nodeType!==Vl){var i=It();return r==null||r.before(i),je(i),i}return e&&em(r),je(r),r}function zr(t,e=!1){var n,s;if(!ie){var r=Qt(t);return r instanceof Comment&&r.data===""?Zt(r):r}if(e){if(((n=ge)==null?void 0:n.nodeType)!==Vl){var i=It();return(s=ge)==null||s.before(i),je(i),i}em(ge)}return ge}function te(t,e=1,r=!1){let i=ie?ge:t;for(var n;e--;)n=i,i=Zt(i);if(!ie)return i;if(r){if((i==null?void 0:i.nodeType)!==Vl){var s=It();return i===null?n==null||n.after(s):i.before(s),je(s),s}em(i)}return je(i),i}function oc(t){t.textContent=""}function Jp(){if(!ir||Lr!==null)return!1;var t=ne.f;return(t&32768)!==0}function em(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===Vl;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}p();p();function Zy(t){ie&&Qt(t)!==null&&oc(t)}var AM=!1;function Ky(){AM||(AM=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(let r of t.target.elements)(e=r.__on_r)==null||e.call(r)})},{capture:!0}))}function Wi(t){var e=le,r=ne;$t(null),Gt(null);try{return t()}finally{$t(e),Gt(r)}}function Qy(t,e,r,i=r){t.addEventListener(e,()=>Wi(r));let n=t.__on_r;n?t.__on_r=()=>{n(),i(!0)}:t.__on_r=()=>i(!0),Ky()}function TM(t){ne===null&&(le===null&&GO(t),UO()),Ei&&HO(t)}function sW(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function In(t,e,r){var o;var i=ne;if(M)for(;i!==null&&i.f&131072;)i=i.parent;i!==null&&i.f&8192&&(t|=8192);var n={ctx:ke,deps:null,nodes:null,f:t|2048|512,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,wv:0,ac:null};if(M&&(n.component_function=Gi),r)try{Js(n),n.f|=32768}catch(l){throw dt(n),l}else e!==null&&vr(n);var s=n;if(r&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&!(s.f&524288)&&(s=s.first,t&16&&t&65536&&s!==null&&(s.f|=65536)),s!==null&&(s.parent=i,i!==null&&sW(s,i),le!==null&&le.f&2&&!(t&64))){var a=le;((o=a.effects)!=null?o:a.effects=[]).push(s)}return n}function Qs(){return le!==null&&!qr}function ar(t){let e=In(8,null,!1);return Be(e,1024),e.teardown=t,e}function or(t){var n;TM("$effect"),M&&tr(t,"name",{value:"$effect"});var e=ne.f,r=!le&&(e&32)!==0&&(e&32768)===0;if(r){var i=ke;((n=i.e)!=null?n:i.e=[]).push(t)}else return $y(t)}function $y(t){return In(1048580,t,!1)}function eb(t){Hr.ensure();let e=In(524352,t,!0);return()=>{dt(e)}}function CM(t){Hr.ensure();let e=In(524352,t,!0);return(r={})=>new Promise(i=>{r.outro?$n(e,()=>{dt(e),i(void 0)}):(dt(e),i(void 0))})}function Vr(t){return In(4,t,!1)}function wM(t){return In(4718592,t,!0)}function Kt(t,e=0){return In(8|e,t,!0)}function Ne(t,e=[],r=[],i=[]){Wp(i,e,r,n=>{In(8,()=>t(...n.map(R)),!0)})}function ii(t,e=0){var r=In(16|e,t,!0);return M&&(r.dev_stack=_n),r}function Ut(t){return In(524320,t,!0)}function tb(t){var e=t.teardown;if(e!==null){let r=Ei,i=le;Jy(!0),$t(null);try{e.call(null)}finally{Jy(r),$t(i)}}}function rb(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){let n=r.ac;n!==null&&Wi(()=>{n.abort(yn)});var i=r.next;r.f&64?r.parent=null:dt(r,e),r=i}}function PM(t){for(var e=t.first;e!==null;){var r=e.next;e.f&32||dt(e),e=r}}function dt(t,e=!0){var r=!1;(e||t.f&262144)&&t.nodes!==null&&t.nodes.end!==null&&(RM(t.nodes.start,t.nodes.end),r=!0),rb(t,e&&!r),ff(t,0),Be(t,16384);var i=t.nodes&&t.nodes.t;if(i!==null)for(let s of i)s.stop();tb(t);var n=t.parent;n!==null&&n.first!==null&&By(t),M&&(t.component_function=null),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function RM(t,e){for(;t!==null;){var r=t===e?null:Zt(t);t.remove(),t=r}}function By(t){var e=t.parent,r=t.prev,i=t.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),e!==null&&(e.first===t&&(e.first=i),e.last===t&&(e.last=r))}function $n(t,e,r=!0){var i=[];$M(t,i,!0);var n=()=>{r&&dt(t),e&&e()},s=i.length;if(s>0){var a=()=>--s||n();for(var o of i)o.out(a)}else n()}function $M(t,e,r){if(!(t.f&8192)){t.f^=8192;var i=t.nodes&&t.nodes.t;if(i!==null)for(let o of i)(o.is_global||r)&&e.push(o);for(var n=t.first;n!==null;){var s=n.next,a=(n.f&65536)!==0||(n.f&32)!==0&&(t.f&16)!==0;$M(n,e,a?r:!1),n=s}}}function uf(t){IM(t,!0)}function IM(t,e){if(t.f&8192){t.f^=8192,t.f&1024||(Be(t,2048),vr(t));for(var r=t.first;r!==null;){var i=r.next,n=(r.f&65536)!==0||(r.f&32)!==0;IM(r,n?e:!1),r=i}var s=t.nodes&&t.nodes.t;if(s!==null)for(let a of s)(a.is_global||e)&&a.in()}}function Vp(t,e){if(t.nodes)for(var r=t.nodes.start,i=t.nodes.end;r!==null;){var n=r===i?null:Zt(r);e.append(r),r=n}}p();var FM=null;var tm=!1,Ei=!1;function Jy(t){Ei=t}var le=null,qr=!1;function $t(t){le=t}var ne=null;function Gt(t){ne=t}var ni=null;function Zp(t){le!==null&&(!ir||le.f&2)&&(ni===null?ni=[t]:ni.push(t))}var Wr=null,ai=0,si=null;function _M(t){si=t}var OM=1,co=0,ra=co;function Yy(t){ra=t}function ic(){return++OM}function ea(t){var e=t.f;if(e&2048)return!0;if(e&2&&(t.f&=-32769),e&4096){for(var r=t.deps,i=r.length,n=0;nt.wv)return!0}e&512&&Rt===null&&Be(t,1024)}return!1}function MM(t,e,r=!0){var i=t.reactions;if(i!==null&&!(!ir&&ni!==null&&Hi.call(ni,t)))for(var n=0;n{t.ac.abort(yn)}),t.ac=null);try{t.f|=2097152;var u=t.fn,f=u(),d=t.deps,h=(g=ye)==null?void 0:g.is_fork;if(Wr!==null){var m;if(h||ff(t,ai),d!==null&&ai>0)for(d.length=ai+Wr.length,m=0;m{requestAnimationFrame(()=>t()),setTimeout(()=>t())});await Promise.resolve(),Ja()}function R(t){var h,m,g;var e=t.f,r=(e&2)!==0;if((h=FM)==null||h.add(t),le!==null&&!qr){var i=ne!==null&&(ne.f&16384)!==0;if(!i&&(ni===null||!Hi.call(ni,t))){var n=le.deps;if(le.f&2097152)t.rvr==null?void 0:r.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?yt(()=>{e.addEventListener(t,n,i)}):e.addEventListener(t,n,i),n}function oi(t,e,r,i,n){var s={capture:i,passive:n},a=NM(t,e,r,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&ar(()=>{e.removeEventListener(t,a,s)})}function kt(t){for(var e=0;e{throw w});throw d}}finally{t.__root=e,delete t.currentTarget,$t(u),Gt(f)}}}p();p();function nm(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("",""),e.content}function Fn(t,e){var r=ne;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function ue(t,e){var r=(e&1)!==0,i=(e&2)!==0,n,s=!t.startsWith("");return()=>{if(ie)return Fn(ge,null),ge;n===void 0&&(n=nm(s?t:""+t),r||(n=Qt(n)));var a=i||Qu?document.importNode(n,!0):n.cloneNode(!0);if(r){var o=Qt(a),l=a.lastChild;Fn(o,l)}else Fn(a,a);return a}}function fs(){if(ie)return Fn(ge,null),ge;var t=document.createDocumentFragment(),e=document.createComment(""),r=It();return t.append(e,r),Fn(e,r),t}function oe(t,e){if(ie){var r=ne;(!(r.f&32768)||r.nodes.end===null)&&(r.nodes.end=ge),rr();return}t!==null&&t.before(e)}p();var fW=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var Cle=[...fW,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var dW=["touchstart","touchmove"];function UM(t){return dW.includes(t)}var hW=["$state","$state.raw","$derived","$derived.by"],Ple=[...hW,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];var sm=!0;function Ue(t,e){var i;var r=e==null?"":typeof e=="object"?e+"":e;r!==((i=t.__t)!=null?i:t.__t=t.nodeValue)&&(t.__t=r,t.nodeValue=r+"")}function ia(t,e){return GM(t,e)}function ab(t,e){var a;Qp(),e.intro=(a=e.intro)!=null?a:!1;let r=e.target,i=ie,n=ge;try{for(var s=Qt(r);s&&(s.nodeType!==Mr||s.data!==Xu);)s=Zt(s);if(!s)throw rs;Ht(!0),je(s);let o=GM(t,{...e,anchor:s});return Ht(!1),o}catch(o){if(o instanceof Error&&o.message.split(` +`).some(l=>l.startsWith("https://svelte.dev/e/")))throw o;return o!==rs&&console.warn("Failed to hydrate: ",o),e.recover===!1&&qO(),Qp(),oc(r),Ht(!1),ia(t,e)}finally{Ht(i),je(n)}}var cc=new Map;function GM(t,{target:e,anchor:r,props:i={},events:n,context:s,intro:a=!0}){Qp();var o=new Set,l=f=>{for(var d=0;d{var f=r!=null?r:e.appendChild(It());return Gy(f,{pending:()=>{}},d=>{ot({});var h=ke;if(s&&(h.c=s),n&&(i.$$events=n),ie&&Fn(d,null),sm=a,c=t(d,i)||{},sm=!0,ie&&(ne.nodes.end=ge,ge===null||ge.nodeType!==Mr||ge.data!==Va))throw Wa(),rs;lt()}),()=>{var m;for(var d of o){e.removeEventListener(d,lc);var h=cc.get(d);--h===0?(document.removeEventListener(d,lc),cc.delete(d)):cc.set(d,h)}im.delete(l),f!==r&&((m=f.parentNode)==null||m.removeChild(f))}});return sb.set(c,u),c}var sb=new WeakMap;function ds(t,e){let r=sb.get(t);return r?(sb.delete(t),r(e)):(M&&(Wt in t?eM():JO()),Promise.resolve())}p();p();p();var Yi,On,li,uo,df,hf,am,hs=class{constructor(e,r=!0){ze(this,"anchor");pe(this,Yi,new Map);pe(this,On,new Map);pe(this,li,new Map);pe(this,uo,new Set);pe(this,df,!0);pe(this,hf,()=>{var e=ye;if($(this,Yi).has(e)){var r=$(this,Yi).get(e),i=$(this,On).get(r);if(i)uf(i),$(this,uo).delete(r);else{var n=$(this,li).get(r);n&&($(this,On).set(r,n.effect),$(this,li).delete(r),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(let[s,a]of $(this,Yi)){if($(this,Yi).delete(s),s===e)break;let o=$(this,li).get(a);o&&(dt(o.effect),$(this,li).delete(a))}for(let[s,a]of $(this,On)){if(s===r||$(this,uo).has(s))continue;let o=()=>{if(Array.from($(this,Yi).values()).includes(s)){var c=document.createDocumentFragment();Vp(a,c),c.append(It()),$(this,li).set(s,{effect:a,fragment:c})}else dt(a);$(this,uo).delete(s),$(this,On).delete(s)};$(this,df)||!i?($(this,uo).add(s),$n(a,o,!1)):o()}}});pe(this,am,e=>{$(this,Yi).delete(e);let r=Array.from($(this,Yi).values());for(let[i,n]of $(this,li))r.includes(i)||(dt(n.effect),$(this,li).delete(i))});this.anchor=e,fe(this,df,r)}ensure(e,r){var i=ye,n=Jp();if(r&&!$(this,On).has(e)&&!$(this,li).has(e))if(n){var s=document.createDocumentFragment(),a=It();s.append(a),$(this,li).set(e,{effect:Ut(()=>r(a)),fragment:s})}else $(this,On).set(e,Ut(()=>r(this.anchor)));if($(this,Yi).set(i,e),n){for(let[o,l]of $(this,On))o===e?i.unskip_effect(l):i.skip_effect(l);for(let[o,l]of $(this,li))o===e?i.unskip_effect(l.effect):i.skip_effect(l.effect);i.oncommit($(this,hf)),i.ondiscard($(this,am))}else ie&&(this.anchor=ge),$(this,hf).call(this)}};Yi=new WeakMap,On=new WeakMap,li=new WeakMap,uo=new WeakMap,df=new WeakMap,hf=new WeakMap,am=new WeakMap;if(M){let t=function(e){if(!(e in globalThis)){let r;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(r!==void 0)return r;VO(e)},set:i=>{r=i}})}};t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}function fo(t){ke===null&&Rp("onMount"),ss&&ke.l!==null?gW(ke).m.push(t):or(()=>{let e=We(t);if(typeof e=="function")return e})}function gW(t){var r;var e=t.l;return(r=e.u)!=null?r:e.u={a:[],b:[],m:[]}}p();p();var zM=new Map;function VM(t,e){var r=zM.get(t);r||(r=new Set,zM.set(t,r)),r.add(e)}p();p();p();p();p();p();p();p();p();function Ae(t,e,r=!1){ie&&rr();var i=new hs(t),n=r?65536:0;function s(a,o){if(ie){let c=Ip(t)===wn;if(a===c){var l=ns();je(l),i.anchor=l,Ht(!1),i.ensure(a,o),Ht(!0);return}}i.ensure(a,o)}ii(()=>{var a=!1;e((o,l=!0)=>{a=!0,s(l,o)}),a||s(!1,null)},n)}p();var Tfe=Symbol("NaN");p();p();function ci(t,e){return e}function SW(t,e,r){var f;for(var i=[],n=e.length,s,a=e.length,o=0;o{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var h=t.outrogroups;ob(ql(s.done)),h.delete(s),h.size===0&&(t.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=i.length===0&&r!==null;if(l){var c=r,u=c.parentNode;oc(u),u.append(c),t.items.clear()}ob(e,!l)}else s={pending:new Set(e),done:new Set},((f=t.outrogroups)!=null?f:t.outrogroups=new Set).add(s)}function ob(t,e=!0){for(var r=0;r{var w=r();return is(w)?w:w==null?[]:ql(w)}),d,h=!0;function m(){v.fallback=u,EW(v,d,a,e,i),u!==null&&(d.length===0?u.f&33554432?(u.f^=33554432,mf(u,null,a)):uf(u):$n(u,()=>{u=null}))}var g=ii(()=>{d=R(f);var w=d.length;let b=!1;if(ie){var k=Ip(a)===wn;k!==(w===0)&&(a=ns(),je(a),Ht(!1),b=!0)}for(var x=new Set,E=ye,A=Jp(),y=0;ys(a)):(u=Ut(()=>s(uc!=null?uc:uc=It())),u.f|=33554432)),w>x.size&&(M?AW(d,i):Cy("","","")),ie&&w>0&&je(ns()),!h)if(A){for(let[P,D]of o)x.has(P)||E.skip_effect(D.e);E.oncommit(m),E.ondiscard(()=>{})}else m();b&&Ht(!0),R(f)}),v={effect:g,flags:e,items:o,outrogroups:null,fallback:u};h=!1,ie&&(a=ge)}function pf(t){for(;t!==null&&!(t.f&32);)t=t.next;return t}function EW(t,e,r,i,n){var T,P,D,B,N,ce,Pe,ve,se;var s=(i&8)!==0,a=e.length,o=t.items,l=pf(t.effect.first),c,u=null,f,d=[],h=[],m,g,v,w;if(s)for(w=0;w0){var _=i&4&&a===0?r:null;if(s){for(w=0;w{var xe,we;if(f!==void 0)for(v of f)(we=(xe=v.nodes)==null?void 0:xe.a)==null||we.apply()})}function kW(t,e,r,i,n,s,a,o){var l=a&1?a&16?sr(r):oo(r,!1,!1):null,c=a&2?sr(n):null;return M&&l&&(l.trace=()=>{var u;o()[(u=c==null?void 0:c.v)!=null?u:n]}),{v:l,i:c,e:Ut(()=>(s(e,l!=null?l:r,c!=null?c:n,o),()=>{t.delete(i)}))}}function mf(t,e,r){if(t.nodes)for(var i=t.nodes.start,n=t.nodes.end,s=e&&!(e.f&33554432)?e.nodes.start:r;i!==null;){var a=Zt(i);if(s.before(i),i===n)return;i=a}}function na(t,e,r){e===null?t.effect.first=r:e.next=r,r===null?t.effect.last=e:r.prev=e}function AW(t,e){let r=new Map,i=t.length;for(let n=0;nperformance.now():()=>Date.now(),Xi={tick:t=>(Ap?requestAnimationFrame:Or)(t),now:()=>TW(),tasks:new Set};function YM(){let t=Xi.now();Xi.tasks.forEach(e=>{e.c(t)||(Xi.tasks.delete(e),e.f())}),Xi.tasks.size!==0&&Xi.tick(YM)}function XM(t){let e;return Xi.tasks.size===0&&Xi.tick(YM),{promise:new Promise(r=>{Xi.tasks.add(e={c:t,f:r})}),abort(){Xi.tasks.delete(e)}}}function om(t,e){Wi(()=>{t.dispatchEvent(new CustomEvent(e))})}function $W(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;let e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("")}function ZM(t){let e={},r=t.split(";");for(let i of r){let[n,s]=i.split(":");if(!n||s===void 0)break;let a=$W(n.trim());e[a]=s.trim()}return e}var IW=t=>t;function Zi(t,e,r,i){var k,x;var n=(t&1)!==0,s=(t&2)!==0,a=n&&s,o=(t&4)!==0,l=a?"both":n?"in":"out",c,u=e.inert,f=e.style.overflow,d,h;function m(){return Wi(()=>{var E;return c!=null?c:c=r()(e,(E=i==null?void 0:i())!=null?E:{},{direction:l})})}var g={is_global:o,in(){var E;if(e.inert=u,!n){h==null||h.abort(),(E=h==null?void 0:h.reset)==null||E.call(h);return}s||d==null||d.abort(),d=lb(e,m(),h,1,()=>{om(e,"introend"),d==null||d.abort(),d=c=void 0,e.style.overflow=f})},out(E){if(!s){E==null||E(),c=void 0;return}e.inert=!0,h=lb(e,m(),d,0,()=>{om(e,"outroend"),E==null||E()})},stop:()=>{d==null||d.abort(),h==null||h.abort()}},v=ne;if(((x=(k=v.nodes).t)!=null?x:k.t=[]).push(g),n&&sm){var w=o;if(!w){for(var b=v.parent;b&&b.f&65536;)for(;(b=b.parent)&&!(b.f&16););w=!b||(b.f&32768)!==0}w&&Vr(()=>{We(()=>g.in())})}}function lb(t,e,r,i,n){var s=i===1;if(Ay(e)){var a,o=!1;return yt(()=>{if(!o){var v=e({direction:s?"in":"out"});a=lb(t,v,r,i,n)}}),{abort:()=>{o=!0,a==null||a.abort()},deactivate:()=>a.deactivate(),reset:()=>a.reset(),t:()=>a.t()}}if(r==null||r.deactivate(),!(e!=null&&e.duration)&&!(e!=null&&e.delay))return om(t,s?"introstart":"outrostart"),n(),{abort:Or,deactivate:Or,reset:Or,t:()=>i};let{delay:l=0,css:c,tick:u,easing:f=IW}=e;var d=[];if(s&&r===void 0&&(u&&u(0,1),c)){var h=ZM(c(0,1));d.push(h,h)}var m=()=>1-i,g=t.animate(d,{duration:l,fill:"forwards"});return g.onfinish=()=>{var _;g.cancel(),om(t,s?"introstart":"outrostart");var v=(_=r==null?void 0:r.t())!=null?_:1-i;r==null||r.abort();var w=i-v,b=e.duration*Math.abs(w),k=[];if(b>0){var x=!1;if(c)for(var E=Math.ceil(b/16.666666666666668),A=0;A<=E;A+=1){var y=v+w*f(A/E),S=ZM(c(y,1-y));k.push(S),x||(x=S.overflow==="hidden")}x&&(t.style.overflow="hidden"),m=()=>{var T=g.currentTime;return v+w*f(T/b)},u&&XM(()=>{if(g.playState!=="running")return!1;var T=m();return u(T,1-T),!0})}g=t.animate(k,{duration:b,fill:"forwards"}),g.onfinish=()=>{m=()=>i,u==null||u(i,1-i),n()}},{abort:()=>{g&&(g.cancel(),g.effect=null,g.onfinish=Or)},deactivate:()=>{n=Or},reset:()=>{i===0&&(u==null||u(1,0))},t:()=>m()}}p();p();function Ki(t,e){Vr(()=>{var n;var r=t.getRootNode(),i=r.host?r:(n=r.head)!=null?n:r.ownerDocument.head;if(!i.querySelector("#"+e.hash)){let s=document.createElement("style");s.id=e.hash,s.textContent=e.code,i.appendChild(s),M&&VM(e.hash,s)}})}p();p();p();p();p();p();var QM=[...` +\r\f\xA0\v\uFEFF`];function JM(t,e,r){var i=t==null?"":""+t;if(e&&(i=i?i+" "+e:e),r){for(var n in r)if(r[n])i=i?i+" "+n:n;else if(i.length)for(var s=n.length,a=0;(a=i.indexOf(n,a))>=0;){var o=a+s;(a===0||QM.includes(i[a-1]))&&(o===i.length||QM.includes(i[o]))?i=(a===0?"":i.substring(0,a))+i.substring(o+1):a=o}}return i===""?null:i}p();function ht(t,e,r,i,n,s){var a=t.__className;if(ie||a!==r||a===void 0){var o=JM(r,i,s);(!ie||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t.__className=r}else if(s&&n!==s)for(var l in s){var c=!!s[l];(n==null||c!==!!n[l])&&t.classList.toggle(l,c)}return s}p();p();var HW=Symbol("class"),UW=Symbol("style"),GW=Symbol("is custom element"),jW=Symbol("is html");function be(t,e,r,i){var n=qW(t);if(ie&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){i||VW(t,e,r!=null?r:"");return}n[e]!==(n[e]=r)&&(e==="loading"&&(t[LO]=r),r==null?t.removeAttribute(e):typeof r!="string"&&zW(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function qW(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[GW]:t.nodeName.includes("-"),[jW]:t.namespaceURI===OO}}var eD=new Map;function zW(t){var e=t.getAttribute("is")||t.nodeName,r=eD.get(e);if(r)return r;eD.set(e,r=[]);for(var i,n=t,s=Element.prototype;s!==n;){i=Sy(n);for(var a in i)i[a].set&&r.push(a);n=zl(n)}return r}function VW(t,e,r){var i;M&&(e==="srcset"&&WW(t,r)||cb((i=t.getAttribute(e))!=null?i:"",r)||QO(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(r)))}function cb(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function tD(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function WW(t,e){var r=tD(t.srcset),i=tD(e);return i.length===r.length&&i.every(([n,s],a)=>s===r[a][1]&&(cb(r[a][0],n)||cb(n,r[a][0])))}p();p();p();function db(t,e,r=e){var i=new WeakSet;Qy(t,"input",async n=>{M&&t.type==="checkbox"&&Ty();var s=n?t.defaultValue:t.value;if(s=ub(t)?fb(s):s,r(s),ye!==null&&i.add(ye),await rm(),s!==(s=e())){var a=t.selectionStart,o=t.selectionEnd,l=t.value.length;if(t.value=s!=null?s:"",o!==null){var c=t.value.length;a===o&&o===l&&c>l?(t.selectionStart=c,t.selectionEnd=c):(t.selectionStart=a,t.selectionEnd=Math.min(o,c))}}}),(ie&&t.defaultValue!==t.value||We(e)==null&&t.value)&&(r(ub(t)?fb(t.value):t.value),ye!==null&&i.add(ye)),Kt(()=>{var a;M&&t.type==="checkbox"&&Ty();var n=e();if(t===document.activeElement){var s=(a=tf)!=null?a:ye;if(i.has(s))return}ub(t)&&n===fb(t.value)||t.type==="date"&&!n&&!t.value||n!==t.value&&(t.value=n!=null?n:"")})}function ub(t){var e=t.type;return e==="number"||e==="range"}function fb(t){return t===""?null:+t}p();p();p();p();p();function iD(t,e){return t===e||(t==null?void 0:t[Wt])===e}function st(t={},e,r,i){return Vr(()=>{var n,s;return Kt(()=>{n=s,s=(i==null?void 0:i())||[],We(()=>{t!==r(...s)&&(e(t,...s),n&&iD(r(...n),t)&&e(null,...n))})}),()=>{yt(()=>{s&&iD(r(...s),t)&&e(null,...s)})}}),t}p();p();p();p();p();p();p();p();p();var cm=!1,Wme=Symbol();function pb(t){var e=cm;try{return cm=!1,[t(),cm]}finally{cm=e}}function ki(t,e,r,i){var k,x;var n=!ss||(r&2)!==0,s=(r&8)!==0,a=(r&16)!==0,o=i,l=!0,c=()=>(l&&(l=!1,o=a?We(i):i),o),u;if(s){var f=Wt in t||Zu in t;u=(x=(k=Fr(t,e))==null?void 0:k.set)!=null?x:f&&e in t?E=>t[e]=E:void 0}var d,h=!1;s?[d,h]=pb(()=>t[e]):d=t[e],d===void 0&&i!==void 0&&(d=c(),u&&(n&&zO(e),u(d)));var m;if(n?m=()=>{var E=t[e];return E===void 0?c():(l=!0,E)}:m=()=>{var E=t[e];return E!==void 0&&(o=void 0),E===void 0?o:E},n&&!(r&4))return m;if(u){var g=t.$$legacy;return function(E,A){return arguments.length>0?((!n||!A||g||h)&&u(A?m():E),E):m()}}var v=!1,w=(r&1?no:so)(()=>(v=!1,m()));M&&(w.label=e),s&&R(w);var b=ne;return function(E,A){if(arguments.length>0){let y=A?R(w):n&&s?Xe(E):E;return ae(w,y),v=!0,o!==void 0&&(o=y),E}return Ei&&v||b.f&16384?w.v:R(w)}}p();p();p();function nD(t){return new mb(t)}var ms,Ai,mb=class{constructor(e){pe(this,ms);pe(this,Ai);var s,a;var r=new Map,i=(o,l)=>{var c=oo(l,!1,!1);return r.set(o,c),c};let n=new Proxy({...e.props||{},$$events:{}},{get(o,l){var c;return R((c=r.get(l))!=null?c:i(l,Reflect.get(o,l)))},has(o,l){var c;return l===Zu?!0:(R((c=r.get(l))!=null?c:i(l,Reflect.get(o,l))),Reflect.has(o,l))},set(o,l,c){var u;return ae((u=r.get(l))!=null?u:i(l,c),c),Reflect.set(o,l,c)}});fe(this,Ai,(e.hydrate?ab:ia)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:(s=e.intro)!=null?s:!1,recover:e.recover})),!ir&&(!((a=e==null?void 0:e.props)!=null&&a.$$host)||e.sync===!1)&&Ja(),fe(this,ms,n.$$events);for(let o of Object.keys($(this,Ai)))o==="$set"||o==="$destroy"||o==="$on"||tr(this,o,{get(){return $(this,Ai)[o]},set(l){$(this,Ai)[o]=l},enumerable:!0});$(this,Ai).$set=o=>{Object.assign(n,o)},$(this,Ai).$destroy=()=>{ds($(this,Ai))}}$set(e){$(this,Ai).$set(e)}$on(e,r){$(this,ms)[e]=$(this,ms)[e]||[];let i=(...n)=>r.call(this,...n);return $(this,ms)[e].push(i),()=>{$(this,ms)[e]=$(this,ms)[e].filter(n=>n!==i)}}$destroy(){$(this,Ai).$destroy()}};ms=new WeakMap,Ai=new WeakMap;var o9;typeof HTMLElement=="function"&&(o9=class extends HTMLElement{constructor(e,r,i){super();ze(this,"$$ctor");ze(this,"$$s");ze(this,"$$c");ze(this,"$$cn",!1);ze(this,"$$d",{});ze(this,"$$r",!1);ze(this,"$$p_d",{});ze(this,"$$l",{});ze(this,"$$l_u",new Map);ze(this,"$$me");ze(this,"$$shadowRoot",null);this.$$ctor=e,this.$$s=r,i&&(this.$$shadowRoot=this.attachShadow(i))}addEventListener(e,r,i){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(r),this.$$c){let n=this.$$c.$on(e,r);this.$$l_u.set(r,n)}super.addEventListener(e,r,i)}removeEventListener(e,r,i){if(super.removeEventListener(e,r,i),this.$$c){let n=this.$$l_u.get(r);n&&(n(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return s=>{let a=document.createElement("slot");n!=="default"&&(a.name=n),oe(s,a)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let r={},i=l9(this);for(let n of this.$$s)n in i&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),r.default=!0):r[n]=e(n));for(let n of this.attributes){let s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=gb(s,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=nD({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=eb(()=>{Kt(()=>{var n;this.$$r=!0;for(let s of xy(this.$$c)){if(!((n=this.$$p_d[s])!=null&&n.reflect))continue;this.$$d[s]=this.$$c[s];let a=gb(s,this.$$d[s],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,a)}this.$$r=!1})});for(let n in this.$$l)for(let s of this.$$l[n]){let a=this.$$c.$on(n,s);this.$$l_u.set(s,a)}this.$$l={}}}attributeChangedCallback(e,r,i){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=gb(e,i,this.$$p_d,"toProp"),(n=this.$$c)==null||n.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return xy(this.$$p_d).find(r=>this.$$p_d[r].attribute===e||!this.$$p_d[r].attribute&&r.toLowerCase()===e)||e}});function gb(t,e,r,i){var s;let n=(s=r[t])==null?void 0:s.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!r[t])return e;if(i==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function l9(t){let e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}p();p();function ho(t,e,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(i.next(u))}catch(f){a(f)}}function l(u){try{c(i.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):n(u.value).then(o,l)}c((i=i.apply(t,e||[])).next())})}var bb=require("obsidian");p();var wb=require("obsidian");p();function c9(t){let e=t-1;return e*e*e+1}var vb=!1;function Dn(t,{delay:e=0,duration:r=400,easing:i=c9,axis:n="y"}={}){let s=getComputedStyle(t);M&&!vb&&/(contents|inline|table)/.test(s.display)&&(vb=!0,Promise.resolve().then(()=>vb=!1),rM(s.display));let a=+s.opacity,o=n==="y"?"height":"width",l=parseFloat(s[o]),c=n==="y"?["top","bottom"]:["left","right"],u=c.map(w=>`${w[0].toUpperCase()}${w.slice(1)}`),f=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),h=parseFloat(s[`margin${u[0]}`]),m=parseFloat(s[`margin${u[1]}`]),g=parseFloat(s[`border${u[0]}Width`]),v=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:r,easing:i,css:w=>`overflow: hidden;opacity: ${Math.min(w*20,1)*a};${o}: ${w*l}px;padding-${c[0]}: ${w*f}px;padding-${c[1]}: ${w*d}px;margin-${c[0]}: ${w*h}px;margin-${c[1]}: ${w*m}px;border-${c[0]}-width: ${w*g}px;border-${c[1]}-width: ${w*v}px;min-${o}: 0`}}p();var um=require("obsidian");var u9=ue('
'),f9=ue('
'),d9={hash:"svelte-1c0jiav",code:"main.svelte-1c0jiav .nav-file-title:where(.svelte-1c0jiav) {align-items:center;}"};function gf(t,e){ot(e,!0),Ki(t,d9);let r=Xe([]),i=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left");or(()=>{for(let w of r)w&&(0,um.setIcon)(w,w.getAttr("data-icon"))});function n(w){w.stopPropagation(),pl(e.diff.path)?s(w):a(w)}function s(w){var b;w.stopPropagation();let k=e.view.app.vault.getAbstractFileByPath(e.diff.vaultPath);k instanceof um.TFile&&((b=Mi(e.view.app,w))===null||b===void 0||b.openFile(k).catch(x=>e.view.plugin.displayError(x)))}function a(w){var b;e.view.plugin.tools.openDiff({event:w,aFile:(b=e.diff.fromPath)!==null&&b!==void 0?b:e.diff.path,aRef:`${e.diff.hash}^`,bFile:e.diff.path,bRef:e.diff.hash})}var o=f9();o.__click=n;var l=G(o),c=G(l),u=G(c,!0);H(c);var f=te(c,2),d=G(f),h=G(d);{var m=w=>{var b=u9();b.__click=s,st(b,k=>r[0]=k,()=>r==null?void 0:r[0]),oi("auxclick",b,s),oe(w,b)};Ae(h,w=>{ml(e.diff.vaultPath,e.view.app)&&w(m)})}H(d);var g=te(d,2),v=G(g,!0);H(g),H(f),H(l),H(o),Ne(w=>{be(l,"data-path",e.diff.vaultPath),be(l,"data-tooltip-position",R(i)),be(l,"aria-label",e.diff.vaultPath),Ue(u,w),be(g,"data-type",e.diff.status),Ue(v,e.diff.status)},[()=>pn(e.diff.vaultPath)]),oi("auxclick",o,w=>{w.stopPropagation(),w.button==2?hn(e.view.app,w,e.diff.vaultPath,e.view.leaf,"git-history"):n(w)}),oe(t,o),lt()}kt(["click"]);p();var h9=ue("
"),p9=ue(''),m9=ue('
'),g9=ue("
"),v9={hash:"svelte-d9h7mp",code:"main.svelte-d9h7mp .nav-folder-title-content:where(.svelte-d9h7mp) {display:flex;align-items:center;}"};function vf(t,e){ot(e,!0),Ki(t,v9);let r=ki(e,"topLevel",3,!1),i=ki(e,"closed",15),n=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left");function s(l,c){l.stopPropagation(),i(i()[c.path]=!i()[c.path],!0)}var a=g9();let o;ui(a,21,()=>e.hierarchy.children,ci,(l,c)=>{var u=fs(),f=zr(u);{var d=m=>{var g=h9(),v=G(g);gf(v,{get diff(){return R(c).data},get view(){return e.view}}),H(g),oe(m,g)},h=m=>{var g=m9();let v;var w=G(g);w.__click=S=>s(S,R(c));var b=te(G(w),2);let k;var x=te(b,2),E=G(x,!0);H(x),H(w);var A=te(w,2);{var y=S=>{var _=p9(),T=G(_);vf(T,{get hierarchy(){return R(c)},get plugin(){return e.plugin},get view(){return e.view},get closed(){return i()},set closed(P){i(P)}}),H(_),Zi(3,_,()=>Dn,()=>({duration:150})),oe(S,_)};Ae(A,S=>{i()[R(c).path]||S(y)})}H(g),Ne(()=>{v=ht(g,1,"tree-item nav-folder",null,v,{"is-collapsed":i()[R(c).path]}),be(w,"data-tooltip-position",R(n)),be(w,"aria-label",R(c).vaultPath),k=ht(b,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,k,{"is-collapsed":i()[R(c).path]}),Ue(E,R(c).title)}),oe(m,g)};Ae(f,m=>{R(c).data?m(d):m(h,!1)})}oe(l,u)}),H(a),Ne(()=>o=ht(a,1,"svelte-d9h7mp",null,o,{topLevel:r()})),oe(t,a),lt()}kt(["click"]);var w9=ue('
'),y9=ue('
'),b9=ue('
'),_9=ue(''),x9=ue('
'),S9={hash:"svelte-1edsiy5",code:""};function yb(t,e){ot(e,!0),Ki(t,S9);let r=Et(()=>({title:"",path:"",vaultPath:"",children:e.plugin.gitManager.getTreeStructure(e.log.diff.files)})),i=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left"),n=De(!0),s=De(Xe({}));function a(S){let _=S.author.name;if(e.plugin.settings.authorInHistoryView=="full")return _;if(e.plugin.settings.authorInHistoryView=="initials")return _.split(" ").filter(P=>P.length>0).map(P=>P[0].toUpperCase()).join("")}var o=x9(),l=G(o);let c;var u=G(l);u.__click=()=>ae(n,!R(n));var f=G(u);let d;var h=te(f,2),m=G(h);{var g=S=>{var _=w9(),T=G(_,!0);H(_),Ne(P=>Ue(T,P),[()=>e.log.refs.join(", ")]),oe(S,_)};Ae(m,S=>{e.log.refs.length>0&&S(g)})}var v=te(m,2);{var w=S=>{var _=y9(),T=G(_,!0);H(_),Ne(P=>Ue(T,P),[()=>a(e.log)]),oe(S,_)};Ae(v,S=>{var _;e.plugin.settings.authorInHistoryView!="hide"&&((_=e.log.author)!=null&&_.name)&&S(w)})}var b=te(v,2);{var k=S=>{var _=b9(),T=G(_,!0);H(_),Ne(P=>Ue(T,P),[()=>(0,wb.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)]),oe(S,_)};Ae(b,S=>{e.plugin.settings.dateInHistoryView&&S(k)})}var x=te(b,2),E=G(x,!0);H(x),H(h),H(u);var A=te(u,2);{var y=S=>{var _=_9(),T=G(_);{var P=B=>{vf(B,{get hierarchy(){return R(r)},get plugin(){return e.plugin},get view(){return e.view},topLevel:!0,get closed(){return R(s)},set closed(N){ae(s,N,!0)}})},D=B=>{var N=fs(),ce=zr(N);ui(ce,17,()=>e.log.diff.files,ci,(Pe,ve)=>{gf(Pe,{get view(){return e.view},get diff(){return R(ve)}})}),oe(B,N)};Ae(T,B=>{e.showTree?B(P):B(D,!1)})}H(_),Zi(3,_,()=>Dn,()=>({duration:150})),oe(S,_)};Ae(A,S=>{R(n)||S(y)})}H(l),H(o),Ne(S=>{c=ht(l,1,"tree-item nav-folder",null,c,{"is-collapsed":R(n)}),be(u,"aria-label",S),be(u,"data-tooltip-position",R(i)),d=ht(f,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,d,{"is-collapsed":R(n)}),Ue(E,e.log.message)},[()=>{var S;return`${e.log.refs.length>0?e.log.refs.join(", ")+` +`:""}${(S=e.log.author)==null?void 0:S.name} +${(0,wb.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)} +${e.log.message}`}]),oe(t,o),lt()}kt(["click"]);var E9=ue(''),k9=ue('
'),A9={hash:"svelte-12n6twc",code:""};function _b(t,e){ot(e,!0),Ki(t,A9);let r=ki(e,"plugin",15),i=De(!1),n=Xe([]),s=De(void 0),a=De(Xe(r().settings.treeStructure)),o;or(()=>{o&&o.empty()}),fo(()=>{e.view.registerEvent(e.view.app.workspace.on("obsidian-git:head-change",()=>void c().catch(console.error)))}),or(()=>{n.forEach(x=>(0,bb.setIcon)(x,x.getAttr("data-icon")))}),fo(()=>{let x=new IntersectionObserver(A=>{A[0].isIntersecting&&!R(i)&&u().catch(console.error)}),E=document.querySelector("#sentinel");return E&&x.observe(E),()=>{x.disconnect()}}),c().catch(console.error);function l(){c().catch(console.error)}function c(){return ho(this,void 0,void 0,function*(){var x;if(!r().gitReady){ae(s,void 0);return}ae(i,!0);let E=r().gitManager instanceof Se,A;((x=R(s)===null||R(s)===void 0?void 0:R(s).length)!==null&&x!==void 0?x:0)==0?A=E?50:10:A=R(s).length,ae(s,yield r().gitManager.log(void 0,!1,A),!0),ae(i,!1)})}function u(){return ho(this,void 0,void 0,function*(){var x;if(!r().gitReady||R(s)===void 0)return;ae(i,!0);let A=r().gitManager instanceof Se?50:10,y=yield r().gitManager.log(void 0,!1,A,(x=R(s).last())===null||x===void 0?void 0:x.hash);R(s).push(...y.slice(1)),ae(i,!1)})}var f=k9(),d=G(f),h=G(d),m=G(h);m.__click=()=>{ae(a,!R(a)),(0,bb.setIcon)(n[0],R(a)?"list":"folder"),r(r().settings.treeStructure=R(a),!0),r().saveSettings()},st(m,x=>n[0]=x,()=>n==null?void 0:n[0]);var g=te(m,2);let v;g.__click=l,st(g,x=>n[1]=x,()=>n==null?void 0:n[1]),H(h),H(d);var w=te(d,2),b=G(w);{var k=x=>{var E=E9();ui(E,21,()=>R(s),ci,(A,y)=>{yb(A,{get view(){return e.view},get showTree(){return R(a)},get log(){return R(y)},get plugin(){return r()}})}),H(E),oe(x,E)};Ae(b,x=>{R(s)&&x(k)})}Ya(4),H(w),H(f),Ne(()=>{be(m,"data-icon",R(a)?"list":"folder"),v=ht(g,1,"clickable-icon nav-action-button",null,v,{loading:R(i)})}),oe(t,f),lt()}kt(["click"]);var wf=class extends sD.ItemView{constructor(e,r){super(e),this.plugin=r,this.hoverPopover=null}getViewType(){return gi.type}getDisplayText(){return gi.name}getIcon(){return gi.icon}onClose(){return this._view&&ds(this._view),super.onClose()}reload(){this._view&&ds(this._view),this._view=ia(_b,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};p();var aD=require("obsidian"),fm=class extends aD.FuzzySuggestModal{constructor(r,i){super(r.app);this.branches=i;this.setPlaceholder("Select branch to checkout")}getItems(){return this.branches}getItemText(r){return r}onChooseItem(r,i){this.resolve(r)}openAndGetReslt(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}};p();var cD=require("obsidian");p();var go=require("obsidian");p();var yf=require("obsidian");p();var oD=require("obsidian");var fc=class extends oD.Modal{constructor({app:r,path:i,filesToDeleteCount:n,filesToDiscardCount:s}){super(r);this.resolve=null;this.path=i,this.deleteCount=n,this.discardCount=s}openAndGetResult(){return this.open(),new Promise(r=>{this.resolve=r})}onOpen(){let r=this.deleteCount+this.discardCount,{contentEl:i,titleEl:n}=this,s="";this.path!=""&&(r>1?s=`files in "${this.path}"`:s=`"${this.path}"`),n.setText(`${this.discardCount==0?"Delete":"Discard"} ${s}`),this.deleteCount>0&&i.createEl("p").setText(`Are you sure you want to DELETE the ${Su(this.deleteCount,"untracked file")}? They are deleted according to your Obsidian trash settting.`),this.discardCount>0&&i.createEl("p").setText(`Are you sure you want to discard ALL changes in ${Su(this.discardCount,"tracked file")}?`);let a=i.createDiv({cls:"modal-button-container"});if(this.deleteCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`${this.discardCount>0?"Discard":"Delete"} all ${Su(r,"file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("delete"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.resolve("delete"),this.close()})}if(this.discardCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`Discard all ${Su(this.discardCount,"tracked file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("discard"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.resolve("discard"),this.close()})}let o=a.createEl("button",{text:"Cancel"});o.addEventListener("click",()=>(this.resolve&&this.resolve(!1),this.close())),o.addEventListener("keypress",()=>(this.resolve&&this.resolve(!1),this.close()))}onClose(){let{contentEl:r}=this;r.empty()}};var T9=ue('
'),C9=ue('
');function bf(t,e){ot(e,!0);let r=Xe([]),i=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left");or(()=>{for(let A of r)A&&(0,yf.setIcon)(A,A.getAttr("data-icon"))});function n(A){A.stopPropagation(),pl(e.change.path)?a(A):l(A)}function s(A){e.view.app.vault.getAbstractFileByPath(e.change.vaultPath)&&gl(e.view.app,A,e.view,e.change.vaultPath)}function a(A){var y;A.stopPropagation();let S=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);S instanceof yf.TFile&&((y=Mi(e.view.app,A))===null||y===void 0||y.openFile(S).catch(_=>e.view.plugin.displayError(_)))}function o(A){A.stopPropagation(),e.manager.stage(e.change.path,!1).catch(y=>e.view.plugin.displayError(y)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}function l(A){A.stopPropagation(),e.view.plugin.tools.openDiff({aFile:e.change.path,aRef:"",event:A})}function c(A){A.stopPropagation();let y=e.change.workingDir=="U";new fc({app:e.view.app,filesToDeleteCount:y?1:0,filesToDiscardCount:y?0:1,path:e.change.vaultPath}).openAndGetResult().then(S=>ho(this,void 0,void 0,function*(){if(S=="delete"){let _=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);_ instanceof yf.TFile?yield e.view.app.fileManager.trashFile(_):yield e.view.app.vault.adapter.remove(e.change.vaultPath)}else S=="discard"&&(yield e.manager.discard(e.change.path).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")}));e.view.app.workspace.trigger("obsidian-git:refresh")}),S=>e.view.plugin.displayError(S))}var u=C9();u.__mouseover=s,u.__click=n;var f=G(u),d=G(f),h=G(d,!0);H(d);var m=te(d,2),g=G(m),v=G(g);{var w=A=>{var y=T9();y.__click=a,st(y,S=>r[0]=S,()=>r==null?void 0:r[0]),oi("auxclick",y,a),oe(A,y)};Ae(v,A=>{ml(e.change.vaultPath,e.view.app)&&A(w)})}var b=te(v,2);b.__click=c,st(b,A=>r[1]=A,()=>r==null?void 0:r[1]);var k=te(b,2);k.__click=o,st(k,A=>r[2]=A,()=>r==null?void 0:r[2]),H(g);var x=te(g,2),E=G(x,!0);H(x),H(m),H(f),H(u),Ne(A=>{be(f,"data-path",e.change.vaultPath),be(f,"data-tooltip-position",R(i)),be(f,"aria-label",e.change.vaultPath),Ue(h,A),be(x,"data-type",e.change.workingDir),Ue(E,e.change.workingDir)},[()=>pn(e.change.vaultPath)]),oi("auxclick",u,A=>{A.stopPropagation(),A.button==2?hn(e.view.app,A,e.change.vaultPath,e.view.leaf,"git-source-control"):n(A)}),oe(t,u),lt()}kt(["mouseover","click"]);p();var lD=require("obsidian");var P9=ue('
');function _f(t,e){ot(e,!0);let r=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left");function i(d){e.view.app.vault.getAbstractFileByPath(e.change.vaultPath)&&gl(e.view.app,d,e.view,e.change.vaultPath)}function n(d){var h;d.stopPropagation();let m=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);m instanceof lD.TFile&&((h=Mi(e.view.app,d))===null||h===void 0||h.openFile(m).catch(g=>e.view.plugin.displayError(g)))}var s=P9();s.__mouseover=i,s.__click=n;var a=G(s),o=G(a),l=G(o,!0);H(o);var c=te(o,2),u=G(c),f=G(u,!0);H(u),H(c),H(a),H(s),Ne(d=>{be(a,"data-path",e.change.vaultPath),be(a,"data-tooltip-position",R(r)),be(a,"aria-label",e.change.vaultPath),Ue(l,d),be(u,"data-type",e.change.workingDir),Ue(f,e.change.workingDir)},[()=>pn(e.change.vaultPath)]),oi("auxclick",s,d=>{d.stopPropagation(),d.button==2?hn(e.view.app,d,e.change.vaultPath,e.view.leaf,"git-source-control"):n(d)}),oe(t,s),lt()}kt(["mouseover","click"]);p();var dm=require("obsidian");var R9=ue('
'),$9=ue('
');function xf(t,e){ot(e,!0);let r=Xe([]),i=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left");or(()=>{for(let x of r)x&&(0,dm.setIcon)(x,x.getAttr("data-icon"))});function n(x){x.stopPropagation(),pl(e.change.path)?a(x):o(x)}function s(x){e.view.app.vault.getFileByPath(e.change.vaultPath)&&gl(e.view.app,x,e.view,e.change.vaultPath)}function a(x){var E;x.stopPropagation();let A=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);A instanceof dm.TFile&&((E=Mi(e.view.app,x))===null||E===void 0||E.openFile(A).catch(y=>e.view.plugin.displayError(y)))}function o(x){var E;x.stopPropagation(),e.view.plugin.tools.openDiff({aFile:(E=e.change.from)!==null&&E!==void 0?E:e.change.path,bFile:e.change.path,aRef:"HEAD",bRef:"",event:x})}function l(x){x.stopPropagation(),e.manager.unstage(e.change.path,!1).catch(E=>e.view.plugin.displayError(E)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}var c=$9();c.__mouseover=s,c.__click=n;var u=G(c),f=G(u),d=G(f,!0);H(f);var h=te(f,2),m=G(h),g=G(m);{var v=x=>{var E=R9();E.__click=a,st(E,A=>r[0]=A,()=>r==null?void 0:r[0]),oe(x,E)};Ae(g,x=>{ml(e.change.vaultPath,e.view.app)&&x(v)})}var w=te(g,2);w.__click=l,st(w,x=>r[1]=x,()=>r==null?void 0:r[1]),H(m);var b=te(m,2),k=G(b,!0);H(b),H(h),H(u),H(c),Ne(x=>{be(u,"data-path",e.change.vaultPath),be(u,"data-tooltip-position",R(i)),be(u,"aria-label",e.change.vaultPath),Ue(d,x),be(b,"data-type",e.change.index),Ue(k,e.change.index)},[()=>pn(e.change.vaultPath)]),oi("auxclick",c,x=>{x.stopPropagation(),x.button==2?hn(e.view.app,x,e.change.vaultPath,e.view.leaf,"git-source-control"):n(x)}),oe(t,c),lt()}kt(["mouseover","click"]);p();p();var I9=ue(''),F9=ue("
");function po(t,e){ot(e,!0);var r=F9(),i=G(r);{var n=s=>{var a=I9(),o=G(a),l=G(o),c=G(l,!0);H(l),H(o),H(a),Ne(()=>{be(o,"aria-label","And "+(e.files.length-500)+" more files"),Ue(c,"And "+(e.files.length-500)+" more files")}),oe(s,a)};Ae(i,s=>{e.files.length>500&&s(n)})}H(r),oe(t,r),lt()}var M9=ue("
"),D9=ue('
'),L9=ue('
',1),B9=ue(''),N9=ue('
'),H9=ue("
");function mo(t,e){ot(e,!0);let r=ki(e,"topLevel",3,!1),i=ki(e,"closed",15);fo(()=>{var h,m;for(let g of e.hierarchy.children)((m=(h=g.children)===null||h===void 0?void 0:h.length)!==null&&m!==void 0?m:0)>100&&i(i()[g.title]=!0,!0)});let n=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left");function s(h,m){h.stopPropagation(),e.plugin.gitManager.stageAll({dir:m}).catch(g=>e.plugin.displayError(g)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}function a(h,m){h.stopPropagation(),e.plugin.gitManager.unstageAll({dir:m}).catch(g=>e.plugin.displayError(g)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}function o(h,m){h.stopPropagation(),e.plugin.discardAll(m.vaultPath)}function l(h,m){h.stopPropagation(),i(i()[m.path]=!i()[m.path],!0)}var c=H9();let u;var f=G(c);ui(f,17,()=>Eu(e.hierarchy.children,500),ci,(h,m)=>{var g=fs(),v=zr(g);{var w=k=>{var x=M9(),E=G(x);{var A=S=>{xf(S,{get change(){return R(m).data},get manager(){return e.plugin.gitManager},get view(){return e.view}})},y=S=>{var _=fs(),T=zr(_);{var P=B=>{bf(B,{get change(){return R(m).data},get manager(){return e.plugin.gitManager},get view(){return e.view}})},D=B=>{var N=fs(),ce=zr(N);{var Pe=ve=>{_f(ve,{get change(){return R(m).data},get view(){return e.view}})};Ae(ce,ve=>{e.fileType==2&&ve(Pe)},!0)}oe(B,N)};Ae(T,B=>{e.fileType==1?B(P):B(D,!1)},!0)}oe(S,_)};Ae(E,S=>{e.fileType==0?S(A):S(y,!1)})}H(x),oe(k,x)},b=k=>{var x=N9();x.__click=se=>l(se,R(m));let E;var A=G(x),y=te(G(A),2);let S;var _=te(y,2),T=G(_,!0);H(_);var P=te(_,2),D=G(P),B=G(D);{var N=se=>{var xe=D9();xe.__click=we=>a(we,R(m).path),oe(se,xe)},ce=se=>{var xe=L9(),we=zr(xe);we.__click=Q=>o(Q,R(m));var z=te(we,2);z.__click=Q=>s(Q,R(m).path),oe(se,xe)};Ae(B,se=>{e.fileType==0?se(N):se(ce,!1)})}Ya(2),H(D),H(P),H(A);var Pe=te(A,2);{var ve=se=>{var xe=B9(),we=G(xe);mo(we,{get hierarchy(){return R(m)},get plugin(){return e.plugin},get view(){return e.view},get fileType(){return e.fileType},get closed(){return i()},set closed(z){i(z)}}),H(xe),Zi(3,xe,()=>Dn,()=>({duration:150})),oe(se,xe)};Ae(Pe,se=>{i()[R(m).path]||se(ve)})}H(x),Ne(()=>{E=ht(x,1,"tree-item nav-folder",null,E,{"is-collapsed":i()[R(m).path]}),be(A,"data-tooltip-position",R(n)),be(A,"aria-label",R(m).vaultPath),S=ht(y,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,S,{"is-collapsed":i()[R(m).path]}),Ue(T,R(m).title)}),oi("auxclick",x,se=>hn(e.view.app,se,R(m).vaultPath,e.view.leaf,"git-source-control")),oe(k,x)};Ae(v,k=>{R(m).data?k(w):k(b,!1)})}oe(h,g)});var d=te(f,2);po(d,{get files(){return e.hierarchy.children}}),H(c),Ne(()=>u=ht(c,1,"",null,u,{topLevel:r()})),oe(t,c),lt()}kt(["click"]);var U9=ue('
'),G9=ue(" ",1),j9=ue(''),q9=ue(" ",1),z9=ue(''),V9=ue(" ",1),W9=ue(''),Y9=ue('
'),X9=ue(''),Z9=ue('
'),K9={hash:"svelte-5wq9p",code:`.commit-msg-input.svelte-5wq9p {width:100%;overflow:hidden;resize:none;padding:7px 5px;background-color:var(--background-modifier-form-field);}.git-commit-msg.svelte-5wq9p {position:relative;padding:0;width:calc(100% - var(--size-4-8));margin:4px auto;}main.svelte-5wq9p .git-tools:where(.svelte-5wq9p) .files-count:where(.svelte-5wq9p) {padding-left:var(--size-2-1);width:11px;display:flex;align-items:center;justify-content:center;}.nav-folder-title.svelte-5wq9p {align-items:center;}.git-commit-msg-clear-button.svelte-5wq9p {position:absolute;background:transparent;border-radius:50%;color:var(--search-clear-button-color);cursor:var(--cursor);top:-4px;right:2px;bottom:0px;line-height:0;height:var(--input-height);width:28px;margin:auto;padding:0 0;text-align:center;display:flex;justify-content:center;align-items:center;transition:color 0.15s ease-in-out;}.git-commit-msg-clear-button.svelte-5wq9p:after {content:"";height:var(--search-clear-button-size);width:var(--search-clear-button-size);display:block;background-color:currentColor;mask-image:url("data:image/svg+xml,");mask-repeat:no-repeat;-webkit-mask-image:url("data:image/svg+xml,");-webkit-mask-repeat:no-repeat;}`};function xb(t,e){ot(e,!0),Ki(t,K9);let r=ki(e,"plugin",7),i=ki(e,"view",7),n=De(!1),s=De(void 0),a=De(Xe([])),o=Et(()=>r().settings.commitMessage),l=Xe([]),c=De(void 0),u=De(void 0),f=De(void 0),d=De(!0),h=De(!0),m=De(!0),g=De(0),v=De(Xe({})),w=De(Xe({})),b=De(Xe({})),k=Et(()=>r().settings.treeStructure);fo(()=>{console.log("Git view mounted"),i().registerEvent(i().app.workspace.on("obsidian-git:loading-status",()=>ae(n,!0))),i().registerEvent(i().app.workspace.on("obsidian-git:status-changed",()=>void A().catch(console.error))),i().plugin.cachedStatus==null?i().plugin.refresh().catch(console.error):A().catch(console.error),i().scope=new go.Scope(r().app.scope),i().scope.register(["Ctrl"],"Enter",Z=>E())}),or(()=>{l.forEach(Z=>(0,go.setIcon)(Z,Z.getAttr("data-icon")))}),or(()=>{l.forEach(Z=>{var L,V;!Z||Z.id!="push"||(go.Platform.isMobile?(Z.removeClass("button-border"),R(g)>0&&Z.addClass("button-border")):((L=Z.firstElementChild)===null||L===void 0||L.removeAttribute("color"),R(g)>0&&((V=Z.firstElementChild)===null||V===void 0||V.setAttr("color","var(--text-accent)"))))})});function x(){if(ae(n,!0),R(s)){let Z=R(s).staged.length>0;r().promiseQueue.addTask(()=>r().commit({fromAuto:!1,commitMessage:R(o),onlyStaged:Z}).then(()=>ae(o,r().settings.commitMessage)).finally(y))}}function E(){if(ae(n,!0),R(s)){let Z=R(s).staged.length>0;r().promiseQueue.addTask(()=>r().commitAndSync({fromAutoBackup:!1,commitMessage:R(o),onlyStaged:Z}).then(()=>{ae(o,r().settings.commitMessage)}).finally(y))}}function A(){return ho(this,void 0,void 0,function*(){if(!r().gitReady){ae(s,void 0);return}if(ae(g,yield r().gitManager.getUnpushedCommits(),!0),ae(s,r().cachedStatus,!0),ae(n,!1),r().lastPulledFiles&&r().lastPulledFiles!=R(a)&&(ae(a,r().lastPulledFiles,!0),ae(f,{title:"",path:"",vaultPath:"",children:r().gitManager.getTreeStructure(R(a))},!0)),R(s)){let Z=(L,V)=>L.vaultPath.split("/").last().localeCompare(pn(V.vaultPath));R(s).changed.sort(Z),R(s).staged.sort(Z),ae(c,{title:"",path:"",vaultPath:"",children:r().gitManager.getTreeStructure(R(s).changed)},!0),ae(u,{title:"",path:"",vaultPath:"",children:r().gitManager.getTreeStructure(R(s).staged)},!0)}else ae(c,void 0),ae(u,void 0)})}function y(){i().app.workspace.trigger("obsidian-git:refresh")}function S(Z){Z.stopPropagation(),ae(n,!0),r().promiseQueue.addTask(()=>r().gitManager.stageAll({status:R(s)}).finally(y))}function _(Z){Z.stopPropagation(),ae(n,!0),r().promiseQueue.addTask(()=>r().gitManager.unstageAll({status:R(s)}).finally(y))}function T(){ae(n,!0),r().promiseQueue.addTask(()=>r().push().finally(y))}function P(){ae(n,!0),r().promiseQueue.addTask(()=>r().pullChangesFromRemote().finally(y))}function D(Z){Z.stopPropagation(),r().discardAll()}let B=Et(()=>(R(o).match(/\n/g)||[]).length+1||1);var N=Z9(),ce=G(N),Pe=G(ce),ve=G(Pe);ve.__click=E,st(ve,Z=>l[0]=Z,()=>l==null?void 0:l[0]);var se=te(ve,2);se.__click=x,st(se,Z=>l[1]=Z,()=>l==null?void 0:l[1]);var xe=te(se,2);xe.__click=S,st(xe,Z=>l[2]=Z,()=>l==null?void 0:l[2]);var we=te(xe,2);we.__click=_,st(we,Z=>l[3]=Z,()=>l==null?void 0:l[3]);var z=te(we,2);z.__click=T,st(z,Z=>l[4]=Z,()=>l==null?void 0:l[4]);var Q=te(z,2);Q.__click=P,st(Q,Z=>l[5]=Z,()=>l==null?void 0:l[5]);var j=te(Q,2);j.__click=()=>{ae(k,!R(k)),(0,go.setIcon)(l[6],R(k)?"list":"folder"),r().settings.treeStructure=R(k),r().saveSettings()},st(j,Z=>l[6]=Z,()=>l==null?void 0:l[6]);var Le=te(j,2);let lr;Le.__click=y,st(Le,Z=>l[7]=Z,()=>l==null?void 0:l[7]),H(Pe),H(ce);var Ft=te(ce,2),Ie=G(Ft);Zy(Ie);var At=te(Ie,2);{var Tt=Z=>{var L=U9();L.__click=()=>ae(o,""),be(L,"aria-label","Clear"),oe(Z,L)};Ae(At,Z=>{R(o)&&Z(Tt)})}H(Ft);var jt=te(Ft,2),Ze=G(jt);{var q=Z=>{var L=X9(),V=G(L);let Te;var qe=G(V);qe.__click=()=>ae(h,!R(h));var Ot=G(qe);let yo;var Tb=te(Ot,4),Em=G(Tb),Cb=G(Em);Cb.__click=_,st(Cb,cr=>l[8]=cr,()=>l==null?void 0:l[8]),H(Em);var Pb=te(Em,2),wD=G(Pb,!0);H(Pb),H(Tb),H(qe);var yD=te(qe,2);{var bD=cr=>{var yr=j9(),bo=G(yr);{var gs=ur=>{mo(ur,{get hierarchy(){return R(u)},get plugin(){return r()},get view(){return i()},get fileType(){return 0},topLevel:!0,get closed(){return R(v)},set closed(Ti){ae(v,Ti,!0)}})},_o=ur=>{var Ti=G9(),sa=zr(Ti);ui(sa,17,()=>Eu(R(s).staged,500),ci,(vs,hc)=>{xf(vs,{get change(){return R(hc)},get view(){return i()},get manager(){return r().gitManager}})});var aa=te(sa,2);po(aa,{get files(){return R(s).staged}}),oe(ur,Ti)};Ae(bo,ur=>{R(k)?ur(gs):ur(_o,!1)})}H(yr),Zi(3,yr,()=>Dn,()=>({duration:150})),oe(cr,yr)};Ae(yD,cr=>{R(h)&&cr(bD)})}H(V);var Ef=te(V,2);let Rb;var kf=G(Ef);kf.__click=()=>ae(d,!R(d));var $b=G(kf);let Ib;var Fb=te($b,4),km=G(Fb),Ob=G(km);Ob.__click=D;var Mb=te(Ob,2);Mb.__click=S,st(Mb,cr=>l[9]=cr,()=>l==null?void 0:l[9]),H(km);var Db=te(km,2),_D=G(Db,!0);H(Db),H(Fb),H(kf);var xD=te(kf,2);{var SD=cr=>{var yr=z9(),bo=G(yr);{var gs=ur=>{mo(ur,{get hierarchy(){return R(c)},get plugin(){return r()},get view(){return i()},get fileType(){return 1},topLevel:!0,get closed(){return R(w)},set closed(Ti){ae(w,Ti,!0)}})},_o=ur=>{var Ti=q9(),sa=zr(Ti);ui(sa,17,()=>Eu(R(s).changed,500),ci,(vs,hc)=>{bf(vs,{get change(){return R(hc)},get view(){return i()},get manager(){return r().gitManager}})});var aa=te(sa,2);po(aa,{get files(){return R(s).changed}}),oe(ur,Ti)};Ae(bo,ur=>{R(k)?ur(gs):ur(_o,!1)})}H(yr),Zi(3,yr,()=>Dn,()=>({duration:150})),oe(cr,yr)};Ae(xD,cr=>{R(d)&&cr(SD)})}H(Ef);var ED=te(Ef,2);{var kD=cr=>{var yr=Y9();let bo;var gs=G(yr);gs.__click=()=>ae(m,!R(m));var _o=te(G(gs),4),ur=G(_o,!0);H(_o),H(gs);var Ti=te(gs,2);{var sa=aa=>{var vs=W9(),hc=G(vs);{var AD=xo=>{mo(xo,{get hierarchy(){return R(f)},get plugin(){return r()},get view(){return i()},get fileType(){return 2},topLevel:!0,get closed(){return R(b)},set closed(Af){ae(b,Af,!0)}})},TD=xo=>{var Af=V9(),Lb=zr(Af);ui(Lb,17,()=>R(a),ci,(PD,RD)=>{_f(PD,{get change(){return R(RD)},get view(){return i()}})});var CD=te(Lb,2);po(CD,{get files(){return R(a)}}),oe(xo,Af)};Ae(hc,xo=>{R(k)?xo(AD):xo(TD,!1)})}H(vs),Zi(3,vs,()=>Dn,()=>({duration:150})),oe(aa,vs)};Ae(Ti,aa=>{R(m)&&aa(sa)})}H(yr),Ne(()=>{bo=ht(yr,1,"pulled nav-folder",null,bo,{"is-collapsed":!R(m)}),Ue(ur,R(a).length)}),oe(cr,yr)};Ae(ED,cr=>{R(a).length>0&&R(f)&&cr(kD)})}H(L),Ne(()=>{Te=ht(V,1,"staged tree-item nav-folder",null,Te,{"is-collapsed":!R(h)}),yo=ht(Ot,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,yo,{"is-collapsed":!R(h)}),Ue(wD,R(s).staged.length),Rb=ht(Ef,1,"changes tree-item nav-folder",null,Rb,{"is-collapsed":!R(d)}),Ib=ht($b,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,Ib,{"is-collapsed":!R(d)}),Ue(_D,R(s).changed.length)}),oe(Z,L)};Ae(Ze,Z=>{R(s)&&R(u)&&R(c)&&Z(q)})}H(jt),H(N),Ne(()=>{be(N,"data-type",zt.type),be(j,"data-icon",R(k)?"list":"folder"),lr=ht(Le,1,"clickable-icon nav-action-button",null,lr,{loading:R(n)}),be(Ie,"rows",R(B))}),db(Ie,()=>R(o),Z=>ae(o,Z)),oe(t,N),lt()}kt(["click"]);var Sf=class extends cD.ItemView{constructor(e,r){super(e),this.plugin=r,this.hoverPopover=null}getViewType(){return zt.type}getDisplayText(){return zt.name}getIcon(){return zt.icon}onClose(){return this._view&&ds(this._view),super.onClose()}reload(){this._view&&ds(this._view),this._view=ia(xb,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};p();var hm=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;this.statusBarEl.addClass("mod-clickable"),this.statusBarEl.onClickEvent(i=>{this.plugin.switchBranch().catch(n=>r.displayError(n))})}async display(){if(this.plugin.gitReady){let e=await this.plugin.gitManager.branchInfo();e.current!=null?this.statusBarEl.setText(e.current):this.statusBarEl.empty()}else this.statusBarEl.empty()}remove(){this.statusBarEl.remove()}};p();var uD=require("obsidian");var pm=class{constructor(e){this.plugin=e}get editor(){var i;let e=(i=this.plugin.app.workspace.activeEditor)==null?void 0:i.editor,r=e==null?void 0:e.cm;if(!(!e||!Bi.hasHunksData(r.state)))return{editor:r,obEditor:e}}get gitManager(){return this.plugin.gitManager}resetHunk(e){if(!this.editor)return;let{editor:r,obEditor:i}=this.editor,n=Bi.getHunk(r.state,!1,e);if(n){let s,a;n.type==="delete"?(s=n.added.start+1,a=n.added.start+1):(s=n.added.start-0,a=n.added.start-1+n.added.count);let o=r.state.doc.line(s).from,l=n.type==="delete"?r.state.doc.line(a).from:r.state.doc.line(a).to+1,c=n.removed.lines.join(` +`);n.removed.lines.length>0&&!n.removed.no_nl_at_eof&&(c+=` +`),i.replaceRange(c,i.offsetToPos(o),i.offsetToPos(l)),i.setSelection(i.offsetToPos(o))}}async stageHunk(e){if(!await this.plugin.isAllInitialized()||!this.editor)return;let{editor:r}=this.editor,i=Bi.getHunk(r.state,!1,e),n=!1;if(i||(i=Bi.getHunk(r.state,!0,e),n=!0),!i)return;let s=r.state.field(uD.editorInfoField).file.path,a=Nt.createPatch(s,[i],"100644",n).join(` +`)+` +`;await this.gitManager.applyPatch(a),this.plugin.app.workspace.trigger("obsidian-git:refresh")}goToHunk(e){if(!this.editor)return;let{editor:r,obEditor:i}=this.editor,n=Bi.getHunks(r.state,!1),s=i.getCursor().line+1,a=Nt.findNearestHunk(s,n,e,!0);if(a==null)return;let o=n[a];if(o){let l=o.added.start-1;i.setCursor(l,0),i.scrollIntoView({from:{line:l,ch:0},to:{line:l+1,ch:0}},!0)}}};p();p();var vo=require("obsidian");var mm=class{constructor(e){this.plg=e;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=e=>{if(!this.lineAuthorInfoProvider){console.warn("Git: undefined lineAuthorInfoProvider. Unexpected situation.");return}let r=e==null?void 0:e.view;!(r instanceof vo.MarkdownView)||r.file==null||(r==null?void 0:r.allowNoFile)===!0||this.lineAuthorInfoProvider.trackChanged(r.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions),WI(()=>this.plg.settings.lineAuthor,e=>{this.plg.settings.lineAuthor=e,this.plg.saveSettings()})}conditionallyActivateBySettings(){this.plg.settings.lineAuthor.show&&this.activateFeature()}activateFeature(){try{if(!this.isAvailableOnCurrentPlatform().available)return;iF(this.plg.settings.lineAuthor),this.lineAuthorInfoProvider=new ep(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions(),console.log(this.plg.manifest.name+": Enabled line authoring.")}catch(e){console.warn("Git: Error while loading line authoring feature.",e),this.deactivateFeature()}}deactivateFeature(){var e;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(e=this.lineAuthorInfoProvider)==null||e.destroy(),this.lineAuthorInfoProvider=void 0,console.log(this.plg.manifest.name+": Disabled line authoring.")}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&vo.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Se?this.plg.gitManager:void 0}}refreshLineAuthorViews(){this.plg.settings.lineAuthor.show&&(this.deactivateFeature(),this.activateFeature())}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(pF),this.plg.app.workspace.updateOptions(),this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}deactivateCodeMirrorExtensions(){for(let e of this.codeMirrorExtensions)this.codeMirrorExtensions.remove(e);this.plg.app.workspace.updateOptions()}createEventHandlers(){this.gutterContextMenuEvent=this.createGutterContextMenuHandler(),this.fileOpenEvent=this.createFileOpenEvent(),this.workspaceLeafChangeEvent=this.createWorkspaceLeafChangeEvent(),this.fileModificationEvent=this.createVaultFileModificationHandler(),this.headChangeEvent=this.createHeadChangeEvent(),this.refreshOnCssChangeEvent=this.createCssRefreshHandler(),this.fileRenameEvent=this.createFileRenameEvent(),QI(),this.plg.registerEvent(this.gutterContextMenuEvent),this.plg.registerEvent(this.refreshOnCssChangeEvent),this.plg.registerEvent(this.fileOpenEvent),this.plg.registerEvent(this.workspaceLeafChangeEvent),this.plg.registerEvent(this.fileModificationEvent),this.plg.registerEvent(this.headChangeEvent),this.plg.registerEvent(this.fileRenameEvent)}destroyEventHandlers(){this.plg.app.workspace.offref(this.gutterContextMenuEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.workspace.offref(this.fileOpenEvent),this.plg.app.workspace.offref(this.workspaceLeafChangeEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.vault.offref(this.fileModificationEvent),this.plg.app.workspace.offref(this.headChangeEvent),this.plg.app.vault.offref(this.fileRenameEvent)}createFileOpenEvent(){return this.plg.app.workspace.on("file-open",e=>{var r;return void((r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e).catch(console.error))})}createWorkspaceLeafChangeEvent(){return this.plg.app.workspace.on("active-leaf-change",this.handleWorkspaceLeaf)}createFileRenameEvent(){return this.plg.app.vault.on("rename",(e,r)=>{var i;return e instanceof vo.TFile&&((i=this.lineAuthorInfoProvider)==null?void 0:i.trackChanged(e))})}createVaultFileModificationHandler(){return this.plg.app.vault.on("modify",e=>{var r;return e instanceof vo.TFile&&((r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e))})}createHeadChangeEvent(){return this.plg.app.workspace.on("obsidian-git:head-change",()=>{this.refreshLineAuthorViews()})}createCssRefreshHandler(){return this.plg.app.workspace.on("css-change",()=>this.refreshLineAuthorViews())}createGutterContextMenuHandler(){return this.plg.app.workspace.on("editor-menu",tF)}};p();var dc=require("obsidian");p();p();var wo=require("@codemirror/state"),vm=require("@codemirror/view");var gm=class extends vm.GutterMarker{constructor(r,i){super();this.type=r;this.staged=i}toDOM(r){let i=document.createElement("div");return i.className=`git-gutter-marker git-${this.type} ${this.staged?"staged":"unstaged"}`,this.type=="changedelete"&&i.setText("~"),i}},Sb=wo.StateField.define({create:()=>wo.RangeSet.empty,update:(t,e)=>{let r=e.state.field(Ir,!1);if(!r)return wo.RangeSet.empty;let i=e.effects.some(s=>s.is(Uu)),n=e.effects.some(s=>s.is(Ol));if(i||n||(e.docChanged||t.size==0)&&r.isDirty==!1){let s=new Set,a=fD(e,r.hunks,!1,s),o=fD(e,r.stagedHunks,!0,s);return t=wo.RangeSet.of([...a,...o],!0),t}else e.docChanged&&(t=t.map(e.changes));return t}});function fD(t,e,r,i){let n=[];for(let a=0;a0?e[a-1]:void 0,l=a{var e;return(e=t.state.field(Sb,!1))!=null?e:wo.RangeSet.empty},initialSpacer:t=>new gm("delete",!1),domEventHandlers:{click:(t,e,r)=>{var n;return((n=Bi.getHunkAtPos(t.state,e.from,!1))!=null?n:Bi.getHunkAtPos(t.state,e.from,!0))&&(Ys(t,e.from),r.preventDefault()),!1}}});var wm=class{constructor(e){this.plugin=e}async trackChanged(e){return this.trackChangedHelper(e).catch(r=>(console.warn("Git: Error in trackChanged."+r),Promise.reject(r)))}async trackChangedHelper(e){if(e){if(e.path===void 0){console.warn("Git: Attempted to track change of undefined filepath. Unforeseen situation.");return}return this.computeSigns(e.path)}}destroy(){}async computeSigns(e){let i=await this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform().gitManager.show("",e).catch(()=>{});this.notifySignComputationResultToSubscribers(e,{compareText:i,compareTextHead:void 0})}notifySignComputationResultToSubscribers(e,r){Jn.ifFilepathDefinedTransformSubscribers(e,i=>i.forEach(n=>n.notifyGitCompare(r)))}},hD=[AO,TO,dD,Sb,xp],pD=[Ir,uy];p();var Eb=require("obsidian"),ym=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;e.addClass("git-changes-status-bar"),r.settings.hunks.statusBar==="colored"&&e.addClass("git-changes-status-bar-colored"),e.setAttr("aria-label","Git diff of the current editor"),this.statusBarEl.setAttribute("data-tooltip-position","top"),r.app.workspace.on("active-leaf-change",i=>{(!i||i.getRoot()==r.app.workspace.rootSplit&&!(i.view instanceof Eb.MarkdownView))&&this.statusBarEl.empty()})}display(e,r){var o;let i=this.plugin.app.workspace.getActiveViewOfType(Eb.MarkdownView);if(!i||((o=i.file)==null?void 0:o.path)!==(r==null?void 0:r.path))return;let n=0,s=0,a=0;for(let l of e)n+=Math.max(0,l.added.count-l.removed.count),s+=Math.min(l.added.count,l.removed.count),a+=Math.max(0,l.removed.count-l.added.count);this.statusBarEl.empty(),n>0&&this.statusBarEl.createSpan({text:`+${n} `,cls:"git-add"}),s>0&&this.statusBarEl.createSpan({text:`~${s} `,cls:"git-change"}),a>0&&this.statusBarEl.createSpan({text:`-${a}`,cls:"git-delete"})}remove(){this.statusBarEl.remove()}};var bm=class{constructor(e){this.plg=e;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=e=>{if(!this.signsProvider){console.warn("Git: undefined signsProvider. Unexpected situation.");return}let r=e==null?void 0:e.view;!(r instanceof dc.MarkdownView)||r.file==null||(r==null?void 0:r.allowNoFile)===!0||this.signsProvider.trackChanged(r.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions)}conditionallyActivateBySettings(){(this.plg.settings.hunks.showSigns||this.plg.settings.hunks.statusBar!="disabled"||this.plg.settings.hunks.hunkCommands)&&this.activateFeature()}activateFeature(){try{if(!this.isAvailableOnCurrentPlatform().available)return;if(this.signsProvider=new wm(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions(),this.plg.settings.hunks.statusBar!="disabled"){let e=this.plg.addStatusBarItem();this.changeStatusBar=new ym(e,this.plg)}}catch(e){console.warn("Git: Error while loading signs feature.",e),this.deactivateFeature()}}deactivateFeature(){var e,r;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(e=this.signsProvider)==null||e.destroy(),this.signsProvider=void 0,(r=this.changeStatusBar)==null||r.remove(),this.changeStatusBar=void 0}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&dc.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Se?this.plg.gitManager:void 0}}refresh(){this.plg.settings.hunks.showSigns&&this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(pD),this.plg.settings.hunks.showSigns&&this.codeMirrorExtensions.push(...hD),this.plg.app.workspace.updateOptions(),this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}deactivateCodeMirrorExtensions(){for(let e of this.codeMirrorExtensions)this.codeMirrorExtensions.remove(e);this.plg.app.workspace.updateOptions()}createEventHandlers(){this.workspaceLeafChangeEvent=this.createWorkspaceLeafChangeEvent(),this.fileRenameEvent=this.createFileRenameEvent(),this.pluginRefreshedEvent=this.createPluginRefreshedEvent(),this.intervalRefreshEvent=this.createIntervalRefreshEvent(),this.plg.registerEvent(this.workspaceLeafChangeEvent),this.plg.registerEvent(this.fileRenameEvent),this.plg.registerEvent(this.pluginRefreshedEvent),this.plg.registerInterval(this.intervalRefreshEvent)}destroyEventHandlers(){this.plg.app.workspace.offref(this.workspaceLeafChangeEvent),this.plg.app.vault.offref(this.fileRenameEvent),this.plg.app.workspace.offref(this.pluginRefreshedEvent),this.plg.app.workspace.offref(this.gutterContextMenuEvent),window.clearInterval(this.intervalRefreshEvent)}createWorkspaceLeafChangeEvent(){return this.plg.app.workspace.on("active-leaf-change",this.handleWorkspaceLeaf)}createFileRenameEvent(){return this.plg.app.vault.on("rename",(e,r)=>{var i;return Jn.ifFilepathDefinedTransformSubscribers(r,n=>n.forEach(s=>{s.changeToNewFilepath(e.path)})),e instanceof dc.TFile&&((i=this.signsProvider)==null?void 0:i.trackChanged(e))})}createPluginRefreshedEvent(){return this.plg.app.workspace.on("obsidian-git:refresh",()=>{this.refresh()})}createIntervalRefreshEvent(){return window.setInterval(()=>{var e,r;(e=this.plg.app.workspace.activeEditor)!=null&&e.file&&((r=this.signsProvider)==null||r.trackChanged(this.plg.app.workspace.activeEditor.file).catch(console.error))},10*1e3)}};p();var mD=require("@codemirror/state"),_m=require("obsidian");var kb=class{constructor(e){this.state=e;this.subscribeMe()}notifyLineAuthoring(e,r){if(this.view===void 0){console.warn(`Git: View is not defined for editor cache key. Unforeseen situation. id: ${e}`);return}let i=this.view.state,n=VI(e,r,i);this.view.dispatch(n)}notifyGitCompare(e){if(this.view===void 0){console.warn("Git: View is not defined for editor cache key. Unforeseen situation. id: ");return}if(this.removeIfStale())return;let r=this.view.state,i=r.field(Ir);if(!i||i.compareText!=e.compareText||i.compareTextHead!=e.compareTextHead){let n=sO(e,r);this.view.dispatch(n)}}updateToNewState(e){return this.state=e,!this.lastSeenPath&&this.filepath&&this.subscribeMe(),this}removeIfStale(){var e;return((e=this.view)==null?void 0:e.state.field(Ab,!1))!=this||this.view.destroyed?(this.unsubscribeMe(this.lastSeenPath),!0):!1}changeToNewFilepath(e){this.unsubscribeMe(this.lastSeenPath),this.subscribeMe(e)}subscribeMe(e){e!=null||(e=this.filepath),e!==void 0&&(Jn.ifFilepathDefinedTransformSubscribers(e,r=>r.add(this)),this.lastSeenPath=e)}unsubscribeMe(e){Jn.ifFilepathDefinedTransformSubscribers(e,r=>r.delete(this))}get filepath(){var e,r;return(r=(e=this.state.field(_m.editorInfoField))==null?void 0:e.file)==null?void 0:r.path}get view(){return this.state.field(_m.editorEditorField)}},Ab=mD.StateField.define({create:t=>new kb(t),update:(t,e)=>t.updateToNewState(e.state),compare:(t,e)=>t===e});var xm=class{constructor(e){this.plg=e;this.lineAuthoringFeature=new mm(this.plg);this.signsFeature=new bm(this.plg)}onUnloadPlugin(){this.lineAuthoringFeature.deactivateFeature(),this.signsFeature.deactivateFeature()}onLoadPlugin(){this.plg.registerEditorExtension(Ab),this.lineAuthoringFeature.onLoadPlugin(),this.signsFeature.onLoadPlugin()}onReady(){this.lineAuthoringFeature.conditionallyActivateBySettings(),this.signsFeature.conditionallyActivateBySettings()}activateLineAuthoring(){this.lineAuthoringFeature.activateFeature()}deactiveLineAuthoring(){this.lineAuthoringFeature.deactivateFeature()}refreshSignsSettings(){let e=this.plg.settings.hunks;e.showSigns||e.statusBar!="disabled"||e.hunkCommands?(this.signsFeature.deactivateFeature(),this.signsFeature.activateFeature()):this.signsFeature.deactivateFeature()}};var Sm=class extends _e.Plugin{constructor(){super(...arguments);this.automaticsManager=new Du(this);this.tools=new Yu(this);this.localStorage=new Sp(this);this.state={gitAction:0,offlineMode:!1};this.gitReady=!1;this.promiseQueue=new Dd(this);this.intervalsToClear=[];this.editorIntegration=new xm(this);this.hunkActions=new pm(this)}setPluginState(r){var i;this.state=Object.assign(this.state,r),(i=this.statusBar)==null||i.display()}async updateCachedStatus(){var r,i;return this.app.workspace.trigger("obsidian-git:loading-status"),this.cachedStatus=await this.gitManager.status(),this.cachedStatus.conflicted.length>0?(this.localStorage.setConflict(!0),await((r=this.branchBar)==null?void 0:r.display())):(this.localStorage.setConflict(!1),await((i=this.branchBar)==null?void 0:i.display())),this.app.workspace.trigger("obsidian-git:status-changed",this.cachedStatus),this.cachedStatus}async refresh(){if(!this.gitReady)return;let r=this.app.workspace.getLeavesOfType(zt.type),i=this.app.workspace.getLeavesOfType(gi.type);(this.settings.changedFilesInStatusBar||r.some(n=>{var s;return!((s=n.isDeferred)!=null&&s)})||i.some(n=>{var s;return!((s=n.isDeferred)!=null&&s)}))&&await this.updateCachedStatus().catch(n=>this.displayError(n)),this.app.workspace.trigger("obsidian-git:refreshed")}refreshUpdatedHead(){}async onload(){console.log("loading "+this.manifest.name+" plugin: v"+this.manifest.version),Fi.plugin=this,this.localStorage.migrate(),await this.loadSettings(),await this.migrateSettings(),this.settingsTab=new tp(this.app,this),this.addSettingTab(this.settingsTab),this.localStorage.getPluginDisabled()||(this.registerStuff(),this.app.workspace.onLayoutReady(()=>this.init({fromReload:!1}).catch(r=>this.displayError(r))))}onExternalSettingsChange(){this.reloadSettings().catch(r=>this.displayError(r))}async reloadSettings(){let r=JSON.stringify(this.settings);await this.loadSettings();let i=JSON.stringify(this.settings);r!==i&&(this.log("Reloading settings"),this.unloadPlugin(),await this.init({fromReload:!0}),this.app.workspace.getLeavesOfType(zt.type).forEach(n=>{var s;if(!((s=n.isDeferred)!=null&&s))return n.view.reload()}),this.app.workspace.getLeavesOfType(gi.type).forEach(n=>{var s;if(!((s=n.isDeferred)!=null&&s))return n.view.reload()}))}registerStuff(){this.registerEvent(this.app.workspace.on("obsidian-git:refresh",()=>{this.refresh().catch(r=>this.displayError(r))})),this.registerEvent(this.app.workspace.on("obsidian-git:head-change",()=>{this.refreshUpdatedHead()})),this.registerEvent(this.app.workspace.on("file-menu",(r,i,n)=>{this.handleFileMenu(r,i,n,"file-manu")})),this.registerEvent(this.app.workspace.on("obsidian-git:menu",(r,i,n)=>{this.handleFileMenu(r,i,n,"obsidian-git:menu")})),this.registerEvent(this.app.workspace.on("active-leaf-change",r=>{this.onActiveLeafChange(r)})),this.registerEvent(this.app.vault.on("modify",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerEvent(this.app.vault.on("delete",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerEvent(this.app.vault.on("create",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerEvent(this.app.vault.on("rename",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerView(zt.type,r=>new Sf(r,this)),this.registerView(gi.type,r=>new wf(r,this)),this.registerView(Bs.type,r=>new qa(r,this)),this.registerView(Ls.type,r=>new za(r,this)),this.addRibbonIcon("git-pull-request","Open Git source control",async()=>{var n;let r=this.app.workspace.getLeavesOfType(zt.type),i;r.length===0?(i=(n=this.app.workspace.getRightLeaf(!1))!=null?n:this.app.workspace.getLeaf(),await i.setViewState({type:zt.type})):i=r.first(),await this.app.workspace.revealLeaf(i)}),this.registerHoverLinkSource(zt.type,{display:"Git View",defaultMod:!0}),this.editorIntegration.onLoadPlugin(),this.setRefreshDebouncer(),CO(this)}setRefreshDebouncer(){var r;(r=this.debRefresh)==null||r.cancel(),this.debRefresh=(0,_e.debounce)(()=>{this.settings.refreshSourceControl&&this.refresh().catch(console.error)},this.settings.refreshSourceControlTimer,!0)}async addFileToGitignore(r,i){let n=this.gitManager.getRelativeRepoPath(r,!0),s=qP({isFolder:i,gitRelativePath:n});await this.app.vault.adapter.append(this.gitManager.getRelativeVaultPath(".gitignore"),` +`+s),this.app.workspace.trigger("obsidian-git:refresh")}handleFileMenu(r,i,n,s){if(!this.gitReady||!this.settings.showFileMenu||!i)return;let a;if(typeof i=="string"?a=i:a=i.path,n=="file-explorer-context-menu"&&(r.addItem(o=>{o.setTitle("Git: Stage").setIcon("plus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{i instanceof _e.TFile?await this.stageFile(i):(await this.gitManager.stageAll({dir:this.gitManager.getRelativeRepoPath(a,!0)}),this.app.workspace.trigger("obsidian-git:refresh"))})})}),r.addItem(o=>{o.setTitle("Git: Unstage").setIcon("minus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{i instanceof _e.TFile?await this.unstageFile(i):(await this.gitManager.unstageAll({dir:this.gitManager.getRelativeRepoPath(a,!0)}),this.app.workspace.trigger("obsidian-git:refresh"))})})}),r.addItem(o=>{o.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(l=>{this.addFileToGitignore(a,i instanceof _e.TFolder).catch(c=>this.displayError(c))})})),n=="git-source-control"){r.addItem(l=>{l.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(c=>{this.addFileToGitignore(a,i instanceof _e.TFolder).catch(u=>this.displayError(u))})});let o=this.app.vault.adapter;s==="obsidian-git:menu"&&o instanceof _e.FileSystemAdapter&&(r.addItem(l=>{l.setTitle("Open in default app").setIcon("arrow-up-right").setSection("action").onClick(c=>{this.app.openWithDefaultApp(a)})}),r.addItem(l=>{l.setTitle("Show in system explorer").setIcon("arrow-up-right").setSection("action").onClick(c=>{window.electron.shell.showItemInFolder(vD.join(o.getBasePath(),a))})}))}}async migrateSettings(){this.settings.mergeOnPull!=null&&(this.settings.syncMethod=this.settings.mergeOnPull?"merge":"rebase",this.settings.mergeOnPull=void 0,await this.saveSettings()),this.settings.autoCommitMessage===void 0&&(this.settings.autoCommitMessage=this.settings.commitMessage,await this.saveSettings()),this.settings.gitPath!=null&&(this.localStorage.setGitPath(this.settings.gitPath),this.settings.gitPath=void 0,await this.saveSettings()),this.settings.username!=null&&(this.localStorage.setPassword(this.settings.username),this.settings.username=void 0,await this.saveSettings())}unloadPlugin(){var r,i;this.gitReady=!1,this.editorIntegration.onUnloadPlugin(),this.automaticsManager.unload(),(r=this.branchBar)==null||r.remove(),(i=this.statusBar)==null||i.remove(),this.statusBar=void 0,this.branchBar=void 0,this.gitManager.unload(),this.promiseQueue.clear();for(let n of this.intervalsToClear)window.clearInterval(n);this.intervalsToClear=[],this.debRefresh.cancel()}onunload(){this.unloadPlugin(),console.log("unloading "+this.manifest.name+" plugin")}async loadSettings(){let r=await this.loadData();r==null&&(r={showedMobileNotice:!0}),this.settings=XA(rt,r)}async saveSettings(){var r;(r=this.settingsTab)==null||r.beforeSaveSettings(),await this.saveData(this.settings)}get useSimpleGit(){return _e.Platform.isDesktopApp}async init({fromReload:r=!1}){var i;if(this.settings.showStatusBar&&!this.statusBar){let n=this.addStatusBarItem();this.statusBar=new rp(n,this),this.intervalsToClear.push(window.setInterval(()=>{var s;return(s=this.statusBar)==null?void 0:s.display()},1e3))}try{this.useSimpleGit?(this.gitManager=new Se(this),await this.gitManager.setGitInstance()):this.gitManager=new Di(this);let n=await this.gitManager.checkRequirements(),s=this.localStorage.getPausedAutomatics();switch(n){case"missing-git":this.displayError(`Cannot run git command. Trying to run: '${this.localStorage.getGitPath()||"git"}' .`);break;case"missing-repo":new _e.Notice("Can't find a valid git repository. Please create one via the given command or clone an existing repo.",1e4);break;case"valid":if(this.gitReady=!0,this.setPluginState({gitAction:0}),_e.Platform.isDesktop&&this.settings.showBranchStatusBar&&!this.branchBar){let a=this.addStatusBarItem();this.branchBar=new hm(a,this),this.intervalsToClear.push(window.setInterval(()=>{var o;return void((o=this.branchBar)==null?void 0:o.display().catch(console.error))},6e4))}await((i=this.branchBar)==null?void 0:i.display()),this.editorIntegration.onReady(),this.app.workspace.trigger("obsidian-git:refresh"),this.app.workspace.trigger("obsidian-git:head-change"),!r&&this.settings.autoPullOnBoot&&!s&&this.promiseQueue.addTask(()=>this.pullChangesFromRemote()),s||await this.automaticsManager.init(),s&&new _e.Notice("Automatic routines are currently paused.");break;default:this.log("Something weird happened. The 'checkRequirements' result is "+n)}}catch(n){this.displayError(n),console.error(n)}}async createNewRepo(){try{await this.gitManager.init(),new _e.Notice("Initialized new repo"),await this.init({fromReload:!0})}catch(r){this.displayError(r)}}async cloneNewRepo(){let i=await new Qe(this,{placeholder:"Enter remote URL"}).openAndGetResult();if(i){let n="Vault Root",s=await new Qe(this,{options:this.gitManager instanceof Di?[n]:[],placeholder:"Enter directory for clone. It needs to be empty or not existent.",allowEmpty:this.gitManager instanceof Di}).openAndGetResult();if(s==null)return;if(s===n&&(s="."),s=(0,_e.normalizePath)(s),s==="/"&&(s="."),s==="."){let f=await new Qe(this,{options:["NO","YES"],placeholder:`Does your remote repo contain a ${this.app.vault.configDir} directory at the root?`,onlySelection:!0}).openAndGetResult();if(f===void 0){new _e.Notice("Aborted clone");return}else if(f==="YES"){let d="DELETE ALL YOUR LOCAL CONFIG AND PLUGINS";if(await new Qe(this,{options:["Abort clone",d],placeholder:`To avoid conflicts, the local ${this.app.vault.configDir} directory needs to be deleted.`,onlySelection:!0}).openAndGetResult()===d)await this.app.vault.adapter.rmdir(this.app.vault.configDir,!0);else{new _e.Notice("Aborted clone");return}}}let a=await new Qe(this,{placeholder:"Specify depth of clone. Leave empty for full clone.",allowEmpty:!0}).openAndGetResult(),o;if(a===void 0){new _e.Notice("Aborted clone");return}if(a!==""&&(o=parseInt(a),isNaN(o))){new _e.Notice("Invalid depth. Aborting clone.");return}new _e.Notice(`Cloning new repo into "${s}"`);let l=this.settings.basePath,c=s&&s!==".";c&&(this.settings.basePath=s);try{await this.gitManager.clone(qw(i),s,o),new _e.Notice("Cloned new repo."),new _e.Notice("Please restart Obsidian"),c&&await this.saveSettings()}catch(u){this.displayError(u),this.settings.basePath=l,await this.saveSettings()}}}async isAllInitialized(){return this.gitReady||await this.init({fromReload:!0}),this.gitReady}async pullChangesFromRemote(){if(!await this.isAllInitialized())return;let r=await this.pull();if(r!==!1){if(r||this.displayMessage("Pull: Everything is up-to-date"),this.gitManager instanceof Se){let i=await this.updateCachedStatus();i.conflicted.length>0&&(this.displayError(`You have conflicts in ${i.conflicted.length} ${i.conflicted.length==1?"file":"files"}`),await this.handleConflict(i.conflicted))}this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0})}}async commitAndSync({fromAutoBackup:r,requestCustomMessage:i=!1,commitMessage:n,onlyStaged:s=!1}){!await this.isAllInitialized()||(this.settings.syncMethod=="reset"&&this.settings.pullBeforePush&&await this.pull(),!await this.commit({fromAuto:r,requestCustomMessage:i,commitMessage:n,onlyStaged:s}))||(this.settings.syncMethod!="reset"&&this.settings.pullBeforePush&&await this.pull(),this.settings.disablePush||(await this.remotesAreSet()&&await this.gitManager.canPush()?await this.push():this.displayMessage("No commits to push")),this.setPluginState({gitAction:0}))}async commit({fromAuto:r,requestCustomMessage:i=!1,onlyStaged:n=!1,commitMessage:s,amend:a=!1}){if(!await this.isAllInitialized())return!1;try{let o=this.localStorage.getConflict(),l,c=[],u=[];if(this.gitManager instanceof Se){if(await this.mayDeleteConflictFile(),l=await this.updateCachedStatus(),l.conflicted.length==0&&(o=!1),r&&l.conflicted.length>0)return this.displayError(`Did not commit, because you have conflicts in ${l.conflicted.length} ${l.conflicted.length==1?"file":"files"}. Please resolve them and commit per command.`),await this.handleConflict(l.conflicted),!1;c=l.staged,u=l.changed}else{if(r&&o)return this.displayError("Did not commit, because you have conflicts. Please resolve them and commit per command."),!1;{o&&await this.mayDeleteConflictFile();let f=this.gitManager;n?c=await f.getStagedFiles():u=(await f.getUnstagedFiles()).map(({path:h,type:m})=>({vaultPath:this.gitManager.getRelativeVaultPath(h),path:h,type:m}))}}if(await this.tools.hasTooBigFiles(n?c:[...c,...u]))return this.setPluginState({gitAction:0}),!1;if(u.length+c.length!==0||o){let f=s!=null?s:s=r?this.settings.autoCommitMessage:this.settings.commitMessage;if(r&&this.settings.customMessageOnAutoBackup||i){!this.settings.disablePopups&&r&&new _e.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort");let m=await new ip(this).openAndGetResult();if(m!=null&&m!=""&&m!="...")f=m;else return this.setPluginState({gitAction:0}),!1}else if(this.gitManager instanceof Se&&this.settings.commitMessageScript){let m=this.settings.commitMessageScript,g=this.localStorage.getHostname()||"",v=m.replace("{{hostname}}",g);v=v.replace("{{date}}",(0,_e.moment)().format(this.settings.commitDateFormat));let w=await ku("sh",["-c",v],{cwd:this.gitManager.absoluteRepoPath});w.code!=0?this.displayError(w.stderr):w.stdout.trim().length==0?this.displayMessage("Stdout from commit message script is empty. Using default message."):f=w.stdout}if(!f||f.trim()==="")return new _e.Notice("Commit aborted: No commit message provided"),this.setPluginState({gitAction:0}),!1;let d;n?d=await this.gitManager.commit({message:f,amend:a}):d=await this.gitManager.commitAll({message:f,status:l,unstagedFiles:u,amend:a}),this.gitManager instanceof Se&&await this.updateCachedStatus();let h=!1;d===void 0&&(h=!0,d=u.length+c.length||0),this.displayMessage(`Committed${h?" approx.":""} ${d} ${d==1?"file":"files"}`)}else this.displayMessage("No changes to commit");return this.app.workspace.trigger("obsidian-git:refresh"),!0}catch(o){return this.displayError(o),!1}}async push(){if(!await this.isAllInitialized()||!await this.remotesAreSet())return!1;let r=this.localStorage.getConflict();try{this.gitManager instanceof Se&&await this.mayDeleteConflictFile();let i;if(this.gitManager instanceof Se&&(i=await this.updateCachedStatus()).conflicted.length>0)return this.displayError(`Cannot push. You have conflicts in ${i.conflicted.length} ${i.conflicted.length==1?"file":"files"}`),await this.handleConflict(i.conflicted),!1;if(this.gitManager instanceof Di&&r)return this.displayError("Cannot push. You have conflicts"),!1;this.log("Pushing....");let n=await this.gitManager.push();return n!==void 0&&(n===null?this.displayMessage("Pushed to remote"):n>0?this.displayMessage(`Pushed ${n} ${n==1?"file":"files"} to remote`):this.displayMessage("No commits to push")),this.setPluginState({offlineMode:!1}),this.app.workspace.trigger("obsidian-git:refresh"),!0}catch(i){return i instanceof cl?this.handleNoNetworkError(i):this.displayError(i),!1}}async pull(){if(!await this.remotesAreSet())return!1;try{this.log("Pulling....");let r=await this.gitManager.pull()||[];return this.setPluginState({offlineMode:!1}),r.length>0&&(this.displayMessage(`Pulled ${r.length} ${r.length==1?"file":"files"} from remote`),this.lastPulledFiles=r),r.length}catch(r){return this.displayError(r),!1}}async fetch(){if(await this.remotesAreSet())try{await this.gitManager.fetch(),this.displayMessage("Fetched from remote"),this.setPluginState({offlineMode:!1}),this.app.workspace.trigger("obsidian-git:refresh")}catch(r){this.displayError(r)}}async mayDeleteConflictFile(){let r=this.app.vault.getAbstractFileByPath(al);r&&(this.app.workspace.iterateAllLeaves(i=>{var n;i.view instanceof _e.MarkdownView&&((n=i.view.file)==null?void 0:n.path)==r.path&&i.detach()}),await this.app.vault.delete(r))}async stageFile(r){return await this.isAllInitialized()?(await this.gitManager.stage(r.path,!0),this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0}),!0):!1}async unstageFile(r){return await this.isAllInitialized()?(await this.gitManager.unstage(r.path,!0),this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0}),!0):!1}async switchBranch(){var n;if(!await this.isAllInitialized())return;let r=await this.gitManager.branchInfo(),i=await new fm(this,r.branches).openAndGetReslt();if(i!=null)return await this.gitManager.checkout(i),this.displayMessage(`Switched to ${i}`),this.app.workspace.trigger("obsidian-git:refresh"),await((n=this.branchBar)==null?void 0:n.display()),i}async switchRemoteBranch(){var s;if(!await this.isAllInitialized())return;let r=await this.selectRemoteBranch()||"",[i,n]=Zn(r);if(n!=null&&i!=null)return await this.gitManager.checkout(n,i),this.displayMessage(`Switched to ${r}`),await((s=this.branchBar)==null?void 0:s.display()),r}async createBranch(){var i;if(!await this.isAllInitialized())return;let r=await new Qe(this,{placeholder:"Create new branch"}).openAndGetResult();if(r!=null)return await this.gitManager.createBranch(r),this.displayMessage(`Created new branch ${r}`),await((i=this.branchBar)==null?void 0:i.display()),r}async deleteBranch(){var n;if(!await this.isAllInitialized())return;let r=await this.gitManager.branchInfo();r.current&&r.branches.remove(r.current);let i=await new Qe(this,{options:r.branches,placeholder:"Delete branch",onlySelection:!0}).openAndGetResult();if(i!=null){let s=!1;if(!await this.gitManager.branchIsMerged(i)){let o=await new Qe(this,{options:["YES","NO"],placeholder:"This branch isn't merged into HEAD. Force delete?",onlySelection:!0}).openAndGetResult();if(o!=="YES")return;s=o==="YES"}return await this.gitManager.deleteBranch(i,s),this.displayMessage(`Deleted branch ${i}`),await((n=this.branchBar)==null?void 0:n.display()),i}}async remotesAreSet(){return this.settings.updateSubmodules||this.gitManager instanceof Se&&await this.gitManager.getConfig("push.autoSetupRemote","all")=="true"||(await this.gitManager.branchInfo()).tracking?!0:(new _e.Notice("No upstream branch is set. Please select one."),await this.setUpstreamBranch())}async setUpstreamBranch(){let r=await this.selectRemoteBranch();return r==null?(this.displayError("Aborted. No upstream-branch is set!",1e4),this.setPluginState({gitAction:0}),!1):(await this.gitManager.updateUpstreamBranch(r),this.displayMessage(`Set upstream branch to ${r}`),this.setPluginState({gitAction:0}),!0)}async discardAll(r){if(!await this.isAllInitialized())return!1;let i=await this.gitManager.status({path:r}),n=0,s=0;for(let o of i.changed)o.workingDir=="U"?n++:s++;if(n+s==0)return!1;let a=await new fc({app:this.app,filesToDeleteCount:n,filesToDiscardCount:s,path:r!=null?r:""}).openAndGetResult();switch(a){case!1:return a;case"discard":await this.gitManager.discardAll({dir:r,status:this.cachedStatus});break;case"delete":{await this.gitManager.discardAll({dir:r,status:this.cachedStatus});let o=await this.gitManager.getUntrackedPaths({path:r,status:this.cachedStatus});for(let l of o){let c=this.gitManager.getRelativeVaultPath(l),u=this.app.vault.getAbstractFileByPath(c);u?await this.app.fileManager.trashFile(u):l.endsWith("/")?await this.app.vault.adapter.rmdir(c,!0):await this.app.vault.adapter.remove(c)}break}default:wh(a)}return this.app.workspace.trigger("obsidian-git:refresh"),a}async handleConflict(r){this.localStorage.setConflict(!0);let i;r!==void 0&&(i=["# Conflicts","Please resolve them and commit them using the commands `Git: Commit all changes` followed by `Git: Push`","(This file will automatically be deleted before commit)","[[#Additional Instructions]] available below file list","",...r.map(n=>{let s=this.app.vault.getAbstractFileByPath(n);return s instanceof _e.TFile?`- [[${this.app.metadataCache.fileToLinktext(s,"/")}]]`:`- Not a file: ${n}`}),` +# Additional Instructions +I strongly recommend to use "Source mode" for viewing the conflicted files. For simple conflicts, in each file listed above replace every occurrence of the following text blocks with the desired text. + +\`\`\`diff +<<<<<<< HEAD + File changes in local repository +======= + File changes in remote repository +>>>>>>> origin/main +\`\`\``]),await this.tools.writeAndOpenFile(i==null?void 0:i.join(` +`))}async editRemotes(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),n=await new Qe(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(n){let s=await this.gitManager.getRemoteUrl(n),o=await new Qe(this,{initialValue:s,placeholder:"Enter remote URL"}).openAndGetResult();if(o)return await this.gitManager.setRemote(n,qw(o)),n}}async selectRemoteBranch(){let r=await this.gitManager.getRemotes(),i;r.length===0&&(i=await this.editRemotes(),i==null&&(r=await this.gitManager.getRemotes()));let n=new Qe(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}),s=i!=null?i:await n.openAndGetResult();if(s){this.displayMessage("Fetching remote branches"),await this.gitManager.fetch(s);let a=await this.gitManager.getRemoteBranches(s),l=await new Qe(this,{options:a,placeholder:"Select or create a new remote branch by typing its name and selecting it"}).openAndGetResult();return l==null?void 0:l.startsWith(s+"/")?l:`${s}/${l}`}}async removeRemote(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),n=await new Qe(this,{options:r,placeholder:"Select a remote"}).openAndGetResult();n&&await this.gitManager.removeRemote(n)}onActiveLeafChange(r){var a,o;let i=r==null?void 0:r.view;if(!(i!=null&&i.getState().file)&&!(i instanceof qa||i instanceof za))return;let n=this.app.workspace.getLeavesOfType(zt.type).first(),s=this.app.workspace.getLeavesOfType(gi.type).first();if((a=n==null?void 0:n.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||a.removeClass("is-active"),(o=s==null?void 0:s.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||o.removeClass("is-active"),(r==null?void 0:r.view)instanceof qa||(r==null?void 0:r.view)instanceof za){let c=r.view.state.bFile.replace(/["\\]/g,"\\$&");this.lastDiffViewState=r.view.getState();let u;n&&r.view.state.aRef=="HEAD"?u=n.view.containerEl.querySelector(`div.staged div.tree-item-self[data-path="${c}"]`):n&&r.view.state.aRef==""?u=n.view.containerEl.querySelector(`div.changes div.tree-item-self[data-path="${c}"]`):s&&(u=s.view.containerEl.querySelector(`div.tree-item-self[data-path='${c}']`)),u==null||u.addClass("is-active")}else this.lastDiffViewState=void 0}handleNoNetworkError(r){this.state.offlineMode?this.log("Encountered network error, but already in offline mode"):this.displayError("Git: Going into offline mode. Future network errors will no longer be displayed.",2e3),this.setPluginState({gitAction:0,offlineMode:!0})}displayMessage(r,i=4*1e3){var n;(n=this.statusBar)==null||n.displayMessage(r.toLowerCase(),i),this.settings.disablePopups||(!this.settings.disablePopupsForNoChanges||!r.startsWith("No changes"))&&new _e.Notice(r,5*1e3),this.log(r)}displayError(r,i=10*1e3){var s;if(r instanceof gD.Errors.UserCanceledError){new _e.Notice("Aborted");return}let n;r instanceof Error?n=r:n=new Error(String(r)),this.setPluginState({gitAction:0}),this.settings.showErrorNotices&&new _e.Notice(n.message,i),console.error(`${this.manifest.id}:`,n.stack),(s=this.statusBar)==null||s.displayMessage(n.message.toLowerCase(),i)}log(...r){console.log(`${this.manifest.id}:`,...r)}}; +/*! Bundled license information: + +ieee754/index.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) + +buffer/index.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +safe-buffer/index.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) + +crc-32/crc32.js: + (*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *) + +isomorphic-git/index.cjs: + (*! + * This code for `path.join` is directly copied from @zenfs/core/path for bundle size improvements. + * SPDX-License-Identifier: LGPL-3.0-or-later + * Copyright (c) James Prevett and other ZenFS contributors. + *) + +js-sha256/src/sha256.js: + (** + * [js-sha256]{@link https://github.com/emn178/js-sha256} + * + * @version 0.9.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2017 + * @license MIT + *) +*/ + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/manifest.json b/.obsidian/plugins/obsidian-git/manifest.json new file mode 100644 index 0000000..fe238e5 --- /dev/null +++ b/.obsidian/plugins/obsidian-git/manifest.json @@ -0,0 +1,10 @@ +{ + "author": "Vinzent", + "authorUrl": "https://github.com/Vinzent03", + "id": "obsidian-git", + "name": "Git", + "description": "Integrate Git version control with automatic backup and other advanced features.", + "isDesktopOnly": false, + "fundingUrl": "https://ko-fi.com/vinzent", + "version": "2.37.1" +} diff --git a/.obsidian/plugins/obsidian-git/styles.css b/.obsidian/plugins/obsidian-git/styles.css new file mode 100644 index 0000000..92c8af8 --- /dev/null +++ b/.obsidian/plugins/obsidian-git/styles.css @@ -0,0 +1,705 @@ +@keyframes loading { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} + +.git-signs-gutter { + .cm-gutterElement { + /* Needed to align the sign properly for different line heigts. Such as + * when having a heading or list item. + */ + padding-top: 0 !important; + } +} + +.workspace-leaf-content[data-type="git-view"] .button-border { + border: 2px solid var(--interactive-accent); + border-radius: var(--radius-s); +} + +.workspace-leaf-content[data-type="git-view"] .view-content { + padding-left: 0; + padding-top: 0; + padding-right: 0; +} + +.workspace-leaf-content[data-type="git-history-view"] .view-content { + padding-left: 0; + padding-top: 0; + padding-right: 0; +} + +.loading { + overflow: hidden; +} + +.loading > svg { + animation: 2s linear infinite loading; + transform-origin: 50% 50%; + display: inline-block; +} + +.obsidian-git-center { + margin: auto; + text-align: center; + width: 50%; +} + +.obsidian-git-textarea { + display: block; + margin-left: auto; + margin-right: auto; +} + +.obsidian-git-disabled { + opacity: 0.5; +} + +.obsidian-git-center-button { + display: block; + margin: 20px auto; +} + +.tooltip.mod-left { + overflow-wrap: break-word; +} + +.tooltip.mod-right { + overflow-wrap: break-word; +} + +/* Limits the scrollbar to the view body */ +.git-view { + display: flex; + flex-direction: column; + position: relative; + height: 100%; +} + +.git-tools { + display: flex; + margin-left: auto; +} +.git-tools .type { + padding-left: var(--size-2-1); + display: flex; + align-items: center; + justify-content: center; + width: 11px; +} + +.git-tools .type[data-type="M"] { + color: orange; +} +.git-tools .type[data-type="D"] { + color: red; +} +.git-tools .buttons { + display: flex; +} +.git-tools .buttons > * { + padding: 0 0; + height: auto; +} + +.workspace-leaf-content[data-type="git-view"] .tree-item-self, +.workspace-leaf-content[data-type="git-history-view"] .tree-item-self { + align-items: center; +} + +.workspace-leaf-content[data-type="git-view"] + .tree-item-self:hover + .clickable-icon, +.workspace-leaf-content[data-type="git-history-view"] + .tree-item-self:hover + .clickable-icon { + color: var(--icon-color-hover); +} + +/* Highlight an item as active if it's diff is currently opened */ +.is-active .git-tools .buttons > * { + color: var(--nav-item-color-active); +} + +.git-author { + color: var(--text-accent); +} + +.git-date { + color: var(--text-accent); +} + +.git-ref { + color: var(--text-accent); +} + +/* ====== diff2html ====== +The following styles are adapted from the obsidian-version-history plugin by +@kometenstaub https://github.com/kometenstaub/obsidian-version-history-diff/blob/main/src/styles.scss +which itself is adapted from the diff2html library with the following original license: + + https://github.com/rtfpessoa/diff2html/blob/master/LICENSE.md + + Copyright 2014-2016 Rodrigo Fernandes https://rtfpessoa.github.io/ + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the + Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +.theme-dark, +.theme-light { + --git-delete-bg: #ff475040; + --git-delete-hl: #96050a75; + --git-insert-bg: #68d36840; + --git-insert-hl: #23c02350; + --git-change-bg: #ffd55840; + --git-selected: #3572b0; + + --git-delete: #c33; + --git-insert: #399839; + --git-change: #d0b44c; + --git-move: #3572b0; +} + +.git-diff { + .d2h-d-none { + display: none; + } + .d2h-wrapper { + text-align: left; + border-radius: 0.25em; + overflow: auto; + } + .d2h-file-header.d2h-file-header { + background-color: var(--background-secondary); + border-bottom: 1px solid var(--background-modifier-border); + font-family: + Source Sans Pro, + Helvetica Neue, + Helvetica, + Arial, + sans-serif; + height: 35px; + padding: 5px 10px; + } + .d2h-file-header, + .d2h-file-stats { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + } + .d2h-file-header { + display: none; + } + .d2h-file-stats { + font-size: 14px; + margin-left: auto; + } + .d2h-lines-added { + border: 1px solid var(--color-green); + border-radius: 5px 0 0 5px; + color: var(--color-green); + padding: 2px; + text-align: right; + vertical-align: middle; + } + .d2h-lines-deleted { + border: 1px solid var(--color-red); + border-radius: 0 5px 5px 0; + color: var(--color-red); + margin-left: 1px; + padding: 2px; + text-align: left; + vertical-align: middle; + } + .d2h-file-name-wrapper { + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + font-size: 15px; + width: 100%; + } + .d2h-file-name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: var(--text-normal); + font-size: var(--h5-size); + } + .d2h-file-wrapper { + border: 1px solid var(--background-secondary-alt); + border-radius: 3px; + margin-bottom: 1em; + max-height: 100%; + } + .d2h-file-collapse { + -webkit-box-pack: end; + -ms-flex-pack: end; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + border: 1px solid var(--background-secondary-alt); + border-radius: 3px; + cursor: pointer; + display: none; + font-size: 12px; + justify-content: flex-end; + padding: 4px 8px; + } + .d2h-file-collapse.d2h-selected { + background-color: var(--git-selected); + } + .d2h-file-collapse-input { + margin: 0 4px 0 0; + } + .d2h-diff-table { + border-collapse: collapse; + font-family: var(--font-monospace); + font-size: var(--code-size); + width: 100%; + } + .d2h-files-diff { + width: 100%; + } + .d2h-file-diff { + /* + overflow-y: scroll; + */ + border-radius: 5px; + font-size: var(--font-text-size); + line-height: var(--line-height-normal); + } + .d2h-file-side-diff { + display: inline-block; + margin-bottom: -8px; + margin-right: -4px; + overflow-x: scroll; + overflow-y: hidden; + width: 50%; + } + .d2h-code-line { + padding-left: 6em; + padding-right: 1.5em; + } + .d2h-code-line, + .d2h-code-side-line { + display: inline-block; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + white-space: nowrap; + width: 100%; + } + .d2h-code-side-line { + /* needed to be changed */ + padding-left: 0.5em; + padding-right: 0.5em; + } + .d2h-code-line-ctn { + word-wrap: normal; + background: none; + display: inline-block; + padding: 0; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + vertical-align: middle; + width: 100%; + /* only works for line-by-line */ + white-space: pre-wrap; + } + .d2h-code-line del, + .d2h-code-side-line del { + background-color: var(--git-delete-hl); + color: var(--text-normal); + } + .d2h-code-line del, + .d2h-code-line ins, + .d2h-code-side-line del, + .d2h-code-side-line ins { + border-radius: 0.2em; + display: inline-block; + margin-top: -1px; + text-decoration: none; + vertical-align: middle; + } + .d2h-code-line ins, + .d2h-code-side-line ins { + background-color: var(--git-insert-hl); + text-align: left; + } + .d2h-code-line-prefix { + word-wrap: normal; + background: none; + display: inline; + padding: 0; + white-space: pre; + } + .line-num1 { + float: left; + } + .line-num1, + .line-num2 { + -webkit-box-sizing: border-box; + box-sizing: border-box; + overflow: hidden; + /* + padding: 0 0.5em; + */ + text-overflow: ellipsis; + width: 2.5em; + padding-left: 0; + } + .line-num2 { + float: right; + } + .d2h-code-linenumber { + background-color: var(--background-primary); + border: solid var(--background-modifier-border); + border-width: 0 1px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + color: var(--text-faint); + cursor: pointer; + display: inline-block; + position: absolute; + text-align: right; + width: 5.5em; + } + .d2h-code-linenumber:after { + content: "\200b"; + } + .d2h-code-side-linenumber { + background-color: var(--background-primary); + border: solid var(--background-modifier-border); + border-width: 0 1px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + color: var(--text-faint); + cursor: pointer; + overflow: hidden; + padding: 0 0.5em; + text-align: right; + text-overflow: ellipsis; + width: 4em; + /* needed to be changed */ + display: table-cell; + position: relative; + } + .d2h-code-side-linenumber:after { + content: "\200b"; + } + .d2h-code-side-emptyplaceholder, + .d2h-emptyplaceholder { + background-color: var(--background-primary); + border-color: var(--background-modifier-border); + } + .d2h-code-line-prefix, + .d2h-code-linenumber, + .d2h-code-side-linenumber, + .d2h-emptyplaceholder { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + } + .d2h-code-linenumber, + .d2h-code-side-linenumber { + direction: rtl; + } + .d2h-del { + background-color: var(--git-delete-bg); + border-color: var(--git-delete-hl); + } + .d2h-ins { + background-color: var(--git-insert-bg); + border-color: var(--git-insert-hl); + } + .d2h-info { + background-color: var(--background-primary); + border-color: var(--background-modifier-border); + color: var(--text-faint); + } + .d2h-del, + .d2h-ins, + .d2h-file-diff .d2h-change { + color: var(--text-normal); + } + .d2h-file-diff .d2h-del.d2h-change { + background-color: var(--git-change-bg); + } + .d2h-file-diff .d2h-ins.d2h-change { + background-color: var(--git-insert-bg); + } + .d2h-file-list-wrapper { + a { + text-decoration: none; + cursor: default; + -webkit-user-drag: none; + } + + svg { + display: none; + } + } + .d2h-file-list-header { + text-align: left; + } + .d2h-file-list-title { + display: none; + } + .d2h-file-list-line { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + text-align: left; + } + .d2h-file-list { + } + .d2h-file-list > li { + border-bottom: 1px solid var(--background-modifier-border); + margin: 0; + padding: 5px 10px; + } + .d2h-file-list > li:last-child { + border-bottom: none; + } + .d2h-file-switch { + cursor: pointer; + display: none; + font-size: 10px; + } + .d2h-icon { + fill: currentColor; + margin-right: 10px; + vertical-align: middle; + } + .d2h-deleted { + color: var(--git-delete); + } + .d2h-added { + color: var(--git-insert); + } + .d2h-changed { + color: var(--git-change); + } + .d2h-moved { + color: var(--git-move); + } + .d2h-tag { + background-color: var(--background-secondary); + display: -webkit-box; + display: -ms-flexbox; + display: flex; + font-size: 10px; + margin-left: 5px; + padding: 0 2px; + } + .d2h-deleted-tag { + border: 1px solid var(--git-delete); + } + .d2h-added-tag { + border: 1px solid var(--git-insert); + } + .d2h-changed-tag { + border: 1px solid var(--git-change); + } + .d2h-moved-tag { + border: 1px solid var(--git-move); + } + + /* needed for line-by-line*/ + + .d2h-diff-tbody { + position: relative; + } +} + +/* ====================== Line Authoring Information ====================== */ + +.cm-gutterElement.obs-git-blame-gutter { + /* Add background color to spacing inbetween and around the gutter for better aesthetics */ + border-width: 0px 2px 0.2px 2px; + border-style: solid; + border-color: var(--background-secondary); + background-color: var(--background-secondary); +} + +.cm-gutterElement.obs-git-blame-gutter > div, +.line-author-settings-preview { + /* delegate text color to settings */ + color: var(--obs-git-gutter-text); + font-family: monospace; + height: 100%; /* ensure, that age-based background color occupies entire parent */ + text-align: right; + padding: 0px 6px 0px 6px; + white-space: pre; /* Keep spaces and do not collapse them. */ +} + +@media (max-width: 800px) { + /* hide git blame gutter not to superpose text */ + .cm-gutterElement.obs-git-blame-gutter { + display: none; + } +} + +.git-unified-diff-view, +.git-split-diff-view .cm-deletedLine .cm-changedText { + background-color: #ee443330; +} + +.git-unified-diff-view, +.git-split-diff-view .cm-insertedLine .cm-changedText { + background-color: #22bb2230; +} + +.git-obscure-prompt[git-is-obscured="true"] #git-show-password:after { + -webkit-mask-image: url('data:image/svg+xml,'); +} + +.git-obscure-prompt[git-is-obscured="false"] #git-show-password:after { + -webkit-mask-image: url('data:image/svg+xml,'); +} + +/* Override styling of Codemirror merge view "collapsed lines" indicator */ +.git-split-diff-view .ͼ2 .cm-collapsedLines { + background: var(--interactive-normal); + border-radius: var(--radius-m); + color: var(--text-accent); + font-size: var(--font-small); + padding: var(--size-4-1) var(--size-4-1); +} +.git-split-diff-view .ͼ2 .cm-collapsedLines:hover { + background: var(--interactive-hover); + color: var(--text-accent-hover); +} + +.git-signs-gutter { + .cm-gutterElement { + display: grid; + } +} + +.git-gutter-marker:hover { + border-radius: 2px; +} + +.git-gutter-marker.git-add { + background-color: var(--color-green); + justify-self: center; + height: inherit; + width: 0.2rem; +} + +.git-gutter-marker.git-change { + background-color: var(--color-yellow); + justify-self: center; + height: inherit; + width: 0.2rem; +} + +.git-gutter-marker.git-changedelete { + color: var(--color-yellow); + font-weight: var(--font-bold); + font-size: 1rem; + justify-self: center; + height: inherit; +} + +.git-gutter-marker.git-delete { + background-color: var(--color-red); + height: 0.2rem; + width: 0.8rem; + align-self: end; +} + +.git-gutter-marker.git-topdelete { + background-color: var(--color-red); + height: 0.2rem; + width: 0.8rem; + align-self: start; +} + +div:hover > .git-gutter-marker.git-change { + width: 0.6rem; +} + +div:hover > .git-gutter-marker.git-add { + width: 0.6rem; +} + +div:hover > .git-gutter-marker.git-delete { + height: 0.6rem; +} + +div:hover > .git-gutter-marker.git-topdelete { + height: 0.6rem; +} + +div:hover > .git-gutter-marker.git-changedelete { + font-weight: var(--font-bold); +} + +.git-gutter-marker.staged { + opacity: 0.5; +} + +.git-diff { + .cm-merge-revert { + width: 4em; + } + /* Ensure that merge revert markers are positioned correctly */ + .cm-merge-revert > * { + position: absolute; + background-color: var(--background-secondary); + display: flex; + } +} + +/* Prevent shifting of the editor when git signs gutter is the only gutter present */ +.cm-gutters.cm-gutters-before:has(> .git-signs-gutter:only-child) { + margin-inline-end: 0; + .git-signs-gutter { + margin-inline-start: -1rem; + } +} + +.git-changes-status-bar-colored { + .git-add { + color: var(--color-green); + } + .git-change { + color: var(--color-yellow); + } + .git-delete { + color: var(--color-red); + } +} + +.git-changes-status-bar .git-add { + margin-right: 0.3em; +} + +.git-changes-status-bar .git-change { + margin-right: 0.3em; +} diff --git a/.obsidian/plugins/obsidian-minimal-settings/data.json b/.obsidian/plugins/obsidian-minimal-settings/data.json new file mode 100644 index 0000000..6b68bcf --- /dev/null +++ b/.obsidian/plugins/obsidian-minimal-settings/data.json @@ -0,0 +1,34 @@ +{ + "lightStyle": "minimal-light", + "darkStyle": "minimal-dark", + "lightScheme": "minimal-default-light", + "darkScheme": "minimal-flexoki-dark", + "editorFont": "", + "lineHeight": 1.5, + "lineWidth": 40, + "lineWidthWide": 50, + "maxWidth": 88, + "textNormal": 16, + "textSmall": 13, + "imgGrid": false, + "imgWidth": "img-default-width", + "tableWidth": "table-default-width", + "iframeWidth": "iframe-default-width", + "mapWidth": "map-default-width", + "chartWidth": "chart-default-width", + "colorfulHeadings": false, + "colorfulFrame": false, + "colorfulActiveStates": false, + "trimNames": true, + "labeledNav": false, + "fullWidthMedia": true, + "bordersToggle": true, + "minimalStatus": true, + "focusMode": false, + "underlineInternal": true, + "underlineExternal": true, + "folding": true, + "lineNumbers": false, + "readableLineLength": true, + "devBlockWidth": false +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-minimal-settings/main.js b/.obsidian/plugins/obsidian-minimal-settings/main.js new file mode 100644 index 0000000..e1aad21 --- /dev/null +++ b/.obsidian/plugins/obsidian-minimal-settings/main.js @@ -0,0 +1,8 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ + +var x=Object.create;var u=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var v=n=>u(n,"__esModule",{value:!0});var O=(n,t)=>{v(n);for(var s in t)u(n,s,{get:t[s],enumerable:!0})},E=(n,t,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of W(t))!N.call(n,l)&&l!=="default"&&u(n,l,{get:()=>t[l],enumerable:!(s=L(t,l))||s.enumerable});return n},y=n=>E(v(u(n!=null?x(T(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var p=(n,t,s)=>new Promise((l,d)=>{var f=h=>{try{m(s.next(h))}catch(o){d(o)}},g=h=>{try{m(s.throw(h))}catch(o){d(o)}},m=h=>h.done?l(h.value):Promise.resolve(h.value).then(f,g);m((s=s.apply(n,t)).next())});O(exports,{default:()=>S});var C=y(require("obsidian"));var a=y(require("obsidian")),D={lightStyle:"minimal-light",darkStyle:"minimal-dark",lightScheme:"minimal-default-light",darkScheme:"minimal-default-dark",editorFont:"",lineHeight:1.5,lineWidth:40,lineWidthWide:50,maxWidth:88,textNormal:16,textSmall:13,imgGrid:!1,imgWidth:"img-default-width",tableWidth:"table-default-width",iframeWidth:"iframe-default-width",mapWidth:"map-default-width",chartWidth:"chart-default-width",colorfulHeadings:!1,colorfulFrame:!1,colorfulActiveStates:!1,trimNames:!0,labeledNav:!1,fullWidthMedia:!0,bordersToggle:!0,minimalStatus:!0,focusMode:!1,underlineInternal:!0,underlineExternal:!0,folding:!0,lineNumbers:!1,readableLineLength:!1,devBlockWidth:!1},b=class extends a.PluginSettingTab{constructor(t,s){super(t,s);this.plugin=s}display(){let{containerEl:t}=this;t.empty();let l=t.createEl("div",{cls:"setting-item setting-item-heading"}).createEl("div",{cls:"setting-item-info"});l.createEl("div",{text:"Color scheme",cls:"setting-item-name"});let d=l.createEl("div",{cls:"setting-item-description"});d.appendChild(createEl("span",{text:"To create a custom color scheme use the "})),d.appendChild(createEl("a",{text:"Style Settings",href:"obsidian://show-plugin?id=obsidian-style-settings"})),d.appendText(" plugin. See "),d.appendChild(createEl("a",{text:"documentation",href:"https://minimal.guide/features/color-schemes"})),d.appendText(" for details."),new a.Setting(t).setName("Light mode color scheme").setDesc("Preset color options for light mode.").addDropdown(i=>i.addOption("minimal-default-light","Default").addOption("minimal-atom-light","Atom").addOption("minimal-ayu-light","Ayu").addOption("minimal-catppuccin-light","Catppuccin").addOption("minimal-eink-light","E-ink (beta)").addOption("minimal-everforest-light","Everforest").addOption("minimal-flexoki-light","Flexoki").addOption("minimal-gruvbox-light","Gruvbox").addOption("minimal-macos-light","macOS").addOption("minimal-nord-light","Nord").addOption("minimal-rose-pine-light","Ros\xE9 Pine").addOption("minimal-notion-light","Sky").addOption("minimal-solarized-light","Solarized").addOption("minimal-things-light","Things").setValue(this.plugin.settings.lightScheme).onChange(e=>{this.plugin.settings.lightScheme=e,this.plugin.saveData(this.plugin.settings),this.plugin.updateLightScheme()})),new a.Setting(t).setName("Light mode background contrast").setDesc("Level of contrast between sidebar and main content.").addDropdown(i=>i.addOption("minimal-light","Default").addOption("minimal-light-white","All white").addOption("minimal-light-tonal","Low contrast").addOption("minimal-light-contrast","High contrast").setValue(this.plugin.settings.lightStyle).onChange(e=>{this.plugin.settings.lightStyle=e,this.plugin.saveData(this.plugin.settings),this.plugin.updateLightStyle()})),new a.Setting(t).setName("Dark mode color scheme").setDesc("Preset colors options for dark mode.").addDropdown(i=>i.addOption("minimal-default-dark","Default").addOption("minimal-atom-dark","Atom").addOption("minimal-ayu-dark","Ayu").addOption("minimal-catppuccin-dark","Catppuccin").addOption("minimal-dracula-dark","Dracula").addOption("minimal-eink-dark","E-ink (beta)").addOption("minimal-everforest-dark","Everforest").addOption("minimal-flexoki-dark","Flexoki").addOption("minimal-gruvbox-dark","Gruvbox").addOption("minimal-macos-dark","macOS").addOption("minimal-nord-dark","Nord").addOption("minimal-rose-pine-dark","Ros\xE9 Pine").addOption("minimal-notion-dark","Sky").addOption("minimal-solarized-dark","Solarized").addOption("minimal-things-dark","Things").setValue(this.plugin.settings.darkScheme).onChange(e=>{this.plugin.settings.darkScheme=e,this.plugin.saveData(this.plugin.settings),this.plugin.updateDarkScheme()})),new a.Setting(t).setName("Dark mode background contrast").setDesc("Level of contrast between sidebar and main content.").addDropdown(i=>i.addOption("minimal-dark","Default").addOption("minimal-dark-tonal","Low contrast").addOption("minimal-dark-black","True black").setValue(this.plugin.settings.darkStyle).onChange(e=>{this.plugin.settings.darkStyle=e,this.plugin.saveData(this.plugin.settings),this.plugin.updateDarkStyle()})),t.createEl("br");let g=t.createEl("div",{cls:"setting-item setting-item-heading"}).createEl("div",{cls:"setting-item-info"});g.createEl("div",{text:"Features",cls:"setting-item-name"});let m=g.createEl("div",{cls:"setting-item-description"});m.appendChild(createEl("span",{text:"See "})),m.appendChild(createEl("a",{text:"documentation",href:"https://minimal.guide"})),m.appendText(" for details."),new a.Setting(t).setName("Text labels for primary navigation").setDesc("Navigation items in the left sidebar uses text labels.").addToggle(i=>i.setValue(this.plugin.settings.labeledNav).onChange(e=>{this.plugin.settings.labeledNav=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Colorful window frame").setDesc("The top area of the app uses your accent color.").addToggle(i=>i.setValue(this.plugin.settings.colorfulFrame).onChange(e=>{this.plugin.settings.colorfulFrame=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Colorful active states").setDesc("Active file and menu items use your accent color.").addToggle(i=>i.setValue(this.plugin.settings.colorfulActiveStates).onChange(e=>{this.plugin.settings.colorfulActiveStates=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Colorful headings").setDesc("Headings use a different color for each size.").addToggle(i=>i.setValue(this.plugin.settings.colorfulHeadings).onChange(e=>{this.plugin.settings.colorfulHeadings=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Minimal status bar").setDesc("Turn off to use full-width status bar.").addToggle(i=>i.setValue(this.plugin.settings.minimalStatus).onChange(e=>{this.plugin.settings.minimalStatus=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Trim file names in sidebars").setDesc("Use ellipses to fit file names on a single line.").addToggle(i=>i.setValue(this.plugin.settings.trimNames).onChange(e=>{this.plugin.settings.trimNames=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Workspace borders").setDesc("Display divider lines between workspace elements.").addToggle(i=>i.setValue(this.plugin.settings.bordersToggle).onChange(e=>{this.plugin.settings.bordersToggle=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Focus mode").setDesc("Hide tab bar and status bar, hover to display. Can be toggled via hotkey.").addToggle(i=>i.setValue(this.plugin.settings.focusMode).onChange(e=>{this.plugin.settings.focusMode=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Underline internal links").setDesc("Show underlines on internal links.").addToggle(i=>i.setValue(this.plugin.settings.underlineInternal).onChange(e=>{this.plugin.settings.underlineInternal=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Underline external links").setDesc("Show underlines on external links.").addToggle(i=>i.setValue(this.plugin.settings.underlineExternal).onChange(e=>{this.plugin.settings.underlineExternal=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Maximize media").setDesc("Images and videos fill the width of the line.").addToggle(i=>i.setValue(this.plugin.settings.fullWidthMedia).onChange(e=>{this.plugin.settings.fullWidthMedia=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),t.createEl("br");let o=t.createEl("div",{cls:"setting-item setting-item-heading"}).createEl("div",{cls:"setting-item-info"});o.createEl("div",{text:"Layout",cls:"setting-item-name"});let r=o.createEl("div",{cls:"setting-item-description"});r.appendChild(createEl("span",{text:"These options can also be defined on a per-file basis, see "})),r.appendChild(createEl("a",{text:"documentation",href:"https://minimal.guide/features/block-width"})),r.appendText(" for details."),new a.Setting(t).setName("Image grids").setDesc("Turn consecutive images into columns \u2014 to make a new row, add an extra line break between images.").addToggle(i=>i.setValue(this.plugin.settings.imgGrid).onChange(e=>{this.plugin.settings.imgGrid=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Chart width").setDesc("Default width for chart blocks.").addDropdown(i=>i.addOption("chart-default-width","Default").addOption("chart-wide","Wide line width").addOption("chart-max","Maximum line width").addOption("chart-100","100% pane width").setValue(this.plugin.settings.chartWidth).onChange(e=>{this.plugin.settings.chartWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Iframe width").setDesc("Default width for iframe blocks.").addDropdown(i=>i.addOption("iframe-default-width","Default").addOption("iframe-wide","Wide line width").addOption("iframe-max","Maximum line width").addOption("iframe-100","100% pane width").setValue(this.plugin.settings.iframeWidth).onChange(e=>{this.plugin.settings.iframeWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Image width").setDesc("Default width for image blocks.").addDropdown(i=>i.addOption("img-default-width","Default").addOption("img-wide","Wide line width").addOption("img-max","Maximum line width").addOption("img-100","100% pane width").setValue(this.plugin.settings.imgWidth).onChange(e=>{this.plugin.settings.imgWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Map width").setDesc("Default width for map blocks.").addDropdown(i=>i.addOption("map-default-width","Default").addOption("map-wide","Wide line width").addOption("map-max","Maximum line width").addOption("map-100","100% pane width").setValue(this.plugin.settings.mapWidth).onChange(e=>{this.plugin.settings.mapWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Table width").setDesc("Default width for table and Dataview blocks.").addDropdown(i=>i.addOption("table-default-width","Default").addOption("table-wide","Wide line width").addOption("table-max","Maximum line width").addOption("table-100","100% pane width").setValue(this.plugin.settings.tableWidth).onChange(e=>{this.plugin.settings.tableWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),t.createEl("br"),t.createEl("div",{text:"Typography",cls:"setting-item setting-item-heading"}),new a.Setting(t).setName("Text font size").setDesc("Used for the main text (default 16).").addText(i=>i.setPlaceholder("16").setValue((this.plugin.settings.textNormal||"")+"").onChange(e=>{this.plugin.settings.textNormal=parseFloat(e),this.plugin.saveData(this.plugin.settings),this.plugin.setFontSize()})),new a.Setting(t).setName("Small font size").setDesc("Used for text in the sidebars and tabs (default 13).").addText(i=>i.setPlaceholder("13").setValue((this.plugin.settings.textSmall||"")+"").onChange(e=>{this.plugin.settings.textSmall=parseFloat(e),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Line height").setDesc("Line height of text (default 1.5).").addText(i=>i.setPlaceholder("1.5").setValue((this.plugin.settings.lineHeight||"")+"").onChange(e=>{this.plugin.settings.lineHeight=parseFloat(e),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Normal line width").setDesc("Number of characters per line (default 40).").addText(i=>i.setPlaceholder("40").setValue((this.plugin.settings.lineWidth||"")+"").onChange(e=>{this.plugin.settings.lineWidth=parseInt(e.trim()),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Wide line width").setDesc("Number of characters per line for wide elements (default 50).").addText(i=>i.setPlaceholder("50").setValue((this.plugin.settings.lineWidthWide||"")+"").onChange(e=>{this.plugin.settings.lineWidthWide=parseInt(e.trim()),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Maximum line width %").setDesc("Percentage of space inside a pane that a line can fill (default 88).").addText(i=>i.setPlaceholder("88").setValue((this.plugin.settings.maxWidth||"")+"").onChange(e=>{this.plugin.settings.maxWidth=parseInt(e.trim()),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Editor font").setDesc("Overrides the text font defined in Obsidian Appearance settings when in edit mode.").addText(i=>i.setPlaceholder("").setValue((this.plugin.settings.editorFont||"")+"").onChange(e=>{this.plugin.settings.editorFont=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()}))}};var S=class extends C.Plugin{onload(){return p(this,null,function*(){yield this.loadSettings(),this.addSettingTab(new b(this.app,this)),this.loadRules();let t=()=>{let i=this.app.vault.getConfig("baseFontSize");this.settings.textNormal=i;let e=!1,w=!1,k=!1;this.app.vault.getConfig("foldHeading")?(this.settings.folding=!0,console.log("Folding is on"),e=!0):(this.settings.folding=!1,console.log("Folding is off")),this.app.vault.getConfig("showLineNumber")?(this.settings.lineNumbers=!0,console.log("Line numbers are on"),w=!0):(this.settings.lineNumbers=!1,console.log("Line numbers are off")),this.app.vault.getConfig("readableLineLength")?(this.settings.readableLineLength=!0,console.log("Readable line length is on"),k=!0):(this.settings.readableLineLength=!1,console.log("Readable line length is off"));let c=document.body.classList;c.toggle("minimal-folding",e),c.toggle("minimal-line-nums",w),c.toggle("minimal-readable",k),c.toggle("minimal-readable-off",!k),this.saveData(this.settings)},s=()=>{let i=document.getElementsByClassName("mod-left-split")[0],e=document.getElementsByClassName("side-dock-ribbon")[0];i&&e&&document.body.classList.contains("theme-light")&&this.settings.lightStyle=="minimal-light-contrast"?(i.addClass("theme-dark"),e.addClass("theme-dark")):i&&e&&(i.removeClass("theme-dark"),e.removeClass("theme-dark"))};this.registerEvent(app.vault.on("config-changed",t)),this.registerEvent(app.workspace.on("css-change",s)),t(),app.workspace.onLayoutReady(()=>{s()});let l=["minimal-light","minimal-light-tonal","minimal-light-contrast","minimal-light-white"],d=["minimal-dark","minimal-dark-tonal","minimal-dark-black"],f=["img-grid","img-grid-ratio","img-nogrid"],g=["table-100","table-default-width","table-wide","table-max"],m=["iframe-100","iframe-default-width","iframe-wide","iframe-max"],h=["img-100","img-default-width","img-wide","img-max"],o=["map-100","map-default-width","map-wide","map-max"],r=["chart-100","chart-default-width","chart-wide","chart-max"];this.addCommand({id:"increase-body-font-size",name:"Increase body font size",callback:()=>{this.settings.textNormal=this.settings.textNormal+.5,this.saveData(this.settings),this.setFontSize()}}),this.addCommand({id:"decrease-body-font-size",name:"Decrease body font size",callback:()=>{this.settings.textNormal=this.settings.textNormal-.5,this.saveData(this.settings),this.setFontSize()}}),this.addCommand({id:"toggle-minimal-dark-cycle",name:"Cycle between dark mode styles",callback:()=>{this.settings.darkStyle=d[(d.indexOf(this.settings.darkStyle)+1)%d.length],this.saveData(this.settings),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-light-cycle",name:"Cycle between light mode styles",callback:()=>{this.settings.lightStyle=l[(l.indexOf(this.settings.lightStyle)+1)%l.length],this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-hidden-borders",name:"Toggle sidebar borders",callback:()=>{this.settings.bordersToggle=!this.settings.bordersToggle,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-colorful-headings",name:"Toggle colorful headings",callback:()=>{this.settings.colorfulHeadings=!this.settings.colorfulHeadings,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-minimal-focus-mode",name:"Toggle focus mode",callback:()=>{this.settings.focusMode=!this.settings.focusMode,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-minimal-colorful-frame",name:"Toggle colorful window frame",callback:()=>{this.settings.colorfulFrame=!this.settings.colorfulFrame,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-table-width",name:"Cycle between table width options",callback:()=>{this.settings.tableWidth=g[(g.indexOf(this.settings.tableWidth)+1)%g.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-image-width",name:"Cycle between image width options",callback:()=>{this.settings.imgWidth=h[(h.indexOf(this.settings.imgWidth)+1)%h.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-iframe-width",name:"Cycle between iframe width options",callback:()=>{this.settings.iframeWidth=m[(m.indexOf(this.settings.iframeWidth)+1)%m.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-chart-width",name:"Cycle between chart width options",callback:()=>{this.settings.chartWidth=r[(r.indexOf(this.settings.chartWidth)+1)%r.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-map-width",name:"Cycle between map width options",callback:()=>{this.settings.mapWidth=o[(o.indexOf(this.settings.mapWidth)+1)%o.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-minimal-img-grid",name:"Toggle image grids",callback:()=>{this.settings.imgGrid=!this.settings.imgGrid,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-minimal-switch",name:"Switch between light and dark mode",callback:()=>{this.updateTheme()}}),this.addCommand({id:"toggle-minimal-light-default",name:"Use light mode (default)",callback:()=>{this.settings.lightStyle="minimal-light",this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-light-white",name:"Use light mode (all white)",callback:()=>{this.settings.lightStyle="minimal-light-white",this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-light-tonal",name:"Use light mode (low contrast)",callback:()=>{this.settings.lightStyle="minimal-light-tonal",this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-light-contrast",name:"Use light mode (high contrast)",callback:()=>{this.settings.lightStyle="minimal-light-contrast",this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-dark-default",name:"Use dark mode (default)",callback:()=>{this.settings.darkStyle="minimal-dark",this.saveData(this.settings),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-dark-tonal",name:"Use dark mode (low contrast)",callback:()=>{this.settings.darkStyle="minimal-dark-tonal",this.saveData(this.settings),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-dark-black",name:"Use dark mode (true black)",callback:()=>{this.settings.darkStyle="minimal-dark-black",this.saveData(this.settings),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-atom-light",name:"Switch light color scheme to Atom (light)",callback:()=>{this.settings.lightScheme="minimal-atom-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-ayu-light",name:"Switch light color scheme to Ayu (light)",callback:()=>{this.settings.lightScheme="minimal-ayu-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-catppuccin-light",name:"Switch light color scheme to Catppuccin (light)",callback:()=>{this.settings.lightScheme="minimal-catppuccin-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-default-light",name:"Switch light color scheme to default (light)",callback:()=>{this.settings.lightScheme="minimal-default-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-gruvbox-light",name:"Switch light color scheme to Gruvbox (light)",callback:()=>{this.settings.lightScheme="minimal-gruvbox-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-eink-light",name:"Switch light color scheme to E-ink (light)",callback:()=>{this.settings.lightScheme="minimal-eink-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-everforest-light",name:"Switch light color scheme to Everforest (light)",callback:()=>{this.settings.lightScheme="minimal-everforest-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-flexoki-light",name:"Switch light color scheme to Flexoki (light)",callback:()=>{this.settings.lightScheme="minimal-flexoki-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-macos-light",name:"Switch light color scheme to macOS (light)",callback:()=>{this.settings.lightScheme="minimal-macos-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-notion-light",name:"Switch light color scheme to Sky (light)",callback:()=>{this.settings.lightScheme="minimal-notion-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-nord-light",name:"Switch light color scheme to Nord (light)",callback:()=>{this.settings.lightScheme="minimal-nord-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-rose-pine-light",name:"Switch light color scheme to Ros\xE9 Pine (light)",callback:()=>{this.settings.lightScheme="minimal-rose-pine-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-solarized-light",name:"Switch light color scheme to Solarized (light)",callback:()=>{this.settings.lightScheme="minimal-solarized-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-things-light",name:"Switch light color scheme to Things (light)",callback:()=>{this.settings.lightScheme="minimal-things-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-atom-dark",name:"Switch dark color scheme to Atom (dark)",callback:()=>{this.settings.darkScheme="minimal-atom-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-ayu-dark",name:"Switch dark color scheme to Ayu (dark)",callback:()=>{this.settings.darkScheme="minimal-ayu-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-catppuccin-dark",name:"Switch dark color scheme to Catppuccin (dark)",callback:()=>{this.settings.darkScheme="minimal-catppuccin-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-dracula-dark",name:"Switch dark color scheme to Dracula (dark)",callback:()=>{this.settings.darkScheme="minimal-dracula-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-default-dark",name:"Switch dark color scheme to default (dark)",callback:()=>{this.settings.darkScheme="minimal-default-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-eink-dark",name:"Switch dark color scheme to E-ink (dark)",callback:()=>{this.settings.darkScheme="minimal-eink-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-everforest-dark",name:"Switch dark color scheme to Everforest (dark)",callback:()=>{this.settings.darkScheme="minimal-everforest-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-flexoki-dark",name:"Switch dark color scheme to Flexoki (dark)",callback:()=>{this.settings.darkScheme="minimal-flexoki-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-gruvbox-dark",name:"Switch dark color scheme to Gruvbox (dark)",callback:()=>{this.settings.darkScheme="minimal-gruvbox-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-macos-dark",name:"Switch dark color scheme to macOS (dark)",callback:()=>{this.settings.darkScheme="minimal-macos-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-nord-dark",name:"Switch dark color scheme to Nord (dark)",callback:()=>{this.settings.darkScheme="minimal-nord-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-notion-dark",name:"Switch dark color scheme to Sky (dark)",callback:()=>{this.settings.darkScheme="minimal-notion-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-rose-pine-dark",name:"Switch dark color scheme to Ros\xE9 Pine (dark)",callback:()=>{this.settings.darkScheme="minimal-rose-pine-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-solarized-dark",name:"Switch dark color scheme to Solarized (dark)",callback:()=>{this.settings.darkScheme="minimal-solarized-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-things-dark",name:"Switch dark color scheme to Things (dark)",callback:()=>{this.settings.darkScheme="minimal-things-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-dev-block-width",name:"Dev \u2014 Show block widths",callback:()=>{this.settings.devBlockWidth=!this.settings.devBlockWidth,this.saveData(this.settings),this.refresh()}}),this.refresh()})}onunload(){console.log("Unloading Minimal Theme Settings plugin");let t=document.getElementsByClassName("mod-left-split")[0];t&&t.removeClass("theme-dark");let s=document.getElementsByClassName("side-dock-ribbon")[0];s&&s.removeClass("theme-dark"),this.unloadRules(),this.removeStyle(),this.removeSettings(),this.removeLightScheme(),this.removeDarkScheme()}loadSettings(){return p(this,null,function*(){this.settings=Object.assign(D,yield this.loadData())})}saveSettings(){return p(this,null,function*(){yield this.saveData(this.settings)})}refresh(){this.updateStyle()}loadRules(){let t=document.createElement("style");t.id="minimal-theme",document.getElementsByTagName("head")[0].appendChild(t),document.body.classList.add("minimal-theme"),this.updateStyle()}unloadRules(){let t=document.getElementById("minimal-theme");t&&t.parentNode.removeChild(t),document.body.classList.remove("minimal-theme")}setFontSize(){this.app.vault.setConfig("baseFontSize",this.settings.textNormal),this.app.updateFontSize()}updateStyle(){this.removeStyle(),this.removeSettings(),document.body.addClass(this.settings.lightStyle,this.settings.lightScheme,this.settings.darkStyle,this.settings.darkScheme),document.body.classList.toggle("borders-none",!this.settings.bordersToggle),document.body.classList.toggle("colorful-headings",this.settings.colorfulHeadings),document.body.classList.toggle("colorful-frame",this.settings.colorfulFrame),document.body.classList.toggle("colorful-active",this.settings.colorfulActiveStates),document.body.classList.toggle("minimal-focus-mode",this.settings.focusMode),document.body.classList.toggle("links-int-on",this.settings.underlineInternal),document.body.classList.toggle("links-ext-on",this.settings.underlineExternal),document.body.classList.toggle("full-width-media",this.settings.fullWidthMedia),document.body.classList.toggle("img-grid",this.settings.imgGrid),document.body.classList.toggle("minimal-dev-block-width",this.settings.devBlockWidth),document.body.classList.toggle("minimal-status-off",!this.settings.minimalStatus),document.body.classList.toggle("full-file-names",!this.settings.trimNames),document.body.classList.toggle("labeled-nav",this.settings.labeledNav),document.body.classList.toggle("minimal-folding",this.settings.folding),document.body.addClass(this.settings.chartWidth,this.settings.tableWidth,this.settings.imgWidth,this.settings.iframeWidth,this.settings.mapWidth);let t=document.getElementById("minimal-theme");if(t)t.innerText="body.minimal-theme{--font-ui-small:"+this.settings.textSmall+"px;--line-height:"+this.settings.lineHeight+";--line-width:"+this.settings.lineWidth+"rem;--line-width-wide:"+this.settings.lineWidthWide+"rem;--max-width:"+this.settings.maxWidth+"%;--font-editor-override:"+this.settings.editorFont+";";else throw"minimal-theme element not found!"}updateDarkStyle(){document.body.removeClass("theme-light","minimal-dark","minimal-dark-tonal","minimal-dark-black"),document.body.addClass("theme-dark",this.settings.darkStyle),this.app.vault.getConfig("theme")!=="system"&&(this.app.setTheme("obsidian"),this.app.vault.setConfig("theme","obsidian")),this.app.workspace.trigger("css-change")}updateLightStyle(){document.body.removeClass("theme-dark","minimal-light","minimal-light-tonal","minimal-light-contrast","minimal-light-white"),document.body.addClass("theme-light",this.settings.lightStyle),this.app.vault.getConfig("theme")!=="system"&&(this.app.setTheme("moonstone"),this.app.vault.setConfig("theme","moonstone")),this.app.workspace.trigger("css-change")}updateDarkScheme(){this.removeDarkScheme(),document.body.addClass(this.settings.darkScheme)}updateLightScheme(){this.removeLightScheme(),document.body.addClass(this.settings.lightScheme)}updateTheme(){if(this.app.vault.getConfig("theme")==="system")document.body.classList.contains("theme-light")?(document.body.removeClass("theme-light"),document.body.addClass("theme-dark")):(document.body.removeClass("theme-dark"),document.body.addClass("theme-light"));else{document.body.classList.contains("theme-light")?(document.body.removeClass("theme-light"),document.body.addClass("theme-dark")):(document.body.removeClass("theme-dark"),document.body.addClass("theme-light"));let s=this.app.vault.getConfig("theme")==="moonstone"?"obsidian":"moonstone";this.app.setTheme(s),this.app.vault.setConfig("theme",s)}this.app.workspace.trigger("css-change")}removeSettings(){document.body.removeClass("borders-none","colorful-headings","colorful-frame","colorful-active","minimal-focus-mode","links-int-on","links-ext-on","full-width-media","img-grid","minimal-dev-block-width","minimal-status-off","full-file-names","labeled-nav","minimal-folding"),document.body.removeClass("table-wide","table-max","table-100","table-default-width","iframe-wide","iframe-max","iframe-100","iframe-default-width","img-wide","img-max","img-100","img-default-width","chart-wide","chart-max","chart-100","chart-default-width","map-wide","map-max","map-100","map-default-width")}removeStyle(){document.body.removeClass("minimal-light","minimal-light-tonal","minimal-light-contrast","minimal-light-white","minimal-dark","minimal-dark-tonal","minimal-dark-black")}removeDarkScheme(){document.body.removeClass("minimal-atom-dark","minimal-ayu-dark","minimal-catppuccin-dark","minimal-default-dark","minimal-dracula-dark","minimal-eink-dark","minimal-everforest-dark","minimal-flexoki-dark","minimal-gruvbox-dark","minimal-macos-dark","minimal-nord-dark","minimal-notion-dark","minimal-rose-pine-dark","minimal-solarized-dark","minimal-things-dark")}removeLightScheme(){document.body.removeClass("minimal-atom-light","minimal-ayu-light","minimal-catppuccin-light","minimal-default-light","minimal-eink-light","minimal-everforest-light","minimal-flexoki-light","minimal-gruvbox-light","minimal-macos-light","minimal-nord-light","minimal-notion-light","minimal-rose-pine-light","minimal-solarized-light","minimal-things-light")}}; + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-minimal-settings/manifest.json b/.obsidian/plugins/obsidian-minimal-settings/manifest.json new file mode 100644 index 0000000..4606938 --- /dev/null +++ b/.obsidian/plugins/obsidian-minimal-settings/manifest.json @@ -0,0 +1,11 @@ +{ + "id": "obsidian-minimal-settings", + "name": "Minimal Theme Settings", + "version": "8.1.1", + "minAppVersion": "1.1.9", + "description": "Change the colors, fonts and features of Minimal Theme.", + "author": "@kepano", + "authorUrl": "https://www.twitter.com/kepano", + "fundingUrl": "https://www.buymeacoffee.com/kepano", + "isDesktopOnly": false +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-typst-math/data.json b/.obsidian/plugins/obsidian-typst-math/data.json new file mode 100644 index 0000000..1f7f54a --- /dev/null +++ b/.obsidian/plugins/obsidian-typst-math/data.json @@ -0,0 +1,11 @@ +{ + "typstPath": "typst", + "enableInlineMath": true, + "enableDisplayMath": true, + "debugMode": false, + "showDetailedErrors": true, + "useWatchMode": false, + "enableLivePreview": false, + "forceSyncCompile": true, + "syncOnlyDuringExport": true +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-typst-math/main.js b/.obsidian/plugins/obsidian-typst-math/main.js new file mode 100644 index 0000000..256cffa --- /dev/null +++ b/.obsidian/plugins/obsidian-typst-math/main.js @@ -0,0 +1,805 @@ +/* +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 __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +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( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// main.ts +var main_exports = {}; +__export(main_exports, { + default: () => TypstMathPlugin +}); +module.exports = __toCommonJS(main_exports); +var import_child_process = require("child_process"); +var import_fs = require("fs"); +var import_obsidian = require("obsidian"); +var os = __toESM(require("os")); +var path = __toESM(require("path")); +var DEFAULT_SETTINGS = { + typstPath: "typst", + enableInlineMath: true, + enableDisplayMath: true, + debugMode: false, + showDetailedErrors: false, + useWatchMode: false, + enableLivePreview: true, + forceSyncCompile: false, + syncOnlyDuringExport: true +}; +var TypstMathPlugin = class extends import_obsidian.Plugin { + constructor() { + super(...arguments); + // Internal flag set when a print/export flow is active + this.exportInProgress = false; + // Hold original window.print so we can restore it on unload + this._originalWindowPrint = null; + // Keep reference to matchMedia listener so we can remove it + this._printMediaListener = null; + this.watchers = /* @__PURE__ */ new Map(); + // Store typst source content for blocks that are pending compilation + this.pendingTypstContent = /* @__PURE__ */ new Map(); + this.renderCache = /* @__PURE__ */ new Map(); + this.handleBeforePrint = () => { + this.exportInProgress = true; + if (this.settings.debugMode) + console.log("Typst plugin: export/print started"); + }; + this.handleAfterPrint = () => { + this.exportInProgress = false; + if (this.settings.debugMode) + console.log("Typst plugin: export/print finished"); + }; + } + async onload() { + var _a; + await this.loadSettings(); + this.tempDir = path.join(os.tmpdir(), "obsidian-typst-math"); + await this.ensureTempDir(); + this.registerMarkdownCodeBlockProcessor( + "math", + this.processMathBlock.bind(this) + ); + this.registerMarkdownCodeBlockProcessor( + "typst", + this.processMathBlock.bind(this) + ); + await (0, import_obsidian.loadMathJax)(); + if (!globalThis.MathJax) { + new import_obsidian.Notice("MathJax failed to load. Math rendering may not work."); + console.error("MathJax failed to load."); + } else { + this.originalTex2chtml = globalThis.MathJax.tex2chtml; + globalThis.MathJax.tex2chtml = (latex, options) => { + return this.renderWithTypst(latex, options); + }; + const activeView = this.app.workspace.getActiveViewOfType(import_obsidian.MarkdownView); + if (activeView) { + (_a = activeView.previewMode) == null ? void 0 : _a.rerender(true); + if (this.settings.enableLivePreview) { + const editor = activeView.editor; + if (editor) { + const cursor = editor.getCursor(); + editor.setCursor(cursor); + } + } + } + } + if (typeof window !== "undefined") { + window.addEventListener("beforeprint", this.handleBeforePrint); + window.addEventListener("afterprint", this.handleAfterPrint); + try { + if (typeof window.print === "function") { + this._originalWindowPrint = window.print.bind(window); + window.print = (...args) => { + this.handleBeforePrint(); + try { + const res = this._originalWindowPrint(...args); + setTimeout(() => this.handleAfterPrint(), 1500); + return res; + } catch (e) { + this.handleAfterPrint(); + throw e; + } + }; + } + } catch (e) { + if (this.settings.debugMode) + console.warn("Failed to patch window.print", e); + } + try { + const mql = window.matchMedia && window.matchMedia("print"); + if (mql) { + this._printMediaListener = (ev) => { + if (ev.matches) + this.handleBeforePrint(); + else + this.handleAfterPrint(); + }; + if (typeof mql.addEventListener === "function") { + mql.addEventListener("change", this._printMediaListener); + } else if (typeof mql.addListener === "function") { + mql.addListener(this._printMediaListener); + } + } + } catch (e) { + if (this.settings.debugMode) + console.warn("Failed to attach matchMedia print listener", e); + } + } + this.addSettingTab(new TypstMathSettingTab(this.app, this)); + this.addCommand({ + id: "typst-prepare-export", + name: "Typst: Prepare export (sync compile all math)", + callback: () => { + void this.prepareExport(); + } + }); + console.log("Typst Math Plugin loaded"); + } + async onunload() { + var _a; + if (this.originalTex2chtml && globalThis.MathJax) { + globalThis.MathJax.tex2chtml = this.originalTex2chtml; + (_a = this.app.workspace.getActiveViewOfType(import_obsidian.MarkdownView)) == null ? void 0 : _a.previewMode.rerender(true); + } + for (const [id, process] of this.watchers) { + process.kill(); + } + this.watchers.clear(); + try { + await import_fs.promises.rm(this.tempDir, { recursive: true, force: true }); + } catch (error) { + console.error("Error cleaning up temp directory:", error); + } + try { + if (typeof window !== "undefined") { + window.removeEventListener("beforeprint", this.handleBeforePrint); + window.removeEventListener("afterprint", this.handleAfterPrint); + if (this._printMediaListener && window.matchMedia) { + const mql = window.matchMedia("print"); + if (mql) { + if (typeof mql.removeEventListener === "function") { + mql.removeEventListener("change", this._printMediaListener); + } else if (typeof mql.removeListener === "function") { + mql.removeListener(this._printMediaListener); + } + } + } + if (this._originalWindowPrint) { + try { + window.print = this._originalWindowPrint; + } catch (e) { + } + } + } + } catch (e) { + if (this.settings.debugMode) + console.warn("Error restoring print handlers", e); + } + console.log("Typst Math Plugin unloaded"); + } + async loadSettings() { + this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); + } + async saveSettings() { + await this.saveData(this.settings); + } + async ensureTempDir() { + try { + await import_fs.promises.mkdir(this.tempDir, { recursive: true }); + } catch (error) { + console.error("Error creating temp directory:", error); + } + } + formatError(error, isInline = false) { + const errorMsg = typeof error === "string" ? error : error.message; + let friendlyMsg = "There was an error with your Typst code"; + if (errorMsg.includes("ENOENT") || errorMsg.includes("not found")) { + friendlyMsg = "Typst CLI not found"; + } else if (errorMsg.includes("syntax error") || errorMsg.includes("unexpected")) { + friendlyMsg = "Syntax error in Typst code"; + } else if (errorMsg.includes("undefined")) { + friendlyMsg = "Undefined symbol or function"; + } else if (errorMsg.includes("type")) { + friendlyMsg = "Type error in expression"; + } + const errorClass = isInline ? "typst-error-inline" : "typst-error"; + if (this.settings.showDetailedErrors) { + return `${friendlyMsg}${errorMsg}`; + } else { + return `${friendlyMsg}`; + } + } + async processMathBlock(source, el, ctx) { + const blockId = this.generateBlockId(source, ctx.sourcePath); + if (this.renderCache.has(blockId)) { + el.empty(); + const container2 = el.createDiv({ cls: "typst-math-container" }); + const cached = this.renderCache.get(blockId); + container2.innerHTML = cached != null ? cached : ""; + return; + } + el.empty(); + const container = el.createDiv({ cls: "typst-math-container" }); + container.innerHTML = '
Rendering with Typst...
'; + container.setAttribute("data-typst-blockid", blockId); + try { + const typstContent = this.wrapInTypstDocument(source); + const typstFile = path.join(this.tempDir, `${blockId}.typ`); + const htmlFile = path.join(this.tempDir, `${blockId}.html`); + this.pendingTypstContent.set(blockId, typstContent); + await import_fs.promises.writeFile(typstFile, typstContent, "utf-8"); + if (this.settings.useWatchMode) { + await this.renderTypstWithWatch(typstFile, htmlFile, container, blockId); + } else { + await this.renderTypstToHtml(typstFile, htmlFile, container, blockId); + } + } catch (error) { + container.innerHTML = this.formatError(error, false); + if (this.settings.debugMode) { + console.error("Typst rendering error:", error); + } + } + } + renderWithTypst(latex, options) { + const isBlock = options.display || false; + if (isBlock && !this.settings.enableDisplayMath) { + return this.originalTex2chtml(latex, options); + } + if (!isBlock && !this.settings.enableInlineMath) { + return this.originalTex2chtml(latex, options); + } + if (this.hasLatexCommand(latex)) { + } + const typstContent = this.convertLatexToTypst(latex); + const blockId = this.generateBlockId(typstContent, `math-${Date.now()}`); + const container = document.createElement(isBlock ? "div" : "span"); + container.className = isBlock ? "typst-math-container" : "typst-math-inline"; + container.innerHTML = 'Rendering with Typst...'; + try { + container.setAttribute("data-typst-blockid", blockId); + this.pendingTypstContent.set(blockId, typstContent); + } catch (e) { + } + this.renderTypstMath(typstContent, container, blockId, isBlock); + return container; + } + hasLatexCommand(expr) { + return false; + } + convertLatexToTypst(latex) { + let content = latex.trim(); + content = content.replace(/^\$\$/, "").replace(/\$\$$/, ""); + content = content.replace(/^\$/, "").replace(/\$$/, ""); + const conversions = [ + // Fractions + [/\\frac\{([^}]+)\}\{([^}]+)\}/g, "($1)/($2)"], + // Superscripts and subscripts (already mostly compatible) + // Greek letters (mostly the same, just remove backslash) + [/\\alpha\b/g, "alpha"], + [/\\beta\b/g, "beta"], + [/\\gamma\b/g, "gamma"], + [/\\delta\b/g, "delta"], + [/\\epsilon\b/g, "epsilon"], + [/\\zeta\b/g, "zeta"], + [/\\eta\b/g, "eta"], + [/\\theta\b/g, "theta"], + [/\\iota\b/g, "iota"], + [/\\kappa\b/g, "kappa"], + [/\\lambda\b/g, "lambda"], + [/\\mu\b/g, "mu"], + [/\\nu\b/g, "nu"], + [/\\xi\b/g, "xi"], + [/\\pi\b/g, "pi"], + [/\\rho\b/g, "rho"], + [/\\sigma\b/g, "sigma"], + [/\\tau\b/g, "tau"], + [/\\phi\b/g, "phi"], + [/\\chi\b/g, "chi"], + [/\\psi\b/g, "psi"], + [/\\omega\b/g, "omega"], + // Capital Greek + [/\\Gamma\b/g, "Gamma"], + [/\\Delta\b/g, "Delta"], + [/\\Theta\b/g, "Theta"], + [/\\Lambda\b/g, "Lambda"], + [/\\Xi\b/g, "Xi"], + [/\\Pi\b/g, "Pi"], + [/\\Sigma\b/g, "Sigma"], + [/\\Phi\b/g, "Phi"], + [/\\Psi\b/g, "Psi"], + [/\\Omega\b/g, "Omega"], + // Common functions + [/\\sin\b/g, "sin"], + [/\\cos\b/g, "cos"], + [/\\tan\b/g, "tan"], + [/\\log\b/g, "log"], + [/\\ln\b/g, "ln"], + [/\\exp\b/g, "exp"], + // Sums and integrals + [/\\sum/g, "sum"], + [/\\prod/g, "product"], + [/\\int/g, "integral"], + [/\\infty\b/g, "oo"], + // Arrows + [/\\rightarrow\b/g, "->"], + [/\\leftarrow\b/g, "<-"], + [/\\Rightarrow\b/g, "=>"], + [/\\Leftarrow\b/g, "<="], + // Operators + [/\\times\b/g, "times"], + [/\\cdot\b/g, "dot"], + [/\\pm\b/g, "plus.minus"], + [/\\mp\b/g, "minus.plus"], + // Special sets + [/\\mathbb\{R\}/g, "RR"], + [/\\mathbb\{N\}/g, "NN"], + [/\\mathbb\{Z\}/g, "ZZ"], + [/\\mathbb\{Q\}/g, "QQ"], + [/\\mathbb\{C\}/g, "CC"], + // Limits + [/\\lim/g, "lim"], + [/\\to\b/g, "->"], + // Parentheses (mostly the same) + [/\\left\(/g, "("], + [/\\right\)/g, ")"], + [/\\left\[/g, "["], + [/\\right\]/g, "]"], + [/\\left\{/g, "{"], + [/\\right\}/g, "}"], + // Sqrt + [/\\sqrt\{([^}]+)\}/g, "sqrt($1)"], + // Text + [/\\text\{([^}]+)\}/g, '"$1"'] + ]; + for (const [pattern, replacement] of conversions) { + content = content.replace(pattern, replacement); + } + return content.trim(); + } + async renderTypstMath(mathContent, container, blockId, isBlock) { + if (this.renderCache.has(blockId)) { + container.innerHTML = this.renderCache.get(blockId); + return; + } + try { + const wrappedContent = `$ ${mathContent} $`; + const typstContent = this.wrapInTypstDocument(wrappedContent, isBlock); + const typstFile = path.join(this.tempDir, `${blockId}.typ`); + const htmlFile = path.join(this.tempDir, `${blockId}.html`); + this.pendingTypstContent.set(blockId, typstContent); + await import_fs.promises.writeFile(typstFile, typstContent, "utf-8"); + await this.renderTypstToHtml(typstFile, htmlFile, container, blockId); + } catch (error) { + container.innerHTML = this.formatError(error, true); + if (this.settings.debugMode) { + console.error("Typst rendering error:", error); + } + } + } + // Synchronously compile a single block (used by prepareExport) + async syncCompileBlock(blockId) { + try { + const typstContent = this.pendingTypstContent.get(blockId); + if (!typstContent) + return; + const typstFile = path.join(this.tempDir, `${blockId}.typ`); + const htmlFile = path.join(this.tempDir, `${blockId}.html`); + (0, import_fs.writeFileSync)(typstFile, typstContent, "utf-8"); + const args = [ + "compile", + typstFile, + htmlFile, + "--features", + "html", + "--format", + "html" + ]; + if (this.settings.debugMode) { + console.log("Typst sync compile (prepareExport):", this.settings.typstPath, args.join(" ")); + } + const res = (0, import_child_process.spawnSync)(this.settings.typstPath, args, { encoding: "utf-8" }); + if (res.error || res.status !== 0) { + const errStr = res.stderr || res.error && res.error.message || `Typst exited ${res.status}`; + throw new Error(errStr); + } + const html = (0, import_fs.readFileSync)(htmlFile, "utf-8"); + const bodyMatch = html.match(/]*>([\s\S]*)<\/body>/i); + const content = bodyMatch ? bodyMatch[1] : html; + this.renderCache.set(blockId, content); + try { + const el = document.querySelector(`[data-typst-blockid="${blockId}"]`); + if (el instanceof HTMLElement) + el.innerHTML = content; + } catch (e) { + } + } catch (error) { + if (this.settings.debugMode) + console.error("Error in syncCompileBlock:", error); + throw error; + } + } + // Prepare the document for export by sync-compiling all pending Typst blocks + async prepareExport() { + const pending = Array.from(this.pendingTypstContent.keys()); + if (pending.length === 0) { + new import_obsidian.Notice("No pending Typst math blocks to prepare"); + return; + } + new import_obsidian.Notice(`Preparing ${pending.length} Typst math blocks for export...`); + const prevForce = this.settings.forceSyncCompile; + const prevSyncOnly = this.settings.syncOnlyDuringExport; + this.settings.forceSyncCompile = true; + this.settings.syncOnlyDuringExport = false; + this.exportInProgress = true; + let success = 0; + for (const id of pending) { + try { + await this.syncCompileBlock(id); + success++; + } catch (e) { + console.error("prepareExport: failed to compile block", id, e); + } + } + this.settings.forceSyncCompile = prevForce; + this.settings.syncOnlyDuringExport = prevSyncOnly; + this.exportInProgress = false; + new import_obsidian.Notice(`Prepared ${success}/${pending.length} Typst math blocks for export`); + } + wrapInTypstDocument(mathContent, isBlock = true) { + const sizeConfig = isBlock ? "16pt" : "14pt"; + return ` +#set text(size: ${sizeConfig}) +#show math.equation: html.frame +#show math.equation.where(block: false): box + +${mathContent} +`; + } + generateBlockId(source, sourcePath) { + const hash = this.simpleHash(source + sourcePath); + return `block-${hash}`; + } + simpleHash(str) { + let hash = 0; + for (let i = 0; i < str.length; i++) { + const char = str.charCodeAt(i); + hash = (hash << 5) - hash + char; + hash = hash & hash; + } + return Math.abs(hash).toString(36); + } + /** + * Parse the full Typst-generated HTML and return a cleaned HTML string. + * - Merges paginated pages if present + * - Removes placeholder ellipsis-only nodes + * - Strips scripts/styles that could interfere + */ + parseTypstHtml(html) { + try { + const parser = new DOMParser(); + const doc = parser.parseFromString(html, "text/html"); + doc.querySelectorAll("script, style").forEach((n) => n.remove()); + const pageSelectors = [".typst-page", ".page", ".typst-doc", "#content", "body > div"]; + let parts = []; + const typstDoc = doc.querySelector(".typst-doc"); + if (typstDoc) { + const children = Array.from(typstDoc.children); + if (children.length > 1) { + for (const c of children) + parts.push(c.innerHTML); + } else { + parts.push(typstDoc.innerHTML); + } + } else { + for (const sel of pageSelectors) { + const nodes = Array.from(doc.querySelectorAll(sel)); + if (nodes.length > 1) { + for (const n of nodes) + parts.push(n.innerHTML); + break; + } else if (nodes.length === 1 && parts.length === 0) { + parts.push(nodes[0].innerHTML); + } + } + } + if (parts.length === 0) { + const bodyHtml = doc.body ? doc.body.innerHTML : html; + parts = [bodyHtml]; + } + parts = parts.map((p) => { + var _a; + const partDoc = parser.parseFromString(`
${p}
`, "text/html"); + const walker = document.createTreeWalker(partDoc.body, NodeFilter.SHOW_ELEMENT, null); + const toRemove = []; + let node = walker.nextNode(); + while (node) { + const el = node; + const txt = (_a = el.textContent) == null ? void 0 : _a.trim(); + if (txt && (/^\.{3,}$/.test(txt) || /^…+$/.test(txt) || txt === "\u22EF")) { + toRemove.push(el); + } + node = walker.nextNode(); + } + toRemove.forEach((e) => e.remove()); + return partDoc.body.innerHTML; + }); + const joined = parts.map((p, i) => `
${p}
`).join('\n
\n'); + return joined; + } catch (e) { + return html; + } + } + async renderTypstToHtml(typstFile, htmlFile, container, blockId) { + const useSync = this.settings.forceSyncCompile || this.settings.syncOnlyDuringExport && this.exportInProgress; + if (useSync) { + try { + const args = [ + "compile", + typstFile, + htmlFile, + "--features", + "html", + "--format", + "html" + ]; + if (this.settings.debugMode) { + console.log("Running Typst (sync):", this.settings.typstPath, args.join(" ")); + } + const res = (0, import_child_process.spawnSync)(this.settings.typstPath, args, { encoding: "utf-8" }); + if (res.error) { + const errMsg = res.error.message || String(res.error); + container.innerHTML = this.formatError(errMsg, false); + throw res.error; + } + if (res.status !== 0) { + const errStr = res.stderr || `Typst process exited with code ${res.status}`; + container.innerHTML = this.formatError(errStr, false); + throw new Error(errStr); + } + const html = (0, import_fs.readFileSync)(htmlFile, "utf-8"); + const bodyMatch = html.match(/]*>([\s\S]*)<\/body>/i); + const content = bodyMatch ? bodyMatch[1] : html; + this.renderCache.set(blockId, content); + container.innerHTML = content; + return Promise.resolve(); + } catch (err) { + if (this.settings.debugMode) + console.error("Typst sync render error:", err); + return Promise.reject(err); + } + } + return new Promise((resolve, reject) => { + var _a; + if (this.watchers.has(blockId)) { + (_a = this.watchers.get(blockId)) == null ? void 0 : _a.kill(); + this.watchers.delete(blockId); + } + const args = [ + "compile", + typstFile, + htmlFile, + "--features", + "html", + "--format", + "html" + ]; + if (this.settings.debugMode) { + console.log( + "Running Typst command:", + this.settings.typstPath, + args.join(" ") + ); + } + const typstProcess = (0, import_child_process.spawn)(this.settings.typstPath, args); + let stderr = ""; + typstProcess.stderr.on("data", (data) => { + stderr += data.toString(); + }); + typstProcess.on("close", async (code) => { + if (code === 0) { + try { + const html = await import_fs.promises.readFile(htmlFile, "utf-8"); + const bodyMatch = html.match(/]*>([\s\S]*)<\/body>/i); + const content = bodyMatch ? bodyMatch[1] : html; + this.renderCache.set(blockId, content); + container.innerHTML = content; + resolve(); + } catch (error) { + container.innerHTML = this.formatError(error, false); + reject(error); + } + } else { + const errorMsg = stderr || `Typst process exited with code ${code}`; + container.innerHTML = this.formatError(errorMsg, false); + reject(new Error(errorMsg)); + } + }); + typstProcess.on("error", (error) => { + container.innerHTML = this.formatError(error, false); + reject(error); + }); + }); + } + async renderTypstWithWatch(typstFile, htmlFile, container, blockId) { + return new Promise((resolve, reject) => { + var _a; + if (this.watchers.has(blockId)) { + (_a = this.watchers.get(blockId)) == null ? void 0 : _a.kill(); + this.watchers.delete(blockId); + } + const args = [ + "watch", + typstFile, + htmlFile, + "--features", + "html", + "--format", + "html" + ]; + if (this.settings.debugMode) { + console.log( + "Running Typst watch:", + this.settings.typstPath, + args.join(" ") + ); + } + const typstProcess = (0, import_child_process.spawn)(this.settings.typstPath, args); + this.watchers.set(blockId, typstProcess); + let stderr = ""; + let hasRendered = false; + const checkForUpdates = async () => { + try { + const html = await import_fs.promises.readFile(htmlFile, "utf-8"); + const bodyMatch = html.match(/]*>([\s\S]*)<\/body>/i); + const content = bodyMatch ? bodyMatch[1] : html; + this.renderCache.set(blockId, content); + container.innerHTML = content; + if (!hasRendered) { + hasRendered = true; + resolve(); + } + } catch (error) { + if (this.settings.debugMode) { + console.log("Waiting for Typst to generate output..."); + } + } + }; + typstProcess.stderr.on("data", (data) => { + stderr += data.toString(); + if (stderr.includes("error:")) { + container.innerHTML = this.formatError(stderr, false); + } + }); + typstProcess.stdout.on("data", (data) => { + const output = data.toString(); + if (this.settings.debugMode) { + console.log("Typst watch output:", output); + } + if (output.includes("written to") || output.includes("compiled")) { + setTimeout(checkForUpdates, 100); + } + }); + setTimeout(checkForUpdates, 500); + typstProcess.on("close", (code) => { + this.watchers.delete(blockId); + if (code !== 0 && code !== null && !hasRendered) { + const errorMsg = stderr || `Typst watch exited with code ${code}`; + container.innerHTML = this.formatError(errorMsg, false); + reject(new Error(errorMsg)); + } + }); + typstProcess.on("error", (error) => { + this.watchers.delete(blockId); + container.innerHTML = this.formatError(error, false); + reject(error); + }); + }); + } +}; +var TypstMathSettingTab = class extends import_obsidian.PluginSettingTab { + constructor(app, plugin) { + super(app, plugin); + this.plugin = plugin; + } + display() { + const { containerEl } = this; + containerEl.empty(); + containerEl.createEl("h2", { text: "Typst Math Renderer Settings" }); + new import_obsidian.Setting(containerEl).setName("Typst CLI path").setDesc('Path to the Typst executable (e.g., "typst" or full path)').addText( + (text) => text.setPlaceholder("typst").setValue(this.plugin.settings.typstPath).onChange(async (value) => { + this.plugin.settings.typstPath = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian.Setting(containerEl).setName("Enable inline math").setDesc("Process inline math blocks ($...$)").addToggle( + (toggle) => toggle.setValue(this.plugin.settings.enableInlineMath).onChange(async (value) => { + this.plugin.settings.enableInlineMath = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian.Setting(containerEl).setName("Enable display math").setDesc("Process display math blocks ($$...$$)").addToggle( + (toggle) => toggle.setValue(this.plugin.settings.enableDisplayMath).onChange(async (value) => { + this.plugin.settings.enableDisplayMath = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian.Setting(containerEl).setName("Debug mode").setDesc("Enable debug logging in the console").addToggle( + (toggle) => toggle.setValue(this.plugin.settings.debugMode).onChange(async (value) => { + this.plugin.settings.debugMode = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian.Setting(containerEl).setName("Show detailed errors").setDesc("Display detailed Typst error messages (useful for debugging)").addToggle( + (toggle) => toggle.setValue(this.plugin.settings.showDetailedErrors).onChange(async (value) => { + this.plugin.settings.showDetailedErrors = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian.Setting(containerEl).setName("Use watch mode").setDesc("Enable watch mode for code blocks (auto-recompile on changes) - experimental").addToggle( + (toggle) => toggle.setValue(this.plugin.settings.useWatchMode).onChange(async (value) => { + this.plugin.settings.useWatchMode = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian.Setting(containerEl).setName("Force synchronous compile (for exports)").setDesc("Use a synchronous Typst compile which can improve reliability when exporting to PDF. This will block rendering while Typst runs.").addToggle( + (toggle) => toggle.setValue(this.plugin.settings.forceSyncCompile).onChange(async (value) => { + this.plugin.settings.forceSyncCompile = value; + await this.plugin.saveSettings(); + new import_obsidian.Notice("Force sync compile setting updated"); + }) + ); + new import_obsidian.Setting(containerEl).setName("Sync only during print/export").setDesc("If enabled, synchronous compilation will only be used during a print/export flow. Disable to always use sync compilation when enabled.").addToggle( + (toggle) => toggle.setValue(this.plugin.settings.syncOnlyDuringExport).onChange(async (value) => { + this.plugin.settings.syncOnlyDuringExport = value; + await this.plugin.saveSettings(); + new import_obsidian.Notice("Sync-only-during-export setting updated"); + }) + ); + new import_obsidian.Setting(containerEl).setName("Enable live preview").setDesc("Render Typst math in live preview mode (works automatically via MathJax override)").addToggle( + (toggle) => toggle.setValue(this.plugin.settings.enableLivePreview).onChange(async (value) => { + this.plugin.settings.enableLivePreview = value; + await this.plugin.saveSettings(); + new import_obsidian.Notice("Reload Obsidian for this change to take full effect"); + }) + ); + containerEl.createEl("h3", { text: "Usage" }); + containerEl.createEl("p", { + text: "Create a code block with ```math or ```typst and write your Typst math syntax inside." + }); + containerEl.createEl("pre", { + text: "```math\n$ sum_(i=1)^n i = (n(n+1))/2 $\n```" + }); + containerEl.createEl("h3", { text: "Installation" }); + containerEl.createEl("p", { + text: "Make sure you have Typst CLI installed. Visit https://github.com/typst/typst for installation instructions." + }); + } +}; diff --git a/.obsidian/plugins/obsidian-typst-math/manifest.json b/.obsidian/plugins/obsidian-typst-math/manifest.json new file mode 100644 index 0000000..ef3caba --- /dev/null +++ b/.obsidian/plugins/obsidian-typst-math/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "obsidian-typst-cli", + "name": "Typst CLI Math Integration", + "version": "1.3.0", + "minAppVersion": "0.15.0", + "description": "Replaces default math blocks with Typst-rendered math blocks using the Typst CLI", + "author": "Your Name", + "authorUrl": "https://yourwebsite.com", + "isDesktopOnly": true +} diff --git a/.obsidian/plugins/obsidian-typst-math/styles.css b/.obsidian/plugins/obsidian-typst-math/styles.css new file mode 100644 index 0000000..3656edf --- /dev/null +++ b/.obsidian/plugins/obsidian-typst-math/styles.css @@ -0,0 +1,176 @@ +/* Styles for Typst Math Renderer Plugin */ + +.typst-math-container { + margin: 1em 0; + padding: 0.5em; + background-color: var(--background-primary); + border-radius: 4px; + color: #deb4ae; +} + +.typst-math-inline { + display: inline-flex; + align-items: baseline; + margin: 0; + padding: 0 0.2em; + color: #deb4ae; +} + +.typst-loading { + color: var(--text-muted); + font-style: italic; + text-align: center; + padding: 1em; +} + +.typst-error { + color: #e74c3c; + background-color: transparent; + padding: 0.2em 0.4em; + border-radius: 3px; + font-family: var(--font-interface); + font-size: 0.95em; + font-weight: 500; + white-space: normal; + word-break: break-word; +} + +.typst-error-inline { + display: inline; + color: #e74c3c; + font-size: 0.9em; +} + +.typst-error-details { + display: block; + margin-top: 0.3em; + padding: 0.5em; + background-color: rgba(231, 76, 60, 0.1); + border-radius: 3px; + font-family: var(--font-monospace); + font-size: 0.85em; + color: var(--text-muted); + white-space: pre-wrap; + word-break: break-word; +} + +/* Style the Typst output - inherit theme colors */ +.typst-math-container svg, +.typst-math-inline svg, +.typst-math-container .typst-doc, +.typst-math-inline .typst-doc { + max-width: 100%; + height: auto; + display: block; + margin: 0 auto; + color: var(--text-normal); +} + +.typst-math-inline svg, +.typst-math-inline .typst-doc { + display: inline-block; + vertical-align: middle; +} + +/* Override Typst's default black text in SVG */ +.typst-math-container svg *[fill="#000000"], +.typst-math-inline svg *[fill="#000000"], +.typst-math-container svg *[fill="black"], +.typst-math-inline svg *[fill="black"] { + fill: #deb4ae !important; +} + +.typst-math-container svg *[stroke="#000000"], +.typst-math-inline svg *[stroke="#000000"], +.typst-math-container svg *[stroke="black"], +.typst-math-inline svg *[stroke="black"] { + stroke: #deb4ae !important; +} + +/* Also target when SVGs are directly in code blocks */ +.markdown-preview-view .cm-preview-code-block svg *[fill="#000000"], +.markdown-preview-view .cm-preview-code-block svg *[fill="black"] { + fill: #deb4ae !important; +} + +.markdown-preview-view .cm-preview-code-block svg *[stroke="#000000"], +.markdown-preview-view .cm-preview-code-block svg *[stroke="black"] { + stroke: #deb4ae !important; +} + +/* Ensure the typst-doc class gets color */ +.typst-doc { + color: #deb4ae; +} + +/* Override any remaining color specifications */ +.typst-math-container *, +.typst-math-inline * { + color: inherit; +} + +/* Center block math */ +.typst-math-container p { + text-align: center; + margin: 0; + color: inherit; +} + +/* Ensure proper spacing for math content */ +.typst-math-container > * { + margin: 0; +} + +/* Print-specific rules: when exporting to PDF, use document/default colors + and avoid any truncation/ellipsis or SVG recoloring that may break prints */ +@media print { + /* Restore default text color so printed PDFs look like the document */ + .typst-math-container, + .typst-math-inline, + .typst-doc, + .typst-math-container *, + .typst-math-inline * { + color: initial !important; + -webkit-text-fill-color: initial !important; + background: transparent !important; + } + + /* Ensure SVGs keep their original fills/strokes in print (do not force plugin color) */ + .typst-math-container svg *[fill="#000000"], + .typst-math-inline svg *[fill="#000000"], + .typst-math-container svg *[fill="black"], + .typst-math-inline svg *[fill="black"], + .markdown-preview-view .cm-preview-code-block svg *[fill="#000000"], + .markdown-preview-view .cm-preview-code-block svg *[fill="black"] { + fill: initial !important; + } + + .typst-math-container svg *[stroke="#000000"], + .typst-math-inline svg *[stroke="#000000"], + .typst-math-container svg *[stroke="black"], + .typst-math-inline svg *[stroke="black"], + .markdown-preview-view .cm-preview-code-block svg *[stroke="#000000"], + .markdown-preview-view .cm-preview-code-block svg *[stroke="black"] { + stroke: initial !important; + } + + /* Avoid text-overflow/ellipsis in printed output */ + .typst-math-container, + .typst-math-inline, + .typst-math-container *, + .typst-math-inline * { + white-space: normal !important; + text-overflow: clip !important; + overflow: visible !important; + } + + /* Remove any max-width/inline-block constraints that might clip content */ + .typst-math-inline svg, + .typst-math-inline .typst-doc, + .typst-math-container svg, + .typst-math-container .typst-doc { + max-width: none !important; + height: auto !important; + display: inline !important; + } +} diff --git a/.obsidian/themes/Minimal/manifest.json b/.obsidian/themes/Minimal/manifest.json new file mode 100644 index 0000000..5330925 --- /dev/null +++ b/.obsidian/themes/Minimal/manifest.json @@ -0,0 +1,8 @@ +{ + "name": "Minimal", + "version": "8.0.4", + "minAppVersion": "1.9.0", + "author": "@kepano", + "authorUrl": "https://twitter.com/kepano", + "fundingUrl": "https://www.buymeacoffee.com/kepano" +} diff --git a/.obsidian/themes/Minimal/theme.css b/.obsidian/themes/Minimal/theme.css new file mode 100644 index 0000000..594e833 --- /dev/null +++ b/.obsidian/themes/Minimal/theme.css @@ -0,0 +1,2251 @@ +/* --------------------------------------------------------------------------- + +Minimal Theme by @kepano + +User interface replacement for Obsidian. + +Designed to be used with the Minimal Theme Settings +plugin and the Hider plugin. + +Sponsor my work: +https://www.buymeacoffee.com/kepano + +Readme: +https://github.com/kepano/obsidian-minimal + +----------------------------------------------------------------------------- + +MIT License + +Copyright (c) 2020-2024 Steph Ango (@kepano) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ +body{--font-editor-theme:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Ubuntu,sans-serif;--font-editor:var(--font-editor-override),var(--font-text-override),var(--font-editor-theme);--bases-table-column-border-width:0px;--bases-header-border-width:0;--blockquote-style:normal;--blockquote-color:var(--text-muted);--blockquote-border-thickness:1px;--blockquote-border-color:var(--quote-opening-modifier);--embed-block-shadow-hover:none;--font-ui-smaller:11px;--normal-weight:400;--inline-title-margin-bottom:1rem;--h1-size:1.125em;--h2-size:1.05em;--h3-size:1em;--h4-size:0.90em;--h5-size:0.85em;--h6-size:0.85em;--h1-weight:600;--h2-weight:600;--h3-weight:500;--h4-weight:500;--h5-weight:500;--h6-weight:400;--h1-variant:normal;--h2-variant:normal;--h3-variant:normal;--h4-variant:normal;--h5-variant:small-caps;--h6-variant:small-caps;--h1-style:normal;--h2-style:normal;--h3-style:normal;--h4-style:normal;--h5-style:normal;--h6-style:normal;--line-width:40rem;--line-height:1.5;--line-height-normal:var(--line-height);--max-width:88%;--max-col-width:18em;--icon-muted:0.5;--nested-padding:1.1em;--folding-offset:32px;--list-edit-offset:0.5em;--list-indent:2em;--list-spacing:0.075em;--input-height:32px;--header-height:40px;--metadata-label-width-multiplier:9;--metadata-label-width:calc(var(--font-adaptive-small) * var(--metadata-label-width-multiplier));--metadata-label-font-size:var(--font-adaptive-small);--metadata-input-font-size:var(--font-adaptive-small);--mobile-left-sidebar-width:280pt;--mobile-right-sidebar-width:240pt;--top-left-padding-y:0px;--image-muted:0.7;--image-radius:4px;--heading-spacing:2em;--p-spacing:1.75rem;--border-width:1px;--table-border-width:var(--border-width);--table-selection:var(--text-selection);--table-selection-border-color:var(--text-accent);--table-selection-border-width:0px;--table-selection-border-radius:0px;--table-drag-handle-background-active:var(--text-selection);--table-drag-handle-color-active:var(--text-accent);--table-add-button-border-width:0px;--file-margins:var(--size-4-2) var(--size-4-12)}.mod-macos{--top-left-padding-y:24px}.is-phone{--metadata-label-font-size:var(--font-adaptive-smaller);--metadata-input-font-size:var(--font-adaptive-smaller)}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2){.is-phone{--border-width:0.75px}}body{--base-h:0;--base-s:0%;--base-l:96%;--accent-h:201;--accent-s:17%;--accent-l:50%}.theme-dark,.theme-light{--color-red-rgb:208,66,85;--color-orange-rgb:213,118,63;--color-yellow-rgb:229,181,103;--color-green-rgb:168,195,115;--color-cyan-rgb:115,187,178;--color-blue-rgb:108,153,187;--color-purple-rgb:158,134,200;--color-pink-rgb:176,82,121;--color-red:#d04255;--color-orange:#d5763f;--color-yellow:#e5b567;--color-green:#a8c373;--color-cyan:#73bbb2;--color-blue:#6c99bb;--color-purple:#9e86c8;--color-pink:#b05279}.theme-light,.theme-light.minimal-default-light,body .excalidraw{--bg1:white;--bg2:hsl( var(--base-h), var(--base-s), var(--base-l) );--bg3:hsla( var(--base-h), var(--base-s), calc(var(--base-l) - 50%), 0.12 );--ui1:hsl( var(--base-h), var(--base-s), calc(var(--base-l) - 6%) );--ui2:hsl( var(--base-h), var(--base-s), calc(var(--base-l) - 12%) );--ui3:hsl( var(--base-h), var(--base-s), calc(var(--base-l) - 20%) );--tx1:hsl( var(--base-h), var(--base-s), calc(var(--base-l) - 90%) );--tx2:hsl( var(--base-h), calc(var(--base-s) - 20%), calc(var(--base-l) - 50%) );--tx3:hsl( var(--base-h), calc(var(--base-s) - 10%), calc(var(--base-l) - 25%) );--tx4:hsl( var(--base-h), calc(var(--base-s) - 10%), calc(var(--base-l) - 60%) );--ax1:hsl( var(--accent-h), var(--accent-s), var(--accent-l) );--ax2:hsl( var(--accent-h), var(--accent-s), calc(var(--accent-l) - 8%) );--ax3:hsl( var(--accent-h), var(--accent-s), calc(var(--accent-l) + 6%) );--hl1:hsla( var(--accent-h), 50%, calc(var(--base-l) - 20%), 30% );--hl2:rgba(255, 225, 0, 0.5);--sp1:white}.excalidraw.theme--dark,.theme-dark,.theme-dark.minimal-default-dark,.theme-light.minimal-light-contrast .titlebar,.theme-light.minimal-light-contrast.minimal-status-off .status-bar{--accent-l:60%;--base-l:15%;--bg1:hsl( var(--base-h), var(--base-s), var(--base-l) );--bg2:hsl( var(--base-h), var(--base-s), calc(var(--base-l) - 2%) );--bg3:hsla( var(--base-h), var(--base-s), calc(var(--base-l) + 40%), 0.12 );--ui1:hsl( var(--base-h), var(--base-s), calc(var(--base-l) + 6%) );--ui2:hsl( var(--base-h), var(--base-s), calc(var(--base-l) + 12%) );--ui3:hsl( var(--base-h), var(--base-s), calc(var(--base-l) + 20%) );--tx1:hsl( var(--base-h), calc(var(--base-s) - 10%), calc(var(--base-l) + 67%) );--tx2:hsl( var(--base-h), calc(var(--base-s) - 20%), calc(var(--base-l) + 45%) );--tx3:hsl( var(--base-h), calc(var(--base-s) - 10%), calc(var(--base-l) + 20%) );--tx4:hsl( var(--base-h), calc(var(--base-s) - 10%), calc(var(--base-l) + 50%) );--ax1:hsl( var(--accent-h), var(--accent-s), var(--accent-l) );--ax2:hsl( var(--accent-h), var(--accent-s), calc(var(--accent-l) + 8%) );--ax3:hsl( var(--accent-h), var(--accent-s), calc(var(--accent-l) - 5%) );--hl1:hsla( var(--accent-h), 50%, 40%, 30% );--hl2:rgba(255, 177, 80, 0.3);--sp1:white}.theme-light.minimal-light-white{--background-primary:white;--background-secondary:white;--background-secondary-alt:white;--ribbon-background:white;--titlebar-background:white;--mobile-sidebar-background:white;--bg1:white}.theme-dark.minimal-dark-black{--base-d:0%;--titlebar-background:black;--background-primary:black;--background-secondary:black;--background-secondary-alt:black;--ribbon-background:black;--background-modifier-hover:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 10%));--tx1:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 75%) );--tx2:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 50%) );--tx3:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 25%) );--ui1:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 12%) );--ui2:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 20%) );--ui3:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 30%) )}.theme-light{--mono100:black;--mono0:white}.theme-dark{--mono100:white;--mono0:black}.theme-dark,.theme-light,.theme-light.minimal-light-contrast .titlebar,.theme-light.minimal-light-contrast.is-mobile .workspace-drawer.mod-left,.theme-light.minimal-light-contrast.minimal-status-off .status-bar{--background-modifier-accent:var(--ax3);--background-modifier-border-focus:var(--ui3);--background-modifier-border-hover:var(--ui2);--background-modifier-border:var(--ui1);--mobile-sidebar-background:var(--bg1);--background-modifier-form-field-highlighted:var(--bg1);--background-modifier-form-field:var(--bg1);--background-modifier-success:var(--color-green);--background-modifier-hover:var(--bg3);--background-modifier-active-hover:var(--bg3);--background-primary:var(--bg1);--background-primary-alt:var(--bg2);--background-secondary:var(--bg2);--background-secondary-alt:var(--bg1);--background-table-rows:var(--bg2);--checkbox-color:var(--ax3);--code-normal:var(--tx1);--divider-color:var(--ui1);--frame-divider-color:var(--ui1);--icon-color-active:var(--tx1);--icon-color-focused:var(--tx1);--icon-color-hover:var(--tx2);--icon-color:var(--tx2);--icon-hex:var(--mono0);--interactive-accent-hover:var(--ax1);--interactive-accent:var(--ax3);--interactive-hover:var(--ui1);--list-marker-color:var(--tx3);--nav-item-background-active:var(--bg3);--nav-item-background-hover:var(--bg3);--nav-item-color:var(--tx2);--nav-item-color-active:var(--tx1);--nav-item-color-hover:var(--tx1);--nav-item-color-selected:var(--tx1);--nav-collapse-icon-color:var(--tx2);--nav-collapse-icon-color-collapsed:var(--tx2);--nav-indentation-guide-color:var(--ui1);--prompt-border-color:var(--ui3);--quote-opening-modifier:var(--ui2);--ribbon-background:var(--bg2);--scrollbar-active-thumb-bg:var(--ui3);--scrollbar-bg:transparent;--scrollbar-thumb-bg:var(--ui1);--search-result-background:var(--bg1);--tab-text-color-focused-active:var(--tx1);--tab-outline-color:var(--ui1);--text-accent-hover:var(--ax2);--text-accent:var(--ax1);--text-blockquote:var(--tx2);--text-bold:var(--tx1);--text-code:var(--tx4);--text-error:var(--color-red);--text-faint:var(--tx3);--text-highlight-bg:var(--hl2);--text-italic:var(--tx1);--text-muted:var(--tx2);--text-normal:var(--tx1);--text-on-accent:var(--sp1);--text-selection:var(--hl1);--text-formatting:var(--tx3);--title-color-inactive:var(--tx2);--title-color:var(--tx1);--titlebar-background:var(--bg2);--titlebar-background-focused:var(--bg2);--titlebar-text-color-focused:var(--tx1);--vault-profile-color:var(--tx1);--vault-profile-color-hover:var(--tx1);--workspace-background-translucent:hsla(var(--base-h),var(--base-s), var(--base-l), 0.7)}.theme-dark .view-actions,.theme-light .view-actions{--icon-color-active:var(--ax1)}.theme-light.minimal-light-contrast{--workspace-background-translucent:rgba(0,0,0,0.6)}.theme-light.minimal-light-contrast .theme-dark{--tab-container-background:var(--bg2);--ribbon-background-collapsed:var(--bg2)}.theme-light{--interactive-normal:var(--bg1);--interactive-accent-rgb:220,220,220;--active-line-bg:rgba(0,0,0,0.035);--background-modifier-cover:hsla(var(--base-h),calc(var(--base-s) - 70%),calc(var(--base-l) - 20%),0.5);--text-highlight-bg-active:rgba(0, 0, 0, 0.1);--background-modifier-error:rgba(255,0,0,0.14);--background-modifier-error-hover:rgba(255,0,0,0.08);--shadow-color:rgba(0, 0, 0, 0.1);--btn-shadow-color:rgba(0, 0, 0, 0.05)}.theme-dark{--interactive-normal:var(--bg3);--interactive-accent-rgb:66,66,66;--active-line-bg:rgba(255,255,255,0.04);--background-modifier-cover:hsla(var(--base-h),var(--base-s), calc(var(--base-l) - 12%), 0.5);--text-highlight-bg-active:rgba(255, 255, 255, 0.1);--background-modifier-error:rgba(255,20,20,0.12);--background-modifier-error-hover:rgba(255,20,20,0.18);--background-modifier-box-shadow:rgba(0, 0, 0, 0.3);--shadow-color:rgba(0, 0, 0, 0.3);--btn-shadow-color:rgba(0, 0, 0, 0.2);--modal-border-color:var(--ui2)}.theme-light.minimal-light-white{--background-table-rows:var(--bg2);--interactive-normal:var(--bg3)}.theme-light.minimal-light-tonal{--background-secondary:var(--bg1);--background-primary-alt:var(--bg3);--background-table-rows:var(--bg3)}.theme-light.minimal-light-tonal.is-mobile{--background-modifier-form-field:var(--bg3);--interactive-normal:var(--bg3)}.theme-dark.minimal-dark-tonal{--ribbon-background:var(--bg1);--background-secondary:var(--bg1);--background-table-rows:var(--bg3)}.theme-dark.minimal-dark-black{--background-primary-alt:var(--bg3);--background-table-rows:var(--bg3);--modal-border:var(--ui2);--active-line-bg:rgba(255,255,255,0.085);--background-modifier-form-field:var(--bg3);--background-modifier-cover:hsla(var(--base-h),var(--base-s),calc(var(--base-d) + 8%),0.9);--background-modifier-box-shadow:rgba(0, 0, 0, 1)}body{--font-adaptive-normal:var(--font-text-size,var(--editor-font-size));--font-adaptive-small:calc(var(--font-ui-small) * 1.07);--font-adaptive-smaller:var(--font-ui-small);--font-adaptive-smallest:var(--font-ui-smaller);--line-width-wide:calc(var(--line-width) + 12.5%);--font-code:calc(var(--font-adaptive-normal) * 0.9);--table-text-size:calc(var(--font-adaptive-normal) * 0.875);--bases-table-font-size:calc(var(--font-adaptive-normal) * 0.875)}.bases-view{--bases-table-font-size:var(--table-text-size)}.query-toolbar-menu .combobox-button{background-color:rgba(0,0,0,0)}.bases-embed .bases-header .query-toolbar,.block-language-base .bases-header .query-toolbar{padding-bottom:2px;opacity:var(--bases-toolbar-opacity);transition:.15s .15s opacity}.bases-embed .bases-header .query-toolbar:hover,.block-language-base .bases-header .query-toolbar:hover{opacity:1;transition:0s opacity}.base-plain .bases-header{display:none}.bases-table-header-icon{display:var(--bases-table-header-icon-display)}.CodeMirror-wrap>div>textarea{opacity:0}.markdown-source-view.mod-cm6 hr{border-width:2px}.cm-editor .cm-content{padding-top:.5em}.markdown-source-view{color:var(--text-normal)}.markdown-source-view.mod-cm6 .cm-sizer{display:block}.markdown-source-view.mod-cm6 .cm-scroller{padding-inline-end:0;padding-inline-start:0}.cm-s-obsidian .cm-line.HyperMD-header{padding-top:calc(var(--p-spacing)/2)}.markdown-rendered .mod-header+div>*{margin-block-start:0}body :not(.canvas-node) .markdown-source-view.mod-cm6 .cm-gutters{position:absolute!important;z-index:0;margin-inline-end:0}body :not(.canvas-node) .markdown-source-view.mod-cm6 .cm-gutters .cm-gutter:before{content:"";height:100%;top:-100%;width:100%;position:absolute;z-index:1;background-color:var(--gutter-background);min-width:var(--folding-offset)}body :not(.canvas-node) .markdown-source-view.mod-cm6.is-rtl .cm-gutters{right:0}body{--line-number-color:var(--text-faint);--line-number-color-active:var(--text-muted)}.empty-state-title{display:none}.markdown-source-view.mod-cm6 .cm-gutters{color:var(--line-number-color)!important}.markdown-source-view.mod-cm6 .cm-editor .cm-gutterElement.cm-active .cm-heading-marker,.markdown-source-view.mod-cm6 .cm-editor .cm-lineNumbers .cm-gutterElement.cm-active{color:var(--line-number-color-active)}.cm-editor .cm-lineNumbers{background-color:var(--gutter-background)}.cm-editor .cm-lineNumbers .cm-gutterElement{min-width:var(--folding-offset);padding-inline-end:.5em}.is-rtl .cm-editor .cm-lineNumbers .cm-gutterElement{text-align:left}@media(max-width:400pt){.cm-editor .cm-lineNumbers .cm-gutterElement{padding-inline-end:4px;padding-inline-start:8px}}.cm-editor .cm-gutterElement.cm-active .cm-heading-marker,.cm-editor .cm-lineNumbers .cm-gutterElement.cm-active{color:var(--text-muted)}.markdown-source-view.mod-cm6 .edit-block-button{cursor:var(--cursor);color:var(--text-faint);background-color:var(--background-primary);top:0;opacity:0;transition:opacity .2s;padding:4px 4px 4px 9px}.markdown-source-view.mod-cm6 .edit-block-button svg{margin:0!important}.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.edit-block-button{width:30px!important;padding-inline-start:7px!important}.is-live-preview:not(.is-readable-line-width) .cm-embed-block>.edit-block-button{padding-inline-start:0px!important;margin-inline-start:0!important;padding:4px}.markdown-source-view.mod-cm6 .edit-block-button:hover{background-color:var(--background-primary);color:var(--text-muted)}.markdown-source-view.mod-cm6 .edit-block-button svg{opacity:1}.markdown-source-view.mod-cm6 .edit-block-button:hover svg{opacity:1}.markdown-source-view.mod-cm6 .cm-embed-block{padding:0;border:0;border-radius:0}.markdown-source-view.mod-cm6 .cm-embed-block:hover{border:0}.metadata-container{--input-height:calc(var(--font-adaptive-small) * 2.2)}body.metadata-heading-off .metadata-properties-heading{display:none}.metadata-add-property-off .mod-root .metadata-add-button{display:none}.metadata-dividers{--metadata-divider-width:1px;--metadata-gap:0px}.metadata-icons-off .workspace-leaf-content[data-type=all-properties] .tree-item-inner{margin-inline-start:-16px}.metadata-icons-off .workspace-leaf-content[data-type=all-properties] .tree-item-icon{display:none}.metadata-icons-off .metadata-property-icon{display:none}figure{margin-inline-start:0;margin-inline-end:0}.markdown-preview-view .mod-highlighted{transition:background-color .3s ease;background-color:var(--text-selection);color:inherit}.inline-title{padding-top:16px}.mod-macos.hider-frameless .workspace-ribbon{border:none}.is-tablet.hider-ribbon{--ribbon-width:0px}.is-tablet.hider-ribbon .side-dock-ribbon{display:none}.hider-ribbon .workspace-ribbon{padding:0}:root{--hider-ribbon-display:none;--ribbon-animation-duration:0.1s}.ribbon-bottom-left-hover-vertical:not(.is-mobile),.ribbon-bottom-left-hover:not(.is-mobile){--hider-ribbon-display:flex}body.ribbon-vertical-expand:not(.is-mobile){--ribbon-width:0px}body.ribbon-vertical-expand:not(.is-mobile) .workspace-ribbon.mod-left{width:10px;flex-basis:10px;opacity:0;position:fixed;height:100%;top:0;bottom:0;left:0;z-index:10;transition:all var(--ribbon-animation-duration) linear .6s}body.ribbon-vertical-expand:not(.is-mobile) .workspace-ribbon.mod-left .side-dock-actions{transition:opacity var(--ribbon-animation-duration) linear .3s}body.ribbon-vertical-expand:not(.is-mobile) .workspace-ribbon.mod-left:hover{width:44px;opacity:1;flex-basis:44px;transition:opacity var(--ribbon-animation-duration) linear .1s}body.ribbon-vertical-expand:not(.is-mobile) .workspace-ribbon.mod-left:hover .side-dock-actions{opacity:1;transition:opacity calc(var(--ribbon-animation-duration)*2) linear .2s}body.ribbon-vertical-expand:not(.is-mobile).labeled-nav .workspace-ribbon.mod-left~.mod-left-split .workspace-tab-header-container{margin-left:0;transition:all var(--ribbon-animation-duration) linear .6s}body.ribbon-vertical-expand:not(.is-mobile).labeled-nav .workspace-ribbon.mod-left:hover~.mod-left-split .workspace-tab-header-container{margin-left:44px;transition:all var(--ribbon-animation-duration) linear}body.ribbon-vertical-expand:not(.is-mobile) .workspace-ribbon.mod-left~.mod-left-split .workspace-tab-container{padding-left:0;transition:all var(--ribbon-animation-duration) linear .6s}body.ribbon-vertical-expand:not(.is-mobile) .workspace-ribbon.mod-left~.mod-left-split .workspace-sidedock-vault-profile{transition:all var(--ribbon-animation-duration) linear .6s}body.ribbon-vertical-expand:not(.is-mobile) .workspace-ribbon.mod-left:hover~.mod-left-split .workspace-tab-container{padding-left:44px;transition:all var(--ribbon-animation-duration) linear}body.ribbon-vertical-expand:not(.is-mobile) .workspace-ribbon.mod-left:hover~.mod-left-split .workspace-sidedock-vault-profile{padding-left:52px;transition:all var(--ribbon-animation-duration) linear}.hider-ribbon .workspace-ribbon.mod-left:before,.ribbon-bottom-left-hover .workspace-ribbon.mod-left:before,.ribbon-bottom-left-hover-vertical .workspace-ribbon.mod-left:before{opacity:0}.hider-ribbon .workspace-ribbon-collapse-btn,.ribbon-bottom-left-hover .workspace-ribbon-collapse-btn,.ribbon-bottom-left-hover-vertical .workspace-ribbon-collapse-btn{display:none}.hider-ribbon .workspace-ribbon.mod-right,.ribbon-bottom-left-hover .workspace-ribbon.mod-right,.ribbon-bottom-left-hover-vertical .workspace-ribbon.mod-right{pointer-events:none}.hider-ribbon .workspace-ribbon.mod-left,.ribbon-bottom-left-hover .workspace-ribbon.mod-left,.ribbon-bottom-left-hover-vertical .workspace-ribbon.mod-left{overflow:visible;border-top:var(--border-width) solid var(--background-modifier-border)!important;border-right:var(--border-width) solid var(--background-modifier-border)!important;border-top-right-radius:var(--radius-m);padding:0;position:absolute;border-right:0px;margin:0;width:auto;height:44px;flex-basis:0;bottom:0;top:auto;background:var(--background-secondary);display:var(--hider-ribbon-display)!important;flex-direction:row;z-index:17;opacity:0;transition:opacity calc(var(--ribbon-animation-duration)*2) ease-in-out;filter:drop-shadow(2px 10px 30px rgba(0, 0, 0, .2));gap:0}.hider-ribbon .side-dock-actions,.hider-ribbon .side-dock-settings,.ribbon-bottom-left-hover .side-dock-actions,.ribbon-bottom-left-hover .side-dock-settings,.ribbon-bottom-left-hover-vertical .side-dock-actions,.ribbon-bottom-left-hover-vertical .side-dock-settings{flex-direction:row;display:var(--hider-ribbon-display);background:rgba(0,0,0,0);margin:0;position:relative;gap:var(--size-2-2)}.hider-ribbon .side-dock-actions,.ribbon-bottom-left-hover .side-dock-actions,.ribbon-bottom-left-hover-vertical .side-dock-actions{padding:6px 6px 6px 8px}.hider-ribbon .side-dock-settings:empty,.ribbon-bottom-left-hover .side-dock-settings:empty,.ribbon-bottom-left-hover-vertical .side-dock-settings:empty{display:none}.hider-ribbon .workspace-ribbon.mod-left .side-dock-ribbon-action,.ribbon-bottom-left-hover .workspace-ribbon.mod-left .side-dock-ribbon-action,.ribbon-bottom-left-hover-vertical .workspace-ribbon.mod-left .side-dock-ribbon-action{display:var(--hider-ribbon-display)}.hider-ribbon .workspace-ribbon.mod-left:hover,.ribbon-bottom-left-hover .workspace-ribbon.mod-left:hover,.ribbon-bottom-left-hover-vertical .workspace-ribbon.mod-left:hover{opacity:1;transition:opacity .25s ease-in-out}.hider-ribbon .workspace-ribbon.mod-left .workspace-ribbon-collapse-btn,.ribbon-bottom-left-hover .workspace-ribbon.mod-left .workspace-ribbon-collapse-btn,.ribbon-bottom-left-hover-vertical .workspace-ribbon.mod-left .workspace-ribbon-collapse-btn{opacity:0}.hider-ribbon .workspace-split.mod-left-split,.ribbon-bottom-left-hover .workspace-split.mod-left-split,.ribbon-bottom-left-hover-vertical .workspace-split.mod-left-split{margin:0}.hider-ribbon .workspace-leaf-content .item-list,.ribbon-bottom-left-hover .workspace-leaf-content .item-list,.ribbon-bottom-left-hover-vertical .workspace-leaf-content .item-list{padding-bottom:40px}.ribbon-bottom-left-hover-vertical .workspace-ribbon.mod-left{height:auto}.ribbon-bottom-left-hover-vertical .side-dock-actions{flex-direction:column;padding:8px 6px}.minimal-status-off .status-bar{--status-bar-position:static;--status-bar-radius:0;--status-bar-border-width:1px 0 0 0;--status-bar-background:var(--background-secondary);--status-bar-border-color:var(--ui1)}body:not(.minimal-status-off) .status-bar{background-color:var(--background-primary);--status-bar-border-width:0}.status-bar{transition:color .2s linear;color:var(--text-faint);font-size:var(--font-adaptive-smallest)}.status-bar .sync-status-icon.mod-success,.status-bar .sync-status-icon.mod-working{color:var(--text-faint)}.status-bar:hover,.status-bar:hover .sync-status-icon.mod-success,.status-bar:hover .sync-status-icon.mod-working{color:var(--text-muted);transition:color .2s linear}.status-bar .plugin-sync:hover .sync-status-icon.mod-success,.status-bar .plugin-sync:hover .sync-status-icon.mod-working{color:var(--text-normal)}.status-bar .status-bar-item{cursor:var(--cursor)!important}.status-bar .status-bar-item.cMenu-statusbar-button:hover,.status-bar .status-bar-item.mod-clickable:hover,.status-bar .status-bar-item.plugin-editor-status:hover,.status-bar .status-bar-item.plugin-sync:hover{text-align:center;background-color:var(--background-modifier-hover)!important}.tab-stack-top-flipped{--tab-stacked-text-transform:rotate(180deg);--tab-stacked-text-align:right}.tab-stack-center{--tab-stacked-text-align:center}.tab-stack-center-flipped{--tab-stacked-text-transform:rotate(180deg);--tab-stacked-text-align:center}.tab-stack-bottom{--tab-stacked-text-transform:rotate(180deg)}.tab-stack-bottom-flipped{--tab-stacked-text-align:right}.workspace .mod-root .workspace-tabs.mod-stacked .workspace-tab-container .workspace-tab-header-inner{flex-direction:var(--tab-stacked-spine-order)}.view-header-title,.view-header-title-parent{text-overflow:ellipsis}.view-header-title-container:not(.mod-at-end):after{display:none}body:not(.is-mobile) .view-actions .view-action:last-child{margin-left:-1px}.minimal-focus-mode .workspace-ribbon:not(.is-collapsed)~.mod-root .view-header:hover .view-actions,.mod-right.is-collapsed~.mod-root .view-header:hover .view-actions,.view-action.is-active:hover,.workspace-ribbon.mod-left.is-collapsed~.mod-root .view-header:hover .view-actions,body:not(.minimal-focus-mode) .workspace-ribbon:not(.is-collapsed)~.mod-root .view-actions{opacity:1;transition:opacity .25s ease-in-out}.view-header-title-container{opacity:0;transition:opacity .1s ease-in-out}.view-header-title-container:focus-within{opacity:1;transition:opacity .1s ease-in-out}.view-header:hover .view-header-title-container,.workspace-tab-header-container:hover+.workspace-tab-container .view-header-title-container{opacity:1;transition:opacity .1s ease-in-out}.is-phone .view-header-title-container,.minimal-tab-title-visible .view-header-title-container{opacity:1}.minimal-tab-title-hidden .view-header-title-container{opacity:0}.minimal-tab-title-hidden .view-header-title-container:focus-within{opacity:1;transition:opacity .1s ease-in-out}.minimal-tab-title-hidden .view-header:hover .view-header-title-container,.minimal-tab-title-hidden .workspace-tab-header-container:hover+.workspace-tab-container .view-header-title-container{opacity:0}body.window-title-off .titlebar-text{display:none}.titlebar-button-container.mod-right{background-color:rgba(0,0,0,0)!important}.is-hidden-frameless.theme-dark:not(.minimal-dark-black):not(.colorful-frame),.is-hidden-frameless.theme-light:not(.minimal-light-tonal):not(.colorful-frame):not(.minimal-light-white){--titlebar-background:var(--bg1)}.is-hidden-frameless.theme-dark:not(.minimal-dark-black):not(.colorful-frame).is-focused .sidebar-toggle-button.mod-right,.is-hidden-frameless.theme-dark:not(.minimal-dark-black):not(.colorful-frame).is-focused .workspace-ribbon.mod-left.is-collapsed,.is-hidden-frameless.theme-dark:not(.minimal-dark-black):not(.colorful-frame).is-focused .workspace-tabs.mod-top,.is-hidden-frameless.theme-light:not(.minimal-light-tonal):not(.colorful-frame):not(.minimal-light-white).is-focused .sidebar-toggle-button.mod-right,.is-hidden-frameless.theme-light:not(.minimal-light-tonal):not(.colorful-frame):not(.minimal-light-white).is-focused .workspace-ribbon.mod-left.is-collapsed,.is-hidden-frameless.theme-light:not(.minimal-light-tonal):not(.colorful-frame):not(.minimal-light-white).is-focused .workspace-tabs.mod-top{--titlebar-background-focused:var(--bg1)}.is-hidden-frameless.theme-dark:not(.minimal-dark-black):not(.colorful-frame):not(.minimal-dark-tonal):not(.minimal-light-white) .workspace-ribbon.mod-left:not(.is-collapsed),.is-hidden-frameless.theme-light:not(.minimal-light-tonal):not(.colorful-frame):not(.minimal-light-white):not(.minimal-dark-tonal):not(.minimal-light-white) .workspace-ribbon.mod-left:not(.is-collapsed){--titlebar-background:var(--bg2)}.mod-macos.is-hidden-frameless:not(.is-popout-window) .sidebar-toggle-button.mod-right{right:0;padding-right:var(--size-4-2)}body.is-focused{--titlebar-background-focused:var(--background-secondary)}.is-hidden-frameless:not(.colorful-frame) .mod-left-split .mod-top .workspace-tab-header-container{--tab-container-background:var(--background-secondary)}.mod-root .workspace-tab-header-status-icon{color:var(--text-muted)}.is-collapsed .workspace-sidedock-vault-profile{opacity:0}body:not(.is-mobile).hide-help .workspace-drawer-vault-actions .clickable-icon:first-child{display:none}body:not(.is-mobile).hide-settings .workspace-drawer-vault-actions .clickable-icon:last-child{display:none}body:not(.is-mobile).hide-help.hide-settings .workspace-drawer-vault-actions{display:none!important}body:not(.is-grabbing):not(.is-fullscreen).labeled-nav.is-hidden-frameless.vault-profile-top .mod-left-split .mod-top .workspace-tab-header-container{-webkit-app-region:no-drag}body:not(.is-grabbing):not(.is-fullscreen).labeled-nav.is-hidden-frameless.vault-profile-top .mod-left-split .mod-top .workspace-tab-header-container:before{position:absolute;top:0;content:"";height:var(--header-height);width:100%;-webkit-app-region:drag}body:not(.is-mobile):not(.labeled-nav).vault-profile-top .workspace-split.mod-left-split .mod-top .workspace-tab-container{margin-top:calc(var(--header-height) + 8px)}body:not(.is-mobile):not(.labeled-nav).vault-profile-top .workspace-split.mod-left-split .workspace-sidedock-vault-profile{-webkit-app-region:no-drag;position:absolute;top:var(--header-height);z-index:6;width:100%;border-top:0;border-bottom:1px solid var(--background-modifier-border)}body:not(.is-mobile):not(.labeled-nav).vault-profile-top .workspace-split.mod-left-split .workspace-sidedock-vault-profile .workspace-drawer-vault-switcher{padding-left:var(--size-4-2)}body:not(.is-mobile).labeled-nav.vault-profile-top .workspace-split.mod-left-split .workspace-sidedock-vault-profile{-webkit-app-region:no-drag;position:absolute;top:var(--labeled-nav-top-margin);z-index:6;width:100%;background-color:rgba(0,0,0,0);border-top:0;border-bottom:1px solid var(--background-modifier-border)}body:not(.is-mobile).labeled-nav.vault-profile-top .workspace-split.mod-left-split .workspace-sidedock-vault-profile .workspace-drawer-vault-switcher{padding-left:var(--size-4-2)}.vault-profile-top .workspace-tab-header-container-inner{--labeled-nav-top-margin:84px}.modal button:not(.mod-warning),.modal.mod-settings button:not(.mod-cta):not(.mod-warning),.modal.mod-settings button:not(.mod-warning){white-space:nowrap;transition:background-color .2s ease-out,border-color .2s ease-out}button.mod-warning{border:1px solid var(--background-modifier-error);color:var(--text-error);box-shadow:0 1px 1px 0 var(--btn-shadow-color);transition:background-color .2s ease-out}button.mod-warning:hover{border:1px solid var(--background-modifier-error);color:var(--text-error);box-shadow:0 2px 3px 0 var(--btn-shadow-color);transition:background-color .2s ease-out}.is-mobile button.mod-warning{border:none}.document-replace,.document-search{max-width:100%;padding:0}.document-search-container{margin:0 auto;max-width:var(--max-width);width:var(--line-width)}.modal-button-container .mod-checkbox{--checkbox-radius:4px}.modal-container.mod-confirmation .modal{width:480px;min-width:0}.hide-settings-desc.is-phone .setting-item{padding:.65em 0}.hide-settings-desc.is-phone .setting-item-name{font-weight:400;font-size:16px}.hide-settings-desc .setting-item-name{transition:max-height .2s ease-in-out,padding-top .2s ease-in-out}.hide-settings-desc .setting-item-name:active+.setting-item-description{opacity:1;max-height:500px;padding-top:4px;transition:opacity .1s ease-out,max-height .2s ease-out,padding-top .2s ease-in-out}.hide-settings-desc .setting-item-description{opacity:0;max-height:0;padding-top:0;transition:max-height .2s ease-in-out,padding-top .2s ease-in-out}.popover{--file-margins:var(--size-4-6) var(--size-4-6) var(--size-4-6)}.minimal-line-nums .popover .markdown-source-view{--file-margins:var(--size-4-4) var(--size-4-6) var(--size-4-6) var(--size-4-12)}.minimal-line-nums .popover .markdown-source-view.is-rtl{--file-margins:var(--size-4-4) var(--size-4-12) var(--size-4-6) var(--size-4-6)}body{--progress-outline:var(--background-modifier-border);--progress-complete:var(--text-accent)}.markdown-preview-view progress,.markdown-rendered progress,.markdown-source-view.is-live-preview progress{width:220px}.markdown-preview-view progress[value]::-webkit-progress-bar,.markdown-rendered progress[value]::-webkit-progress-bar,.markdown-source-view.is-live-preview progress[value]::-webkit-progress-bar{box-shadow:inset 0 0 0 var(--border-width) var(--progress-outline)}.markdown-preview-view progress[value^="1"]::-webkit-progress-value,.markdown-preview-view progress[value^="2"]::-webkit-progress-value,.markdown-preview-view progress[value^="3"]::-webkit-progress-value,.markdown-rendered progress[value^="1"]::-webkit-progress-value,.markdown-rendered progress[value^="2"]::-webkit-progress-value,.markdown-rendered progress[value^="3"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^="1"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^="2"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^="3"]::-webkit-progress-value{background-color:var(--color-red)}.markdown-preview-view progress[value^="4"]::-webkit-progress-value,.markdown-preview-view progress[value^="5"]::-webkit-progress-value,.markdown-rendered progress[value^="4"]::-webkit-progress-value,.markdown-rendered progress[value^="5"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^="4"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^="5"]::-webkit-progress-value{background-color:var(--color-orange)}.markdown-preview-view progress[value^="6"]::-webkit-progress-value,.markdown-preview-view progress[value^="7"]::-webkit-progress-value,.markdown-rendered progress[value^="6"]::-webkit-progress-value,.markdown-rendered progress[value^="7"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^="6"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^="7"]::-webkit-progress-value{background-color:var(--color-yellow)}.markdown-preview-view progress[value^="8"]::-webkit-progress-value,.markdown-preview-view progress[value^="9"]::-webkit-progress-value,.markdown-rendered progress[value^="8"]::-webkit-progress-value,.markdown-rendered progress[value^="9"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^="8"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^="9"]::-webkit-progress-value{background-color:var(--color-green)}.markdown-preview-view progress[value="1"]::-webkit-progress-value,.markdown-preview-view progress[value="100"]::-webkit-progress-value,.markdown-rendered progress[value="1"]::-webkit-progress-value,.markdown-rendered progress[value="100"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value="1"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value="100"]::-webkit-progress-value{background-color:var(--progress-complete)}.markdown-preview-view progress[value="0"]::-webkit-progress-value,.markdown-preview-view progress[value="2"]::-webkit-progress-value,.markdown-preview-view progress[value="3"]::-webkit-progress-value,.markdown-preview-view progress[value="4"]::-webkit-progress-value,.markdown-preview-view progress[value="5"]::-webkit-progress-value,.markdown-preview-view progress[value="6"]::-webkit-progress-value,.markdown-preview-view progress[value="7"]::-webkit-progress-value,.markdown-preview-view progress[value="8"]::-webkit-progress-value,.markdown-preview-view progress[value="9"]::-webkit-progress-value,.markdown-rendered progress[value="0"]::-webkit-progress-value,.markdown-rendered progress[value="2"]::-webkit-progress-value,.markdown-rendered progress[value="3"]::-webkit-progress-value,.markdown-rendered progress[value="4"]::-webkit-progress-value,.markdown-rendered progress[value="5"]::-webkit-progress-value,.markdown-rendered progress[value="6"]::-webkit-progress-value,.markdown-rendered progress[value="7"]::-webkit-progress-value,.markdown-rendered progress[value="8"]::-webkit-progress-value,.markdown-rendered progress[value="9"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value="0"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value="2"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value="3"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value="4"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value="5"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value="6"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value="7"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value="8"]::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value="9"]::-webkit-progress-value{background-color:var(--color-red)}.tooltip{transition:none;animation:none}.tooltip.mod-left,.tooltip.mod-right{animation:none}.tooltip.mod-error{color:var(--text-error)}.markdown-preview-view blockquote{padding-inline-start:var(--nested-padding);font-size:var(--blockquote-size)}.markdown-source-view.mod-cm6 .HyperMD-quote,.markdown-source-view.mod-cm6.is-live-preview .HyperMD-quote{font-size:var(--blockquote-size)}.is-live-preview .cm-hmd-indent-in-quote{color:var(--text-faint)}.is-live-preview.is-readable-line-width>.cm-callout .callout{max-width:var(--max-width);margin:0 auto}.callouts-outlined .callout .callout-title{background-color:var(--background-primary);margin-top:-24px;z-index:200;width:fit-content;padding:0 .5em;margin-left:-.75em;letter-spacing:.05em;font-variant-caps:all-small-caps}.callouts-outlined .callout{overflow:visible;--callout-border-width:1px;--callout-border-opacity:0.5;--callout-title-size:0.8em;--callout-blend-mode:normal;background-color:rgba(0,0,0,0)}.callouts-outlined .cm-embed-block.cm-callout{padding-top:12px}.callouts-outlined .callout-content .callout{margin-top:18px}body{--checkbox-radius:50%;--checkbox-top:2px;--checkbox-left:0px;--checkbox-margin:0px 6px 0px -2em}.checkbox-square{--checkbox-size:calc(var(--font-text-size) * 0.85);--checkbox-radius:4px;--checkbox-top:1px;--checkbox-left:0px;--checkbox-margin:0px 8px 0px -2em}body.minimal-strike-lists{--checklist-done-decoration:line-through}body:not(.minimal-strike-lists){--checklist-done-decoration:none;--checklist-done-color:var(--text-normal)}.markdown-preview-section>.contains-task-list{padding-bottom:.5em}.mod-cm6 .HyperMD-task-line[data-task] .cm-formatting-list-ol~.task-list-label .task-list-item-checkbox{margin:1px}.markdown-preview-view .task-list-item-checkbox{position:relative;top:var(--checkbox-top);left:var(--checkbox-left)}.markdown-preview-view ul>li.task-list-item{text-indent:0}.minimal-code-scroll{--code-white-space:pre}.minimal-code-scroll .HyperMD-codeblock.HyperMD-codeblock-bg{overflow-y:scroll;white-space:pre}.minimal-code-scroll .cm-hmd-codeblock{white-space:pre!important}@media print{.print{--code-background:#eee!important}}body{--embed-max-height:none;--embed-decoration-style:solid;--embed-decoration-color:var(--background-modifier-border-hover)}.embed-strict{--embed-background:transparent;--embed-border-start:0;--embed-border-left:0;--embed-padding:0}.embed-strict .markdown-embed-content{--folding-offset:0px}.embed-strict .internal-embed .markdown-embed,.embed-strict .markdown-preview-view .markdown-embed,.embed-strict.markdown-preview-view .markdown-embed{padding:0}.embed-strict .internal-embed .markdown-embed .markdown-embed-title,.embed-strict .markdown-embed-title{display:none}.embed-strict .internal-embed:not([src*="#^"]) .markdown-embed-link{width:24px;opacity:0}.embed-underline .internal-embed:not(.pdf-embed,.bases-embed){text-decoration-line:underline;text-decoration-style:var(--embed-decoration-style);text-decoration-color:var(--embed-decoration-color)}.embed-hide-title .markdown-embed-title{display:none}.contextual-typography .embed-strict .internal-embed .markdown-preview-view .markdown-preview-sizer>div,.embed-strict.contextual-typography .internal-embed .markdown-preview-view .markdown-preview-sizer>div{margin:0;width:100%}.markdown-embed .markdown-preview-view .markdown-preview-sizer{padding-bottom:0!important}.markdown-preview-view.is-readable-line-width .markdown-embed .markdown-preview-sizer,.markdown-preview-view.markdown-embed .markdown-preview-sizer{max-width:100%;width:100%;min-height:0!important;padding-bottom:0!important}.markdown-embed .markdown-preview-section div:last-child p,.markdown-embed .markdown-preview-section div:last-child ul{margin-block-end:2px}.markdown-preview-view .markdown-embed{margin-top:var(--nested-padding);padding:0 calc(var(--nested-padding)/2) 0 var(--nested-padding)}.internal-embed:not([src*="#^"]) .markdown-embed-link{right:0;width:100%}.file-embed-link,.markdown-embed-link{top:0;right:0;text-align:right;justify-content:flex-end}.file-embed-link svg,.markdown-embed-link svg{width:16px;height:16px}.markdown-embed .file-embed-link,.markdown-embed .markdown-embed-link{opacity:.6;transition:opacity .1s linear}.markdown-embed .file-embed-link:hover,.markdown-embed .markdown-embed-link:hover{opacity:1}.markdown-embed .file-embed-link:hover:hover,.markdown-embed .markdown-embed-link:hover:hover{background-color:rgba(0,0,0,0);--icon-color:var(--text-accent)}.file-embed-link:hover,.markdown-embed-link:hover{color:var(--text-muted)}.markdown-embed .markdown-preview-view{padding:0}.internal-embed .markdown-embed{border:0;border-left:1px solid var(--quote-opening-modifier);border-radius:0}a[href*="obsidian://search"]{background-image:url("data:image/svg+xml,")}.theme-dark a[href*="obsidian://search"]{background-image:url("data:image/svg+xml,")}.plain-external-links .external-link{background-image:none;padding-right:0}body{--adaptive-list-edit-offset:var(--list-edit-offset)}.is-rtl{--adaptive-list-edit-offset:calc(var(--list-edit-offset)*-1)}.markdown-preview-view ol>li,.markdown-preview-view ul>li,.markdown-source-view ol>li,.markdown-source-view ul>li,.mod-cm6 .HyperMD-list-line.cm-line{padding-top:var(--list-spacing);padding-bottom:var(--list-spacing)}.is-mobile ul>li:not(.task-list-item)::marker{font-size:.8em}.is-mobile .workspace-leaf-content:not([data-type=search]) .workspace-leaf-content[data-type=markdown] .nav-buttons-container{border-bottom:none;padding-top:5px}.is-mobile .mod-root .workspace-leaf-content[data-type=markdown] .search-input-container{width:calc(100% - 160px)}.embedded-backlinks .backlink-pane>.tree-item-self,.embedded-backlinks .backlink-pane>.tree-item-self:hover{text-transform:none;color:var(--text-normal);font-size:var(--font-adaptive-normal);font-weight:500;letter-spacing:unset}body{--pdf-dark-opacity:1}.theme-dark:not(.pdf-shadows-on),.theme-light:not(.pdf-shadows-on){--pdf-shadow:none;--pdf-thumbnail-shadow:none}.theme-dark:not(.pdf-shadows-on) .pdf-viewer .page,.theme-dark:not(.pdf-shadows-on) .pdfViewer .page,.theme-light:not(.pdf-shadows-on) .pdf-viewer .page,.theme-light:not(.pdf-shadows-on) .pdfViewer .page{border:0}.theme-dark:not(.pdf-shadows-on) .pdf-sidebar-container .thumbnailSelectionRing,.theme-light:not(.pdf-shadows-on) .pdf-sidebar-container .thumbnailSelectionRing{padding:0}.theme-dark:not(.pdf-shadows-on) .pdf-sidebar-container .thumbnail::after,.theme-light:not(.pdf-shadows-on) .pdf-sidebar-container .thumbnail::after{right:var(--size-4-2);bottom:var(--size-4-2)}.theme-dark{--pdf-thumbnail-shadow:0 0 1px 0 rgba(0,0,0,0.6);--pdf-shadow:0 0 1px 0 rgba(0,0,0,0.6)}.theme-dark .pdf-viewer .canvasWrapper,.theme-dark .pdfViewer .canvasWrapper{opacity:var(--pdf-dark-opacity)}.theme-dark.pdf-invert-dark .workspace-leaf-content[data-type=pdf] .pdf-viewer .canvasWrapper,.theme-dark.pdf-invert-dark .workspace-leaf-content[data-type=pdf] .pdfViewer .canvasWrapper{filter:invert(1) hue-rotate(180deg);mix-blend-mode:screen}.theme-light.pdf-blend-light .workspace-leaf-content[data-type=pdf] .pdf-viewer .canvasWrapper,.theme-light.pdf-blend-light .workspace-leaf-content[data-type=pdf] .pdfViewer .canvasWrapper{mix-blend-mode:multiply}body{--table-header-border-width:0;--table-column-first-border-width:0;--table-column-last-border-width:0;--table-row-last-border-width:0;--table-edge-cell-padding-first:0;--table-edge-cell-padding-last:0;--table-cell-padding:4px 10px;--table-header-size:var(--table-text-size)}.markdown-source-view.mod-cm6 table{border-collapse:collapse}.markdown-rendered th{--table-header-size:var(--table-text-size)}.markdown-preview-view table,.markdown-source-view.mod-cm6 table{border:var(--border-width) solid var(--border-color);border-collapse:collapse}.markdown-preview-view td,.markdown-preview-view th,.markdown-source-view.mod-cm6 td,.markdown-source-view.mod-cm6 th{padding:var(--table-cell-padding)}.markdown-preview-view td:first-child,.markdown-preview-view th:first-child,.markdown-source-view.mod-cm6 td:first-child,.markdown-source-view.mod-cm6 th:first-child{padding-inline-start:var(--table-edge-cell-padding-first)}.markdown-preview-view td:first-child .table-cell-wrapper,.markdown-preview-view th:first-child .table-cell-wrapper,.markdown-source-view.mod-cm6 td:first-child .table-cell-wrapper,.markdown-source-view.mod-cm6 th:first-child .table-cell-wrapper{padding-inline-start:0}.markdown-preview-view td:last-child,.markdown-preview-view th:last-child,.markdown-source-view.mod-cm6 td:last-child,.markdown-source-view.mod-cm6 th:last-child{padding-inline-end:var(--table-edge-cell-padding-last)}.markdown-preview-view td:last-child .table-cell-wrapper,.markdown-preview-view th:last-child .table-cell-wrapper,.markdown-source-view.mod-cm6 td:last-child .table-cell-wrapper,.markdown-source-view.mod-cm6 th:last-child .table-cell-wrapper{padding-inline-end:0}.markdown-source-view.mod-cm6 .cm-table-widget table{margin-top:0}.markdown-source-view.mod-cm6 .cm-table-widget .table-cell-wrapper{padding:var(--table-cell-padding)}.markdown-reading-view table{--p-spacing:0.5rem}.cm-embed-block.cm-table-widget.markdown-rendered{padding:var(--table-drag-padding);overscroll-behavior-x:none}.is-mobile .cm-embed-block.cm-table-widget.markdown-rendered{padding-bottom:40px}.markdown-preview-view th,.markdown-source-view.mod-cm6 .dataview.table-view-table thead.table-view-thead tr th,.table-view-table>thead>tr>th{padding:var(--table-cell-padding)}.markdown-preview-view th:first-child,.markdown-source-view.mod-cm6 .dataview.table-view-table thead.table-view-thead tr th:first-child,.table-view-table>thead>tr>th:first-child{padding-inline-start:var(--table-edge-cell-padding-first)}.markdown-preview-view th:last-child,.markdown-source-view.mod-cm6 .dataview.table-view-table thead.table-view-thead tr th:last-child,.table-view-table>thead>tr>th:last-child{padding-inline-end:var(--table-edge-cell-padding-last)}.cm-hmd-table-sep-dummy,.cm-s-obsidian .HyperMD-table-row span.cm-hmd-table-sep{color:var(--text-faint);font-weight:400}body.minimal-unstyled-tags{--tag-background:transparent;--tag-background-hover:transparent;--tag-border-width:0px;--tag-padding-x:0;--tag-padding-y:0;--tag-size:inherit;--tag-color-hover:var(--text-accent-hover)}body.minimal-unstyled-tags.is-mobile.theme-dark{--tag-background:transparent}body:not(.minimal-unstyled-tags){--tag-size:0.8em;--tag-padding-y:0.2em;--tag-background:transparent;--tag-background-hover:transparent;--tag-color:var(--text-muted);--tag-border-width:1px;--tag-border-color:var(--background-modifier-border);--tag-border-color-hover:var(--background-modifier-border-hover);--tag-color-hover:var(--text-normal)}body.is-mobile.theme-dark{--tag-background:transparent}h1,h2,h3,h4{letter-spacing:-.02em}body,button,input{font-family:var(--font-interface)}.cm-s-obsidian span.cm-error{color:var(--color-red)}.markdown-preview-view,.popover,.workspace-leaf-content[data-type=markdown]{font-family:var(--font-text)}.markdown-preview-view,.view-content>.cm-s-obsidian,.view-content>.markdown-source-view.mod-cm6.is-live-preview>.cm-scroller,body{font-size:var(--font-adaptive-normal);font-weight:var(--normal-weight)}.view-content>.cm-s-obsidian,.view-content>.markdown-source-view,.view-content>.markdown-source-view.mod-cm6 .cm-scroller{font-family:var(--font-editor)}.cm-formatting:not(.cm-formatting-code-block):not(.cm-formatting-hashtag){color:var(--text-formatting)}.hide-markdown .is-live-preview .cm-formatting.cm-formatting-code.cm-inline-code,.hide-markdown .is-live-preview .cm-formatting.cm-formatting-em,.hide-markdown .is-live-preview .cm-formatting.cm-formatting-highlight,.hide-markdown .is-live-preview .cm-formatting.cm-formatting-link,.hide-markdown .is-live-preview .cm-formatting.cm-formatting-strikethrough,.hide-markdown .is-live-preview .cm-formatting.cm-formatting-strong{display:none}.hide-markdown .is-live-preview .cm-formatting-quote{opacity:0}.hide-markdown .is-live-preview .cm-formatting-header,.hide-markdown .is-live-preview .cm-formatting-link,.hide-markdown .is-live-preview .cm-hmd-internal-link.cm-link-has-alias,.hide-markdown .is-live-preview .cm-link-alias-pipe{display:none}.active-line-on .workspace-leaf-content[data-type=markdown] .cm-line.cm-active,.active-line-on .workspace-leaf-content[data-type=markdown] .markdown-source-view.mod-cm6.is-live-preview .HyperMD-quote.cm-active{background-color:var(--active-line-bg);box-shadow:-25vw 0 var(--active-line-bg),25vw 0 var(--active-line-bg)}.disable-animations{--ribbon-animation-duration:0ms;--focus-animation-duration:0ms}.disable-animations .mod-sidedock{transition-duration:0s!important}.fast-animations{--ribbon-animation-duration:0.05s;--focus-animation-duration:0.05s}.fast-animations .mod-sidedock{transition-duration:70ms!important}body{--content-margin:auto;--content-margin-start:max( calc(50% - var(--line-width)/2), calc(50% - var(--max-width)/2) );--content-line-width:min(var(--line-width), var(--max-width))}.markdown-preview-view .markdown-preview-sizer.markdown-preview-sizer{max-width:100%;margin-inline:auto;width:100%}.markdown-source-view.mod-cm6.is-readable-line-width .cm-content,.markdown-source-view.mod-cm6.is-readable-line-width .cm-sizer{max-width:100%;width:100%}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>div,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>div,.markdown-source-view.mod-cm6.is-readable-line-width .cm-sizer>.embedded-backlinks,.markdown-source-view.mod-cm6.is-readable-line-width .cm-sizer>.inline-title,.markdown-source-view.mod-cm6.is-readable-line-width .cm-sizer>.metadata-container{max-width:var(--max-width);width:var(--line-width);margin-inline:var(--content-margin)!important}.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>:not(div){max-width:var(--content-line-width);margin-inline-start:var(--content-margin-start)!important}.is-readable-line-width{--file-margins:1rem 0 0 0}.is-mobile .markdown-preview-view{--folding-offset:0}.minimal-line-nums .workspace-leaf-content[data-type=markdown]{--file-margins:var(--size-4-8) var(--size-4-8) var(--size-4-8) 48px}.minimal-line-nums .workspace-leaf-content[data-type=markdown].is-rtl{--file-margins:var(--size-4-8) 48px var(--size-4-8) var(--size-4-8)}.minimal-line-nums .workspace-leaf-content[data-type=markdown] .is-readable-line-width{--file-margins:1rem 0 0 var(--folding-offset)}.minimal-line-nums .workspace-leaf-content[data-type=markdown] .is-readable-line-width.is-rtl{--file-margins:1rem var(--folding-offset) 0 0}.minimal-line-nums .mod-left-split .markdown-preview-view,.minimal-line-nums .mod-left-split .markdown-source-view.mod-cm6 .cm-scroller,.minimal-line-nums .mod-right-split .markdown-preview-view,.minimal-line-nums .mod-right-split .markdown-source-view.mod-cm6 .cm-scroller{--file-margins:var(--size-4-5) var(--size-4-5) var(--size-4-5) 48px}.view-content .reader-mode-content.is-readable-line-width .markdown-preview-sizer{max-width:var(--max-width);width:var(--line-width)}.markdown-preview-view .inline-embed{--max-width:100%}body{--container-table-max-width:var(--max-width);--table-max-width:none;--table-width:auto;--table-margin:inherit;--table-wrapper-width:fit-content;--container-dataview-table-width:var(--line-width);--container-img-width:var(--line-width);--container-img-max-width:var(--max-width);--img-max-width:100%;--img-width:auto;--img-margin-start:var(--content-margin-start);--img-line-width:var(--content-line-width);--container-chart-width:var(--line-width);--container-chart-max-width:var(--max-width);--chart-max-width:none;--chart-width:auto;--container-map-width:var(--line-width);--container-map-max-width:var(--max-width);--map-max-width:none;--map-width:auto;--container-iframe-width:var(--line-width);--container-iframe-max-width:var(--max-width);--iframe-max-width:none;--iframe-width:auto}body .wide{--line-width:var(--line-width-wide);--container-table-width:var(--line-width-wide);--container-dataview-table-width:var(--line-width-wide);--container-img-width:var(--line-width-wide);--container-iframe-width:var(--line-width-wide);--container-map-width:var(--line-width-wide);--container-chart-width:var(--line-width-wide)}body .max{--line-width:var(--max-width);--container-table-width:var(--max-width);--container-dataview-table-width:var(--max-width);--container-img-width:var(--max-width);--container-iframe-width:var(--max-width);--container-map-width:var(--max-width);--container-chart-width:var(--max-width)}table.dataview{--table-min-width:min(var(--line-width),var(--max-width))}.cards table.dataview{--table-width:100%;--table-min-width:none}body{--table-drag-space:16px;--container-table-margin:calc(var(--content-margin-start) - var(--table-drag-space));--container-table-width:calc(var(--line-width) + var(--table-drag-space)*2);--table-drag-padding:var(--table-drag-space)}.is-mobile{--table-drag-space:16px;--container-table-max-width:calc(100% - var(--container-table-margin))}.maximize-tables-auto{--container-table-max-width:100%;--container-table-width:100%;--container-dataview-table-width:100%;--container-table-margin:0;--table-drag-padding:var(--table-drag-space) 0;--table-max-width:100%;--table-margin:var(--content-margin-start) auto;--table-width:auto}.maximize-tables-auto .cards{--container-table-max-width:var(--max-width)}.maximize-tables-auto .cards .block-language-dataview{--table-margin:auto}.maximize-tables{--container-table-max-width:100%;--container-table-width:100%;--container-table-margin:0;--table-drag-padding:var(--table-drag-space) 0;--table-min-width:min(var(--line-width), var(--max-width));--table-max-width:100%;--table-margin:auto;--table-width:auto;--table-edge-cell-padding-first:8px;--table-edge-cell-padding-last:8px;--table-wrapper-width:auto}.table-100,.table-max,.table-wide{--table-max-width:100%;--table-width:100%}.table-wide{--container-table-width:var(--line-width-wide);--container-dataview-table-width:var(--line-width-wide);--container-table-margin:auto;--table-edge-cell-padding-first:0px}.table-max{--container-table-width:var(--max-width);--container-table-max-width:calc(var(--max-width) + var(--table-drag-space)*2);--container-dataview-table-width:var(--max-width);--container-table-margin:auto;--table-edge-cell-padding-first:0px;--table-margin:0}.table-100{--container-table-width:100%;--container-dataview-table-width:100%;--container-table-max-width:100%;--container-table-margin:0;--table-edge-cell-padding-first:16px;--table-edge-cell-padding-last:16px;--table-margin:0;--table-drag-padding:var(--table-drag-space) 0;--table-wrapper-width:min(fit-content, 100%);--bases-cards-embed-padding:0 12px;--bases-header-padding-end:var(--size-4-2);--bases-header-padding-start:var(--size-4-2)}.table-100 .bases-view[data-view-type=table]{--bases-embed-border-width:0}.table-100 .table-col-btn{cursor:default!important;margin-top:8px;height:var(--table-header-size);inset-inline-start:calc(100% - var(--table-drag-handle-size) - 4px)!important}.table-100 .markdown-source-view.mod-cm6,.table-100.markdown-source-view.mod-cm6{--table-drag-handle-background-active:transparent}.table-100 .markdown-source-view.mod-cm6 .cm-table-widget .table-row-drag-handle,.table-100.markdown-source-view.mod-cm6 .cm-table-widget .table-row-drag-handle{inset-inline-end:calc(100% - var(--table-drag-handle-size))!important}.img-100,.img-max,.img-wide{--img-max-width:100%;--img-width:100%}.img-wide{--container-img-width:var(--line-width-wide);--img-line-width:var(--line-width-wide);--img-margin-start:calc(50% - var(--line-width-wide)/2)}.img-max{--container-img-width:var(--max-width);--img-line-width:var(--max-width);--img-margin-start:calc(50% - var(--max-width)/2)}.img-100{--container-img-width:100%;--container-img-max-width:100%;--img-line-width:100%;--img-margin-start:0}.map-100,.map-max,.map-wide{--map-max-width:100%;--map-width:100%}.map-wide{--container-map-width:var(--line-width-wide)}.map-max{--container-map-width:var(--max-width)}.map-100{--container-map-width:100%;--container-map-max-width:100%}.chart-100,.chart-max,.chart-wide{--chart-max-width:100%;--chart-width:100%}.chart-wide{--container-chart-width:var(--line-width-wide)}.chart-max{--container-chart-width:var(--max-width)}.chart-100{--container-chart-width:100%;--container-chart-max-width:100%}.iframe-100,.iframe-max,.iframe-wide{--iframe-max-width:100%;--iframe-width:100%}.iframe-wide{--container-iframe-width:var(--line-width-wide)}.iframe-max{--container-iframe-width:var(--max-width)}.iframe-100{--container-iframe-width:100%;--container-iframe-max-width:100%}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer .cm-table-widget,.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>div:has(table),.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content .cm-table-widget,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>div:has(table){width:var(--container-table-width);max-width:var(--container-table-max-width);margin-inline:var(--container-table-margin)!important;padding-inline-start:var(--table-drag-padding)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer .el-table,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content .el-table{margin-inline:var(--container-table-margin)!important;padding-inline-start:var(--table-drag-padding)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer .table-wrapper,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content .table-wrapper{width:var(--table-wrapper-width)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.bases-embed,.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>:has(>.block-language-dataview table),.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>:has(>.block-language-dataviewjs table),.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>div:has(.bases-embed),.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>div:has(.block-language-base),.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>.bases-embed,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>:has(>.block-language-dataview table),.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>:has(>.block-language-dataviewjs table),.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>div:has(.bases-embed),.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>div:has(.block-language-base){width:var(--container-dataview-table-width);max-width:var(--container-table-max-width)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer table,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content table{width:var(--table-width);max-width:var(--table-max-width);margin-inline:var(--table-margin);min-width:var(--table-min-width)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer .block-language-dataviewjs>:is(p,h1,h2,h3,h4,h5,h6),.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content .block-language-dataviewjs>:is(p,h1,h2,h3,h4,h5,h6){width:var(--line-width);margin-inline:var(--content-margin)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer .block-language-dataviewjs>.dataview-error,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content .block-language-dataviewjs>.dataview-error{margin:0 auto;width:var(--content-line-width)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer .dataview.dataview-error-box,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content .dataview.dataview-error-box{margin-inline:var(--table-margin)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.image-embed,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>.image-embed{padding-top:.25rem;padding-bottom:.25rem}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.image-embed,.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>div:has(.image-embed),.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>.image-embed,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>div:has(.image-embed){width:var(--container-img-width);max-width:var(--container-img-max-width)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.image-embed img,.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>div:has(.image-embed) img,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>.image-embed img,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>div:has(.image-embed) img{max-width:var(--img-max-width)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>img,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>img{max-width:var(--img-line-width);margin-inline-start:var(--img-margin-start)!important}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer div:has(>.block-language-dataviewjs canvas,>.block-language-chart),.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content div:has(>.block-language-dataviewjs canvas,>.block-language-chart){width:var(--container-chart-width);max-width:var(--container-chart-max-width)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer div:has(>.block-language-dataviewjs canvas,>.block-language-chart) canvas,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content div:has(>.block-language-dataviewjs canvas,>.block-language-chart) canvas{max-width:var(--chart-max-width)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer div:has(>.block-language-leaflet),.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content div:has(>.block-language-leaflet){width:var(--container-map-width);max-width:var(--container-map-max-width)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer div:has(>.block-language-leaflet) iframe,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content div:has(>.block-language-leaflet) iframe{max-width:var(--map-max-width)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer div:has(>.cm-html-embed),.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>div:has(>iframe),.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content div:has(>.cm-html-embed),.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>div:has(>iframe){width:var(--container-iframe-width);max-width:var(--container-iframe-max-width)}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer div:has(>.cm-html-embed) iframe,.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>div:has(>iframe) iframe,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content div:has(>.cm-html-embed) iframe,.markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer.cm-contentContainer>.cm-content>div:has(>iframe) iframe{max-width:var(--iframe-max-width)}.borders-none{--divider-width:0px;--tab-outline-width:0px}body:is(.borders-none) .mod-root .workspace-tab-header-container:is(div,:hover){--tab-outline-width:0px}body{--cards-min-width:180px;--cards-max-width:1fr;--cards-mobile-width:120px;--cards-image-height:400px;--cards-padding:1.2em;--cards-image-fit:contain;--cards-background:transparent;--cards-background-hover:transparent;--cards-border-width:1px;--cards-aspect-ratio:auto;--cards-columns:repeat(auto-fit, minmax(var(--cards-min-width), var(--cards-max-width)))}@media(max-width:400pt){body{--cards-min-width:var(--cards-mobile-width)}}.cards.table-100 table.dataview tbody,.table-100 .cards table.dataview tbody{padding:.25rem .75rem}.cards table.dataview{--table-width:100%;--table-edge-cell-padding-first:calc(var(--cards-padding)/2);--table-edge-cell-padding-last:calc(var(--cards-padding)/2);--table-cell-padding:calc(var(--cards-padding)/3) calc(var(--cards-padding)/2);line-height:1.3}.cards table.dataview tbody{clear:both;padding:.5rem 0;display:grid;grid-template-columns:var(--cards-columns);grid-column-gap:.75rem;grid-row-gap:.75rem}.cards table.dataview>tbody>tr{background-color:var(--cards-background);border:var(--cards-border-width) solid var(--background-modifier-border);display:flex;flex-direction:column;margin:0;padding:0 0 calc(var(--cards-padding)/3) 0;border-radius:6px;overflow:hidden;transition:box-shadow .15s linear;max-width:var(--cards-max-width);height:auto}.cards table.dataview>tbody>tr:hover{background-color:var(--cards-background-hover)!important;border:var(--cards-border-width) solid var(--background-modifier-border-hover);box-shadow:0 4px 6px 0 rgba(0,0,0,.05),0 1px 3px 1px rgba(0,0,0,.025);transition:box-shadow .15s linear}.cards table.dataview tbody>tr>td:first-child{font-weight:var(--bold-weight);border:none}.cards table.dataview tbody>tr>td:first-child a{display:block}.cards table.dataview tbody>tr>td:last-child{border:none}.cards table.dataview tbody>tr>td:not(:first-child){font-size:calc(var(--table-text-size)*.9);color:var(--text-muted)}.cards table.dataview tbody>tr>td>*{padding:calc(var(--cards-padding)/3) 0}.cards table.dataview tbody>tr>td:not(:last-child):not(:first-child){padding:4px 0;border-bottom:1px solid var(--background-modifier-border);width:calc(100% - var(--cards-padding));margin:0 calc(var(--cards-padding)/2)}.cards table.dataview tbody>tr>td a{text-decoration:none}.cards table.dataview tbody>tr>td>button{width:100%;margin:calc(var(--cards-padding)/2) 0}.cards table.dataview tbody>tr>td:last-child>button{margin-bottom:calc(var(--cards-padding)/6)}.cards table.dataview tbody>tr>td>ul{width:100%;padding:.25em 0!important;margin:0 auto!important}.cards table.dataview tbody>tr>td img{aspect-ratio:var(--cards-aspect-ratio);width:100%;object-fit:var(--cards-image-fit);max-height:var(--cards-image-height);background-color:var(--background-secondary);vertical-align:bottom}.markdown-source-view.mod-cm6.cards .dataview.table-view-table>tbody>tr>td,.trim-cols .cards table.dataview tbody>tr>td{white-space:normal}.links-int-on .cards table{--link-decoration:none}.markdown-source-view.mod-cm6.cards .edit-block-button{top:-1px;right:28px;opacity:1}.cards.table-100 table.dataview thead>tr,.table-100 .cards table.dataview thead>tr{right:.75rem}.cards.table-100 table.dataview thead:before,.table-100 .cards table.dataview thead:before{margin-right:.75rem}.cards table.dataview thead{user-select:none;width:180px;display:block;float:right;position:relative;text-align:right;height:24px;padding-bottom:0}.cards table.dataview thead:hover:after{background-color:var(--background-modifier-hover)}.cards table.dataview thead:hover:before{background-color:var(--text-muted)}.cards table.dataview thead:after,.cards table.dataview thead:before{content:"";position:absolute;right:0;top:0;width:10px;height:16px;cursor:var(--cursor);text-align:right;padding:var(--size-4-1) var(--size-4-2);margin-bottom:2px;border-radius:var(--radius-s);font-weight:500;font-size:var(--font-adaptive-small)}.cards table.dataview thead:before{background-color:var(--text-faint);-webkit-mask-repeat:no-repeat;-webkit-mask-size:16px;-webkit-mask-position:center center;-webkit-mask-image:url('data:image/svg+xml;utf8,')}.cards table.dataview thead>tr{top:-1px;position:absolute;display:none;z-index:9;border:1px solid var(--background-modifier-border-hover);background-color:var(--background-secondary);box-shadow:var(--shadow-s);padding:6px;border-radius:var(--radius-m);flex-direction:column;margin:24px 0 0 0;width:100%}.cards table.dataview thead:hover>tr{display:flex;height:auto}.cards table.dataview thead>tr>th{display:block;padding:3px 30px 3px 6px!important;border-radius:var(--radius-s);width:100%;font-weight:400;color:var(--text-normal);cursor:var(--cursor);border:none;font-size:var(--font-ui-small)}.cards table.dataview thead>tr>th[sortable-style=sortable-asc],.cards table.dataview thead>tr>th[sortable-style=sortable-desc]{color:var(--text-normal)}.cards table.dataview thead>tr>th:hover{color:var(--text-normal);background-color:var(--background-modifier-hover)}.list-cards.markdown-preview-view .list-bullet,.list-cards.markdown-preview-view .list-collapse-indicator,.list-cards.markdown-preview-view.markdown-rendered.show-indentation-guide li>ul::before{display:none}.list-cards.markdown-preview-view div>ul{display:grid;gap:.75rem;grid-template-columns:var(--cards-columns);padding:0;line-height:var(--line-height-tight)}.list-cards.markdown-preview-view div>ul .contains-task-list{padding-inline-start:calc(var(--cards-padding)*1.5)}.list-cards.markdown-preview-view div>ul>li.task-list-item>.task-list-item-checkbox{margin-inline-start:3px}.list-cards.markdown-preview-view div>ul>li{background-color:var(--cards-background);padding:calc(var(--cards-padding)/2);border-radius:var(--radius-s);border:var(--cards-border-width) solid var(--background-modifier-border);overflow:hidden;margin-inline-start:0}.list-cards.markdown-preview-view div>ul .image-embed{padding:0;display:block;background-color:var(--background-secondary);border-radius:var(--image-radius)}.list-cards.markdown-preview-view div>ul .image-embed img{aspect-ratio:var(--cards-aspect-ratio);object-fit:var(--cards-image-fit);max-height:var(--cards-image-height);background-color:var(--background-secondary);vertical-align:bottom}.list-cards.markdown-preview-view div>ul>li>a{--link-decoration:none;--link-external-decoration:none;font-weight:var(--bold-weight)}.list-cards.markdown-preview-view div ul>li:hover{border-color:var(--background-modifier-border-hover)}.list-cards.markdown-preview-view div ul ul{display:block;width:100%;color:var(--text-muted);font-size:var(--font-smallest);margin:calc(var(--cards-padding)/-4) 0;padding:calc(var(--cards-padding)/2) 0}.list-cards.markdown-preview-view div ul ul ul{padding-bottom:calc(var(--cards-padding)/4)}.list-cards.markdown-preview-view div ul ul>li{display:block;margin-inline-start:0}.cards.cards-16-9,.list-cards.cards-16-9{--cards-aspect-ratio:16/9}.cards.cards-1-1,.list-cards.cards-1-1{--cards-aspect-ratio:1/1}.cards.cards-2-1,.list-cards.cards-2-1{--cards-aspect-ratio:2/1}.cards.cards-2-3,.list-cards.cards-2-3{--cards-aspect-ratio:2/3}.cards.cards-cols-1,.list-cards.cards-cols-1{--cards-columns:repeat(1, minmax(0, 1fr))}.cards.cards-cols-2,.list-cards.cards-cols-2{--cards-columns:repeat(2, minmax(0, 1fr))}.cards.cards-cover,.list-cards.cards-cover{--cards-image-fit:cover}.cards.cards-cover tbody>tr>td:first-child,.list-cards.cards-cover tbody>tr>td:first-child{padding:0!important;background-color:var(--background-secondary);display:block;margin:0;width:100%}.cards.cards-cover tbody>tr>td:first-child img,.list-cards.cards-cover tbody>tr>td:first-child img{border-radius:0}.cards.cards-align-bottom table.dataview tbody>tr>td:last-child,.list-cards.cards-align-bottom table.dataview tbody>tr>td:last-child{margin-top:auto}@media(max-width:400pt){.cards table.dataview tbody>tr>td:not(:first-child){font-size:80%}}@media(min-width:400pt){.cards-cols-3{--cards-columns:repeat(3, minmax(0, 1fr))}.cards-cols-4{--cards-columns:repeat(4, minmax(0, 1fr))}.cards-cols-5{--cards-columns:repeat(5, minmax(0, 1fr))}.cards-cols-6{--cards-columns:repeat(6, minmax(0, 1fr))}.cards-cols-7{--cards-columns:repeat(7, minmax(0, 1fr))}.cards-cols-8{--cards-columns:repeat(8, minmax(0, 1fr))}}.cm-formatting.cm-formatting-task.cm-property{font-family:var(--font-monospace)}input[data-task="!"]:checked,input[data-task="*"]:checked,input[data-task="-"]:checked,input[data-task="<"]:checked,input[data-task=">"]:checked,input[data-task=I]:checked,input[data-task=b]:checked,input[data-task=c]:checked,input[data-task=d]:checked,input[data-task=f]:checked,input[data-task=k]:checked,input[data-task=l]:checked,input[data-task=p]:checked,input[data-task=u]:checked,input[data-task=w]:checked,li[data-task="!"]>input:checked,li[data-task="!"]>p>input:checked,li[data-task="*"]>input:checked,li[data-task="*"]>p>input:checked,li[data-task="-"]>input:checked,li[data-task="-"]>p>input:checked,li[data-task="<"]>input:checked,li[data-task="<"]>p>input:checked,li[data-task=">"]>input:checked,li[data-task=">"]>p>input:checked,li[data-task=I]>input:checked,li[data-task=I]>p>input:checked,li[data-task=b]>input:checked,li[data-task=b]>p>input:checked,li[data-task=c]>input:checked,li[data-task=c]>p>input:checked,li[data-task=d]>input:checked,li[data-task=d]>p>input:checked,li[data-task=f]>input:checked,li[data-task=f]>p>input:checked,li[data-task=k]>input:checked,li[data-task=k]>p>input:checked,li[data-task=l]>input:checked,li[data-task=l]>p>input:checked,li[data-task=p]>input:checked,li[data-task=p]>p>input:checked,li[data-task=u]>input:checked,li[data-task=u]>p>input:checked,li[data-task=w]>input:checked,li[data-task=w]>p>input:checked{--checkbox-marker-color:transparent;border:none;border-radius:0;background-image:none;background-color:currentColor;-webkit-mask-size:var(--checkbox-icon);-webkit-mask-position:50% 50%}input[data-task=">"]:checked,li[data-task=">"]>input:checked,li[data-task=">"]>p>input:checked{color:var(--text-faint);transform:rotate(90deg);-webkit-mask-position:50% 100%;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath d='M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z' /%3E%3C/svg%3E")}input[data-task="<"]:checked,li[data-task="<"]>input:checked,li[data-task="<"]>p>input:checked{color:var(--text-faint);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z' clip-rule='evenodd' /%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task="?"]:checked,li[data-task="?"]>input:checked,li[data-task="?"]>p>input:checked{--checkbox-marker-color:transparent;background-color:var(--color-yellow);border-color:var(--color-yellow);background-position:50% 50%;background-size:200% 90%;background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"%3E%3Cpath fill="white" fill-rule="evenodd" d="M4.475 5.458c-.284 0-.514-.237-.47-.517C4.28 3.24 5.576 2 7.825 2c2.25 0 3.767 1.36 3.767 3.215c0 1.344-.665 2.288-1.79 2.973c-1.1.659-1.414 1.118-1.414 2.01v.03a.5.5 0 0 1-.5.5h-.77a.5.5 0 0 1-.5-.495l-.003-.2c-.043-1.221.477-2.001 1.645-2.712c1.03-.632 1.397-1.135 1.397-2.028c0-.979-.758-1.698-1.926-1.698c-1.009 0-1.71.529-1.938 1.402c-.066.254-.278.461-.54.461h-.777ZM7.496 14c.622 0 1.095-.474 1.095-1.09c0-.618-.473-1.092-1.095-1.092c-.606 0-1.087.474-1.087 1.091S6.89 14 7.496 14Z"%2F%3E%3C%2Fsvg%3E')}.theme-dark input[data-task="?"]:checked,.theme-dark li[data-task="?"]>input:checked,.theme-dark li[data-task="?"]>p>input:checked{background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"%3E%3Cpath fill="black" fill-opacity="0.8" fill-rule="evenodd" d="M4.475 5.458c-.284 0-.514-.237-.47-.517C4.28 3.24 5.576 2 7.825 2c2.25 0 3.767 1.36 3.767 3.215c0 1.344-.665 2.288-1.79 2.973c-1.1.659-1.414 1.118-1.414 2.01v.03a.5.5 0 0 1-.5.5h-.77a.5.5 0 0 1-.5-.495l-.003-.2c-.043-1.221.477-2.001 1.645-2.712c1.03-.632 1.397-1.135 1.397-2.028c0-.979-.758-1.698-1.926-1.698c-1.009 0-1.71.529-1.938 1.402c-.066.254-.278.461-.54.461h-.777ZM7.496 14c.622 0 1.095-.474 1.095-1.09c0-.618-.473-1.092-1.095-1.092c-.606 0-1.087.474-1.087 1.091S6.89 14 7.496 14Z"%2F%3E%3C%2Fsvg%3E')}input[data-task="/"]:checked,li[data-task="/"]>input:checked,li[data-task="/"]>p>input:checked{background-image:none;background-color:rgba(0,0,0,0);position:relative;overflow:hidden}input[data-task="/"]:checked:after,li[data-task="/"]>input:checked:after,li[data-task="/"]>p>input:checked:after{top:0;left:0;content:" ";display:block;position:absolute;background-color:var(--background-modifier-accent);width:calc(50% - .5px);height:100%;-webkit-mask-image:none}input[data-task="!"]:checked,li[data-task="!"]>input:checked,li[data-task="!"]>p>input:checked{color:var(--color-orange);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task='"']:checked,input[data-task=“]:checked,li[data-task='"']>input:checked,li[data-task='"']>p>input:checked,li[data-task=“]>input:checked,li[data-task=“]>p>input:checked{--checkbox-marker-color:transparent;background-position:50% 50%;background-color:var(--color-cyan);border-color:var(--color-cyan);background-size:75%;background-repeat:no-repeat;background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"%3E%3Cpath fill="white" d="M6.5 10c-.223 0-.437.034-.65.065c.069-.232.14-.468.254-.68c.114-.308.292-.575.469-.844c.148-.291.409-.488.601-.737c.201-.242.475-.403.692-.604c.213-.21.492-.315.714-.463c.232-.133.434-.28.65-.35l.539-.222l.474-.197l-.485-1.938l-.597.144c-.191.048-.424.104-.689.171c-.271.05-.56.187-.882.312c-.318.142-.686.238-1.028.466c-.344.218-.741.4-1.091.692c-.339.301-.748.562-1.05.945c-.33.358-.656.734-.909 1.162c-.293.408-.492.856-.702 1.299c-.19.443-.343.896-.468 1.336c-.237.882-.343 1.72-.384 2.437c-.034.718-.014 1.315.028 1.747c.015.204.043.402.063.539l.025.168l.026-.006A4.5 4.5 0 1 0 6.5 10zm11 0c-.223 0-.437.034-.65.065c.069-.232.14-.468.254-.68c.114-.308.292-.575.469-.844c.148-.291.409-.488.601-.737c.201-.242.475-.403.692-.604c.213-.21.492-.315.714-.463c.232-.133.434-.28.65-.35l.539-.222l.474-.197l-.485-1.938l-.597.144c-.191.048-.424.104-.689.171c-.271.05-.56.187-.882.312c-.317.143-.686.238-1.028.467c-.344.218-.741.4-1.091.692c-.339.301-.748.562-1.05.944c-.33.358-.656.734-.909 1.162c-.293.408-.492.856-.702 1.299c-.19.443-.343.896-.468 1.336c-.237.882-.343 1.72-.384 2.437c-.034.718-.014 1.315.028 1.747c.015.204.043.402.063.539l.025.168l.026-.006A4.5 4.5 0 1 0 17.5 10z"%2F%3E%3C%2Fsvg%3E')}.theme-dark input[data-task='"']:checked,.theme-dark input[data-task=“]:checked,.theme-dark li[data-task='"']>input:checked,.theme-dark li[data-task='"']>p>input:checked,.theme-dark li[data-task=“]>input:checked,.theme-dark li[data-task=“]>p>input:checked{background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"%3E%3Cpath fill="black" fill-opacity="0.7" d="M6.5 10c-.223 0-.437.034-.65.065c.069-.232.14-.468.254-.68c.114-.308.292-.575.469-.844c.148-.291.409-.488.601-.737c.201-.242.475-.403.692-.604c.213-.21.492-.315.714-.463c.232-.133.434-.28.65-.35l.539-.222l.474-.197l-.485-1.938l-.597.144c-.191.048-.424.104-.689.171c-.271.05-.56.187-.882.312c-.318.142-.686.238-1.028.466c-.344.218-.741.4-1.091.692c-.339.301-.748.562-1.05.945c-.33.358-.656.734-.909 1.162c-.293.408-.492.856-.702 1.299c-.19.443-.343.896-.468 1.336c-.237.882-.343 1.72-.384 2.437c-.034.718-.014 1.315.028 1.747c.015.204.043.402.063.539l.025.168l.026-.006A4.5 4.5 0 1 0 6.5 10zm11 0c-.223 0-.437.034-.65.065c.069-.232.14-.468.254-.68c.114-.308.292-.575.469-.844c.148-.291.409-.488.601-.737c.201-.242.475-.403.692-.604c.213-.21.492-.315.714-.463c.232-.133.434-.28.65-.35l.539-.222l.474-.197l-.485-1.938l-.597.144c-.191.048-.424.104-.689.171c-.271.05-.56.187-.882.312c-.317.143-.686.238-1.028.467c-.344.218-.741.4-1.091.692c-.339.301-.748.562-1.05.944c-.33.358-.656.734-.909 1.162c-.293.408-.492.856-.702 1.299c-.19.443-.343.896-.468 1.336c-.237.882-.343 1.72-.384 2.437c-.034.718-.014 1.315.028 1.747c.015.204.043.402.063.539l.025.168l.026-.006A4.5 4.5 0 1 0 17.5 10z"%2F%3E%3C%2Fsvg%3E')}input[data-task="-"]:checked,li[data-task="-"]>input:checked,li[data-task="-"]>p>input:checked{color:var(--text-faint);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z' clip-rule='evenodd' /%3E%3C/svg%3E")}body:not(.tasks) .markdown-preview-view ul li[data-task="-"].task-list-item.is-checked,body:not(.tasks) .markdown-source-view.mod-cm6 .HyperMD-task-line[data-task]:is([data-task="-"]),body:not(.tasks) li[data-task="-"].task-list-item.is-checked{color:var(--text-faint);text-decoration:line-through solid var(--text-faint) 1px}input[data-task="*"]:checked,li[data-task="*"]>input:checked,li[data-task="*"]>p>input:checked{color:var(--color-yellow);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath d='M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z' /%3E%3C/svg%3E")}input[data-task=l]:checked,li[data-task=l]>input:checked,li[data-task=l]>p>input:checked{color:var(--color-red);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task=i]:checked,li[data-task=i]>input:checked,li[data-task=i]>p>input:checked{--checkbox-marker-color:transparent;background-color:var(--color-blue);border-color:var(--color-blue);background-position:50%;background-size:100%;background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512"%3E%3Cpath fill="none" stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="40" d="M196 220h64v172"%2F%3E%3Cpath fill="none" stroke="white" stroke-linecap="round" stroke-miterlimit="10" stroke-width="40" d="M187 396h138"%2F%3E%3Cpath fill="white" d="M256 160a32 32 0 1 1 32-32a32 32 0 0 1-32 32Z"%2F%3E%3C%2Fsvg%3E')}.theme-dark input[data-task=i]:checked,.theme-dark li[data-task=i]>input:checked,.theme-dark li[data-task=i]>p>input:checked{background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512"%3E%3Cpath fill="none" stroke="black" stroke-opacity="0.8" stroke-linecap="round" stroke-linejoin="round" stroke-width="40" d="M196 220h64v172"%2F%3E%3Cpath fill="none" stroke="black" stroke-opacity="0.8" stroke-linecap="round" stroke-miterlimit="10" stroke-width="40" d="M187 396h138"%2F%3E%3Cpath fill="black" fill-opacity="0.8" d="M256 160a32 32 0 1 1 32-32a32 32 0 0 1-32 32Z"%2F%3E%3C%2Fsvg%3E')}input[data-task=S]:checked,li[data-task=S]>input:checked,li[data-task=S]>p>input:checked{--checkbox-marker-color:transparent;border-color:var(--color-green);background-color:var(--color-green);background-size:100%;background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 48 48"%3E%3Cpath fill="white" fill-rule="evenodd" d="M26 8a2 2 0 1 0-4 0v2a8 8 0 1 0 0 16v8a4.002 4.002 0 0 1-3.773-2.666a2 2 0 0 0-3.771 1.332A8.003 8.003 0 0 0 22 38v2a2 2 0 1 0 4 0v-2a8 8 0 1 0 0-16v-8a4.002 4.002 0 0 1 3.773 2.666a2 2 0 0 0 3.771-1.332A8.003 8.003 0 0 0 26 10V8Zm-4 6a4 4 0 0 0 0 8v-8Zm4 12v8a4 4 0 0 0 0-8Z" clip-rule="evenodd"%2F%3E%3C%2Fsvg%3E')}.theme-dark input[data-task=S]:checked,.theme-dark li[data-task=S]>input:checked,.theme-dark li[data-task=S]>p>input:checked{background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 48 48"%3E%3Cpath fill-opacity="0.8" fill="black" fill-rule="evenodd" d="M26 8a2 2 0 1 0-4 0v2a8 8 0 1 0 0 16v8a4.002 4.002 0 0 1-3.773-2.666a2 2 0 0 0-3.771 1.332A8.003 8.003 0 0 0 22 38v2a2 2 0 1 0 4 0v-2a8 8 0 1 0 0-16v-8a4.002 4.002 0 0 1 3.773 2.666a2 2 0 0 0 3.771-1.332A8.003 8.003 0 0 0 26 10V8Zm-4 6a4 4 0 0 0 0 8v-8Zm4 12v8a4 4 0 0 0 0-8Z" clip-rule="evenodd"%2F%3E%3C%2Fsvg%3E')}input[data-task=I]:checked,li[data-task=I]>input:checked,li[data-task=I]>p>input:checked{color:var(--color-yellow);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath d='M11 3a1 1 0 10-2 0v1a1 1 0 102 0V3zM15.657 5.757a1 1 0 00-1.414-1.414l-.707.707a1 1 0 001.414 1.414l.707-.707zM18 10a1 1 0 01-1 1h-1a1 1 0 110-2h1a1 1 0 011 1zM5.05 6.464A1 1 0 106.464 5.05l-.707-.707a1 1 0 00-1.414 1.414l.707.707zM5 10a1 1 0 01-1 1H3a1 1 0 110-2h1a1 1 0 011 1zM8 16v-1h4v1a2 2 0 11-4 0zM12 14c.015-.34.208-.646.477-.859a4 4 0 10-4.954 0c.27.213.462.519.476.859h4.002z' /%3E%3C/svg%3E")}input[data-task=f]:checked,li[data-task=f]>input:checked,li[data-task=f]>p>input:checked{color:var(--color-red);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M12.395 2.553a1 1 0 00-1.45-.385c-.345.23-.614.558-.822.88-.214.33-.403.713-.57 1.116-.334.804-.614 1.768-.84 2.734a31.365 31.365 0 00-.613 3.58 2.64 2.64 0 01-.945-1.067c-.328-.68-.398-1.534-.398-2.654A1 1 0 005.05 6.05 6.981 6.981 0 003 11a7 7 0 1011.95-4.95c-.592-.591-.98-.985-1.348-1.467-.363-.476-.724-1.063-1.207-2.03zM12.12 15.12A3 3 0 017 13s.879.5 2.5.5c0-1 .5-4 1.25-4.5.5 1 .786 1.293 1.371 1.879A2.99 2.99 0 0113 13a2.99 2.99 0 01-.879 2.121z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task=k]:checked,li[data-task=k]>input:checked,li[data-task=k]>p>input:checked{color:var(--color-yellow);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task=u]:checked,li[data-task=u]>input:checked,li[data-task=u]>p>input:checked{color:var(--color-green);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M12 7a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0V8.414l-4.293 4.293a1 1 0 01-1.414 0L8 10.414l-4.293 4.293a1 1 0 01-1.414-1.414l5-5a1 1 0 011.414 0L11 10.586 14.586 7H12z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task=d]:checked,li[data-task=d]>input:checked,li[data-task=d]>p>input:checked{color:var(--color-red);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M12 13a1 1 0 100 2h5a1 1 0 001-1V9a1 1 0 10-2 0v2.586l-4.293-4.293a1 1 0 00-1.414 0L8 9.586 3.707 5.293a1 1 0 00-1.414 1.414l5 5a1 1 0 001.414 0L11 9.414 14.586 13H12z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task=w]:checked,li[data-task=w]>input:checked,li[data-task=w]>p>input:checked{color:var(--color-purple);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M6 3a1 1 0 011-1h.01a1 1 0 010 2H7a1 1 0 01-1-1zm2 3a1 1 0 00-2 0v1a2 2 0 00-2 2v1a2 2 0 00-2 2v.683a3.7 3.7 0 011.055.485 1.704 1.704 0 001.89 0 3.704 3.704 0 014.11 0 1.704 1.704 0 001.89 0 3.704 3.704 0 014.11 0 1.704 1.704 0 001.89 0A3.7 3.7 0 0118 12.683V12a2 2 0 00-2-2V9a2 2 0 00-2-2V6a1 1 0 10-2 0v1h-1V6a1 1 0 10-2 0v1H8V6zm10 8.868a3.704 3.704 0 01-4.055-.036 1.704 1.704 0 00-1.89 0 3.704 3.704 0 01-4.11 0 1.704 1.704 0 00-1.89 0A3.704 3.704 0 012 14.868V17a1 1 0 001 1h14a1 1 0 001-1v-2.132zM9 3a1 1 0 011-1h.01a1 1 0 110 2H10a1 1 0 01-1-1zm3 0a1 1 0 011-1h.01a1 1 0 110 2H13a1 1 0 01-1-1z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task=p]:checked,li[data-task=p]>input:checked,li[data-task=p]>p>input:checked{color:var(--color-green);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath d='M2 10.5a1.5 1.5 0 113 0v6a1.5 1.5 0 01-3 0v-6zM6 10.333v5.43a2 2 0 001.106 1.79l.05.025A4 4 0 008.943 18h5.416a2 2 0 001.962-1.608l1.2-6A2 2 0 0015.56 8H12V4a2 2 0 00-2-2 1 1 0 00-1 1v.667a4 4 0 01-.8 2.4L6.8 7.933a4 4 0 00-.8 2.4z' /%3E%3C/svg%3E")}input[data-task=c]:checked,li[data-task=c]>input:checked,li[data-task=c]>p>input:checked{color:var(--color-orange);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath d='M18 9.5a1.5 1.5 0 11-3 0v-6a1.5 1.5 0 013 0v6zM14 9.667v-5.43a2 2 0 00-1.105-1.79l-.05-.025A4 4 0 0011.055 2H5.64a2 2 0 00-1.962 1.608l-1.2 6A2 2 0 004.44 12H8v4a2 2 0 002 2 1 1 0 001-1v-.667a4 4 0 01.8-2.4l1.4-1.866a4 4 0 00.8-2.4z' /%3E%3C/svg%3E")}input[data-task=b]:checked,li[data-task=b]>input:checked,li[data-task=b]>p>input:checked{color:var(--color-orange);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath d='M5 4a2 2 0 012-2h6a2 2 0 012 2v14l-5-2.5L5 18V4z' /%3E%3C/svg%3E")}.colorful-active .nav-files-container{--nav-item-background-active:var(--interactive-accent);--nav-item-color-active:var(--text-on-accent)}.colorful-active .nav-files-container .is-active .nav-file-tag{color:var(--text-on-accent);opacity:.6}.colorful-active .tree-item-self.is-being-renamed:focus-within{--nav-item-color-active:var(--text-normal)}.colorful-active #calendar-container .active,.colorful-active #calendar-container .active.today,.colorful-active #calendar-container .active:hover,.colorful-active #calendar-container .day:active{background-color:var(--interactive-accent);color:var(--text-on-accent)}.colorful-active #calendar-container .active .dot,.colorful-active #calendar-container .day:active .dot,.colorful-active #calendar-container .today.active .dot{fill:var(--text-on-accent)}body:not(.colorful-active) .horizontal-tab-nav-item.is-active,body:not(.colorful-active) .vertical-tab-nav-item.is-active{background-color:var(--bg3);color:var(--text-normal)}body{--frame-background:hsl( var(--frame-background-h), var(--frame-background-s), var(--frame-background-l));--frame-icon-color:var(--frame-muted-color)}.theme-light{--frame-background-h:var(--accent-h);--frame-background-s:var(--accent-s);--frame-background-l:calc(var(--accent-l) + 30%);--frame-outline-color:hsla( var(--frame-background-h), var(--frame-background-s), calc(var(--frame-background-l) - 6.5%), 1 );--frame-muted-color:hsl( var(--frame-background-h), calc(var(--frame-background-s) - 10%), calc(var(--frame-background-l) - 35%))}.theme-dark{--frame-background-h:var(--accent-h);--frame-background-s:var(--accent-s);--frame-background-l:calc(var(--accent-l) - 25%);--frame-outline-color:hsla( var(--frame-background-h), calc(var(--frame-background-s) - 2%), calc(var(--frame-background-l) + 6.5%), 1 );--frame-muted-color:hsl( var(--frame-background-h), calc(var(--frame-background-s) - 10%), calc(var(--frame-background-l) + 25%))}.colorful-frame.theme-dark{--tab-outline-width:0px}.colorful-frame,.colorful-frame.is-focused{--frame-divider-color:var(--frame-outline-color);--titlebar-background:var(--frame-background);--titlebar-background-focused:var(--frame-background);--titlebar-text-color:var(--frame-muted-color);--minimal-tab-text-color:var(--frame-muted-color)}.colorful-frame .workspace-tabs:not(.mod-stacked),.colorful-frame.is-focused .workspace-tabs:not(.mod-stacked){--tab-text-color:var(--minimal-tab-text-color);--tab-text-color-focused:var(--minimal-tab-text-color)}.colorful-frame .mod-top .workspace-tab-header-container,.colorful-frame .titlebar,.colorful-frame .workspace-ribbon.mod-left:before,.colorful-frame.is-focused .mod-top .workspace-tab-header-container,.colorful-frame.is-focused .titlebar,.colorful-frame.is-focused .workspace-ribbon.mod-left:before{--tab-outline-color:var(--frame-outline-color);--tab-divider-color:var(--frame-outline-color)}.colorful-frame .mod-root .workspace-tab-header .workspace-tab-header-inner-icon,.colorful-frame.is-focused .mod-root .workspace-tab-header .workspace-tab-header-inner-icon{--icon-color:var(--minimal-tab-text-color-active);--icon-color-hover:var(--minimal-tab-text-color-active);--icon-color-active:var(--minimal-tab-text-color-active);--icon-color-focused:var(--minimal-tab-text-color-active)}.colorful-frame .mod-left-split .mod-top .workspace-tab-header,.colorful-frame .mod-right-split .mod-top .workspace-tab-header,.colorful-frame .sidebar-toggle-button,.colorful-frame .workspace-tab-header-new-tab,.colorful-frame .workspace-tab-header-tab-list,.colorful-frame .workspace-tab-header:not(.is-active),.colorful-frame.is-focused .mod-left-split .mod-top .workspace-tab-header,.colorful-frame.is-focused .mod-right-split .mod-top .workspace-tab-header,.colorful-frame.is-focused .sidebar-toggle-button,.colorful-frame.is-focused .workspace-tab-header-new-tab,.colorful-frame.is-focused .workspace-tab-header-tab-list,.colorful-frame.is-focused .workspace-tab-header:not(.is-active){--background-modifier-hover:var(--frame-outline-color);--icon-color:var(--frame-icon-color);--icon-color-hover:var(--frame-icon-color);--icon-color-active:var(--frame-icon-color);--icon-color-focused:var(--frame-icon-color);--icon-color-focus:var(--frame-icon-color)}.colorful-frame .mod-left-split .mod-top .workspace-tab-header.is-active .workspace-tab-header-inner-icon,.colorful-frame .mod-right-split .mod-top .workspace-tab-header.is-active .workspace-tab-header-inner-icon,.colorful-frame.is-focused .mod-left-split .mod-top .workspace-tab-header.is-active .workspace-tab-header-inner-icon,.colorful-frame.is-focused .mod-right-split .mod-top .workspace-tab-header.is-active .workspace-tab-header-inner-icon{color:var(--frame-icon-color)}.workspace-leaf-resize-handle{transition:none}.colorful-frame.is-hidden-frameless:not(.minimal-focus-mode) .workspace-split.mod-left-split>.workspace-leaf-resize-handle,.colorful-frame.is-hidden-frameless:not(.minimal-focus-mode) .workspace-split.mod-right-split>.workspace-leaf-resize-handle,.colorful-frame.is-hidden-frameless:not(.minimal-focus-mode) .workspace-split.mod-vertical>*>.workspace-leaf-resize-handle{-webkit-app-region:no-drag;border:0;z-index:15}.colorful-frame.is-hidden-frameless:not(.minimal-focus-mode) .workspace-split.mod-left-split>.workspace-leaf-resize-handle:after,.colorful-frame.is-hidden-frameless:not(.minimal-focus-mode) .workspace-split.mod-right-split>.workspace-leaf-resize-handle:after,.colorful-frame.is-hidden-frameless:not(.minimal-focus-mode) .workspace-split.mod-vertical>*>.workspace-leaf-resize-handle:after{content:"";height:100%;width:1px;background:linear-gradient(180deg,var(--frame-outline-color) var(--header-height),var(--divider-color) var(--header-height));top:0;position:absolute}.colorful-frame.is-hidden-frameless:not(.minimal-focus-mode) .workspace-split.mod-left-split>.workspace-leaf-resize-handle:hover:after,.colorful-frame.is-hidden-frameless:not(.minimal-focus-mode) .workspace-split.mod-right-split>.workspace-leaf-resize-handle:hover:after,.colorful-frame.is-hidden-frameless:not(.minimal-focus-mode) .workspace-split.mod-vertical>*>.workspace-leaf-resize-handle:hover:after{background:var(--divider-color-hover)}.colorful-frame.is-hidden-frameless:not(.minimal-focus-mode) .workspace-split.mod-right-split>.workspace-leaf-resize-handle:after{left:0}.colorful-frame.is-hidden-frameless:not(.minimal-focus-mode) .workspace-split.mod-left-split>.workspace-leaf-resize-handle:after,.colorful-frame.is-hidden-frameless:not(.minimal-focus-mode) .workspace-split.mod-vertical>*>.workspace-leaf-resize-handle:after{right:0}body.colorful-headings{--h1-color:var(--color-red);--h2-color:var(--color-orange);--h3-color:var(--color-yellow);--h4-color:var(--color-green);--h5-color:var(--color-blue);--h6-color:var(--color-purple)}body.colorful-headings .modal{--h1-color:var(--text-normal);--h2-color:var(--text-normal);--h3-color:var(--text-normal);--h4-color:var(--text-normal);--h5-color:var(--text-normal);--h6-color:var(--text-normal)}.workspace-ribbon.mod-left{border-left:0;transition:none}:root{--focus-animation-duration:0.1s}.minimal-focus-mode.is-translucent .workspace-ribbon.mod-left.is-collapsed,.minimal-focus-mode.is-translucent .workspace-ribbon.mod-left.is-collapsed:before{background-color:var(--background-primary)!important}.minimal-focus-mode .workspace-ribbon.mod-left{transition:background-color 0s linear 0s}.minimal-focus-mode .workspace-ribbon.mod-left.is-collapsed{border-color:transparent;background-color:var(--background-primary)}.minimal-focus-mode .workspace-ribbon.mod-left.is-collapsed:before{background-color:var(--background-primary);border-color:transparent}.minimal-focus-mode .workspace-ribbon.mod-left.is-collapsed .side-dock-actions,.minimal-focus-mode .workspace-ribbon.mod-left.is-collapsed .side-dock-settings{opacity:0;transition:opacity var(--focus-animation-duration) ease-in-out .1s}.minimal-focus-mode .workspace-ribbon.mod-left.is-collapsed:hover .side-dock-actions,.minimal-focus-mode .workspace-ribbon.mod-left.is-collapsed:hover .side-dock-settings{opacity:1;transition:opacity var(--focus-animation-duration) ease-in-out .1s}.minimal-focus-mode.borders-title .workspace-ribbon.mod-left.is-collapsed{border-right:none}.minimal-focus-mode .mod-root .sidebar-toggle-button.mod-right{opacity:0;transition:opacity var(--focus-animation-duration) ease-in-out .5s}.minimal-focus-mode:not(.minimal-status-off) .status-bar{opacity:0;transition:opacity var(--focus-animation-duration) ease-in-out}.minimal-focus-mode .status-bar:hover{opacity:1;transition:opacity var(--focus-animation-duration) ease-in-out}.minimal-focus-mode .mod-root .workspace-tabs{position:relative}.minimal-focus-mode .mod-root .workspace-tabs:before:hover{background-color:#00f}.minimal-focus-mode .mod-root .workspace-tab-header-container{height:0;transition:all var(--focus-animation-duration) linear .6s;--tab-outline-width:0px}.minimal-focus-mode .mod-root .workspace-tab-header-container .workspace-tab-header-container-inner,.minimal-focus-mode .mod-root .workspace-tab-header-container .workspace-tab-header-new-tab,.minimal-focus-mode .mod-root .workspace-tab-header-container .workspace-tab-header-tab-list{opacity:0;transition:all var(--focus-animation-duration) linear .6s}.minimal-focus-mode .mod-root .workspace-tab-header-container .workspace-tab-header-spacer:before{width:100%;content:" ";background-color:rgba(0,0,0,0);height:15px;position:absolute;z-index:100;top:0;left:0}.minimal-focus-mode .mod-root .workspace-tab-header-container .workspace-tab-header-container-inner .workspace-tab-header.is-active,.minimal-focus-mode .mod-root .workspace-tab-header-container .workspace-tab-header-container-inner .workspace-tab-header.is-active::after,.minimal-focus-mode .mod-root .workspace-tab-header-container .workspace-tab-header-container-inner .workspace-tab-header.is-active::before{transition:all var(--focus-animation-duration) linear .6s}.minimal-focus-mode .mod-root .workspace-tab-header-container:hover{height:var(--header-height);--tab-outline-width:1px;transition:all var(--focus-animation-duration) linear .05s}.minimal-focus-mode .mod-root .workspace-tab-header-container:hover .sidebar-toggle-button.mod-right,.minimal-focus-mode .mod-root .workspace-tab-header-container:hover .workspace-tab-header-container-inner,.minimal-focus-mode .mod-root .workspace-tab-header-container:hover .workspace-tab-header-new-tab,.minimal-focus-mode .mod-root .workspace-tab-header-container:hover .workspace-tab-header-tab-list{opacity:1;transition:all var(--focus-animation-duration) linear .05s}.minimal-focus-mode .mod-root .workspace-tab-header-container:hover .workspace-tab-header-container-inner .workspace-tab-header.is-active,.minimal-focus-mode .mod-root .workspace-tab-header-container:hover .workspace-tab-header-container-inner .workspace-tab-header.is-active::after,.minimal-focus-mode .mod-root .workspace-tab-header-container:hover .workspace-tab-header-container-inner .workspace-tab-header.is-active::before{transition:all var(--focus-animation-duration) linear .05s}.minimal-focus-mode.mod-macos:not(.is-fullscreen) .workspace:not(.is-left-sidedock-open) .mod-root .workspace-tabs.mod-stacked .workspace-tab-container .workspace-tab-header-inner{padding-top:30px}body.show-view-header .app-container .workspace-split.mod-root>.workspace-leaf .view-header{transition:height var(--focus-animation-duration) linear .1s}body.minimal-focus-mode.show-view-header .mod-top-left-space .view-header{padding-left:var(--frame-left-space)}body.minimal-focus-mode.show-view-header .mod-root .workspace-leaf .view-header{height:0;transition:all var(--focus-animation-duration) linear .5s}body.minimal-focus-mode.show-view-header .view-header::after{width:100%;content:" ";background-color:rgba(0,0,0,0);height:40px;position:absolute;z-index:-9;top:0}body.minimal-focus-mode.show-view-header .view-actions,body.minimal-focus-mode.show-view-header .view-header-nav-buttons,body.minimal-focus-mode.show-view-header .view-header-title-container{opacity:0;transition:all var(--focus-animation-duration) linear .5s}body.minimal-focus-mode.show-view-header .mod-root .workspace-leaf .view-header:focus-within,body.minimal-focus-mode.show-view-header .mod-root .workspace-leaf .view-header:hover,body.minimal-focus-mode.show-view-header .mod-root .workspace-tab-header-container:hover~.workspace-tab-container .view-header{height:calc(var(--header-height) + 2px);transition:all var(--focus-animation-duration) linear .1s}body.minimal-focus-mode.show-view-header .mod-root .workspace-tab-header-container:hover~.workspace-tab-container .view-header .view-actions,body.minimal-focus-mode.show-view-header .mod-root .workspace-tab-header-container:hover~.workspace-tab-container .view-header .view-header-nav-buttons,body.minimal-focus-mode.show-view-header .mod-root .workspace-tab-header-container:hover~.workspace-tab-container .view-header .view-header-title-container,body.minimal-focus-mode.show-view-header .view-header:focus-within .view-actions,body.minimal-focus-mode.show-view-header .view-header:focus-within .view-header-nav-buttons,body.minimal-focus-mode.show-view-header .view-header:focus-within .view-header-title-container,body.minimal-focus-mode.show-view-header .view-header:hover .view-actions,body.minimal-focus-mode.show-view-header .view-header:hover .view-header-nav-buttons,body.minimal-focus-mode.show-view-header .view-header:hover .view-header-title-container{opacity:1;transition:all var(--focus-animation-duration) linear .1s}body.minimal-focus-mode.show-view-header .view-content{height:100%}.full-width-media{--iframe-width:100%}.full-width-media .markdown-preview-view .external-embed,.full-width-media .markdown-preview-view .image-embed img:not(.link-favicon):not(.emoji):not([width]),.full-width-media .markdown-preview-view audio,.full-width-media .markdown-preview-view img:not(.link-favicon):not(.emoji):not([width]),.full-width-media .markdown-preview-view video,.full-width-media .markdown-source-view .external-embed,.full-width-media .markdown-source-view .image-embed img:not(.link-favicon):not(.emoji):not([width]),.full-width-media .markdown-source-view audio,.full-width-media .markdown-source-view img:not(.link-favicon):not(.emoji):not([width]),.full-width-media .markdown-source-view video{width:100%}.markdown-rendered img:not(.emoji),.markdown-rendered video,.markdown-source-view img:not(.emoji),.markdown-source-view video{border-radius:var(--image-radius)}.tabular{font-variant-numeric:tabular-nums}.table-small .bases-view{--bases-table-font-size:85%}.table-small table:not(.calendar){--table-text-size:85%}.table-tiny .bases-view{--bases-table-font-size:75%}.table-tiny table:not(.calendar){--table-text-size:75%}.row-hover{--table-edge-cell-padding-first:8px;--table-edge-cell-padding-last:8px;--table-row-background-hover:var(--hl1);--table-row-alt-background-hover:var(--hl1)}.row-alt{--table-row-alt-background:var(--background-table-rows);--table-row-alt-background-hover:var(--background-table-rows);--table-edge-cell-padding-first:8px;--table-edge-cell-padding-last:8px}.col-alt .markdown-rendered:not(.cards){--table-column-alt-background:var(--background-table-rows)}.table-tabular table:not(.calendar){font-variant-numeric:tabular-nums}.table-center .markdown-preview-view .markdown-preview-sizer table,.table-center .markdown-source-view.mod-cm6 .table-wrapper,.table-center.markdown-preview-view .markdown-preview-sizer table,.table-center.markdown-source-view.mod-cm6 .table-wrapper{margin:0 auto}.table-lines{--table-border-width:var(--border-width);--table-header-border-width:var(--border-width);--table-column-first-border-width:var(--border-width);--table-column-last-border-width:var(--border-width);--table-row-last-border-width:var(--border-width);--table-edge-cell-padding:8px;--table-edge-cell-padding-first:8px;--table-edge-cell-padding-last:8px;--table-add-button-border-width:1px}.table-nowrap{--table-white-space:nowrap}.table-nowrap-first table tbody>tr>td:first-child,.table-nowrap-first table thead>tr>th:first-child{--table-white-space:nowrap}.table-nowrap .table-wrap,.trim-cols{--table-white-space:normal}.table-numbers{--table-numbers-padding-right:0.5em}.table-numbers table:not(.calendar){counter-reset:section}.table-numbers table:not(.calendar)>thead>tr>th:first-child{white-space:nowrap}.table-numbers table:not(.calendar)>thead>tr>th:first-child::before{content:" ";padding-right:var(--table-numbers-padding-right);display:inline-block;min-width:2em}.table-numbers table:not(.calendar)>thead>tr>th:first-child .cm-s-obsidian,.table-numbers table:not(.calendar)>thead>tr>th:first-child .table-cell-wrapper{display:inline-block;min-width:10px}.table-numbers table:not(.calendar).table-editor>tbody>tr>td:first-child .table-cell-wrapper,.table-numbers table:not(.calendar):not(.table-editor)>tbody>tr>td:first-child{white-space:nowrap}.table-numbers table:not(.calendar).table-editor>tbody>tr>td:first-child .table-cell-wrapper::before,.table-numbers table:not(.calendar):not(.table-editor)>tbody>tr>td:first-child::before{counter-increment:section;content:counter(section) " ";text-align:center;padding-right:var(--table-numbers-padding-right);display:inline-block;min-width:2em;color:var(--text-faint);font-variant-numeric:tabular-nums}.table-numbers table:not(.calendar).table-editor>tbody>tr>td:first-child .table-cell-wrapper .cm-s-obsidian,.table-numbers table:not(.calendar):not(.table-editor)>tbody>tr>td:first-child .cm-s-obsidian{display:inline-block;min-width:10px}.table-numbers .bases-table{counter-reset:section}.table-numbers .bases-table .bases-tr>.bases-td:first-child{white-space:nowrap}.table-numbers .bases-table .bases-tr>.bases-td:first-child .bases-table-header-label,.table-numbers .bases-table .bases-tr>.bases-td:first-child .bases-table-header-name{padding-inline-start:0}.table-numbers .bases-table .bases-tr>.bases-td:first-child::before{content:" ";padding-right:var(--table-numbers-padding-right);display:inline-block;min-width:2em}.table-numbers .bases-table .bases-tbody .bases-tr>.bases-td:first-child::before{counter-increment:section;content:counter(section) " ";text-align:center;color:var(--text-faint);font-variant-numeric:tabular-nums;font-size:var(--bases-table-font-size)}.table-numbers .table-editor{--table-numbers-padding-right:0}.row-lines-off{--table-row-last-border-width:0;--bases-table-row-border-width:0}.row-lines-off .table-view-table>tbody>tr>td,.row-lines-off table:not(.calendar) tbody>tr:last-child>td,.row-lines-off table:not(.calendar) tbody>tr>td{border-bottom:none}.row-lines:not(.table-lines) .markdown-preview-view:not(.cards),.row-lines:not(.table-lines) .markdown-source-view:not(.cards){--table-row-last-border-width:0}.row-lines:not(.table-lines) .markdown-preview-view:not(.cards) .table-view-table>tbody>tr:not(:last-child)>td,.row-lines:not(.table-lines) .markdown-preview-view:not(.cards) table:not(.calendar) tbody>tr:not(:last-child)>td,.row-lines:not(.table-lines) .markdown-source-view:not(.cards) .table-view-table>tbody>tr:not(:last-child)>td,.row-lines:not(.table-lines) .markdown-source-view:not(.cards) table:not(.calendar) tbody>tr:not(:last-child)>td{border-bottom:var(--table-border-width) solid var(--table-border-color)}.col-lines{--bases-table-column-border-width:var(--table-border-width)}.col-lines .table-view-table thead>tr>th:not(:last-child),.col-lines .table-view-table>tbody>tr>td:not(:last-child),.col-lines table:not(.calendar) tbody>tr>td:not(:last-child){border-right:var(--table-border-width) solid var(--background-modifier-border)}:root{--image-mix:normal}.image-blend-light{--image-mix:multiply}.theme-dark .markdown-preview-view img,.theme-dark .markdown-source-view img{opacity:var(--image-muted);transition:opacity .25s linear}@media print{body{--image-muted:1}}.theme-dark .markdown-preview-view img:hover,.theme-dark .markdown-source-view img:hover,.theme-dark .print-preview img{opacity:1;transition:opacity .25s linear}.theme-light img{mix-blend-mode:var(--image-mix)}div[src$="#blend"],div[src$="#invert"]{background-color:var(--background-primary)}.theme-dark div[src$="#invert"] img,.theme-dark img[src$="#invert"],.theme-dark span[src$="#invert"] img{filter:invert(1) hue-rotate(180deg);mix-blend-mode:screen}.theme-dark div[src$="#blend"] img,.theme-dark img[src$="#blend"],.theme-dark span[src$="#blend"] img{mix-blend-mode:screen}.theme-dark .img-blend{mix-blend-mode:screen}.theme-light div[src$="#blend"] img,.theme-light img[src$="#blend"],.theme-light span[src$="#blend"] img{mix-blend-mode:multiply}.theme-light div[src$="#invertW"] img,.theme-light img[src$="#invertW"],.theme-light span[src$=invertW] img{filter:invert(1) hue-rotate(180deg)}.theme-light .img-blend{mix-blend-mode:multiply}img[src$="#circle"]:not(.emoji),span[src$="#circle"] img:not(.emoji),span[src$="#round"] img:not(.emoji){border-radius:50%;aspect-ratio:1/1}div[src$="#outline"] img,img[src$="#outline"],span[src$="#outline"] img{border:1px solid var(--ui1)}img[src$="#interface"],span[src$="#interface"] img{border:1px solid var(--ui1);box-shadow:0 .5px .9px rgba(0,0,0,.021),0 1.3px 2.5px rgba(0,0,0,.03),0 3px 6px rgba(0,0,0,.039),0 10px 20px rgba(0,0,0,.06);margin-top:10px;margin-bottom:15px;border-radius:var(--radius-m)}body{--image-grid-fit:cover;--image-grid-background:transparent;--img-grid-gap:0.5rem}@media(max-width:400pt){body{--img-grid-gap:0.25rem}}.img-grid-ratio{--image-grid-fit:contain}.img-grid-ratio{--image-grid-fit:contain}.img-grid .image-embed.is-loaded{line-height:0;display:flex;align-items:stretch}.img-grid .image-embed.is-loaded img{background-color:var(--image-grid-background)}.img-grid .image-embed.is-loaded img:active{background-color:rgba(0,0,0,0)}.img-grid .markdown-preview-section>div:has(img) .image-embed~br,.img-grid .markdown-preview-section>div:has(img) img~br,.img-grid .markdown-preview-section>div:has(img) p:empty{display:none}.img-grid .markdown-preview-section div:has(>.image-embed~.image-embed),.img-grid .markdown-preview-section div:has(>img~img),.img-grid .markdown-preview-section p:has(>.image-embed~.image-embed),.img-grid .markdown-preview-section p:has(>.image-embed~img),.img-grid .markdown-preview-section p:has(>img~.image-embed),.img-grid .markdown-preview-section p:has(>img~img){display:grid;margin-block-start:var(--img-grid-gap);margin-block-end:var(--img-grid-gap);grid-column-gap:var(--img-grid-gap);grid-row-gap:0;grid-template-columns:repeat(auto-fit,minmax(0,1fr))}.img-grid .markdown-preview-section div:has(>.image-embed~.image-embed)>img,.img-grid .markdown-preview-section div:has(>img~img)>img,.img-grid .markdown-preview-section p:has(>.image-embed~.image-embed)>img,.img-grid .markdown-preview-section p:has(>.image-embed~img)>img,.img-grid .markdown-preview-section p:has(>img~.image-embed)>img,.img-grid .markdown-preview-section p:has(>img~img)>img{object-fit:var(--image-grid-fit);align-self:stretch}.img-grid .markdown-preview-section div:has(>.image-embed~.image-embed)>.internal-embed img,.img-grid .markdown-preview-section div:has(>img~img)>.internal-embed img,.img-grid .markdown-preview-section p:has(>.image-embed~.image-embed)>.internal-embed img,.img-grid .markdown-preview-section p:has(>.image-embed~img)>.internal-embed img,.img-grid .markdown-preview-section p:has(>img~.image-embed)>.internal-embed img,.img-grid .markdown-preview-section p:has(>img~img)>.internal-embed img{object-fit:var(--image-grid-fit);align-self:center}.img-grid .markdown-preview-section>div:has(img)>p{display:grid;margin-block-start:var(--img-grid-gap);margin-block-end:var(--img-grid-gap);grid-column-gap:var(--img-grid-gap);grid-row-gap:0;grid-template-columns:repeat(auto-fit,minmax(0,1fr))}.img-grid .markdown-preview-section>div:has(img)>p>br{display:none}body:not(.zoom-off):not(.is-mobile) .workspace-leaf-content[data-type=markdown] .view-content div:not(.canvas-node-content) img{cursor:zoom-in}body:not(.zoom-off):not(.is-mobile) .workspace-leaf-content[data-type=markdown] .view-content img:active{cursor:zoom-out;max-width:100%;z-index:900}body:not(.zoom-off):not(.is-mobile) .workspace-leaf-content[data-type=markdown] .view-content .markdown-preview-view img[referrerpolicy=no-referrer]:active,body:not(.zoom-off):not(.is-mobile) .workspace-leaf-content[data-type=markdown] .view-content .markdown-source-view.mod-cm6 .cm-content>img[contenteditable=false]:active{background-color:var(--background-primary)}body:not(.zoom-off):not(.is-mobile) .workspace-leaf-content[data-type=markdown] .view-content .image-embed:not(.canvas-node-content):active,body:not(.zoom-off):not(.is-mobile) .workspace-leaf-content[data-type=markdown] .view-content .markdown-preview-view img[referrerpolicy=no-referrer]:active,body:not(.zoom-off):not(.is-mobile) .workspace-leaf-content[data-type=markdown] .view-content .markdown-source-view.mod-cm6 .cm-content>img[contenteditable=false]:active{--container-img-width:100%;--container-img-max-width:100%;aspect-ratio:unset;cursor:zoom-out;display:block;z-index:200;position:fixed;max-height:calc(100% + 1px);max-width:100%;height:calc(100% + 1px);width:100%;object-fit:contain;margin:-.5px auto 0!important;text-align:center;padding:0;left:0;right:0;bottom:0}body:not(.zoom-off):not(.is-mobile) .workspace-leaf-content[data-type=markdown] .view-content .image-embed:not(.canvas-node-content):active:after{background-color:var(--background-primary);opacity:.9;content:" ";height:calc(100% + 1px);width:100%;position:fixed;left:0;right:1px;z-index:0}body:not(.zoom-off):not(.is-mobile) .workspace-leaf-content[data-type=markdown] .view-content .image-embed:not(.canvas-node-content):active img{aspect-ratio:unset;z-index:99;padding:0;margin:0 auto;width:calc(100% - 20px);max-height:95vh;object-fit:contain;left:0;right:0;bottom:0;position:absolute;opacity:1}body:not(.zoom-off):not(.is-mobile) .workspace-leaf-content[data-type=markdown] .view-content .markdown-source-view.mod-cm6 .cm-content>.cm-callout[contenteditable=false]:active{contain:unset!important}.labeled-nav.is-fullscreen:not(.colorful-frame),.labeled-nav.mod-windows{--labeled-nav-top-margin:0}.labeled-nav{--labeled-nav-top-margin:var(--header-height)}.labeled-nav.is-translucent .mod-left-split .mod-top .workspace-tab-header-container .workspace-tab-header-container-inner{background-color:rgba(0,0,0,0)}.labeled-nav.is-hidden-frameless:not(.is-fullscreen) .mod-left-split .workspace-tabs.mod-top-left-space .workspace-tab-header-container{padding-left:0}.labeled-nav.mod-macos .mod-left-split .mod-top .workspace-tab-header-container:before,.labeled-nav.mod-macos.is-hidden-frameless:not(.is-fullscreen) .mod-left-split .mod-top .workspace-tab-header-container:before{-webkit-app-region:drag;position:absolute;width:calc(100% - var(--divider-width));height:calc(var(--header-height) - var(--tab-outline-width));border-bottom:0 solid var(--tab-outline-color)}.labeled-nav.mod-macos.is-hidden-frameless:not(.is-fullscreen) .workspace-ribbon.mod-left:not(.is-collapsed){border:none;--tab-outline-width:0px}.labeled-nav.colorful-frame.is-hidden-frameless:not(.is-fullscreen) .mod-left-split .mod-top .workspace-tab-header-container:before,.labeled-nav.mod-macos:not(.hider-ribbon) .mod-left-split .mod-top .workspace-tab-header-container:before,.labeled-nav:not(.is-hidden-frameless) .mod-left-split .mod-top .workspace-tab-header-container:before{border-bottom:var(--tab-outline-width) solid var(--tab-outline-color)}.labeled-nav.colorful-frame.is-hidden-frameless:not(.is-fullscreen) .workspace-ribbon.mod-left:not(.is-collapsed),.labeled-nav.mod-macos:not(.hider-ribbon) .workspace-ribbon.mod-left:not(.is-collapsed),.labeled-nav:not(.is-hidden-frameless) .workspace-ribbon.mod-left:not(.is-collapsed){--tab-outline-width:1px}.labeled-nav:not(.is-hidden-frameless) .mod-left-split .mod-top .workspace-tab-header-container:before{position:absolute;top:0;content:" "}.labeled-nav.hider-ribbon.mod-macos.is-hidden-frameless:not(.is-fullscreen):not(.is-popout-window) .mod-left-split:not(.is-sidedock-collapsed) .workspace-tabs.mod-top-left-space .workspace-tab-header-container{padding-left:0}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-spacer{display:none}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-inner-title{display:inline-block;font-weight:500;font-size:var(--font-adaptive-smaller)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-container{position:relative;flex-direction:column-reverse!important;height:auto;width:100%}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-container .sidebar-toggle-button.mod-left{position:absolute;justify-content:flex-end;padding-right:var(--size-4-2);top:0;right:0}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-container .workspace-tab-header-container-inner{padding:var(--size-4-2) var(--size-4-2);margin-top:var(--labeled-nav-top-margin);flex-direction:column!important;background-color:var(--background-secondary)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-container .workspace-tab-container-inner{flex-grow:1;gap:0;padding:var(--size-4-2) var(--size-4-3)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header{--icon-color:var(--text-muted);--tab-text-color:var(--text-muted);--tab-text-color-focused:var(--text-muted);padding:0;margin-bottom:2px;border:none;height:auto}.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active:not(:hover){background-color:rgba(0,0,0,0)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active,.labeled-nav .mod-left-split .mod-top .workspace-tab-header:hover{opacity:1;--tab-text-color-active:var(--text-normal);--tab-text-color-focused:var(--text-normal);--tab-text-color-focused-active:var(--text-normal);--tab-text-color-focused-active-current:var(--text-normal);--icon-color:var(--text-normal)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header .workspace-tab-header-inner{gap:var(--size-2-3);padding:var(--size-4-1) var(--size-4-2);box-shadow:none;border:none}.labeled-nav .mod-left-split .mod-top .workspace-tab-header.has-active-menu:hover,.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active:hover{background-color:rgba(0,0,0,0)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active:hover .workspace-tab-header-inner,.labeled-nav .mod-left-split .mod-top .workspace-tab-header:not(.is-active):hover .workspace-tab-header-inner{background-color:var(--nav-item-background-hover)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active .workspace-tab-header-inner-icon,.labeled-nav .mod-left-split .mod-top .workspace-tab-header:hover .workspace-tab-header-inner-icon{color:var(--icon-color-active)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-container{border:none;padding:0}body:not(.links-int-on){--link-decoration:none}body:not(.links-ext-on){--link-external-decoration:none}body:not(.sidebar-color) .mod-right-split{--background-secondary:var(--background-primary)}body:not(.sidebar-color) .mod-right-split :not(.mod-top) .workspace-tab-header-container{--tab-container-background:var(--background-primary)}.theme-dark,.theme-light{--minimal-tab-text-color:var(--tx2);--minimal-tab-text-color-active:var(--tx1)}.workspace-tabs:not(.mod-stacked){--tab-text-color:var(--minimal-tab-text-color);--tab-text-color-focused:var(--minimal-tab-text-color);--tab-text-color-active:var(--minimal-tab-text-color-active);--tab-text-color-focused-active:var(--minimal-tab-text-color-active);--tab-text-color-focused-active-current:var(--minimal-tab-text-color-active)}.tabs-plain-square .mod-root{--tab-curve:0;--tab-radius:0;--tab-radius-active:0}.tabs-plain-square .mod-root .workspace-tab-header-container{padding-left:0;padding-right:0}.tabs-plain-square .mod-root .workspace-tab-header-container-inner{margin-top:-1px;margin-left:-15px}.tabs-plain-square .mod-root .workspace-tab-header{padding:0}.tabs-plain-square .mod-root .workspace-tab-header-inner{padding:0 8px}.tabs-square .mod-root{--tab-curve:0;--tab-radius:0;--tab-radius-active:0}.tabs-underline .mod-root{--tab-curve:0;--tab-radius:0;--tab-radius-active:0;--tab-outline-width:0px;--tab-background-active:transparent}.tabs-underline .mod-root .workspace-tab-header-container{border-bottom:1px solid var(--divider-color)}.tabs-underline .mod-root .workspace-tab-header{border-bottom:2px solid transparent}.tabs-underline .mod-root .workspace-tab-header:hover{border-bottom:2px solid var(--ui2)}.tabs-underline .mod-root .workspace-tab-header:hover .workspace-tab-header-inner{background-color:rgba(0,0,0,0)}.tabs-underline .mod-root .workspace-tab-header.is-active{border-bottom:2px solid var(--ax3)}.tabs-underline .mod-root .workspace-tab-header-inner:hover{background-color:rgba(0,0,0,0)}body:not(.sidebar-tabs-underline):not(.sidebar-tabs-index):not(.sidebar-tabs-square) .workspace>.workspace-split:not(.mod-root) .workspace-tabs:not(.mod-top) .workspace-tab-header-container{--tab-outline-width:0}.tabs-modern.colorful-frame .mod-root .mod-top.workspace-tabs:not(.mod-stacked){--tab-background:var(--frame-outline-color);--tab-outline-width:1px}.tabs-modern.colorful-frame .mod-root .mod-top.workspace-tabs:not(.mod-stacked) .workspace-tab-header.is-active .workspace-tab-header-inner-close-button,.tabs-modern.colorful-frame .mod-root .mod-top.workspace-tabs:not(.mod-stacked) .workspace-tab-header:hover .workspace-tab-header-inner-close-button{color:var(--minimal-tab-text-color-active)}.tabs-modern.minimal-focus-mode .mod-root .workspace-tab-header-container:hover{--tab-outline-width:0px}.tabs-modern .mod-root{--tab-container-background:var(--background-primary)}.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked){--tab-background:var(--background-modifier-hover);--tab-height:calc(var(--header-height) - 14px);--tab-outline-width:0px}.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header-inner::after,.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header::after,.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header::before{display:none}.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header-container-inner{align-items:center;margin:0;padding:2px var(--size-4-2) 0 var(--size-4-1)}.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header-inner-title{text-overflow:ellipsis;-webkit-mask-image:none}.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header{background:rgba(0,0,0,0);border-radius:5px;border:none;box-shadow:none;height:var(--tab-height);margin-left:var(--size-4-1);padding:0}.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header.is-active .workspace-tab-header-inner-title{color:var(--tab-text-color-active)}.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header.is-active.mod-active,.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header:hover{opacity:1;background-color:var(--tab-background)}.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header-new-tab{margin-inline-end:0}.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header-inner{padding:0 var(--size-4-1) 0 var(--size-4-2);border:1px solid transparent}.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header:not(.is-active):hover .workspace-tab-header-inner{background-color:rgba(0,0,0,0)}.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header.is-active:not(.mod-active) .workspace-tab-header-inner,.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header:not(:hover):not(.mod-active) .workspace-tab-header-inner{border:1px solid var(--tab-outline-color)}.tab-names-on .workspace-split:not(.mod-root) .workspace-tab-header-container-inner{--sidebar-tab-text-display:static}.tab-names-on .workspace-split:not(.mod-root) .workspace-tab-header-container-inner .workspace-tab-header-inner-title{font-weight:500}.tab-names-on .workspace-split:not(.mod-root) .workspace-tab-header-container-inner .workspace-tab-header-inner{gap:var(--size-2-3)}.tab-names-single .workspace>.workspace-split:not(.mod-root) .workspace-tab-header-container-inner .workspace-tab-header:only-child{--sidebar-tab-text-display:static;background-color:rgba(0,0,0,0)}.tab-names-single .workspace>.workspace-split:not(.mod-root) .workspace-tab-header-container-inner .workspace-tab-header:only-child .workspace-tab-header-inner-title{font-weight:500}.tab-names-single .workspace>.workspace-split:not(.mod-root) .workspace-tab-header-container-inner .workspace-tab-header:only-child .workspace-tab-header-inner{gap:var(--size-2-3)}.tabs-modern.sidebar-tabs-default .mod-right-split,.tabs-modern.sidebar-tabs-wide .mod-right-split{--tab-outline-width:0}.sidebar-tabs-underline .mod-right-split .workspace-tab-header-spacer,.sidebar-tabs-underline.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-spacer,.sidebar-tabs-underline:not(.labeled-nav) .mod-left-split .workspace-tab-header-spacer{display:none}.sidebar-tabs-underline .mod-right-split .workspace-tab-header-container,.sidebar-tabs-underline.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container,.sidebar-tabs-underline:not(.labeled-nav) .mod-left-split .workspace-tab-header-container{padding-right:0}.sidebar-tabs-underline .mod-right-split .workspace-tab-header-container-inner,.sidebar-tabs-underline.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container-inner,.sidebar-tabs-underline:not(.labeled-nav) .mod-left-split .workspace-tab-header-container-inner{padding:0;margin:0;flex-grow:1;gap:0}.sidebar-tabs-underline .mod-right-split .workspace-tab-header-container .workspace-tab-header,.sidebar-tabs-underline.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container .workspace-tab-header,.sidebar-tabs-underline:not(.labeled-nav) .mod-left-split .workspace-tab-header-container .workspace-tab-header{flex-grow:1;border-radius:0;max-width:100px}.sidebar-tabs-underline .mod-right-split .workspace-tab-header-container .workspace-tab-header.is-active,.sidebar-tabs-underline .mod-right-split .workspace-tab-header-container .workspace-tab-header:hover,.sidebar-tabs-underline.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container .workspace-tab-header.is-active,.sidebar-tabs-underline.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container .workspace-tab-header:hover,.sidebar-tabs-underline:not(.labeled-nav) .mod-left-split .workspace-tab-header-container .workspace-tab-header.is-active,.sidebar-tabs-underline:not(.labeled-nav) .mod-left-split .workspace-tab-header-container .workspace-tab-header:hover{background-color:rgba(0,0,0,0)}.sidebar-tabs-underline .mod-right-split .workspace-tab-header-container .workspace-tab-header.is-active .workspace-tab-header-inner,.sidebar-tabs-underline .mod-right-split .workspace-tab-header-container .workspace-tab-header:hover .workspace-tab-header-inner,.sidebar-tabs-underline.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container .workspace-tab-header.is-active .workspace-tab-header-inner,.sidebar-tabs-underline.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container .workspace-tab-header:hover .workspace-tab-header-inner,.sidebar-tabs-underline:not(.labeled-nav) .mod-left-split .workspace-tab-header-container .workspace-tab-header.is-active .workspace-tab-header-inner,.sidebar-tabs-underline:not(.labeled-nav) .mod-left-split .workspace-tab-header-container .workspace-tab-header:hover .workspace-tab-header-inner{background-color:rgba(0,0,0,0)}.sidebar-tabs-underline .mod-right-split .workspace-tab-header-container .workspace-tab-header .workspace-tab-header-inner,.sidebar-tabs-underline.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container .workspace-tab-header .workspace-tab-header-inner,.sidebar-tabs-underline:not(.labeled-nav) .mod-left-split .workspace-tab-header-container .workspace-tab-header .workspace-tab-header-inner{border-bottom:2px solid transparent;border-radius:0}.sidebar-tabs-underline .mod-right-split .workspace-tab-header-container .workspace-tab-header .workspace-tab-header-inner:hover,.sidebar-tabs-underline.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container .workspace-tab-header .workspace-tab-header-inner:hover,.sidebar-tabs-underline:not(.labeled-nav) .mod-left-split .workspace-tab-header-container .workspace-tab-header .workspace-tab-header-inner:hover{border-color:var(--ui2)}.sidebar-tabs-underline .mod-right-split .workspace-tab-header-container .workspace-tab-header.is-active .workspace-tab-header-inner,.sidebar-tabs-underline.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container .workspace-tab-header.is-active .workspace-tab-header-inner,.sidebar-tabs-underline:not(.labeled-nav) .mod-left-split .workspace-tab-header-container .workspace-tab-header.is-active .workspace-tab-header-inner{border-color:var(--ax3);padding-top:1px}.sidebar-tabs-square .mod-left-split,.sidebar-tabs-square .mod-right-split{--tab-radius:0px}.sidebar-tabs-plain-square .mod-left-split,.sidebar-tabs-plain-square .mod-right-split{--tab-radius:0px}.sidebar-tabs-plain-square.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top),.sidebar-tabs-plain-square:not(.labeled-nav) .mod-left-split{--tab-background-active:var(--background-secondary)}.sidebar-tabs-plain-square .mod-right-split .workspace-tab-header-container,.sidebar-tabs-plain-square.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container,.sidebar-tabs-plain-square:not(.labeled-nav) .mod-left-split .workspace-tab-header-container{padding-left:0}.sidebar-tabs-plain-square .mod-right-split .workspace-tab-header-container-inner,.sidebar-tabs-plain-square.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container-inner,.sidebar-tabs-plain-square:not(.labeled-nav) .mod-left-split .workspace-tab-header-container-inner{padding:0;margin:0 0 calc(var(--tab-outline-width)*-1);flex-grow:1;gap:0}.sidebar-tabs-plain-square .mod-right-split .workspace-tab-header,.sidebar-tabs-plain-square.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header,.sidebar-tabs-plain-square:not(.labeled-nav) .mod-left-split .workspace-tab-header{flex-grow:1;max-width:100px;border-radius:var(--tab-radius) var(--tab-radius) 0 0}.sidebar-tabs-plain-square .mod-right-split .workspace-tab-header.is-active,.sidebar-tabs-plain-square.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header.is-active,.sidebar-tabs-plain-square:not(.labeled-nav) .mod-left-split .workspace-tab-header.is-active{box-shadow:0 0 0 var(--tab-outline-width) var(--tab-outline-color);color:var(--tab-text-color-active);background-color:var(--tab-background-active)}.sidebar-tabs-index.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top),.sidebar-tabs-index:not(.labeled-nav) .mod-left-split,.sidebar-tabs-square.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top),.sidebar-tabs-square:not(.labeled-nav) .mod-left-split{--tab-background-active:var(--background-secondary)}.sidebar-tabs-index .mod-right-split .workspace-tab-header-container-inner,.sidebar-tabs-index.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container-inner,.sidebar-tabs-index:not(.labeled-nav) .mod-left-split .workspace-tab-header-container-inner,.sidebar-tabs-square .mod-right-split .workspace-tab-header-container-inner,.sidebar-tabs-square.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container-inner,.sidebar-tabs-square:not(.labeled-nav) .mod-left-split .workspace-tab-header-container-inner{padding:1px var(--size-4-2) 0;margin:6px 0 calc(var(--tab-outline-width)*-1);flex-grow:1}.sidebar-tabs-index .mod-right-split .workspace-tab-header,.sidebar-tabs-index.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header,.sidebar-tabs-index:not(.labeled-nav) .mod-left-split .workspace-tab-header,.sidebar-tabs-square .mod-right-split .workspace-tab-header,.sidebar-tabs-square.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header,.sidebar-tabs-square:not(.labeled-nav) .mod-left-split .workspace-tab-header{flex-grow:1;max-width:100px;border-radius:var(--tab-radius) var(--tab-radius) 0 0}.sidebar-tabs-index .mod-right-split .workspace-tab-header.is-active,.sidebar-tabs-index.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header.is-active,.sidebar-tabs-index:not(.labeled-nav) .mod-left-split .workspace-tab-header.is-active,.sidebar-tabs-square .mod-right-split .workspace-tab-header.is-active,.sidebar-tabs-square.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header.is-active,.sidebar-tabs-square:not(.labeled-nav) .mod-left-split .workspace-tab-header.is-active{box-shadow:0 0 0 var(--tab-outline-width) var(--tab-outline-color);color:var(--tab-text-color-active);background-color:var(--tab-background-active)}.sidebar-tabs-wide .mod-right-split .workspace-tab-header-container-inner,.sidebar-tabs-wide.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container-inner,.sidebar-tabs-wide:not(.labeled-nav) .mod-left-split .workspace-tab-header-container-inner{flex-grow:1;border:1px solid var(--tab-outline-color);padding:3px;margin:6px 8px 6px;border-radius:4px}.sidebar-tabs-wide .mod-right-split .workspace-tab-header,.sidebar-tabs-wide.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header,.sidebar-tabs-wide:not(.labeled-nav) .mod-left-split .workspace-tab-header{flex-grow:1}.sidebar-tabs-wide .mod-right-split .workspace-tab-header.is-active,.sidebar-tabs-wide.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header.is-active,.sidebar-tabs-wide:not(.labeled-nav) .mod-left-split .workspace-tab-header.is-active{border-color:transparent}.sidebar-tabs-wide .mod-right-split .workspace-tab-header-container,.sidebar-tabs-wide.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-container,.sidebar-tabs-wide:not(.labeled-nav) .mod-left-split .workspace-tab-header-container{padding-right:0}.sidebar-tabs-wide .mod-right-split .workspace-tab-header-spacer,.sidebar-tabs-wide.labeled-nav .mod-left-split .workspace-tabs:not(.mod-top) .workspace-tab-header-spacer,.sidebar-tabs-wide:not(.labeled-nav) .mod-left-split .workspace-tab-header-spacer{display:none}.full-file-names{--nav-item-white-space:normal}body:not(.full-file-names){--nav-item-white-space:nowrap}body:not(.full-file-names) .tree-item-self{white-space:nowrap}body:not(.full-file-names) .tree-item-inner{text-overflow:ellipsis;overflow:hidden}.theme-dark,.theme-light{--h1l:var(--ui1);--h2l:var(--ui1);--h3l:var(--ui1);--h4l:var(--ui1);--h5l:var(--ui1);--h6l:var(--ui1)}.h1-l .markdown-reading-view h1:not(.embedded-note-title),.h1-l .mod-cm6 .cm-editor .HyperMD-header-1{border-bottom:1px solid var(--h1l);padding-bottom:.4em;margin-block-end:.6em}.h2-l .markdown-reading-view h2,.h2-l .mod-cm6 .cm-editor .HyperMD-header-2{border-bottom:1px solid var(--h2l);padding-bottom:.4em;margin-block-end:.6em}.h3-l .markdown-reading-view h3,.h3-l .mod-cm6 .cm-editor .HyperMD-header-3{border-bottom:1px solid var(--h3l);padding-bottom:.4em;margin-block-end:.6em}.h4-l .markdown-reading-view h4,.h4-l .mod-cm6 .cm-editor .HyperMD-header-4{border-bottom:1px solid var(--h4l);padding-bottom:.4em;margin-block-end:.6em}.h5-l .markdown-reading-view h5,.h5-l .mod-cm6 .cm-editor .HyperMD-header-5{border-bottom:1px solid var(--h5l);padding-bottom:.4em;margin-block-end:.6em}.h6-l .markdown-reading-view h6,.h6-l .mod-cm6 .cm-editor .HyperMD-header-6{border-bottom:1px solid var(--h6l);padding-bottom:.4em;margin-block-end:.6em}.is-tablet .workspace-drawer{padding-top:0}.is-tablet .workspace-drawer:not(.is-pinned){margin:30px 16px 0;height:calc(100vh - 48px);border-radius:15px;border:none}.is-tablet .workspace-drawer-ribbon{background-color:var(--background-primary);border-right:1px solid var(--background-modifier-border)}.is-tablet .workspace-drawer-header,.is-tablet .workspace-drawer.is-pinned .workspace-drawer-header{padding-top:var(--size-4-4)}.is-tablet .workspace-drawer-header-icon{margin-inline-start:0}.is-mobile{--font-bold:600;--font-ui-medium:var(--font-adaptive-small);--interactive-normal:var(--background-secondary);--background-modifier-form-field:var(--background-secondary);--background-modifier-form-field-highlighted:var(--background-secondary)}.is-mobile .markdown-source-view.mod-cm6 .cm-gutters{margin-left:0}.is-mobile.theme-light .menu{--interactive-normal:var(--background-modifier-hover)}.is-mobile .workspace-drawer.mod-left.is-pinned{width:var(--mobile-left-sidebar-width);min-width:150pt}.is-mobile .workspace-drawer.mod-right.is-pinned{width:var(--mobile-right-sidebar-width);min-width:150pt}.backlink-pane>.tree-item-self,.backlink-pane>.tree-item-self:hover,.outgoing-link-pane>.tree-item-self,.outgoing-link-pane>.tree-item-self:hover{color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em;font-size:var(--font-adaptive-smallest);font-weight:500}body{--canvas-dot-pattern:var(--background-modifier-border-hover)}.canvas-node-label{font-size:var(--font-adaptive-small)}.canvas-edges :not(.is-themed) path.canvas-display-path{stroke:var(--background-modifier-border-focus)}.canvas-edges :not(.is-themed) polyline.canvas-path-end{stroke:var(--background-modifier-border-focus);fill:var(--background-modifier-border-focus)}.canvas-node-container{border:1.5px solid var(--background-modifier-border-focus)}.node-insert-event.mod-inside-iframe{--max-width:100%;--folding-offset:0px}.node-insert-event.mod-inside-iframe .cm-editor .cm-content{padding-top:0}.hider-file-nav-header:not(.labeled-nav) .nav-files-container{padding-top:var(--size-4-3)}.is-mobile .nav-folder.mod-root>.nav-folder-title .nav-folder-title-content{display:none}body:not(.is-mobile) .nav-folder.mod-root>.nav-folder-title .nav-folder-title-content{font-weight:500;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);font-size:var(--font-adaptive-smallest)}.nav-buttons-container{justify-content:flex-start}.nav-file-tag{padding-top:.2em;background-color:rgba(0,0,0,0);color:var(--text-faint)}.nav-file .is-active .nav-file-tag,.nav-file:hover .nav-file-tag{color:var(--text-muted)}input.prompt-input,input.prompt-input:focus,input.prompt-input:focus-visible,input.prompt-input:hover{border-color:rgba(var(--mono-rgb-100),.05)}.is-mobile .mod-publish .modal-content{display:unset;padding:10px 10px 10px;margin-bottom:120px;overflow-x:hidden}.is-mobile .mod-publish .button-container,.is-mobile .modal.mod-publish .modal-button-container{padding:10px 15px 30px;margin-left:0;left:0}.is-mobile .modal.mod-publish .modal-title{padding:10px 20px;margin:0 -10px;border-bottom:1px solid var(--background-modifier-border)}.is-mobile .publish-site-settings-container{margin-right:0;padding:0}.is-mobile .modal.mod-publish .modal-content .publish-sections-container{margin-right:0;padding-right:0}@media(max-width:400pt){.is-mobile .publish-changes-info,.is-mobile .publish-section-header{flex-wrap:wrap;border:none}.is-mobile .publish-changes-info .publish-changes-add-linked-btn{flex-basis:100%;margin-top:10px}.is-mobile .publish-section-header-text{flex-basis:100%;margin-bottom:10px;margin-left:20px;margin-top:-8px}.is-mobile .publish-section{background:var(--background-secondary);border-radius:10px;padding:12px 12px 1px}.is-mobile .publish-changes-switch-site{flex-grow:0;margin-right:10px}}.release-notes-view .cm-scroller.is-readable-line-width{width:var(--line-width);max-width:var(--max-width);margin:0 auto}.search-results-info{border-bottom:none}.workspace-leaf-content[data-type=sync] .tree-item.nav-folder .nav-folder-title{color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em;font-size:var(--font-adaptive-smallest);font-weight:500;margin-bottom:4px}.workspace-leaf-content[data-type=sync] .tree-item.nav-folder .nav-folder-title:hover{color:var(--text-normal)}.workspace-leaf-content[data-type=sync] .tree-item.nav-folder.is-collapsed .nav-folder-title{color:var(--text-faint)}.workspace-leaf-content[data-type=sync] .tree-item.nav-folder.is-collapsed .nav-folder-title:hover{color:var(--text-muted)}.workspace-leaf-content[data-type=calendar] .view-content{padding:5px 0 0 0}.mod-root #calendar-container{width:var(--line-width);max-width:var(--max-width);margin:0 auto;padding:0}body{--calendar-dot-active:var(--text-faint);--calendar-dot-today:var(--text-accent)}#calendar-container{padding:0 var(--size-4-4) var(--size-4-1);--color-background-day-empty:var(--background-secondary-alt);--color-background-day-active:var(--background-modifier-hover);--color-background-day-hover:var(--background-modifier-hover);--color-dot:var(--text-faint);--calendar-text-active:inherit;--color-text-title:var(--text-normal);--color-text-heading:var(--text-muted);--color-text-day:var(--text-normal);--color-text-today:var(--text-normal);--color-arrow:var(--text-faint);--color-background-day-empty:transparent}#calendar-container .table{border-collapse:separate;table-layout:fixed}#calendar-container h2{font-weight:400;font-size:var(--h2)}#calendar-container .arrow{cursor:var(--cursor);width:22px;border-radius:4px;padding:3px 7px}#calendar-container .arrow svg{width:12px;height:12px;color:var(--text-faint);opacity:.7}#calendar-container .arrow:hover{fill:var(--text-muted);color:var(--text-muted);background-color:var(--background-modifier-hover)}#calendar-container .arrow:hover svg{color:var(--text-muted);opacity:1}#calendar-container tr th{padding:2px 0 4px;font-weight:500;letter-spacing:.1em;font-size:var(--font-adaptive-smallest)}#calendar-container tr th:first-child{padding-left:0!important}#calendar-container tr td{padding:2px 0 0 0;border-radius:var(--radius-m);cursor:var(--cursor);border:1px solid transparent;transition:none}#calendar-container tr td:first-child{padding-left:0!important}#calendar-container .nav{padding:0;margin:var(--size-4-2) var(--size-4-1)}#calendar-container .dot{margin:0}#calendar-container .month,#calendar-container .title,#calendar-container .year{font-size:calc(var(--font-adaptive-small) + 2px);font-weight:400;color:var(--text-normal)}#calendar-container .today,#calendar-container .today.active{color:var(--text-accent);font-weight:600}#calendar-container .today .dot,#calendar-container .today.active .dot{fill:var(--calendar-dot-today)}#calendar-container .active .task{stroke:var(--text-faint)}#calendar-container .active{color:var(--text-normal)}#calendar-container .reset-button{text-transform:none;letter-spacing:0;font-size:var(--font-adaptive-smaller);font-weight:500;color:var(--text-muted);border-radius:4px;margin:0;padding:2px 8px}#calendar-container .reset-button:hover{color:var(--text-normal);background-color:var(--background-modifier-hover)}#calendar-container .day,#calendar-container .reset-button,#calendar-container .week-num{cursor:var(--cursor)}#calendar-container .day.adjacent-month{color:var(--text-faint);opacity:1}#calendar-container .day{padding:2px 4px 4px;transition:none}#calendar-container .day,#calendar-container .week-num{font-size:calc(var(--font-adaptive-smaller) + 5%)}#calendar-container .active,#calendar-container .active.today,#calendar-container .day:hover,#calendar-container .week-num:hover{background-color:var(--color-background-day-active);color:var(--calendar-text-active);transition:none}#calendar-container .active .dot{fill:var(--calendar-dot-active)}#calendar-container .active .task{stroke:var(--text-faint)}.block-language-chart canvas,.block-language-dataviewjs canvas{margin:1em 0}.theme-dark,.theme-light{--chart-color-1:var(--color-blue);--chart-color-2:var(--color-red);--chart-color-3:var(--color-yellow);--chart-color-4:var(--color-green);--chart-color-5:var(--color-orange);--chart-color-6:var(--color-purple);--chart-color-7:var(--color-cyan);--chart-color-8:var(--color-pink)}body #cMenuModalBar{box-shadow:0 2px 20px var(--shadow-color)}body #cMenuModalBar .cMenuCommandItem{cursor:var(--cursor)}body #cMenuModalBar button.cMenuCommandItem:hover{background-color:var(--background-modifier-hover)}.MiniSettings-statusbar-button{padding-top:0;padding-bottom:0}.MySnippets-statusbar-menu .menu-item .MS-OpenSnippet{height:auto;border:none;background:rgba(0,0,0,0);box-shadow:none;width:auto;padding:4px 6px;margin-left:0}.MySnippets-statusbar-menu .menu-item .MS-OpenSnippet svg path{fill:var(--text-muted)}.MySnippets-statusbar-menu .menu-item .MS-OpenSnippet:hover{background-color:var(--background-modifier-hover)}.dataview-inline-lists .markdown-preview-view .dataview-ul,.dataview-inline-lists .markdown-source-view .dataview-ul{--list-spacing:0}.dataview-inline-lists .markdown-preview-view .dataview-ol li:not(:last-child):after,.dataview-inline-lists .markdown-preview-view .dataview-ul li:not(:last-child):after,.dataview-inline-lists .markdown-source-view .dataview-ol li:not(:last-child):after,.dataview-inline-lists .markdown-source-view .dataview-ul li:not(:last-child):after{content:", "}.dataview-inline-lists .markdown-preview-view ul.dataview-ol>li::before,.dataview-inline-lists .markdown-preview-view ul.dataview-ul>li::before,.dataview-inline-lists .markdown-source-view ul.dataview-ol>li::before,.dataview-inline-lists .markdown-source-view ul.dataview-ul>li::before{display:none}.dataview-inline-lists .markdown-preview-view .dataview-ol li,.dataview-inline-lists .markdown-preview-view .dataview-ul li,.dataview-inline-lists .markdown-source-view .dataview-ol li,.dataview-inline-lists .markdown-source-view .dataview-ul li{display:inline-block;padding-inline-end:.25em;margin-inline-start:0}.markdown-rendered table.dataview{margin-block-start:0;margin-block-end:0}.markdown-rendered table.dataview .dataview-result-list-li{margin-inline-start:0}.markdown-preview-view .table-view-table>thead>tr>th,body .table-view-table>thead>tr>th{font-weight:400;font-size:var(--table-text-size);color:var(--text-muted);border-bottom:var(--table-border-width) solid var(--table-border-color);cursor:var(--cursor)}table.dataview ul.dataview-ul{list-style:none;padding-inline-start:0;margin-block-start:0em!important;margin-block-end:0em!important}.markdown-preview-view:not(.cards) .table-view-table>tbody>tr>td,.markdown-source-view.mod-cm6:not(.cards) .table-view-table>tbody>tr>td{max-width:var(--max-col-width)}body .dataview.small-text{color:var(--text-faint)}body:not(.row-hover) .dataview.task-list-basic-item:hover,body:not(.row-hover) .dataview.task-list-item:hover,body:not(.row-hover) .table-view-table>tbody>tr:hover{background-color:rgba(0,0,0,0)!important;box-shadow:none}body.row-hover .dataview.task-list-basic-item:hover,body.row-hover .dataview.task-list-item:hover,body.row-hover .table-view-table>tbody>tr:hover{background-color:var(--table-row-background-hover)}body .dataview-error{background-color:rgba(0,0,0,0)}.dataview.dataview-error,.markdown-source-view.mod-cm6 .cm-content .dataview.dataview-error{color:var(--text-muted)}body div.dataview-error-box{min-height:0;border:none;background-color:rgba(0,0,0,0);font-size:var(--table-text-size);border-radius:var(--radius-m);padding:15px 0;justify-content:flex-start}body div.dataview-error-box p{margin-block-start:0;margin-block-end:0;color:var(--text-faint)}.trim-cols .markdown-preview-view .table-view-table>tbody>tr>td,.trim-cols .markdown-source-view.mod-cm6 .table-view-table>tbody>tr>td,.trim-cols .markdown-source-view.mod-cm6 .table-view-table>thead>tr>th{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}ul .dataview .task-list-basic-item:hover,ul .dataview .task-list-item:hover{background-color:rgba(0,0,0,0);box-shadow:none}body .dataview.result-group{padding-left:0}body .dataview .inline-field-standalone-value,body .dataview.inline-field-key,body .dataview.inline-field-value{font-family:var(--font-text);font-size:calc(var(--font-adaptive-normal) - 2px);background:rgba(0,0,0,0);color:var(--text-muted)}body .dataview.inline-field-key{padding:0}body .dataview .inline-field-standalone-value{padding:0}body .dataview.inline-field-key::after{margin-left:3px;content:"|";color:var(--background-modifier-border)}body .dataview.inline-field-value{padding:0 1px 0 3px}.markdown-preview-view .block-language-dataview table.calendar th{border:none;cursor:default;background-image:none}.markdown-preview-view .block-language-dataview table.calendar .day{font-size:var(--font-adaptive-small)}.git-view-body .opener{text-transform:uppercase;letter-spacing:.05em;font-size:var(--font-adaptive-smallest);font-weight:500;padding:5px 7px 5px 10px;margin-bottom:6px}.git-view-body .file-view .opener{text-transform:none;letter-spacing:normal;font-size:var(--font-adaptive-smallest);font-weight:400;padding:initial;margin-bottom:0}.git-view-body .file-view .opener .collapse-icon{display:flex!important;margin-left:-7px}.git-view-body{margin-top:6px}.git-view-body .file-view{margin-left:4px}.git-view-body .file-view main:hover{color:var(--text-normal)}.git-view-body .file-view .tools .type{display:none!important}.git-view-body .file-view .tools{opacity:0;transition:opacity .1s}.git-view-body .file-view main:hover>.tools{opacity:1}.git-view-body .staged{margin-bottom:12px}.git-view-body .opener.open{color:var(--text-normal)}div[data-type=git-view] .search-input-container{margin-left:0;width:100%}.git-view-body .opener .collapse-icon{display:none!important}.git-view-body main{background-color:var(--background-primary)!important;width:initial!important}.git-view-body .file-view>main:not(.topLevel){margin-left:7px}div[data-type=git-view] .commit-msg{min-height:2.5em!important;height:2.5em!important;padding:6.5px 8px!important}div[data-type=git-view] .search-input-clear-button{bottom:5.5px}.hider-vault .nav-folder.mod-root>.nav-folder-title{height:4px}body.minimal-dark-black.theme-dark,body.minimal-dark-tonal.theme-dark,body.minimal-light-tonal.theme-light,body.minimal-light-white.theme-light,body.theme-dark{--kanban-border:0px}body:not(.is-mobile) .kanban-plugin__grow-wrap>textarea:focus{box-shadow:none}body:not(.minimal-icons-off) .kanban-plugin svg.cross{height:14px;width:14px}body .kanban-plugin__icon>svg,body .kanban-plugin__lane-settings-button svg{width:18px;height:18px}body .kanban-plugin{--kanban-border:var(--border-width);--interactive-accent:var(--text-selection);--interactive-accent-hover:var(--background-modifier-hover);--text-on-accent:var(--text-normal);background-color:var(--background-primary)}body .kanban-plugin__markdown-preview-view{font-family:var(--font-text)}body .kanban-plugin__board>div{margin:0 auto}body .kanban-plugin__checkbox-label{color:var(--text-muted)}body .kanban-plugin__item-markdown ul{margin:0}body .kanban-plugin__item-content-wrapper{box-shadow:none}body .kanban-plugin__grow-wrap::after,body .kanban-plugin__grow-wrap>textarea{padding:0;border:0;border-radius:0}body .kanban-plugin__grow-wrap::after,body .kanban-plugin__grow-wrap>textarea,body .kanban-plugin__item-title p,body .kanban-plugin__markdown-preview-view{font-size:var(--font-ui-medium);line-height:1.3}body .kanban-plugin__item{background-color:var(--background-primary)}body .kanban-plugin__item-title-wrapper{align-items:center}body .kanban-plugin__lane-form-wrapper{border:1px solid var(--background-modifier-border)}body .kanban-plugin__lane-header-wrapper{border-bottom:0}body .kanban-plugin__lane-header-wrapper .kanban-plugin__grow-wrap>textarea,body .kanban-plugin__lane-input-wrapper .kanban-plugin__grow-wrap>textarea,body .kanban-plugin__lane-title p{background:rgba(0,0,0,0);color:var(--text-normal);font-size:var(--font-ui-medium);font-weight:500}body .kanban-plugin__item-input-wrapper .kanban-plugin__grow-wrap>textarea{padding:0;border-radius:0;height:auto}body .kanban-plugin__item-form .kanban-plugin__grow-wrap{background-color:var(--background-primary)}body .kanban-plugin__item-input-wrapper .kanban-plugin__grow-wrap>textarea::placeholder{color:var(--text-faint)}body .kanban-plugin__item .kanban-plugin__item-edit-archive-button,body .kanban-plugin__item button.kanban-plugin__item-edit-button,body .kanban-plugin__item-settings-actions>button,body .kanban-plugin__lane button.kanban-plugin__lane-settings-button,body .kanban-plugin__lane button.kanban-plugin__lane-settings-button.is-enabled,body .kanban-plugin__lane-action-wrapper>button{background:rgba(0,0,0,0);transition:color .1s ease-in-out}body .kanban-plugin__item .kanban-plugin__item-edit-archive-button:hover,body .kanban-plugin__item button.kanban-plugin__item-edit-button.is-enabled,body .kanban-plugin__item button.kanban-plugin__item-edit-button:hover,body .kanban-plugin__lane button.kanban-plugin__lane-settings-button.is-enabled,body .kanban-plugin__lane button.kanban-plugin__lane-settings-button:hover{color:var(--text-normal);transition:color .1s ease-in-out;background:rgba(0,0,0,0)}body .kanban-plugin__new-lane-button-wrapper{position:fixed;bottom:30px}body .kanban-plugin__lane-items>.kanban-plugin__placeholder:only-child{border:1px dashed var(--background-modifier-border);height:2em}body .kanban-plugin__item-postfix-button-wrapper{align-self:flex-start}body .kanban-plugin__item button.kanban-plugin__item-postfix-button.is-enabled,body .kanban-plugin__item button.kanban-plugin__item-prefix-button.is-enabled,body .kanban-plugin__lane button.kanban-plugin__lane-settings-button.is-enabled{color:var(--text-muted)}body .kanban-plugin button{box-shadow:none;cursor:var(--cursor);height:auto}body .kanban-plugin__item button.kanban-plugin__item-postfix-button:hover,body .kanban-plugin__item button.kanban-plugin__item-prefix-button:hover,body .kanban-plugin__lane button.kanban-plugin__lane-settings-button:hover{background-color:var(--background-modifier-hover)}body .kanban-plugin__item-button-wrapper>button{color:var(--text-muted);font-weight:400;background:rgba(0,0,0,0);min-height:calc(var(--input-height) + 8px)}body .kanban-plugin__item-button-wrapper>button:hover{color:var(--text-normal);background:var(--background-modifier-hover)}body .kanban-plugin__item-button-wrapper>button:focus{box-shadow:none}body .kanban-plugin__item-button-wrapper{padding:1px 6px 5px;border-top:none}body .kanban-plugin__lane-setting-wrapper>div:last-child{border:none;margin:0}body .kanban-plugin.something-is-dragging{cursor:grabbing;cursor:-webkit-grabbing}body .kanban-plugin__item.is-dragging{box-shadow:0 5px 30px rgba(0,0,0,.15),0 0 0 2px var(--text-selection)}body .kanban-plugin__lane-items{border:var(--kanban-border) solid var(--background-modifier-border);padding:0 4px;margin:0;background-color:var(--background-secondary)}body .kanban-plugin__lane{background:rgba(0,0,0,0);padding:0;border:var(--border-width) solid transparent}body .kanban-plugin__lane.is-dragging{box-shadow:0 5px 30px rgba(0,0,0,.15);border:1px solid var(--background-modifier-border)}body .kanban-plugin__lane .kanban-plugin__item-button-wrapper{border-top-left-radius:8px;border-top-right-radius:8px;border-top:1px solid var(--background-modifier-border);border-bottom-width:0;padding:4px 4px 0 4px}body .kanban-plugin__lane.will-prepend .kanban-plugin__lane-items{border-radius:8px}body .kanban-plugin__lane.will-prepend .kanban-plugin__item-form{border-top:1px solid var(--background-modifier-border);border-radius:8px 8px 0 0;padding:4px 4px 0;border-bottom-width:0}body .kanban-plugin__lane.will-prepend .kanban-plugin__item-form+.kanban-plugin__lane-items{border-top-width:0;border-radius:0 0 8px 8px}body .kanban-plugin__lane.will-prepend .kanban-plugin__item-button-wrapper+.kanban-plugin__lane-items{border-top-width:0;border-radius:0 0 8px 8px}body .kanban-plugin__lane:not(.will-prepend) .kanban-plugin__item-button-wrapper,body .kanban-plugin__lane:not(.will-prepend) .kanban-plugin__item-form{border-top:none;border-radius:0 0 8px 8px}body .kanban-plugin__lane:not(.will-prepend) .kanban-plugin__item-button-wrapper{padding:0 4px 4px 4px;border-bottom-width:1px}body .kanban-plugin__lane:not(.will-prepend) .kanban-plugin__lane-items{border-bottom:none;border-top-width:1px;border-radius:8px 8px 0 0}body .kanban-plugin__item-form .kanban-plugin__item-input-wrapper{min-height:calc(var(--input-height) + 8px);display:flex;justify-content:center}body .kanban-plugin__item-button-wrapper,body .kanban-plugin__item-form{background-color:var(--background-secondary);border:var(--kanban-border) solid var(--background-modifier-border)}body .kanban-plugin__item-form{padding:0 4px 5px}body .kanban-plugin__markdown-preview-view ol,body .kanban-plugin__markdown-preview-view ol.contains-task-list .contains-task-list,body .kanban-plugin__markdown-preview-view ul,body .kanban-plugin__markdown-preview-view ul.contains-task-list .contains-task-list{padding-inline-start:1.8em!important}@media(max-width:400pt){.kanban-plugin__board{flex-direction:column!important}.kanban-plugin__lane{width:100%!important;margin-bottom:1rem!important}}body .cm-heading-marker{cursor:var(--cursor);padding-left:10px}.theme-light{--leaflet-buttons:var(--bg1);--leaflet-borders:rgba(0,0,0,0.1)}.theme-dark{--leaflet-buttons:var(--bg2);--leaflet-borders:rgba(255,255,255,0.1)}.leaflet-container{--image-radius:0}.leaflet-top{transition:top .1s linear}body .leaflet-container{background-color:var(--background-secondary);font-family:var(--font-interface)}.leaflet-control-attribution{display:none}.leaflet-popup-content{margin:10px}.block-language-leaflet{border-radius:var(--radius-m);overflow:hidden;border:var(--border-width) solid var(--background-modifier-border)}.map-wide .block-language-leaflet{border-radius:var(--radius-l)}.map-max .block-language-leaflet{border-radius:var(--radius-xl)}.workspace-leaf-content[data-type=obsidian-leaflet-map-view] .block-language-leaflet{border-radius:0;border:none}.map-100 .block-language-leaflet{border-radius:0;border-left:none;border-right:none}.block-language-leaflet .leaflet-control-expandable-list .input-container .input-item>input{appearance:none}body .block-language-leaflet .leaflet-bar.disabled>a{background-color:rgba(0,0,0,0);opacity:.3}body .leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}body .leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px}body .leaflet-control-layers-toggle{border-radius:4px}body .block-language-leaflet .leaflet-control-expandable,body .block-language-leaflet .leaflet-control-has-actions .control-actions.expanded,body .block-language-leaflet .leaflet-distance-control,body .leaflet-bar,body .leaflet-bar a,body .leaflet-control-layers-expanded,body .leaflet-control-layers-toggle{background-color:var(--leaflet-buttons);color:var(--text-muted);border:none;user-select:none}body .leaflet-bar a.leaflet-disabled,body .leaflet-bar a.leaflet-disabled:hover{background-color:var(--leaflet-buttons);color:var(--text-faint);opacity:.6;cursor:not-allowed}body .leaflet-control a{cursor:var(--cursor);color:var(--text-normal)}body .leaflet-bar a:hover{background-color:var(--background-modifier-hover);color:var(--text-normal);border:none}body .leaflet-touch .leaflet-control-layers{background-color:var(--leaflet-buttons)}body .leaflet-touch .leaflet-bar,body .leaflet-touch .leaflet-control-layers{border-radius:5px;box-shadow:2px 0 8px 0 rgba(0,0,0,.1);border:1px solid var(--ui1)}body .block-language-leaflet .leaflet-control-has-actions .control-actions{box-shadow:0;border:1px solid var(--ui1)}body .leaflet-control-expandable-list .leaflet-bar{box-shadow:none;border-radius:0}body .block-language-leaflet .leaflet-distance-control{padding:4px 10px;height:auto;cursor:var(--cursor)!important}body .block-language-leaflet .leaflet-marker-link-popup>.leaflet-popup-content-wrapper>*{font-size:var(--font-adaptive-small);font-family:var(--font-interface)}body .block-language-leaflet .leaflet-marker-link-popup>.leaflet-popup-content-wrapper{padding:4px 10px!important}.leaflet-marker-icon svg path{stroke:var(--background-primary);stroke-width:18px}body .markdown-preview-view th,body .markdown-source-view.mod-cm6 .dataview.table-view-table thead.table-view-thead tr th,body .table-view-table>thead>tr>th{cursor:var(--cursor);background-image:none}.markdown-source-view.mod-cm6 th{background-repeat:no-repeat;background-position:right}.style-settings-container[data-level="2"]{background:var(--background-secondary);border:1px solid var(--ui1);border-radius:5px;padding:10px 20px;margin:2px 0 2px -20px}.workspace-leaf-content[data-type=style-settings] div[data-id=instructions] .setting-item-name{display:none}.workspace-leaf-content[data-type=style-settings] div[data-id=instructions] .setting-item-description{color:var(--text-normal);font-size:var(--font-adaptive-smaller);padding-bottom:.5em}.workspace-leaf-content[data-type=style-settings] .view-content{padding:var(--size-4-4) 0}.workspace-leaf-content[data-type=style-settings] .view-content>div{width:var(--line-width);max-width:var(--max-width);margin:0 auto}.workspace-leaf-content[data-type=style-settings] .style-settings-heading[data-level="0"] .setting-item-name{padding-left:17px}.workspace-leaf-content[data-type=style-settings] .setting-item{max-width:100%;margin:0 auto}.workspace-leaf-content[data-type=style-settings] .setting-item-name{position:relative}.workspace-leaf-content[data-type=style-settings] .style-settings-collapse-indicator{position:absolute;left:0}.setting-item-heading.style-settings-heading,.style-settings-container .style-settings-heading{cursor:var(--cursor)}.modal.mod-settings .setting-item .pickr button.pcr-button{box-shadow:none;border-radius:40px;height:24px;width:24px}.setting-item .pickr .pcr-button:after,.setting-item .pickr .pcr-button:before{border-radius:40px;box-shadow:none;border:none}.setting-item.setting-item-heading.style-settings-heading.is-collapsed{border-bottom:1px solid var(--background-modifier-border)}.setting-item.setting-item-heading.style-settings-heading{border:0;padding:10px 0 5px;margin-bottom:0}.setting-item .style-settings-export,.setting-item .style-settings-import{text-decoration:none;font-size:var(--font-ui-small);font-weight:500;color:var(--text-muted);margin:0;padding:2px 8px;border-radius:5px;cursor:var(--cursor)}.setting-item .style-settings-export:hover,.setting-item .style-settings-import:hover{background-color:var(--background-modifier-hover);color:var(--text-normal);cursor:var(--cursor)}.mod-root .workspace-leaf-content[data-type=style-settings] .style-settings-container .setting-item:not(.setting-item-heading){flex-direction:row;align-items:center;padding:.5em 0}.workspace-split:not(.mod-root) .workspace-leaf-content[data-type=style-settings] .setting-item-name{font-size:var(--font-adaptive-smaller)}.themed-color-wrapper>div+div{margin-top:0;margin-left:6px}.theme-light .themed-color-wrapper>.theme-light{background-color:rgba(0,0,0,0)}.theme-light .themed-color-wrapper>.theme-dark{background-color:rgba(0,0,0,.8)}.theme-dark .themed-color-wrapper>.theme-dark{background-color:rgba(0,0,0,0)}@media(max-width:400pt){.workspace-leaf-content[data-type=style-settings] .setting-item-name{font-size:var(--font-adaptive-small)}.workspace-leaf-content[data-type=style-settings] .view-content>.setting-item>.setting-item-info:first-child{width:100%;margin-right:0}}.zoom-plugin-header{--link-color:var(--text-normal);--link-decoration:none;font-size:var(--font-ui-small);padding:0;justify-content:center;margin:var(--size-4-2) auto;max-width:var(--max-width)}.zoom-plugin-header>.zoom-plugin-title{text-decoration:none;max-width:15em;overflow:hidden}.zoom-plugin-header>.zoom-plugin-delimiter{color:var(--text-faint);padding:0 var(--size-4-1)}.theme-dark.minimal-atom-dark{--color-red-rgb:225,109,118;--color-orange-rgb:209,154,102;--color-yellow-rgb:206,193,103;--color-green-rgb:152,195,121;--color-cyan-rgb:88,182,194;--color-blue-rgb:98,175,239;--color-purple-rgb:198,120,222;--color-pink-rgb:225,109,118;--color-red:#e16d76;--color-orange:#d19a66;--color-yellow:#cec167;--color-green:#98c379;--color-cyan:#58b6c2;--color-blue:#62afef;--color-purple:#c678de;--color-pink:#e16d76}.theme-light.minimal-atom-light{--color-red-rgb:228,87,73;--color-orange-rgb:183,107,2;--color-yellow-rgb:193,131,2;--color-green-rgb:80,161,80;--color-cyan-rgb:13,151,179;--color-blue-rgb:98,175,239;--color-purple-rgb:166,38,164;--color-pink-rgb:228,87,73;--color-red:#e45749;--color-orange:#b76b02;--color-yellow:#c18302;--color-green:#50a150;--color-cyan:#0d97b3;--color-blue:#62afef;--color-purple:#a626a4;--color-pink:#e45749}.theme-light.minimal-atom-light{--base-h:106;--base-s:0%;--base-l:98%;--accent-h:231;--accent-s:76%;--accent-l:62%;--bg1:#fafafa;--bg2:#eaeaeb;--bg3:rgba(0,0,0,.1);--ui1:#dbdbdc;--ui2:#d8d8d9;--tx1:#232324;--tx2:#8e8e90;--tx3:#a0a1a8;--hl1:rgba(180,180,183,0.3);--hl2:rgba(209,154,102,0.35)}.theme-light.minimal-atom-light.minimal-light-white{--bg3:#eaeaeb}.theme-dark.minimal-atom-dark,.theme-light.minimal-atom-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-atom-light.minimal-light-contrast .theme-dark,.theme-light.minimal-atom-light.minimal-light-contrast .titlebar,.theme-light.minimal-atom-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-atom-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-atom-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:220;--base-s:12%;--base-l:18%;--accent-h:220;--accent-s:86%;--accent-l:65%;--bg1:#282c34;--bg2:#21252c;--bg3:#3a3f4b;--divider-color:#181a1f;--tab-outline-color:#181a1f;--tx1:#d8dae1;--tx2:#898f9d;--tx3:#5d6370;--hl1:rgba(114,123,141,0.3);--hl2:rgba(209,154,102,0.3);--sp1:#fff}.theme-dark.minimal-atom-dark.minimal-dark-black{--base-d:5%;--bg3:#282c34;--divider-color:#282c34;--tab-outline-color:#282c34}.theme-light.minimal-ayu-light{--color-red-rgb:230,80,80;--color-orange-rgb:250,141,62;--color-yellow-rgb:242,174,73;--color-green-rgb:108,191,67;--color-cyan-rgb:76,191,153;--color-blue-rgb:57,158,230;--color-purple-rgb:163,122,204;--color-pink-rgb:255,115,131;--color-red:#e65050;--color-orange:#fa8d3e;--color-yellow:#f2ae49;--color-green:#6CBF43;--color-cyan:#4cbf99;--color-blue:#399ee6;--color-purple:#a37acc;--color-pink:#ff7383}.theme-dark.minimal-ayu-dark{--color-red-rgb:255,102,102;--color-orange-rgb:250,173,102;--color-yellow-rgb:255,209,55;--color-green-rgb:135,217,108;--color-cyan-rgb:149,230,203;--color-blue-rgb:115,208,255;--color-purple-rgb:223,191,255;--color-pink-rgb:242,121,131;--color-red:#ff6666;--color-orange:#ffad66;--color-yellow:#ffd137;--color-green:#87D96C;--color-cyan:#95e6cb;--color-blue:#73d0ff;--color-purple:#dfbfff;--color-pink:#f27983}.theme-light.minimal-ayu-light{--base-h:210;--base-s:17%;--base-l:98%;--accent-h:36;--accent-s:100%;--accent-l:50%;--bg1:#fff;--bg2:#f8f9fa;--bg3:rgba(209,218,224,0.5);--ui1:#E6EAED;--tx1:#5C6165;--tx2:#8A9199;--tx3:#AAAEB0;--hl1:rgba(3,91,214,0.15)}.theme-dark.minimal-ayu-dark,.theme-light.minimal-ayu-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-ayu-light.minimal-light-contrast .theme-dark,.theme-light.minimal-ayu-light.minimal-light-contrast .titlebar,.theme-light.minimal-ayu-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-ayu-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-ayu-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:222;--base-s:22%;--base-l:15%;--accent-h:35;--accent-s:100%;--accent-l:60%;--bg1:#232937;--bg2:#1E2431;--bg3:rgba(51,61,80,0.5);--ui1:#333C4A;--ui2:#333C4A;--ui3:#333C4A;--tx1:#cccac2;--tx2:#707A8C;--tx3:#495063;--hl1:rgba(64,159,255,0.25)}.theme-dark.minimal-ayu-dark.minimal-dark-black{--accent-h:40;--accent-s:75%;--accent-l:61%;--bg3:#0E1017;--tx1:#BFBDB6;--divider-color:#11151C;--tab-outline-color:#11151C}.theme-light.minimal-catppuccin-light{--color-red-rgb:230,69,83;--color-orange-rgb:254,100,12;--color-yellow-rgb:223,142,29;--color-green-rgb:64,160,43;--color-cyan-rgb:23,146,154;--color-blue-rgb:33,102,246;--color-purple-rgb:137,56,239;--color-pink-rgb:234,119,203;--color-red:#E64553;--color-orange:#FE640C;--color-yellow:#DF8E1D;--color-green:#40A02B;--color-cyan:#17929A;--color-blue:#2166F6;--color-purple:#8938EF;--color-pink:#EA77CB}.theme-dark.minimal-catppuccin-dark{--color-red-rgb:235,153,156;--color-orange-rgb:239,160,118;--color-yellow-rgb:229,200,144;--color-green-rgb:166,209,138;--color-cyan-rgb:129,200,190;--color-blue-rgb:140,170,238;--color-purple-rgb:202,158,230;--color-pink-rgb:244,185,229;--color-red:#EB999C;--color-orange:#EFA076;--color-yellow:#E5C890;--color-green:#A6D18A;--color-cyan:#81C8BE;--color-blue:#8CAAEE;--color-purple:#CA9EE6;--color-pink:#F4B9E5}.theme-light.minimal-catppuccin-light{--base-h:228;--base-s:20%;--base-l:95%;--accent-h:11;--accent-s:59%;--accent-l:67%;--bg1:#F0F1F5;--bg2:#DCE0E8;--bg3:hsla(228,11%,65%,.25);--ui1:#CCD0DA;--ui2:#BCC0CC;--ui3:#ACB0BE;--tx1:#4D4F69;--tx2:#5D5F77;--tx3:#8D8FA2;--hl1:rgba(172,176,190,.3);--hl2:rgba(223,142,29,.3)}.theme-light.minimal-catppuccin-light.minimal-light-tonal{--bg2:#DCE0E8}.theme-light.minimal-catppuccin-light.minimal-light-white{--bg3:#F0F1F5;--ui1:#DCE0E8}.theme-dark.minimal-catppuccin-dark,.theme-light.minimal-catppuccin-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-catppuccin-light.minimal-light-contrast .theme-dark,.theme-light.minimal-catppuccin-light.minimal-light-contrast .titlebar,.theme-light.minimal-catppuccin-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-catppuccin-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-catppuccin-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:229;--base-s:19%;--base-l:23%;--accent-h:10;--accent-s:57%;--accent-l:88%;--bg1:#303446;--bg2:#242634;--bg3:hsla(229,13%,52%,0.25);--ui1:#41455A;--ui2:#51576D;--ui3:#626880;--tx1:#C6D0F5;--tx2:#A6ADCE;--tx3:#848BA7;--sp1:#242634;--hl1:rgba(98,104,128,.5);--hl2:rgba(223,142,29,.4)}.theme-dark.minimal-catppuccin-dark.minimal-dark-black{--ui1:#303446;--hl2:rgba(223,142,29,.5)}.theme-dark.minimal-dracula-dark{--color-red-rgb:255,85,85;--color-orange-rgb:255,184,108;--color-yellow-rgb:241,250,140;--color-green-rgb:80,250,123;--color-cyan-rgb:139,233,253;--color-blue-rgb:98,114,164;--color-purple-rgb:189,147,249;--color-pink-rgb:255,121,198;--color-red:#ff5555;--color-orange:#ffb86c;--color-yellow:#f1fa8c;--color-green:#50fa7b;--color-cyan:#8be9fd;--color-blue:#6272a4;--color-purple:#bd93f9;--color-pink:#ff79c6}.theme-dark.minimal-dracula-dark,.theme-light.minimal-dracula-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-dracula-light.minimal-light-contrast .theme-dark,.theme-light.minimal-dracula-light.minimal-light-contrast .titlebar,.theme-light.minimal-dracula-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-dracula-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-dracula-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:232;--base-s:16%;--base-l:19%;--accent-h:265;--accent-s:89%;--accent-l:78%;--bg1:#282a37;--bg2:#21222c;--ui2:#44475a;--ui3:#6272a4;--tx1:#f8f8f2;--tx2:#949FBE;--tx3:#6272a4;--hl1:rgba(134, 140, 170, 0.3);--hl2:rgba(189, 147, 249, 0.35)}.theme-dark.minimal-dracula-dark.minimal-dark-black{--ui1:#282a36}.theme-dark.minimal-eink-dark,.theme-light.minimal-eink-light{--collapse-icon-color:var(--text-normal);--icon-color-active:var(--bg1);--icon-color-hover:var(--bg1);--icon-color-focused:var(--bg1);--icon-opacity:1;--indentation-guide-color:var(--tx1);--indentation-guide-color-active:var(--tx1);--indentation-guide-width-active:3px;--interactive-normal:var(--bg1);--input-shadow:0 0 0 1px var(--tx1);--link-unresolved-opacity:1;--link-unresolved-decoration-style:dashed;--link-unresolved-decoration-color:var(--tx1);--metadata-label-background-active:var(--bg1);--metadata-input-background-active:var(--bg1);--modal-border-color:var(--tx1);--modal-border-width:2px;--prompt-border-color:var(--tx1);--prompt-border-width:2px;--calendar-dot-active:var(--bg1);--calendar-dot-today:var(--bg1);--calendar-text-active:var(--bg1);--tag-border-width:1.25px;--tag-background:transparent;--tag-background-hover:transparent;--tag-border-color:var(--tx1);--tag-border-color-hover:var(--tx1);--text-on-accent:var(--bg1);--text-on-accent-inverted:var(--bg1);--text-selection:var(--tx1);--vault-profile-color:var(--tx1);--nav-item-color-hover:var(--bg1)}.theme-dark.minimal-eink-dark ::selection,.theme-dark.minimal-eink-dark button:hover,.theme-light.minimal-eink-light ::selection,.theme-light.minimal-eink-light button:hover{color:var(--bg1)}.theme-dark.minimal-eink-dark .nav-files-container,.theme-light.minimal-eink-light .nav-files-container{--nav-item-color-active:var(--bg1)}.theme-dark.minimal-eink-dark .tree-item-self:hover,.theme-light.minimal-eink-light .tree-item-self:hover{--nav-collapse-icon-color:var(--bg1)}.theme-dark.minimal-eink-dark.is-focused .mod-active .workspace-tab-header.is-active .workspace-tab-header-inner-icon,.theme-dark.minimal-eink-dark.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active,.theme-dark.minimal-eink-dark.tabs-modern,.theme-light.minimal-eink-light.is-focused .mod-active .workspace-tab-header.is-active .workspace-tab-header-inner-icon,.theme-light.minimal-eink-light.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active,.theme-light.minimal-eink-light.tabs-modern{--minimal-tab-text-color-active:var(--bg1);--tab-text-color-focused:var(--bg1);--tab-text-color-focused-active-current:var(--bg1)}.theme-dark.minimal-eink-dark .setting-hotkey,.theme-light.minimal-eink-light .setting-hotkey{background-color:rgba(0,0,0,0);border:1px solid var(--tx1)}.theme-dark.minimal-eink-dark .suggestion-container,.theme-light.minimal-eink-light .suggestion-container{border-width:3px}.theme-dark.minimal-eink-dark .cm-s-obsidian span.cm-inline-code,.theme-dark.minimal-eink-dark .markdown-rendered code,.theme-light.minimal-eink-light .cm-s-obsidian span.cm-inline-code,.theme-light.minimal-eink-light .markdown-rendered code{font-weight:600}.theme-dark.minimal-eink-dark .tree-item-self.is-active,.theme-dark.minimal-eink-dark .tree-item-self:hover,.theme-light.minimal-eink-light .tree-item-self.is-active,.theme-light.minimal-eink-light .tree-item-self:hover{--icon-color:var(--bg1)}.theme-dark.minimal-eink-dark .metadata-property-icon,.theme-light.minimal-eink-light .metadata-property-icon{--icon-color-focused:var(--tx1)}.theme-dark.minimal-eink-dark .checkbox-container,.theme-light.minimal-eink-light .checkbox-container{background-color:var(--bg1);box-shadow:0 0 0 1px var(--tx1);--toggle-thumb-color:var(--tx1)}.theme-dark.minimal-eink-dark .checkbox-container.is-enabled,.theme-light.minimal-eink-light .checkbox-container.is-enabled{background-color:var(--tx1);--toggle-thumb-color:var(--bg1)}.theme-dark.minimal-eink-dark.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active:not(:hover),.theme-dark.minimal-eink-dark.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header.is-active,.theme-light.minimal-eink-light.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active:not(:hover),.theme-light.minimal-eink-light.tabs-modern .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header.is-active{background-color:var(--tx1)}.theme-dark.minimal-eink-dark #calendar-container .reset-button:hover,.theme-dark.minimal-eink-dark .cm-s-obsidian span.cm-formatting-highlight,.theme-dark.minimal-eink-dark .cm-s-obsidian span.cm-highlight,.theme-dark.minimal-eink-dark .community-item .suggestion-highlight,.theme-dark.minimal-eink-dark .dropdown:hover,.theme-dark.minimal-eink-dark .horizontal-tab-nav-item:hover,.theme-dark.minimal-eink-dark .markdown-rendered mark,.theme-dark.minimal-eink-dark .mod-root .workspace-tab-header-status-icon,.theme-dark.minimal-eink-dark .mod-root .workspace-tab-header:hover,.theme-dark.minimal-eink-dark .search-result-file-match:hover,.theme-dark.minimal-eink-dark .search-result-file-matched-text,.theme-dark.minimal-eink-dark .status-bar .plugin-sync:hover .sync-status-icon.mod-success,.theme-dark.minimal-eink-dark .status-bar .plugin-sync:hover .sync-status-icon.mod-working,.theme-dark.minimal-eink-dark .status-bar-item.mod-clickable:hover,.theme-dark.minimal-eink-dark .suggestion-item.is-selected,.theme-dark.minimal-eink-dark .text-icon-button:hover,.theme-dark.minimal-eink-dark .vertical-tab-nav-item:hover,.theme-dark.minimal-eink-dark button.mod-cta,.theme-dark.minimal-eink-dark select:hover,.theme-dark.minimal-eink-dark.is-focused.tabs-modern .mod-active .workspace-tab-header.is-active .workspace-tab-header-inner-title,.theme-dark.minimal-eink-dark.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active,.theme-dark.minimal-eink-dark.labeled-nav .mod-left-split .mod-top .workspace-tab-header:hover,.theme-dark.minimal-eink-dark:not(.colorful-active) .horizontal-tab-nav-item.is-active,.theme-dark.minimal-eink-dark:not(.colorful-active) .vertical-tab-nav-item.is-active,.theme-light.minimal-eink-light #calendar-container .reset-button:hover,.theme-light.minimal-eink-light .cm-s-obsidian span.cm-formatting-highlight,.theme-light.minimal-eink-light .cm-s-obsidian span.cm-highlight,.theme-light.minimal-eink-light .community-item .suggestion-highlight,.theme-light.minimal-eink-light .dropdown:hover,.theme-light.minimal-eink-light .horizontal-tab-nav-item:hover,.theme-light.minimal-eink-light .markdown-rendered mark,.theme-light.minimal-eink-light .mod-root .workspace-tab-header-status-icon,.theme-light.minimal-eink-light .mod-root .workspace-tab-header:hover,.theme-light.minimal-eink-light .search-result-file-match:hover,.theme-light.minimal-eink-light .search-result-file-matched-text,.theme-light.minimal-eink-light .status-bar .plugin-sync:hover .sync-status-icon.mod-success,.theme-light.minimal-eink-light .status-bar .plugin-sync:hover .sync-status-icon.mod-working,.theme-light.minimal-eink-light .status-bar-item.mod-clickable:hover,.theme-light.minimal-eink-light .suggestion-item.is-selected,.theme-light.minimal-eink-light .text-icon-button:hover,.theme-light.minimal-eink-light .vertical-tab-nav-item:hover,.theme-light.minimal-eink-light button.mod-cta,.theme-light.minimal-eink-light select:hover,.theme-light.minimal-eink-light.is-focused.tabs-modern .mod-active .workspace-tab-header.is-active .workspace-tab-header-inner-title,.theme-light.minimal-eink-light.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active,.theme-light.minimal-eink-light.labeled-nav .mod-left-split .mod-top .workspace-tab-header:hover,.theme-light.minimal-eink-light:not(.colorful-active) .horizontal-tab-nav-item.is-active,.theme-light.minimal-eink-light:not(.colorful-active) .vertical-tab-nav-item.is-active{color:var(--bg1)}.theme-dark.minimal-eink-dark .is-flashing,.theme-light.minimal-eink-light .is-flashing{--text-highlight-bg:#999}.theme-dark.minimal-eink-dark #calendar-container .day:hover,.theme-light.minimal-eink-light #calendar-container .day:hover{--color-dot:var(--bg1)}.theme-light.minimal-eink-light{--base-h:0;--base-s:0%;--base-l:100%;--accent-h:0;--accent-s:0%;--accent-l:0%;--ax3:#000;--bg1:#fff;--bg2:#fff;--bg3:#000;--ui1:#000;--ui2:#000;--ui3:#000;--tx1:#000;--tx2:#000;--tx3:#000;--hl1:#000;--hl2:#000;--sp1:#fff;--text-on-accent:#fff;--background-modifier-cover:rgba(235,235,235,1)}.theme-dark.minimal-eink-dark,.theme-light.minimal-eink-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-eink-light.minimal-light-contrast .theme-dark,.theme-light.minimal-eink-light.minimal-light-contrast .titlebar,.theme-light.minimal-eink-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-eink-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-eink-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:0;--base-s:0%;--base-l:0%;--accent-h:0;--accent-s:0%;--accent-l:100%;--ax3:#fff;--bg1:#000;--bg2:#000;--bg3:#fff;--ui1:#fff;--ui2:#fff;--ui3:#fff;--tx1:#fff;--tx2:#fff;--tx3:#fff;--hl1:#fff;--hl2:#fff;--sp1:#000;--background-modifier-cover:rgba(20,20,20,1);--vault-profile-color:var(--tx1);--vault-profile-color-hover:var(--bg1);--nav-item-color-hover:var(--bg1);--nav-item-color-active:var(--bg1)}.theme-light.minimal-eink-light.minimal-light-tonal{--bg3:#bbb;--ui1:#bbb;--tx3:#999}.theme-dark.minimal-eink-dark.minimal-dark-tonal{--bg3:#444;--ui1:#444;--tx3:#999}.theme-dark.minimal-eink-dark.minimal-dark-tonal,.theme-light.minimal-eink-light.minimal-light-tonal{--hl2:var(--bg3);--modal-border-color:var(--ui1);--prompt-border-color:var(--ui1);--tag-border-color:var(--ui1);--text-selection:var(--bg3);--icon-color-active:var(--tx1);--icon-color-focused:var(--tx1);--nav-item-color-active:var(--tx1);--nav-item-color-hover:var(--tx1);--minimal-tab-text-color-active:var(--tx1)}.theme-dark.minimal-eink-dark.minimal-dark-tonal .is-flashing,.theme-dark.minimal-eink-dark.minimal-dark-tonal .search-result-file-matched-text,.theme-light.minimal-eink-light.minimal-light-tonal .is-flashing,.theme-light.minimal-eink-light.minimal-light-tonal .search-result-file-matched-text{background-color:var(--bg3);color:var(--tx1)}.theme-dark.minimal-eink-dark.minimal-dark-tonal #calendar-container .reset-button:hover,.theme-dark.minimal-eink-dark.minimal-dark-tonal ::selection,.theme-dark.minimal-eink-dark.minimal-dark-tonal:not(.colorful-active) .vertical-tab-nav-item.is-active,.theme-dark.minimal-eink-dark.minimal-dark-tonal:not(.colorful-active) .vertical-tab-nav-item:hover,.theme-light.minimal-eink-light.minimal-light-tonal #calendar-container .reset-button:hover,.theme-light.minimal-eink-light.minimal-light-tonal ::selection,.theme-light.minimal-eink-light.minimal-light-tonal:not(.colorful-active) .vertical-tab-nav-item.is-active,.theme-light.minimal-eink-light.minimal-light-tonal:not(.colorful-active) .vertical-tab-nav-item:hover{color:var(--tx1)}.theme-light.minimal-everforest-light{--color-red-rgb:248,85,82;--color-orange-rgb:245,125,38;--color-yellow-rgb:223,160,0;--color-green-rgb:141,161,1;--color-cyan-rgb:53,167,124;--color-blue-rgb:56,148,196;--color-purple-rgb:223,105,186;--color-pink-rgb:223,105,186;--color-red:#f85552;--color-orange:#f57d26;--color-yellow:#dfa000;--color-green:#8da101;--color-cyan:#35a77c;--color-blue:#3795C5;--color-purple:#df69ba;--color-pink:#df69ba}.theme-dark.minimal-everforest-dark{--color-red-rgb:230,126,128;--color-orange-rgb:230,152,117;--color-yellow-rgb:219,188,127;--color-green-rgb:167,192,128;--color-cyan-rgb:131,192,146;--color-blue-rgb:127,187,179;--color-purple-rgb:223,105,186;--color-pink-rgb:223,105,186;--color-red:#e67e80;--color-orange:#e69875;--color-yellow:#dbbc7f;--color-green:#a7c080;--color-cyan:#83c092;--color-blue:#7fbbb3;--color-purple:#d699b6;--color-pink:#d699b6}.theme-light.minimal-everforest-light{--base-h:44;--base-s:87%;--base-l:94%;--accent-h:83;--accent-s:36%;--accent-l:53%;--bg1:#fdf6e3;--bg2:#efebd4;--bg3:rgba(226,222,198,.5);--ui1:#e0dcc7;--ui2:#bec5b2;--ui3:#bec5b2;--tx1:#5C6A72;--tx2:#829181;--tx3:#a6b0a0;--hl1:rgba(198,214,152,.4);--hl2:rgba(222,179,51,.3)}.theme-light.minimal-everforest-light.minimal-light-tonal{--bg2:#fdf6e3}.theme-light.minimal-everforest-light.minimal-light-white{--bg3:#f3efda;--ui1:#edead5}.theme-dark.minimal-everforest-dark,.theme-light.minimal-everforest-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-everforest-light.minimal-light-contrast .theme-dark,.theme-light.minimal-everforest-light.minimal-light-contrast .titlebar,.theme-light.minimal-everforest-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-everforest-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-everforest-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:203;--base-s:15%;--base-l:23%;--accent-h:81;--accent-s:34%;--accent-l:63%;--bg1:#2d353b;--bg2:#232a2e;--bg3:rgba(71,82,88,0.5);--ui1:#475258;--ui2:#4f585e;--ui3:#525c62;--tx1:#d3c6aa;--tx2:#9da9a0;--tx3:#7a8478;--hl1:rgba(134,70,93,.5);--hl2:rgba(147,185,96,.3)}.theme-dark.minimal-everforest-dark.minimal-dark-black{--hl1:rgba(134,70,93,.4);--ui1:#2b3339}.theme-light.minimal-flexoki-light{--color-red-rgb:175,48,41;--color-orange-rgb:188,82,21;--color-yellow-rgb:173,131,1;--color-green-rgb:102,128,11;--color-cyan-rgb:36,131,123;--color-blue-rgb:32,94,166;--color-purple-rgb:94,64,157;--color-pink-rgb:160,47,111;--color-red:#AF3029;--color-orange:#BC5215;--color-yellow:#AD8301;--color-green:#66800B;--color-cyan:#24837B;--color-blue:#205EA6;--color-purple:#5E409D;--color-pink:#A02F6F}.theme-dark.minimal-flexoki-dark{--color-red-rgb:209,77,65;--color-orange-rgb:218,112,44;--color-yellow-rgb:208,162,21;--color-green-rgb:135,154,57;--color-cyan-rgb:58,169,159;--color-blue-rgb:67,133,190;--color-purple-rgb:139,126,200;--color-pink-rgb:206,93,151;--color-red:#D14D41;--color-orange:#DA702C;--color-yellow:#D0A215;--color-green:#879A39;--color-cyan:#3AA99F;--color-blue:#4385BE;--color-purple:#8B7EC8;--color-pink:#CE5D97}.theme-light.minimal-flexoki-light{--base-h:48;--base-s:100%;--base-l:97%;--accent-h:175;--accent-s:57%;--accent-l:33%;--bg1:#FFFCF0;--bg2:#F2F0E5;--bg3:rgba(16,15,15,0.05);--ui1:#E6E4D9;--ui2:#DAD8CE;--ui3:#CECDC3;--tx1:#100F0F;--tx2:#6F6E69;--tx3:#B7B5AC;--hl1:rgba(187,220,206,0.3);--hl2:rgba(247,209,61,0.3)}.theme-light.minimal-flexoki-light.minimal-light-tonal{--bg2:#FFFCF0}.theme-dark.minimal-flexoki-dark,.theme-light.minimal-flexoki-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-flexoki-light.minimal-light-contrast .theme-dark,.theme-light.minimal-flexoki-light.minimal-light-contrast .titlebar,.theme-light.minimal-flexoki-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-flexoki-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-flexoki-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:360;--base-s:3%;--base-l:6%;--accent-h:175;--accent-s:49%;--accent-l:45%;--bg1:#100F0F;--bg2:#1C1B1A;--bg3:rgba(254,252,240,0.05);--ui1:#282726;--ui2:#343331;--ui3:#403E3C;--tx1:#CECDC3;--tx2:#878580;--tx3:#575653;--hl1:rgba(30,95,91,0.3);--hl2:rgba(213,159,17,0.3)}.theme-dark.minimal-flexoki-dark.minimal-dark-black{--ui1:#1C1B1A}.theme-dark.minimal-gruvbox-dark,.theme-light.minimal-gruvbox-light{--color-red-rgb:204,36,29;--color-orange-rgb:214,93,14;--color-yellow-rgb:215,153,33;--color-green-rgb:152,151,26;--color-cyan-rgb:104,157,106;--color-blue-rgb:69,133,136;--color-purple-rgb:177,98,134;--color-pink-rgb:177,98,134;--color-red:#cc241d;--color-orange:#d65d0e;--color-yellow:#d79921;--color-green:#98971a;--color-cyan:#689d6a;--color-blue:#458588;--color-purple:#b16286;--color-pink:#b16286}.theme-light.minimal-gruvbox-light{--base-h:49;--base-s:92%;--base-l:89%;--accent-h:24;--accent-s:88%;--accent-l:45%;--bg1:#fcf2c7;--bg2:#f2e6bd;--bg3:#ebd9b3;--ui1:#ebdbb2;--ui2:#d5c4a1;--ui3:#bdae93;--tx1:#282828;--tx2:#7c7065;--tx3:#a89a85;--hl1:rgba(192,165,125,.3);--hl2:rgba(215,153,33,.4)}.theme-light.minimal-gruvbox-light.minimal-light-tonal{--bg2:#fcf2c7}.theme-light.minimal-gruvbox-light.minimal-light-white{--bg3:#faf5d7;--ui1:#f2e6bd}.theme-dark.minimal-gruvbox-dark,.theme-light.minimal-gruvbox-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-gruvbox-light.minimal-light-contrast .theme-dark,.theme-light.minimal-gruvbox-light.minimal-light-contrast .titlebar,.theme-light.minimal-gruvbox-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-gruvbox-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-gruvbox-light.minimal-light-contrast.minimal-status-off .status-bar{--accent-h:24;--accent-s:88%;--accent-l:45%;--bg1:#282828;--bg2:#1e2021;--bg3:#3d3836;--bg3:rgba(62,57,55,0.5);--ui1:#3c3836;--ui2:#504945;--ui3:#665c54;--tx1:#fbf1c7;--tx2:#bdae93;--tx3:#7c6f64;--hl1:rgba(173,149,139,0.3);--hl2:rgba(215,153,33,.4)}.theme-dark.minimal-gruvbox-dark.minimal-dark-black{--hl1:rgba(173,149,139,0.4);--ui1:#282828}.theme-dark.minimal-macos-dark,.theme-light.minimal-macos-light{--color-red-rgb:255,59,49;--color-orange-rgb:255,149,2;--color-yellow-rgb:255,204,0;--color-green-rgb:42,205,65;--color-cyan-rgb:2,199,190;--color-blue-rgb:2,122,255;--color-purple-rgb:176,81,222;--color-pink-rgb:255,46,85;--color-red:#ff3b31;--color-orange:#ff9502;--color-yellow:#ffcc00;--color-green:#2acd41;--color-cyan:#02c7be;--color-blue:#027aff;--color-purple:#b051de;--color-pink:#ff2e55}.theme-light.minimal-macos-light{--base-h:106;--base-s:0%;--base-l:94%;--accent-h:212;--accent-s:100%;--accent-l:50%;--bg1:#fff;--bg2:#f0f0f0;--bg3:rgba(0,0,0,.1);--ui1:#e7e7e7;--tx1:#454545;--tx2:#808080;--tx3:#b0b0b0;--hl1:#b3d7ff}.theme-light.minimal-macos-light.minimal-light-tonal{--bg1:#f0f0f0;--bg2:#f0f0f0}.theme-dark.minimal-macos-dark,.theme-light.minimal-macos-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-macos-light.minimal-light-contrast .theme-dark,.theme-light.minimal-macos-light.minimal-light-contrast .titlebar,.theme-light.minimal-macos-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-macos-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-macos-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:106;--base-s:0%;--base-l:12%;--accent-h:212;--accent-s:100%;--accent-l:50%;--bg1:#1e1e1e;--bg2:#282828;--bg3:rgba(255,255,255,0.11);--divider-color:#000;--tab-outline-color:#000;--ui1:#373737;--ui2:#515151;--ui3:#595959;--tx1:#dcdcdc;--tx2:#8c8c8c;--tx3:#686868;--hl1:rgba(98,169,252,0.5);--sp1:#fff}.theme-dark.minimal-macos-dark.minimal-dark-black{--divider-color:#1e1e1e;--tab-outline-color:#1e1e1e}.theme-dark.minimal-nord-dark,.theme-light.minimal-nord-light{--color-red-rgb:191,97,106;--color-orange-rgb:208,138,112;--color-yellow-rgb:235,203,139;--color-green-rgb:163,190,140;--color-cyan-rgb:136,192,208;--color-blue-rgb:129,161,193;--color-purple-rgb:180,142,173;--color-pink-rgb:180,142,173;--color-red:#BF616A;--color-orange:#D08770;--color-yellow:#EBCB8B;--color-green:#A3BE8C;--color-cyan:#88C0D0;--color-blue:#81A1C1;--color-purple:#B48EAD;--color-pink:#B48EAD}.theme-light.minimal-nord-light{--base-h:221;--base-s:27%;--base-l:94%;--accent-h:213;--accent-s:32%;--accent-l:52%;--bg1:#fff;--bg2:#eceff4;--bg3:rgba(157,174,206,0.25);--ui1:#d8dee9;--ui2:#BBCADC;--ui3:#81a1c1;--tx1:#2e3440;--tx2:#7D8697;--tx3:#ADB1B8;--hl2:rgba(208, 135, 112, 0.35)}.theme-dark.minimal-nord-dark,.theme-light.minimal-nord-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-nord-light.minimal-light-contrast .theme-dark,.theme-light.minimal-nord-light.minimal-light-contrast .titlebar,.theme-light.minimal-nord-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-nord-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-nord-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:220;--base-s:16%;--base-l:22%;--accent-h:213;--accent-s:32%;--accent-l:52%;--bg1:#2e3440;--bg2:#3b4252;--bg3:rgba(135,152,190,0.15);--ui1:#434c5e;--ui2:#58647b;--ui3:#58647b;--tx1:#d8dee9;--tx2:#9eafcc;--tx3:#4c566a;--hl1:rgba(129,142,180,0.3);--hl2:rgba(208, 135, 112, 0.35)}.theme-dark.minimal-nord-dark.minimal-dark-black{--ui1:#2e3440}.theme-light.minimal-notion-light{--base-h:39;--base-s:18%;--base-d:96%;--accent-h:197;--accent-s:71%;--accent-l:52%;--bg2:#f7f6f4;--bg3:#e8e7e4;--ui1:#ededec;--ui2:#dbdbda;--ui3:#aaa9a5;--tx1:#37352f;--tx2:#72706c;--tx3:#aaa9a5;--hl1:rgba(131,201,229,0.3)}.theme-dark.minimal-notion-dark,.theme-light.minimal-notion-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-notion-light.minimal-light-contrast .theme-dark,.theme-light.minimal-notion-light.minimal-light-contrast .titlebar,.theme-light.minimal-notion-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-notion-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-notion-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:203;--base-s:8%;--base-d:20%;--accent-h:197;--accent-s:71%;--accent-l:52%;--bg1:#2f3437;--bg2:#373c3f;--bg3:#4b5053;--ui1:#3e4245;--ui2:#585d5f;--ui3:#585d5f;--tx1:#ebebeb;--tx2:#909295;--tx3:#585d5f;--hl1:rgba(57,134,164,0.3)}.theme-dark.minimal-notion-dark.minimal-dark-black{--base-d:5%;--bg3:#232729;--ui1:#2f3437}.theme-light.minimal-rose-pine-light{--color-red-rgb:180,99,122;--color-orange-rgb:215,130,125;--color-yellow-rgb:234,157,53;--color-green-rgb:40,105,131;--color-cyan-rgb:87,147,159;--color-blue-rgb:87,147,159;--color-purple-rgb:144,122,169;--color-pink-rgb:144,122,169;--color-red:#b4637a;--color-orange:#d7827e;--color-yellow:#ea9d34;--color-green:#286983;--color-cyan:#56949f;--color-blue:#56949f;--color-purple:#907aa9;--color-pink:#907aa9}.theme-dark.minimal-rose-pine-dark{--color-red-rgb:234,111,146;--color-orange-rgb:233,155,151;--color-yellow-rgb:246,193,119;--color-green-rgb:47,116,143;--color-cyan-rgb:157,207,215;--color-blue-rgb:157,207,215;--color-purple-rgb:196,167,231;--color-pink-rgb:196,167,231;--color-red:#eb6f92;--color-orange:#ea9a97;--color-yellow:#f6c177;--color-green:#31748f;--color-cyan:#9ccfd8;--color-blue:#9ccfd8;--color-purple:#c4a7e7;--color-pink:#c4a7e7}.theme-light.minimal-rose-pine-light{--base-h:32;--base-s:57%;--base-l:95%;--accent-h:3;--accent-s:53%;--accent-l:67%;--bg1:#fffaf3;--bg2:#faf4ed;--bg3:rgba(233,223,218,0.5);--ui1:#EAE3E1;--ui2:#dfdad9;--ui3:#cecacd;--tx1:#575279;--tx2:#797593;--tx3:#9893a5;--hl1:rgba(191,180,181,0.35)}.theme-dark.minimal-rose-pine-dark,.theme-light.minimal-rose-pine-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-rose-pine-light.minimal-light-contrast .theme-dark,.theme-light.minimal-rose-pine-light.minimal-light-contrast .titlebar,.theme-light.minimal-rose-pine-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-rose-pine-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-rose-pine-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:247;--base-s:23%;--base-l:15%;--accent-h:2;--accent-s:55%;--accent-l:83%;--bg1:#1f1d2e;--bg2:#191724;--bg3:rgba(68,66,86,0.5);--ui1:#312F41;--ui2:#403d52;--ui3:#524f67;--tx1:#e0def4;--tx2:#908caa;--tx3:#6e6a86;--hl1:rgba(126,121,155,0.35)}.theme-dark.minimal-rose-pine-dark.minimal-dark-black{--ui1:#21202e}.theme-dark.minimal-solarized-dark,.theme-light.minimal-solarized-light{--color-red-rgb:220,50,47;--color-orange-rgb:203,77,22;--color-yellow-rgb:181,137,0;--color-green-rgb:133,153,0;--color-cyan-rgb:42,161,152;--color-blue-rgb:38,139,210;--color-purple-rgb:108,113,196;--color-pink-rgb:211,54,130;--color-red:#dc322f;--color-orange:#cb4b16;--color-yellow:#b58900;--color-green:#859900;--color-cyan:#2aa198;--color-blue:#268bd2;--color-purple:#6c71c4;--color-pink:#d33682}.theme-light.minimal-solarized-light{--base-h:44;--base-s:87%;--base-l:94%;--accent-h:205;--accent-s:70%;--accent-l:48%;--bg1:#fdf6e3;--bg2:#eee8d5;--bg3:rgba(0,0,0,0.062);--ui1:#e9e1c8;--ui2:#d0cab8;--ui3:#d0cab8;--tx1:#073642;--tx2:#586e75;--tx3:#ABB2AC;--tx4:#586e75;--hl1:rgba(202,197,182,0.3);--hl2:rgba(203,75,22,0.3)}.theme-light.minimal-solarized-light.minimal-light-tonal{--bg2:#fdf6e3}.theme-dark.minimal-solarized-dark,.theme-light.minimal-solarized-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-solarized-light.minimal-light-contrast .theme-dark,.theme-light.minimal-solarized-light.minimal-light-contrast .titlebar,.theme-light.minimal-solarized-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-solarized-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-solarized-light.minimal-light-contrast.minimal-status-off .status-bar{--accent-h:205;--accent-s:70%;--accent-l:48%;--base-h:193;--base-s:98%;--base-l:11%;--bg1:#002b36;--bg2:#073642;--bg3:rgba(255,255,255,0.062);--ui1:#19414B;--ui2:#274850;--ui3:#31535B;--tx1:#93a1a1;--tx2:#657b83;--tx3:#31535B;--tx4:#657b83;--hl1:rgba(15,81,98,0.3);--hl2:rgba(203, 75, 22, 0.35)}.theme-dark.minimal-solarized-dark.minimal-dark-black{--hl1:rgba(15,81,98,0.55);--ui1:#002b36}.theme-dark.minimal-things-dark,.theme-light.minimal-things-light{--color-red-rgb:255,48,108;--color-orange-rgb:255,149,2;--color-yellow-rgb:255,213,0;--color-green-rgb:75,191,94;--color-cyan-rgb:73,174,164;--color-purple-rgb:176,81,222;--color-pink-rgb:255,46,85;--color-red:#FF306C;--color-orange:#ff9502;--color-yellow:#FFD500;--color-green:#4BBF5E;--color-cyan:#49AEA4;--color-purple:#b051de;--color-pink:#ff2e55}.theme-light.minimal-things-light{--color-blue-rgb:27,97,194;--color-blue:#1b61c2}.theme-dark.minimal-things-dark{--color-blue-rgb:77,149,247;--color-blue:#4d95f7}.theme-light.minimal-things-light{--accent-h:215;--accent-s:76%;--accent-l:43%;--bg1:white;--bg2:#f5f6f8;--bg3:rgba(162,177,187,0.25);--ui1:#eef0f4;--ui2:#D8DADD;--ui3:#c1c3c6;--tx1:#26272b;--tx2:#7D7F84;--tx3:#a9abb0;--hl1:#cae2ff}.theme-light.minimal-things-light.minimal-light-tonal{--ui1:#e6e8ec}.theme-light.minimal-things-light.minimal-light-white{--bg3:#f5f6f8}.theme-dark.minimal-things-dark,.theme-light.minimal-things-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-things-light.minimal-light-contrast .theme-dark,.theme-light.minimal-things-light.minimal-light-contrast .titlebar,.theme-light.minimal-things-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-things-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-things-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:218;--base-s:9%;--base-l:15%;--accent-h:215;--accent-s:91%;--accent-l:64%;--bg1:#24262a;--bg2:#202225;--bg3:#3d3f41;--divider-color:#17191c;--tab-outline-color:#17191c;--ui1:#3A3B3F;--ui2:#45464a;--ui3:#6c6e70;--tx1:#fbfbfb;--tx2:#CBCCCD;--tx3:#6c6e70;--hl1:rgba(40,119,236,0.35);--sp1:#fff}.theme-dark.minimal-things-dark.minimal-dark-black{--base-d:5%;--bg3:#24262a;--divider-color:#24262a;--tab-outline-color:#24262a} +/* Plugin compatibility */ + +/* @plugins +core: +- backlink +- command-palette +- daily-notes +- file-explorer +- file-recovery +- global-search +- graph +- outgoing-link +- outline +- page-preview +- publish +- random-note +- starred +- switcher +- sync +- tag-pane +- word-count +community: +- buttons +- dataview +- calendar +- obsidian-charts +- obsidian-checklist-plugin +- obsidian-codemirror-options +- obsidian-dictionary-plugin +- obsidian-embedded-note-titles +- obsidian-excalidraw-plugin +- obsidian-git +- obsidian-hider +- obsidian-hover-editor +- obsidian-kanban +- obsidian-metatable +- obsidian-minimal-settings +- obsidian-outliner +- obsidian-system-dark-mode +- obsidian-style-settings +- quickadd +- sliding-panes-obsidian +- todoist-sync-plugin +*/ +/* @settings + +name: Minimal +id: minimal-style +settings: + - + id: instructions + title: Documentation + type: heading + level: 2 + collapsed: true + description: Use the Minimal Theme Settings plugin to set hotkeys, adjust features, select fonts, and choose from preset color schemes. Use the settings below for more granular customization. Go to https://minimal.guide for documentation. + - + id: interface + title: Interface colors + type: heading + level: 2 + collapsed: true + - + id: base + title: Base color + description: Defines all background and border colors unless overridden in more granular settings + type: variable-themed-color + format: hsl-split + default-light: '#' + default-dark: '#' + - + id: bg1 + title: Primary background + description: Background color for the main window + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: bg2 + title: Secondary background + description: Background color for left sidebar and menus + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: bg3 + title: Active background + description: Background color for hovered buttons and currently selected file + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: ui1 + title: Border color + type: variable-themed-color + description: For buttons, divider lines, and outlined elements + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: ui2 + title: Highlighted border color + description: Used when hovering over buttons, dividers, and outlined elements + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: ui3 + title: Active border color + description: Used when clicking buttons and outlined elements + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: accent-color + title: Accent color + type: heading + level: 2 + collapsed: true + - + id: ax1 + title: Accent color + type: variable-themed-color + description: Used primarily for links + format: hex + default-light: '#' + default-dark: '#' + - + id: ax2 + title: Accent color (hover) + type: variable-themed-color + description: Used primarily for hovered links + format: hex + default-light: '#' + default-dark: '#' + - + id: ax3 + title: Accent color interactive + type: variable-themed-color + description: Used for buttons, checklists, toggles + format: hex + default-light: '#' + default-dark: '#' + - + id: sp1 + title: Text on accent + type: variable-themed-color + description: Used primarily for text on accented buttons + format: hex + default-light: '#' + default-dark: '#' + - + id: extended-palette + title: Extended colors + type: heading + level: 2 + collapsed: true + - + id: color-red + title: Red + description: Extended palette colors are defaults used for progress bar status, syntax highlighting, colorful headings, and graph nodes + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: color-orange + title: Orange + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: color-yellow + title: Yellow + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: color-green + title: Green + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: color-cyan + title: Cyan + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: color-blue + title: Blue + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: color-purple + title: Purple + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: color-pink + title: Pink + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: bases + title: Bases + type: heading + level: 2 + collapsed: true + - + id: bases-toolbar-opacity + title: Toolbar opacity + type: variable-number-slider + default: 1 + min: 0 + max: 1 + step: 0.05 + - + id: bases-table-header-icon-display + title: Table header icons + type: variable-select + allowEmpty: false + default: flex + options: + - + label: Visible + value: flex + - + label: Hidden + value: none + - + id: bases-table-row-height + title: Table row height + type: variable-number + default: 30 + format: px + - + id: blockquotes + title: Blockquotes + type: heading + level: 2 + collapsed: true + - + id: blockquote-color + title: Blockquote text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: blockquote-background-color + title: Blockquote background color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: blockquote-border-color + title: Blockquote border color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: blockquote-border-thickness + title: Blockquote border thickness + type: variable-number-slider + format: px + default: 1 + min: 0 + max: 5 + step: 1 + - + id: blockquote-size + title: Blockquote font size + description: Accepts any CSS font-size value + type: variable-text + default: '' + - + id: blockquote-font-style + title: Blockquote font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: callouts + title: Callouts + type: heading + level: 2 + collapsed: true + - + id: callouts-style + title: Callout style + type: class-select + allowEmpty: false + default: callouts-default + options: + - + label: Filled + value: callouts-default + - + label: Outlined + value: callouts-outlined + - + id: callout-blend-mode + title: Color blending + description: Blend the color of nested callouts + type: variable-select + allowEmpty: false + default: var(--highlight-mix-blend-mode) + options: + - + label: On + value: var(--highlight-mix-blend-mode) + - + label: Off + value: normal + - + id: canvas + title: Canvas + type: heading + level: 2 + collapsed: true + - + id: canvas-dot-pattern + title: Canvas dot pattern + description: Color for background dot pattern + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-blocks + title: Code blocks + type: heading + level: 2 + collapsed: true + - + id: code-size + title: Code font size + description: Accepts any CSS font-size value + type: variable-text + default: 0.8em + - + id: minimal-code-scroll + title: Scroll long lines + description: Turns off line wrap for code + type: class-toggle + default: false + - + id: code-background + title: Code background color + description: Background for code blocks + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-normal + title: Code text color + description: Color of code when syntax highlighting is not present + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: syntax-highlighting + title: Syntax highlighting + type: heading + level: 3 + collapsed: false + - + id: code-comment + title: "Syntax: comments" + description: Syntax highlighting for comments + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-function + title: "Syntax: functions" + description: Syntax highlighting for functions + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-keyword + title: "Syntax: keywords" + description: Syntax highlighting for keywords + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-important + title: "Syntax: important" + description: Syntax highlighting for important text + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-operator + title: "Syntax: operators" + description: Syntax highlighting for operators + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-property + title: "Syntax: properties" + description: Syntax highlighting for properties + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-punctuation + title: "Syntax: punctuation" + description: Syntax highlighting for punctuation + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-string + title: "Syntax: strings" + description: Syntax highlighting for strings + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-tag + title: "Syntax: tags" + description: Syntax highlighting for tags + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-value + title: "Syntax: values" + description: Syntax highlighting for values + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: dataview + title: Dataview + type: heading + level: 2 + collapsed: true + - + id: trim-cols + title: Trim Dataview columns + description: Disables word wrapping in table cells, and trims long text + type: class-toggle + default: true + - + id: dataview-inline-lists + title: Force tables lists inline + description: Makes lists inside of table cells inline and comma separated + type: class-toggle + default: false + - + id: max-col-width + title: Dataview maximum column width + description: Maximum width for Dataview columns, accepts any CSS width value + type: variable-text + default: 18em + - + id: embed-blocks + title: Embeds and transclusions + type: heading + level: 2 + collapsed: true + - + id: embed-strict + title: Use strict embed style globally + description: Transclusions appear seamlessly in the flow of text. Can be enabled per file using the embed-strict helper class + type: class-toggle + default: false + - + id: embed-hide-title + title: Hide embed titles + description: Hide title of the transcluded file (if strict embed is off) + type: class-toggle + default: false + - + id: embed-underline + title: Underline embedded text + description: Transcluded text is underlined. Can be enabled per file using the embed-underline helper class + type: class-toggle + default: false + - + id: embed-max-height + title: Maximum height of embeds + type: variable-text + description: For transcluded text, accepts valid CSS units + default: '' + - + id: embed-decoration-style + title: Embedded text underline style + type: variable-select + description: Requires underlines to be enabled + allowEmpty: true + default: solid + options: + - + label: Solid + value: solid + - + label: Dashed + value: dashed + - + label: Dotted + value: dotted + - + label: Double + value: double + - + label: Wavy + value: wavy + - + id: embed-decoration-color + title: Embedded text underline color + type: variable-themed-color + description: Requires underlines to be enabled + format: hex + default-light: '#' + default-dark: '#' + - + id: embed-background + title: Embed background + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: graphs + title: Graphs + type: heading + level: 2 + collapsed: true + - + id: graph-line + title: Line color + description: Changing graph colors requires closing and reopening graph panes or restarting Obsidian + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: graph-node + title: Node color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: graph-node-focused + title: Active node color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: graph-node-tag + title: Tag node color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: graph-node-attachment + title: Attachment node color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: graph-node-unresolved + title: Unresolved node color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: headings + title: Headings + type: heading + level: 2 + collapsed: true + - + id: level-1-headings + title: Level 1 Headings + type: heading + level: 3 + collapsed: true + - + id: h1-font + title: H1 font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: h1-size + title: H1 font size + description: Accepts any CSS font-size value + type: variable-text + default: 1.125em + - + id: h1-weight + title: H1 font weight + type: variable-number-slider + default: 600 + min: 100 + max: 900 + step: 100 + - + id: h1-color + title: H1 text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: h1-variant + title: H1 font variant + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Small caps + value: small-caps + - + label: All small caps + value: all-small-caps + - + id: h1-style + title: H1 font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: h1-l + title: H1 divider line + description: Adds a border below the heading + type: class-toggle + default: false + - + id: level-2-headings + title: Level 2 Headings + type: heading + level: 3 + collapsed: true + - + id: h2-font + title: H2 font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: h2-size + title: H2 font size + description: Accepts any CSS font-size value + type: variable-text + default: 1em + - + id: h2-weight + title: H2 font weight + type: variable-number-slider + default: 600 + min: 100 + max: 900 + step: 100 + - + id: h2-color + title: H2 text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: h2-variant + title: H2 font variant + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Small caps + value: small-caps + - + label: All small caps + value: all-small-caps + - + id: h2-style + title: H2 font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: h2-l + title: H2 divider line + description: Adds a border below the heading + type: class-toggle + default: false + - + id: level-3-headings + title: Level 3 Headings + type: heading + level: 3 + collapsed: true + - + id: h3-font + title: H3 font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: h3-size + title: H3 font size + description: Accepts any CSS font-size value + type: variable-text + default: 1em + - + id: h3-weight + title: H3 font weight + type: variable-number-slider + default: 600 + min: 100 + max: 900 + step: 100 + - + id: h3-color + title: H3 text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: h3-variant + title: H3 font variant + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Small caps + value: small-caps + - + label: All small caps + value: all-small-caps + - + id: h3-style + title: H3 font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: h3-l + title: H3 divider line + description: Adds a border below the heading + type: class-toggle + default: false + - + id: level-4-headings + title: Level 4 Headings + type: heading + level: 3 + collapsed: true + - + id: h4-font + title: H4 font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: h4-size + title: H4 font size + description: Accepts any CSS font-size value + type: variable-text + default: 0.9em + - + id: h4-weight + title: H4 font weight + type: variable-number-slider + default: 500 + min: 100 + max: 900 + step: 100 + - + id: h4-color + title: H4 text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: h4-variant + title: H4 font variant + type: variable-select + allowEmpty: false + default: small-caps + options: + - + label: Normal + value: normal + - + label: Small caps + value: small-caps + - + label: All small caps + value: all-small-caps + - + id: h4-style + title: H4 font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: h4-l + title: H4 divider line + description: Adds a border below the heading + type: class-toggle + default: false + - + id: level-5-headings + title: Level 5 Headings + type: heading + level: 3 + collapsed: true + - + id: h5-font + title: H5 font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: h5-size + title: H5 font size + description: Accepts any CSS font-size value + type: variable-text + default: 0.85em + - + id: h5-weight + title: H5 font weight + type: variable-number-slider + default: 500 + min: 100 + max: 900 + step: 100 + - + id: h5-color + title: H5 text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: h5-variant + title: H5 font variant + type: variable-select + allowEmpty: false + default: small-caps + options: + - + label: Normal + value: normal + - + label: Small caps + value: small-caps + - + label: All small caps + value: all-small-caps + - + id: h5-style + title: H5 font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: h5-l + title: H5 divider line + description: Adds a border below the heading + type: class-toggle + default: false + - + id: level-6-headings + title: Level 6 Headings + type: heading + level: 3 + collapsed: true + - + id: h6-font + title: H6 font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: h6-size + title: H6 font size + description: Accepts any CSS font-size value + type: variable-text + default: 0.85em + - + id: h6-weight + title: H6 font weight + type: variable-number-slider + default: 400 + min: 100 + max: 900 + step: 100 + - + id: h6-color + title: H6 text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: h6-variant + title: H6 font variant + type: variable-select + allowEmpty: false + default: small-caps + options: + - + label: Normal + value: normal + - + label: Small caps + value: small-caps + - + label: All small caps + value: all-small-caps + - + id: h6-style + title: H6 font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: h6-l + title: H6 divider line + type: class-toggle + description: Adds a border below the heading + default: false + - + id: icons + title: Icons + type: heading + level: 2 + collapsed: true + - + id: icon-muted + title: Icon opacity (inactive) + type: variable-number-slider + default: 0.5 + min: 0.25 + max: 1 + step: 0.05 + - + id: icon-color + title: Icon color + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: icon-color-hover + title: Icon color (hover) + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: icon-color-active + title: Icon color (active) + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: icon-color-focused + title: Icon color (focused) + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: images + title: Images + type: heading + level: 2 + collapsed: true + - + id: image-muted + title: Image opacity in dark mode + description: Level of fading for images in dark mode. Hover over images to display at full brightness. + type: variable-number-slider + default: 0.7 + min: 0.25 + max: 1 + step: 0.05 + - + id: image-radius + title: Image radius + description: Rounded corners for images + type: variable-number-slider + default: 4 + min: 0 + max: 16 + step: 1 + format: px + - + id: image-blend-light + title: Blend images in light mode + description: Allow images to blend into the color scheme background color + type: class-toggle + default: false + - + id: zoom-off + title: Disable image zoom + description: Turns off click + hold to zoom images + type: class-toggle + - + id: image-grid-fit + title: Image grid crop + description: Sets how images get cropped in a grid + type: variable-select + default: cover + options: + - + label: Crop to fit + value: cover + - + label: Show full image + value: contain + - + id: image-grid-background + title: Image grid background + description: Background of images in cells, useful when images are not cropped to fit + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: indentation-guides + title: Indentation guides + type: heading + level: 2 + collapsed: true + - + id: indentation-guide-color + title: Indentation guide color + type: variable-themed-color + format: hex + opacity: true + default-light: '#' + default-dark: '#' + - + id: indentation-guide-color-active + title: Indentation guide color (active) + type: variable-themed-color + format: hex + opacity: true + default-light: '#' + default-dark: '#' + - + id: links + title: Links + type: heading + level: 2 + collapsed: true + - + id: links-internal + title: Internal links + type: heading + level: 3 + collapsed: true + - + id: link-color + title: Internal link color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: link-color-hover + title: Internal link color (hover) + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: link-unresolved-opacity + title: Unresolved link opacity + type: variable-number-slider + default: 0.7 + min: 0.25 + max: 1 + step: 0.05 + - + id: link-unresolved-color + title: Unresolved link color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: link-unresolved-decoration-color + title: Unresolved link underline color + type: variable-themed-color + format: hex + opacity: true + default-light: '#' + default-dark: '#' + - + id: links-external + title: External links + type: heading + level: 3 + collapsed: true + - + id: link-external-color + title: External link color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: link-external-color-hover + title: External link color (hover) + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: active-line + title: Line numbers + type: heading + level: 2 + collapsed: true + - + id: active-line-on + title: Highlight active line + description: Adds a background to current line in editor + type: class-toggle + default: false + - + id: folding-offset + title: Gutter offset + description: Width of the file margin used for gutter + type: variable-number-slider + default: 32 + min: 0 + max: 60 + step: 1 + format: px + - + id: gutter-background + title: Gutter background + type: variable-themed-color + format: hex + opacity: true + default-light: '#' + default-dark: '#' + - + id: line-number-color + title: Line number color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: line-number-color-active + title: Active line number color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: active-line-bg + title: Active line background + description: Using a low opacity color is recommended to avoid conflicting with highlights + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: lists + title: Lists and tasks + type: heading + level: 2 + collapsed: true + - + id: checkbox-color + title: Checkbox color + description: Background color for completed tasks + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: checkbox-shape + title: Checkbox shape + type: class-select + allowEmpty: false + default: checkbox-circle + options: + - + label: Circle + value: checkbox-circle + - + label: Square + value: checkbox-square + - + id: minimal-strike-lists + title: Strike completed tasks + description: Adds strikethrough line and greyed text for completed tasks + type: class-toggle + default: false + - + id: list-spacing + title: List item spacing + description: Vertical space between list items in em units + type: variable-number-slider + default: 0.075 + min: 0 + max: 0.3 + step: 0.005 + format: em + - + id: list-indent + title: Nested list indentation + description: Horizontal space from left in em units + type: variable-number-slider + default: 2 + min: 1 + max: 3.5 + step: 0.1 + format: em + - + id: pdf + title: PDFs + type: heading + level: 2 + collapsed: true + - + id: pdf-page-style + title: PDF page style + description: Borders and shadows around pages + type: class-select + allowEmpty: false + default: pdf-seamless-on + options: + - + label: Seamless + value: pdf-seamless-on + - + label: Shadows + value: pdf-shadows-on + - + id: pdf-invert-dark + title: Invert PDFs in dark mode + description: Best for working with black text on white pages + type: class-toggle + default: true + - + id: pdf-blend-light + title: Blend PDFs in light mode + description: Allow PDFs to blend into the color scheme background color + type: class-toggle + default: true + - + id: pdf-dark-opacity + title: PDF opacity in dark mode + description: Fade PDF pages in dark mode + type: variable-number-slider + default: 1 + min: 0.25 + max: 1 + step: 0.05 + - + id: progress + title: Progress bars + type: heading + level: 2 + collapsed: true + - + id: progress-complete + title: Completed progress bar color + description: Defaults to your accent color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: properties + title: Properties + type: heading + level: 2 + collapsed: true + - + id: metadata-heading-off + title: Hide properties heading + description: Hide "Properties" heading above properties + type: class-toggle + default: false + - + id: metadata-add-property-off + title: Hide "Add property" button + description: Hide "Add property" button below properties + type: class-toggle + default: false + - + id: metadata-icons-off + title: Hide property icons + description: Hide icons next to property names + type: class-toggle + default: false + - + id: metadata-dividers + title: Property row lines + description: Display borders between properties + type: class-toggle + default: false + - + id: metadata-label-width-multiplier + title: Property name width + description: Width for the name of the property + type: variable-number-slider + default: 9 + min: 4 + max: 12 + step: 0.25 + - + id: sidebars + title: Sidebars + type: heading + level: 2 + collapsed: true + - + id: sidebar-tabs-style + title: Sidebar tab style + type: class-select + allowEmpty: false + default: sidebar-tabs-default + options: + - + label: Index round + value: sidebar-tabs-index + - + label: Index square + value: sidebar-tabs-square + - + label: Modern compact + value: sidebar-tabs-default + - + label: Modern wide + value: sidebar-tabs-wide + - + label: Square + value: sidebar-tabs-plain-square + - + label: Underline + value: sidebar-tabs-underline + - + id: sidebar-tabs-names + title: Sidebar tab names + type: class-select + allowEmpty: false + default: tab-names-off + options: + - + label: Hidden + value: tab-names-off + - + label: Visible + value: tab-names-on + - + label: Single tab only + value: tab-names-single + - + id: vault-profile-display + title: Vault profile position + type: class-select + allowEmpty: false + default: vault-profile-default + options: + - + label: Bottom + value: vault-profile-default + - + label: Top + value: vault-profile-top + - + id: hide-help + title: Hide help button + description: + type: class-toggle + default: false + - + id: hide-settings + title: Hide settings button + description: + type: class-toggle + default: false + - + id: mobile-left-sidebar-width + title: Mobile left sidebar width + description: Maximum width for pinned left sidebar on mobile + type: variable-number + default: 280 + format: pt + - + id: mobile-right-sidebar-width + title: Mobile right sidebar width + description: Maximum width for pinned right sidebar on mobile + type: variable-number + default: 240 + format: pt + - + id: ribbon + title: Ribbon + type: heading + level: 2 + collapsed: true + - + id: ribbon-style + title: Ribbon style + description: Display options for ribbon menu. Ribbon must be turned on in Obsidian Appearance settings for these options to work. + type: class-select + allowEmpty: false + default: ribbon-hidden + options: + - + label: Default + value: ribbon-hidden + - + label: Expand (vertical) + value: ribbon-vertical-expand + - + label: Hover (vertical) + value: ribbon-bottom-left-hover-vertical + - + label: Hover (horizontal) + value: ribbon-bottom-left-hover + - + id: tables + title: Tables + type: heading + level: 2 + collapsed: true + - + id: table-text-size + title: Table font size + description: All of the following settings apply to all tables globally. To turn on these features on a per-note basis use helper classes. See documentation. + type: variable-text + default: 1em + - + id: table-column-min-width + title: Minimum column width + type: variable-text + default: 6ch + - + id: table-column-max-width + title: Maximum column width + type: variable-text + default: none + - + id: maximize-tables-off + title: Maximize table width + description: Determines how wide tables should behave when they become wider than the line width + type: class-select + allowEmpty: false + default: maximize-tables-off + options: + - + label: Fit to line width + value: maximize-tables-off + - + label: Overflow line width + value: maximize-tables-auto + - + label: Always fill + value: maximize-tables + - + id: row-lines + title: Row lines + description: Display borders between table rows globally + type: class-toggle + default: false + - + id: col-lines + title: Column lines + description: Display borders between table columns globally + type: class-toggle + default: false + - + id: table-lines + title: Cell lines + description: Display borders around all table cells globally + type: class-toggle + default: false + - + id: row-alt + title: Striped rows + description: Display striped background in alternating table rows globally + type: class-toggle + default: false + - + id: col-alt + title: Striped columns + description: Display striped background in alternating table columns globally + type: class-toggle + default: false + - + id: table-tabular + title: Tabular figures + description: Use fixed width numbers in tables globally + type: class-toggle + default: false + - + id: table-numbers + title: Row numbers + description: Display row numbers in tables globally + type: class-toggle + default: false + - + id: table-center + title: Center small tables + description: Make small tables centered + type: class-toggle + default: false + - + id: table-nowrap + title: Disable line wrap + description: Turn off line wrapping in table cells globally + type: class-toggle + default: false + - + id: row-hover + title: Highlight active row + description: Highlight rows on hover + type: class-toggle + default: false + - + id: table-row-background-hover + title: Active row background + description: Background color for hovered tables rows + type: variable-themed-color + format: hex + opacity: true + default-light: '#' + default-dark: '#' + - + id: tabs + title: Tabs + type: heading + level: 2 + collapsed: true + - + id: header-height + title: Tab bar height + type: variable-text + default: 40px + - + id: tabs-style + title: Tab style + type: class-select + allowEmpty: false + default: tabs-default + options: + - + label: Index round + value: tabs-default + - + label: Index square + value: tabs-square + - + label: Modern + value: tabs-modern + - + label: Square + value: tabs-plain-square + - + label: Underline + value: tabs-underline + - + id: minimal-tab-text-color + title: Tab text color + type: variable-themed-color + format: hex + opacity: true + default-light: '#' + default-dark: '#' + - + id: minimal-tab-text-color-active + title: Tab text color (active) + type: variable-themed-color + format: hex + opacity: true + default-light: '#' + default-dark: '#' + - + id: tab-stacks + title: Tab stacks + type: heading + level: 2 + collapsed: true + - + id: tab-stacked-pane-width + title: Stacked width + type: variable-number + description: Width of a stacked tab in pixels + default: 700 + format: px + - + id: tab-stacked-header-width + title: Spine width + type: variable-number + description: Width of the spine in pixels + default: 40 + format: px + - + id: tab-stacked-spine-orientation + title: Spine text orientation + type: class-select + default: tab-stack-top + options: + - + label: Top + value: tab-stack-top + - + label: Top flipped + value: tab-stack-top-flipped + - + label: Bottom + value: tab-stack-bottom + - + label: Bottom flipped + value: tab-stack-bottom-flipped + - + label: Center + value: tab-stack-center + - + label: Center flipped + value: tab-stack-center-flipped + - + id: tab-stacked-spine-order + title: Spine element order + type: variable-select + default: row + options: + - + label: Default + value: row + - + label: Reversed + value: row-reverse + - + id: tags + title: Tags + type: heading + level: 2 + collapsed: true + - + id: minimal-unstyled-tags + title: Plain tags + description: Tags will render as normal text, overrides settings below + type: class-toggle + default: false + - + id: tag-radius + title: Tag shape + type: variable-select + default: 14px + options: + - + label: Pill + value: 14px + - + label: Rounded + value: 4px + - + label: Square + value: 0px + - + id: tag-border-width + title: Tag border width + type: variable-select + default: 1px + options: + - + label: None + value: 0 + - + label: Thin + value: 1px + - + label: Thick + value: 2px + - + id: tag-color + title: Tag text color + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: tag-background + title: Tag background color + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: tag-background-hover + title: Tag background color (hover) + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: text + title: Text + type: heading + level: 2 + collapsed: true + - + id: tx1 + title: Normal text color + type: variable-themed-color + description: Primary text color used by default across all elements + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: hl1 + title: Selected text background + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: hl2 + title: Highlighted text background + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: tx2 + title: Muted text color + description: Secondary text such as sidebar note titles and table headings + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: tx3 + title: Faint text color + description: tertiary text such as input placeholders, empty checkboxes, and disabled statuses + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: text-formatting + title: Markdown syntax color + description: Markdown formatting syntax text color + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: italic-color + title: Italic text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: bold-color + title: Bold text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: bold-modifier + title: Bold text weight + type: variable-number-slider + default: 200 + min: 100 + max: 500 + step: 100 + - + id: p-spacing + title: Paragraph spacing + description: Space between paragraphs in reading mode (Obsidian 1.3.7+) + type: variable-text + default: 1.75rem + - + id: heading-spacing + title: Heading spacing + description: Space between paragraphs and headings in reading mode (Obsidian 1.3.7+) + type: variable-text + default: 2em + - + id: titles + title: Titles + type: heading + level: 2 + collapsed: true + - + id: tab-title-bar + title: Tab title bar + description: Tab title bar must be turned on in Appearance settings + type: heading + level: 3 + collapsed: true + - + id: file-header-visibility + title: Tab title visibility + description: Visibility of the tab title text + type: class-select + default: minimal-tab-title-hover + options: + - + label: Hover only + value: minimal-tab-title-hover + - + label: Hidden + value: minimal-tab-title-hidden + - + label: Visible + value: minimal-tab-title-visible + - + id: file-header-font-size + title: Tab title font size + description: Accepts any CSS font-size value + type: variable-text + default: 0.9em + - + id: file-header-font-weight + title: Tab title font weight + type: variable-number-slider + default: 400 + min: 100 + max: 900 + step: 100 + - + id: file-header-justify + title: Tab title alignment + type: variable-select + default: center + options: + - + label: Center + value: center + - + label: Left + value: left + - + id: title-color + title: Tab title text color (active) + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: title-color-inactive + title: Tab title text color (inactive) + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: inline-title + title: Inline title + description: Inline titles must be turned on in Appearance settings + type: heading + level: 3 + collapsed: true + - + id: inline-title-font + title: Inline title font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: inline-title-size + title: Inline title font size + description: Accepts any CSS font-size value + type: variable-text + default: 1.125em + - + id: inline-title-weight + title: Inline title font weight + type: variable-number-slider + default: 600 + min: 100 + max: 900 + step: 100 + - + id: inline-title-color + title: Inline title text color (active) + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: translucency + title: Translucency + type: heading + level: 2 + collapsed: true + - + id: workspace-background-translucent + title: Translucent background color + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: window-frame + title: Window frame + type: heading + level: 2 + collapsed: true + - + id: window-title-off + title: Hide window frame title + description: Hide title in the custom title bar + type: class-toggle + - + id: frame-background + title: Frame background + description: Requires colorful window frame + type: variable-themed-color + opacity: true + format: hsl-split + default-light: '#' + default-dark: '#' + - + id: frame-icon-color + title: Frame icon color + description: Requires colorful frame + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: titlebar-text-color-focused + title: Frame title color (focused) + description: Requires custom title bar + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: titlebar-text-color + title: Frame title color (inactive) + description: Requires custom title bar + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: titlebar-text-weight + title: Frame title font weight + description: Requires custom title bar + type: variable-number-slider + default: 600 + min: 100 + max: 900 + step: 100 +*/ + +/* @settings +name: Minimal Cards +id: minimal-cards-style +settings: + - + id: cards-min-width + title: Card minimum width + type: variable-text + default: 180px + - + id: cards-max-width + title: Card maximum width + description: Default fills the available width, accepts valid CSS units + type: variable-text + default: 1fr + - + id: cards-mobile-width + title: Card minimum width on mobile + type: variable-text + default: 120px + - + id: cards-padding + title: Card padding + type: variable-text + default: 1.2em + - + id: cards-image-height + title: Card maximum image height + type: variable-text + default: 400px + - + id: cards-border-width + title: Card border width + type: variable-text + default: 1px + - + id: cards-background + title: Card background color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: cards-background-hover (hover) + title: Card background color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + +*/ + +/* @settings +name: Minimal Advanced Settings +id: minimal-advanced +settings: + - + id: hide-markdown + title: Hide Markdown syntax + description: WARNING — This may be confusing because the characters still exist they are just hidden. + type: class-toggle + - + id: hide-settings-desc + title: Hide setting descriptions + description: Press and hold setting names to see their description. + type: class-toggle + - + id: animations + title: Animation speed + type: class-select + default: default + options: + - + label: Normal + value: default + - + label: Disabled + value: disable-animations + - + label: Fast + value: fast-animations + - + id: cursor + title: Cursor style + description: The cursor style for UI elements + type: variable-select + default: default + options: + - + label: Default + value: default + - + label: Pointer + value: pointer + - + label: Crosshair + value: crosshair + - + id: font-ui-small + title: Small font size + description: Font size in px of smaller text + type: variable-number + default: 13 + format: px + - + id: font-ui-smaller + title: Smaller font size + description: Font size in px of smallest text + type: variable-number + default: 11 + format: px + - + id: mobile-toolbar-off + title: Disable mobile toolbar + description: Turns off toolbar in editor on mobile + type: class-toggle + +*/ diff --git a/.obsidian/themes/Tokyo Night/manifest.json b/.obsidian/themes/Tokyo Night/manifest.json new file mode 100644 index 0000000..a39d266 --- /dev/null +++ b/.obsidian/themes/Tokyo Night/manifest.json @@ -0,0 +1,6 @@ +{ + "name": "Tokyo Night", + "version": "1.1.6", + "minAppVersion": "0.0.1", + "author": "tcmmichaelb139" +} diff --git a/.obsidian/themes/Tokyo Night/theme.css b/.obsidian/themes/Tokyo Night/theme.css new file mode 100644 index 0000000..d57dc8f --- /dev/null +++ b/.obsidian/themes/Tokyo Night/theme.css @@ -0,0 +1,2129 @@ +/*Fonts*/ +:root { + --default-font: '"JetBrains Mono", monospace, "Inter", sans-serif'; + --font-monospace: '"JetBrains Mono", monospace, "Source Code Pro", monospace'; +} + +.theme-dark { + color-scheme: dark; + /* --accent-h: 261; /* magenta */ + /* --accent-s: 85%; */ + /* --accent-l: 79%; */ + /* cyan */ + --accent-h: 202; + --accent-s: 100%; + --accent-l: 75%; + + --bg_dark2_x: 18, 18, 24; + --bg_dark2: rgb(var(--bg_dark2_x)); + --bg_dark_x: 22, 22, 30; + --bg_dark: rgb(var(--bg_dark_x)); + --bg_x: 26, 27, 38; + --bg: rgb(var(--bg_x)); + --bg_highlight_x: 41, 46, 66; + --bg_highlight: rgb(var(--bg_highlight_x)); + --bg_highlight_dark_x: 36, 40, 59; + --bg_highlight_dark: rgb(var(--bg_highlight_dark_x)); + --terminal_black_x: 65, 72, 104; + --terminal_black: rgb(var(--terminal_black_x)); + --fg_x: 192, 202, 245; + --fg: rgb(var(--fg_x)); + --fg_dark_x: 169, 177, 214; + --fg_dark: rgb(var(--fg_dark_x)); + --comment_x: 86, 95, 137; + --comment: rgb(var(--comment_x)); + --blue0_x: 61, 89, 161; + --blue0: rgb(var(--blue0_x)); + --blue_x: 122, 162, 247; + --blue: rgb(var(--blue_x)); + --cyan_hsl: 202 100% 75%; + --cyan_x: 125, 207, 255; + --cyan: rgb(var(--cyan_x)); + --magent_hsl: 261 85% 79%; + --magenta_x: 187, 154, 247; + --magenta: rgb(var(--magenta_x)); + --pink_hsl: 331 100% 43%; + --pink_x: 217, 0, 105; + --pink: rgb(var(--pink_x)); + --orange_x: 255, 158, 100; + --orange: rgb(var(--orange_x)); + --yellow_x: 224, 175, 104; + --yellow: rgb(var(--yellow_x)); + --green_x: 158, 206, 106; + --green: rgb(var(--green_x)); + --teal_x: 26, 188, 156; + --teal: rgb(var(--teal_x)); + --red_x: 255, 117, 127; + --red: rgb(var(--red_x)); + --red1_x: 219, 75, 75; + --red1: rgb(var(--red1_x)); + --unknown: #ffffff; + + --link-external-filter: invert(35%) sepia(28%) saturate(681%) hue-rotate(192deg) brightness(94%) contrast(85%); +} + +.theme-light { + /* --accent-h: 261; /* magenta */ + /* --accent-s: 24%; */ + /* --accent-l: 38%; */ + /* cyan */ + --accent-h: 202; + --accent-s: 86%; + --accent-l: 43%; + + --bg_dark2_x: 188, 189, 194; + --bg_dark2: rgb(var(--bg_dark2_x)); + --bg_dark_x: 203, 204, 209; + --bg_dark: rgb(var(--bg_dark_x)); + --bg_x: 213, 214, 219; + --bg: rgb(var(--bg_x)); + --bg_highlight_x: 220, 222, 226; + --bg_highlight: rgb(var(--bg_highlight_x)); + --bg_highlight_dark_x: 195, 197, 201; + --bg_highlight_dark: rgb(var(--bg_highlight_dark_x)); + --terminal_black_x: 15, 15, 20; + --terminal_black: rgb(var(--terminal_black_x)); + --fg_x: 52, 59, 88; + --fg: rgb(var(--fg_x)); + --fg_dark_x: 39, 46, 75; + --fg_dark: rgb(var(--fg_dark_x)); + --comment_x: 150, 153, 163; + --comment: rgb(var(--comment_x)); + --blue0_x: 39, 71, 125; + --blue0: rgb(var(--blue0_x)); + --blue_x: 52, 84, 138; + --blue: rgb(var(--blue_x)); + --cyan_x: 15, 75, 110; + --cyan: rgb(var(--cyan_x)); + --magent_hsl: 261 24% 38%; + --magenta_x: 90, 74, 120; + --magenta: rgb(var(--magenta_x)); + --pink_hsl: 286 24% 38%; + --pink_x: 109, 74, 120; + --pink: rgb(var(--pink_x)); + --orange_x: 150, 80, 39; + --orange: rgb(var(--orange_x)); + --yellow_x: 143, 94, 21; + --yellow: rgb(var(--yellow_x)); + --green_x: 51, 99, 92; + --green: rgb(var(--green_x)); + --teal_x: 22, 103, 117; + --teal: rgb(var(--teal_x)); + --red_x: 140, 67, 81; + --red: rgb(var(--red_x)); + --red1_x: 115, 42, 56; + --red1: rgb(var(--red1_x)); + --unknown: #000000; + + --link-external-filter: invert(62%) sepia(9%) saturate(266%) hue-rotate(189deg) brightness(97%) contrast(88%); +} + +.theme-dark, +.theme-light { + --color_red_rgb: var(--red_x); + --color-red: var(--red); + --color_purple_rgb: var(--magenta_x); + --color-purple: var(--magenta); + --color_green_rgb: var(--green_x); + --color-green: var(--green); + --color_cyan_rgb: var(--cyan_x); + --color-cyan: var(--cyan); + --color_blue_rgb: var(--blue_x); + --color-blue: var(--blue); + --color_yellow_rgb: var(--yellow_x); + --color-yellow: var(--yellow); + --color_orange_rgb: var(--orange_x); + --color-orange: var(--orange); + --color_pink_rgb: var(--magenta_x); + --color-pink: var(--magenta); + + --background-primary: var(--bg); + --background-primary-alt: var(--bg); + --background-secondary: var(--bg_dark); + --background-secondary-alt: var(--bg_dark); + + --background-modifier-border: var(--bg_highlight); + --background-modifier-border-focus: var(--bg_highlight); + --background-modifier-border-hover: var(--bg_highlight); + --background-modifier-form-field: var(--bg_dark); + --background-modifier-form-field-highlighted: var(--bg_dark); + --background-modifier-box-shadow: rgba(0, 0, 0, 0.3); + --background-modifier-success: var(--green); + --background-modifier-error: var(--red1); + --background-modifier-error-hover: var(--red); + --background-modifier-cover: rgba(var(--bg_dark_x), 0.8); + --background-modifier-hover: var(--bg_highlight); + --background-modifier-message: rgba(var(--bg_highlight_x), 0.9); + --background-modifier-active-hover: var(--bg_highlight); + + --text-normal: var(--fg); + --text-faint: var(--comment); + --text-muted: var(--fg_dark); + --text-error: var(--red); + --text-accent: var(--magenta); + --text-accent-hover: var(--cyan); + --text-error: var(--red1); + --text-error-hover: var(--red); + --text-selection: var(--unknown); + --text-on-accent: var(--bg); + --text-highlight-bg: rgba(var(--orange_x), 0.25); + --text-selection: rgba(var(--blue0_x), 0.6); + --bold-color: var(--cyan); + --italic-color: var(--cyan); + + --interactive-normal: var(--bg_dark); + --interactive-hover: var(--bg); + --interactive-success: var(--green); + --interactive-accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l)); + --interactive-accent-hover: var(--blue); + + --scrollbar-bg: var(--bg_dark2); + --scrollbar-thumb-bg: var(--comment); + --scrollbar-active-thumb-bg: var(--comment); + --scrollbar-width: 7px; + + --h1-color: var(--red); + --h2-color: var(--yellow); + --h3-color: var(--green); + --h4-color: var(--cyan); + --h5-color: var(--blue); + --h6-color: var(--magenta); + + --border-width: 2px; + + --tag-color: var(--magenta); + --tag-background: rgba(var(--magenta_x), 0.15); + --tag-color-hover: var(--cyan); + --tag-background-hover: rgba(var(--cyan_x), 0.15); + + --link-color: var(--magenta); + --link-color-hover: var(--cyan); + --link-external-color: var(--magenta); + --link-external-color-hover: var(--cyan); + + --checkbox-radius: var(--radius-l); + --checkbox-color: var(--green); + --checkbox-color-hover: var(--green); + --checkbox-marker-color: var(--bg); + --checkbox-border-color: var(--comment); + --checkbox-border-color-hover: var(--comment); + + --table-header-background: var(--bg_dark2); + --table-header-background-hover: var(--bg_dark2); + + --flashing-background: rgba(var(--blue0_x), 0.3); + + --code-normal: var(--fg); + --code-background: var(--bg_highlight_dark); + + --mermaid-note: var(--blue0); + --mermaid-actor: var(--fg_dark); + --mermaid-loopline: var(--blue); + + --blockquote-background-color: var(--bg_dark); + --callout-default: var(--blue_x); + --callout-info: var(--blue_x); + --callout-summary: var(--cyan_x); + --callout-tip: var(--cyan_x); + --callout-todo: var(--cyan_x); + --callout-bug: var(--red_x); + --callout-error: var(--red1_x); + --callout-fail: var(--red1_x); + --callout-example: var(--magenta_x); + --callout-important: var(--green_x); + --callout-success: var(--teal_x); + --callout-question: var(--yellow_x); + --callout-warning: var(--orange_x); + --callout-quote: var(--fg_dark_x); + + --icon-color-hover: var(--blue); + --icon-color-focused: var(--magenta); + --icon-color-active: var(--magenta); + + --nav-item-color-hover: var(--fg); + --nav-item-background-hover: var(--bg_highlight); + --nav-item-color-active: var(--red); + --nav-item-background-active: var(--bg_highlight); + --nav-file-tag: rgba(var(--yellow_x), 0.9); + --nav-indentation-guide-color: var(--bg_highlight); + + --indentation-guide-color: var(--comment); + --indentation-guide-color-active: var(--comment); + + --graph-line: var(--comment); + --graph-node: var(--fg); + --graph-node-tag: var(--orange); + --graph-node-attachment: var(--blue); + + --tab-text-color-focused-active: rgba(var(--red_x), 0.8); + --tab-text-color-focused-active-current: var(--red); + + --modal-border-color: var(--bg_highlight); + --prompt-border-color: var(--bg_highlight); + --slider-track-background: var(--bg_highlight); + + --embed-background: var(--bg_dark); + --embed-padding: 1.5rem 1.5rem 0.5rem; + + --canvas-color: var(--bg_highlight_x); + + --toggle-thumb-color: var(--bg); + + --image-radius: 0px; + + --date-color: var(--blue); + --date-background-color: var(--bg_highlight); +} + + +/* Headings (credit: https://github.com/Akifyss/obsidian-border)*/ + +body:not(.heading-indicator-off) .markdown-rendered>:is(h1, h2, h3, h4, h5, h6), +body:not(.heading-indicator-off) .markdown-preview-sizer>div>:is(h1, h2, h3, h4, h5, h6) { + position: relative; +} + +body.h1-divider-on :is(.markdown-preview-sizer>div>h1, .markdown-rendered>h1, .HyperMD-header-1)::after { + content: ""; + position: absolute; + height: 2px; + width: 100%; + right: 0px; + opacity: 0.5; + bottom: 0; + background-image: linear-gradient(to left, var(--h1-color) 30%, transparent 70%); +} + +body.h2-divider-on :is(.markdown-preview-sizer>div>h2, .markdown-rendered>h2, .HyperMD-header-2)::after { + content: ""; + position: absolute; + height: 2px; + width: 100%; + right: 0px; + opacity: 0.5; + bottom: 0; + background-image: linear-gradient(to left, var(--h2-color) 30%, transparent 70%); +} + +body.h3-divider-on :is(.markdown-preview-sizer>div>h3, .markdown-rendered>h3, .HyperMD-header-3)::after { + content: ""; + position: absolute; + height: 2px; + width: 100%; + right: 0px; + opacity: 0.5; + bottom: 0; + background-image: linear-gradient(to left, var(--h3-color) 30%, transparent 70%); +} + +body.h4-divider-on :is(.markdown-preview-sizer>div>h4, .markdown-rendered>h4, .HyperMD-header-4)::after { + content: ""; + position: absolute; + height: 2px; + width: 100%; + right: 0px; + opacity: 0.5; + bottom: 0; + background-image: linear-gradient(to left, var(--h4-color) 30%, transparent 70%); +} + +body.h5-divider-on :is(.markdown-preview-sizer>div>h5, .markdown-rendered>h5, .HyperMD-header-5)::after { + content: ""; + position: absolute; + height: 2px; + width: 100%; + right: 0px; + opacity: 0.5; + bottom: 0; + background-image: linear-gradient(to left, var(--h5-color) 30%, transparent 70%); +} + +body.h6-divider-on :is(.markdown-preview-sizer>div>h6, .markdown-rendered>h6, .HyperMD-header-6)::after { + content: ""; + position: absolute; + height: 2px; + width: 100%; + right: 0px; + opacity: 0.5; + bottom: 0; + background-image: linear-gradient(to left, var(--h6-color) 30%, transparent 70%); +} + +/* mobile */ +.is-mobile .suggestion-item.is-selected { + background-color: var(--bg_highlight); +} + +/* scrollbars */ +::-webkit-scrollbar { + width: var(--scrollbar-width); + background-color: transparent !important; +} + +:hover::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb-bg) !important; +} + +::-webkit-scrollbar-thumb:hover, +::-webkit-scrollbar-thumb:active { + background-color: var(--scrollbar-active-thumb-bg) !important; +} + + +::-webkit-scrollbar:horizontal { + height: 0; + background-color: transparent !important; +} + +/* tooltip */ +.tooltip { + color: var(--fg); +} + +/* links */ + +.cm-url { + filter: none !important; +} + +.cm-string.cm-url.external-link { + filter: var(--link-external-filter) !important; +} + +a.external-link { + filter: none; + background-image: unset; + padding-right: 0; +} + +a.external-link::after { + content: url(public/images/874d8b8e340f75575caa.svg); + filter: var(--link-external-filter); + padding-left: 2.5px; + bottom: -1px; + position: relative; +} + +/* Images */ + +.image-embed { + border-radius: var(--image-radius); +} + +/* tables credit: Akifyss/border */ +body { + --table-width: 88cqw; +} + +.theme-dark, +.theme-light .markdown-rendered thead tr { + background: var(--table-header-background); +} + +body:not(.table-width-obsidian-default) .markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, +body:not(.table-width-obsidian-default) :is(.markdown-rendered, .markdown-source-view.mod-cm6.is-live-preview) table { + width: 100% !important; +} + +.table-width-customized .markdown-source-view.mod-cm6.is-live-preview .cm-content>.cm-table-widget, +.table-width-customized .markdown-rendered .markdown-preview-sizer>div:has(>table) { + overflow: auto; + width: var(--table-width) !important; + margin-left: calc((var(--table-width) - 100%) / -2) !important; +} + +/* notice */ +.notice { + background-color: var(--bg_dark); + border: 2px solid var(--bg_highlight); +} + +/* callouts */ +.callout[data-callout="quote"] { + background-color: rgba(var(--bg_highlight_dark_x), 0.5); +} + + +.callout[data-callout="cite"] { + --callout-color: var(--pink_x); + background-color: rgba(var(--pink_x), 0.15); +} + +/* the following callouts are from Border (https://github.com/Akifyss/obsidian-border/blob/18607ee208d56e1d4faff7419efb9cf7c9cc726e/theme.css#L7710C1-L7799C2) */ + +.callout-style-1.theme-light { + --callout-border-width: 1px; + --callout-border-opacity: 0.25; + --callout-padding: 0; + --callout-radius: var(--radius-s); + --callout-title-color: inherit; + --callout-title-padding: 8px 16px; + --callout-title-size: inherit; + --callout-content-padding: 0px 16px; + --callout-content-background: #FFFFFFBF; + --callout-content-radius: 0px; +} + +.callout-style-1.theme-dark { + --callout-border-width: 1px; + --callout-border-opacity: 0.25; + --callout-padding: 0; + --callout-radius: var(--radius-s); + --callout-title-color: inherit; + --callout-title-padding: 8px 16px; + --callout-title-size: inherit; + --callout-content-padding: 0px 16px; + --callout-content-background: #00000040; + --callout-content-radius: 0px; +} + +.callout-style-2.theme-light { + --callout-border-width: 1px; + --callout-border-opacity: 0.25; + --callout-padding: 0 6px 6px; + --callout-radius: var(--radius-s); + --callout-title-color: inherit; + --callout-title-padding: 8px 16px; + --callout-title-size: inherit; + --callout-content-padding: 0px 16px; + --callout-content-background: #FFFFFFBF; + --callout-content-radius: 4px; +} + +.callout-style-2.theme-dark { + --callout-border-width: 1px; + --callout-border-opacity: 0.25; + --callout-padding: 0 6px 6px; + --callout-radius: var(--radius-s); + --callout-title-color: inherit; + --callout-title-padding: 8px 16px; + --callout-title-size: inherit; + --callout-content-padding: 0px 16px; + --callout-content-background: #00000040; + --callout-content-radius: 4px; +} + +.callout-style-3:is(.theme-light, .theme-dark) { + --callout-border-width: 0 0 0 4px; + --callout-border-opacity: 1; + --callout-padding: var(--size-4-3) var(--size-4-3) var(--size-4-3) var(--size-4-6); + --callout-radius: var(--radius-s); + --callout-title-color: inherit; + --callout-title-padding: 0; + --callout-title-size: inherit; + --callout-content-padding: 0; + --callout-content-background: transparent; + --callout-content-radius: 0px; +} + +.callout-style-4.theme-light { + --callout-border-width: 0 0 0 4px; + --callout-border-opacity: 1; + --callout-padding: 0; + --callout-radius: var(--radius-s); + --callout-title-color: inherit; + --callout-title-padding: 8px 16px; + --callout-title-size: inherit; + --callout-content-padding: 0px 16px; + --callout-content-background: #FFFFFFBF; + --callout-content-radius: 0px; +} + +.callout-style-4.theme-dark { + --callout-border-width: 0 0 0 4px; + --callout-border-opacity: 1; + --callout-padding: 0; + --callout-radius: var(--radius-s); + --callout-title-color: inherit; + --callout-title-padding: 8px 16px; + --callout-title-size: inherit; + --callout-content-padding: 0px 16px; + --callout-content-background: #00000040; + --callout-content-radius: 0px; +} + +/* for vim */ +.ͼ2 .cm-panels-bottom { + border-top: var(--border-width) solid var(--bg_highlight); +} + +.cm-vim-message { + color: var(--red); +} + +/* kanban */ +.kanban-plugin__lane-action-add { + color: var(--fg); +} + +.kanban-plugin__lane-action-add:hover { + color: var(--bg); +} + +.kanban-plugin__autocomplete-item:hover, +.kanban-plugin__autocomplete-item-active { + color: hsl(var(--accent-h), var(--accent-s), var(--accent-l)); + background-color: var(--bg_highlight); +} + +/* various-complement */ +.various-complements__suggestion-item::before { + filter: var(--link-external-filter); +} + +.various-complements__footer::before { + filter: var(--link-external-filter); +} + +/* Math Jax */ +mjx-math { + font-size: 110% !important; +} + +/* metadata */ +.cm-atom { + color: var(--blue); +} + +span.cm-hmd-frontmatter.cm-meta { + color: rgba(var(--blue0_x), 0.9); +} + +/* checkboxes (credit: border) */ + +body:not(.disable-alternative-checkboxes) input[data-task="<"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="<"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="<"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task=">"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task=">"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task=">"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="d"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="d"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="d"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="u"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="u"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="u"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="S"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="S"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="S"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="“"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="“"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="“"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="\""]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="\""]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="\""]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="c"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="c"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="c"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="p"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="p"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="p"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="n"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="n"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="n"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="b"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="b"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="b"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="-"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="-"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="-"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="l"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="l"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="l"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="I"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="I"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="I"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="/"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="/"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="/"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="i"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="i"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="i"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="*"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="*"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="*"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="?"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="?"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="?"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="!"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="!"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="!"]>p>input:checked { + --checkbox-marker-color: transparent; + border: none; + border-radius: 0; + background-image: none; + background-color: currentColor; + -webkit-mask-size: var(--checkbox-icon); + -webkit-mask-position: 50% 50% +} + + +body:not(.disable-alternative-checkboxes) input[data-task="!"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="!"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="!"]>p>input:checked { + --checkbox-color-hover: var(--color-orange); + color: var(--color-orange); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="?"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="?"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="?"]>p>input:checked { + --checkbox-color-hover: var(--color-pink); + color: var(--color-pink); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="*"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="*"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="*"]>p>input:checked { + --checkbox-color-hover: var(--color-yellow); + color: var(--color-yellow); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="i"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="i"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="i"]>p>input:checked { + --checkbox-color-hover: var(--color-cyan); + color: var(--color-cyan); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="/"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="/"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="/"]>p>input:checked { + --checkbox-color-hover: var(--color-yellow); + color: var(--color-yellow); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="I"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="I"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="I"]>p>input:checked { + --checkbox-color-hover: var(--color-orange); + color: var(--color-orange); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="l"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="l"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="l"]>p>input:checked { + --checkbox-color-hover: var(--color-red); + color: var(--color-red); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="-"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="-"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="-"]>p>input:checked { + --checkbox-color-hover: var(--text-faint); + color: var(--text-faint); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) body:not(.tasks) .markdown-preview-view ul li[data-task="x"].task-list-item.is-checked, +body:not(.disable-alternative-checkboxes) body:not(.tasks) .markdown-source-view.mod-cm6 .HyperMD-task-line[data-task]:is([data-task="x"]), +body:not(.disable-alternative-checkboxes) body:not(.tasks) li[data-task="x"].task-list-item.is-checked, +body:not(.disable-alternative-checkboxes) body:not(.tasks) .markdown-preview-view ul li[data-task="-"].task-list-item.is-checked, +body:not(.disable-alternative-checkboxes) body:not(.tasks) .markdown-source-view.mod-cm6 .HyperMD-task-line[data-task]:is([data-task="-"]), +body:not(.disable-alternative-checkboxes) body:not(.tasks) li[data-task="-"].task-list-item.is-checked { + color: var(--text-faint); + text-decoration: line-through solid var(--text-faint) 1px +} + + +body:not(.disable-alternative-checkboxes) input[data-task="b"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="b"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="b"]>p>input:checked { + --checkbox-color-hover: var(--color-blue); + color: var(--color-blue); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="n"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="n"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="n"]>p>input:checked { + --checkbox-color-hover: var(--color-cyan); + color: var(--color-cyan); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="p"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="p"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="p"]>p>input:checked { + --checkbox-color-hover: var(--color-green); + color: var(--color-green); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="c"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="c"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="c"]>p>input:checked { + --checkbox-color-hover: var(--color-red); + color: var(--color-red); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="“"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="“"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="“"]>p>input:checked, +body:not(.disable-alternative-checkboxes) input[data-task="\""]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="\""]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="\""]>p>input:checked { + --checkbox-color-hover: var(--color-purple); + color: var(--color-purple); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="S"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="S"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="S"]>p>input:checked { + --checkbox-color-hover: var(--color-green); + color: var(--color-green); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="u"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="u"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="u"]>p>input:checked { + --checkbox-color-hover: var(--color-green); + color: var(--color-green); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="d"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="d"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="d"]>p>input:checked { + --checkbox-color-hover: var(--color-red); + color: var(--color-red); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task=">"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task=">"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task=">"]>p>input:checked { + --checkbox-color-hover: var(--color-pink); + color: var(--color-pink); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + +body:not(.disable-alternative-checkboxes) input[data-task="<"]:checked, +body:not(.disable-alternative-checkboxes) li[data-task="<"]>input:checked, +body:not(.disable-alternative-checkboxes) li[data-task="<"]>p>input:checked { + --checkbox-color-hover: var(--color-blue); + color: var(--color-blue); + -webkit-mask-image: url('data:image/svg+xml;utf8,'); +} + + +/* style settings */ + +.style-settings-container .themed-color-wrapper { + display: flex; + gap: var(--size-4-2); +} + +.style-settings-container .themed-color-wrapper>div+div { + margin-top: 0; +} + +.style-settings-container { + margin-left: var(--size-4-1); + padding-left: var(--size-4-8); + border-left: 1px solid var(--divider-color); +} + +/* printing */ + +@media print { + .theme-light { + --blockquote-background-color: rgba(var(--bg_dark_x), 0.25); + --code-background: rgba(var(--bg_highlight_dark_x), 0.25); + --table-header-background: rgba(var(--bg_dark2_x), 0.25); + } +} + + +/* @settings + +name: Appearance +id: Appearance +settings: + - + id: colors + title: Colors + type: heading + level: 1 + collapsed: true + - + id: accent + title: Accent Color + type: variable-themed-color + format: hsl-split + opacity: false + default-light: '#0F87CC' + default-dark: '#80D0FF' + - + id: Extended-colors + title: Extended Colors + type: heading + level: 2 + collapsed: true + - + id: red + title: Red + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(115, 42, 56)' + default-dark: 'rgb(219, 75, 75)' + - + id: red1 + title: Red1 + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(140, 67, 81)' + default-dark: 'rgb(255, 117, 127)' + - + id: green + title: Green + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(51, 99, 92)' + default-dark: 'rgb(158, 206, 106)' + - + id: cyan + title: Cyan + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(15, 75, 110)' + default-dark: 'rgb(125, 207, 255)' + - + id: blue + title: Blue + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(52, 84, 138)' + default-dark: 'rgb(122, 162, 247)' + - + id: yellow + title: Yellow + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(143, 94, 21)' + default-dark: 'rgb(224, 175, 104)' + - + id: orange + title: Orange + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(150, 80, 39)' + default-dark: 'rgb(255, 158, 100)' + - + id: magenta + title: Magenta + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(90, 74, 120)' + default-dark: 'rgb(187, 154, 247)' + - + id: pink + title: Pink + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(109, 74, 120)' + default-dark: 'rgb(217, 0, 105)' + - + id: Background-colors + title: Background Colors + type: heading + level: 1 + collapsed: true + - + id: bg + title: Background Primary + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(213, 214, 219)' + default-dark: 'rgb(26, 27, 38)' + - + id: bg_dark + title: Background Dark + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(203, 204, 209)' + default-dark: 'rgb(22, 22, 30)' + - + id: bg_highlight + title: Background Highlight + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(220, 222, 226)' + default-dark: 'rgb(41, 46, 66)' + - + id: bg_highlight_dark + title: Background Highlight Dark + description: 'Used for code bg' + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(195, 197, 201)' + default-dark: 'rgb(36, 40, 59)' + - + id: bg_dark2 + title: Background Dark2 + type: variable-themed-color + format: rgb + opacity: false + default-light: 'rgb(188, 189, 194)' + default-dark: 'rgb(15, 15, 20)' + - + id: foreground-header + title: Foreground + type: heading + level: 2 + collapsed: true + - + id: text-color-heading + title: Text / Icon Color + type: heading + level: 3 + collapsed: true + - + id: text-normal + title: Text Normal + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: text-muted + title: Text Muted + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: text-faint + title: Text Faint + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: text-accent + title: Text Accent + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: text-accent-hover + title: Text Accent Hover + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: text-on-accent + title: Text on Accent + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: text-on-accent-inverted + title: Text on Accent Inverted + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: text-error + title: Text Error + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: text-warning + title: Text Warning + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: text-success + title: Text Success + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: interactive-heading + title: Interactive color + type: heading + level: 3 + collapsed: true + - + id: interactive-normal + title: Interactive Normal + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: interactive-hover + title: Interactive Hover + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: interactive-accent + title: Interactive Accent + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: interactive-accent-hover + title: Interactive Accent Hover + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: interactive-accent-hsl + title: Interactive Accent HSL + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - +*/ + +/* @settings + +name: Editor +id: Editor +settings: + - + id: headings + title: Tabs + type: heading + level: 1 + collapsed: true + - + id: tab-text-color-focused-active + title: Tab Focus Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: tab-text-color-focused-active-current + title: Current Tab Focus Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: headings + title: Headings + type: heading + level: 1 + collapsed: true + - + id: level-1-heading + title: Level 1 + type: heading + level: 2 + collapsed: true + - + id: h1-divider-on + title: disable H1 divider + type: class-toggle + default: false + - + id: h1-font + title: H1 Font + type: variable-text + default: '' + - + id: h1-size + title: H1 Font Size + description: Any CSS font-size value + type: variable-text + default: '' + - + id: h1-weight + title: H1 Font Weight + description: Value from 100 - 900 + type: variable-text + default: 700 + - + id: h1-color + title: H1 Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: level-2-heading + title: Level 2 + type: heading + level: 2 + collapsed: true + - + id: h2-divider-on + title: disable H2 divider + type: class-toggle + default: false + - + id: h2-font + title: H2 Font + type: variable-text + default: '' + - + id: h2-size + title: H2 Font Size + description: Any CSS font-size value + type: variable-text + default: '' + - + id: h2-weight + title: H2 Font Weight + description: Value from 100 - 900 + type: variable-text + default: 600 + - + id: h2-color + title: H2 Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: level-3-heading + title: Level 3 + type: heading + level: 2 + collapsed: true + - + id: h3-divider-on + title: disable H3 divider + type: class-toggle + default: false + - + id: h3-font + title: H3 Font + type: variable-text + default: '' + - + id: h3-size + title: H3 Font Size + description: Any CSS font-size value + type: variable-text + default: '' + - + id: h3-weight + title: H3 Font Weight + description: Value from 100 - 900 + type: variable-text + default: 600 + - + id: h3-color + title: H3 Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: level-4-heading + title: Level 4 + type: heading + level: 2 + collapsed: true + - + id: h4-divider-on + title: disable H4 divider + type: class-toggle + default: false + - + id: h4-font + title: H4 Font + type: variable-text + default: '' + - + id: h4-size + title: H4 Font Size + description: Any CSS font-size value + type: variable-text + default: '' + - + id: h4-weight + title: H4 Font Weight + description: Value from 100 - 900 + type: variable-text + default: 600 + - + id: h4-color + title: H4 Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: level-5-heading + title: Level 5 + type: heading + level: 2 + collapsed: true + - + id: h5-divider-on + title: disable H5 divider + type: class-toggle + default: false + - + id: h5-font + title: H5 Font + type: variable-text + default: '' + - + id: h5-size + title: H5 Font Size + description: Any CSS font-size value + type: variable-text + default: '' + - + id: h5-weight + title: H5 Font Weight + description: Value from 100 - 900 + type: variable-text + default: 600 + - + id: h5-color + title: H5 Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: level-6-heading + title: Level 6 + type: heading + level: 2 + collapsed: true + - + id: h6-divider-on + title: disable H6 divider + type: class-toggle + default: false + - + id: h6-font + title: H6 Font + type: variable-text + default: '' + - + id: h6-size + title: H6 Font Size + description: Any CSS font-size value + type: variable-text + default: '' + - + id: h6-weight + title: H6 Font Weight + description: Value from 100 - 900 + type: variable-text + default: 600 + - + id: h6-color + title: H6 Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: text-heading + title: Text + type: heading + level: 1 + collapsed: true + - + id: bold-color + title: Bold Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: italic-color + title: Italic Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: link-heading + title: Links + type: heading + level: 1 + collapsed: true + - + id: link-color + title: Link Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: link-color-hover + title: Link Hover Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: link-decoration + title: Link decoration + description: Any CSS text-decoration-line value + type: variable-text + default: underline + - + id: link-decoration-hover + title: Link Hover decoration + description: Any CSS text-decoration-line value + type: variable-text + default: underline + - + id: link-decoration-thickness + title: Link decoration thickness + description: Any CSS text-decoration-thickness value + type: variable-text + default: auto + - + id: external-link-heading + title: External Link + type: heading + level: 3 + collapsed: true + - + id: link-external-color + title: External Link Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: link-external-color-hover + title: External Link Hover Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: link-external-decoration + title: External Link decoration + description: Any CSS text-decoration-line value + type: variable-text + default: underline + - + id: link-external-decoration-hover + title: External Link Hover decoration + description: Any CSS text-decoration-line value + type: variable-text + default: underline + - + id: link-external-filter + title: External Link Filter + description: Any CSS filter value + type: variable-text + default: invert(35%) sepia(28%) saturate(681%) hue-rotate(192deg) brightness(94%) contrast(85%) + - + id: unresolved-link-heading + title: Unresolved Link + type: heading + level: 3 + collapsed: true + - + id: link-unresolved-color + title: Unresolved Link Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: link-unresolved-opacity + title: Unresolved link opacity + type: variable-number-slider + default: 0.7 + min: 0.25 + max: 1 + step: 0.05 + - + id: link-unresolved-filter + title: Unresolved Link Filter + description: Any CSS filter value + type: variable-text + default: none + - + id: link-unresolved-decoration + title: Unresolved Link decoration + description: Any CSS text-decoration-line value + type: variable-text + default: solid + - + id: link-unresolved-decoration-color + title: Unresolved Link decoration Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: lists-heading + title: Lists + type: heading + level: 2 + collapsed: true + - + id: list-indent + title: List Indent + type: variable-text + default: 2.25em + - + id: list-spacing + title: list spacing + type: variable-text + default: 0.075em + - + id: list-bullet-size + title: list marker size + type: variable-text + default: 0.3em + - + id: list-marker-color + title: list marker color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: list-marker-color-hover + title: list marker color (hover) + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: list-marker-color-collapsed + title: list marker color (collapsed) + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: Tags + title: Tags + type: heading + collapsed: true + level: 2 + - + id: tag-color + title: Tag text color + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: tag-background + title: Tag background color + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: tag-background-hover + title: Tag background color (hover) + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: Dates + title: Dates + type: heading + collapsed: true + level: 2 + - + id: date-color + title: Tag text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: date-background-color + title: Date background color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: table-heading + title: Tables + type: heading + level: 2 + collapsed: true + - + id: table-border-width + title: Table Border Width + type: variable-number-slider + default: 1 + min: 0 + max: 20 + step: 1 + format: px + - + id: table-border-color + title: Table Border Color + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: code-headigeng + title: Code + type: heading + level: 2 + collapsed: true + - + id: code-background + title: Code Background + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: code-normal + title: Code Normal + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: code-comment + title: Code Comment + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: code-function + title: Code Function + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: code-important + title: Code Important + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: code-keyword + title: Code Keyword + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: code-operator + title: Code Operator + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: code-property + title: Code Property + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: code-punctuation + title: Code Punctuation + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: code-string + title: Code String + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: code-tag + title: Code Tag + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: code-value + title: Code Value + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: blockquote-heading + title: Blockquote + type: heading + level: 2 + collapsed: true + - + id: blockquote-border-thickness + title: Blockquote Border Thickness + type: variable-number-slider + default: 3 + min: 0 + max: 20 + step: 1 + format: px + - + id: blockquote-border-color + title: Blockquote Border Color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: blockquote-color + title: Blockquote Color + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: blockquote-background-color + title: Blockquote Background Color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: checkbox-heading + title: Checkboxes + type: heading + level: 2 + collapsed: true + - + id: disable-alternative-checkboxes + title: Disable Alternative Checkboxes + description: Enable this if you are using your own implementation via a CSS Snippet. + default: false + type: class-toggle + - + id: checkbox-radius + title: Checkbox Radius + description: Any CSS border-radius value + type: variable-text + default: '' + - + id: checkbox-color + title: Checkbox Color + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: checkbox-color-hover + title: Checkbox Hover Color + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: checkbox-marker-color + title: Checkbox Marker Color + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: checkbox-border-color + title: Checkbox Border Color + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: checkbox-border-color-hover + title: Checkbox Border Hover Color + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-heading + title: Callouts + type: heading + level: 2 + collapsed: true + - + id: callout-style-select + title: Callout Style + type: class-select + allowEmpty: false + default: callout-style-customize + options: + - label: Customize + value: callout-style-customize + - label: style 1 + value: callout-style-1 + - label: style 2 + value: callout-style-2 + - label: style 3 + value: callout-style-3 + - label: style 4 + value: callout-style-4 + - + id: callout-border-width + title: Callout Border Width + type: variable-text + description: Any CSS border-width value + default: 0px + - + id: callout-border-opacity + title: Callout Border Opacity + type: variable-number-slider + default: 0.25 + min: 0 + max: 1 + step: 0.05 + - + id: callout-padding + title: Callout Padding + description: Accepts any CSS padding value + type: variable-text + default: '' + - + id: callout-radius + title: Callout Radius + description: Input your border-radius value here + type: variable-text + default: '' + - + id: callout-title-color + title: Callout Title Color + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: callout-title-padding + title: Callout Title Padding + description: Any CSS font-size value + type: variable-text + default: '' + - + id: callout-title-size + title: Callout Title Size + description: Any CSS font-size value + type: variable-text + default: '' + - + id: callout-content-padding + title: Callout Content Padding + description: Any CSS font-size value + type: variable-text + default: '' + - + id: callout-content-background + title: Callout Content Background + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: callout-content-radius + title: Callout Content Radius + description: Input your border-radius value here + type: variable-text + default: '' + - + id: callout-color-heading + title: Callout Colors + type: heading + level: 3 + collapsed: true + - + id: callout-default + title: Default Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-info + title: Info Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-summary + title: Summary Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-tip + title: Tip Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-todo + title: Todo Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-bug + title: Bug Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-error + title: Error Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-fail + title: Fail Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-example + title: Example Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-important + title: Important Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-success + title: Success Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-question + title: Question Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-warning + title: Warning Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: callout-quote + title: Quote Callout + type: variable-themed-color + format: hex + opacity: false + default-light: '#' + default-dark: '#' + - + id: embed-heading + title: Embeds + type: heading + level: 2 + collapsed: true + - + id: embed-background + title: Embed Background + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: embed-padding + title: Embed Padding + description: Any CSS padding value + type: variable-text + default: '' + - + id: embed-border-radius + title: Embed Border Radius + description: Any CSS border-radius value + type: variable-text + default: '' + - + id: embed-font-style + title: Embed Font Style + description: Any CSS font-style value + type: variable-text + default: '' + - + id: image-heading + title: Images + type: heading + level: 2 + collapsed: true + - + id: image-radius + title: Image Radius + description: Any CSS border-radius value + type: variable-text + default: '' + - + id: scrollbar-heading + title: Scrollbar + type: heading + level: 2 + collapsed: true + - + id: scrollbar-bg + title: Scrollbar Background + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: scrollbar-thumb-bg + title: Scrollbar Thumb Background + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: scrollbar-active-thumb-bg + title: Scrollbar Active Thumb Background + type: variable-themed-color + format: rgb + opacity: false + default-light: '#' + default-dark: '#' + - + id: scrollbar-width + title: Scrollbar Width + type: variable-number-slider + default: 7 + min: 0 + max: 20 + step: 1 + format: px + - +*/ diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json new file mode 100644 index 0000000..3662024 --- /dev/null +++ b/.obsidian/workspace.json @@ -0,0 +1,202 @@ +{ + "main": { + "id": "687d1c86232da224", + "type": "split", + "children": [ + { + "id": "15fadcc006380479", + "type": "tabs", + "children": [ + { + "id": "6b7a81afba2d55ca", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "DAS/Set Theory.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "Set Theory" + } + }, + { + "id": "197c8e18c8d8ef8c", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "DAS/Functions.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "Functions" + } + } + ], + "currentTab": 1 + } + ], + "direction": "vertical" + }, + "left": { + "id": "9ec91dab2caa0289", + "type": "split", + "children": [ + { + "id": "3eac170f3e784f0a", + "type": "tabs", + "children": [ + { + "id": "7a0e7b37bd89861d", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": { + "sortOrder": "alphabetical", + "autoReveal": false + }, + "icon": "lucide-folder-closed", + "title": "Files" + } + }, + { + "id": "4f49c1281d39a560", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + }, + "icon": "lucide-search", + "title": "Search" + } + }, + { + "id": "2e48ff6ec7a1cd18", + "type": "leaf", + "state": { + "type": "bookmarks", + "state": {}, + "icon": "lucide-bookmark", + "title": "Bookmarks" + } + } + ] + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "8a65bc0c1d4d98f2", + "type": "split", + "children": [ + { + "id": "9a7ddad3818b86d0", + "type": "tabs", + "children": [ + { + "id": "93d7330db83403ee", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "file": "Studium.md", + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-coming-in", + "title": "Backlinks for Studium" + } + }, + { + "id": "6d8323e062c2ca0a", + "type": "leaf", + "state": { + "type": "outgoing-link", + "state": { + "linksCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-going-out", + "title": "Outgoing links" + } + }, + { + "id": "10b1fc99e21f5952", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": true, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-tags", + "title": "Tags" + } + }, + { + "id": "9ef86e6061e150c0", + "type": "leaf", + "state": { + "type": "outline", + "state": { + "followCursor": false, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-list", + "title": "Outline" + } + } + ] + } + ], + "direction": "horizontal", + "width": 300, + "collapsed": true + }, + "left-ribbon": { + "hiddenItems": { + "switcher:Open quick switcher": false, + "graph:Open graph view": false, + "canvas:Create new canvas": false, + "daily-notes:Open today's daily note": false, + "templates:Insert template": false, + "command-palette:Open command palette": false, + "bases:Create new base": false + } + }, + "active": "197c8e18c8d8ef8c", + "lastOpenFiles": [ + "DAS/Set Theory.md", + "DAS/Functions.md", + "mathe/notation.md", + "Studium.md", + "ET/Netzwerke.md", + "ET/Kirchhoffsche Regeln.md", + "ET/Grundlagen.md", + "DAS", + "ET/images/beispiel_knotenregel.png", + "ET/images", + "ET", + "mathe/notation.md~", + "mathe/4913", + "mathe" + ] +} \ No newline at end of file diff --git a/DAS/Functions.md b/DAS/Functions.md new file mode 100644 index 0000000..992768d --- /dev/null +++ b/DAS/Functions.md @@ -0,0 +1,27 @@ +A function takes in an element from its **domain**, transforms it in someway and outputs that transformed element, which is part of the **co-domain**. +Every element of the **domain** must map to a value in the **co-domain**, all values of the **co-domain** that are mapped to form the functions **image**. +A function must be **deterministic** - one input can only map to a single output. + +## Notation +General function notation: $f: X -> Y$ + +> [!INFO] +> $f$: name of the function +> $X$: Domain +> $Y$: Co-domain +> $f(x)$: Image of $f$ +> $X$, $f(x)$ and $Y$ are [[Set Theory | Set]] + +For any $x in X$ the output $f(x)$ is an element of $Y$. + +## Mapping Properties +### Injectivity +A function is _injective_ if every element in $Y$ has _at most_ one matching $x in X$. +- $forall y in Y,exists^(<=1) x in X : f(x) = y$ + +### Surjectivity +A function is _surjective_ if every element $y in Y$ has _at minimum_ one matching $x in X$ +- $forall y in Y, exists x in X : f(x) = y$ + +### Bijectivity +A function is _bijective_ if every element $y in Y$ has _exactly_ one matching $x in X$ (it is _injective_ and _surjective_) \ No newline at end of file diff --git a/DAS/Set Theory.md b/DAS/Set Theory.md new file mode 100644 index 0000000..5b52e15 --- /dev/null +++ b/DAS/Set Theory.md @@ -0,0 +1,85 @@ +> A set is a collection of _unordered_ elements. +> A set cannot contain duplicates. +## Notation +### Set Notation +Declaration of a set $A$ with elements $a$, $b$, $c$: +$$ A := {a, b, c} $$ +### Cardinality +Amount of Elements in a set $A$ +Notation: $|A|$ +$$ +A := {1, 2, 3, 4} \ +|A| = 4 +$$ +### Well-Known Sets +- Empty Set: $emptyset = {}$ +- Natural Numbers: $N = {1, 2, 3, ...}$ +- Integers: $ZZ = {-2, -1, 0, 1, 2}$ +- Rational Numbers: $QQ = {1/2, 22/7 }$ +- Real Numbers: $RR = {1, pi, sqrt(2)}$ +- Complex Numbers: $CC = {i, pi, 1, sqrt(-1)}$ + +### Set-Builder Notation +Common form of notation to create sets without explicitly specifying elements. +$$ +A := {x in N | 0 <= x <= 5} \ +A = {1, 2, 3, 4, 5} +$$ +### Member of +Denote whether $x$ is an element of the set $A$ +Notation: $x in A$ +Negation: $x in.not A$ + +### Subsets +| Type | Explanation | Notation | +| ------------------------ | ---------------------------------------------------------------------- | ------------------- | +| **Subset** | Every element of $A$ is in $B$ | $A subset B$ | +| **Subset or equal to** | Every element of $A$ is in $B$, or they are the exactly same set | $A subset.eq B$ | +| **Proper subset** | Every element of $A$ is in $B$, but $A$ is definitely smaller than $B$ | $A subset.sq B$
| +| **Superset**
| $A$ contains everything that is in $B$ | $A supset B$ | +| **Superset or equal to** | $A$ contains everything that is in $B$, or they are identical | $A supset.eq B$ | + +## Operations +### Union +Notation: $A union B$ +Definition: all elements from both sets _without adding duplicates_ +$$ A := {1, 2, 3}\ B := {3, 4, 5}\ A union B = {1, 2, 3, 4, 5} $$ +### Intersection +Notation:$A inter B$ +Definition: all elements _contained in both sets_ +$$ +A := {1, 2, 3} \ +B := {2, 3, 4} \ +A inter B = {2, 3} +$$ +### Difference +Notation: $A backslash B$ +Definition: all elements _in $A$ that are not in $B$_ +$$ +A := {1, 2, 3} \ +B := {3, 4, 5} \ +A backslash B = {1, 2} +$$ +### Symmetric Difference +Notation: $A Delta B$ +Definition: all elements _only in $A$ or only in $B$_ +$$ +A := {1, 2, 3} \ +B := {2, 3, 4} \ +A Delta B = {1, 4} +$$ +### Cartesian Product +Notation: $A times B$ +Definition: all pairs of all elements in $A$ and $B$ +$$ +A := {1, 2} \ +B := {3, 4, 5} \ +A times B = {(1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5)} +$$ +### Powerset +Notation: $cal(P)(A)$ +Definition: all possible _Subsets of A_ +$$ +A := {1, 2, 3} \ +cal(P)(A) = {emptyset, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}} +$$ \ No newline at end of file diff --git a/ET/Grundlagen.md b/ET/Grundlagen.md new file mode 100644 index 0000000..8b6fc83 --- /dev/null +++ b/ET/Grundlagen.md @@ -0,0 +1,8 @@ +## Formelzeichen, Einheiten, Konstanten +- Leistung \[$P$] in __Watt__ \[$W$] +- Stromstärke \[$I$] in __Ampere__ \[$A$] +- Widerstand \[$R$] in __Ohm__ \[$Omega$] +- Spannung \[$U$] in __Volt__ \[$V$] +- Ladung \[$Q$] in __Coulomb__ \[$C$] +- $Q = -e approx -1.602 * 10^(-19)C$ +## Netzwerke diff --git a/ET/Kirchhoffsche Regeln.md b/ET/Kirchhoffsche Regeln.md new file mode 100644 index 0000000..0cf1543 --- /dev/null +++ b/ET/Kirchhoffsche Regeln.md @@ -0,0 +1,14 @@ +## Knotenregel +- Die Summe aller in einen Knoten hinein und herausfließenden Ströme entspricht 0 +- _"Alles was reinfließt muss auch wieder rausfließen"_ +$$sum_(k=1)^(n)I_k = 0$$ +### Beispiel Knotenregel + +![[beispiel_knotenregel.png|250]] + +$$ ("I") wide && I + I_2 - I_1 &= 0 \ + ("II") wide && I_1 + I_3 + I_q &= 0 \ + ("III") wide && -I_q - I_3 - I_2 - I &= 0 $$ + +## Maschenregel +- Die Summe aller Spannung in einer Masche \ No newline at end of file diff --git a/ET/Netzwerke.md b/ET/Netzwerke.md new file mode 100644 index 0000000..b63792b --- /dev/null +++ b/ET/Netzwerke.md @@ -0,0 +1,22 @@ +- In einem Netzwerk kann man allgemein $k - 1$ unabhängige [[Kirchhoffsche Regeln#Knotenregel|-> Knotengleichungen]] aufstellen ($k$ ist hier die Anzahl der Knoten) +## Bezugspfeile +- Richtung egal -> ändert nur Vorzeichen in der Rechnung +### Verbraucherpfeilsystem + Liegt vor wenn Spannung $U$ und Stromstärke $I$ in die selbe Richtung zeigen. + _Es gelten:_ + - $P = U * I$ + - $U eq R * I$ + +Wenn $P$ positiv ist, wird Leistung aufgenommen (**verbraucht**). +### Erzeugerpfeilsystem +Liegt vor wenn Spannung $U$ und Stromstärke $I$ in entgegengesetzte Richtungen Zeigen. +_Es gelten:_ +- $P = U * I$ +- $U = -R * I$ +Wenn $P$ positiv ist, wird Leistung abgegeben (**erzeugt**) + +> Es ist sinnvoll die Bezugspfeile an Widerständen in Richtung der +> Stromstärke zu wählen (-> [[#Verbraucherpfeilsystem]]), da ein Widerstand +> nur Leistung aufnehmen kann. +> Dies vermeidet Vorzeichenfehler beim rechnen. + diff --git a/ET/images/beispiel_knotenregel.png b/ET/images/beispiel_knotenregel.png new file mode 100644 index 0000000000000000000000000000000000000000..682f7954dfb881e8a02535716b2e138f103635ee GIT binary patch literal 85915 zcmXt9WmHsu*Bu6wp$DWTM;fH1V}K!~K?I~hx;v%2K^mo7q@_ziM7kM5TDn{Mz5Ji` z4$Chry!X!Up4eyaeIiwrWpOacF+m^@&TBb@ItT>50scWDVBj|iMts^J5Dn-xLPEpy z^IrS5%X4JPrT=hyyU~(I!kpdfV;F1d-i+qQNY*~nj~SV-Q%bDwgRfdQlnido)n6t3 z>q~MpzG%B9vK`QTpvh#1rqQ$_|y4t(|LIANg8I%w}L@FP@9^TwtFsw?`8e#W?OXU z4uPNzDYgnTCJn>K3{{+%bQ5i&XQd4jtk&!J;AL(uGrw!hiQO#{rBiXy$C#tn>}=-d zHq~IKatWdR5RHqU2UUmYBVQ!SF(fgk4amk(kUf8{z>w5Zd3a97iOoY;y$XB}ISB+9 zDw$r~+|l88yxMbfc{tw?8?oXjkkm&N`3rt#tBKn;ciVusGVFu`-dr-4-;< zUx|y0b8$KC&(#m4aTvCHpP!D1=VWK!Uybi!cS3sWFhj*`7*9-B9r7AKM6{942SilmQ2r-M)BSD&} zX@`HBdAPWa!^Lk`1~Ygv6o2s!iHf3z8DEgrAW@A-H^?O7FCBQdT!qfP7aHt95xr|E z^7L8q3e17to}ac`{Qmw<#BykN+nHqU=4@Fw`1$i^>~sFiAqKm}kH+c2Pg$wLX46z3 zHnsY*@-#tyzFFSw9ksQq%-IN-8cPZ+5rW2Y_D`8rX(Fm;b!J9efZ}Pu)YMcs9yK31 z&a@D=%Xi}{VjdGTt(Sk!7*~pA(|g}7ThVREGuPMF);2Y53B)CHC-o6V_oy=cCE7gZ zKP^8D>0a>^Ign=6O`Wpj1)j(NC)+rkHjoI9M;o`ru$S=C%eqs7BBWUXBjxF9uaADk@bK70g8@HQGh$eWu(x;^rBA;?m5(qfAdv zi;!qD5y~?p<*7nscK(osdF=piUIyD?Y!2peD@}>2OX+wqLihFSSCJ3@stu}Gi$3<5 z*6S$I5s22|1T6V>bvNu^U0r2lWGI)Qg32_$sFxvN_`}K;>8QBCLnXs!98Jo;XU#lN zRvS|st>XkQis6yJ;)&OCA&VeRBQ7Z^5zYe6D`!NDCB>4L{14l|uQCNrHy8V5Wz6#p zINbu?XInt@y*mbSEGnGLz2RJgHgRhy6ji}DaM2>imrq=rqv)$@pCjpKy{y|1Z3vHD}WXa3|!rpM;niVQdgyXDl;SFxGPl(xVFaN zx^s5W@$Ea&=HRWFi^<8!o5N23tCMw^g2a){CGXveL*GN69+NSTKrU<-BjcX#7;Mp- z5VQH+U2Q|8t!@HX74&y~8Hx#!pR z!6S@y>OEq!_px3ZBV`7_X&_%05-^MjjK+z>`Rcnwnvp}@%6Fc{ua%X`Dk_chK<>#D z03|)5EhJQ`OzhZM}c<V7eGNhhe1XuCOOy|dr%EjXTh(5EHqPQKn(XQdB5A+|#jPnSDfu4#K+jYC?WRB9 zFu#A%-`~Htw-=0#S6ou^a=`nzhhzkJrj@SHG($hZq&`pksw@N^iM>gBFe(tUGsjvl zz%(e_#F1G7#q&x&*Ak~YZksD@#d?V`TO6GPey2G5DQPsH7?i%F=>KYyV*t-@vsJJe z-h68DekH{JylyVcnJAYMvw20YUpHbxAZ4!KlC9kx9!${#-uZt*^6hy;aH$~rfHsGnzzcd!s_O2$LByck%Z2c5@>Fnbgdzbce@NiIU@n z>m%*zb+VK#%*@QJt>xvtfU?@S#DQbKf7E9v>}jUvM-ulnYKepDu%832TN0P zl-RP8OG1=aWAV#>ydvo3b%uu646$0j@%K?La~uKHMKB^%bgr zncoLOu=C;mrt@au(A?Y{XiYZtnaSLQn4*5>sY_8{>7Xl>D_KrCJeS426MK1C^Cz!7#+68-A=2Ls8qRk2-nt=d1An$DKlXIyvh_ z3R)ZoLOlGJFJBG~54*SOBY@23XglfxUJyZK$faf7?4T)kz0Q6kkcEH${yp@6xUsI! z>@%&M{n{AbTQdqxTocIl7~~z&W4FlMcrTU)bits`A~6l98gVJwKk@EcD7TH`=tuNrCz~t9254mEj^vG)zn$%g5JW4}}amBY;X* zl!OvAcfhu{8Bljrd&kd7iYO3*o!`3B_lH1NCQa>Ivf z@%uILMgNC8psFBDo4Yx0@EU+B7_lZ$UcL}YZ|w$ERiKZpVfnchLI6k0RHjgcs)A6U za}95*TK5~23l&knyd`~(&a>w`MK%}0C;qQ^Vp~x~h2!N*d^ILQmb8JZ4+az8mdzs( zt1~t4r>xzaot=Gs?>2@$H99Pb`CflRhIQff&Sq8?Ma)%9cZcJN-pKwRC_!0yP>`^`h4Jf`Rpk9sN^dq!69$49j0@*X#a@(Zxn+ddl%Kz{@WZv)C4j5^ zj5WbnjfD5U1^-+*vp@+@w+6Dx+`M?o8U@ahaYi0-?fml%oqE41_d7P?7m2^e$3K#6 zw>30qvZMt0oUTW&2@DJjAS(?Ywz~1E^jrD(`5V7|o7{G#=*5?mV-|GIFuq{@>X~kA z@m^X61j{4*rgL%oQAZc~WSi?v>PdpUoq$zSDFu`u(M*@Me0Vi~(Rz!(jDa=k3FK4o zJnk&w%8#kniI{}M!rWXaD~_Z=k3CH)Z!}=LCwhZ9RUQZ@Z||1*{o#=j07~qCdzhV_ z1;7~|35S6#FS%?y)!h#~zv{NylSQ9H{SH?Q{7|Uvobmq>4{gSD%}HO!Vdhjp)d3TY z3~RRsOt;!DrjEYYKT)>~Esa|+&~r~sQ$$WHy&;U&W(zV-px)*kd=_f?ZW_SpfBt-4 z6DYPyl`m2+BeV@X;D-XBs7I1Esn0TVW1FsOzZB_X6JTEVu6zo>Yx54Bz6XDrO=<)L z1qENday#8nQaRq6W9G)L8+dFvs44>x#5X$|vmPBif-H6#6BhdDCy?;=6Q{)o)Jkt} z3HAz23*$wdceqIeiIC)|1f}3JO;?H&M@E=+gO1<+4@UvuXzFJ78ejk_{UDYzWRBBa z%{E{oG-h4jM(6Gyz8Gs#^RJuw9*VC}q|TjjmTkY)VzFS1ir2mO{t;+^t{x(C=l9vz zbrc3N*D;53CGjz(M{zj5bz|B6^2_ZHL_J`b4}jBPdKBar8c3~!hS0lZT_rK7K(m7M`J6Fe5G8~}+$_dv&@ z0~RxTaVhEsId2I0R=5jL&Ta72%dK9rmDXqGB@^RDs^dF*jk>|d>g>k84q6ac&lPmUjra_d4$K~PPw`#7I43nM!V}cjOX?J%AokO-j z4e5qNA`chZg~i3GzqYP9uoX_a=}&xH zZC;0qqVo+X@G~WDVNq7{*wle_MTQqed#*x;AC7xc%C&-z2RaUBTcS~30|?0PKLm89 z#SETzM^3k3MQb?hpn1b8iB6$7&%B2-SM+*4B8@)qy9yty=IgvmY^d07`MsH!fG%|? zE>@T%jaabvaCg6`^1s^!Af7l6&)UM0b^XCor~l=_!c+>;d~E|}vK*ayh33F|tyN~K z*#a;N`9ECxKm6+z_tu0J5mr}48RLpPCMbF!R1QQ7(oSvvX8Q7FWMzd-X6oxm6Jp7y zXPq5*o01(io?{9@kWY3N_Sw_Zysq`7Wkk^lLxIIV97p1JTND%&fTu8A@;Pkp>wC>X zCzvy`+v0b+F?0!}UfqbeuD<>`p(2#WG%hwa%k!XFzG#)+&ev&oy7jQ*rgiD=;QsC= zZq4&k%@!~TVau}fya0hA9RCU@+=xl0`lDXQ5pzqk<6VJCf29uL5u+00xu)nCdXNw! z>hgduruf?ge-*=@n7Ss(uis<&0aqmYou<5-P?mdZmK>dd|D7As%{P_+H=MH9YVvu* zdx!dCOLf+?fu(jw2_$b7S1J@n9t$8c_tt$a-No&uy(s{5fgT|Z97GeMsW8N0WG5{p zEAuR0BTNxLWW}uT61fws9mLsW!aBcGSt+2PAk$jDO{=($=m42Ro~~+xPZ8}+`Wm3+ zj0tZ%dyZ#EvxH(F)y?Z>T{efagxoN}3}hUWGLS?dL;8}nUNM#$LAg@o^?`x-Y z!0pgaX`)S2&vpTr?*W)B)KvMULfFMcTQ{xno3;jPDox@JNB=#+hiW7rY-;;k8gbS- z(NJxXajpdh&k)YJ5#MjYd7EVP4_LHqdrpUZwly6_ITa(XunT}e z@bt<^>#JRbu-~@i-)gfkK{=opg;6dIZzw!iq zNWw|9=Bv1p_9!YAmX8ic)PSzoNLv^!5HvxTO>&6;4pT`CZt#Y>#DTIafMRS5e3jxd54lpGs+#A6;-xKu3qalFMe53q| zoZ9;;D$I)WM%)P;C7rzdI#^#gP!@wQpo)#2Fj@HCOU$}a_%MXh7`tu+$a-wytvj0a zhRm!`FAuNTtvT-0Uy@|C??#_Q1hc#F8S4)B%Uc*5*nCx>Q)I~14$=;SyyYOpY!~vw zY`Y$$NyZu?9vp1qzi+s|+RQ2|`+2!j#bbFXqE4N-S=j&5L+|0# zx8+*Iz?BtZf-AXlPwZRf0-7!}Soy4Uo#1Vj9GN@iO0r>P_m-tdwkuyX!1k%DT^%mn zj_VE{6`Svc*Ug+;O%nw{zAD>JeZ6vB9!kWWKx~IwuhZvBGraF+0pdEJyX2CZ_o z$hJ+Uce~$ue~KJk{;qey7(jPevZu|@bMauGYCNV5tHDbn8Z^n0@>G(kGpPbip5$>? z%2h5%I6SwJeQo*lLa?cMi_1>CODHS!Nqv*8yPZA{XG)muQ$b^GUkO+u3eX282MaRL1QmmGtNd#bP{GcNe!S)t zfl&yY9|aBSU7y6?70{M?wk#Ud-ZhO%6y;H=!V|^nUwzO0bjE#PfpX385|s z`D2e~=2tg17h0B%@BZ9Wz4%?{FN>T{6{+}qpM<7T@*{<>AAH0m3B9&;VM%K3+@UD= z)g`F@;8H`~xgDJado85f1aJGI`n)~%vhaP|gl2WiT)S7fsF!fZ;;5~pt^_hjnM4oF z+_tr0bkT9RN^UFHuyQ+>?K{zKt2(0bd{g-e4MdLJeS9f%mJqaFr`nGYgHMv&)M>IuW-UDfzj&gS2}`7 zq@n-a?bYe$>R)@P0Qi-X8qFGiU?q%CGx&gyM?Frd0FYq0$(vWsuPEOz<40eH;^L;W z%RqXaG_|xk)6@Sgul9_H-F#JL`nh&26^^_A&9_QH((tUQ!hC-?>&gb{XSiX7P9KwwT(0fyLLvCk2I1%?ZdI-N%_P~IeLTk)!gq+m*Z z#)%Gsf+*Bu&XUt0R)Ault_EQAKG<~QZS@{?T^y^v;BS}eg2M-^%a~xbYzoY7Cx81o zZ(2Kry-o^^NwbuJ$_w10udnYDzeBc=8w*7ws1rS1?Gd#g&{nN)j2k3vnL%y!90Xl_ z2bqb+c6R#*3$5oecK~%*uVZI#uPlG{idY&!7D=b_SuQRfqj%q}3kIjbk&r@Z!Cm3( z`@tPMPYJ?*k_$oOL%rhJEvazu+fcSLD;Q478nBeUx&FwXGxBg0F0ROsG$MMb$3~0_ z(nt3G>ctH00_L>-e)-1v{d&U%l`1Zm?~kYV>Rar}MtN0ZfwT05rmWIL|N2SfRwRNO z1%#~BpK!b5N+sG;!UI`mMp!|k?fjEvJ-(?+wd&1Oy- zmPT^=o8Ea>L)7{`rg!CX;z`kxwd?nab2rq_ck*ZwM`|DT!*cMe>l5sZXe^pR`B+MepDia{eLALW@1`=(IHKzNdG1$xNMTdw7 zVNvKc%GmRVHixr#sGxx?%Rntf@Af`KX6EQL#+IvHNCA;q?6vSZd~7RttJ4v{@s0Ki zJMOI|Dmh|aC#JmQ=j8(2gAo9IW_*F|k3kEA|0#w4D;(%=sE=saA(~@CVncGT=`s2| z0+|gD&O+k952fZUpQ2`O##<{Vz`k?40Dg2Yii=!My5D_Z5(!81d z{G;jNGAq%CzMb>ydK)AI1H+f89e|FFqZ0kHD}-Hd6KC8(t|@}egJ6PH?RQV?KRrB* z28-Y6wo8UJyb#u(XmIOAnFkMmW%JM^+BeMNb2ZEF)(hhAk9x(~IbK?2hDE&C{5Quk zmaYBGtCofdH(A}Fm%W>_17M{)Pltsw6wL)}u4zqL7dqT_rvc@yC>da>f3a4z5ybai zdh21I5&{9k>4S0o&WZ|gL>kMG4c*aNJsz)$7^Qbi*1&ZY=Hw|K8K&Qfb!^2MVCAd> z$y%o?<{JkM6P) zm%39PWl;yS|CgU2S3fs>!ZNutV>>etoi!r1{ef$RSGU1#ib`zq{u-GuS*_vpo-0cF zo1*;B_cTS+cOp$Tu=$48h00>9Vym67W9(m@79#fpV*`$Jw|c!!Z6|y!mBMjrvp(59 z0-fxrZ;2^;Gk~wL9E=ADKnB1h3)Ihc4Hi37E3Ux^K>wJ1|MZqkg-hRt@JEO2U$VVc z@rekz0K`yHQRqO9fX5+O{VNZ%zD&P}*p|fCx`k}WqFt?+xi7zoT8=}QNG7VXW5pgQ zAT9-Wjz%#NOhtgQ2?Yqcf5&UUr`SqN`Tb-bOj{QMR$sRH`~+s-a10&0y}bqWv(;4? z47Y>_3zV#WdU^`bK5Z_S2aU=(ervJ(EGbdNRzFo?8HN+8!^mK~_?VefT%T zzeGVzjdWXZTX1i+n|BwW;8SwZ_>+uX_Y%lnQ6nQ!Tyi%)>3WLvavN3R4=!oF!&W=( zZLC$pMszuNzMI0U>uI6RD3jj<_}a0HQOfA#_E{%3@VO{(sRfmlz}qdCNGkGdTNZh=Tj88E9l|9O3V{r9ga0O`C={?5$I z9L0P#&VIz1i!PiT`MPGYyDba$$XYhq5W9K#vRty|$mhED73F((BrDYsAwJ3!XeV#u zkqV$vt?+OSe`?rhs?m*;?W>)=mMT;r77#qzr-le*FWW)0v(|I?d=bMZpFjHQ)~q=Ds_77 zB+)&928SD-!{(hFP`bn)1PmiuYSl=kuKChKDrj0I?$eKlbi$vE5UIJtRFnJwY8v?0LVAvC>13qTJrvohGdL|6XDhE zGChd{e&lj@X^P-gZCOVw8J^`;91&038RLD@W53U5z3>VLPw)aNyz|y*-VXyP0z^|d z`geKrOs!@Cu_Xk@%>^?`gi}I+&}jzE@-nPK;{xn+ z6RKaOUX*he@_%^c+XLMT5d4NbFd&%ZV~;lwIGWb02y~$Z(FIj5bhsR@_;m6V7oU_B z^6?eFWtC~B!;&5}r6CTlMrnCE{ze?!IP?Abw6)B8B+j?P@`wZT3$-}}(m~u{$4?%s zQvo!P2qp^L67@1b&3}ct;MuQS*$8(zm+kgWBa;NexfL6nS4~mV_UFzdzow1B73Z1S z@4^@pgQ{fHdRq+^oie%;FS!y^5tKyEbOuWujx%B?v~M71@z05oO*#+GB1KKPqpF3c zVXxi1eS;1_C%Wk?O~6(h*~rh+Si$h3KQaYgoA$eF@k+=sZsv@kt*bTzcAJzawJ(-M zVB*?zc_}vB#B@$68hQ+szn;PpQxl@1ShHF($7l$q+G#SG2(|$oZSC~WpKpPJ1z1D? zlpV>GA|D$YFaB_QTB4lImLeZ!{9Vp0gKH2O^ca^=8s=>s^H!>|mpw#dQI6E|+^+lt z>V0TMJnrmxJ+M@TTJ`CEGc`67cC1J=1Pqw3c;L43Nf&+&XvJq0LcSRVMhdr4BdWe+ zlv~QsHh?P_93Eb5cGJ=Dn+oA{#x~^ej+s{NxtAd0R+r+hlV~6Qkdrua^bn-JX$rS za)3#gL6(1I3Iaut$NnM#7~%V#XlmboD;2tpfVt=804zXG;PbF)9F^e7FF-E8yO>|P zo^H$^E4?hN$iaenE284hVNU>#P*sA6%b+8Y7_S4Ycg9E!2l&{_&0(8 zhCfm%BdJQ$Sx)_~p5E7n=}kgd>OuzV15>Q|X@3eUzz82u-yekoWcBo}+k8WN_;jJ3 zwzj9^!#yC6n_E~cd2MDrk^@Ch?OH$})D$WBDc1ayHUKV3qaVaB(F_Mm$kJ%UZRw2D zQtIF)v@%U5KMlh*Pd9N&QI_CS=z%3GYnVd1azD|~p)`S>H_P6Q z<|sv<0VlC006+@r4@W-$irNQg=zyI>xzT1e)mfkR@7dYe-~Ze@2aD~Oc;YwPx+IG% zVUjdx7$~1!_=SM?gdj>|+rPb)Ua}`#(33w+f7)ZhlI7$Ah-i6wKXyn{2hus<46%K5 zzg|FhyoiEd`60x+zNF!F9-rsD@B%fUK`wQF+D}@Y-TTSNUarU4&3o7{-48kVoqk%n zHFtKdo!Ca>e;+n2JBbJ`shs zF%g~1zbj9c&Vy`!mZRe$C!$4l#TXZUdclzo5&pG=%K>Q1fG*m3yUqc`O4ENHqlX0N z1?AQSyGGq1^Y*bVZT)WEj>{9Wng#hC3^5e>H<)aP9ekcsK83F5%mbVYmNDwDQ~He9 z8L^}*G$#9{-?5v};$>j}Bp{89O4yzv{2m(>Hky{43onD43D3-|F4wwYEVau#ivZ|` zGR~Ty1mZYcO5=v)4ytikN zYX1D2#Iz=4og1ht>EU|B>aQW;$;Iy^XJ{gV$R?#)u<_VJ0ClC!>-3SgGQ2-YySnl! znw&0yfO;D&EG)#Yw+d|8b*I0**nQ=wU*m<_D7vy3(p2d-Y*lf=qDK?5-^;+2v#$a-x8LSNa2MB1@=7kEdr*7W9((d!1;y+ z>-wGZmSU@sv*0~_E`aak&~I@CLRZXEw2xy541|M(Jr4Pv$F@@qJPSg6{PTBE(R;^u(w*)+3kJ^( zdWr9ScCQftB9LQ|rM5hYRTw^tF(b7X03V|jeM}yRk~ApSh;hb$^Lk)(H$W+g}DTeJIh(!nQpDieSfO}Ha#N?#ULlomjAv$|bQtEP6|V0N+7 zrIfQy9rlQIA$v<6%go{89bjc~sPf5V^tk<x$@mndtEGb<8pjL~xOJWxa3uEJz>+@Z}UE!|p z5#M`;*g~j*bdxxqKlO5RyWZ0q_V|Po^a%rm`kkiA>j}I>$xWl$WLu|~cTW8qzA)$| z;B`rb`)#*)>esJ3c? zhRojXO{7@hZTW3d8Gh4mO6|;Ms7{nllp3g|72looS3;DEBn`fHZ*YgTqxw#v`|!_! zp@MM}`|kR^M3OWR?~wNj5ZXjJOG)`|IJ0PX3bi(N`|Jyl$L=V9Cz^1!566-cjTJfB z)6C*gMOu0qp$5D9`8XH>7~N$pohqW#D$|&B9IO1WGqEGD-Th`x5CmEl0A9WDtY<^M zl@1f(I4=&rq%BT zs_&D@tO3{Tbt-^))!mN8WW99&Co9V1IlTcKpoc37@RGEq(&(yCUq(Cl+F zyuhJ5}k&=J@>)zu{> zCAqk`{9x%2wps zwM_LYnP}Uk9xwUb1z@>Sc{o!6_zNG={3;Xz4E2?p%VVvFHFowH92%5TXb4C(cT0^{ zIB*^NBp@!1eqW5iuV zrPoih?L5!Uy~E@0-n5ZI1J(qd0btVb;oMLmT4Bh1LYLA*M=k=Q2ltI4aYjZ}l+grdcGDrdtP#~Dvs zMOFuPC+@(7$@26`$ST8!y}A*AR!t*m+2=nufVF%_2%X>dZN^gx1`P~UCS$5yggx8#t&$y515^+C-xJ4)vT9)%aLj-hF9jNZ_bQ{*}qh7 z*vw6WIrKWls`h1}@aoc&PQm+|pYbIqAX+n)6d}L^4$K<2qstbixW{Ksu*4=Hoc8A% zKMieMI8f25LL5W~)}1#EefDpb9_|67ac6U@-Q+$BI?$tzXDxEPy0nw!;Y%cC1UQ|!5UwE0HsL#Cak^BAd?`V8{yr7)`WR#f)_~3Hxr?E1$ zUEj$~DQwL}%*{?;=7A`f?W8;;Gb!T)#+u|y&h>_wQtIWWN;PAgU;jN#7?NbcsUh8Z zdKMH?jT}H7mDqzAznEd77%Lb24g~N_4_@sh`xgzCrK@3&$DIJcr4D@V+$+nIqhtzz zih6YrinZ=c7CJMO$1NqNT6S5PU+|D>)WajMN=@o190x_qo}uNa%e-}8V8?L8C(Mr? zf8vS{w=A_`Ay6wL+&IZoPyF(hf|}>ouR-;9!0@3gA%YwBTKyw5L@tmjKf6T&yw^B; z^4;NL-^HV&*_*>&gi73HWAN&96R<1;o?QM_PmRNp9XC(lr8R2^J?u0)WC=cdXQ1;G zR1}cxzk1h1F`~?13qlX%jm4&1<9ewz8ZG^fS)!ih*BA4mFC+@-eUjW5iI6QJ3=Jkw z;L4R@U!~;VdXuLQ55%Fk8p#*+2mwDU}M0=8@zevMrag z_L))~+rvzE}28b|~2o+K-Zdu>fwK{T46}k&C+z>g%Ew zB_wZU2@^oje|*e;X@=y@l0#c{dYQzB;=|4D^{?D!L{v50h$CXSg%}Zui-3~L`Qf3Rlqi9e`mLZyj+=SPC0_Hq2 zHKkfCb2FZn9|pgsnsMP}@cvwdVkT8Slb1aEqdpT4?fRZ3GE>ORfAljEYVxh0eh*i| zccQ%X8>^AH#NKG0)Wg5{2LUm$`}>>2hjkABX1}}ZlapHY{((VnKwj#+Y(LBr_2J7> zM#p-xKTMOc!kDfmF#aD=hS2@pV*d5ls`f8cZu?|RoibC+FXnE8rJ9H`$Seh25;Qi* zIG{K{59kU|xF$<&$_8 z09H+aq6I-4_ao1@B7cg3)sEzwc?ga8@uDJ{^$sc;7lqvSW`Jtue;jQH4A$szYZO4C z0Zg@5vm<_*OoX=$1lXvb=&K%3mb#Bch#r}%=*#9v#QTw~uT3me7>xbWE?-$#%zkgs zW&}BElVuVta>sz7eEy@=T6UhTzK8u}dt#Ci2$&NPGXN>te$vnSXs@{6^uM>TvjYag zc7RlQxUPD*2KJ6jxyh7}qOA!rJ*$k_$U#++L`ZCWXz#Bx`6pOU%Wo`pNn3TUn0UXqDHfibnbjEJf`>PpPK4lc?l*F zpI}JD^VxwKu;&^0!x8(Wx_lKU9=ysduyWU6jBrFwD$HJkMTS-dE|0loQ6n)Dvu0s% z#Bym%28o#cX0m6Mzb=!POQ~7A=o4zpSBJ+2^rCdpfDlmk+4vWXfa?l|Hq!Ulzq2ar zCh-IeDW3#E01l?gh#jSDsO+t7K^~_k|7i?qaXvx&WrBJunamKU&*K(>!;w$~ro)1? zq~QS+O>=3nppD80`@@eDRvsMN4gXMCagmaT2H|*zi_tf*d%p1f(e+Zianj4UjORD}tbFbOXPG4R!p?kg0VIbq_Uywi z{?C>V6;0>;0?rO&C4Od07cMQ~yRy|ZqosyYq#HJXPiXeJ_X=HzpWWZ@s6Q%ZzSl)6 z3BE#1UdsQwbU>qVcs+ew?0v&`uHq2aK2CX4;NAPic%HDLeVoiMi?OpSYIA0edTE(# zV+?pA{0rncgn!{WN}XfGldYgPcZ(LYQak>0RaN$ZL!A1TDeEcgSNcf)F2wcPDNl}U zFyq}H<7LH1v)FE`*%il|QOagv_4hOrGb1A>CX2xK5jq;cexVq~l0yE)ggN@2)N2)t zH94*Q0(_Wha&!&*jUw{-n>NFzGM-H&3DY@Ax{daL->0Q=_fmoSY1onePwbaB-8X^= zYVj~*s&He2Qaz-;zW&`nuYbnp&y&1EZVUKPgcxxy?`N{#%9K@%+kwW=gOp`ppi<;6 zK#!%GJs}z~Xpj5Bc`8Z<>fR#);7E+I!G3x>O8Az(1Y*ei^hYrIn>TOZ1tg@cYUSpq z)zpm9KAZs<_+X#YpG(E>QPTL#WrD}93B|#H(A)jtO$hYA{lafL6#xmrzshVdi#|u- z#Sd(WiBKWk?yM+7joo7tZ@_g#|NDDD4Bwt8@jpq*`C3sC`>pryb6jE11HUq}y-)ri zIP!cm$6xHzP_2GAkc0pG9|VyhR@1j`iu-5&qul=ZxSYD%&#g+U>=QtQV0>r-7z7`4z}RdY zB^CAU&VIGA3<#URq9))*ds0z6VHIp_xx#5FQ_Yb<1EMQ5uwYREp@3E|?!Vd{&c631 zGu3VR%>AG3xI2c$fS8x@Rz&~W?4ty8lZ(aqiJ=x$Jw?7)b$o&>Lr#JhGYr>YjSU1+ zz4M1wUoLOVS6@Btj-e8`UQH*$>yF``yy2Qd=B)&S2!Bj!tSuNWs+U1+;zu6G(`?CPM&LXB|`cc>BEWp7> z8AI-$-2IeA4R{%S8By!@>#5DrOoQILlt#ww3q&uZH4%+rJYk?;UM=oz{Z9Hj_UEA= zf18@ZXbS+}nZ!g}1a(z_$^&&`rw3w-vF}=X;r4oPK4xV*i=&&u73d|{r|H;ieJ@^m zyA#+=j#Nvc!D%t18lKe&m3iyx8ZdJ0T4!?O5XA~@Cl8vJX{)DT0wkRJSU=IroL&vg z_rN{W(n16hI;cLk8-SHWK?dn`CW*H;K+}mZ; zqi#?WM=*XcZeOC}xe2h4^LPU+5%fNuV>>k(Zjy^o{2=%0V_U-K2sjAi4n%d2ljG?2cr^fb+NP(upPBuv5|rn~m&U&>-g_%i#E}{#t|OT6>Bu&6FLhk51-2 zX=H-c$7IMBzupq$!vVU);Yg%;`oiPkan4HxR7zDeSl9n}JC0S|1Lq#UH;B?F(M0kN z@V!;}1F}6Bm>5YyUH9rj0|!WMwdf!N&7a!<8!QG^kYZ`DYj}!bjreCP# z&HGco%2e=cxO`J?pm`7{JfG3&se&HXQDIEl&_N%igZ!V^_y1Im^8;K#jzmqAJFXfP z8&T3W=EY7NlgbPlw0LW4o~vH_x*X|C*P3z@O8T4Syxk&{|LTB+hd4Qj6^NP3m)Qmh zSGXKuhq1+*%6jTaZrItn@`&CuMSMmOJt*)@8ENJIxsp|mG`BkKcj%{XFDS+j+L7KT zlM}E0f@yN;Xpk-`b`Um{!q<{RDdS^qtOWH*uUWH#^l%5vgm`hovPD0Mxr^A%8#G)ngpc|q z2niPu-fpX0Om=T{!30^rxtCuh(3UTLQo(6#WkIh&Q#V*B5J=Jc-<6f~#oHm0_AuOx zuS~?I&9L5I-*(c~SZtap%*PWVqy)fWxcLt7{Mddtu>1eyvFO#kXu+MOFn57|?WC{- zKe_4o^(+J$0cWCTWDuft(GNgd2fqe2XlrG3Vg$8W*Z{}@LY$DUGICWk1R zfPI=$Sa)nzoQk4&J^>UfRp@_!A2TpHq?E6b^4$Ka>!UQ@|KCouLp+pe2F-dt?%9hW zxIgQNM^WO(ez!mhRWx=?cpeHw6*E~91jpe8l|jBsufW`krW0ugu;=^eh+VvEO5eRiv&15ogA|&6NhWx6IBo{6G>44S)6gp3MWHSt!l!Qb(0V=`E%s2Ua6vwi35>} zPxI9{u^mbbq#|<#dp}8zr3nkiMj59&0DGAL8cGV3{C@MEs~81m^HnAd9A5SN+m>kI zZ+a~WSqWWhJ08>C{DeNs^^a;5)@$$QX3_=4h*`8u+0pw5f12d(wxgcK|E*_!+hk06 zYQZg#ar54U%zW#=P%QBJ+~bKL*{-1FMzntvl0!qQRJTi;4%94U7=nft*mKABe0*0% zzP5I9v@)7^>{yh)>5`x*L5HS(YAYxqZlpT>8*Y7LzS7j!_bUIik5dZgzvm72o!z#Y zXdacRp**t{k#v2ZIOj=3FlJgt${fG_el4$GyHtG&OZxXZO-hhuArconR>e=MA+ney z;Z&EykYFr>@gF>*ZxU?t=nT4xTZe$u;YAcT$MJCjnr#}xnqO8-UITFy9c=uuI1wtE zSBIM4IkF#Dw*~^>kLLf;^vzL~|6SWB+qSKfn`}>-YO0xBCu6d0+ty6BZEKpW$+rET z`Q6X^Z);WG_1V7m-q-$5CO`PdBd5OnV4i2d1N4R8@Kl>wWj~M#?cYO6!zkAx zOa6xU)4Or-vq?sP_$5jPTwq0Z6a}x!11D4p;VW2mcrXwUcVj)brDVB~|1|pCOutJ+ z)XYJQQvxKb;poXJDFKj#u=ud~)V5!yfN*gCUKW|=&x@V&Wp5yOCI4f3!_#NE3|EKnm*Yq zr6j+J={kJaAtt;0EDfMW_f>xEh(be&fLN);9}PW;M@? zB9tzdtLsJRds{#>i)^}95TzYnZ_|(a@B8_-Psg5>iyvI+F^xs1@1)s6ad>2X8w5+J zYORS04rQ`9%JTAKorwOuO48pu8Vm)9$b3vXo^{&SO94-PIgj_Qbs{gVZnvsSxL8t3 zzzE39@TDJzzxN!fwB8?e_8+S6J=WF0c$*LXO?~b-csVjNliB1C7Z(l9UPByXPEt~m zXFNS!b}uw;fP=OwYcG4FACI*#pMtUo%T!LVaW#vQs7bRSIyp>)dy+yQyCHn__k~yy zRx)2mqRhC2MDoLiDg*g33yL$2_=E(9*nR*U#ab}lBhrH20s`vP-&1W9N8WG207~h@ z{_K}7UN}&4ndcTI4=)7`0EIqezrjjUeyo(D@jsD7qNiBw4CFl#2j<^H2E?^?Go=vQA}K&9|v@h;l@Klz@<0PMzGhyrIbH^DZUjW*hqeO&GY+lqNyNpv)O zw{aegYHDid+S}$tlYh=wbZjP)UTk)QSplGvbmL;uegnjRQmnu;H!%g&3%4Z=(m8y7C3Y<@16G{0q zln9n4TYtvv8O!lqFfT8%p?XtIbEGw@qyf6b~*6qs%dJjZAKc_-ZRa1s&zZF;>S^xa|g(Y zEd8@?dT7YGyy}xs%UW{LT_jK?Xb%ZJA$1U;mg5eXM^Hf!=wG(@_M`~1HglEv(`1;Q zw}k9ePhI(^EivJmJn?_VhMUjTxN2Lt^^%j6(A2a$RTb5jf^nxQ0?CP;*N>h(^?Lbi z#Gaa7QQvN5YttL2YT9Q?lam?G-=wBSs;E}2`Og_3K)`!(5!Qp&@1W*t&3{TalJL0{ zxjkyV_52#e<$Mt)oYXECdXQk!A341cAS$NM%>EJJe;^AzT~`l7a+6jJ_I?LNJpU;O zHfUo1*W$XZvXv=6L2Er#IgZx;Baf=N*dU z(07vp0q@N5#pRoRtt8Bop=dBYl>7|;>DM;Bc*9hm@BH`s3927YJPoPQo#P?q@{ z{o3MyS_r|L|E76Ml>#7HerY**`LvBGGB%qzP&`;ywwrXAbEnfdU9v&X**rfwB=cvnQqt)KNKLjgFynK7?Nn6aW zpEuv*`E`9!kKpYoZ~;p>33Y0}xvcrYq?7KboKj zz(Bh|E2)(^=r7UOr6j#ypNbQIuUT$uBElzvmp+&u_JBG549h94iQ8c^Wqr@$kNwOu zJzvAL!O*HC?((DW)%s^}fBB^)-!x#z8>ToGiv;bo3zwPkf*P>-WNd_*ot`^1|L`9} zitB5w(Q|(kt!exxF6I95DTJ#B=3WAW>9|xB<8Mq7!3JRdh!@_x1L!nuD`*NP7{4O1 zCMrd!Bqv#AMc}yfVT5)IYn3mzWt4Q}qJI1R*f`WM zYuDp;aVTk(;z7Fa>#%00FtQh=18E)-0hTTY1o#VsI?OY?#Eu5LS#w16JrCo* zcZHpxoOYGj45N7`l446NvvY|e6Md)PCm-{}sV^1_&)z!;3i?rCxgCwpo+lRHYRjO+ zPE7ITE)tY}%i`h`S!uzZv6&GOXM5DbiU9=7q@8}$I=IjQPlIkD3KVl&V%hmCysaKP>rBi6e6PYuY&2o{yc z3O6f>zDx(>2EarBL=ksGOr_wDUfBp!G>n26GMQ&LLB6kidpR`Vyx?b~@lYlkl}A@E z@73@58e(GTI0&9%RSap+zC(FnFT9y}8f{k$(6DQnECF48&2&}*dUdE+p;(5DrNhw~ zn43=a{t0Xw;Iz5D-9%Q02buQ|&h9!~WZJ5VlOaf?5ZEQ@P5$zMOvkINdpHv42+@Xclv*F;aFoYNx9^pgFIsry zUC?Qa61~qq6*jSu5FtYg4^e%8S$cW9 z@c4LHT+E!joRztMf4{I~>pE0tyehrqusIw-E!gDn4?~ErXLk8uZk&x4zXW|+df@-@ zT5|$>#`EBz&1;_~P8o`$wV6U1DJcn!8nC=&_|hm6v{+^O@|Ja>QvrdfNJnq?drx8S z!fSPd9;jIHJrNw#{*@hBJW36LUNkfVGTrTS7bnR_xuOB_bY<|Z5Myp#=8aA}D$Ka* z%<-?=X8<~szr9}U?|-2ljx~-ONTwUPkT4aCivD_S2)g#VA2aM2pauL;KVPHmIy}bs zQ7bF*DCQ0nH2xO-Ad=Q~B|{p6WY@8kB~pz916rt0x8%K}TUo z_{Z=Rf_g6}fCA>{nC{TUxd0_Sny0I#?jDOHN240*-QXp3%JOAoC?WiyyAW!C+4bqh@hn3J3nTu$7cD;xd}p2C>4-3RSyzmIXC;B$W)U`(pNXfAtGHopZ7D< zK0DT@t1=q94!@qeUcEXlm5ODIhSJOnGPuV66EWoi96x}(lhi-%HHG2cZRS{6W@9u; zV`==@+xsOjWJj0NSR+6h(w!lanz<6@#GXH2y8rm@2M_h?g0H*d2`(e70Vr!y0guEL z75ilZu*C87`bnD}o6M8h^(^sq zYs;GJ7Ltv;#sZPfI4Q!VF=KOm`t*FP67ispd5@7iIDz^jllbEKto;YO@bkc0vn1Wt zi(c~y_v(VRp%qA63_Kb&7&uZ-V;>1|i4B(}h9pKH^M|pc8!IJZtS+0pffwB2$8y{M zwzRp}G)a9pB14NK^nc1to09nYC<95uPUNK6qS66afR$jz3lDwYTYVn#zq;@2OXUbe zVD2Fhhp1`f;bL0c10k)Wdf{b-i#v6@b?|T37>W`)IM&-A)d_prf*CCPfPpitIG4LS zZubOP%b~`Bk_C_#gyGsDV$l6Fs~W1T>oI3-C7{VTL-S|SKHxjhYx0X(j6{zZx;O*` zXW~o~Rg+bV6M;ZG(1xW5b`-b3#tq&8Ruex_}EbDl4N_zp}&R1_I01r{zt_o9`qOV|4kA{Rp8~4_>eh-Lw zQIvG{Oc8GWh2-{q`TW=1v57<<1Hli1nE`Ptq3o8)kaO3w9_~EIN?@)bU%-i)u(Il; zZC7J?pDHAAU^ui`4PMzOv12NBzk|wp?*_!RR2=#%`8=$0Yc9A}8!HWORThlpG75F9ixXw8{qrf|w@S>2NkEW!GPC`+m=$KMvbry<)FnJk76 zopVw~o)n2&5+7!` z?tx^hW4%fxTsH7eAh;+n60B=v>&;)VW}3wbp!3$1go1caJnh;FY04q4{w_9FH?5hAKgB%p^0>Y6o*WsF(u%y6$UTIaCW*o z{MLnb!!1}uz)z`tGLpSHnY2-wjwX=y#w!U$*L}wdZZro9%97+lU*&{YBl+ zHVS6BaI1_kuwX#c{>{|+M9S&RrZfgoZXuXa;S%iqc++kA;$4BIIz;} zvBrbT&o2Wy_o!w!`@xaP9#k*GyluW7#=9>mM%o)Hn{P_{Yfo#v{u3sPNIO^n1{LNN zJXXzWeYW?l#`8>HLbs|0mNth$@V1UTnvjXDMo|Y8St%cCAVChV70(dg}Do-M)?vb>Ei)l1|-{3-LwQN|+NumD$)6E*LVXC!DshosM8(K0|gYVBtM0 z=tz>+c~9y4aa(3MDYXt`gdW}G3^RU$_GSF}>3H78UhG4nfsP)$PD|N5;;PN+9W|7n zN(9KUig)ISTs^LwBdOWJ!zwkWujc}7&1E=e5*e5r@yn(#E)pAurLqJZdsF{8W=2Y@ zVA}jhsi(&sn11^2-kw*(i=mM)vV;Nx_h`OZPbaw}fly2Lj3Nv=UlEfO_Kjnc8~WzU z6L~)xv|6&p)0IV%p9VMil?8*XNvUmb-0*GWp(di9)@=Ut>un-HN-#taDnLW<3vp#= zO|+`N%R@Pw5?{a7EF!d#c(SL8tGGkWpUDbVvONuP9CRs&C@~5Q5FN*PRz|fFXv>vE>k-U6l1}vS=0q;^IfCp%#%XMCo5jw7 zTMcI&UM!Wu_e2*GIlSxB<2~^#u?U;wa48$vC)d>QJs)ODcj$H`I<_t;TKhT>n1y|6 zQd1jjL_n<_m>uQ57jZLDKeQoCECUsho;tTdZ!L*9wbaoX?vRd>7%W-|61l0kxul}U z){5J|bME3%phJO}A>2__sh)E)DOWLk(yYY@ZK!-8wrPIB*o z4gI@rU;&p=gKx@`Qc320cEx|)Q1cuu!Z_(`{MdLu1$ulK;ydZy09CZFNeCjtZScw1 ztn44OR#h`siewH?Axkb`c8~MujR`t@@!_FvXXN7FraYWj8N)(~VJrm;BfnrjE+~6f z`~{*krNo0RTy5H52)}lfbr-(FNOBE2Nmted?IDp5l<4q;`2QTJcHavTh3i zF<~#1Gu>!}f{5tu{T{Hk9%$jO4TT8w({RUx1Wba9?y7Nli#c^TIH#jJW^90Y2y8B~ zz$R!CbWHILFxvgzNPAnYs8SKtkEaN|_~JAUF`+Rad23p&6ctNE5o= zHxhrDfek!!Fse}^F{%Ri&%5_ z_e&Vp`q|u+EzW;s&BSVd4ltNK0aJrzO&4?hY6w5m-9^+|7~bV>z3CCuXLx`DBc`7| zOa7)nMW)!4Dd)a$4g`)II2yU)H4-vgeXhHVE(pa%vgE=&OZnNjv{Z9{e<}{4FgI04 zIr^CyLjUQF)YKwgGcD@%IUgUDgAtp5Y#7&ovIfKaHpIM zCg!70ZtsjCkZ>v!MdBC-Sb#cf8OQ;8X8#h;kX}Vo|vqYXm4K5n?Ainh=!G<;8NOR-D%dQ=g_TwA<|YGK z*vBwu$g0+bT5 z11y+;f-J)I;Lw;%Ax6P?tReXuHl&>@Ff49-YqZrYU^#=g0l7@v)Kt?5v%3Alg7U&7 zHlP%e6(u*$7-AJW%%~@DZ$(=x@<4+;jV92Ux6DI_HT*C*I~QN!&X0h0f{$$BiZ=oI zx7yZ2TiDp6_EJEXGzwWiKTXOMiHN9%xx{(YO@Gk)=bGkY2-(F-VcfoDaTe>gI+>^y zGOU*tTFDmxDBs}XbY+lI)*hP-YVA?Xq?n!bNV-2;vB403mAh=-AdRo>b}~W5)^sH5 zGg?=(d2@%->Z5PR!2h2GxE10YYlIlg)u)tzpTH}dm;8ycDa5|F53*3$GHEhzymK?B zCtF5tDyL61NGtaj7QUux<>SrKD!|(D)vsCN9jN`g$9GPof(-NPj*Nh@Y%Xy`>hsL) zBZ*WcWCU%pWmwsSA*45x8GTym(4+w$o9bOwro`C zFH|PGj=wZj7<=NzMz0!2; zA2%!h=fo?7_4CD>iN1?`pV$ZdQcq}a2eHD5jTcZuhON2|!xG0K&YrlRr4Y4oWH#Qr zNEO$e>LIN8k0L@95zMuIvpe+JM1Ts^D3IRXxKOj|znMA8(;oJU@VYvD=Iul;Y7jYW zpDba|(Lpch@Xxl{y-_{uHGM@RLr~)Hl8Rx0od`!S#KL<)l5xW0t6Md7A01gtkX@6k z9K6en-EGKj$@WB1;>a(^g(tizwd85#1qP^8t@oJ|ls4kD)M?AqLre!+h;KM_QBeKy z>Aq+d81e$4e`yT@|0jp=VJ01T>`@M&ebFxf9e>oqdnL3N;jLq8SS0*X1#dAta^VR7 z&*bl2D6u-n=Tu+p|7Ej8we_^{zveS|36VCjLh`M+PfsHn%K~``CGkbk^X7DK`5~Cf zwVdwnD;+*9?`PbcxO75n8*5~QQhj*nqItOdRRG}+AkI*r-|52_RjW6b6NWl)NEZ+N z?s*ogkYXZxqP={xUA<^H4K_pgVr`qJBgQjMjoCf)8_br(nG~gBRbStjN)9C{hjq3i z(D_wXd;($(INl+rnoH#C&W1UjJ<>_Y)TE*;UAB?8B|EerX7DC9Q}d?cy3)IKueoQY zHO8P%{cRw^^r&Lr~hNbLmDJng<1+vB1*mPaTvYc{*yl zE&3fnLRtJ9n2gWOt7u%>MBkP>bpY_#V>leNA(Cbv13m?@XKNk56 zkK@!JAf;0}iyj?9jQk^SM9`y;cbQ{NYR0zoT{I-$P}{)@DH)NN2>S#l-i@MQ!c*AA zIia%p6QqCPXM%0rbw@TS{;l@RkNqx#$*Owm&fX%g?oAXT6e|wSowPlw8;4$?L=M{U z#@)%jL0BcD?Ntm0VB$cm9>b-b1HQsqTC@C@<`y5ayiS1R9cfysk~WAw7$}LKpb6X1UChb^*D9`v1Oq9-O`%D)2qDKmuBF<*dIOenVJ^s z&&j*_fZv4a;6_ekYik9*gNaTqHj7EIIoGyFKT(WC!m{Q3+B&y25if848m-r&6>q2J z+~s#DKUgai1`6ng2wV&R8?Irwjcfa^=ZHyS_zGS}I)1(Ol4a>^oVY1AqCWUsrbX}4dktXUsz$!Tqx zdDe{scvhA1&RFiOxu?n8U8f2IAc5IsAPKZk4&+KjX=^)UeO#39DB1n%zY5qwlHvAQtZ<73m)0O@e19V+c`}W?cFd z%JAND{N!Dy6jTye<)Jl8Lk?VndX>C0!m&(d6g?JvxNb~QonB}5OhbO~?q4fu1Ew0{ zaEUnSAf%b2wH7g*$M8F1+bDge!?4x^sRehoTQuy$iwinFFTS1TjuO5@`(!kKE0Rgp zx67~Sq80OQ*i9K}pTmQgQ_MZ#ia8WoNe2ffc3aEl5URY7bze-p-fo`k@hywFtrmxk zZ0R*d4&?DzO>*6byiQfsn+-Fxgftmk31P{5Kjn${Q5YsH0V)KrD&34OuSwdb|791> zKy+yHMziRUgH|2`Yg;3;uPgVX<6r&=Lt;b!IrFGYIf0|h9X~zI$RrXaULKd((NucH z-YNHqLqOLt=0G7tL4J-w94t#g4D5ka3F|W4`%)e0fi;KFRPOh;C0p8I#p*avbcPr? zq->sRAB#aYX}m#KLU>x-JT6c69+)?Z=Ek8>S@Q675P1?>#*2Q_dM|kIjVJ+TF?FGF zJW9Aa#B#FlX(bLz2|i5=vvpxtvn3nl#QVtA`oc#X(;*!gLS=;!x9!Zi%JD1@2uR*M zc?=D`w~lZ)Di?^=0;r6gJ-oVnW5zX+wYHsgL1`5<-`o8IXeimpdpX&RdcP6bZHyh| z;>2Sk#AE$E1RKg|&a?iok=^Z}0X}H4;n{p!pSu+*Qm}#=i3PR&#g=p2N^wHF50?U| z3Es5lH+u73{X_#|@KCL`v9)&hB(K0fvqT%}lPat|YP;2Rnv?pn|I85`n+J<86@IKu*SfnOC$t34 zj4k5Jd{;$>?d)1T)@G37V2LWUCEFX72oke%JK-50O5v!|!D;(Tj1?Yw%H zx0>wF#+=B*t6C}92Aghcu<^6EU8u$_x=Cw(0Ba`?sx= zcQfntzS(^>9?q<`7GZU3KrdZb$~9>OQt>bIEG>O`Bb6j+oWjBORj?h29w>|U+c#f@ z4VTTY|KcJJvM48rvw?8KZNe{moWN`X6+Gl*7w;$G=8bG}q%#}KFYGI#9>%b*3A*0pu{H5ZE4lXN93 zDW^TKG@6w4*Ltg&-xA0b;76Rvn7OnPWTWb^0sw@I!YvBhyscJCcYk;fay8|6vwnOP z8PRK_j(|Z8m^jEK>VC?8$=p=>xNKU_Hq*{Kof+h0{w&IoV5}8fQBpWhVpRO+t8u~! zTxHJYk=a|%cTYvCgt&1Q(A?5kk^cGe$6YMJ zS9<15nDuvU-?3;QykZ4OUXinAX@v!dzDj1Qqin+Q1m?~B?&CS=#~ooOXY;3j+KZwY zAuTa)?g37bjCzInj8n&C+u}DL<>>(Ovu+icl?MDY{lMn(rK(=8#4tTQ!Y{XVvjcS_ z<8@a998I+Rm^v^v|hElPYX@loex10DuI2&B>2ug-YCg$Fb$n zRSOnGfp7}ixE!Td5Y$e*dXzQks)luvLAn(iQ3NVe+9X|eRkKzS*}LZ1Pv5``Z?t(t z=EyYgJ|C#^^w;`H=WYAnX|m(R^6g~>zIrhwQffCE*EoLab3xuT`+ab)L$k9B*(*FQ zFXqkLT?AU9jkGbtyy>s|2q-;^)cb}cH zeh&3LFf#wMJ9rY2C9`Y!==>G&z&oJK~&Nwbt2)9Ddg; z{;Hz`@kTO+ye4EJZoHxW?(4$WP6p&jY{o}_6~io)crK$D{p6Iv6dauBPF*>)fBx4- z1;1bw>_%N{{m={48mEYtmYMOHd$J~i7HP+!d(c`|(N@4<0y3TP`KeklBn6-<5t_HcTGrA4T%Y7jm^kNAnsmu#bnaL&)E!7oh!Ff9>Ow_n%5rL4xQm` z0!%}g7U75XwX!*;>4|b>5cEvD}Io+5${%Pf=G#KW?L%M6te zc6I z1ShO0mk0|+JWO0kuSL|;6ZjdlziP6o@E>3ffEIS<*DF8rtOBxtGwyXE0&eurbybU% zWyAzu1koz*3+ApGc#vSMT$NMCRVzEG!gb`s2LnQkj~`kWuRJ=R+&a>x1AFKwOeu1g zml?7I%+AgV)yXYpqQyi<_0k~_18O!OGFYO1y8POcvwNm$lVRW{b*#5Q4&ieQNjSP| zD`btSM387+bzZgctOb&r8zZd>fN?)+Q8@rApeHW99uCjv%8}&pi3!cvHI?NH9SIb< z94=Ca?v{9tsL_`37Nxp@&NBx+N!~f8)dmEJ9_Ri=tlnY*6oMKvnq7D=hTdz08d{jA z+AKq*UT%%APisVFVIh9$T|IXtkR8xo6K>KPB@YwRFJtMU_FV^~H{KxZO@zQ)G-t7ELN&e9Ul#U*Crruv2QzqWAz;9AgW zr8loSiKAY7WnIcyK%N5*v$ehn5sE@$0{4$OGk>-yQ~7rn7uQKI;brsRY2v{JbEq5c z)4nGpZ_7U|`ESF$$1^yCZ-PmqZk>!kj^|Wpc=~P>FWCpCjf_WWt^4$+FJeEj8dge9 z(&I)u+Xqp(8RzLz++&y|1 z480-Po&tN7D1KXf*69H?*d9ioaxlcwYB+$L==;Cz8wESmZ`TYpOIk;Gtz1OOa79Yy1q@(K0@_FZQ-VRUELguH&D0D)98pLUHCo-<_1La*J;QKdUn5 ztN$*UliN>Ut4je9k~Cq_I(TWj&{(IOL*}=nooi zACL>hdq2t>G|lJf7tK**V6Uch!_xrq8Eg+n0R&Z%dTeP*1aT=;<=lne^_t#Vub?K# z7b0Ygt9aM8R4`1-aUAWwf;bF71;5@PIhP)e-dsaJE;mKI?@%ycgU1iRL#M6aBYM)b zp-1ArkF_7y7em$EvtBRRdY!e#t3+(CJq_7AXZV=@;(!t7eocit{uo4LioCce&0|n# zxe(eJPX(!G}Z5)GrioTQfg#H)HBF77B-rN4DyF|Pgy+Ufa0E{WMddSN=L+F|{@uSnZG znmq4_?{Rl$L!p~M|D~uwchzm*;;9d5X*HB)TsVrq!@%Epxf6?f(NT$d5`1>Hov3Wu z^&-fsFJ6mY-R_0^wx@Qq|8o zU7b1N7#Hta2hkM&mo3q>U?g3xcrhmL+m__l^%$aDaKmjbc;QkoXIdQ{Kz$me%8cLC z`6_!=7k1^)06U_qQi#EmA@=K+=BRGl;pv~4G$8#GV=?`HB~vQz$MfJB*<0F_z8}}N z$(^F+#0TTUl)zxDF#IY@*Rzs}-QS7y#+4DRRT|NJL^z3Vz0|^doadtcJFM2_Vf|+c zSSqeee3bmDp1j7naL{gE@QL1wq_-0bXS#O8XNn?Vg6-B1%jJv$e$czl7a*fbbpIBS zFTVF>m+{Ccr}E$SX(QLz;z{f$4)e+Z)iDyYJ>%bFM98?6DeO6)Z0YB(zSVfF{5ihI zk1_zF9y=Rzm5?-kH}Ov9-lPY_fpR7~tjO+sK2~lEt+Yj)P#jSW??PLrtL6rgfS>u6 z`9?mpRABv~x<9r;*F`$R`(a6VZX2zZXAN#nwGT#r?z(mdhO!o@Yh@m8RwZR8VQJ}p z$0<|d6%^zGVJTP{$)flQ-VsGl*vsZqB887$q<~L^4Wj{HbXs+^|Mmc*)=7TsA(m`Ve*)u#or!2-Y02K<@rDsh26OD9LO=<@#1 zbe%Xm46eIwM$-=hoi*!C2VZ1L*|b}i)DaUAGFY5EFNI`V1<8zPD@X6_&k_gA?G9sw znI@8oshfzvKn+f+AH1z}&AOJ>%NR=cUK(__BD#Nn6rIuCf!JF`dtyiR)t7&oI3Y!7)QS>*bo^NS@Vs8JS}?I(zW);kf#Lfces^4+9+l{RilNQgAIA$z zBfY}HZ_t||z4Jt5*YN(fX-4MT;C-L>y2v(mAsm}+!!xm0emOEP*P6&27{6m?&ZGY) zbIw)-@0Utkf`Uv+7*uOPt)yg|9;X=4BIF=cx;$D5&nIpvG9kLUID~G9+D{v9Y{JA! z*_+964+ATsCqo-45X{N|B~J(HHAaK&itt$L0nDGJ(R+FX^Z7hs5g}{<1(hnj%^wjC503 z&W5;sYrWIkx*Hf9YgS%)zizGD<3)kDs`}<^wmoLlaQuK*#f2NQw#BA>GpSamFWG&_ zHGs&`Kb|{h``xcEhi9%lu9lhIk3>&9cy4xhRt%HjYjV0et^}~?ie`l_t}U0u;~Y|` z8~}z8a`^moY=y}IKWrUDsSFqd+Ddj>zC_iM%|>ss6K&mbj34XMQj#eeK8Hr`uHSy4 z&oC|G0WfQ9un~cUhvrHkgj%a4fEMWJ_tWoIs9)%YeuI#e_qX$3i9YVj_XWN>x2I=L zpp^UB?ZuBv?*CaO9L;dp#f3uFOj8U1B}x}6j;KMX`pdJSXQT2Ga%CG?ab}o%qs&4< z$};3AYW$R#E2TgwROfPWQDKxmPKjml7WfBGGEiFDrcWB04KrgqSMRWth;@=i$$(gq zU@-<(I>ga|nX{f3&)^1Y*ZZ<{eaF@M1$Osa2XpEU7gj;Cp{uqzL3ym%X^s(m54^IFQC@HA9GF--<0G!E#NZw7$*J0t}E>-lx>IdQ@gK@$sJhhCWp%T?{id3jd%g>O_H$FeXO-c1$03wW_6OH3mK!tv8 zOi7|hmtn_UiZ&xv<|m_{rbA94&6|I^pASY)s!@x%ay`2q=ekG1{p^0eQEA`X14;G) z4JIz4H;lKd*!t#oF3Np7Ux61eZlumQTW9n%C0Eyl0PR`d@SxviC-@vk@(c~j*`V3K z)&6l^{ju_zT6=PijregVu-ST9pIe~bS69!)*|1O&Yzecc=JZ_w!_3q%Ss~RA$pBXU z50*p#&4?ichiF1@7>?GO6kIJ73!?x}?&Qbg{+;jRaPN3^663eV?zi-}?O1#J7@N?Y zGDhYenX2JhcFsK|2@_k}v-d-pc4eVGx13#c@jw8@U%2RpjqYdPk2$golC#iQTTS14 zS6|=D*JcWsB=KLO2K_zvs0kil#t%YcHhLb1i@&AC+|KKL<49OLDVN4@h_8-BclV-j zQt#B3x4u}46^Zx0bMAQYU$nlIA;Ztcy|?s>7nX3v4>AiZ@pT&f zk$n(tBphzvMNkeQtR!GIWFqbB;doE>aRI)I?R{E%*8TFbJ*V8?#1|ez&Ww~Txh)P~ zs0BoF|C_%jo!+>3Xzm@VNrqqX3_L`5^l!yldaIv9Zp1ds40!c|w>XH6J%b z*HW+-L@*ne`=R3+ShU8F@`HaCPnB^W5eDRkLxpgQDekT}J=%4Zx%tM_5I~BDI4yX! zTTJ#2FYZSmPgNy~E+i;(#&4Cb=48@+JLtY6H=~Swk0o?N7@o|vphOKV8;CzpQpwBc zQ7+y@z`F0i)nkoZ93D1DpCbS-VKuRD+ezT$;m*b-9+2WkNly@b-LPuTQg zH)V=902CrpEG9nBu`4pCDm2x4;n8$Q#aiHm5#sdI0Kjs=4o<96zy_I{_hxvxUcJNR zzD@gDyq!PnO-=@Oze(NGv0X27S_?$L`$b6$>mf1>pt6cHdYnTt$xvfZ*GApK&}86{ zBQ}yQgT^^B)abu(k$hqgN(tB=y5|VzSI80PXLLnJ%DP)8ZQSshtsO)%|6I=y8)AT4 z%mHRLE2T)-9+#9vheeQ+6qh$#o~3td$8uF$Fa)R&7RI}}{ep#Jf;Vl+iuF$$ebA^b zCq(&_tx}BWe)13q_^lH=?9(3o@xuN8X90p|dluyP9SWKPjXq_>7XRA|I>E}^;?x#= zH(6+yIz0!04;ws=4sXychTQdQ(=vVj0wK?dgxTtK^y1t2Hn5XymdhgaT0@_#6;|l* zHz@X1txa+eVbI9mb<-JqGQy+#l+z(D*GlE@BUs3p7`d$oVxUL7BoloWEK^# zA8mfHiX_BeCe|WQ2bo6L$I)HWo9_sGMtn%ZoeE-9z zG;31#aa0-6_ls4>@<}jFiF_mqbDkd2xNQrzXiY9*m^=bSZyJso(n=Jg zftuDxTohi*Y9Rm`^NY%wuT`?WD-_*vMj_f3if{Nw5dwC|`OjQ#J&*8%oAnDX-kU#( zBc?&**)1IO>S>C1Zpg(^UK_v8jEs>uNGi|CuLcwtgz%pyX(vIrGJ~T|*uzkMNr+&i zY&j_~e+g~5!PZ8GT`VsIs(ZcQXvr@nxMOWuthUE$eBEU$QCNcECx+Mv=<<+C$<*qj z)y!4oX$d?+d88gJ@1JC$#%g9`yWiw``X;opJSa^-;K@>r*FsSSp*8IqHl7z~DI(Gb;$?dyy?aj+h-+j-A zwL8L9tBy1SMI}gT>ii0X3}Vj`iTM|a$p+~{KWIppXGf=^S;f%fqvNulIkFVE${Q^N z9}nDU;_C;~0^N_0I^V>wF;vL0q4LC4i3mPN$6O0HUmU8MTY{dmGcE>_TsGJm-yGx) zweLUaAWn#hLckXn8O>DCiu|fM&5d4ST~OW5H+`X+xpm;<@V$Aso`~YiY;Mak*XK>B zfUoC2fu`AhUNU!g!M(|vS!W>?g!hO2%Qq+dtd}n;#*l0rDbF>OicJa+87(Jh4TUUf zsvRpyks}%rP|-A*TX3BTNiH>ug}{QlqdSFwjEFAMYWA$_k zd%1mS>G91E&bL)NIsay#CyiD8_wCb909+)90i)T}y-Xl+npFj2GMW@KK!xV7~@kxuum(*T1aJw&kzQ(u~% zIcR**c2`<&MTEdFhm;%|2$#H^+Q&%8xh$V@mr{m-l$UUu(ff>60RMF|8Yh(%XtEcP zU^n_1j%B^$j=5!gRYk#@3>qNsu8~;hZfe=~df{v3Lgaf+%*9J3C*D?4oCqGvo4DKj zV?MAx%a9`!2?y7EQi?*s<&LHTfTU?9MzpF;`>gS)0LpyG%(_8bKE1Ba+W{e~!3b)7 z$)ThqQ3X+SoQ8#TE&(C30I{G4=5=NXP!QHb-_kU8PGmNZn~oVfDid1!M-q_sQxGj7 zXicLYL){bx0B_+~b0@5vw62f=<&wSSz#~I;ZXu6&fd^H(9AFDfz$)?WjI&>qpyug93;nh z?#xhC4OO4n+kFyBp3?gFos;UTC3xSIa8;0XR3~RY-;KOE&|gp|(e3(Ec)RjS#(LmD+xD`4BDGOOL943i#+XBk~47~!D?%kqQNvG$|4@ISB_GWYPi} zh=T|evC8spDT1Tdynzji#-gZ^gq2-7Oilc=xkVT%a*t~MEp4Q6`q(L$2j%daGW)}$!)0yTS-5H;#xe~D$6P@nk ze_S6W1he_wyqggS@W8|j9FvB)i4g>xZV6_j^JV9Eb_T zP*WBjM@(Fxffyd*z=-A{RfR0}y~qV#&6sE)w;_md`!ETERJ5$+tf9+Ls&8_0duKI; zZd^9N1E@I&Hg0SEP8P0?D^DiHW+K(A=d~u?zF8vBUwQFyglN@QkTwVQAx#C3yib^n|QL=1c`0IwY9C)1i?d*L^3QvB^L zbmMj+AxCtc9n3%);ng{MQumIxF5u<#eI4 zP!%qp1OBig)=T%-JDPi9xfhv&>yx4%PFrpDO_Q6OBjhv)UANeW7Z zw%;6f4J_19kMP{3+HG99E3e9t)UTFoSeh=A>xrVv5}1sWQEZTPDv2<}#Yc##$#J)w zE16^y55E{V+aBg%B@`bVxOqD#Ob|=;J1Y~T^9NO^@leFnP7}&3{pks}@n0~Nhchz9 zT;~;Q&Jji+Rxd+f;5gKghK6UYI&Qwl1lxW_%tX8z&qSF}qhH25B(W?WUIQhtt_`z*F#Ba(j~p#PQ){sHARaq z-?X{=eP<7Y{3j{KnMU&k8Xc{|@hQ`w?5x-+0^LF?`uXfYOOZzX8GP?r!xe|4h)`dM z+);j0w}L^$yM>SY)@0Tqy3{O3u7gxlj2Q)n+~H_EQ}n78qdq4Xg$Y5dQj`c%K|JPi zZ-Q)NMt8VowQ);vGG?nGFmU$atv#x7= zant5{ldQrAn&#LB>>b4{A7#bdaM4lD@WongIM}tnPGvS%jC@v$WE+&@iPY4Dp^!tx z%;;o^^tw;$&D0?Mg|C^4LOC?C&2K-KxANdB2q0DvHv{B^k3XoN9#tOwM#KB=0pa}8 zHTLy$u^R8uv|Gc%qL(NLaLS)TUhBDqj!I(!YFS!VR{ZnkoVAwgdNlXxoo5u>p_GaU z6`8s6V6W3g^xY^DG!^wAl}x16`5ncDZs@eQ-^|77dbD|+nto|D8trpOO{*~x9hhR4 zG;~yBU_S?2{t5zrgCNUy?YFA)x?&oWktG=%)GS_xDU1+@G>n*t91Lm0-r=D}){2bS zEZ<7`XUJSyq;UeZ@ie{Ep%8jjS*<|%bYZ*x_5TW*g-*jQim-aK9TdNOa6goueQ$cx z%5KF>B+krQ*Mb)rHINtv>lpkN#uSJR6@$pTdXvWGOQI8?2)Ln1&? zWBZ;Effuh(PCH-jaTNaidm*70gf{IRTO1K_0TbP@mim}is}@;#^|wK8cSE_NChO3V zJ=_VJcvQanA0gK%=(c>)>H8n$(w+~Z|Nd1XEz_{X=0x5U5vr#8oFl96)HzLk*ol7g z{z_fOO60;vi$dpjM}Nb(o2jTSW0T$6fKs-19;J0Qea9EOS(RvpEVNb^-1UmdG?EiL zQ5zp~<>fO6IXNq}SUpHi%^>B;ap zwXc^ir+VRLFlwclX=Wi(@r-QEDM7VP&bcbBI&K7NC3W?890a{(Y`jN3uBE~i^B?Th z#0Z#Ja}}8f#NBetF`S^voP*ie+?u7|YgsZv-^g%N+uz`Sg~b;}nbiE1 z%kUXDgUa9dLZ3G~O4l3>teG909uXSn2sZ=T z6BgzZN70kxZlbAZn&ax|QJG;hf&(FEhjT$Ym;IPSn zJDA-)S&jMCh0EhmUX4$C&gogPGaK@h>Eg= z5JFH|OJxdqb78zGW_9a>M7ALiYdM-JWJxoXMC}Z{v>}_f)Z}x{j1`@vGe)s!Wid*0 z!P5B}!D`QVDI(%ZGXNT*%9&%j06gXuKlLQG;5Ew|?Uw=iN zZ?^zP5zR>;GV3rvJ_BN0y1VZUywx>FBE5bsIqf!+4b-8<8>m4d3cq8}oDaXKcoirj z(sLp~&X_WsX__ya8coM}>3Mol*V15>XR$Bn<{7d&XmfK0Nry2F+lbcKkXkjID~N66={#7052^*rTKKKNq&>+=E%r+R2Suu=1$$;*c4bk?KUP>r$x#R)|*soQ47>6E;(py^{>D2_cZ8kDMQ6 zHO6vZ<*Itcznzov?fB8}_jj!guHE_H5a%EVY@bLHM$DT1pLT}wl9np_1_QXc zCT~h=s{CJlC1ENIvQynev^X<#ACg!cm2Z}h{1(eKQ|had zl1T!Dg(4UcMLwaLu+}YS@9Qf+)=?iPN>d(=GDSWLihs9S+ zNvW}%lZPYvTRZe>v6c%zogkmSjNv+SXx=)5Tv0#@5ny7WVM$4TG`MkV;!l~ZDSkv{ z6-_&%OAQjfBCL^^Pz;C|E|gqWf-eiZ5_ee&rJ|~!q@s+E|cBC8+c64+t_3&vtQt|$yMo=Sho zb`F8SqUwcwPL&U-p3=w6E5Uh3@aHF|2+@tJ>@Sv-*z{Xq6l!u_7fb=yHu4+=6BCP~ zFVQ~ZKqB7mE_W4Yrq4FKNJbN5{>C#pR!+x>KBhG8@=S2$rrG95%>C&b&-)wRzaupn zPLgiR1Fn17X`CxnTBQkIXJ6KcG`RaN$#;b0rRWs!lNP^sFqk&KF@vLi+&GIF%XDtH zr+hO|IB~V6sW5yoqT{Rz#SQw@kt1wJz*OE=shw<`Tv+}-Nvn%E6o#m)T8PG%fs24f ziSy^LNdikErU(noN9Br{8Cbl&6vo0VvM8qs@<>N&8lPpn0vu@cFl7V}GbcubT1`9c_7?YCBbkd8$-r#V1LI;eC5VI%v)U)B_Ro~rU~=dFiU zUbcp>?>i1u{uK}2{mxpR2r}NV@d-kQRrL7yODqH#TZ|f}8%@tOY@143Hgk+RLNfIN zh*Z8wbzm#41WzE!7UEDEmkew-e{i(>oFfb-m5-#-Q>q6kB>fr1C1P%p2(bDNsZ`sYel%)Yq0c5~me&`@YFIdt| zR+Qjs>BREwR*51Ao7k%?OO_(YmS0j+a*K_@8~_Xpdg-CBMpnfKweRZS&)PO_y$Kuj z&mdCw>9hxr)JNl!KXdk6h#GU~&z9NMl1`D*napBp%F&B>)c7z1r4W#D!PCwo&>&|Q z9u}zVPJP;}(ALuZ;^~GCJh!IpJU) zq5k1ifJV%1cPj+qOxioFaef;;J7eX;W{Cjv6D7wCHZKbNwtRVKv~aFrY=TUJ52=4} z$hh@VT$8oueWy7s4u$;}3N38Zn&;+TTC$6Ohr#`v5-$$O$LyF+;l;Xa)EaTP!cpC7 zEb7baN=%{>I0DD%uvFD^%p{fsD|Ph+#GeQANKO&ewIB-DVj-%P7#$ z%<<8dv-FhvV!&mIU|teXW`Y(81UIapZwJUj>ffUiE=JP67{qN!DkINMLi}Gr;ZhMK z?u**BLkyH$8Xn1b5=W;dFR$e=)*VL_J+MZoa-$X-=!F*E--wb)99>*F!fj8=qbVDr z1MF%a%^r#s5@sM3w}Lfu_WVhjAL{XUFL}vXEbH6Kg@E``*sN(#!wRcbEaBS~GLakQ z|DMeVi;H=vAI#f;!8y!b(n7lecD9qn{Q@j ziPb`+WD0Tbn)+RPsl7S_xvKUjw5W)FclGyC3Q#w0c4nxq@u^C=V*R^*r#9%frP?_oJneO-kaVsF9=r-uN7DOk{Cw7B$x+CIF%fm zLg=Fxb+;lEs5;AtRpk-fl=jq^@#2_n;k5m!V_&}p=MGDlnXPi!F%f$>?ny#My@|Ln zqT|G5QcQVEEwds4 zJle<=mrfXe-;2(`Jat)Y6W*5K2>&?umKb=d8-i(qo&v*)!#d16ma5n^f9RbL>toSXUxjO6k_C zR8Bv9Kdk&^KtA*qn@-Gb^-BgT*AhRbYjX8b=trfK2*~%H`a-6`xJrz7nIB-&?m4q< zMZJeFvZpj*67UJf{5@(&HPa^*ok(dusX8PbK24nP7L|x{(oGZ(+9=3EYy9zza_h}; zgW00frA^Ux6MtZpfhbK6`TCE|Rwo1uiQU`UT*cDh9)V^Z9PGt-%AHQio!$@wH`O^l z(aAtkQZWLAg6qz&H!b}Qmt}@EjvmGh7iXw%S-anc!cZnP`0ye_C1|8nnIO_ovkutDdS-u%bDot=!P{CGa6l5e=IJhPwZ_8#zl(SO}I1i&*R`qI5f9+ zcCMaybeDBTs3cFkwib^Zh$z>CNajrH80hOvMoIPVSPsTeB!2L+{UbX+qxq_qfpt%R zg)S`{#ac@BH8bKAEv4YkOCO5oaWjgUL*#pxn}gI|e?KZF6VbWA2j7nJA@>|11R-^p zQ|l9|Z!RgP-l{HCHekJNwZ!`jQBlRzNb?qc>$tB%_ji^R(_{(LMqXC`YdfYDG+%>d zwL9Pm=;jWag(+`Q2xj@z@w+}K2?D}%2tvdXn%Tm@HxzU6TqNU^&0X}3x6ThU_gtYkDRPWfFn z5Uj8NxtQ9T6oMFs6vGVJZdm>b|BRnVf6@D&Q#;e3UB$ z?||B0H;@E+c<|fdu-mnSNoZ)I1WFW~Z4N|(52)_;tfIG%7=QWlyiB&L9cq{>yT6gL+X@kLh^HC;Yt zwz!CzMRi`xcpM}3&_zTzEh$0N-4A%wKz>z-&|p2PO_HbsqoY*Sk3P1~<>jdr-|E>$ zT!eFSv$E6)P!`?rBjEv$@D%yF)wW*ccWaPaU*EvtW#F$(mSP3wR+G%VR+m&|N=-1~_JP)~wuaq{Qo z?GJ}$dO7l;pebLb)j3s|NR;QS-cg$oM;ZcGj|MmiC{MRnS9IotT?V8dp!AjC@gnRU@?qIOqH=fg$7Sk-hwqS zjJ@kSOAf{X2FCUzE}I^vZNvtP6}HAH%BLilg#3=0Xxf{SnR72V5Y;xVGv~=rE^%!& z5Y6Kxik_L7S+XOd`ONhF@BQzs^A->b^{Rke=icS5UzZs5^a>Y=esliAs-oR9O7~S%8xyTKQ78G+J(k4r}%b{&0L>I5ji^_Wi-D{9W!rl=&NA zjDKNpl#QKq4$Id|sH$14UTA;E2tnC0%F zh<~IX24b!`;~zeJ*xlU)XNvy%^{cwNIxa45a8SB^b=;Y}DoS)$=YnHWei4x&InlFX zhEYyUUtizVwSiu)X+FFuyYcWCqc)S!Z0TkYCQ)F(5iU^xyg;q&io>3NNyv$O&!b&L zSQs$~(x6z?w4+BgchjgDMrnqmv@l%;RIJ^2GD4f$OP#-dr$TJarbH*iM>ABff*|fg zNZuh!eLXz3)8){U!YJ3`%-2j9A}{1uGMrs0-*4j>ae*i3r03=3{_o1mGuF|Gkp7gR z$e1^gCeI+H8sm=Z`iw1Y1Ro#2#<<(^88@=Hi4A4i$Q&@9AJfzG%ga-s@3pivH8nLm zyX_{tB<~wixnv+&k;h|3j6xlOSEceTlrBROy+U{jIySUR6s1uh&axRM}qIoq{RaMQ+ z%{4VO-QC^o?II+Y%O@TkgL;z$q5K$p()&uLqeR%@TgOWc>wcG5S#>5zG&t@v(|UOE zb+L7ma`bplK%nmNb|Qc$a?k9n@<#)?3=%r=xv_Q0h0)%aVP$!F85q{WdO$5m2akV&A$qjGFG^bapo1RDw~5LO84$yzk*CS~MxPX+ckGdv z<{F=?N5L^MoTR4Dns34QMOZP?ii|qcykQAk#GFQO-<#u|ku^cI&<+$1il_riU$11*x`N7f6g|di8(JGe70`e*N-F$AOsF; z9mAJ?IfiySOPJ?UnyPHYGPF@_t`OQ<$$nDEnG5d3M3N5X@-nUo@?3v^am(ee+DSOF z7<72=5}*c7<1W9utAoqEiJ_q(x&+w*6%$={2nb{qb1YGXbKsFr__M}Xg)=d(qg~`O;PhAcxc^v1rv|nl6g$pVJ3%P=xRdr^+V93P@eT(v@ zNDa7;|Hbz3KMhWx0r=uY(#Q@#Xw^sX36UJ-w2__5TaclHdrhceP+nfImy{(l2X4Ze znw>xeEdJG_AW&`gXrIV^dB2lp?9;g>QScEc#2&cOCg>O#V21ZiS@UKnTJk*8O$9Mt z^q(7h-5rC|cm@8$rX(jN{U_KLgoOIw-~HBuFDw^JLi?dzSLuym43c!q_?RCnckmyr zbQ(oxtKVwB8y)CX2T%igSP}MI5~OLDHw(2m^dX_7o)pyvM7w*cf|%i&KbJxy^7YE6 zw+#zIKflNr9v*)FCih2oK!BH*m!&0Riu|(~@V14MAUS1x3GnB#va*5#8W@xdRi(YJ zHQ`JIuoEUvc5&Sqq(y$ktG7=;&fK*IHNk&nb@UUNbUu-w8`-=b#(@6a1 zaTFr+D=RCDi%e0QjA=_Lbrt2M#SkbL=PjAut5+C9AH-&YXn%TtWc%rX5RWVEcFpn( zQrv&pYtl8ig^&OHbhX`eZ~W}+3}6KQEKSXnYdCN=pwc-vH<0ZJoDMN4aOK29IEN@Y zY)deAPrYmw)GK3_NRa4(>8YuIYOU_>?$2^>228n=hJks6g@u7I1)dzZIQTb6SR*?` z#KhqDX1BNdWa9t(??2@{VRx|QkB|P{>)nrsljbkigf69})?cr`(Q#1X3;a$yOknRR zMD-K9+9G7}TUjgtdyF5#R}4M4xTaDiYgW~fDK9z(kZJ6fOD+1DeJHVN{<^Y*IrO6e zhX5bn_0Qgrm1f6R-go969$!9kGDQW$>X+I$i~H9;tZPGs-&_rH zHWIPaN24|7W?fnh*a%)^D6$b@gh_nBKm75-fHvXVj!T&aOWMfT!~{@>Zh89IJ5!?k z{_daz6^GKms!ez3LX*$~h9b$0n1xj7f!>&?gkXjl2%`?gC5aoUb&=%TYyBNTGs;u) z`~LUodYk*v)Ygz|Lqn^9@`Af60SFrD6=Og~&ezvhL_~y)jBM4RdCq1>>q^Mz=Tg=& zMGUvA&IcRM&yeJgV8wJ(L2_p!%F4;1prWFp_;*=28;!nXCr6Ksi-7~v7|nPA6mEYV z95@T-uoA~n-C(@%o=6v_NMg6Rh1Ky+Xgu{Mi}5RcrD0DZa#P}ofh>5

I;zN+rAi=0&=0aYFq5^lwa3TD zTqM-C_BPgd>5YE$X`{)!pxm@pXr;ou2EqOtKh`0CdMll%MozyZLuxTwQRI=15iKun#EovEp* zx%u|P?Inh2pOqr26rD1BZ*p>s)_6yz8J$TDQ6Y#J8cB#?*<*l2 zGEnT{!Y~0Baci0|K2~-v*!Tr9RCgOKCso|i@QznWfgW$-L*8nO|JHn!{-;l$4&3xq z2~-JI^j3U)eB#K3T>hNBHEVktjQzERB}9upLleh{HG(=c5b2*znUh&0hDD; zu96y!HF2E%UENaNbto96@HSQf+57AE_BL40fZLrk@M$`1j3Yb^(%0A5SXfvTFFh)| zYie3smo}WZQ0v-Oy30p8&sFV5$ICt56SX)rEIs%KczXT@;0Ju~7FaK!87eGHiXE`9zfqP~kAIJ9aHvELbaXyi=n@P7 zW9)kD!XJ8riG_9j`!|RLAlMcV70!jsN=wh>S+5$DL1}XLmfY~cnbB=+aX45?ii&Wc zJ_@oIr%{KFjt(faL7fbC-qO<2#pMF*Jn--$C6`y)R<~rF>vey^9PcOJ| zc0g!x}xykL{Ism!`%ql;EfOBk^%4;VnQc9PC)%2G>zEDEEPVf(lL4{g40y!S|JM zVr1m7$T*(9IVC2HwR4X{a1(2b`=sjbV8l*< zJRBt$Cv=yNH^DgR{xWH}!|Qx=!8o83sPFFYThk^$AbArD3kyS-av+VH)@?TNBbS~i zB-8d67V__{h}ptXbiG2Up_K9A@7~|t--9Re2F~{C@y`~JkOqkrFA`uWCqcM~$o-tQ zagMNic~OxREYxD4RmUt<&UD10PLr%DXy_|gu)sD1S=D3}Cb!?eR;dCW&cWuHM7HH9 zTLGgfQ!g3Med!CNWxsskZ(lXi_HN<7Ca-G!?be#%@prb=w%6PV;DFkdklvq2+qcxKG(n30|4sRA{cN0aJm@> z3oGZP=dan}BoJur-gUZ>>u`3tDZmABB|O?!ZJPc=3>qIF@9OFT8E3uK*VE6A4XE(? zT(f{&NK9;2w+NOB1bt53DwP*#^9Bbi{FY6B0T7K&u<*9=xofsvsDAjfwIvh3c`gWP zY;45D#x`nk+PIu}b$W0B&Ixd@R}N!ulw?C299akRt#KCUR&7I|+FJ)Is6c5L0|Nut zN0CV^qYfPBH-v9 za4h5vfLQ{ShPI5+vGJD*`lRD8E9^gTe_65v%BrIc!Ab)0lrJ-Lax6TW-Tujm0<~{A z7ne!H(!6btUY=cX7O+Pxl@yJrflW}Ka&|vl^rf&)>hK-M_`Op@*AEx^bz^i9u_NsK{U@;xBeM9SNp~n@8i9FKZp%u6A~y$_G5rtE@31 z^ss;I&)>g)*+|yRJ%b?Db0Kc+E2bAlrJ-{s9SP=eDrCC!;!Q)^5m@AYbhKXUC{hFz z2Fn*#K@PoTLV`G1gki`~lY;p*apY1BwXaR*0*tK8De?fQJ_3*lUO(6a`IRwAE_YA& zdm?d|Q^59)Wco92%NA zxSA<>6Foqy5H2VvxbGxrW7Wxix(HGmN-b)q4qKPc^H$ zCvb!0Llg+z1eFNsa2?(TrJ8H#8qwH9i5vyO5-q&_{2oB6zS{#z;vhnr)>$_!fxN{5 zG7Y%BPcreqJg!T!aL&fGG(0rXKD4U7c*+HO^Tq*xQ_yTc8Ilad=2_llf?^8P#T8v9 z`s>ml1wF@n1`;f&2aQ@?cJ5ER1I{0{wnEB2W9;FUc1ZAKPCitU4?cHuaa3)CpMMnF<4-O;nBC>`ujh} z6_Hp$sF8Wzy(E}^!K|$9-4k)kvf%K2^f*)p5AD6b_{a`QJTaFMy4%ywv|14r0wAcd z`EM_PaCvxmIN(<%_C(zFCl}H<4DaraLQrvp$>UBOw(z8RpFvDw3>|(0M}bqmp@umL z=Xjp3VuVWoC}Gzo4h2cHj_=D9(ibO+mfsAyO_vyU&vsn?t>qAihv4I7q@{V4F#Zd9 zuAKd61sr8^z6lbV7G2ZLUGp);CfyoZC=mGjXW#D0$F+OB3E!_DO$ekiGBevi418hvu8qhJJy+EI zuKVe}d&0N{P*UGcB)h+A!jKD!igo~X2&hXlzpcSoS^BS`lv--lH8qamuN3}8@0cb= zT66-)Fhhi-!c;m-8awj*dA3xbm#!4XTf9gKW2%V4GASc`d0FeX8^A5O`zgBD10MdI zpLX5<0v~MS=xF60>?sPL5D*XuI3FM;lH2rtTyC5BH_$pb~d($`}HTwK@BO@;NG7AA3p6p{hb(yCPoVC(OXLLWF#@moACVgLnv;G zYjC03&}?p@#-P=-d4)l4x!E!AS-pd4J$|WXbBEzzl&7P(y+ZkGgPk!0Wkcu=zH?J$ z%l;icmUKDx6cjB?R&~(hK5?Q#jv`WW^X~fS9|M#7D!_;(<-z}HIO+M*<*TR55zcNq zTiX@(9o!5{Jeuv__pk1cUuaccrB!HW6z}CdJ(R3EcnXrQuC5+Or5oBQSWd2Z$9q8i0%IJsbliBXkHt$I+7j~oMP8(#Id`;BGh|u^ zK*!@*9}Z>w5XgUxjdtIkmizn7ZI>u-E&He;64V(SW8w8>nAVvnsY{KRY1=lvD%c3U z2g&ud`MWMedGRSBykmMJ`JfGP+wOV#xc>BaJ*ni4h3<_P{PpYCPv?10x4@H|0T)Q* zTtXE3abfHB>gpYGe)%D%c8&Dc4Ztp(c0a8hUHkuD^#q)jT^qO0gUEPH`>DvXM@(I@ z3e&$D=U=Vx@W)v+&$HDa&+lT`bN#*N#@8@0>RRQXh@AM59bw;_%0i}kHh>hecH%** z29e}z7=}@vV|Zv^W_tQD{9|E(P6s*mNLX-^3hS)zIms_k0xrZ*NQ<8lM%c*k=b|dY zbGXrp^^LRYktjDD{t)o=I{^5!Ldgt&g}al}SvxSa!x2t>kF1su8^jiv1V`G@_HYtl zx8;jK{2AOj2PD(O-_rmbWJIv4AZ_Xkt{fNFyd%@ifU3KT~q`yzQRyyY62#0rs*&gb|NHA6uEK*sXuj} zj_yF3Phr)rHf;Yw66-=jCFt~%GvM!0kwO|M`9lpEesRS>IQSKO;JI&J{nbd_(O_}E z+#NHm0~KH&2<8B5Cp~|oS2bUiY3;Et&=fmslSr5F4TKI4;LBlQD3JZb!#2O$3-Ez@ z`uf^L$g8m`@_+rGfFl7)jU~nB_QC>A`SkbqI-q+&%?mJ+-~KUSwn?yfw-&dC3q@8hA}2(=<9uw*EiYvH4$7tgko2dfRHalAgL+zB_Z}biUV)r#sKz+El6nQ5qd6JLJ)1A<1cI3V&9N>=nyVl= za6FK(gn{J@m@fU|cX(F$%9*?wu&AKk0P7(PgEB?&@bFxK&>tHU0}f*TQ`;)0_=Q66 z^=kJ~!zxyQFTZ~*Ye>o3QP{#@ki*EPO>7da1U0TUEk;{*gQ_7iBqpdYkf{(EDjo5f zga%VqjD#)*;vC2oaSJC#JIWx~UqHT&L^Z#%x3ka(CNFZ@NHx3It+> z#L#j(&ll@xpZ=0;-Q3&&OS%E*f-+u4a}E@?z%-3Pjb<`4)@~*b&kDqPTc&XcGFQv{ zdkI#bD|(t|gfa*{7GsZ6gc>vEQQKYO*RoF9UT{(Q@z#)$<7(h@>Fo z5FBdipD>i3BD_fH*+tsYos+iY9F!v7q~RZ(zP|@!$ts!LfhkvH?6|bv3_g72s+J-c z2nq`N2S!6eLI8oBH}MKED7#}>1u7AQ5HA_Uiuv71-jlfsZNRN$XJ)EtHZ?U}1Nz2l zJo}x4Lv@u&2kM>aN$JVuttjYSg2)JpEj~Uz0Rc~7l;ER3eE2WCuTJ3Dlkw;^Geam- z)Yrir_lpp^P{Fu9@?EaxBlvIadgZNHtNz7e<$3RJ;;xV@;s27=G`>}Agt_tLY7&T` zJcB@|H1o;N2$1vPa|zf4fv|GKeJBm0m>6doMgo)y``ksfQFtuM2}J1r{{AN0g+Zgv zY2L9DkARycD^Soo+Sn}nIwXHMiWsvL0ihZA#@CIr?QL^lq3%aS6%vOY?Hj9<70n4= z^Sa#~8}Ak$I7ATinn-CwHzUCTzn*|A$R0MY)H>?v=>ed^C@U@gR~3|TSL*}!ul;>N zz|sR+2C#7EJODg)c%B+LI-UZ~_KZW0#r}drMLubG8!+X%I*3(K>%CElSh&=ncp ztQFA_M$&p|m4-dJWXDew4Qi1ljW1A|815nGU~147%o?+7Sn@a+=n|={eb=S(eb*(p z)CcKjJ~~QNAjG8nXeTj|Gpd~B3~}*9qtQB@l_sA61}VxnH5j+F-$|53%g=P)35iM+ zL6VRa&hZD45#T|d3{1$?&CTP%n}EZkqZN~-!c_%z^_egXVxumb)`{VS7c7(4r~POn?C zUHkU4i|47sSR#H8fX3W#`tw`A86d2STlf(f`H(Ifkt#t3rX-Xm6cWf31!e(2+66ES zq`00Sqz{z-#8~rF*5HMyEKmUf(k}F)1-lG{AYCGQ&pVpFHTz$C4|ptq?x0&lp*ePr z1db;p2n;sI{STWDk+HQ&WhAmTfyNG8}^Ybe5syI(IhZ=+4?KqUsc8E&9SlA20X&FJKy9kb<#fM{)J_YZM^ z#>s1p0&^ZAQPIc!sZStewP%la`ph|ka~5M@MOl=|o~yqHzRHAu_)xzDEcRasVy?UE z-34GS$eAZ6CxAd#D=)VZ&3i+Smms?h+`idi)yCRd(EV^0(D}Z*qt9v<+A(r3Nz<1Z zK{?az30k~mJU_@A;oBwR4bR1Y{^lR41>Q?Ft&2R5 z49B6O6!lx&ap_d}e7Ac;A6l%o)7t7Mtc2F2%A)#{2@x4N!Ui|FIDc{4rf!9mf)D`( zl9TV&#w(I0M;{17MTtZlgu?bo%xh4an)Tm{j$){MqF;7yPJ;0W3EhH4a}rd9zO%6r z_J8m)HqKjhSa-Hx6}BPXNu<9f-xmT#es%`xthfQwzP>)dE`l|tve0!$R#76k#|`|) z`GbJZN)!#qH7@`b%QRdB$pOjp^sl_S+E;Se2;5J|^F0FTWccAEi4IUO?6C&~r8DY-2DpLv z$h~_dCnvBoZJw)ID(t{dfq~UmG0T^(@DM|DT~$jfE2@`1{di}*yu8^$u9i+tD)l;| ziKjtZEx)RNf!)Hv!Le#s@`68tzyNL!kZ1rg(p2g}1My@_nl`Lj0ojmHN}pzcTnT~F zjlFw*-*#@57qoz*CGwLYBMgrsZi)B$|7QUbnRk|EW3vHB`OS)2&NXyQ4a6xZR;GfTme92%4`T53zKBW(an%EZ3IL& zKqVzl8~fif5TF}&`*(JBz6U@a)Hv<3h_yOw?Ck7dWF<%}&@jJmL(paWo4~qXL%@^2 zrGW|dYKG$O_4am+cFn)teDUH%nMRZvDHIu~ZDNG?ohOW{K_FrXpsfIbvS0d$rR1~6 zs>BAy;qJhkB3$N>M@JLG7S+7NeEW%rCf9BW(8Iuzf-Gmn^GuZhusCn>L=B0l8h)2X zG|$169GdSzECAgG(4^NjF!1|(cimt$5r>K0W>DRn>mjf=6vE{q{Q2ff&$i^@jild$ zyXwq)$hRY!=W!yWWE8RD%84wyEJ!iE2OstHNM&RiYK#GUf7!N+k6a(nZSf@PX`8k0 z=9>Nj`F-Pydk;Z!|GVu2(0(g^=ieRRI z0fi0PG05VJziu-8pgK)_M0GoE!utApenvF~R+hOP!PJX({JDGJGVbsK?Gw<&2Knos zMbFQFX`j}bD}p<>8UTO`vVnhhw?_kj{lK@u!Se~_8#qjPvSb6gA!;J{rrC| ze!M(x9V}+Ft;@HXG3Dk&dAI>@wh?o>ynH!p$v~p2fqR7jaVEdG4>KF;$O~BeF>T76 z)@YadT2>go-*RPjG>JBTT0%ZV3BhbSETBM&#`Al8@a9OvM=oe@_XT!JH>Ld|Mt>6r z8DxannHjU@mFR)Ze+Ba3;Kgl+D%qsDBj8FC%aY5>Nz6dMbau9}{6qZv<@NRTsVN#L z*dRd5s;jF@wYJ!*T~Q-L588~F2-5fJssAxSpsHZyd}em+CX53ff3qJgH7+~j{od{# zul?!s*^0%gn7jGoa9ZTRpdxKc*0+tH+r^uF%`}{MB{f$k6Mg%PzSTEBlP{XS8XW~h zK1&K7azW>(t;IF8WrL|9PQCemXPNI4`hH#p zF_E$&H_r4^@F#$XlaPR$8Zxxw0(vc=eC)Aoc&`}$7A0$Ld3A1XW##DFhfoSF42-p! zv5BM(=gKTxgH~|Fkh>wV6gOz)|3|i<=Yt;n^Y{I~2B=!NH*cE4&MM6>4OBWQRUPU7 zBqHW)>}_mpF#lU3e3o!KNGOy8h<0Tn<*yPepq>2czep>TQky(I#v=_rfu=r7O?dh3 zQif}5Stk(}yPFuPVju`kYn zY9a|!(U|(BQrdQMO8)OXr1Vx=L@{cZpx2p+tLqB|%v$~V3Vn!#N|paKXwFYhe|09m z+|||5SxgK~XA~jlj~?1`He3L13)bg#{#*7C#>;zLNVl|`MXAQB4SH0yzebZJD5W;NY-t6)Z&l95)rZ67N2{D5me`IfgPxM z5Kf!lG_4pLKQ6=fu{yf?C{of7gkWc9T(jff_h2vul;q9rhEx$L5;$2-8GP`x5zrL! z@$k?}-Dwti+^y78iB+C3SIDTW#7CDsznzQ2-gZGS63A6qph;VBX{|3V<0m^g{K`Jo zO8@nT`fgMbjPZm!BU1D5?aYlkMx{W7CQID$#1LMF5;6?7Q9t_AhHpiz97s zcNc`GZByLQx3)D&6ML@x>;)s44pw%1`k;FIjXP;Ys!fds6HwT**NB=(L! z>1~P|pHjohNw3M|iO0h2PQHZ*`%4t66h6zPu!U^{{nus<^9!b-_U}J~R6QwSZRsPN zHWFF*jYrSBbM3@ofxjo0B5Q0OB$Bx~201Xt1H5$R#fw|N$CJ2Qeql$jkCL{2OOx1a*8`*BmDS;W z8~b45VSk^igY#9j5G4%+CiQP#tD<7$z>OuUzNJNwk1s{Jq`BRh@ia$+g%CZ=r4@kN z9T!l~ff>1`jwR3;E>eq>lu#vr09XU!L?Zo3b>JiT*+|K#0ooDS+1Xih^UbmWrWXcG z1TiS3|E6~APKQ?<1@@(wBpRiEaKn?Aj=pC>2sFw4SmqX*Kb47qsU0q`83M1gIno&9 z4v&wI_xBeS_@>uoSNjH>4M1%II0P`Igd$6i*YLk=S*9#-PhfYb3N(0BG!kj>I2bq4 zr@Sjdm-U=p!{&8bY4V{=#RO>z;AJaQ?pWCN<#`o*@G62zLNt>hkL3xQ63z%R-^-U{ zih5wk1&jq16!hwBzlYlja%H38UiiR4N&(LXEwJMU_jM1Bqscu{rO+qcFJG>69cM?Q z7n4MT$w`Ksw|vLNNj&`%4S=@E^%@D02;uiEC>*-3ipvzcF{b?*SgQr1yaeeWk3&W=xE2g zONB{MS(!0uct_RSsCTQ3!3=Ht5*Df9DnuB_{cK6>qibv6TVq(PB&ql-*k48FHM!tN2Q_^339Q;O4-zK$rxA+3~fHzMkGL6v(`7fB`2k^t65oPOeM*4CXOq z=`}Q0t8YRigQ2c#q)d!Xw;8~#1WqNzBH*x2th+inHOz0h zaOXb{7h+2Q&(p^PDw#U~Is+>!XPtq-kByj>+n;w3x?(B$(>!#Q#-xa8XGRjDK4+r% zQ#chX73nH+Qk=Y@u5`^nv3J8mDeWJ}$uktxB&7Ug9%6h=2pmdrI0(ZA#5XHI@{#Ye ztVF+^kWfUC7L44S>4+`nrH{d4)E|5#zb`o>tX}GECz7JcYoIL5LLDaGyRtJ{7VYz0 zlA9Ow8xX2Ng#{Z1DiWj|7;}$rACyEFzP=`%bX%UgpuF>fNqT}x$;etsXKCAD5(@EH zy)-P0XwD&XrPXcz8Tg;X#IxU5V9}}t0~=1B5nukf3ZaN2UpH#n#-^!9MeBmcLcXsq73e)SPkuF4>A}fn^(yA#8NrRWvlu@KTOWXb(5`P%TIq=dPwD-BJ zM6&EmK-NrDDZx9Wy4i@`DA2Ds99i2%z@LEAZPDGswOIQOHamUT0ru#7e|84@`V``K zVDJh>a-8j8Voh6HNAh#K24l7$ji#znWTjCxIP5w=Zv>6<6gQOLpg$4jVB}}a^OLfA zuM?Yg7#`0SGOtFJTT~j*6Z~owM%9?Os<==OPbf2w_K4&KGjg)C1(@RS??=Y_Ye*4D zBDHYiryNO_tN2)`UAb_7?tN@Ey{DdWs_xRo&4Q}p%1U(}?rKWMCRRo3G3N;BWVij` zy-1WaY31i+kRy&ljH=UqO@yVralG=ip*CMl|2lo@?6=)uI7OXCOKduX0>i?o=SAN(K$sS(CPu-Pv4{DZ;K(cZ+ZeZ&YG z8wc3EO zPiA(EslD~v_@ZL{4b6xok_V#~Fa6_mje!Eo@&}WqH*If2qW;@XAeMbhy)-2|A2bzw zy@=P{pqS&}AjFlP!FXSbkV#yU0X8BCh z?r`aaPKKwk8&@Pl+<={knqv_Bv-^P+KR#wZd{f6ynh$fK$$zQ5PSSZF;&-0f@>j9N z4S?=bH6`%sJr?7f&6J?xL~_Z{5TEAFm&bbU-1g>X2W$v1mADl9slj$o4q7NM2S)WT zi%EFl8#$5&Z5uMtc(EPsqzBI)mY1W|z+Ml+<;M1Q4`}_MXn-~iBL%|O!C>DT%pNY) z1+OTHre=DOzTAJchRCX})`L5DJvJ-xMPl^DgSG`8$Hns_gT*IqO$ zM6RxCquM{^PV8Wb{#Uv&9dQjF-AWyKC0k7uK9a-6cC{K59t^_-dj^wRKg6!8~DwU{jD3&qI z6sNqnKE3`m$9Q7Y<2hOlY)Z{PC~ZMy-3L8DF7OA!R@2N020H6-Lx4c?2$VckQ| z2NtJp#}Uqs#YCZKMyj}4QY3e&o|6cDks-GXylaObj(qW!ineA@PPS`%Gy>_3qM{;j z1;HusGyF$J&!5$Z({dngxZN*>21PnTS(+5I z9KSzCoNn*v0E;$w)3lP?xc@Hjk4lIdFqtTKuEunawSV?*d;OVr>uQnH9H^h*LDGsa zYtD0qLy?IRStQT(0|wv${{EoTc*5vKJjX41Lt?x0wW7z1b}^@>=@)(%u@?F3n~D?7 zdXXpHJkb9qyM# zgg6#%b}AMX@>9Ng4}Ht<7aDD|=^BQ9Ap@%fdlP3uh^)+sWu^W7AHL~RNbYstU>loo zKEW=_ZHjXto=-dGu|hhI2VnjIjc;RXt5nnvdb4*H*DSPe+w$G(TkM{i2xR1n&TTfeXEpzNu^ROW8R}$j5korfNQV5!Ac&&k@`oT#1aSZgdO3>h}U= zUWA3ZeXvRRW|4adAt4t>PSP)wU1li2xUti#(k0?ToG_59;U&43ZVUy=%9)i_Z&q6l zB&l}3%polE0V^StB7<_w;L5V6vEdXrrJ%pJ=b3Mft_1fqdiox`!1b)vr-Oa`2_*2|faP2AS8o+ytmj&?;#WqSx+#iWVlhuy-uA(ia~friF!g!7w|Is! z?o0fG7CE7GqDY-mJq6_0tbEE7_0mRax)-I>&fHv8(LaM8s$6dCB<{_M58;0;g-w>q zzG0lN=ITVs9EVE6&*ny>R{TZ7xX#DA*!E6bzKjcZKbpuE!1TFh^7SBQglbB7uMB@%QcaLSgP7~g|2aE;k> zaR~`%Dh}_uJpNo{FkD%ANx&xSjosIA8e1@c!1&S3Y(D*p*$0vPsdB#|!N6IU=MAR8 zn>Pnx2d=nP!mqBOL4|L8W7i0?G4Ss~5{HGFQ#RPQp}Q*KT84d=h`30WW|2;zzSOWy ztGQtL#B3(sIACPVA#2)vlwDJn(Ly_5YJWAt>Z`dH0KJ3Hf5B1L|tIM6q5 zR~u?g*qM}l`C@p`M4D9oy{kgt$%HdnFijn4`|dj`oV(Aa$P7!>D)bP+Wf-PulrXqz zL+1tAz_1w-^tJM0m$VNurpZNhy~gQ_ygOeDt5Jz76%#d8FbwtR)Y{|wAccgpGf|}& zS}=wId9IJX((Dr*9D`)UVPI%27-5Ff?Bd09AVDuKZXFympD{5q6k|*H1!CmE!9=$! z8b2;*00%*`s$G*w$yh6-7C^-ZF?Dj?SA@E$SX+KY7q)gRCR-i+5Acb2uC8+M$g>l%b1r(=0v#>g-)hmY8_l@KKu@IF2Rh{jZw_7tGLH( zV`)>94|pVlFX#Ai@5$o|4Ria=8AsWM5_r|1bYHsvuWJlDS%PC=pI(Qe3Z%)mKd{-) zWPEn%lOBBSLA(*+O&vEdPp{$_@wU9mPU)p`o=fQ%C(?8_WA1A@?_*7am4;XY`yr-x z%)Q!cnhiXQKKOt9x6B(P7xxH)z6=2SZBg) zhlGN*xuu0Q;T1#&!QyboViV(ty<0%%(jH zU!FGTg8RRIS^lT|o`3-?=-;2?dp+lDJEhaES+eK&3{X3a5BXIPMEAIXVnL7T))Vr* zz&*SoE8mfr3AZdKf-5DmjDE^a&&WP(EmIyr5w26+kHD%9Zv4*L;LTe~Q;T73g0QDu0NxS+UGBOuGH{&3I0AmB7?wS@q?PMNZ17 zFB+$)!aw?VbXnH%$3jR+MFb?l?>oJ& z&HeWE+h-=HC(5$?rPxv<1R^8D-5T5V#6j*15$o+$lgkX9aFV!&EgRnx^!H2tX z`%ZV>Xw=hZHUXNH+o8n0bN^cP?)$*}g7g2L6&{EN+^?ri0QGX!JIi^6I}-H@&rfkL zW-tQx496Au$UEv~`IE`!;tKL6G71=f5^JuKgmH^1>ihb-Ae7E)7CjmGG_c-Gs#HH8 zC65!$K|CUtM`RvlJhePY&uZ0P>*=#C*^&u!MK^fKC;_k)KhnoW#?pN_Y!Mngq zU(|K4V(&-D?g-r2;eK!!!k2mpbbIeMco&BqV1?$M-8lC-D1Y2Y4r&Yia_uNZZdn&s zX!ceHxA*s`si~p4gP~`j%!l#u#zrUmNbH7k`l_jfEO@*=tnH4ypUNF}^3W}qxg2ZL zVyeYUpPCGp|9yHoO%_ncul`?n65Kj_SrY_f0XR^|6y%YWRdbV*y!fABYym&x_obdC zQ0}Itl=ronWyZx;4<1E1MD07I+&SmVq>S|9V5W?Mu-DS$q>>ZK-X$~ihZ5Vf6mwAA zf>#s%3G5;7gq2r%V#cdL=i^BXe+E~Yfp-wsL$OSjx(6+j`I}N+Y^0*A{*Um^JH{=> zT-2A_EuJntAWd#Bh*Nt8Q;O{6UlU#QifOV4d5@t+?^|-Opxew&Vc~8>>zmGIXS*0t zKJK}M7pXymEx3`xYQMcM$C#E^EmozZA<&#KA4E};hu*u6_wsQtifjP+H@K^Lm%&W} za_6YC4$9Dw5rc9z{k8MljvHYCp+E*1|9jSv^|5~bU(2O^^s38q(QI~Cxeww9%s$xd(r_9w@n_;Y*0IHU1)H4{` zp4?o`TenCM`+?@#7cEsqANex}Navvk-!#IJ2~}z_Kh@jEamB4*@YdmnC$Q*VE~b;f zmut-;;D_|Ht$$H|Edt_7kX#vd2rH`%SAeYA>&dd)(bg<5YS=&2bP(NAJ`*<}k~NfD z&osFPol?l}*U38k(3XQm%XbH}h+B_6->hv@L*{LXY?eCLNy=iYfU4k#D07k-p&$-} z*^K`8`?hV(o>8uKU__ z`;4Let2Yr35rS#D7@k`L_Qk@2<&`ytKLVZS#h*0pB~5algX13%#+UBlcq0 z^qC*I)&%@;FJF?DUdhqqtDDhKlWEFji9~@10o;eH-a8x@@!ld?@hT;&-X^F2iiKOV z{O8!PD$<2nL$)BESEow?|cdu}Pc-^1+O^t?^ET?%$4U|*u4JQz&AH;MtIM#}&DYnIgY&9i; zFkdE`)0cOU)ny|ZJ`zJ20>>ZB6zdy6MI0Po`iO=xU-!WMh(nP=c$J zz&LHy8)y;V=btAr3HH6k2VIUWKF}nCEZ-;ZHvTZ*zhkk*kc+c$mzc6COFNu$HuPwa zTRV?Aq}tV__iKXk5!~hISeu)UgCHAETQk3Dm$KYCVOS!ocn76sapMc9w=(dC)rLo{ z>qI>?DR!CqXG*HzQ<)r2fC)y{@Hc!jaCXQzM>_Gb2yWs+Iz%sy6+ucm6*H(bVuM1^ z5T)~Cq$*`XP1VZ#Tt7YY7&HTrxHVr)oI_d<34&WSg)1L-^W^YYcA~$(RGrK?eU(MN zaEJIO#TJJn2MdcR>$1lkh-E}G?#rSSp^tKC^5VED`(2aoyc+!l_S(tkwREHY?oo;g zhKBiTHAb6XQhf8mPNt@r=(FNypxg=k0~Tb>asbvij@4B^h&{!f!V4WWsCKYlz-R#MCHH@=J3<*+viE~A zjVt(Kua6#a4n$X?t>J|juvreWoHBSzUE&^aK3$T2y582{RuLxgkBZL?=J!l-_6^0a znLiGk!+JIfJtVdjspp_FjCp*y!hl?vES(6~&Us6gg|yH)QmfSJqwcSfL3Bs|Nky`ubSfvaUv1-cL*NWh+;N_$Jov(K9R>ij#++3YMkulMG zt$*(t+P-f`6=c?}BNhCT6gd+pcbS}R1q9$pyx@PJf+^=IS7DF$7mW(SFQ}=PPh@GT z7#b>|zWH~&u?wEL`8=l7M)*7S{Iym<62`|9Y$i-`V-nRVkB3)b_R%jy-9L1?$qb#Y z!w+Ht*0`dl=N~wdU`cV%?#d*wIy4NHi3cH2iU2qP4Oh^j9U~?N`TIl2rxJ9%ElhHm zS9V`tpAwJo+NATK)G>>3x?jg)kq-FEK*od74b-NP#9qH*uvYeO<603%D`*^OCWuNy zP7wA|khTcUJjhkR!1nq4NtNTA>VDw9{vB)Al(akKZ)pm@s2ENvHVDbeYS~ujfd1JW z0&6Uy527z<{KiHX1DPUxeB4Hte+5fbn_Nj>bxnV1Yg!peMvHi@`6LU$^_1>4^Vmw? zM&5P3F|}C-A5KZE?5MK7DTY`n3~To=rO}S;)nMtJdukyEi+hug+db}l{dYJzTJ)u!9dzGIVY+O2q~OZ4cvm z)wQ~*j=oeoQcj$%GZ&oTvD;t<+kziU3w3^I{4M^wn) zzg>5SwX{0?x3bUc-mu27<^1;xTu=O|2hfqTtbjzkz0fw%lF3+?5k(^3VEk=!^Z0wm zHrQpJxi20Ol47!Vr`LU7s9!ZZmCWlTkoYN}nV!=f8D+da-6nrrBh&o<&L5x6K?wWiF5oQZC##=a zh7mR~tlutX2pViJU7;Ha;Aqa3yZFqVB)$En=p1#z(9O*J=o|^}>!H`hrHA~!EgcPH zfO}f1oJ5F^1vyyqE05_u#3sGw>_kY3$se4}oJsjvc{AtBUb~CT{YWe`cgG?v0=8|Y zIM~xAC?B|L>Zpwd%0NuOnenpacG+MPt^69ZdPy7fx1dW(CeC-=eQufeSe3W-PERd= z?5u14_6{<9bbNdqs#&#G4AIiWLPI6=u7_dJdt1+!KD7JcxBUO%d;Z`d zl=5x&@Pnf7&6FqbWZ5O$&3~_E#KfFptLH^PDY-FKT~!60tje zMwdC6isy8N0I0@58jNj_hXF4$y0YqMHDT}*B>!&0FdnQOe5p~2eQUdr?l(q%*$*aD zFosavS%llP+m&$E@7G5(2;+_N@^Ue)oRN1r4ymc+7o{#VRo8B%ZS-QC1OJ|9u!H+OU1y|GQgoyVhJdOY=_1&H%XoR2bhI zeb@9mqTPC!Ke84P)_e0@s6py=qF!W7am8)j;iU-v*sW^;_aKux|IAI_FwOEpv^BU? zyNGv3vi&P0y?=Z9=HF>*e}1g!NSFNamz5Jq`Tg(jHRgoY13%MFxrjcTok^ZH4!eE4B%vv<4-THne}@Qvkq{#a-s*%A^H5+IFkp~d3SqN4I@DWNg!Fr1$15*$Q1ZA?g(BZE3V*-| z>Ct`o1ztI@ImXz9BYe+Ydsf!wMPp7>+*5L=XA1M-&bfr9m$?UbxEVF7&#rF>C#wRg z3Eo?C!L_1BL3YL|XHd7m*67^wmZ}p*5yvM~={LF=G@eMGSBG2Ei;g4nRvs;RbcSBO z&idx$x9#@>v(DkZQ^dN4HF}TVUdUQ|nRhMw;G8GtwdIBRH**|HS8XVIMcJ;4E~+da z>MSou*onOHaQd}9@90EHatr_N6vBq+A-cq%F*`rqWQY`8J`?GdRJG;%eFraYRvDT9 zN+~5*1f>EjyHKIS_*%Ubs;}|&Ju`g@6T{IheYt}2&*VVaQL&ZefaFm1TZbN9G{%wp z6;+_^o}_F=ba4Z->h>CtY_i$;q+S@hAk~OZ_Pa#tZnW2e3s;Zj(tEFV_&>S#Ti{;=gVAA=s6klY8 z)zHv@*ybGN#gWs;ZY+<2u384Qics4IywAzbaTPa1GnJg!LtOyclWIh~n_vbzD{E1L z`+ouby~7YHtR0%@>UQUby_pn%gwgiAS zty=7eJ;=&3U9+fC=gDGWWrY$I^Qsk|l8XC!yH6;S4d4C?BqcWQMSj2zT3 z{#8xc19}i)S_(oFL^FS`UnD$Wj)1i-`CIc{v?hV;dmFDFL^Ymir{$Ch{;ay){{YnI z=g$K`T&%2gTA#6Alnr2~@?FS`FZ)vVMV?CtgE0`yfM6wTouIYMq^}%1fV&WWV`9Cz znBSki{Ahf~dG#9-i4e{%487<)Ya>!S*vN? zZL_ABTpwG>MWTow=SL@ViwT#Wl3{kY36=Xub~FeU%LyIn8+;c_L-HlRrI*$BInv|sbP^;J2wH&>7;!EB`S67mIz6{e=9!0~bF`VL%!4_$X99uAg7po05!+ss+d zv7h7Qgvz$ra10POqPJ1@|zFw)KqG8U8t(b~;nd47U6} zE98TISf7A90C5J|xLXCXz<;R^Rp|;iDQS2D2`%`K0NVhv#r)B;=4Q0+q_3Ri6=yA3 zMp9DI_gG$XlAnRtmt|kf3Xg7uzL=3c-Q1i1m5I$x^rwM&&EtA}RHtRVF;>H06E~`> zlRWx9FbMm^pi;#Bxfp{;c08hxXpAl0)@LE_wnpK*{`lm67D!cY&$Vnq5e{Q=wgg&Q zTF&eDAjjrP+H==oRo!{HT~qo5dZwKnum6}8E-o(MLwqi$CL@&eNOJ8~LjN}!9p>A_ zc&g4C*WSW+R4^o;fr`a<9ei1!_51_-E+}(O=LCa+cqa#WJ^)*Rp{k_Bb~QJDb<5wM zA!O`iG?^QQ&^kH{16CLo8kHfT{i!={pGW;ogD*GiKbE*tjxUlpZF+fPZVr0=|F}Rb zU$?=8%Kmnxs4!I?avK1mfq`3#DZoR(=?c#n|K)kt_?akdA}2RFf?G+*h}Fp2IA+-{ zTA#(JFFw4UQZ*;wfG{MI~tIy}rW)346c>jHU_XwHAk$-+L{7miMh_;M6>7tWhLSH6}!mYrwsOKYl&&TMjdQsH64jdmi_E)Ra2 z3~ubZLM(PB;sqlI2Vmnp?a_-p7b*?bBFH36PChPka({jozG00?&pRlMkX(n%Uo`(x z$TblA)N~eepGsNPkP;6JV22im~`wUnK* zEDSQ1RxI*j?eR9&CSm{xw>JoSWiz+n4j(Lt4<5+ z->@AV8Zg4}>-w9y@)ElrdxkNLT=j;k%R}tO6u!dR?#1TIyOsyL)r^hB zz##ksph?IJ;DXUNZ%dOSv?h4f*x1<#aH;Y2W?nUyW0UiC!NEsgU>n>SB;a>|mle{x zkjZ-6&@Ut;#M4tK^$nabP#Z+{FWZlN^B}_ed5NzES`wFxy$5483#n z&uTjAft4SoAFUBnG|BPgyLD>>LfRIB zw@b2DkI3^VU(J!Wjk6NDD*o^M_{YE^X|HU=G>+)y=sF3} zs?~~gs_D{9?&u_1lHf^x2Np0;h+M_z0jBbw*|)K_x^ays15ZOuy|=%AL0_%vl46c& zUEJkS$qU0$XBU2iBVOPTI1($m7rrQNQlt=qqDA-i=^rS0U*7Jwk0pBK++~Tll@J6P z71R01(VYlkIBG_FrHePBFy(+31hH-!<3`JEC&U7VuE7;Jz#+Ht&Q1jIoKGm_n`sZh zp@PQ$UA=n$5Q@-__I6FaGf(HEUS_L=Cg0dlSeR>)(;q<4gD3pzi@yQ1-eIecxt zNfcLp9+BmAG588oh_i3|Hc}g98gveRVG&>4rd7!rN#*hQ7gnbazmH_ zX0kIyH{dk~FbJH2ki(ya(EYH3*@3dz5v3o{8sMCUCZ^7)iZjXapmq_2ibi8}y?OAr zDk7)f7VM-|u>y>Gf^^C?6K@fSFy0%^Y*mKIs8hH!d%nEr_Y6NcZVd7g=^$9h4DVjVepJUi1fyV?^AQ?f9DH9^Rz(FlhDrGQ>o5e^FL&IYq~9hc*m?70 zg7g>$;3)o2-4_Nmh&^2`1sI)#VLjxI0pPJU+w?&2t92^Xvkje`%gC`AVJdHKlp;2lkehtVr^k3^bmTsYk~FEb=zZLoB>(`Asg>kfuFWtk#wK+T55^HVxTL! zPYAx63(kN01%f0TEak5Xu@#;n7tj`AKWN-lBx(}aBYU^#=AOm4C(*~*eP0m2miua% z+bE5)!MMtt+@p6>XDBp@o+T~x-lu(H{5!F;k@Diz+L{K?fSb@E0;O>nV*OK@nV;=u zNv$f3vWmEWp9G*1M0b(oS`58w14XD{g=T7Q25Ryo4!MwncX^t8soLcb^M#D@2}Ex5 zBSvUmJ2XM{67u7tf=Je9$=cFVd-yX*Lb%M)idog#CtqMWcjecCV;OyCSr$g187Hrs zwc{njx-2#v`-nTs%42~mmF|TQJr8BEiRqIz^KTzyUpzCKb~UwH^AQ@<&)r{|$)7PQ zVpm6)3qqRVB6vj#i{b`yhcQ|t2u0+e7r2TN5;2PjzyX9k&)vmEgDhYwDihq7aXIYFJ56}S0+6l`CY3#RhZxKj#arbGWcWz_CUc5Kf3z!8)hVr@mSaRj4Ew%p8*-4 zmD~G=J}>Ioik_Y&W-;vK{58bdG)2ib5w{=?b_k#-)z%7DQHsgPgltYFBfWBX#fZtQ2Jrgc`J%y=E6hrn85X;G}T*4l?FDLAuN)Pl#M%$QZ(<` zTYpP@ zlL!3@$^pD;#a?IUE~Z$sRR? z0fy0%dvX~~){zWZ_hnxH*)^-5!*HzE+c_SB*D0%c^V0IQulvth&ah=k6^Eqf^kem6z`tr3y2kww|fn zBZZ4B!ci!zGiv)Ex+Y&r>WR^z5IW+RbVeinAr{dAdTLsMTLo3P&%t9f*0X=UTSSvk z3`=*oHXM?3gB=6B@(`vPU-#upZ3BG)l%)RUAJ>u}TIdd$x}Ql=;t2Ct-u1KN+pXn{DJm5}yDZpgV%T_Z%tn?`PXmXarZkN;mk#;`v z2GXFy`03Cy@$(~1`8$@}tJ1uCi44@LZ^Vq$_tOJMUy^KdHS? zbYz!fa2O@T{+;H^uBEJm%NZ&nqC9dW0*6jryI*$yH@B>ajgB2V?jZ{?+Q^_R^MR%c z;^SNU@%hV1+6Kax>57Grwv3n5r?zTC{v_KD`V(#Z+}gJQ4;c_SUMCZ_aDdO2>aBxC z30$=UW974b=Fu|Zg;XJjPBZ;(PR1DaUpAsg!j&g3(#Hc>T3er2Z>(64%h zaA90(+ydi>y`N~(NEWTez9H!aE*47zyf%nq($}tm`~~YpT1G|&kZ!<50FykRe)gHR zD$KM=bp+Bt&30dC6~Mkk5iMm8 zwzuEJlMo|Nfr%?Lv#$PjN|!PaI3g7i+OTMOdxe!SA;TW38>Dzs}Zu65QLOwoU7(Y;e`^#9Jp{$ zLZ$Eq$>akQ1FEO)dpL>@m4hYoETj)T(XERgeMK5yAc&Yq`spLN?tr8pW}Gqq zakr@xA=ZRh`GrCVWk0;$+p$2NxK?GzS=dMRN}e%-h{%du2>0|~!b9Sn;J!^V1ujz6 zE}V*1x5gQ z;D>$gZn#;w*T@ZP;%3fe*KjTF%$XFvY6OQOP8h2bV8t?O!8M9tKoC>MacCo>>icQY z)78(|0=iz)p(k%=qig^fsRWQ zhAN<3J3nM{hB;0JESx3XH=&NzkmLXhabcg8vE%K01hz_AN-7AD6gd(eU=7Y+3;6cl z3$oi#KI)Q>xCq96U|eDn`;%X}Z7cLphEDl~H=80G_Y;HgH!*q`BQl}GKjDKUnMF~d zqPtQjr>}<3fPagZk`d>vMU{vclfO`iKv7eZN2AD*{ix{LE(Ou7%)){LNrjIXbM_}! zO&_sRM-#e2X}{R)KTtKmqJ{_S26-*r$NS~71T*}~3^==5>0*=+g_V`-z?Xrv^c{c4 zRKs}F_5AOmnM1BzcD{iuA2lcqoVW|g7evUCkVJJBfaxiT0Jn5f!HMDKT#(fGd z9FcHjUnIAk(E~LuguvCR4~W2sUiQ8AUu|z?n^k_pZg9>2+s7ceJnf~UdDn4whetz`nye3AT4W%QNi%*W( z8TVCpFzJ}Lt)Ig#_b<#^l2}Q3wq?oVnlc}++o|1eXlcK|ycn7{!{jKyG4uui^2iX~GN zFdv3mp{)6)_El~UC7};Z4hz3C&jJ1@pg(ipo78d;&0_#q{Lf^?sqvm7R-` zkaLFV(a93fnqY(kCvr;y%tGCq-K(;4X5{*&boI4n3ssq&t1o0QkX_Ipe`zOIkP+tT z9X0G&q(`iEBl2T*1kFPo*|XIC?97xVxwPrF7kUMRXnw_f;Xqa348jc*4MvgEf%$=* zC~BUP%6EOn#4xA=vkzFLq2K=MD}8Br73d$`cMsgfbD|CtkLDC>ocOB@1mI79!ww8H zMHr=1livV?E1+>8>E(uD+wbhpzBk0Ac!eqqB}6UBVGf^S4*Ydoc+hR9#F0@b1a^!0Dx@ss3eL<1D@9uS29 z0SS<_1dVW$hGj7_0;_?OgX0g(J^|O3HS9p9K-iA&0JWy6X~GUO+#+&$$^KIf5mC{u zSi0R~O~&zwQ;9W=nj5ndz)kw3_GYYm-bM)F{D|ub-+;}RaD}+}^In|>H3CfwQZ&f1 zvofTQ-6$KaxVjOWr*ZtmXEUx|xT+6&I_%)unwl^HfY%qmkT7=u{z>&z@Yhl95};C+ zyS!r`J;!L00(#vaKt`H(1%uPtHvYNWyg%IhK*;|{B>s9)cu%dHJK_Jm0H+&_b%b6@ z=9$_lrXUqq!pP%ejS*z>WtJkfrH_QT5L2$N!VqiqBn}v2QX&%ED80bsn!e{Kk3u5z z*8@zasjY1t-4Sa|+ePddc4{OdUIiH$n3S;+RBE111VnC|Y-3#eOOdbp;*r)2&mWwM zel)9;7RZ*xNrRD7M94D?L{QKI=IbI%lfN%^w3&a0@(0|NuHxY4eeB#@>!h=v3a!y! zfSc_E=1x0?0!S&?gQk5Jt-jD$Pbr&kQf?=#;8@w7DEW??;!lb%O1Z~ZUrM}@szJNky$YEDtvdEan&V-Yd^$A)V(z4rV=Z}>{FfXR1Tz3~NZ5al)-NW)4H_Ud zY|lB1sFPVEjcbf5Jr2Oru=SxUC!M56!K~>>h7;G`#Vtc& zd3tT%Q*0%Ig;+D<`GR~y>D0zU<13OZFKNr^V+Is)kB6CM6PA8ElgitAj_rTR5oanTdHwv{1JCcAwC}@bxp$ik#-`SHbWmN+4tu)04kLUvHBr7}Ji#eIQSLkb+ra;|2NBP!DT53JKX zU0!FlIj9n|_H{2eyN>#ZvwCrHwJ)L_1O$@57HqV?#t87-VE*PmQBJp4O992gckI!Wzy6n`T=mkQd$UdFy8r!!VdnSEO&F>h zEF(|fAIX&nr1bTK`Wwb&c6Z?2xM`oVDKfOF2oQAd$DMyGF?z;?#v)nv0jyW zZ++y~#9d8Iq%C4}h>wHX+x@gBN9FOSOdZh{JFZBeZh=F?&SV<11@mRd?|^pp4^CUC zVtN?#f zK9H!BQy7J!Dbst#HPWn8Y5$rIabX96d%N@UoK?6rnhjBuk?~9X%QI^7e&`ZG*sZDp z4@6dOF2~ukC+p<}@cGLXY{OaHW?ub_BFbIi=V8eG`~OZ~hd1@$`lwwxP+}mp*K=~R z^x=BIJBS&&M1Q22A+B>sqM$Ra(%TK>&pS(Gh1m@jM=l3_+VKo4?8Bn%eeC7Kr6md| zA@6}GG(~F)y_|RL74q%UK!z(nynaBAF&?VBUT+%k2G|k8iscK8Ho!0n+B`TEhSql1 zeF@-Vm^M;Te(LGBulie>T?QURSe%3nj(|Xv!|MoMHdZuj%52M|MGHhcgof>Jsh?U>yV}C!sL`*`3UM z_xfL2vnjYZ225f*3CQ2dXA+9o?)uTqO`fORR-{IkDWi-ZXe9E+R-s*}>$t6u zICcK($p~zr30jkXNa}2FBk5PygBRj%+w?gCQ8|G(j1MZeF1)ZJEhzA6qZ@gX*7!8; zWF~dK!g7Zz=$pCZYhz6u-DFf`Mlj8OwcGP~!Z3TcbJn#Rxb!O*Z>7Ak8|k_WbZn5h z2>@tNiVH@bTfO-)f5*GJDqFi8z$LYoU4-vGtS@ZOmyH{E7(ma70jJG3VCVyFB0b5h zfy8Wz^EBp3ttHD|&MH+5@y{UTx{NbX-lb?FRBr{7g%Uylr-HDHfTQK<;EfKmo~*k` z1eX>Nb41t@fD!>+$oK7S$nXNb3fNU}1q2`&VU`I4Y(S5o@x+sXTpm7q+>s2*aJ3G2 zazLvi+(rY#66miW7&?XpV(&GWC6*W5o12|&drxm25eA3ZDYEdVGYR?2&RP7C%g9O7 z=ek&V79*dIS)GSX#zeMy8QOtSR25XDok3irO_gu4tKBZJR6V&6T*%j(wxRbdG1#_T zYMsqsi*1z~C@vc0$R)Y!w50MM_ib+dq(4J}*v-g8n$%1~T5ED>IEv~7E+6!68;pp6 z5)hUoe9C?S0l>81gk15RrMZY(7dh1FVT8H0zTO6R0sxc{{LdPzDg3c+HEuA7{QI>e z3HV1q>0Tl}!M5C$k!G`zp-P~_oVmO#`N_+tsL)E>p=tf?(`2Q>X(j}3H6z)Lr;D`I z*Q)jRUC7OaUV(uFIvwYh_Qmf|4zI&#CPv97Bt$0lO?+Y^ICWY<@$~uk_e&Wcn0bG}vEX=QQA(R*z zmIjYQ!e3XfHd1Djv!E2&xJ-prp~b#FTE&zL=MmxQC5=96O-O`xBBiOEB{RDHmo| zKzGS5ld^aR!{OY}ZM2&iT%S-8{z?6GmDtKo?|3vBcVu7oaP$p@KKBWpF_8-AE4Rfa z4s>lzW>>5u6rNn(K}Xbge)Zz9!>~c832pMpz5DzO?LoU=z`y`;rtNKb`JuFt9VO(J zTA-naF28B^OVbcjEpeV(0~=L5vxdd`_Ul*}Fx!rOg_P2F_)I|X21(-OCohu}C0$o{ zcRASZp~HqicMbs{7N~#Q)&l3r;ngvVyCcK~P$23^TkVkd^7jdfNNio z(3&?9{@qSs`Wr7mctC!9h!1c;RMCn(i>*8GSwprB&I%=-9eDhNK{Xgo;amdRQg#mW z(jYU(;2+djc!wTCsWDo`wgIjkIUtz7zgq+gL1Y9KdByA*_!qyz7elrdM$CZz@NhG) zxsc@O#D%aDSLA=)u}F=C4?eL%QLO1K7wx>z zva#^oqasvyF+qh_HC#Sm_mG2=lK9%nr|APDSwla)cdq96Ip6Rz{28LiC=@7n-8$63IPoZ*iJ1E)OUJ1#k*uG17nAcMB@ZQUQ*XvXw z(u1eZ3g!5@oC)E>J0uu1mbuWB+lM_m7UM}hwje=zo}sgUTKGV*_jA74=)Z&7>Y(WY z6h;dVv0p2IF=)pp5iTX@fDPx*pFf{I*_7%9!O;lmFbIqX0eth!MeX>61mzOl35?Vl zy9%N`sr$yM7-K5g9NKHM3&3!O`~L_*u^g~qfGHA=UdYI(l=Mm6;!A}UaQ~ny;QH?! z3b0H%h-5v!eVj*$%eaqC(EPM+5e_#v%O$_Tt~Zx$y2Hj**+06zseqW-YjD+8<13nf z{!>p5`wo~g@P@kbrAoogW*31jJ~eY^spBrB)%_eCRQ!L1Kpq+@WdQX{!e0RJ54dT` zBciPVzsr)k%IxCdeX@~irgTmT0mKBaT>lP>8l#N#bWmGD0Ehu<%pw8pd~zHY7gu8x z=fn9QlLKx*IevF-JNNqidm$kUnBfnGiyD8-qfx}awbJp2`jvBw9a{4(bOtk93>QgS zbLV#?M^=rwez;x$?CadaAHsbgVCCJFp1o7%ctm$vj9UpVR53Np4*IDy zyIFP1e2G>fXSlTVLiN8Br8Fm)wGCdW(n&Z8x;1V*_MuB@gm%#wu&RDMQx3ulj z$UmZA1=Ufg_y#PmH%O|WB7FWjHX?UokjMi#UD!6zf`Y#!B;dIhWM)1ZP8eC!H}vZl zIcg0hHIr~7(-oIUw+Bkq>gp=6*x=0!B@n-1Lj-OA#S6ufu}6%xP>%wHYx6!K|KddpR{U=01Oe-|%E+oIGiq)urywY58w1bQ!i`F>^5>fsvI(Gh;f@v_LG zY`+j3yEYB)p^3YdC%q4W4?sqqz@Rx#4WYl>>3hLY|FwIXO89*PXsac-ekJ8`lF+AJ7ZmuKtAk z-zp8-;WGlcdUk06&Za;aNIPpzOk%X$CtLje5|Eooq$9gBBTZ+^-ArnXG|2O88h*q6 z4CMtVjn`q)0pcTm)uHK)6x{d(DFMhOL#sh>Re{h8kDJ3}-uUj$&jgiE$-xDgAI&4r z%jAd>7cmVzM`$9t#jyk5R5{=qM&V9oIb;8)y|)UB`U~H^hmh`)hQR=o?vzGEKosc^ zq`SLDX(dJJMnVt}knZjhVW^>DXrvqVg5UqWuJ_tU`(Ph#j*MaEJ1d{{tmppR+`z69 ztee0+4ooyhaKHjrLOx*l0CyQ3ZEYYjb9xL11pCE34{*RT;Q=YmRF%9pKfpsr243ZY zqI@v!z(}8VgfzP%oN55s))?-}-d6zMbUOP1d^N!`0;&nYk3k8*K%)aMq<9chpIus) zG`N9P8q^rk3p+iek0OLe=3zpJA?oCd*zB<*KC6mFQ~wyZipKnEo-u&+GB!?5tZprX zLOSii=FvHLBCw}E#pHWuu!sWW0n3&a_jeQVL?$~Hg;YwlE^m`IV1zb&w@SW_3^W6S zx^|8xE zah|+-Kv?NkXR95jH|Oc;36S`}@S=ZcXlP()U;vnH+LLc4Nx(`6tb@FGZM!Exr3$cf09^t|GL&C0!og80 z?+u4{8r*^p+^#Ov7F#9(etI*cDYRZ8W?bP~uUBEY81KkHq#x@8CW-Q_8>CaL;NuFuXC1ys3-xbVQ2++h;j24N% z$~BmD@l1n@UYf*KE^t?Q;_V7E4Hi28J}QV(CUw$&l)4za`uAreIa@RNFrJ)NBjf#F zYY0>OXW#K9Xyjg-3=IHBph1vC2J;)V$y}}LO9}x%J^A+STTV_6m`M2gg37!^Sh86o zz>AI`1nmPj>_%sTf??0V?#x0kR4w>SoXbJ72($=DT7ecB`>hi~-$!w3c;Y@Iu&~Q9u4UjLuRS&4R)Ho}fjPqrF z*oXJpOLLSw`XVHba7b~>W1@#NhskGmZd6{Z+2oQ_;bhdw;{I}osFwPF-riY0F_DyN}ut^FtQ2n zfeJ7a9vy*fnqd9HO5m!70bvvyEPAWcN1k90JQ6uYs>iN&JG)|Pm`TEbW#2MTrh!pi z2ZC`ziA#`^47lAKIXMNX@r7l%1O=Hj9W=<~1O&_Ce!G8k(uc2q8Hkus{KDNyE~ow# z_<<6HfLmiwcWGl6$shqxv4D3Ur)#j)A?k0I9q+NcPNz=(C`{e#Ds&>3 zx~b_#R%$tzYKwJ$Xlzy_)i;`lI|g9}0IebzYXHOXkR(WY0fN z|HnxL>!3hzBY5QJ*c7C;Uhy><=Qj-}&vEue&)&R(f(>xX=y#Aj_qIU2vXPpuN;gXz z0_m)f^shUk5UE#cLnh5ySia-0nwPP z`?5gf8t-?QttzxNQ7MMDMa1fLUm%2#o78Mp|wXfXnWO0gP z`AMfzP|(Z0*Wm9hgJ()^DOS8vb`A44E&U7mhoXi;qzC`!d4`%>o{{f;rdx%05VrF~ zFU6VaIS3%Ylmu-g`Y3I56rjC8!F0oFXQgeT&9bX&i3%Bn(wJwyj6?YJQ5O@?406Pa z@(Ft`cY}-MJw1+ig@?fY&|cPNXmg&IdB=PVc!g;LEZ zR27SzqdI?~(O!-w%XbBIVd-FZOA`Z3x%>A4%_i$-D?r3*>FMcdgP8Hjkr$%u=iMz= zAAouoxQm0FgxsxrtPOxcCV}C7XKW54;@j;{>2WIHSB_Y?^ku5;hX)o&Gi91OKO6lC zx1xYyH$%kQFwan5;TBGa30n#MXbN013I6V|}_6fjf}TxmB4jF?go#`jDyr)zD5{x0hzHU%qF zt9GdyuG5tzz*eTdUQApZ9|G>`Zk@uwVV)4NzihjM5Rc1n7V2RF*J1VM_BPc;u4_!v zEbUIh@7Q$w_N&*cBiCFo>ii@aXy7E+lcabTqX%RD*rt>~`UhI!)@^NLqrk>)6^R5T zpx`=CjzODj#I8!WXnbSCszS$=7J!BgK9tYx5@G}Z@J~?Htmw z$ivUt2$(){ieeimWwSOjTLtMzVDx7N0wLzRyGL+u2B=+P=s@vXvi4lXaaX)!{`=NK z2c;|%TRJ=ds-^7qBPrQ~JkqKcJlbXLicM)EijYrV;s;9wU|k89ad09)^4ex} z_4wDbO`C+#(w$`K;e=HODcLrzv|XNDgdHavTlZ)CGoc@Et!!+zSYQ6J)p3a&WKMRG zk0Ku7*tQDTD&%pxOC#KGIZq>AC>Ik-_I*3n&s{Po^2=3qU+(oj`**qt}T?_7B;ePbl!{MekPH=jkEFd(+Sz9PhB`;G{ z8tP505C3-I3uLB+1|`7v`g1(T)wyO9$ljMFJBEyo|JPdRsL?~od(~e4wJV-HMxv!G z3^Zyo&`Im+Hbn|L@1yeQr$#Qdsc?xk#&nnN&mJuWb=UjLE%xcb%FKsrBHu^lMRGQE zDl98nNEuaMHz*}VMf`ZifJKBg+ovLC&1s#iK11{x_}7A)PJdty--rz>lScySJ~)km z^gId-cvONCow@7dDxi-o;>!}TebZK0oQra+|A*(9 zcU(h0{sF7WUc6qqYB0@UO|E5a@rhg5w8L}CtpNKqMp&kd!2NEM%cOC;3R;NF>lqsi z98a!8L{a-e>$!hpo%TJuHbbfkhms6-|20lOr;O3hzmNBr49y?m^2d(`WP+tAD2*Ay zufBYc(1)tIEX|5}Fu6TL#b(d=G@h874Cg2~-$cK>c(W|PGi0=TwSpI;OG>kBOB`KR z79%vpn6DT2-aDa>-8v8s7-`tA)&vSX6q%7!mC=iyqoJqtY@5_I5jR{JC7usialU`? z;sEf%DF_7&$tw$un&h*Qpfln;f*0!;wElm!0BaDJxP?x9I4>VNy4=0>4FPS9xE}#c+|CC&auE zYv^fq`ig@>$ppH+k7}>FRhv#W)>-shuwJAqXBRwj zZj46WBs3Y9MFcQX$%*Q?IA5J5ielvXYzWXnWveae!2Y)qeY zI7XAuQ@R7*|B|Teh502KG3;rvk){!52ZSePV6CNO_h6nNU%new)* z>ft9$7((zF$*!MAxX&VrEEa~*d%dUME`vTU@-Ev?uKGgOx*yba2(>Rxl^VC?c94V_ zU=FDX#4|2`3rxkH#!yj8*sUjhr_H^D{qEUZ)9xIWBm_#TSAsdf#rSUcF>^&2cBnjD z1^?q9Ii|_?$m$|4SuS5L;q|KNZE2M;AsCT0c5;4i{+mtq#6<8jJzE#K^}0ev&( zBbM~fx|CJgMMu+(3J0!cNB#P2j5Wi0oUrGNAJ;YU(_1NJXurJ?c5)#4!2OR3FTLq#!LdsfU?Jg`KYG&KLi+Syp}55Z?mC^!jn zby9BLxYFb@kWfkbB1_ocV9^ezQr#Z{0DZv%I@y^QrtSmeHnB;k9Fw=EmXl zWEjr)_3X|AYLYg89O_J+v(&?q;1}Jq8DFUP6{mK7%`L#CwkW^Jldv~E3pI#om%(I! z2HKRB$n8Q#J|t)D#!jXn3B~X67GH=)FzgDASUuuQ+0-l zs6=`Z!0*a5-7G4rF7h<%a~Q^}qOP1bo})gZmk!2uWs5;Oq79j&sOaasOfX5`a%iRM ztTF%UfklOi^`H)h?b%_Ize*KkIbD*!W8jB*C6a~$eh~{=_gg^5u}>H&8XRvhPJDGU z*K^=~N{u~0u#^kU$8!VHS;ha6x*AKoE&;0TPIj~@ZMmeO81?hFu_C@ zZ%Sdz>$|V@R61kHuns>mU>Lq(R5d66T59xzv!OK&8;r#)Q){INCqAB1n0K(64rL?m7J@)`$8hoa^yB=8=M?x%WX#w z-cFhatT9d1LLU>H5isyyUhjxVphB7*Wi3m6Pwa}cTxfOgr+ol5AkC)rbg%Y})#OD6 z)WJo5h&in9Amgo#|JmgJHp5KESjJKU9yxkT0#Y!w6jjuH(EeO%bmdnnp7>hLFI5}A zGtc#qIvdlm-!|zGa;l9ah4#H8_z~{?W_#(Ar2`01pBlDg-c~l9n_DVqph>8VZs0$_5al>%RHSC%aMYPV36p&M#d7;HXTplS1i>=fXba!$ zKeP-IOYwbrI2#oq6FYz4daSZ*2PF&-GwF3-$g;0sD@IuSj2n|z8$y0FevZcAm!JMD zVu9;d#TUC-Un`voPeRrI#$Srm!>p$3B!iL;PJeuO;}8C1XeW2->)D&q8^j4?BC7gy zwd*}|$_R^+CW;cltawgN-wWl25j=F%)x`2ka|vWuuH*@du6w+c9UPvU4gI(fpcKcD zg!h<)UA+kH^y+&4FLt%d3voYMJcj1ZKgK95cnl_GLXO?{BZ9~}@+?0{O9|h^?X4z9 zD@v7=(O5q3ZjcWPiO%Gnhc}rlL%ncn{m@8XQ{d>N2%;nf6B>9U+*jGY|H-gS4fw5F zJ)VIkBjr^e^?|Kz&2onSPmvCg4 zdiPi<(;)~LzB9bGp`0EDS%z_B;OC$FsAM)jW`>e|2@)-14r4e)G6oX02{T)ZmUPdq z2NFpe1g=s15n&Xo+7`Bb>0t}gc*qvXpy@2ES}nPD`N4IdB3iA;cDiD_5~*D~o0i}} z$bd464*3AiUlU;%Xf*B_$@;Zw!+}JowD&iT+_ER##51j!5}Wt9!{uR6#!p4T8TTMU z1b=C^%?ejMi!IB1BJ6j&sCL7|3g1-lr<;nSsiaVjXr(pWWYP&=ztO!jjdarJ^RlDdN7!^G=CbZ|8PNPf zFO9q9?r@7%ln7Qet)=su;{JB!K+VTQyrC5`{SZ6SuuTTVZgsaQ3XZs+IUSYAeFrU? zr}-mTl6f);hbv)HX{n7nMLnq-%vQYVACN**czy8Dcl00HGdZ0(*gh{oeAx941t2v~}`*-S6d^Vk63_ ziG(i$u-d(SPecF~$`MBY5Py8U4b(#@%fwlXXzl6(!vAkb7VGERt;Krv9}YvKAEmm@ zptSdv86`sptwd;cP^Bevo_spUdP9Nd$<*@4l1rKD0mjoE8*>Hg0@ghuX{;DG`gS5n zE2(Nxi(aYz4^-Hy;E}Y-%ZIRoZMP8$$h?=-bMhlf#pkuhpNw%JG$cMn&t?zdspw4NG(VFGF&GjmRfx>3oE0x=!U zeTt+G&%V;H89i@Uv4UXSL}fSTsu9hKhX1pmgCbWZ+rN_?sRK%`kbcZy2L<))AOD4TRhU07Xeu_7pW^@?*`J{Exqt zbOT)40+>I@{xvp`Rn{99-s{Lx({a&{4{4LRaU%l6d%S#AHp~t?kTW;!Fb?lp5{q5PtvTaBo9jO*5@8Yb z)X-?C@qAsv%HqM&K1xN8hf>DA*_i2$92;{hwctJ%Rj{R2@QAI8?hEPZU(h!;M!yC8WC-@B`fSxAwOY-@9{Y?YQ!k~i=dCOAE$$YB>1;acW?Zc+L!OHB0n+i4- z3f<3-`dq&nHmCQjEnuSa_ z|I+-MQgDwnVtafS1*Uck;*MwAS&XNgKFxhkee469LY=u4XFc46@T{6#Y zE!^SMOB%SJa=b;g3A{XEGRLjV{lC5yB8SK_w)nA zMo~f9=CWLWZV2XrZB(<>KTy$Y`dfd8@RJfotI>RYdAlm}FgDTfW;Y3=Yz-dotC_Jf zW+8df1ci^e?l>v08L`IMy&iidh@q|kiRf<1d zZOQ3N&4j~T#q$HP{I@e_XYxgh1vBAYV@lM%&xFl&4{b%q`nXXgv1He_s)p-2Is^au zcDlZ*dd|@5=4C{nM;I4JD3#)}gB| zc>F~%PuF7G4HZ&L;}jzVMDrzpZ2LZ&KARKdOi92orU=+w-BbA#rLO! zS4_SA8b|W$K+WkFu^4o@?Rykk-j6?|Zs>0nwbxrFn$|8y1P8q@ z|2_PB`ctu05BkfT7UX8Q5w@X|T-vPHA15_WcuU6{<4lVRcDr*Akv?N?)vvQOYXocf zvdrUHS6TF++lONb5Tg=*Y^(=~ty`)c-(!Z$eX}wjcr_ik!#ezsnW)pN|Rn@bJwPbVi z$1eE!pBM!ZfzbBI!EN?>$7|_A_Xv}a`rD_X{QS))Sg%V&pY~Ob?K6$c_r!*sJo}d} zGVs7ivfYkV)gOQ4SDZRu>GuhG{pZ?gr|g0yEXGFC=cF&UEL-h<&>v zF=sv0*u$-p2v$D%A}_{QN;EkA)oYwzYU`{PY)H6Mgg1`xp`fA!ZJm4e5P=&7R4a9N z(+*31Vu&;}ydz=gE1k;3w*Qxk7Y**%twBLSow3Xj^08-VW{<61;PioZ&vi<^dNV#4 z`j>rs5HTsg?on+$_%-scfIJT&-&sR7KSFtMCc<0bUF7||sy-JH{H7-^BQZSzEYp`j2%Q7&G!21j2v&mQ-^)^>?&s$g-k|W-r0hEVI`#%Z$QVzmw}&px2+Jj;=0B*T8Sozc z%=;=uR3cDQBV37E#8?V)A+fH7^@}ZUjHGoboEH&N`^xP82-WaLC*6nn%>IDtTAY*I z!TYc35!xQS^>q05oiqNMaK5{#ts zjoI!>L13FLi(drA5n3!$DeFNWoldy|rT5L89^!y-TJ`lpcg)1ljpY++d;_np_sH~T!d$JRO|id1WZ@mp zd5=%#bXUlU@u<~G)?;r^RPyEL4BqK;eNTf(2myf!-{A_56&j8kgd2={FJtXc*=5s_ z5(XiYcG1Ko%bGMHq!)7E;oCH&#|?U=boQ7qz^FUKxM9P9FtE6_2OeO2mXT{Lgp>3b zau0_vFr*nm=>?(ZK?%lbVO;aF|5Q71ZQ3M;isBQz!CTWhm4>E5vn_x{DCvQ!zvc6O zf60*;BFPR1aFvx^`>Dw6SF~?b(lwm4hsQBmEh5ML?heQ%=HbqViIiAQ>Ic-eU1hQj z1eN%;gC?la7e+?z9Y*lBMO3}I+3N+jQRmC&1ZP8OBRHO_%a8F`aJ}!La-oDvu?6oX z{A=C}1o|T(R2jo<3QqFvptAy^0j0-2r=iplJ+R@X(}Bj0dr;(;5E&hw%=1IVx{>1I z+NUoS3-5h^FdYX^Ec-YUpeC```%a&4jpi`(7Af%gTxabbQelO_GMlgbu1ffHoD+$p zy9tOOiKv;OUwYTfhMi@tO~+D`$-m*aXufnKrbWNsOupvX+^g=kU3+zQfBTH-WlqJ* z_^+dR+$1{I6U1`w-YGCQ9#XtBgJIDIP1&(VF)YF3HFqWSLfcPs+}n_x8w(2N$FcRB zQ?;EJvW%ZRKE6`f_h>~K2ce3)zXKB4Tvo&U_QTI|*l)wMJT3N>Yw^n^|6;$RvoHU? z@*=YsuKtQSq4TLTs&8*`Zrr*rlugzm>Zt-0l*GNnL&Ww{i5Jl}K{ZIeLgm_ZA@#T;yH z{{CB#LE8Is`tSFo6ck8YX&Fv#W`j?}mqr4j(_QAo+rkj)22Ftl0ygC9UiI0W0kN4kiE?kYLibe!^3eraU z9LCNJ-LN_>phk7T7IKvb9hb^IQR#=+Zif6Ns;`x;cfv$2CZ3jrD*0V5CkOGG&;MJP zU0t5GTdLp`sSC>e19BZvPpNN8ZuF|%Dm)MB)-MPdQ{V8i8YLKts{ZgQ?29z@-1At@ zPH*?$k39|gY{oX58Z()>=_43cN&V)lm4;=gL!aKn5(n zud#~bA;)z$twg(vvXpS$738Nlt8p|ZOVcT`y*;zJYVNInwZ12hS~1+}TN2`zB=29X zR-tR1@6l1T;uPN7fiavg%T|pFQNDtTSO0|(__Be9k}2ZWWH^&A?L&4EFZ&1i`^XDz zMQO#-2{K`EN*K67YwdxFgVKyxDY)p6cDl}Tuevu}fvs9w@i$(_ZBb-}MH)|c`j>!! zWu>H1@AUNKvu2}}cy;<&)w_GI>O1+ALkF{qw;LMMmmSEAndn0puDXTJf=hpY)ie0L zc@$?|hxeNIuc20yyeAjBAE}En*I_L}I2m(^=i9bNDzGV4VN(v+&%%RASs-5mIf z*En03j*!$A%QCH=3ZcT*whDtT>efBnZ9DB0NBKfK8EHTC$UK34LJfpS8q!9ixCso9 zu)y!>*Y0k_oH+~Mn3@a|ElE~+JToI>TcfDkedz3u*SmII?7W|S zXgkqA;xbZ_T16`>J1zv7o26hzC5?_Ay}Gtb6*XUVZdUj7ADQ-ZzBw9CFk>XT_av*z zTGk!9ah=iSfWR5~y)p0i-!>Ugq`SD|9yB9GJED8>E;?I@W&91n^g`zH@p@_*A|gyK z17wP22!}^qV+L5eB9lwMmsXn$i0!3`IZoT!Sve_eLJAWu4pO%c)+2N?Q=V7);fAA4 z5Ct6m_x2|uP&5=s^^9o2h418!gj#l_lReH*thZ+O@I%Z3bgWmf&+``4f!S*h`WrMA5%PVODMjm`Y+mnosIxp2Mlt-~c` zf;F4H?Cwt1vL;1z%V{HI6Ny_lZ%O`6#$!_W3OiI#zoK*h0(!_l0ZD}V39Cck&Sr$keg zYyo@dIFOwW8ih|ggw0($)W}S2!jbz*VD?lKyKZB;lggL( zhf+kmNc)N^-EUepnElgJ(^fzH8ZxI05*y_sf<(6Un%27(`Yv@UmX9PPgf_aiBnUl( zvjtzJe{HmW`%NtLZU%W0i;^wxh&^b~MGJ&<7gc&)L>`4i>1y-|IpY{}@1VRbbhv3e z7`wmXE%DoFa#?iuk;JL$OLMOknSkM_GEV{tD%HDXPOOS<>NGXkKhQ3-WN7|*)Z^LO zW(M)VH;$nGqu^PJTQ)IN^{usmrPR-24^q+=!C8g+n-6aL57#gtFiGyGZ(ynr2*Jh+ zS*f>>v-c1K)JgukxpSPlHn=E{b#GF1H&6|GX+*}`uUNlGM_TAxfh78%;d>=v|8XIo zhdzf1aeVm8}q4;>2m z?`7i>Jq7lx=7g$T1e+&QWYW1QjpX61`_V|ryRA!Vf@=ha3gS{VeYlLrG5O;G|iO z`!;u7Ma7a_IX88l&bkwAE_3%W^AkUiA<_4xM8inHan$7SZXio{uied$!03_Zx39v2 zW`i4K5E4ksGu(Z8VED7U*1@9kz3Vz6p7Xo+|9@}rf433U2+r?;Fou!jVxO&=b4VHs z<+j<&_)8fQpF{sB0HX-M?w}Ah@ULU!Ais(F#@v$(A=u|w$ zy8!Zb7=bKDa8&&~1%xrMK4C}y<7fr{q$E8}1DecF=9?eRm)+Ag8-r4^8B3q=B*1qA zHR;z_L)H~KKp@fA*H^rW3NxMte*k|4z7Nj=pstfUkEmD(&(&S(J)(gH{iF@>(gBsc z0H8i}0PJbp>VUpahaJ?V?V}p}TgRq?fB{P7A^m%L8PRJ%ffPxEeY|IW;`8>G^~Mw1&C#VsP+!_f~Yf}t|S7E^?QAsO#mhc z^fr4Qdg|(sj2&8@0x$u1z-7mP*#VHz0D(@=ZMhaGrXB)oKQ;c^%gxKX`4=K_3Ahgz?t=DlnwoT7F*nOXgFuy0qjyUY?(bKs(Yx;8 z^m7Dyk-SLNXvD*&#vwg{c;ajq@F4(^@bvs>6Zn4|1oSN-L4(S+ z1OC(Jcb81m5pS+UKfJavW!b~4x)v5iMRy?_loB=C{%2i|cu7}Vw>74AIP}v}fcjRn zlYVoF1ehh8P|?tC%Gjg4P+%eq$Tny2rt2e6FFazwM~O%9c7c6zGB`liC2!u=Jpduu zu2XajN`SA=hWs0yk&)q|)8cQlM@|9fzO}NC(ffIVbU`(EzZn<1D6Y*>LL{ZjmF>T zxcGSB`8*2bCBP(Y9uXx2H#(qopKQxpLpZv+9sxILAUrDGw4=-?kv=So^ug(Jyw%&> zq9=eq5_N>#{qp75H;bOnyw60(FHoR{?rwpznY* zIt?8a1q|zJv>*|J=LY7!oDfL<*FJd3yDGNAoAh96&|0G}1&TMp1Od!-L zKaMa?^s$v)O?!{C@tnFl(&hnCPUnNP^IsJ@x4Z`+MSDYL+SYXZuEF-?`*Ox1Ct_;NhgZf=u|AD| z3#12NFo(Qm_dI(jLukxKgoPd;CHLB}aOt?FE@MrBM&wGu8Y;{44OG&$T|0ko=QRN< z5Afv$P{GO+3z6>Nd^}HNosE9)uO(-(1Hj3z5&`gmTSJX8`zBldb$!&`d5*S0-yHkWoHP{n|sI zgIX7Wjp3P3V}Rdl&Onl(Xi%wti_!<{A!enC`AZqi;Ch6< zTfxlCs&JaUTkYi{s7VFbbFahvvf8N|mSm(Y3Ir*Zs&WHn%{8dZ)@329^v*I8HZ$P2 zeyZ$Zdo3(}WDfWL1ziLPSn;9c)YKyQrf%e?;}S;*1b8c&OI%Fa`yJ5ed~10i>0hBF6-!_m-?}8N@%+Hm-i+Lo| z9^^YrX`9*x0yBrmM21XUNFY&*;Xklo+`g*4y*;?lxidj;x7k&H=zvdI6wve}F54sk zmD835HQR`thbOZ@o54Ke0Al$>$xCjV3cx8I9gc&8yQe*)vYMK2J;wr zet-7A?s(;YK6-!dy|j(azms)$;bFv7dfp4ad%bFbL@5V=bd!FyWnLC(?&Vc0sHT66 z+uL;IcLU^Yen*AiaIg>p@KYkL-T8}PrU3ynAdpL}X-XRuBZWS1uYB?Hu07r5om-hq zH|CTmMpnO^>w094d_;oXG`H)SR?mb9=}gGA{2&Ru^HRVDdg~G{akH5I&U>4GlrR10 z+wOJHHiGVW1=;BCEBqj#%q&pQAUR!im6m92XN?`#t7CJD(3c|hb2mCE> z_T!tjTp!upWCY^nOioS$P@NixIM9?MZ2=AN34PQnWo2K`UBE-{>C>k`+NeI}A?A1b z?{>t37Zj+nbdOcJPfFu!u1>5U53?2r>OYUgZ~OS*$4P0RbS6;Bb-phJvR%FZWS8JQ zBA0-SC@LLz#{Z0UTb_Uv{L?wWjt<_=!&`F)R92P}B zYGrdCP_9pjrTXGxN8EZws=a0C`PH6@Eiuy00`LMn1d_!8FBB+8YxLs6fbiz~=(-6H z6&Cu$XZ&Cip3^n57u^o?DZn*Zm4)xwGrQ?Zq-SV8pv4q~JJ(YBPX-^7cJ2VQxg~In z2C5xkZR1E=Gn4q3&b)QO_ zZ@*l9GjshyS~#~pTrm7uH2;3KpU(Zk16uvIS1N~_ciGzg)*lNNAP?Fn<9<&PGAv0fg=Np2B;S-}`T=|lT=a-)v^rdeD zeEArge$$LSv7xe`K=W0m6S)o8V3fI*Kom7w3&b2c*wBmHQ;^A5u-^Ws!vrc@03Wdt zVDJ0m>I<|1fDZy_R#m9@IrP%+KurHe849worOAvOvo%w1Z(VFQ0^WZ?(8P#>sG-@O8GUto& zG!S;B577jpw3TbJK$mM+A^(ox?-&mI7z3jls)W0+pkR-_#ff2p)OqB=?Mwp5xGS2^ zZ{i7|+2(GyKNNt;;5}S&TYmG&AQCjSBkeQ*fmE7mmo;|rDXXim;Ipg|@$6sw$8_#~ V;a--02J~}~7ji1H#nOf!{}-cxT4n$M literal 0 HcmV?d00001 diff --git a/Studium.md b/Studium.md new file mode 100644 index 0000000..1d74fc6 --- /dev/null +++ b/Studium.md @@ -0,0 +1,7 @@ +> [!INFO] +> **Semester**: `#1` - WiSe 25/26 +> **Kurse**: +> - *DAS*: Diskrete Algebraische Strukturen +> - *ET* +> + diff --git a/mathe/notation.md b/mathe/notation.md new file mode 100644 index 0000000..de64d79 --- /dev/null +++ b/mathe/notation.md @@ -0,0 +1,5 @@ +# Notation + +## 1. Sets and Logic +$|A|$: The *cardinality* (size) of finite set $A$. +$script(p)$