import { i as e, o as t, r as n } from "./rolldown-runtime-gEudmnaM.js";
import { n as r, t as i } from "./excel-reader-CiDeab7_.js";
import { a, i as o, n as s, r as c, t as l } from "./word-reader-Chcn6YoS.js";
import { t as u } from "./lodash-DVkZQU_K.js";
import { saveAs as d } from "file-saver";
import { message as ee } from "antd";
//#region ../../node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/esm/tinycolor.js
function f(e) {
	"@babel/helpers - typeof";
	return f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
		return typeof e;
	} : function(e) {
		return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
	}, f(e);
}
var te = /^\s+/, ne = /\s+$/;
function p(e, t) {
	if (e ||= "", t ||= {}, e instanceof p) return e;
	if (!(this instanceof p)) return new p(e, t);
	var n = re(e);
	this._originalInput = e, this._r = n.r, this._g = n.g, this._b = n.b, this._a = n.a, this._roundA = Math.round(100 * this._a) / 100, this._format = t.format || n.format, this._gradientType = t.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = n.ok;
}
p.prototype = {
	isDark: function() {
		return this.getBrightness() < 128;
	},
	isLight: function() {
		return !this.isDark();
	},
	isValid: function() {
		return this._ok;
	},
	getOriginalInput: function() {
		return this._originalInput;
	},
	getFormat: function() {
		return this._format;
	},
	getAlpha: function() {
		return this._a;
	},
	getBrightness: function() {
		var e = this.toRgb();
		return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
	},
	getLuminance: function() {
		var e = this.toRgb(), t = e.r / 255, n = e.g / 255, r = e.b / 255, i = t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4, a = n <= .03928 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4, o = r <= .03928 ? r / 12.92 : ((r + .055) / 1.055) ** 2.4;
		return .2126 * i + .7152 * a + .0722 * o;
	},
	setAlpha: function(e) {
		return this._a = b(e), this._roundA = Math.round(100 * this._a) / 100, this;
	},
	toHsv: function() {
		var e = h(this._r, this._g, this._b);
		return {
			h: e.h * 360,
			s: e.s,
			v: e.v,
			a: this._a
		};
	},
	toHsvString: function() {
		var e = h(this._r, this._g, this._b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.v * 100);
		return this._a == 1 ? "hsv(" + t + ", " + n + "%, " + r + "%)" : "hsva(" + t + ", " + n + "%, " + r + "%, " + this._roundA + ")";
	},
	toHsl: function() {
		var e = m(this._r, this._g, this._b);
		return {
			h: e.h * 360,
			s: e.s,
			l: e.l,
			a: this._a
		};
	},
	toHslString: function() {
		var e = m(this._r, this._g, this._b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.l * 100);
		return this._a == 1 ? "hsl(" + t + ", " + n + "%, " + r + "%)" : "hsla(" + t + ", " + n + "%, " + r + "%, " + this._roundA + ")";
	},
	toHex: function(e) {
		return g(this._r, this._g, this._b, e);
	},
	toHexString: function(e) {
		return "#" + this.toHex(e);
	},
	toHex8: function(e) {
		return se(this._r, this._g, this._b, this._a, e);
	},
	toHex8String: function(e) {
		return "#" + this.toHex8(e);
	},
	toRgb: function() {
		return {
			r: Math.round(this._r),
			g: Math.round(this._g),
			b: Math.round(this._b),
			a: this._a
		};
	},
	toRgbString: function() {
		return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
	},
	toPercentageRgb: function() {
		return {
			r: Math.round(x(this._r, 255) * 100) + "%",
			g: Math.round(x(this._g, 255) * 100) + "%",
			b: Math.round(x(this._b, 255) * 100) + "%",
			a: this._a
		};
	},
	toPercentageRgbString: function() {
		return this._a == 1 ? "rgb(" + Math.round(x(this._r, 255) * 100) + "%, " + Math.round(x(this._g, 255) * 100) + "%, " + Math.round(x(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(x(this._r, 255) * 100) + "%, " + Math.round(x(this._g, 255) * 100) + "%, " + Math.round(x(this._b, 255) * 100) + "%, " + this._roundA + ")";
	},
	toName: function() {
		return this._a === 0 ? "transparent" : this._a < 1 ? !1 : ye[g(this._r, this._g, this._b, !0)] || !1;
	},
	toFilter: function(e) {
		var t = "#" + _(this._r, this._g, this._b, this._a), n = t, r = this._gradientType ? "GradientType = 1, " : "";
		if (e) {
			var i = p(e);
			n = "#" + _(i._r, i._g, i._b, i._a);
		}
		return "progid:DXImageTransform.Microsoft.gradient(" + r + "startColorstr=" + t + ",endColorstr=" + n + ")";
	},
	toString: function(e) {
		var t = !!e;
		e ||= this._format;
		var n = !1, r = this._a < 1 && this._a >= 0;
		return !t && r && (e === "hex" || e === "hex6" || e === "hex3" || e === "hex4" || e === "hex8" || e === "name") ? e === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(!0)), e === "hex4" && (n = this.toHex8String(!0)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), n || this.toHexString());
	},
	clone: function() {
		return p(this.toString());
	},
	_applyModification: function(e, t) {
		var n = e.apply(null, [this].concat([].slice.call(t)));
		return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this;
	},
	lighten: function() {
		return this._applyModification(de, arguments);
	},
	brighten: function() {
		return this._applyModification(fe, arguments);
	},
	darken: function() {
		return this._applyModification(pe, arguments);
	},
	desaturate: function() {
		return this._applyModification(ce, arguments);
	},
	saturate: function() {
		return this._applyModification(le, arguments);
	},
	greyscale: function() {
		return this._applyModification(ue, arguments);
	},
	spin: function() {
		return this._applyModification(me, arguments);
	},
	_applyCombination: function(e, t) {
		return e.apply(null, [this].concat([].slice.call(t)));
	},
	analogous: function() {
		return this._applyCombination(_e, arguments);
	},
	complement: function() {
		return this._applyCombination(he, arguments);
	},
	monochromatic: function() {
		return this._applyCombination(ve, arguments);
	},
	splitcomplement: function() {
		return this._applyCombination(ge, arguments);
	},
	triad: function() {
		return this._applyCombination(v, [3]);
	},
	tetrad: function() {
		return this._applyCombination(v, [4]);
	}
}, p.fromRatio = function(e, t) {
	if (f(e) == "object") {
		var n = {};
		for (var r in e) e.hasOwnProperty(r) && (r === "a" ? n[r] = e[r] : n[r] = T(e[r]));
		e = n;
	}
	return p(e, t);
};
function re(e) {
	var t = {
		r: 0,
		g: 0,
		b: 0
	}, n = 1, r = null, i = null, a = null, o = !1, s = !1;
	return typeof e == "string" && (e = Ce(e)), f(e) == "object" && (k(e.r) && k(e.g) && k(e.b) ? (t = ie(e.r, e.g, e.b), o = !0, s = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : k(e.h) && k(e.s) && k(e.v) ? (r = T(e.s), i = T(e.v), t = oe(e.h, r, i), o = !0, s = "hsv") : k(e.h) && k(e.s) && k(e.l) && (r = T(e.s), a = T(e.l), t = ae(e.h, r, a), o = !0, s = "hsl"), e.hasOwnProperty("a") && (n = e.a)), n = b(n), {
		ok: o,
		format: e.format || s,
		r: Math.min(255, Math.max(t.r, 0)),
		g: Math.min(255, Math.max(t.g, 0)),
		b: Math.min(255, Math.max(t.b, 0)),
		a: n
	};
}
function ie(e, t, n) {
	return {
		r: x(e, 255) * 255,
		g: x(t, 255) * 255,
		b: x(n, 255) * 255
	};
}
function m(e, t, n) {
	e = x(e, 255), t = x(t, 255), n = x(n, 255);
	var r = Math.max(e, t, n), i = Math.min(e, t, n), a, o, s = (r + i) / 2;
	if (r == i) a = o = 0;
	else {
		var c = r - i;
		switch (o = s > .5 ? c / (2 - r - i) : c / (r + i), r) {
			case e:
				a = (t - n) / c + (t < n ? 6 : 0);
				break;
			case t:
				a = (n - e) / c + 2;
				break;
			case n:
				a = (e - t) / c + 4;
				break;
		}
		a /= 6;
	}
	return {
		h: a,
		s: o,
		l: s
	};
}
function ae(e, t, n) {
	var r, i, a;
	e = x(e, 360), t = x(t, 100), n = x(n, 100);
	function o(e, t, n) {
		return n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
	}
	if (t === 0) r = i = a = n;
	else {
		var s = n < .5 ? n * (1 + t) : n + t - n * t, c = 2 * n - s;
		r = o(c, s, e + 1 / 3), i = o(c, s, e), a = o(c, s, e - 1 / 3);
	}
	return {
		r: r * 255,
		g: i * 255,
		b: a * 255
	};
}
function h(e, t, n) {
	e = x(e, 255), t = x(t, 255), n = x(n, 255);
	var r = Math.max(e, t, n), i = Math.min(e, t, n), a, o, s = r, c = r - i;
	if (o = r === 0 ? 0 : c / r, r == i) a = 0;
	else {
		switch (r) {
			case e:
				a = (t - n) / c + (t < n ? 6 : 0);
				break;
			case t:
				a = (n - e) / c + 2;
				break;
			case n:
				a = (e - t) / c + 4;
				break;
		}
		a /= 6;
	}
	return {
		h: a,
		s: o,
		v: s
	};
}
function oe(e, t, n) {
	e = x(e, 360) * 6, t = x(t, 100), n = x(n, 100);
	var r = Math.floor(e), i = e - r, a = n * (1 - t), o = n * (1 - i * t), s = n * (1 - (1 - i) * t), c = r % 6, l = [
		n,
		o,
		a,
		a,
		s,
		n
	][c], u = [
		s,
		n,
		n,
		o,
		a,
		a
	][c], d = [
		a,
		a,
		s,
		n,
		n,
		o
	][c];
	return {
		r: l * 255,
		g: u * 255,
		b: d * 255
	};
}
function g(e, t, n, r) {
	var i = [
		w(Math.round(e).toString(16)),
		w(Math.round(t).toString(16)),
		w(Math.round(n).toString(16))
	];
	return r && i[0].charAt(0) == i[0].charAt(1) && i[1].charAt(0) == i[1].charAt(1) && i[2].charAt(0) == i[2].charAt(1) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
}
function se(e, t, n, r, i) {
	var a = [
		w(Math.round(e).toString(16)),
		w(Math.round(t).toString(16)),
		w(Math.round(n).toString(16)),
		w(E(r))
	];
	return i && a[0].charAt(0) == a[0].charAt(1) && a[1].charAt(0) == a[1].charAt(1) && a[2].charAt(0) == a[2].charAt(1) && a[3].charAt(0) == a[3].charAt(1) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
}
function _(e, t, n, r) {
	return [
		w(E(r)),
		w(Math.round(e).toString(16)),
		w(Math.round(t).toString(16)),
		w(Math.round(n).toString(16))
	].join("");
}
p.equals = function(e, t) {
	return !e || !t ? !1 : p(e).toRgbString() == p(t).toRgbString();
}, p.random = function() {
	return p.fromRatio({
		r: Math.random(),
		g: Math.random(),
		b: Math.random()
	});
};
function ce(e, t) {
	t = t === 0 ? 0 : t || 10;
	var n = p(e).toHsl();
	return n.s -= t / 100, n.s = S(n.s), p(n);
}
function le(e, t) {
	t = t === 0 ? 0 : t || 10;
	var n = p(e).toHsl();
	return n.s += t / 100, n.s = S(n.s), p(n);
}
function ue(e) {
	return p(e).desaturate(100);
}
function de(e, t) {
	t = t === 0 ? 0 : t || 10;
	var n = p(e).toHsl();
	return n.l += t / 100, n.l = S(n.l), p(n);
}
function fe(e, t) {
	t = t === 0 ? 0 : t || 10;
	var n = p(e).toRgb();
	return n.r = Math.max(0, Math.min(255, n.r - Math.round(255 * -(t / 100)))), n.g = Math.max(0, Math.min(255, n.g - Math.round(255 * -(t / 100)))), n.b = Math.max(0, Math.min(255, n.b - Math.round(255 * -(t / 100)))), p(n);
}
function pe(e, t) {
	t = t === 0 ? 0 : t || 10;
	var n = p(e).toHsl();
	return n.l -= t / 100, n.l = S(n.l), p(n);
}
function me(e, t) {
	var n = p(e).toHsl(), r = (n.h + t) % 360;
	return n.h = r < 0 ? 360 + r : r, p(n);
}
function he(e) {
	var t = p(e).toHsl();
	return t.h = (t.h + 180) % 360, p(t);
}
function v(e, t) {
	if (isNaN(t) || t <= 0) throw Error("Argument to polyad must be a positive number");
	for (var n = p(e).toHsl(), r = [p(e)], i = 360 / t, a = 1; a < t; a++) r.push(p({
		h: (n.h + a * i) % 360,
		s: n.s,
		l: n.l
	}));
	return r;
}
function ge(e) {
	var t = p(e).toHsl(), n = t.h;
	return [
		p(e),
		p({
			h: (n + 72) % 360,
			s: t.s,
			l: t.l
		}),
		p({
			h: (n + 216) % 360,
			s: t.s,
			l: t.l
		})
	];
}
function _e(e, t, n) {
	t ||= 6, n ||= 30;
	var r = p(e).toHsl(), i = 360 / n, a = [p(e)];
	for (r.h = (r.h - (i * t >> 1) + 720) % 360; --t;) r.h = (r.h + i) % 360, a.push(p(r));
	return a;
}
function ve(e, t) {
	t ||= 6;
	for (var n = p(e).toHsv(), r = n.h, i = n.s, a = n.v, o = [], s = 1 / t; t--;) o.push(p({
		h: r,
		s: i,
		v: a
	})), a = (a + s) % 1;
	return o;
}
p.mix = function(e, t, n) {
	n = n === 0 ? 0 : n || 50;
	var r = p(e).toRgb(), i = p(t).toRgb(), a = n / 100;
	return p({
		r: (i.r - r.r) * a + r.r,
		g: (i.g - r.g) * a + r.g,
		b: (i.b - r.b) * a + r.b,
		a: (i.a - r.a) * a + r.a
	});
}, p.readability = function(e, t) {
	var n = p(e), r = p(t);
	return (Math.max(n.getLuminance(), r.getLuminance()) + .05) / (Math.min(n.getLuminance(), r.getLuminance()) + .05);
}, p.isReadable = function(e, t, n) {
	var r = p.readability(e, t), i, a = !1;
	switch (i = we(n), i.level + i.size) {
		case "AAsmall":
		case "AAAlarge":
			a = r >= 4.5;
			break;
		case "AAlarge":
			a = r >= 3;
			break;
		case "AAAsmall":
			a = r >= 7;
			break;
	}
	return a;
}, p.mostReadable = function(e, t, n) {
	var r = null, i = 0, a, o, s, c;
	n ||= {}, o = n.includeFallbackColors, s = n.level, c = n.size;
	for (var l = 0; l < t.length; l++) a = p.readability(e, t[l]), a > i && (i = a, r = p(t[l]));
	return p.isReadable(e, r, {
		level: s,
		size: c
	}) || !o ? r : (n.includeFallbackColors = !1, p.mostReadable(e, ["#fff", "#000"], n));
};
var y = p.names = {
	aliceblue: "f0f8ff",
	antiquewhite: "faebd7",
	aqua: "0ff",
	aquamarine: "7fffd4",
	azure: "f0ffff",
	beige: "f5f5dc",
	bisque: "ffe4c4",
	black: "000",
	blanchedalmond: "ffebcd",
	blue: "00f",
	blueviolet: "8a2be2",
	brown: "a52a2a",
	burlywood: "deb887",
	burntsienna: "ea7e5d",
	cadetblue: "5f9ea0",
	chartreuse: "7fff00",
	chocolate: "d2691e",
	coral: "ff7f50",
	cornflowerblue: "6495ed",
	cornsilk: "fff8dc",
	crimson: "dc143c",
	cyan: "0ff",
	darkblue: "00008b",
	darkcyan: "008b8b",
	darkgoldenrod: "b8860b",
	darkgray: "a9a9a9",
	darkgreen: "006400",
	darkgrey: "a9a9a9",
	darkkhaki: "bdb76b",
	darkmagenta: "8b008b",
	darkolivegreen: "556b2f",
	darkorange: "ff8c00",
	darkorchid: "9932cc",
	darkred: "8b0000",
	darksalmon: "e9967a",
	darkseagreen: "8fbc8f",
	darkslateblue: "483d8b",
	darkslategray: "2f4f4f",
	darkslategrey: "2f4f4f",
	darkturquoise: "00ced1",
	darkviolet: "9400d3",
	deeppink: "ff1493",
	deepskyblue: "00bfff",
	dimgray: "696969",
	dimgrey: "696969",
	dodgerblue: "1e90ff",
	firebrick: "b22222",
	floralwhite: "fffaf0",
	forestgreen: "228b22",
	fuchsia: "f0f",
	gainsboro: "dcdcdc",
	ghostwhite: "f8f8ff",
	gold: "ffd700",
	goldenrod: "daa520",
	gray: "808080",
	green: "008000",
	greenyellow: "adff2f",
	grey: "808080",
	honeydew: "f0fff0",
	hotpink: "ff69b4",
	indianred: "cd5c5c",
	indigo: "4b0082",
	ivory: "fffff0",
	khaki: "f0e68c",
	lavender: "e6e6fa",
	lavenderblush: "fff0f5",
	lawngreen: "7cfc00",
	lemonchiffon: "fffacd",
	lightblue: "add8e6",
	lightcoral: "f08080",
	lightcyan: "e0ffff",
	lightgoldenrodyellow: "fafad2",
	lightgray: "d3d3d3",
	lightgreen: "90ee90",
	lightgrey: "d3d3d3",
	lightpink: "ffb6c1",
	lightsalmon: "ffa07a",
	lightseagreen: "20b2aa",
	lightskyblue: "87cefa",
	lightslategray: "789",
	lightslategrey: "789",
	lightsteelblue: "b0c4de",
	lightyellow: "ffffe0",
	lime: "0f0",
	limegreen: "32cd32",
	linen: "faf0e6",
	magenta: "f0f",
	maroon: "800000",
	mediumaquamarine: "66cdaa",
	mediumblue: "0000cd",
	mediumorchid: "ba55d3",
	mediumpurple: "9370db",
	mediumseagreen: "3cb371",
	mediumslateblue: "7b68ee",
	mediumspringgreen: "00fa9a",
	mediumturquoise: "48d1cc",
	mediumvioletred: "c71585",
	midnightblue: "191970",
	mintcream: "f5fffa",
	mistyrose: "ffe4e1",
	moccasin: "ffe4b5",
	navajowhite: "ffdead",
	navy: "000080",
	oldlace: "fdf5e6",
	olive: "808000",
	olivedrab: "6b8e23",
	orange: "ffa500",
	orangered: "ff4500",
	orchid: "da70d6",
	palegoldenrod: "eee8aa",
	palegreen: "98fb98",
	paleturquoise: "afeeee",
	palevioletred: "db7093",
	papayawhip: "ffefd5",
	peachpuff: "ffdab9",
	peru: "cd853f",
	pink: "ffc0cb",
	plum: "dda0dd",
	powderblue: "b0e0e6",
	purple: "800080",
	rebeccapurple: "663399",
	red: "f00",
	rosybrown: "bc8f8f",
	royalblue: "4169e1",
	saddlebrown: "8b4513",
	salmon: "fa8072",
	sandybrown: "f4a460",
	seagreen: "2e8b57",
	seashell: "fff5ee",
	sienna: "a0522d",
	silver: "c0c0c0",
	skyblue: "87ceeb",
	slateblue: "6a5acd",
	slategray: "708090",
	slategrey: "708090",
	snow: "fffafa",
	springgreen: "00ff7f",
	steelblue: "4682b4",
	tan: "d2b48c",
	teal: "008080",
	thistle: "d8bfd8",
	tomato: "ff6347",
	turquoise: "40e0d0",
	violet: "ee82ee",
	wheat: "f5deb3",
	white: "fff",
	whitesmoke: "f5f5f5",
	yellow: "ff0",
	yellowgreen: "9acd32"
}, ye = p.hexNames = be(y);
function be(e) {
	var t = {};
	for (var n in e) e.hasOwnProperty(n) && (t[e[n]] = n);
	return t;
}
function b(e) {
	return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
}
function x(e, t) {
	xe(e) && (e = "100%");
	var n = Se(e);
	return e = Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(e * t, 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : e % t / parseFloat(t);
}
function S(e) {
	return Math.min(1, Math.max(0, e));
}
function C(e) {
	return parseInt(e, 16);
}
function xe(e) {
	return typeof e == "string" && e.indexOf(".") != -1 && parseFloat(e) === 1;
}
function Se(e) {
	return typeof e == "string" && e.indexOf("%") != -1;
}
function w(e) {
	return e.length == 1 ? "0" + e : "" + e;
}
function T(e) {
	return e <= 1 && (e = e * 100 + "%"), e;
}
function E(e) {
	return Math.round(parseFloat(e) * 255).toString(16);
}
function D(e) {
	return C(e) / 255;
}
var O = function() {
	var e = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)", t = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?", n = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?";
	return {
		CSS_UNIT: new RegExp(e),
		rgb: RegExp("rgb" + t),
		rgba: RegExp("rgba" + n),
		hsl: RegExp("hsl" + t),
		hsla: RegExp("hsla" + n),
		hsv: RegExp("hsv" + t),
		hsva: RegExp("hsva" + n),
		hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
		hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
		hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
		hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
	};
}();
function k(e) {
	return !!O.CSS_UNIT.exec(e);
}
function Ce(e) {
	e = e.replace(te, "").replace(ne, "").toLowerCase();
	var t = !1;
	if (y[e]) e = y[e], t = !0;
	else if (e == "transparent") return {
		r: 0,
		g: 0,
		b: 0,
		a: 0,
		format: "name"
	};
	var n;
	return (n = O.rgb.exec(e)) ? {
		r: n[1],
		g: n[2],
		b: n[3]
	} : (n = O.rgba.exec(e)) ? {
		r: n[1],
		g: n[2],
		b: n[3],
		a: n[4]
	} : (n = O.hsl.exec(e)) ? {
		h: n[1],
		s: n[2],
		l: n[3]
	} : (n = O.hsla.exec(e)) ? {
		h: n[1],
		s: n[2],
		l: n[3],
		a: n[4]
	} : (n = O.hsv.exec(e)) ? {
		h: n[1],
		s: n[2],
		v: n[3]
	} : (n = O.hsva.exec(e)) ? {
		h: n[1],
		s: n[2],
		v: n[3],
		a: n[4]
	} : (n = O.hex8.exec(e)) ? {
		r: C(n[1]),
		g: C(n[2]),
		b: C(n[3]),
		a: D(n[4]),
		format: t ? "name" : "hex8"
	} : (n = O.hex6.exec(e)) ? {
		r: C(n[1]),
		g: C(n[2]),
		b: C(n[3]),
		format: t ? "name" : "hex"
	} : (n = O.hex4.exec(e)) ? {
		r: C(n[1] + "" + n[1]),
		g: C(n[2] + "" + n[2]),
		b: C(n[3] + "" + n[3]),
		a: D(n[4] + "" + n[4]),
		format: t ? "name" : "hex8"
	} : (n = O.hex3.exec(e)) ? {
		r: C(n[1] + "" + n[1]),
		g: C(n[2] + "" + n[2]),
		b: C(n[3] + "" + n[3]),
		format: t ? "name" : "hex"
	} : !1;
}
function we(e) {
	var t, n;
	return e ||= {
		level: "AA",
		size: "small"
	}, t = (e.level || "AA").toUpperCase(), n = (e.size || "small").toLowerCase(), t !== "AA" && t !== "AAA" && (t = "AA"), n !== "small" && n !== "large" && (n = "small"), {
		level: t,
		size: n
	};
}
//#endregion
//#region src/lib/utils/download-stream.ts
var A = (e, t) => {
	d(e, t);
}, j = "%[a-f0-9]{2}", M = RegExp("(" + j + ")|([^%]+?)", "gi"), N = RegExp("(" + j + ")+", "gi");
function P(e, t) {
	try {
		return [decodeURIComponent(e.join(""))];
	} catch {}
	if (e.length === 1) return e;
	t ||= 1;
	let n = e.slice(0, t), r = e.slice(t);
	return Array.prototype.concat.call([], P(n), P(r));
}
function Te(e) {
	try {
		return decodeURIComponent(e);
	} catch {
		let t = e.match(M) || [];
		for (let n = 1; n < t.length; n++) e = P(t, n).join(""), t = e.match(M) || [];
		return e;
	}
}
function Ee(e) {
	let t = {
		"%FE%FF": "��",
		"%FF%FE": "��"
	}, n = N.exec(e);
	for (; n;) {
		try {
			t[n[0]] = decodeURIComponent(n[0]);
		} catch {
			let e = Te(n[0]);
			e !== n[0] && (t[n[0]] = e);
		}
		n = N.exec(e);
	}
	t["%C2"] = "�";
	let r = Object.keys(t);
	for (let n of r) e = e.replace(new RegExp(n, "g"), t[n]);
	return e;
}
function De(e) {
	if (typeof e != "string") throw TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof e + "`");
	try {
		return decodeURIComponent(e);
	} catch {
		return Ee(e);
	}
}
//#endregion
//#region ../../node_modules/.pnpm/filter-obj@5.1.0/node_modules/filter-obj/index.js
function Oe(e, t) {
	let n = {};
	if (Array.isArray(t)) for (let r of t) {
		let t = Object.getOwnPropertyDescriptor(e, r);
		t?.enumerable && Object.defineProperty(n, r, t);
	}
	else for (let r of Reflect.ownKeys(e)) {
		let i = Object.getOwnPropertyDescriptor(e, r);
		if (i.enumerable) {
			let a = e[r];
			t(r, a, e) && Object.defineProperty(n, r, i);
		}
	}
	return n;
}
//#endregion
//#region ../../node_modules/.pnpm/split-on-first@3.0.0/node_modules/split-on-first/index.js
function F(e, t) {
	if (!(typeof e == "string" && typeof t == "string")) throw TypeError("Expected the arguments to be of type `string`");
	if (e === "" || t === "") return [];
	let n = e.indexOf(t);
	return n === -1 ? [] : [e.slice(0, n), e.slice(n + t.length)];
}
//#endregion
//#region ../../node_modules/.pnpm/query-string@9.3.1/node_modules/query-string/base.js
var ke = /* @__PURE__ */ n({
	exclude: () => Le,
	extract: () => H,
	parse: () => U,
	parseUrl: () => G,
	pick: () => Ie,
	stringify: () => W,
	stringifyUrl: () => K
}), Ae = (e) => e == null, je = (e) => encodeURIComponent(e).replaceAll(/[!'()*]/g, (e) => `%${e.charCodeAt(0).toString(16).toUpperCase()}`), I = Symbol("encodeFragmentIdentifier");
function Me(e) {
	switch (e.arrayFormat) {
		case "index": return (t) => (n, r) => {
			let i = n.length;
			return r === void 0 || e.skipNull && r === null || e.skipEmptyString && r === "" ? n : r === null ? [...n, [
				R(t, e),
				"[",
				i,
				"]"
			].join("")] : [...n, [
				R(t, e),
				"[",
				R(i, e),
				"]=",
				R(r, e)
			].join("")];
		};
		case "bracket": return (t) => (n, r) => r === void 0 || e.skipNull && r === null || e.skipEmptyString && r === "" ? n : r === null ? [...n, [R(t, e), "[]"].join("")] : [...n, [
			R(t, e),
			"[]=",
			R(r, e)
		].join("")];
		case "colon-list-separator": return (t) => (n, r) => r === void 0 || e.skipNull && r === null || e.skipEmptyString && r === "" ? n : r === null ? [...n, [R(t, e), ":list="].join("")] : [...n, [
			R(t, e),
			":list=",
			R(r, e)
		].join("")];
		case "comma":
		case "separator":
		case "bracket-separator": {
			let t = e.arrayFormat === "bracket-separator" ? "[]=" : "=";
			return (n) => (r, i) => i === void 0 || e.skipNull && i === null || e.skipEmptyString && i === "" ? r : (i = i === null ? "" : i, r.length === 0 ? [[
				R(n, e),
				t,
				R(i, e)
			].join("")] : [[r, R(i, e)].join(e.arrayFormatSeparator)]);
		}
		default: return (t) => (n, r) => r === void 0 || e.skipNull && r === null || e.skipEmptyString && r === "" ? n : r === null ? [...n, R(t, e)] : [...n, [
			R(t, e),
			"=",
			R(r, e)
		].join("")];
	}
}
function Ne(e) {
	let t;
	switch (e.arrayFormat) {
		case "index": return (e, n, r) => {
			if (t = /\[(\d*)]$/.exec(e), e = e.replace(/\[\d*]$/, ""), !t) {
				r[e] = n;
				return;
			}
			r[e] === void 0 && (r[e] = {}), r[e][t[1]] = n;
		};
		case "bracket": return (e, n, r) => {
			if (t = /(\[])$/.exec(e), e = e.replace(/\[]$/, ""), !t) {
				r[e] = n;
				return;
			}
			if (r[e] === void 0) {
				r[e] = [n];
				return;
			}
			r[e] = [...r[e], n];
		};
		case "colon-list-separator": return (e, n, r) => {
			if (t = /(:list)$/.exec(e), e = e.replace(/:list$/, ""), !t) {
				r[e] = n;
				return;
			}
			if (r[e] === void 0) {
				r[e] = [n];
				return;
			}
			r[e] = [...r[e], n];
		};
		case "comma":
		case "separator": return (t, n, r) => {
			r[t] = typeof n == "string" && n.includes(e.arrayFormatSeparator) ? n.split(e.arrayFormatSeparator).map((t) => z(t, e)) : n === null ? n : z(n, e);
		};
		case "bracket-separator": return (t, n, r) => {
			let i = /(\[])$/.test(t);
			if (t = t.replace(/\[]$/, ""), !i) {
				r[t] = n && z(n, e);
				return;
			}
			let a = n === null ? [] : z(n, e).split(e.arrayFormatSeparator);
			if (r[t] === void 0) {
				r[t] = a;
				return;
			}
			r[t] = [...r[t], ...a];
		};
		default: return (e, t, n) => {
			if (n[e] === void 0) {
				n[e] = t;
				return;
			}
			n[e] = [...[n[e]].flat(), t];
		};
	}
}
function L(e) {
	if (typeof e != "string" || e.length !== 1) throw TypeError("arrayFormatSeparator must be single character string");
}
function R(e, t) {
	return t.encode ? t.strict ? je(e) : encodeURIComponent(e) : e;
}
function z(e, t) {
	return t.decode ? De(e) : e;
}
function B(e) {
	return Array.isArray(e) ? e.sort() : typeof e == "object" ? B(Object.keys(e)).sort((e, t) => Number(e) - Number(t)).map((t) => e[t]) : e;
}
function V(e) {
	let t = e.indexOf("#");
	return t !== -1 && (e = e.slice(0, t)), e;
}
function Pe(e) {
	let t = "", n = e.indexOf("#");
	return n !== -1 && (t = e.slice(n)), t;
}
function Fe(e, t, n) {
	return n === "string" && typeof e == "string" ? e : typeof n == "function" && typeof e == "string" ? n(e) : n === "boolean" && e === null ? !0 : n === "boolean" && e !== null && (e.toLowerCase() === "true" || e.toLowerCase() === "false") ? e.toLowerCase() === "true" : n === "boolean" && e !== null && (e.toLowerCase() === "1" || e.toLowerCase() === "0") ? e.toLowerCase() === "1" : n === "string[]" && t.arrayFormat !== "none" && typeof e == "string" ? [e] : n === "number[]" && t.arrayFormat !== "none" && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" ? [Number(e)] : n === "number" && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" ? Number(e) : t.parseBooleans && e !== null && (e.toLowerCase() === "true" || e.toLowerCase() === "false") ? e.toLowerCase() === "true" : t.parseNumbers && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" ? Number(e) : e;
}
function H(e) {
	e = V(e);
	let t = e.indexOf("?");
	return t === -1 ? "" : e.slice(t + 1);
}
function U(e, t) {
	t = {
		decode: !0,
		sort: !0,
		arrayFormat: "none",
		arrayFormatSeparator: ",",
		parseNumbers: !1,
		parseBooleans: !1,
		types: Object.create(null),
		...t
	}, L(t.arrayFormatSeparator);
	let n = Ne(t), r = Object.create(null);
	if (typeof e != "string" || (e = e.trim().replace(/^[?#&]/, ""), !e)) return r;
	for (let i of e.split("&")) {
		if (i === "") continue;
		let e = t.decode ? i.replaceAll("+", " ") : i, [a, o] = F(e, "=");
		a === void 0 && (a = e), o = o === void 0 ? null : [
			"comma",
			"separator",
			"bracket-separator"
		].includes(t.arrayFormat) ? o : z(o, t), n(z(a, t), o, r);
	}
	for (let [e, n] of Object.entries(r)) if (typeof n == "object" && n && t.types[e] !== "string") for (let [r, i] of Object.entries(n)) {
		let a = t.types[e], o = typeof a == "function" ? a : a ? a.replace("[]", "") : void 0;
		n[r] = Fe(i, t, o);
	}
	else typeof n == "object" && n && t.types[e] === "string" ? r[e] = Object.values(n).join(t.arrayFormatSeparator) : r[e] = Fe(n, t, t.types[e]);
	return t.sort === !1 ? r : (t.sort === !0 ? Object.keys(r).sort() : Object.keys(r).sort(t.sort)).reduce((e, t) => {
		let n = r[t];
		return e[t] = n && typeof n == "object" && !Array.isArray(n) ? B(n) : n, e;
	}, Object.create(null));
}
function W(e, t) {
	if (!e) return "";
	t = {
		encode: !0,
		strict: !0,
		arrayFormat: "none",
		arrayFormatSeparator: ",",
		...t
	}, L(t.arrayFormatSeparator);
	let n = (n) => t.skipNull && Ae(e[n]) || t.skipEmptyString && e[n] === "", r = Me(t), i = {};
	for (let [t, r] of Object.entries(e)) n(t) || (i[t] = r);
	let a = Object.keys(i);
	return t.sort !== !1 && a.sort(t.sort), a.map((n) => {
		let i = e[n];
		if (t.replacer && (i = t.replacer(n, i), i === void 0) || i === void 0) return "";
		if (i === null) return R(n, t);
		if (Array.isArray(i)) {
			if (i.length === 0 && t.arrayFormat === "bracket-separator") return R(n, t) + "[]";
			let e = i;
			return t.replacer && (e = i.map((e, r) => t.replacer(`${n}[${r}]`, e)).filter((e) => e !== void 0)), e.reduce(r(n), []).join("&");
		}
		return R(n, t) + "=" + R(i, t);
	}).filter((e) => e.length > 0).join("&");
}
function G(e, t) {
	t = {
		decode: !0,
		...t
	};
	let [n, r] = F(e, "#");
	return n === void 0 && (n = e), {
		url: n?.split("?")?.[0] ?? "",
		query: U(H(e), t),
		...t && t.parseFragmentIdentifier && r ? { fragmentIdentifier: z(r, t) } : {}
	};
}
function K(e, t) {
	t = {
		encode: !0,
		strict: !0,
		[I]: !0,
		...t
	};
	let n = V(e.url).split("?")[0] || "", r = W({
		...U(H(e.url), {
			sort: !1,
			...t
		}),
		...e.query
	}, t);
	r &&= `?${r}`;
	let i = Pe(e.url);
	if (typeof e.fragmentIdentifier == "string") {
		let r = new URL(n);
		r.hash = e.fragmentIdentifier, i = t[I] ? r.hash : `#${e.fragmentIdentifier}`;
	}
	return `${n}${r}${i}`;
}
function Ie(e, t, n) {
	n = {
		parseFragmentIdentifier: !0,
		[I]: !1,
		...n
	};
	let { url: r, query: i, fragmentIdentifier: a } = G(e, n);
	return K({
		url: r,
		query: Oe(i, t),
		fragmentIdentifier: a
	}, n);
}
function Le(e, t, n) {
	return Ie(e, Array.isArray(t) ? (e) => !t.includes(e) : (e, n) => !t(e, n), n);
}
//#endregion
//#region ../../node_modules/.pnpm/query-string@9.3.1/node_modules/query-string/index.js
var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
	let t = [];
	if (!e) return {
		results: t,
		remaining: ""
	};
	let n = e.split(/\n\n/), r = "";
	for (let e = 0; e < n.length; e++) {
		let i = n?.[e]?.trim();
		if (!i) continue;
		if (!i.startsWith("data:") && !i.startsWith("error:")) {
			r += i;
			continue;
		}
		let a = i.slice(5).trim();
		try {
			let e = JSON.parse(a);
			t.push(e);
		} catch {
			r += i;
		}
	}
	return {
		results: t,
		remaining: r
	};
}, J = async (e) => {
	try {
		return {
			error: !0,
			data: await e.json()
		};
	} catch {
		return {
			error: !0,
			message: e.statusText
		};
	}
}, Be = async (e) => {
	let t = e.method || "POST", n = e.url;
	e.params && (n = `${n}?${Re.stringify(e.params)}`);
	let r = await fetch(n, {
		method: t,
		body: t === "POST" ? JSON.stringify(e.data) : null,
		signal: e.signal,
		headers: {
			"Content-Type": "application/json",
			...e.headers
		}
	});
	return r.ok ? {
		reader: r?.body?.getReader(),
		decoder: new TextDecoder("utf-8", { fatal: !0 })
	} : await J(r);
}, Y = (e) => {
	let t = new FormData(), n = (e, n) => {
		n instanceof File ? t.append(e, n) : typeof n == "object" && n ? t.append(e, JSON.stringify(n)) : n != null && t.append(e, n);
	};
	for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && n(t, e[t]);
	return t;
}, Ve = async (e) => {
	let { url: t } = e, n = await fetch(t, {
		method: "POST",
		body: Y(e.data),
		signal: e.signal
	});
	return n.ok ? {
		reader: n?.body?.getReader(),
		decoder: new TextDecoder("utf-8", { fatal: !0 })
	} : await J(n);
}, He = async (e, t, n, r = 200) => {
	class i {
		buffer = [];
		add(e) {
			this.buffer.push(e);
		}
		flush() {
			if (this.buffer.length > 0) {
				let e = [...this.buffer];
				this.buffer = [], e.forEach((e) => n(e));
			}
		}
		getBuffer() {
			return this.buffer;
		}
	}
	let a = new i(), o = (0, q.throttle)(() => {
		a.flush();
	}, r), s = !0, c = "";
	for (; s;) {
		let { done: n, value: r } = await e.read();
		try {
			if (c += t.decode(r, { stream: !0 }), !c.startsWith("data:") && !c.startsWith("error:")) try {
				let e = JSON.parse(c);
				a.add({ error: e }), c = "", o();
				continue;
			} catch {}
			if (c.startsWith("error:")) {
				let e = c.slice(7).trim(), t = JSON.parse(e);
				a.add({ error: t }), c = "";
			} else {
				let { results: e, remaining: t } = ze(c);
				e.forEach((e) => {
					a.add(e);
				}), c = t;
			}
			o();
		} catch (e) {
			a.add({ error: e });
		}
		if (n) {
			if (c += t.decode(), c) {
				let { results: e, remaining: t } = ze(c);
				e.forEach((e) => a.add(e));
			}
			a.flush(), s = !1;
			break;
		}
	}
}, Ue = async (e, t, n) => {
	if (!e) return;
	let r = e.split("\n");
	for (let e of r) {
		let r = e.trim();
		if (r.startsWith("data: ")) {
			let e = r.slice(6).trim();
			try {
				e !== "[DONE]" && t(JSON.parse(e), n);
			} catch (t) {
				console.error("Failed to parse JSON from line:", e, t);
			}
		} else if (r.startsWith("error:")) {
			let e = r.slice(7).trim();
			try {
				t({
					error: JSON.parse(e),
					done: n
				});
			} catch (t) {
				console.error("Failed to parse error JSON from line:", e, t);
			}
		}
	}
}, We = async (e, t, n, r = 200) => {
	let i = "";
	class a {
		buffer = [];
		failed = !1;
		isFlushing = !1;
		callback;
		constructor(e) {
			this.callback = e;
		}
		add(e) {
			this.buffer.push(e);
		}
		async flush(e) {
			if (this.buffer.length === 0 && e) {
				this.callback({}, e);
				return;
			}
			if (!(this.buffer.length === 0 || this.isFlushing)) {
				for (this.failed = !1, this.isFlushing = !0; this.buffer.length > 0;) {
					let t = this.buffer.shift();
					try {
						Ue(t, this.callback, e);
					} catch (e) {
						console.error("Error processing buffer:", e), this.failed = !0, this.buffer.unshift(t);
						break;
					}
				}
				e && this.callback({}, e), this.isFlushing = !1;
			}
		}
		getBuffer() {
			return this.buffer;
		}
	}
	let o = new a(n), s = (0, q.throttle)(async () => {
		o.flush();
	}, r);
	for (;;) {
		let { done: n, value: r } = await e?.read?.() || {
			done: !0,
			value: null
		};
		if (console.log("done:", n, "value:", r), n) {
			i && o.add(i), o.flush(n);
			break;
		}
		try {
			i += t.decode(r, { stream: !0 });
			let e = i.split("\n");
			i = e.pop() || "", console.log("buffer>>>>>>>>>>>>>:", i);
			for (let t of e) o.add(t);
			s();
		} catch (e) {
			console.log("Error reading stream data:", e);
		}
	}
}, Ge = (e) => new Promise((t, n) => {
	let r = new FileReader();
	r.readAsDataURL(e), r.onload = () => t(r.result), r.onerror = (e) => n(e);
}), X = async (e, t) => new Promise((n, r) => {
	let i = new Blob([e], { type: t }), a = Q(i.size), o = document.createElement("audio"), s = URL.createObjectURL(i);
	o.src = s, o.addEventListener("loadedmetadata", () => {
		let e = o.duration;
		n({
			data: i,
			size: a,
			type: t,
			duration: Math.ceil(e),
			url: s
		});
	}), o.addEventListener("ended", () => {
		URL.revokeObjectURL(o.src);
	}), o.addEventListener("error", () => {
		URL.revokeObjectURL(s), ee.error("Failed to load audio metadata invalid file"), r(/* @__PURE__ */ Error("Failed to load audio metadata invalid file"));
	});
}), Ke = async (e) => new Promise((t, n) => {
	let r = new FileReader();
	r.onload = async function(r) {
		try {
			let n = r.target.result;
			t({
				...await X(n, e.type) || {},
				name: e.name
			});
		} catch (e) {
			n(e);
		}
	}, r.onerror = (e) => n(e), r.readAsArrayBuffer(e);
});
//#endregion
//#region src/lib/utils/pcm-to-wav.ts
function Z(e, t, n) {
	for (let r = 0; r < n.length; r++) e.setUint8(t + r, n.charCodeAt(r));
}
function qe(e, t = 24e3, n = 1, r = 16) {
	let i = new Uint8Array(e), a = i.length, o = new ArrayBuffer(44 + a), s = new DataView(o);
	return Z(s, 0, "RIFF"), s.setUint32(4, 36 + a, !0), Z(s, 8, "WAVE"), Z(s, 12, "fmt "), s.setUint32(16, 16, !0), s.setUint16(20, 1, !0), s.setUint16(22, n, !0), s.setUint32(24, t, !0), s.setUint32(28, t * n * (r / 8), !0), s.setUint16(32, r / 8 * n, !0), s.setUint16(34, r, !0), Z(s, 36, "data"), s.setUint32(40, a, !0), new Uint8Array(o).set(i, 44), new Blob([o], { type: "audio/wav" });
}
//#endregion
//#region src/lib/utils/index.ts
var Je = /* @__PURE__ */ n({
	base64ToFile: () => lt,
	convertFileSize: () => Q,
	convertFileSizeByUnit: () => Qe,
	convertFileToBase64: () => Ge,
	cosineSimilarity: () => it,
	createFormData: () => Y,
	downloadFile: () => A,
	errorHandler: () => J,
	exportJsonToExcel: () => i,
	fetchChunkedData: () => Be,
	fetchChunkedDataPostFormData: () => Ve,
	formatLargeNumber: () => $,
	formatNumber: () => tt,
	formatTime: () => et,
	genColors: () => dt,
	generateRandomNumber: () => st,
	handleBatchRequest: () => Ze,
	isHTMLDocumentString: () => ot,
	isNotEmptyValue: () => Ye,
	isNotEmptyValueAllowNull: () => Xe,
	isOnline: () => ut,
	loadAudioData: () => X,
	loadLanguageConfig: () => nt,
	parseParamsString: () => ft,
	pcmToWav: () => qe,
	platformCall: () => $e,
	readAudioFile: () => Ke,
	readBlob: () => rt,
	readEpubContent: () => a,
	readExcelContent: () => r,
	readHtmlContent: () => s,
	readLargeStreamData: () => We,
	readPDFContent: () => o,
	readPptxContent: () => c,
	readStreamData: () => He,
	readWordContent: () => l
}), Ye = (e) => Array.isArray(e) ? e.length > 0 : !!e || e === 0 || e === !1, Xe = (e) => Array.isArray(e) ? e.length > 0 : !!e || e === 0 || e === !1 || e === null, Ze = async (e, t) => Promise.allSettled(e.map((e) => t(e))), Q = (e, t = 1, n = !1) => {
	if (!e) return n ? "" : 0;
	let r = 1024, i = [
		"B",
		"KiB",
		"MiB",
		"GiB",
		"TiB"
	], a = [
		0,
		1,
		1,
		2,
		2
	], o = e, s = 0;
	for (; o >= r && s < i.length - 1;) o /= r, s++;
	return `${q.default.round(o, a[s])} ${i[s]}`;
}, Qe = (e) => {
	let { sizeInBytes: t, allowEmpty: n = !1, defaultUnit: r = "B" } = e;
	if (!t) return n ? "" : 0;
	let i = 1024, a = [
		"B",
		"KiB",
		"MiB",
		"GiB",
		"TiB"
	], o = [
		0,
		1,
		1,
		2,
		2
	], s = t, c = a.indexOf(r);
	for (; s >= i && c < a.length - 1;) s /= i, c++;
	return `${q.default.round(s, o[c])} ${a[c]}`;
}, $e = () => {
	let e = navigator.userAgent;
	return {
		isMac: e.indexOf("Mac") !== -1,
		isWin: e.indexOf("Win") !== -1
	};
}, et = (e) => {
	if (isNaN(e) || !e || e === Infinity) return "00:00";
	let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.floor(e % 60), i = [
		t.toString().padStart(2, "0"),
		n.toString().padStart(2, "0"),
		r.toString().padStart(2, "0")
	];
	return t > 0 ? `${i[0]}:${i[1]}:${i[2]}` : `${i[1]}:${i[2]}`;
}, tt = (e) => e ? e >= 1e6 ? (e / 1e6).toFixed(2) + "M" : e >= 1e3 ? (e / 1e3).toFixed(2) + "k" : e.toString() : "0", $ = (e) => typeof e != "number" || isNaN(e) ? e : e >= 1e9 ? (e / 1e9).toFixed(1).replace(/\.0$/, "") + "B" : e >= 1e6 ? (e / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : e;
function nt(t) {
	let n = e.context(`./${t}`, !1, /\.ts$/), r = {};
	return n.keys().forEach((e) => {
		let t = n(e).default, i = e.replace(/(\.\/|\.ts)/g, "");
		r[i] = t;
	}), r;
}
function rt(e) {
	return new Promise((t) => {
		let n = new FileReader();
		n.onload = function(e) {
			t(e.target.result);
		}, n.readAsText(e, "utf-8");
	});
}
var it = (e, t) => {
	if (e.length !== t.length) throw Error("both vectors must have the same length");
	let n = e.reduce((e, n, r) => e + n * (t?.[r] || 0), 0), r = Math.sqrt(e.reduce((e, t) => e + t * t, 0)), i = Math.sqrt(t.reduce((e, t) => e + t * t, 0));
	if (r === 0 || i === 0) throw Error("both vectors must have a length greater than 0");
	return n / (r * i);
}, at = /^<html>(.|\n|\r)*<\/html>$/i, ot = (e) => at.test(e?.trim()), st = () => Math.floor(Math.random() * 4294967296);
function ct(e, t = "", n = 512) {
	try {
		let r = e.replace(/^data:image\/[^;]+;base64,/, ""), i = atob(r), a = [];
		for (let e = 0; e < i.length; e += n) {
			let t = i.slice(e, e + n), r = Array(t.length);
			for (let e = 0; e < t.length; e++) r[e] = t.charCodeAt(e);
			let o = new Uint8Array(r);
			a.push(o);
		}
		return new Blob(a, { type: t });
	} catch {
		return null;
	}
}
var lt = (e, t) => {
	try {
		if (!e) return null;
		console.log("base64String:", e);
		let n = e.match(/data:(.*?);base64,/);
		if (!n) throw Error("Invalid base64 string");
		let r = n[1], i = ct(e, r);
		if (!i) throw Error("Failed to convert base64 to blob");
		return new File([i], t || r, { type: r });
	} catch {
		return null;
	}
}, ut = () => window.navigator.onLine, dt = ({ color: e, alpha1: t, alpha2: n }) => {
	let r = p(e), i = t || r.getAlpha(), a = n || r.getAlpha();
	return [r.setAlpha(i).toRgbString(), r.setAlpha(a).toRgbString()];
}, ft = (e) => {
	if (!e || !e.trim()) return [];
	let t = e.replace(/\n/g, " ").replace(/\s\\\s/g, " ").replace(/\s+/g, " ").trim(), n = [], r = [], i = "", a = !1, o = "", s = 0;
	for (let e = 0; e < t.length; e++) {
		let n = t[e];
		(n === "\"" || n === "'") && (e === 0 || t[e - 1] !== "\\") ? a ? n === o ? (a = !1, o = "", i += n) : i += n : (a = !0, o = n, i += n) : n === "{" && !a ? (s++, i += n) : n === "}" && !a ? (s--, i += n) : n === " " && !a && s === 0 ? i &&= (r.push(i), "") : i += n;
	}
	i && r.push(i);
	for (let e = 0; e < r.length; e++) {
		let t = r[e];
		if (t?.includes("=")) n.push(t);
		else if (t?.startsWith("-")) {
			let i = r[e + 1];
			i && !i.startsWith("-") && !i.includes("=") ? (i.startsWith("\"") || i.startsWith("'") ? n.push(`${t} ${i}`) : n.push(`${t}=${i}`), e++) : n.push(t);
		}
	}
	return n;
};
//#endregion
export { Re as A, Ke as C, Ve as D, Be as E, We as O, X as S, J as T, $e as _, $ as a, qe as b, dt as c, ot as d, Ye as f, ft as g, nt as h, it as i, A as j, He as k, st as l, ut as m, Q as n, tt as o, Xe as p, Qe as r, et as s, lt as t, Ze as u, rt as v, Y as w, Ge as x, Je as y };
