/**
 * ldesign v0.2.22
 * (c) 2022/12/7 16:21 built by swimly
 * @license MIT
 */

'use strict';

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

var log = require('../../chunks/log.js');
require('../../chunks/_commonjsHelpers-fe796db6.js');

const DefaultAlign = {
  vertical: ["left", "right"],
  horizontal: ["top", "bottom"]
};
function getRenderAlign(align) {
  let layout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "vertical";
  let renderAlign = layout === "vertical" ? "left" : "top";
  if (layout === "vertical" && align) {
    const index = DefaultAlign.horizontal.indexOf(align);
    const isError = index !== -1;
    isError && log.log.warn("Timeline", 'If layout is vertical, align should be "left","alternate" or "right" ');
    renderAlign = isError ? DefaultAlign.vertical[index] : align;
  }
  if (layout === "horizontal" && align) {
    const index = DefaultAlign.vertical.indexOf(align);
    const isError = index !== -1;
    isError && log.log.warn("Timeline", 'If layout is horizontal, align should be "top","alternate" or "bottom" ');
    renderAlign = isError ? DefaultAlign.horizontal[index] : align;
  }
  return renderAlign;
}

exports["default"] = getRenderAlign;
//# sourceMappingURL=utils.js.map
