"use strict";

var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
  return mod && mod.__esModule ? mod : {
    "default": mod
  };
};

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getDurationOfFastType = void 0;

var constant_1 = require("./constant");

var dayjs_1 = __importDefault(require("dayjs"));

var getDurationOfFastType = function getDurationOfFastType(fast, val, type, unit, fastMap) {
  if (!fast) return [null, null];

  if (fast === constant_1.FastTypeKeys.customer) {
    if (type === constant_1.DynamincType.after) {
      return [dayjs_1["default"](), dayjs_1["default"]().add(val || 0, unit)];
    }

    return [dayjs_1["default"]().subtract(val || 0, unit), dayjs_1["default"]()];
  }

  return fastMap[fast];
};

exports.getDurationOfFastType = getDurationOfFastType;

