UNPKG

create-mock-backend

Version:

This is npx starter package for installing your favourite backend template for mockBee.

1,821 lines 508 kB
"use strict"; var t = require("os"), e = require("tty"), r = require("fs"), i = require("path"), s = require("events"), n = require("stream"), o = require("string_decoder"), a = require("assert"), l = require("buffer"), c = require("zlib"), h = require("util"), u = require("crypto"), d = require("constants"), f = require("https"), p = require("child_process"), m = require("url"), y = require("net"), g = require("tls"), b = require("readline"); function v(t) { return t && "object" == typeof t && "default" in t ? t : { default: t }; } var w = v(t), S = v(e), E = v(r), O = v(i), _ = v(s), x = v(n), k = v(o), T = v(a), C = v(l), R = v(c), I = v(h), M = v(u), A = v(d), P = v(f), N = v(p), D = v(m), L = v(y), j = v(g), F = v(b), $ = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}; var B = { exports: {} }; const G = { 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], }, U = {}; for (const t of Object.keys(G)) U[G[t]] = t; const z = { 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"] }, }; var H = z; for (const t of Object.keys(z)) { if (!("channels" in z[t])) throw new Error("missing channels property: " + t); if (!("labels" in z[t])) throw new Error("missing channel labels property: " + t); if (z[t].labels.length !== z[t].channels) throw new Error("channel and label counts mismatch: " + t); const { channels: e, labels: r } = z[t]; delete z[t].channels, delete z[t].labels, Object.defineProperty(z[t], "channels", { value: e }), Object.defineProperty(z[t], "labels", { value: r }); } function Y(t, e) { return (t[0] - e[0]) ** 2 + (t[1] - e[1]) ** 2 + (t[2] - e[2]) ** 2; } (z.rgb.hsl = function (t) { const e = t[0] / 255, r = t[1] / 255, i = t[2] / 255, s = Math.min(e, r, i), n = Math.max(e, r, i), o = n - s; let a, l; n === s ? (a = 0) : e === n ? (a = (r - i) / o) : r === n ? (a = 2 + (i - e) / o) : i === n && (a = 4 + (e - r) / o), (a = Math.min(60 * a, 360)), a < 0 && (a += 360); const c = (s + n) / 2; return ( (l = n === s ? 0 : c <= 0.5 ? o / (n + s) : o / (2 - n - s)), [a, 100 * l, 100 * c] ); }), (z.rgb.hsv = function (t) { let e, r, i, s, n; const o = t[0] / 255, a = t[1] / 255, l = t[2] / 255, c = Math.max(o, a, l), h = c - Math.min(o, a, l), u = function (t) { return (c - t) / 6 / h + 0.5; }; return ( 0 === h ? ((s = 0), (n = 0)) : ((n = h / c), (e = u(o)), (r = u(a)), (i = u(l)), o === c ? (s = i - r) : a === c ? (s = 1 / 3 + e - i) : l === c && (s = 2 / 3 + r - e), s < 0 ? (s += 1) : s > 1 && (s -= 1)), [360 * s, 100 * n, 100 * c] ); }), (z.rgb.hwb = function (t) { const e = t[0], r = t[1]; let i = t[2]; const s = z.rgb.hsl(t)[0], n = (1 / 255) * Math.min(e, Math.min(r, i)); return ( (i = 1 - (1 / 255) * Math.max(e, Math.max(r, i))), [s, 100 * n, 100 * i] ); }), (z.rgb.cmyk = function (t) { const e = t[0] / 255, r = t[1] / 255, i = t[2] / 255, s = Math.min(1 - e, 1 - r, 1 - i); return [ 100 * ((1 - e - s) / (1 - s) || 0), 100 * ((1 - r - s) / (1 - s) || 0), 100 * ((1 - i - s) / (1 - s) || 0), 100 * s, ]; }), (z.rgb.keyword = function (t) { const e = U[t]; if (e) return e; let r, i = 1 / 0; for (const e of Object.keys(G)) { const s = Y(t, G[e]); s < i && ((i = s), (r = e)); } return r; }), (z.keyword.rgb = function (t) { return G[t]; }), (z.rgb.xyz = function (t) { let e = t[0] / 255, r = t[1] / 255, i = t[2] / 255; (e = e > 0.04045 ? ((e + 0.055) / 1.055) ** 2.4 : e / 12.92), (r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92), (i = i > 0.04045 ? ((i + 0.055) / 1.055) ** 2.4 : i / 12.92); return [ 100 * (0.4124 * e + 0.3576 * r + 0.1805 * i), 100 * (0.2126 * e + 0.7152 * r + 0.0722 * i), 100 * (0.0193 * e + 0.1192 * r + 0.9505 * i), ]; }), (z.rgb.lab = function (t) { const e = z.rgb.xyz(t); let r = e[0], i = e[1], s = e[2]; (r /= 95.047), (i /= 100), (s /= 108.883), (r = r > 0.008856 ? r ** (1 / 3) : 7.787 * r + 16 / 116), (i = i > 0.008856 ? i ** (1 / 3) : 7.787 * i + 16 / 116), (s = s > 0.008856 ? s ** (1 / 3) : 7.787 * s + 16 / 116); return [116 * i - 16, 500 * (r - i), 200 * (i - s)]; }), (z.hsl.rgb = function (t) { const e = t[0] / 360, r = t[1] / 100, i = t[2] / 100; let s, n, o; if (0 === r) return (o = 255 * i), [o, o, o]; s = i < 0.5 ? i * (1 + r) : i + r - i * r; const a = 2 * i - s, l = [0, 0, 0]; for (let t = 0; t < 3; t++) (n = e + (1 / 3) * -(t - 1)), n < 0 && n++, n > 1 && n--, (o = 6 * n < 1 ? a + 6 * (s - a) * n : 2 * n < 1 ? s : 3 * n < 2 ? a + (s - a) * (2 / 3 - n) * 6 : a), (l[t] = 255 * o); return l; }), (z.hsl.hsv = function (t) { const e = t[0]; let r = t[1] / 100, i = t[2] / 100, s = r; const n = Math.max(i, 0.01); (i *= 2), (r *= i <= 1 ? i : 2 - i), (s *= n <= 1 ? n : 2 - n); return [ e, 100 * (0 === i ? (2 * s) / (n + s) : (2 * r) / (i + r)), 100 * ((i + r) / 2), ]; }), (z.hsv.rgb = function (t) { const e = t[0] / 60, r = t[1] / 100; let i = t[2] / 100; const s = Math.floor(e) % 6, n = e - Math.floor(e), o = 255 * i * (1 - r), a = 255 * i * (1 - r * n), l = 255 * i * (1 - r * (1 - n)); switch (((i *= 255), s)) { case 0: return [i, l, o]; case 1: return [a, i, o]; case 2: return [o, i, l]; case 3: return [o, a, i]; case 4: return [l, o, i]; case 5: return [i, o, a]; } }), (z.hsv.hsl = function (t) { const e = t[0], r = t[1] / 100, i = t[2] / 100, s = Math.max(i, 0.01); let n, o; o = (2 - r) * i; const a = (2 - r) * s; return ( (n = r * s), (n /= a <= 1 ? a : 2 - a), (n = n || 0), (o /= 2), [e, 100 * n, 100 * o] ); }), (z.hwb.rgb = function (t) { const e = t[0] / 360; let r = t[1] / 100, i = t[2] / 100; const s = r + i; let n; s > 1 && ((r /= s), (i /= s)); const o = Math.floor(6 * e), a = 1 - i; (n = 6 * e - o), 0 != (1 & o) && (n = 1 - n); const l = r + n * (a - r); let c, h, u; switch (o) { default: (c = a), (h = l), (u = r); break; case 1: (c = l), (h = a), (u = r); break; case 2: (c = r), (h = a), (u = l); break; case 3: (c = r), (h = l), (u = a); break; case 4: (c = l), (h = r), (u = a); break; case 5: (c = a), (h = r), (u = l); } return [255 * c, 255 * h, 255 * u]; }), (z.cmyk.rgb = function (t) { const e = t[0] / 100, r = t[1] / 100, i = t[2] / 100, s = t[3] / 100; return [ 255 * (1 - Math.min(1, e * (1 - s) + s)), 255 * (1 - Math.min(1, r * (1 - s) + s)), 255 * (1 - Math.min(1, i * (1 - s) + s)), ]; }), (z.xyz.rgb = function (t) { const e = t[0] / 100, r = t[1] / 100, i = t[2] / 100; let s, n, o; return ( (s = 3.2406 * e + -1.5372 * r + -0.4986 * i), (n = -0.9689 * e + 1.8758 * r + 0.0415 * i), (o = 0.0557 * e + -0.204 * r + 1.057 * i), (s = s > 0.0031308 ? 1.055 * s ** (1 / 2.4) - 0.055 : 12.92 * s), (n = n > 0.0031308 ? 1.055 * n ** (1 / 2.4) - 0.055 : 12.92 * n), (o = o > 0.0031308 ? 1.055 * o ** (1 / 2.4) - 0.055 : 12.92 * o), (s = Math.min(Math.max(0, s), 1)), (n = Math.min(Math.max(0, n), 1)), (o = Math.min(Math.max(0, o), 1)), [255 * s, 255 * n, 255 * o] ); }), (z.xyz.lab = function (t) { let e = t[0], r = t[1], i = t[2]; (e /= 95.047), (r /= 100), (i /= 108.883), (e = e > 0.008856 ? e ** (1 / 3) : 7.787 * e + 16 / 116), (r = r > 0.008856 ? r ** (1 / 3) : 7.787 * r + 16 / 116), (i = i > 0.008856 ? i ** (1 / 3) : 7.787 * i + 16 / 116); return [116 * r - 16, 500 * (e - r), 200 * (r - i)]; }), (z.lab.xyz = function (t) { let e, r, i; (r = (t[0] + 16) / 116), (e = t[1] / 500 + r), (i = r - t[2] / 200); const s = r ** 3, n = e ** 3, o = i ** 3; return ( (r = s > 0.008856 ? s : (r - 16 / 116) / 7.787), (e = n > 0.008856 ? n : (e - 16 / 116) / 7.787), (i = o > 0.008856 ? o : (i - 16 / 116) / 7.787), (e *= 95.047), (r *= 100), (i *= 108.883), [e, r, i] ); }), (z.lab.lch = function (t) { const e = t[0], r = t[1], i = t[2]; let s; (s = (360 * Math.atan2(i, r)) / 2 / Math.PI), s < 0 && (s += 360); return [e, Math.sqrt(r * r + i * i), s]; }), (z.lch.lab = function (t) { const e = t[0], r = t[1], i = (t[2] / 360) * 2 * Math.PI; return [e, r * Math.cos(i), r * Math.sin(i)]; }), (z.rgb.ansi16 = function (t, e = null) { const [r, i, s] = t; let n = null === e ? z.rgb.hsv(t)[2] : e; if (((n = Math.round(n / 50)), 0 === n)) return 30; let o = 30 + ((Math.round(s / 255) << 2) | (Math.round(i / 255) << 1) | Math.round(r / 255)); return 2 === n && (o += 60), o; }), (z.hsv.ansi16 = function (t) { return z.rgb.ansi16(z.hsv.rgb(t), t[2]); }), (z.rgb.ansi256 = function (t) { const e = t[0], r = t[1], i = t[2]; if (e === r && r === i) return e < 8 ? 16 : e > 248 ? 231 : Math.round(((e - 8) / 247) * 24) + 232; return ( 16 + 36 * Math.round((e / 255) * 5) + 6 * Math.round((r / 255) * 5) + Math.round((i / 255) * 5) ); }), (z.ansi16.rgb = function (t) { let e = t % 10; if (0 === e || 7 === e) return t > 50 && (e += 3.5), (e = (e / 10.5) * 255), [e, e, e]; const r = 0.5 * (1 + ~~(t > 50)); return [ (1 & e) * r * 255, ((e >> 1) & 1) * r * 255, ((e >> 2) & 1) * r * 255, ]; }), (z.ansi256.rgb = function (t) { if (t >= 232) { const e = 10 * (t - 232) + 8; return [e, e, e]; } let e; t -= 16; return [ (Math.floor(t / 36) / 5) * 255, (Math.floor((e = t % 36) / 6) / 5) * 255, ((e % 6) / 5) * 255, ]; }), (z.rgb.hex = function (t) { const e = ( ((255 & Math.round(t[0])) << 16) + ((255 & Math.round(t[1])) << 8) + (255 & Math.round(t[2])) ) .toString(16) .toUpperCase(); return "000000".substring(e.length) + e; }), (z.hex.rgb = function (t) { const e = t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!e) return [0, 0, 0]; let r = e[0]; 3 === e[0].length && (r = r .split("") .map((t) => t + t) .join("")); const i = parseInt(r, 16); return [(i >> 16) & 255, (i >> 8) & 255, 255 & i]; }), (z.rgb.hcg = function (t) { const e = t[0] / 255, r = t[1] / 255, i = t[2] / 255, s = Math.max(Math.max(e, r), i), n = Math.min(Math.min(e, r), i), o = s - n; let a, l; return ( (a = o < 1 ? n / (1 - o) : 0), (l = o <= 0 ? 0 : s === e ? ((r - i) / o) % 6 : s === r ? 2 + (i - e) / o : 4 + (e - r) / o), (l /= 6), (l %= 1), [360 * l, 100 * o, 100 * a] ); }), (z.hsl.hcg = function (t) { const e = t[1] / 100, r = t[2] / 100, i = r < 0.5 ? 2 * e * r : 2 * e * (1 - r); let s = 0; return i < 1 && (s = (r - 0.5 * i) / (1 - i)), [t[0], 100 * i, 100 * s]; }), (z.hsv.hcg = function (t) { const e = t[1] / 100, r = t[2] / 100, i = e * r; let s = 0; return i < 1 && (s = (r - i) / (1 - i)), [t[0], 100 * i, 100 * s]; }), (z.hcg.rgb = function (t) { const e = t[0] / 360, r = t[1] / 100, i = t[2] / 100; if (0 === r) return [255 * i, 255 * i, 255 * i]; const s = [0, 0, 0], n = (e % 1) * 6, o = n % 1, a = 1 - o; let l = 0; switch (Math.floor(n)) { case 0: (s[0] = 1), (s[1] = o), (s[2] = 0); break; case 1: (s[0] = a), (s[1] = 1), (s[2] = 0); break; case 2: (s[0] = 0), (s[1] = 1), (s[2] = o); break; case 3: (s[0] = 0), (s[1] = a), (s[2] = 1); break; case 4: (s[0] = o), (s[1] = 0), (s[2] = 1); break; default: (s[0] = 1), (s[1] = 0), (s[2] = a); } return ( (l = (1 - r) * i), [255 * (r * s[0] + l), 255 * (r * s[1] + l), 255 * (r * s[2] + l)] ); }), (z.hcg.hsv = function (t) { const e = t[1] / 100, r = e + (t[2] / 100) * (1 - e); let i = 0; return r > 0 && (i = e / r), [t[0], 100 * i, 100 * r]; }), (z.hcg.hsl = function (t) { const e = t[1] / 100, r = (t[2] / 100) * (1 - e) + 0.5 * e; let i = 0; return ( r > 0 && r < 0.5 ? (i = e / (2 * r)) : r >= 0.5 && r < 1 && (i = e / (2 * (1 - r))), [t[0], 100 * i, 100 * r] ); }), (z.hcg.hwb = function (t) { const e = t[1] / 100, r = e + (t[2] / 100) * (1 - e); return [t[0], 100 * (r - e), 100 * (1 - r)]; }), (z.hwb.hcg = function (t) { const e = t[1] / 100, r = 1 - t[2] / 100, i = r - e; let s = 0; return i < 1 && (s = (r - i) / (1 - i)), [t[0], 100 * i, 100 * s]; }), (z.apple.rgb = function (t) { return [(t[0] / 65535) * 255, (t[1] / 65535) * 255, (t[2] / 65535) * 255]; }), (z.rgb.apple = function (t) { return [(t[0] / 255) * 65535, (t[1] / 255) * 65535, (t[2] / 255) * 65535]; }), (z.gray.rgb = function (t) { return [(t[0] / 100) * 255, (t[0] / 100) * 255, (t[0] / 100) * 255]; }), (z.gray.hsl = function (t) { return [0, 0, t[0]]; }), (z.gray.hsv = z.gray.hsl), (z.gray.hwb = function (t) { return [0, 100, t[0]]; }), (z.gray.cmyk = function (t) { return [0, 0, 0, t[0]]; }), (z.gray.lab = function (t) { return [t[0], 0, 0]; }), (z.gray.hex = function (t) { const e = 255 & Math.round((t[0] / 100) * 255), r = ((e << 16) + (e << 8) + e).toString(16).toUpperCase(); return "000000".substring(r.length) + r; }), (z.rgb.gray = function (t) { return [((t[0] + t[1] + t[2]) / 3 / 255) * 100]; }); const V = H; function q(t) { const e = (function () { const t = {}, e = Object.keys(V); for (let r = e.length, i = 0; i < r; i++) t[e[i]] = { distance: -1, parent: null }; return t; })(), r = [t]; for (e[t].distance = 0; r.length; ) { const t = r.pop(), i = Object.keys(V[t]); for (let s = i.length, n = 0; n < s; n++) { const s = i[n], o = e[s]; -1 === o.distance && ((o.distance = e[t].distance + 1), (o.parent = t), r.unshift(s)); } } return e; } function W(t, e) { return function (r) { return e(t(r)); }; } function Z(t, e) { const r = [e[t].parent, t]; let i = V[e[t].parent][t], s = e[t].parent; for (; e[s].parent; ) r.unshift(e[s].parent), (i = W(V[e[s].parent][s], i)), (s = e[s].parent); return (i.conversion = r), i; } const K = H, J = function (t) { const e = q(t), r = {}, i = Object.keys(e); for (let t = i.length, s = 0; s < t; s++) { const t = i[s]; null !== e[t].parent && (r[t] = Z(t, e)); } return r; }, X = {}; Object.keys(K).forEach((t) => { (X[t] = {}), Object.defineProperty(X[t], "channels", { value: K[t].channels }), Object.defineProperty(X[t], "labels", { value: K[t].labels }); const e = J(t); Object.keys(e).forEach((r) => { const i = e[r]; (X[t][r] = (function (t) { const e = function (...e) { const r = e[0]; if (null == r) return r; r.length > 1 && (e = r); const i = t(e); if ("object" == typeof i) for (let t = i.length, e = 0; e < t; e++) i[e] = Math.round(i[e]); return i; }; return "conversion" in t && (e.conversion = t.conversion), e; })(i)), (X[t][r].raw = (function (t) { const e = function (...e) { const r = e[0]; return null == r ? r : (r.length > 1 && (e = r), t(e)); }; return "conversion" in t && (e.conversion = t.conversion), e; })(i)); }); }); var Q = X; !(function (t) { const e = (t, e) => (...r) => `[${t(...r) + e}m`, r = (t, e) => (...r) => { const i = t(...r); return `[${38 + e};5;${i}m`; }, i = (t, e) => (...r) => { const i = t(...r); return `[${38 + e};2;${i[0]};${i[1]};${i[2]}m`; }, s = (t) => t, n = (t, e, r) => [t, e, r], o = (t, e, r) => { Object.defineProperty(t, e, { get: () => { const i = r(); return ( Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, }), i ); }, enumerable: !0, configurable: !0, }); }; let a; const l = (t, e, r, i) => { void 0 === a && (a = Q); const s = i ? 10 : 0, n = {}; for (const [i, o] of Object.entries(a)) { const a = "ansi16" === i ? "ansi" : i; i === e ? (n[a] = t(r, s)) : "object" == typeof o && (n[a] = t(o[e], s)); } return n; }; Object.defineProperty(t, "exports", { enumerable: !0, get: function () { const t = new Map(), a = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29], }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39], }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49], }, }; (a.color.gray = a.color.blackBright), (a.bgColor.bgGray = a.bgColor.bgBlackBright), (a.color.grey = a.color.blackBright), (a.bgColor.bgGrey = a.bgColor.bgBlackBright); for (const [e, r] of Object.entries(a)) { for (const [e, i] of Object.entries(r)) (a[e] = { open: `[${i[0]}m`, close: `[${i[1]}m` }), (r[e] = a[e]), t.set(i[0], i[1]); Object.defineProperty(a, e, { value: r, enumerable: !1 }); } return ( Object.defineProperty(a, "codes", { value: t, enumerable: !1 }), (a.color.close = ""), (a.bgColor.close = ""), o(a.color, "ansi", () => l(e, "ansi16", s, !1)), o(a.color, "ansi256", () => l(r, "ansi256", s, !1)), o(a.color, "ansi16m", () => l(i, "rgb", n, !1)), o(a.bgColor, "ansi", () => l(e, "ansi16", s, !0)), o(a.bgColor, "ansi256", () => l(r, "ansi256", s, !0)), o(a.bgColor, "ansi16m", () => l(i, "rgb", n, !0)), a ); }, }); })(B); const tt = w.default, et = S.default, rt = (t, e = process.argv) => { const r = t.startsWith("-") ? "" : 1 === t.length ? "-" : "--", i = e.indexOf(r + t), s = e.indexOf("--"); return -1 !== i && (-1 === s || i < s); }, { env: it } = process; let st; function nt(t) { return 0 !== t && { level: t, hasBasic: !0, has256: t >= 2, has16m: t >= 3 }; } function ot(t, e) { if (0 === st) return 0; if (rt("color=16m") || rt("color=full") || rt("color=truecolor")) return 3; if (rt("color=256")) return 2; if (t && !e && void 0 === st) return 0; const r = st || 0; if ("dumb" === it.TERM) return r; if ("win32" === process.platform) { const t = tt.release().split("."); return Number(t[0]) >= 10 && Number(t[2]) >= 10586 ? Number(t[2]) >= 14931 ? 3 : 2 : 1; } if ("CI" in it) return [ "TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", ].some((t) => t in it) || "codeship" === it.CI_NAME ? 1 : r; if ("TEAMCITY_VERSION" in it) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(it.TEAMCITY_VERSION) ? 1 : 0; if ("truecolor" === it.COLORTERM) return 3; if ("TERM_PROGRAM" in it) { const t = parseInt((it.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (it.TERM_PROGRAM) { case "iTerm.app": return t >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } } return /-256(color)?$/i.test(it.TERM) ? 2 : /^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test( it.TERM ) || "COLORTERM" in it ? 1 : r; } rt("no-color") || rt("no-colors") || rt("color=false") || rt("color=never") ? (st = 0) : (rt("color") || rt("colors") || rt("color=true") || rt("color=always")) && (st = 1), "FORCE_COLOR" in it && (st = "true" === it.FORCE_COLOR ? 1 : "false" === it.FORCE_COLOR ? 0 : 0 === it.FORCE_COLOR.length ? 1 : Math.min(parseInt(it.FORCE_COLOR, 10), 3)); var at = { supportsColor: function (t) { return nt(ot(t, t && t.isTTY)); }, stdout: nt(ot(!0, et.isatty(1))), stderr: nt(ot(!0, et.isatty(2))), }; var lt = { stringReplaceAll: (t, e, r) => { let i = t.indexOf(e); if (-1 === i) return t; const s = e.length; let n = 0, o = ""; do { (o += t.substr(n, i - n) + e + r), (n = i + s), (i = t.indexOf(e, n)); } while (-1 !== i); return (o += t.substr(n)), o; }, stringEncaseCRLFWithFirstIndex: (t, e, r, i) => { let s = 0, n = ""; do { const o = "\r" === t[i - 1]; (n += t.substr(s, (o ? i - 1 : i) - s) + e + (o ? "\r\n" : "\n") + r), (s = i + 1), (i = t.indexOf("\n", s)); } while (-1 !== i); return (n += t.substr(s)), n; }, }; const ct = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi, ht = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g, ut = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/, dt = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi, ft = new Map([ ["n", "\n"], ["r", "\r"], ["t", "\t"], ["b", "\b"], ["f", "\f"], ["v", "\v"], ["0", "\0"], ["\\", "\\"], ["e", ""], ["a", ""], ]); function pt(t) { const e = "u" === t[0], r = "{" === t[1]; return (e && !r && 5 === t.length) || ("x" === t[0] && 3 === t.length) ? String.fromCharCode(parseInt(t.slice(1), 16)) : e && r ? String.fromCodePoint(parseInt(t.slice(2, -1), 16)) : ft.get(t) || t; } function mt(t, e) { const r = [], i = e.trim().split(/\s*,\s*/g); let s; for (const e of i) { const i = Number(e); if (Number.isNaN(i)) { if (!(s = e.match(ut))) throw new Error( `Invalid Chalk template style argument: ${e} (in style '${t}')` ); r.push(s[2].replace(dt, (t, e, r) => (e ? pt(e) : r))); } else r.push(i); } return r; } function yt(t) { ht.lastIndex = 0; const e = []; let r; for (; null !== (r = ht.exec(t)); ) { const t = r[1]; if (r[2]) { const i = mt(t, r[2]); e.push([t].concat(i)); } else e.push([t]); } return e; } function gt(t, e) { const r = {}; for (const t of e) for (const e of t.styles) r[e[0]] = t.inverse ? null : e.slice(1); let i = t; for (const [t, e] of Object.entries(r)) if (Array.isArray(e)) { if (!(t in i)) throw new Error(`Unknown Chalk style: ${t}`); i = e.length > 0 ? i[t](...e) : i[t]; } return i; } var bt = (t, e) => { const r = [], i = []; let s = []; if ( (e.replace(ct, (e, n, o, a, l, c) => { if (n) s.push(pt(n)); else if (a) { const e = s.join(""); (s = []), i.push(0 === r.length ? e : gt(t, r)(e)), r.push({ inverse: o, styles: yt(a) }); } else if (l) { if (0 === r.length) throw new Error("Found extraneous } in Chalk template literal"); i.push(gt(t, r)(s.join(""))), (s = []), r.pop(); } else s.push(c); }), i.push(s.join("")), r.length > 0) ) { const t = `Chalk template literal is missing ${r.length} closing bracket${ 1 === r.length ? "" : "s" } (\`}\`)`; throw new Error(t); } return i.join(""); }; const vt = B.exports, { stdout: wt, stderr: St } = at, { stringReplaceAll: Et, stringEncaseCRLFWithFirstIndex: Ot } = lt, { isArray: _t } = Array, xt = ["ansi", "ansi", "ansi256", "ansi16m"], kt = Object.create(null); class Tt { constructor(t) { return Ct(t); } } const Ct = (t) => { const e = {}; return ( ((t, e = {}) => { if ( e.level && !(Number.isInteger(e.level) && e.level >= 0 && e.level <= 3) ) throw new Error("The `level` option should be an integer from 0 to 3"); const r = wt ? wt.level : 0; t.level = void 0 === e.level ? r : e.level; })(e, t), (e.template = (...t) => Lt(e.template, ...t)), Object.setPrototypeOf(e, Rt.prototype), Object.setPrototypeOf(e.template, e), (e.template.constructor = () => { throw new Error( "`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead." ); }), (e.template.Instance = Tt), e.template ); }; function Rt(t) { return Ct(t); } for (const [t, e] of Object.entries(vt)) kt[t] = { get() { const r = Pt(this, At(e.open, e.close, this._styler), this._isEmpty); return Object.defineProperty(this, t, { value: r }), r; }, }; kt.visible = { get() { const t = Pt(this, this._styler, !0); return Object.defineProperty(this, "visible", { value: t }), t; }, }; const It = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"]; for (const t of It) kt[t] = { get() { const { level: e } = this; return function (...r) { const i = At(vt.color[xt[e]][t](...r), vt.color.close, this._styler); return Pt(this, i, this._isEmpty); }; }, }; for (const t of It) { kt["bg" + t[0].toUpperCase() + t.slice(1)] = { get() { const { level: e } = this; return function (...r) { const i = At( vt.bgColor[xt[e]][t](...r), vt.bgColor.close, this._styler ); return Pt(this, i, this._isEmpty); }; }, }; } const Mt = Object.defineProperties(() => {}, { ...kt, level: { enumerable: !0, get() { return this._generator.level; }, set(t) { this._generator.level = t; }, }, }), At = (t, e, r) => { let i, s; return ( void 0 === r ? ((i = t), (s = e)) : ((i = r.openAll + t), (s = e + r.closeAll)), { open: t, close: e, openAll: i, closeAll: s, parent: r } ); }, Pt = (t, e, r) => { const i = (...t) => _t(t[0]) && _t(t[0].raw) ? Nt(i, Lt(i, ...t)) : Nt(i, 1 === t.length ? "" + t[0] : t.join(" ")); return ( Object.setPrototypeOf(i, Mt), (i._generator = t), (i._styler = e), (i._isEmpty = r), i ); }, Nt = (t, e) => { if (t.level <= 0 || !e) return t._isEmpty ? "" : e; let r = t._styler; if (void 0 === r) return e; const { openAll: i, closeAll: s } = r; if (-1 !== e.indexOf("")) for (; void 0 !== r; ) (e = Et(e, r.close, r.open)), (r = r.parent); const n = e.indexOf("\n"); return -1 !== n && (e = Ot(e, s, i, n)), i + e + s; }; let Dt; const Lt = (t, ...e) => { const [r] = e; if (!_t(r) || !_t(r.raw)) return e.join(" "); const i = e.slice(1), s = [r.raw[0]]; for (let t = 1; t < r.length; t++) s.push(String(i[t - 1]).replace(/[{}\\]/g, "\\$&"), String(r.raw[t])); return void 0 === Dt && (Dt = bt), Dt(t, s.join("")); }; Object.defineProperties(Rt.prototype, kt); const jt = Rt(); (jt.supportsColor = wt), (jt.stderr = Rt({ level: St ? St.level : 0 })), (jt.stderr.supportsColor = St); var Ft = jt, $t = {}, Bt = E.default, Gt = O.default, Ut = _.default, zt = x.default, Ht = k.default, Yt = T.default, Vt = C.default, qt = R.default, Wt = I.default, Zt = M.default, Kt = w.default, Jt = S.default, Xt = A.default, Qt = P.default, te = N.default, ee = D.default, re = L.default, ie = j.default; function se(t) { return t && "object" == typeof t && "default" in t ? t : { default: t }; } var ne = se(Bt), oe = se(Gt), ae = se(Ut), le = se(zt), ce = se(Ht), he = se(Yt), ue = se(Vt), de = se(qt), fe = se(Wt), pe = se(Zt), me = se(Kt), ye = se(Jt), ge = se(Xt), be = se(Qt), ve = se(te), we = se(ee), Se = se(re), Ee = se(ie), Oe = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== $ ? $ : "undefined" != typeof self ? self : {}; function _e(t) { var e = { exports: {} }; return t(e, e.exports), e.exports; } const xe = new Map([ ["C", "cwd"], ["f", "file"], ["z", "gzip"], ["P", "preservePaths"], ["U", "unlink"], ["strip-components", "strip"], ["stripComponents", "strip"], ["keep-newer", "newer"], ["keepNewer", "newer"], ["keep-newer-files", "newer"], ["keepNewerFiles", "newer"], ["k", "keep"], ["keep-existing", "keep"], ["keepExisting", "keep"], ["m", "noMtime"], ["no-mtime", "noMtime"], ["p", "preserveOwner"], ["L", "follow"], ["h", "follow"], ]); var ke = (t) => t ? Object.keys(t) .map((e) => [xe.has(e) ? xe.get(e) : e, t[e]]) .reduce((t, e) => ((t[e[0]] = e[1]), t), Object.create(null)) : {}, Te = Ce; function Ce(t) { var e = this; if ( (e instanceof Ce || (e = new Ce()), (e.tail = null), (e.head = null), (e.length = 0), t && "function" == typeof t.forEach) ) t.forEach(function (t) { e.push(t); }); else if (arguments.length > 0) for (var r = 0, i = arguments.length; r < i; r++) e.push(arguments[r]); return e; } function Re(t, e, r) { var i = e === t.head ? new Ae(r, null, e, t) : new Ae(r, e, e.next, t); return ( null === i.next && (t.tail = i), null === i.prev && (t.head = i), t.length++, i ); } function Ie(t, e) { (t.tail = new Ae(e, t.tail, null, t)), t.head || (t.head = t.tail), t.length++; } function Me(t, e) { (t.head = new Ae(e, null, t.head, t)), t.tail || (t.tail = t.head), t.length++; } function Ae(t, e, r, i) { if (!(this instanceof Ae)) return new Ae(t, e, r, i); (this.list = i), (this.value = t), e ? ((e.next = this), (this.prev = e)) : (this.prev = null), r ? ((r.prev = this), (this.next = r)) : (this.next = null); } (Ce.Node = Ae), (Ce.create = Ce), (Ce.prototype.removeNode = function (t) { if (t.list !== this) throw new Error("removing node which does not belong to this list"); var e = t.next, r = t.prev; return ( e && (e.prev = r), r && (r.next = e), t === this.head && (this.head = e), t === this.tail && (this.tail = r), t.list.length--, (t.next = null), (t.prev = null), (t.list = null), e ); }), (Ce.prototype.unshiftNode = function (t) { if (t !== this.head) { t.list && t.list.removeNode(t); var e = this.head; (t.list = this), (t.next = e), e && (e.prev = t), (this.head = t), this.tail || (this.tail = t), this.length++; } }), (Ce.prototype.pushNode = function (t) { if (t !== this.tail) { t.list && t.list.removeNode(t); var e = this.tail; (t.list = this), (t.prev = e), e && (e.next = t), (this.tail = t), this.head || (this.head = t), this.length++; } }), (Ce.prototype.push = function () { for (var t = 0, e = arguments.length; t < e; t++) Ie(this, arguments[t]); return this.length; }), (Ce.prototype.unshift = function () { for (var t = 0, e = arguments.length; t < e; t++) Me(this, arguments[t]); return this.length; }), (Ce.prototype.pop = function () { if (this.tail) { var t = this.tail.value; return ( (this.tail = this.tail.prev), this.tail ? (this.tail.next = null) : (this.head = null), this.length--, t ); } }), (Ce.prototype.shift = function () { if (this.head) { var t = this.head.value; return ( (this.head = this.head.next), this.head ? (this.head.prev = null) : (this.tail = null), this.length--, t ); } }), (Ce.prototype.forEach = function (t, e) { e = e || this; for (var r = this.head, i = 0; null !== r; i++) t.call(e, r.value, i, this), (r = r.next); }), (Ce.prototype.forEachReverse = function (t, e) { e = e || this; for (var r = this.tail, i = this.length - 1; null !== r; i--) t.call(e, r.value, i, this), (r = r.prev); }), (Ce.prototype.get = function (t) { for (var e = 0, r = this.head; null !== r && e < t; e++) r = r.next; if (e === t && null !== r) return r.value; }), (Ce.prototype.getReverse = function (t) { for (var e = 0, r = this.tail; null !== r && e < t; e++) r = r.prev; if (e === t && null !== r) return r.value; }), (Ce.prototype.map = function (t, e) { e = e || this; for (var r = new Ce(), i = this.head; null !== i; ) r.push(t.call(e, i.value, this)), (i = i.next); return r; }), (Ce.prototype.mapReverse = function (t, e) { e = e || this; for (var r = new Ce(), i = this.tail; null !== i; ) r.push(t.call(e, i.value, this)), (i = i.prev); return r; }), (Ce.prototype.reduce = function (t, e) { var r, i = this.head; if (arguments.length > 1) r = e; else { if (!this.head) throw new TypeError("Reduce of empty list with no initial value"); (i = this.head.next), (r = this.head.value); } for (var s = 0; null !== i; s++) (r = t(r, i.value, s)), (i = i.next); return r; }), (Ce.prototype.reduceReverse = function (t, e) { var r, i = this.tail; if (arguments.length > 1) r = e; else { if (!this.tail) throw new TypeError("Reduce of empty list with no initial value"); (i = this.tail.prev), (r = this.tail.value); } for (var s = this.length - 1; null !== i; s--) (r = t(r, i.value, s)), (i = i.prev); return r; }), (Ce.prototype.toArray = function () { for (var t = new Array(this.length), e = 0, r = this.head; null !== r; e++) (t[e] = r.value), (r = r.next); return t; }), (Ce.prototype.toArrayReverse = function () { for (var t = new Array(this.length), e = 0, r = this.tail; null !== r; e++) (t[e] = r.value), (r = r.prev); return t; }), (Ce.prototype.slice = function (t, e) { (e = e || this.length) < 0 && (e += this.length), (t = t || 0) < 0 && (t += this.length); var r = new Ce(); if (e < t || e < 0) return r; t < 0 && (t = 0), e > this.length && (e = this.length); for (var i = 0, s = this.head; null !== s && i < t; i++) s = s.next; for (; null !== s && i < e; i++, s = s.next) r.push(s.value); return r; }), (Ce.prototype.sliceReverse = function (t, e) { (e = e || this.length) < 0 && (e += this.length), (t = t || 0) < 0 && (t += this.length); var r = new Ce(); if (e < t || e < 0) return r; t < 0 && (t = 0), e > this.length && (e = this.length); for (var i = this.length, s = this.tail; null !== s && i > e; i--) s = s.prev; for (; null !== s && i > t; i--, s = s.prev) r.push(s.value); return r; }), (Ce.prototype.splice = function (t, e, ...r) { t > this.length && (t = this.length - 1), t < 0 && (t = this.length + t); for (var i = 0, s = this.head; null !== s && i < t; i++) s = s.next; var n = []; for (i = 0; s && i < e; i++) n.push(s.value), (s = this.removeNode(s)); null === s && (s = this.tail), s !== this.head && s !== this.tail && (s = s.prev); for (i = 0; i < r.length; i++) s = Re(this, s, r[i]); return n; }), (Ce.prototype.reverse = function () { for (var t = this.head, e = this.tail, r = t; null !== r; r = r.prev) { var i = r.prev; (r.prev = r.next), (r.next = i); } return (this.head = e), (this.tail = t), this; }); try { !(function (t) { t.prototype[Symbol.iterator] = function* () { for (let t = this.head; t; t = t.next) yield t.value; }; })(Ce); } catch (t) {} const Pe = ce.default.StringDecoder, Ne = Symbol("EOF"), De = Symbol("maybeEmitEnd"), Le = Symbol("emittedEnd"), je = Symbol("emittingEnd"), Fe = Symbol("closed"), $e = Symbol("read"), Be = Symbol("flush"), Ge = Symbol("flushChunk"), Ue = Symbol("encoding"), ze = Symbol("decoder"), He = Symbol("flowing"), Ye = Symbol("paused"), Ve = Symbol("resume"), qe = Symbol("bufferLength"), We = Symbol("bufferPush"), Ze = Symbol("bufferShift"), Ke = Symbol("objectMode"), Je = Symbol("destroyed"), Xe = "1" !== Oe._MP_NO_ITERATOR_SYMBOLS_, Qe = (Xe && Symbol.asyncIterator) || Symbol("asyncIterator not implemented"), tr = (Xe && Symbol.iterator) || Symbol("iterator not implemented"), er = (t) => "end" === t || "finish" === t || "prefinish" === t; var rr = class t extends le.default { constructor(t) { super(), (this[He] = !1), (this[Ye] = !1), (this.pipes = new Te()), (this.buffer = new Te()), (this[Ke] = (t && t.objectMode) || !1), this[Ke] ? (this[Ue] = null) : (this[Ue] = (t && t.encoding) || null), "buffer" === this[Ue] && (this[Ue] = null), (this[ze] = this[Ue] ? new Pe(this[Ue]) : null), (this[Ne] = !1), (this[Le] = !1), (this[je] = !1), (this[Fe] = !1), (this.writable = !0), (this.readable = !0), (this[qe] = 0), (this[Je] = !1); } get bufferLength() { return this[qe]; } get encoding() { return this[Ue]; } set encoding(t) { if (this[Ke]) throw new Error("cannot set encoding in objectMode"); if ( this[Ue] && t !== this[Ue] && ((this[ze] && this[ze].lastNeed) || this[qe]) ) throw new Error("cannot change encoding"); this[Ue] !== t && ((this[ze] = t ? new Pe(t) : null), this.buffer.length && (this.buffer = this.buffer.map((t) => this[ze].write(t)))), (this[Ue] = t); } setEncoding(t) { this.encoding = t; } get objectMode() { return this[Ke]; } set objectMode(t) { this[Ke] = this[Ke] || !!t; } write(t, e, r) { if (this[Ne]) throw new Error("write after end"); return this[Je] ? (this.emit( "error", Object.assign( new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" } ) ), !0) : ("function" == typeof e && ((r = e), (e = "utf8")), e || (e = "utf8"), this[Ke] || Buffer.isBuffer(t) || ((i = t), !Buffer.isBuffer(i) && ArrayBuffer.isView(i) ? (t = Buffer.from(t.buffer, t.byteOffset, t.byteLength)) : ((t) => t instanceof ArrayBuffer || ("object" == typeof t && t.constructor && "ArrayBuffer" === t.constructor.name && t.byteLength >= 0))(t) ? (t = Buffer.from(t)) : "string" != typeof t && (this.objectMode = !0)), this.objectMode || t.length ? ("string" != typeof t || this[Ke] || (e === this[Ue] && !this[ze].lastNeed) || (t = Buffer.from(t, e)), Buffer.isBuffer(t) && this[Ue] && (t = this[ze].write(t)), this.flowing ? (0 !== this[qe] && this[Be](!0), this.emit("data", t)) : this[We](t), 0 !== this[qe] && this.emit("readable"), r && r(), this.flowing) : (0 !== this[qe] && this.emit("readable"), r && r(), this.flowing)); var i; } read(t) { if (this[Je]) return null; try { return 0 === this[qe] || 0 === t || t > this[qe] ? null : (this[Ke] && (t = null), this.buffer.length > 1 && !this[Ke] && (this.encoding ? (this.buffer = new Te([Array.from(this.buffer).join("")])) : (this.buffer = new Te([ Buffer.concat(Array.from(this.buffer), this[qe]), ]))), this[$e](t || null, this.buffer.head.value)); } finally { this[De](); } } [$e](t, e) { return ( t === e.length || null === t ? this[Ze]() : ((this.buffer.head.value = e.slice(t)), (e = e.slice(0, t)), (this[qe] -= t)), this.emit("data", e), this.buffer.length || this[Ne] || this.emit("drain"), e ); } end(t, e, r) { return ( "function" == typeof t && ((r = t), (t = null)), "function" == typeof e && ((r = e), (e = "utf8")), t && this.write(t, e), r && this.once("end", r), (this[Ne] = !0), (this.writable = !1), (!this.flowing && this[Ye]) || this[De](), this ); } [Ve]() { this[Je] || ((this[Ye] = !1), (this[He] = !0), this.emit("resume"), this.buffer.length ? this[Be]() : this[Ne] ? this[De]() : this.emit("drain")); } resume() { return this[Ve](); } pause() { (this[He] = !1), (this[Ye] = !0); } get destroyed() { return this[Je]; } get flowing() { return this[He]; } get paused() { return this[Ye]; } [We](t) { return ( this[Ke] ? (this[qe] += 1) : (this[qe] += t.length), this.buffer.push(t) ); } [Ze]() { return ( this.buffer.length && (this[Ke] ? (this[qe] -= 1) : (this[qe] -= this.buffer.head.value.length)), this.buffer.shift() ); } [Be](t) { do {} while (this[Ge](this[Ze]())); t || this.buffer.length || this[Ne] || this.emit("drain"); } [Ge](t) { return !!t && (this.emit("data", t), this.flowing); } pipe(t, e) { if (this[Je]) return; const r = this[Le]; (e = e || {}), t === process.stdout || t === process.stderr ? (e.end = !1) : (e.end = !1 !== e.end); const i = { dest: t, opts: e, ondrain: (t) => this[Ve]() }; return ( this.pipes.push(i), t.on("drain", i.ondrain), this[Ve](), r && i.opts.end && i.dest.end(), t ); } addListener(t, e) { return this.on(t, e); } on(t, e) { try { return super.on(t, e); } finally { "data" !== t || this.pipes.length || this.flowing ? er(t) && this[Le] && (super.emit(t), this.removeAllListeners(t)) : this[Ve](); } } get emittedEnd() { return this[Le]; } [De]() { this[je] || this[Le] || this[Je] || 0 !== this.buffer.length || !this[Ne] || ((this[je] = !0), th