import { g as e, h as t, p as n } from "./src-BuisGndr.js";
import { F as r, f as i, m as a, r as o, s } from "./chunk-ABZYJK2D-DDrmE3Q7.js";
import "./math-H49DsxYR.js";
import { t as c } from "./dist-zNcLEPGR.js";
import { C as l, D as u, F as d, H as f, M as p, N as m, O as ee, P as h, R as g, S as _, T as te, U as ne, V as re, _ as ie, b as v, c as y, d as ae, g as oe, j as se, p as ce, t as le, x as ue } from "./_createAssigner-IEX8lwxm.js";
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.js
function de(e) {
	this._context = e;
}
de.prototype = {
	areaStart: function() {
		this._line = 0;
	},
	areaEnd: function() {
		this._line = NaN;
	},
	lineStart: function() {
		this._point = 0;
	},
	lineEnd: function() {
		(this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
	},
	point: function(e, t) {
		switch (e = +e, t = +t, this._point) {
			case 0:
				this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
				break;
			case 1: this._point = 2;
			default:
				this._context.lineTo(e, t);
				break;
		}
	}
};
function fe(e) {
	return new de(e);
}
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/bump.js
var pe = class {
	constructor(e, t) {
		this._context = e, this._x = t;
	}
	areaStart() {
		this._line = 0;
	}
	areaEnd() {
		this._line = NaN;
	}
	lineStart() {
		this._point = 0;
	}
	lineEnd() {
		(this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
	}
	point(e, t) {
		switch (e = +e, t = +t, this._point) {
			case 0:
				this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
				break;
			case 1: this._point = 2;
			default:
				this._x ? this._context.bezierCurveTo(this._x0 = (this._x0 + e) / 2, this._y0, this._x0, t, e, t) : this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + t) / 2, e, this._y0, e, t);
				break;
		}
		this._x0 = e, this._y0 = t;
	}
};
function me(e) {
	return new pe(e, !0);
}
function he(e) {
	return new pe(e, !1);
}
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/noop.js
function b() {}
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basis.js
function x(e, t, n) {
	e._context.bezierCurveTo((2 * e._x0 + e._x1) / 3, (2 * e._y0 + e._y1) / 3, (e._x0 + 2 * e._x1) / 3, (e._y0 + 2 * e._y1) / 3, (e._x0 + 4 * e._x1 + t) / 6, (e._y0 + 4 * e._y1 + n) / 6);
}
function S(e) {
	this._context = e;
}
S.prototype = {
	areaStart: function() {
		this._line = 0;
	},
	areaEnd: function() {
		this._line = NaN;
	},
	lineStart: function() {
		this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0;
	},
	lineEnd: function() {
		switch (this._point) {
			case 3: x(this, this._x1, this._y1);
			case 2:
				this._context.lineTo(this._x1, this._y1);
				break;
		}
		(this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
	},
	point: function(e, t) {
		switch (e = +e, t = +t, this._point) {
			case 0:
				this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
				break;
			case 1:
				this._point = 2;
				break;
			case 2: this._point = 3, this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
			default:
				x(this, e, t);
				break;
		}
		this._x0 = this._x1, this._x1 = e, this._y0 = this._y1, this._y1 = t;
	}
};
function ge(e) {
	return new S(e);
}
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basisClosed.js
function _e(e) {
	this._context = e;
}
_e.prototype = {
	areaStart: b,
	areaEnd: b,
	lineStart: function() {
		this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN, this._point = 0;
	},
	lineEnd: function() {
		switch (this._point) {
			case 1:
				this._context.moveTo(this._x2, this._y2), this._context.closePath();
				break;
			case 2:
				this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3), this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3), this._context.closePath();
				break;
			case 3:
				this.point(this._x2, this._y2), this.point(this._x3, this._y3), this.point(this._x4, this._y4);
				break;
		}
	},
	point: function(e, t) {
		switch (e = +e, t = +t, this._point) {
			case 0:
				this._point = 1, this._x2 = e, this._y2 = t;
				break;
			case 1:
				this._point = 2, this._x3 = e, this._y3 = t;
				break;
			case 2:
				this._point = 3, this._x4 = e, this._y4 = t, this._context.moveTo((this._x0 + 4 * this._x1 + e) / 6, (this._y0 + 4 * this._y1 + t) / 6);
				break;
			default:
				x(this, e, t);
				break;
		}
		this._x0 = this._x1, this._x1 = e, this._y0 = this._y1, this._y1 = t;
	}
};
function ve(e) {
	return new _e(e);
}
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basisOpen.js
function ye(e) {
	this._context = e;
}
ye.prototype = {
	areaStart: function() {
		this._line = 0;
	},
	areaEnd: function() {
		this._line = NaN;
	},
	lineStart: function() {
		this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0;
	},
	lineEnd: function() {
		(this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
	},
	point: function(e, t) {
		switch (e = +e, t = +t, this._point) {
			case 0:
				this._point = 1;
				break;
			case 1:
				this._point = 2;
				break;
			case 2:
				this._point = 3;
				var n = (this._x0 + 4 * this._x1 + e) / 6, r = (this._y0 + 4 * this._y1 + t) / 6;
				this._line ? this._context.lineTo(n, r) : this._context.moveTo(n, r);
				break;
			case 3: this._point = 4;
			default:
				x(this, e, t);
				break;
		}
		this._x0 = this._x1, this._x1 = e, this._y0 = this._y1, this._y1 = t;
	}
};
function be(e) {
	return new ye(e);
}
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/bundle.js
function C(e, t) {
	this._basis = new S(e), this._beta = t;
}
C.prototype = {
	lineStart: function() {
		this._x = [], this._y = [], this._basis.lineStart();
	},
	lineEnd: function() {
		var e = this._x, t = this._y, n = e.length - 1;
		if (n > 0) for (var r = e[0], i = t[0], a = e[n] - r, o = t[n] - i, s = -1, c; ++s <= n;) c = s / n, this._basis.point(this._beta * e[s] + (1 - this._beta) * (r + c * a), this._beta * t[s] + (1 - this._beta) * (i + c * o));
		this._x = this._y = null, this._basis.lineEnd();
	},
	point: function(e, t) {
		this._x.push(+e), this._y.push(+t);
	}
};
var xe = (function e(t) {
	function n(e) {
		return t === 1 ? new S(e) : new C(e, t);
	}
	return n.beta = function(t) {
		return e(+t);
	}, n;
})(.85);
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinal.js
function w(e, t, n) {
	e._context.bezierCurveTo(e._x1 + e._k * (e._x2 - e._x0), e._y1 + e._k * (e._y2 - e._y0), e._x2 + e._k * (e._x1 - t), e._y2 + e._k * (e._y1 - n), e._x2, e._y2);
}
function T(e, t) {
	this._context = e, this._k = (1 - t) / 6;
}
T.prototype = {
	areaStart: function() {
		this._line = 0;
	},
	areaEnd: function() {
		this._line = NaN;
	},
	lineStart: function() {
		this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._point = 0;
	},
	lineEnd: function() {
		switch (this._point) {
			case 2:
				this._context.lineTo(this._x2, this._y2);
				break;
			case 3:
				w(this, this._x1, this._y1);
				break;
		}
		(this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
	},
	point: function(e, t) {
		switch (e = +e, t = +t, this._point) {
			case 0:
				this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
				break;
			case 1:
				this._point = 2, this._x1 = e, this._y1 = t;
				break;
			case 2: this._point = 3;
			default:
				w(this, e, t);
				break;
		}
		this._x0 = this._x1, this._x1 = this._x2, this._x2 = e, this._y0 = this._y1, this._y1 = this._y2, this._y2 = t;
	}
};
var E = (function e(t) {
	function n(e) {
		return new T(e, t);
	}
	return n.tension = function(t) {
		return e(+t);
	}, n;
})(0);
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinalClosed.js
function D(e, t) {
	this._context = e, this._k = (1 - t) / 6;
}
D.prototype = {
	areaStart: b,
	areaEnd: b,
	lineStart: function() {
		this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._point = 0;
	},
	lineEnd: function() {
		switch (this._point) {
			case 1:
				this._context.moveTo(this._x3, this._y3), this._context.closePath();
				break;
			case 2:
				this._context.lineTo(this._x3, this._y3), this._context.closePath();
				break;
			case 3:
				this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5);
				break;
		}
	},
	point: function(e, t) {
		switch (e = +e, t = +t, this._point) {
			case 0:
				this._point = 1, this._x3 = e, this._y3 = t;
				break;
			case 1:
				this._point = 2, this._context.moveTo(this._x4 = e, this._y4 = t);
				break;
			case 2:
				this._point = 3, this._x5 = e, this._y5 = t;
				break;
			default:
				w(this, e, t);
				break;
		}
		this._x0 = this._x1, this._x1 = this._x2, this._x2 = e, this._y0 = this._y1, this._y1 = this._y2, this._y2 = t;
	}
};
var Se = (function e(t) {
	function n(e) {
		return new D(e, t);
	}
	return n.tension = function(t) {
		return e(+t);
	}, n;
})(0);
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinalOpen.js
function O(e, t) {
	this._context = e, this._k = (1 - t) / 6;
}
O.prototype = {
	areaStart: function() {
		this._line = 0;
	},
	areaEnd: function() {
		this._line = NaN;
	},
	lineStart: function() {
		this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._point = 0;
	},
	lineEnd: function() {
		(this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
	},
	point: function(e, t) {
		switch (e = +e, t = +t, this._point) {
			case 0:
				this._point = 1;
				break;
			case 1:
				this._point = 2;
				break;
			case 2:
				this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
				break;
			case 3: this._point = 4;
			default:
				w(this, e, t);
				break;
		}
		this._x0 = this._x1, this._x1 = this._x2, this._x2 = e, this._y0 = this._y1, this._y1 = this._y2, this._y2 = t;
	}
};
var Ce = (function e(t) {
	function n(e) {
		return new O(e, t);
	}
	return n.tension = function(t) {
		return e(+t);
	}, n;
})(0);
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRom.js
function k(e, t, n) {
	var r = e._x1, i = e._y1, a = e._x2, o = e._y2;
	if (e._l01_a > 1e-12) {
		var s = 2 * e._l01_2a + 3 * e._l01_a * e._l12_a + e._l12_2a, c = 3 * e._l01_a * (e._l01_a + e._l12_a);
		r = (r * s - e._x0 * e._l12_2a + e._x2 * e._l01_2a) / c, i = (i * s - e._y0 * e._l12_2a + e._y2 * e._l01_2a) / c;
	}
	if (e._l23_a > 1e-12) {
		var l = 2 * e._l23_2a + 3 * e._l23_a * e._l12_a + e._l12_2a, u = 3 * e._l23_a * (e._l23_a + e._l12_a);
		a = (a * l + e._x1 * e._l23_2a - t * e._l12_2a) / u, o = (o * l + e._y1 * e._l23_2a - n * e._l12_2a) / u;
	}
	e._context.bezierCurveTo(r, i, a, o, e._x2, e._y2);
}
function A(e, t) {
	this._context = e, this._alpha = t;
}
A.prototype = {
	areaStart: function() {
		this._line = 0;
	},
	areaEnd: function() {
		this._line = NaN;
	},
	lineStart: function() {
		this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
	},
	lineEnd: function() {
		switch (this._point) {
			case 2:
				this._context.lineTo(this._x2, this._y2);
				break;
			case 3:
				this.point(this._x2, this._y2);
				break;
		}
		(this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
	},
	point: function(e, t) {
		if (e = +e, t = +t, this._point) {
			var n = this._x2 - e, r = this._y2 - t;
			this._l23_a = Math.sqrt(this._l23_2a = (n * n + r * r) ** +this._alpha);
		}
		switch (this._point) {
			case 0:
				this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
				break;
			case 1:
				this._point = 2;
				break;
			case 2: this._point = 3;
			default:
				k(this, e, t);
				break;
		}
		this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = e, this._y0 = this._y1, this._y1 = this._y2, this._y2 = t;
	}
};
var j = (function e(t) {
	function n(e) {
		return t ? new A(e, t) : new T(e, 0);
	}
	return n.alpha = function(t) {
		return e(+t);
	}, n;
})(.5);
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRomClosed.js
function M(e, t) {
	this._context = e, this._alpha = t;
}
M.prototype = {
	areaStart: b,
	areaEnd: b,
	lineStart: function() {
		this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
	},
	lineEnd: function() {
		switch (this._point) {
			case 1:
				this._context.moveTo(this._x3, this._y3), this._context.closePath();
				break;
			case 2:
				this._context.lineTo(this._x3, this._y3), this._context.closePath();
				break;
			case 3:
				this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5);
				break;
		}
	},
	point: function(e, t) {
		if (e = +e, t = +t, this._point) {
			var n = this._x2 - e, r = this._y2 - t;
			this._l23_a = Math.sqrt(this._l23_2a = (n * n + r * r) ** +this._alpha);
		}
		switch (this._point) {
			case 0:
				this._point = 1, this._x3 = e, this._y3 = t;
				break;
			case 1:
				this._point = 2, this._context.moveTo(this._x4 = e, this._y4 = t);
				break;
			case 2:
				this._point = 3, this._x5 = e, this._y5 = t;
				break;
			default:
				k(this, e, t);
				break;
		}
		this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = e, this._y0 = this._y1, this._y1 = this._y2, this._y2 = t;
	}
};
var we = (function e(t) {
	function n(e) {
		return t ? new M(e, t) : new D(e, 0);
	}
	return n.alpha = function(t) {
		return e(+t);
	}, n;
})(.5);
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRomOpen.js
function N(e, t) {
	this._context = e, this._alpha = t;
}
N.prototype = {
	areaStart: function() {
		this._line = 0;
	},
	areaEnd: function() {
		this._line = NaN;
	},
	lineStart: function() {
		this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
	},
	lineEnd: function() {
		(this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
	},
	point: function(e, t) {
		if (e = +e, t = +t, this._point) {
			var n = this._x2 - e, r = this._y2 - t;
			this._l23_a = Math.sqrt(this._l23_2a = (n * n + r * r) ** +this._alpha);
		}
		switch (this._point) {
			case 0:
				this._point = 1;
				break;
			case 1:
				this._point = 2;
				break;
			case 2:
				this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
				break;
			case 3: this._point = 4;
			default:
				k(this, e, t);
				break;
		}
		this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = e, this._y0 = this._y1, this._y1 = this._y2, this._y2 = t;
	}
};
var Te = (function e(t) {
	function n(e) {
		return t ? new N(e, t) : new O(e, 0);
	}
	return n.alpha = function(t) {
		return e(+t);
	}, n;
})(.5);
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linearClosed.js
function P(e) {
	this._context = e;
}
P.prototype = {
	areaStart: b,
	areaEnd: b,
	lineStart: function() {
		this._point = 0;
	},
	lineEnd: function() {
		this._point && this._context.closePath();
	},
	point: function(e, t) {
		e = +e, t = +t, this._point ? this._context.lineTo(e, t) : (this._point = 1, this._context.moveTo(e, t));
	}
};
function Ee(e) {
	return new P(e);
}
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/monotone.js
function F(e) {
	return e < 0 ? -1 : 1;
}
function I(e, t, n) {
	var r = e._x1 - e._x0, i = t - e._x1, a = (e._y1 - e._y0) / (r || i < 0 && -0), o = (n - e._y1) / (i || r < 0 && -0), s = (a * i + o * r) / (r + i);
	return (F(a) + F(o)) * Math.min(Math.abs(a), Math.abs(o), .5 * Math.abs(s)) || 0;
}
function L(e, t) {
	var n = e._x1 - e._x0;
	return n ? (3 * (e._y1 - e._y0) / n - t) / 2 : t;
}
function R(e, t, n) {
	var r = e._x0, i = e._y0, a = e._x1, o = e._y1, s = (a - r) / 3;
	e._context.bezierCurveTo(r + s, i + s * t, a - s, o - s * n, a, o);
}
function z(e) {
	this._context = e;
}
z.prototype = {
	areaStart: function() {
		this._line = 0;
	},
	areaEnd: function() {
		this._line = NaN;
	},
	lineStart: function() {
		this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN, this._point = 0;
	},
	lineEnd: function() {
		switch (this._point) {
			case 2:
				this._context.lineTo(this._x1, this._y1);
				break;
			case 3:
				R(this, this._t0, L(this, this._t0));
				break;
		}
		(this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
	},
	point: function(e, t) {
		var n = NaN;
		if (e = +e, t = +t, !(e === this._x1 && t === this._y1)) {
			switch (this._point) {
				case 0:
					this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
					break;
				case 1:
					this._point = 2;
					break;
				case 2:
					this._point = 3, R(this, L(this, n = I(this, e, t)), n);
					break;
				default:
					R(this, this._t0, n = I(this, e, t));
					break;
			}
			this._x0 = this._x1, this._x1 = e, this._y0 = this._y1, this._y1 = t, this._t0 = n;
		}
	}
};
function De(e) {
	this._context = new Oe(e);
}
(De.prototype = Object.create(z.prototype)).point = function(e, t) {
	z.prototype.point.call(this, t, e);
};
function Oe(e) {
	this._context = e;
}
Oe.prototype = {
	moveTo: function(e, t) {
		this._context.moveTo(t, e);
	},
	closePath: function() {
		this._context.closePath();
	},
	lineTo: function(e, t) {
		this._context.lineTo(t, e);
	},
	bezierCurveTo: function(e, t, n, r, i, a) {
		this._context.bezierCurveTo(t, e, r, n, a, i);
	}
};
function ke(e) {
	return new z(e);
}
function Ae(e) {
	return new De(e);
}
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/natural.js
function je(e) {
	this._context = e;
}
je.prototype = {
	areaStart: function() {
		this._line = 0;
	},
	areaEnd: function() {
		this._line = NaN;
	},
	lineStart: function() {
		this._x = [], this._y = [];
	},
	lineEnd: function() {
		var e = this._x, t = this._y, n = e.length;
		if (n) if (this._line ? this._context.lineTo(e[0], t[0]) : this._context.moveTo(e[0], t[0]), n === 2) this._context.lineTo(e[1], t[1]);
		else for (var r = Me(e), i = Me(t), a = 0, o = 1; o < n; ++a, ++o) this._context.bezierCurveTo(r[0][a], i[0][a], r[1][a], i[1][a], e[o], t[o]);
		(this._line || this._line !== 0 && n === 1) && this._context.closePath(), this._line = 1 - this._line, this._x = this._y = null;
	},
	point: function(e, t) {
		this._x.push(+e), this._y.push(+t);
	}
};
function Me(e) {
	var t, n = e.length - 1, r, i = Array(n), a = Array(n), o = Array(n);
	for (i[0] = 0, a[0] = 2, o[0] = e[0] + 2 * e[1], t = 1; t < n - 1; ++t) i[t] = 1, a[t] = 4, o[t] = 4 * e[t] + 2 * e[t + 1];
	for (i[n - 1] = 2, a[n - 1] = 7, o[n - 1] = 8 * e[n - 1] + e[n], t = 1; t < n; ++t) r = i[t] / a[t - 1], a[t] -= r, o[t] -= r * o[t - 1];
	for (i[n - 1] = o[n - 1] / a[n - 1], t = n - 2; t >= 0; --t) i[t] = (o[t] - i[t + 1]) / a[t];
	for (a[n - 1] = (e[n] + i[n - 1]) / 2, t = 0; t < n - 1; ++t) a[t] = 2 * e[t + 1] - i[t + 1];
	return [i, a];
}
function Ne(e) {
	return new je(e);
}
//#endregion
//#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/step.js
function B(e, t) {
	this._context = e, this._t = t;
}
B.prototype = {
	areaStart: function() {
		this._line = 0;
	},
	areaEnd: function() {
		this._line = NaN;
	},
	lineStart: function() {
		this._x = this._y = NaN, this._point = 0;
	},
	lineEnd: function() {
		0 < this._t && this._t < 1 && this._point === 2 && this._context.lineTo(this._x, this._y), (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line >= 0 && (this._t = 1 - this._t, this._line = 1 - this._line);
	},
	point: function(e, t) {
		switch (e = +e, t = +t, this._point) {
			case 0:
				this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
				break;
			case 1: this._point = 2;
			default:
				if (this._t <= 0) this._context.lineTo(this._x, t), this._context.lineTo(e, t);
				else {
					var n = this._x * (1 - this._t) + e * this._t;
					this._context.lineTo(n, this._y), this._context.lineTo(n, t);
				}
				break;
		}
		this._x = e, this._y = t;
	}
};
function Pe(e) {
	return new B(e, .5);
}
function Fe(e) {
	return new B(e, 0);
}
function Ie(e) {
	return new B(e, 1);
}
//#endregion
//#region node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignMergeValue.js
var Le = c();
function V(e, t, n) {
	(n !== void 0 && !g(e[t], n) || n === void 0 && !(t in e)) && m(e, t, n);
}
//#endregion
//#region node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isPlainObject.js
var Re = "[object Object]", ze = Function.prototype, Be = Object.prototype, Ve = ze.toString, He = Be.hasOwnProperty, Ue = Ve.call(Object);
function We(e) {
	if (!_(e) || ne(e) != Re) return !1;
	var t = te(e);
	if (t === null) return !0;
	var n = He.call(t, "constructor") && t.constructor;
	return typeof n == "function" && n instanceof n && Ve.call(n) == Ue;
}
//#endregion
//#region node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_safeGet.js
function H(e, t) {
	if (!(t === "constructor" && typeof e[t] == "function") && t != "__proto__") return e[t];
}
//#endregion
//#region node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPlainObject.js
function Ge(e) {
	return ae(e, y(e));
}
//#endregion
//#region node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMergeDeep.js
function Ke(e, t, n, r, i, a, o) {
	var s = H(e, n), c = H(t, n), d = o.get(c);
	if (d) {
		V(e, n, d);
		return;
	}
	var p = a ? a(s, c, n + "", e, t, o) : void 0, m = p === void 0;
	if (m) {
		var h = v(c), g = !h && oe(c), _ = !h && !g && ce(c);
		p = c, h || g || _ ? v(s) ? p = s : ie(s) ? p = u(s) : g ? (m = !1, p = se(c, !0)) : _ ? (m = !1, p = ee(c, !0)) : p = [] : We(c) || ue(c) ? (p = s, ue(s) ? p = Ge(s) : (!f(s) || re(s)) && (p = l(c))) : m = !1;
	}
	m && (o.set(c, p), i(p, c, r, a, o), o.delete(c)), V(e, n, p);
}
//#endregion
//#region node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMerge.js
function qe(e, t, n, r, i) {
	e !== t && p(t, function(a, o) {
		if (i ||= new h(), f(a)) Ke(e, t, o, n, qe, r, i);
		else {
			var s = r ? r(H(e, o), a, o + "", e, t, i) : void 0;
			s === void 0 && (s = a), V(e, o, s);
		}
	}, y);
}
//#endregion
//#region node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge.js
var Je = le(function(e, t, n) {
	qe(e, t, n);
}), Ye = {
	curveBasis: ge,
	curveBasisClosed: ve,
	curveBasisOpen: be,
	curveBumpX: me,
	curveBumpY: he,
	curveBundle: xe,
	curveCardinalClosed: Se,
	curveCardinalOpen: Ce,
	curveCardinal: E,
	curveCatmullRomClosed: we,
	curveCatmullRomOpen: Te,
	curveCatmullRom: j,
	curveLinear: fe,
	curveLinearClosed: Ee,
	curveMonotoneX: ke,
	curveMonotoneY: Ae,
	curveNatural: Ne,
	curveStep: Pe,
	curveStepAfter: Ie,
	curveStepBefore: Fe
}, Xe = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi, Ze = /* @__PURE__ */ t(function(e, t) {
	let n = Qe(e, /(?:init\b)|(?:initialize\b)/), a = {};
	if (Array.isArray(n)) {
		let e = n.map((e) => e.args);
		r(e), a = o(a, [...e]);
	} else a = n.args;
	if (!a) return;
	let s = i(e, t), c = "config";
	return a[c] !== void 0 && (s === "flowchart-v2" && (s = "flowchart"), a[s] = a[c], delete a[c]), a;
}, "detectInit"), Qe = /* @__PURE__ */ t(function(t, n = null) {
	try {
		let r = RegExp(`[%]{2}(?![{]${Xe.source})(?=[}][%]{2}).*
`, "ig");
		t = t.trim().replace(r, "").replace(/'/gm, "\""), e.debug(`Detecting diagram directive${n === null ? "" : " type:" + n} based on the text:${t}`);
		let i, o = [];
		for (; (i = a.exec(t)) !== null;) if (i.index === a.lastIndex && a.lastIndex++, i && !n || n && i[1]?.match(n) || n && i[2]?.match(n)) {
			let e = i[1] ? i[1] : i[2], t = i[3] ? i[3].trim() : i[4] ? JSON.parse(i[4].trim()) : null;
			o.push({
				type: e,
				args: t
			});
		}
		return o.length === 0 ? {
			type: t,
			args: null
		} : o.length === 1 ? o[0] : o;
	} catch (r) {
		return e.error(`ERROR: ${r.message} - Unable to parse directive type: '${n}' based on the text: '${t}'`), {
			type: void 0,
			args: null
		};
	}
}, "detectDirective"), $e = /* @__PURE__ */ t(function(e) {
	return e.replace(a, "");
}, "removeDirectives"), et = /* @__PURE__ */ t(function(e, t) {
	for (let [n, r] of t.entries()) if (r.match(e)) return n;
	return -1;
}, "isSubstringInArray");
function U(e, t) {
	return e ? Ye[`curve${e.charAt(0).toUpperCase() + e.slice(1)}`] ?? t : t;
}
t(U, "interpolateToCurve");
function tt(e, t) {
	let n = e.trim();
	if (n) return t.securityLevel === "loose" ? n : (0, Le.sanitizeUrl)(n);
}
t(tt, "formatUrl");
var nt = /* @__PURE__ */ t((t, ...n) => {
	let r = t.split("."), i = r.length - 1, a = r[i], o = window;
	for (let n = 0; n < i; n++) if (o = o[r[n]], !o) {
		e.error(`Function name: ${t} not found in window`);
		return;
	}
	o[a](...n);
}, "runFunc");
function W(e, t) {
	return !e || !t ? 0 : Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2);
}
t(W, "distance");
function rt(e) {
	let t, n = 0;
	return e.forEach((e) => {
		n += W(e, t), t = e;
	}), G(e, n / 2);
}
t(rt, "traverseEdge");
function it(e) {
	return e.length === 1 ? e[0] : rt(e);
}
t(it, "calcLabelPosition");
var at = /* @__PURE__ */ t((e, t = 2) => {
	let n = 10 ** t;
	return Math.round(e * n) / n;
}, "roundNumber"), G = /* @__PURE__ */ t((e, t) => {
	let n, r = t;
	for (let t of e) {
		if (n) {
			let e = W(t, n);
			if (e === 0) return n;
			if (e < r) r -= e;
			else {
				let i = r / e;
				if (i <= 0) return n;
				if (i >= 1) return {
					x: t.x,
					y: t.y
				};
				if (i > 0 && i < 1) return {
					x: at((1 - i) * n.x + i * t.x, 5),
					y: at((1 - i) * n.y + i * t.y, 5)
				};
			}
		}
		n = t;
	}
	throw Error("Could not find a suitable point for the given distance");
}, "calculatePoint"), ot = /* @__PURE__ */ t((t, n, r) => {
	e.info(`our points ${JSON.stringify(n)}`), n[0] !== r && (n = n.reverse());
	let i = G(n, 25), a = t ? 10 : 5, o = Math.atan2(n[0].y - i.y, n[0].x - i.x), s = {
		x: 0,
		y: 0
	};
	return s.x = Math.sin(o) * a + (n[0].x + i.x) / 2, s.y = -Math.cos(o) * a + (n[0].y + i.y) / 2, s;
}, "calcCardinalityPosition");
function st(t, n, r) {
	let i = structuredClone(r);
	e.info("our points", i), n !== "start_left" && n !== "start_right" && i.reverse();
	let a = G(i, 25 + t), o = 10 + t * .5, s = Math.atan2(i[0].y - a.y, i[0].x - a.x), c = {
		x: 0,
		y: 0
	};
	return n === "start_left" ? (c.x = Math.sin(s + Math.PI) * o + (i[0].x + a.x) / 2, c.y = -Math.cos(s + Math.PI) * o + (i[0].y + a.y) / 2) : n === "end_right" ? (c.x = Math.sin(s - Math.PI) * o + (i[0].x + a.x) / 2 - 5, c.y = -Math.cos(s - Math.PI) * o + (i[0].y + a.y) / 2 - 5) : n === "end_left" ? (c.x = Math.sin(s) * o + (i[0].x + a.x) / 2 - 5, c.y = -Math.cos(s) * o + (i[0].y + a.y) / 2 - 5) : (c.x = Math.sin(s) * o + (i[0].x + a.x) / 2, c.y = -Math.cos(s) * o + (i[0].y + a.y) / 2), c;
}
t(st, "calcTerminalLabelPosition");
function K(e) {
	let t = "", n = "";
	for (let r of e) r !== void 0 && (r.startsWith("color:") || r.startsWith("text-align:") ? n = n + r + ";" : t = t + r + ";");
	return {
		style: t,
		labelStyle: n
	};
}
t(K, "getStylesFromArray");
var ct = 0, lt = /* @__PURE__ */ t(() => (ct++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + ct), "generateId");
function ut(e) {
	let t = "";
	for (let n = 0; n < e; n++) t += "0123456789abcdef".charAt(Math.floor(Math.random() * 16));
	return t;
}
t(ut, "makeRandomHex");
var q = /* @__PURE__ */ t((e) => ut(e.length), "random"), dt = /* @__PURE__ */ t(function() {
	return {
		x: 0,
		y: 0,
		fill: void 0,
		anchor: "start",
		style: "#666",
		width: 100,
		height: 100,
		textMargin: 0,
		rx: 0,
		ry: 0,
		valign: void 0,
		text: ""
	};
}, "getTextObj"), ft = /* @__PURE__ */ t(function(e, t) {
	let n = t.text.replace(s.lineBreakRegex, " "), [, r] = Q(t.fontSize), i = e.append("text");
	i.attr("x", t.x), i.attr("y", t.y), i.style("text-anchor", t.anchor), i.style("font-family", t.fontFamily), i.style("font-size", r), i.style("font-weight", t.fontWeight), i.attr("fill", t.fill), t.class !== void 0 && i.attr("class", t.class);
	let a = i.append("tspan");
	return a.attr("x", t.x + t.textMargin * 2), a.attr("fill", t.fill), a.text(n), i;
}, "drawSimpleText"), pt = d((e, t, n) => {
	if (!e || (n = Object.assign({
		fontSize: 12,
		fontWeight: 400,
		fontFamily: "Arial",
		joinWith: "<br/>"
	}, n), s.lineBreakRegex.test(e))) return e;
	let r = e.split(" ").filter(Boolean), i = [], a = "";
	return r.forEach((e, o) => {
		let s = Y(`${e} `, n), c = Y(a, n);
		if (s > t) {
			let { hyphenatedStrings: r, remainingWord: o } = mt(e, t, "-", n);
			i.push(a, ...r), a = o;
		} else c + s >= t ? (i.push(a), a = e) : a = [a, e].filter(Boolean).join(" ");
		o + 1 === r.length && i.push(a);
	}), i.filter((e) => e !== "").join(n.joinWith);
}, (e, t, n) => `${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`), mt = d((e, t, n = "-", r) => {
	r = Object.assign({
		fontSize: 12,
		fontWeight: 400,
		fontFamily: "Arial",
		margin: 0
	}, r);
	let i = [...e], a = [], o = "";
	return i.forEach((e, s) => {
		let c = `${o}${e}`;
		if (Y(c, r) >= t) {
			let e = s + 1, t = i.length === e, r = `${c}${n}`;
			a.push(t ? c : r), o = "";
		} else o = c;
	}), {
		hyphenatedStrings: a,
		remainingWord: o
	};
}, (e, t, n = "-", r) => `${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`);
function J(e, t) {
	return X(e, t).height;
}
t(J, "calculateTextHeight");
function Y(e, t) {
	return X(e, t).width;
}
t(Y, "calculateTextWidth");
var X = d((e, t) => {
	let { fontSize: r = 12, fontFamily: i = "Arial", fontWeight: a = 400 } = t;
	if (!e) return {
		width: 0,
		height: 0
	};
	let [, o] = Q(r), c = ["sans-serif", i], l = e.split(s.lineBreakRegex), u = [], d = n("body");
	if (!d.remove) return {
		width: 0,
		height: 0,
		lineHeight: 0
	};
	let f = d.append("svg");
	for (let e of c) {
		let t = 0, n = {
			width: 0,
			height: 0,
			lineHeight: 0
		};
		for (let r of l) {
			let i = dt();
			i.text = r || "​";
			let s = ft(f, i).style("font-size", o).style("font-weight", a).style("font-family", e), c = (s._groups || s)[0][0].getBBox();
			if (c.width === 0 && c.height === 0) throw Error("svg element not in render tree");
			n.width = Math.round(Math.max(n.width, c.width)), t = Math.round(c.height), n.height += t, n.lineHeight = Math.round(Math.max(n.lineHeight, t));
		}
		u.push(n);
	}
	return f.remove(), u[isNaN(u[1].height) || isNaN(u[1].width) || isNaN(u[1].lineHeight) || u[0].height > u[1].height && u[0].width > u[1].width && u[0].lineHeight > u[1].lineHeight ? 0 : 1];
}, (e, t) => `${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`), ht = class {
	constructor(e = !1, t) {
		this.count = 0, this.count = t ? t.length : 0, this.next = e ? () => this.count++ : () => Date.now();
	}
	static {
		t(this, "InitIDGenerator");
	}
}, Z, gt = /* @__PURE__ */ t(function(e) {
	return Z ||= document.createElement("div"), e = escape(e).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";"), Z.innerHTML = e, unescape(Z.textContent);
}, "entityDecode");
function _t(e) {
	return "str" in e;
}
t(_t, "isDetailedError");
var vt = /* @__PURE__ */ t((e, t, n, r) => {
	if (!r) return;
	let i = e.node()?.getBBox();
	i && e.append("text").text(r).attr("text-anchor", "middle").attr("x", i.x + i.width / 2).attr("y", -n).attr("class", t);
}, "insertTitle"), Q = /* @__PURE__ */ t((e) => {
	if (typeof e == "number") return [e, e + "px"];
	let t = parseInt(e ?? "", 10);
	return Number.isNaN(t) ? [void 0, void 0] : e === String(t) ? [t, e + "px"] : [t, e];
}, "parseFontSize");
function $(e, t) {
	return Je({}, e, t);
}
t($, "cleanAndMerge");
var yt = {
	assignWithDepth: o,
	wrapLabel: pt,
	calculateTextHeight: J,
	calculateTextWidth: Y,
	calculateTextDimensions: X,
	cleanAndMerge: $,
	detectInit: Ze,
	detectDirective: Qe,
	isSubstringInArray: et,
	interpolateToCurve: U,
	calcLabelPosition: it,
	calcCardinalityPosition: ot,
	calcTerminalLabelPosition: st,
	formatUrl: tt,
	getStylesFromArray: K,
	generateId: lt,
	random: q,
	runFunc: nt,
	entityDecode: gt,
	insertTitle: vt,
	isLabelCoordinateInPath: wt,
	parseFontSize: Q,
	InitIDGenerator: ht
}, bt = /* @__PURE__ */ t(function(e) {
	let t = e;
	return t = t.replace(/style.*:\S*#.*;/g, function(e) {
		return e.substring(0, e.length - 1);
	}), t = t.replace(/classDef.*:\S*#.*;/g, function(e) {
		return e.substring(0, e.length - 1);
	}), t = t.replace(/#\w+;/g, function(e) {
		let t = e.substring(1, e.length - 1);
		return /^\+?\d+$/.test(t) ? "ﬂ°°" + t + "¶ß" : "ﬂ°" + t + "¶ß";
	}), t;
}, "encodeEntities"), xt = /* @__PURE__ */ t(function(e) {
	return e.replace(/ﬂ°°/g, "&#").replace(/ﬂ°/g, "&").replace(/¶ß/g, ";");
}, "decodeEntities"), St = /* @__PURE__ */ t((e, t, { counter: n = 0, prefix: r, suffix: i }, a) => a || `${r ? `${r}_` : ""}${e}_${t}_${n}${i ? `_${i}` : ""}`, "getEdgeId");
function Ct(e) {
	return e ?? null;
}
t(Ct, "handleUndefinedAttr");
function wt(e, t) {
	let n = Math.round(e.x), r = Math.round(e.y), i = t.replace(/(\d+\.\d+)/g, (e) => Math.round(parseFloat(e)).toString());
	return i.includes(n.toString()) || i.includes(r.toString());
}
t(wt, "isLabelCoordinateInPath");
//#endregion
export { Ae as C, me as D, ge as E, he as O, ke as S, E as T, Je as _, bt as a, Pe as b, K as c, _t as d, Q as f, pt as g, yt as h, xt as i, fe as k, Ct as l, $e as m, Y as n, lt as o, q as p, $ as r, St as s, J as t, U as u, Ie as v, j as w, Ne as x, Fe as y };
