"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const array = require("./src-array2.cjs");
const constant = require("./src-constant2.cjs");
const point = require("./src-point2.cjs");
const path = require("../d3-path/src-path2.cjs");
function linkSource(d) {
  return d.source;
}
function linkTarget(d) {
  return d.target;
}
function link(curve) {
  var source = linkSource, target = linkTarget, x = point.x, y = point.y, context = null;
  function link2() {
    var buffer, argv = array.slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);
    if (!context) context = buffer = path.default();
    curve(context, +x.apply(this, (argv[0] = s, argv)), +y.apply(this, argv), +x.apply(this, (argv[0] = t, argv)), +y.apply(this, argv));
    if (buffer) return context = null, buffer + "" || null;
  }
  link2.source = function(_) {
    return arguments.length ? (source = _, link2) : source;
  };
  link2.target = function(_) {
    return arguments.length ? (target = _, link2) : target;
  };
  link2.x = function(_) {
    return arguments.length ? (x = typeof _ === "function" ? _ : constant.default(+_), link2) : x;
  };
  link2.y = function(_) {
    return arguments.length ? (y = typeof _ === "function" ? _ : constant.default(+_), link2) : y;
  };
  link2.context = function(_) {
    return arguments.length ? (context = _ == null ? null : _, link2) : context;
  };
  return link2;
}
function curveHorizontal(context, x0, y0, x1, y1) {
  context.moveTo(x0, y0);
  context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);
}
function linkHorizontal() {
  return link(curveHorizontal);
}
exports.linkHorizontal = linkHorizontal;
//# sourceMappingURL=src-link-index.cjs.map
