import { getTimeFormatToZone as n } from "@aplus-frontend/utils";
import m from "dayjs";
import { isArray as c, isString as d } from "lodash-unified";
import { ApFieldDatePresetFormats as u, PRESET_FORMAT_MAP as l } from "../../ap-field/date/constant.mjs";
function A(e) {
  const t = e.value;
  if (!t?.length)
    return e.emptyText || "--";
  const r = c(e.timezone) ? e.timezone[0]?.value : e.timezone, i = r ? n(t[0], r) : t[0], s = r ? n(t[1], r) : t[1], o = e.format || "Y-D", a = u.indexOf(o) > -1 ? l[o] : o, f = d(e.readModeSeparator) ? e.readModeSeparator : "~";
  return `${m(i).format(a)}${f}${m(s).format(a)}`;
}
export {
  A as dateRangeRenderer
};
