import { getTimeFormatToZone as a } from "@aplus-frontend/utils";
import r from "dayjs";
import { isNil as n, isArray as f } from "lodash-unified";
import { ApFieldDatePresetFormats as l, PRESET_FORMAT_MAP as u } from "../../ap-field/date/constant.mjs";
function z(e) {
  if (n(e.value))
    return e.emptyText || "--";
  let m = r(e.value);
  if (e.timezone) {
    const o = f(e.timezone) ? e.timezone[0]?.value : e.timezone;
    m = r(a(e.value, o));
  }
  const t = e.format || "Y-D", i = l.indexOf(t) > -1 ? u[t] : t;
  return m.format(i);
}
export {
  z as dateRenderer
};
