"use strict";

var __assign = void 0 && (void 0).__assign || function () {
  __assign = Object.assign || function (t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];

      for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
    }

    return t;
  };

  return __assign.apply(this, arguments);
};

var __rest = void 0 && (void 0).__rest || function (s, e) {
  var t = {};

  for (var p in s) {
    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  }

  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  }
  return t;
};

Object.defineProperty(exports, "__esModule", {
  value: true
});

var jsx_runtime_1 = require("react/jsx-runtime");

var offset = 4;

var dropIndicatorRender = function dropIndicatorRender(props) {
  var _a;

  var dropPosition = props.dropPosition,
      dropLevelOffset = props.dropLevelOffset,
      prefixCls = props.prefixCls,
      indent = props.indent,
      _b = props.direction,
      direction = _b === void 0 ? 'ltr' : _b,
      restProps = __rest(props, ["dropPosition", "dropLevelOffset", "prefixCls", "indent", "direction"]);

  var startPosition = direction === 'ltr' ? 'left' : 'right';
  var endPosition = direction === 'ltr' ? 'right' : 'left';
  var style = (_a = {}, _a[startPosition] = -dropLevelOffset * indent + offset, _a[endPosition] = 0, _a);

  switch (dropPosition) {
    case -1:
      style.top = -3;
      break;

    case 1:
      style.bottom = -3;
      break;

    default:
      // dropPosition === 0
      style.bottom = -3;
      style[startPosition] = indent + offset;
      break;
  }

  return jsx_runtime_1.jsx("div", __assign({}, restProps, {
    style: style,
    className: prefixCls + "-drop-indicator"
  }), void 0);
};

exports["default"] = dropIndicatorRender;

