import e from "../noop.js";
import { point as t } from "./cardinal.js";
//#region ../../node_modules/d3-shape/src/curve/cardinalClosed.js
function n(e, t) {
	this._context = e, this._k = (1 - t) / 6;
}
n.prototype = {
	areaStart: e,
	areaEnd: e,
	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, n) {
		switch (e = +e, n = +n, this._point) {
			case 0:
				this._point = 1, this._x3 = e, this._y3 = n;
				break;
			case 1:
				this._point = 2, this._context.moveTo(this._x4 = e, this._y4 = n);
				break;
			case 2:
				this._point = 3, this._x5 = e, this._y5 = n;
				break;
			default:
				t(this, e, n);
				break;
		}
		this._x0 = this._x1, this._x1 = this._x2, this._x2 = e, this._y0 = this._y1, this._y1 = this._y2, this._y2 = n;
	}
};
var r = (function e(t) {
	function r(e) {
		return new n(e, t);
	}
	return r.tension = function(t) {
		return e(+t);
	}, r;
})(0);
//#endregion
export { n as CardinalClosed, r as default };
