/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import { getElementLocale as Ge } from "@arcgis/toolkit/intl";
import { cloneDeep as s, isEmpty as B } from "lodash-es";
import { DateTime as je } from "luxon";
import { cM as _e, f as re, g as ze, dt as ie, dr as He, u as $e, W as Re, ax as Qe, bM as Ye, o as C, a6 as Ke, dp as c, b$ as b, c1 as Z, j as Xe, k as Je, ay as Ze, df as T, d as K, d7 as oe, bj as Ue, cn as et, bA as tt, q as rt } from "./index.js";
import { h as it, i as ot, a as st } from "./index4.js";
import { p as U, w as h, W as l, a as F, t as f, g as S, c as nt, o as ee, i as g } from "./series-types.js";
var P = /* @__PURE__ */ ((r) => (r.NONE = "none", r.ROTATE = "rotate", r.STAGGER = "stagger", r.WRAP = "wrap", r))(P || {});
function se(r) {
  const { configToUpdate: e, chartContainer: i, layer: t } = r, o = s(e);
  if (t?.capabilities?.queryAttributeBins?.supportsFirstDayOfWeek === !0 && (!("firstDayOfWeek" in e) || e.firstDayOfWeek === void 0 || e.firstDayOfWeek === null)) {
    const { lang: n } = Ge(i ?? document.documentElement);
    try {
      o.firstDayOfWeek = je.local().setLocale(n.replaceAll("_", "-")).startOf("week", { useLocaleWeeks: !0 }).weekday;
    } catch {
    }
  }
  return o;
}
function ne(r) {
  const e = s(r);
  return B(r.axes) || (e.axes = r.axes?.map((i) => {
    const t = i;
    return delete t.calculateAutomaticMaximum, delete t.calculateAutomaticMinimum, t.title?.content.font?.style !== void 0 && (t.title.content.font.style = t.title.content.font.style.toLowerCase()), t;
  })), e;
}
function ae(r) {
  const e = s(r);
  return B(r.series) || (e.series = r.series.map((i, t) => {
    const o = i;
    i.id === void 0 && (o.id = `Series ${Date.now()}-${t}`);
    const n = h(r.series, t);
    return (n === l.BarSeries || n === l.LineSeries || n === l.RadarSeries) && o.query?.outStatistics?.[0]?.statisticType === "median" && (o.query.outStatistics[0].statisticType = F.ContinuousPercentile), n === l.BarSeries && o.multipleBarType !== void 0 && (o.stackedType = o.multipleBarType, delete o.multipleBarType), n === l.PieSeries && o.sliceGrouping !== void 0 && (o.sliceGrouping.sliceId = Qe.defaultGroupOfSlicesId, o.sliceGrouping.groupName !== void 0 && (o.sliceGrouping = {
      ...o.sliceGrouping,
      label: o.sliceGrouping.groupName
    }, delete o.sliceGrouping.groupName), o.sliceGrouping.groupSliceSymbol !== void 0 && (o.sliceGrouping = {
      ...o.sliceGrouping,
      fillSymbol: o.sliceGrouping.groupSliceSymbol
    }, delete o.sliceGrouping.groupSliceSymbol)), o;
  })), e;
}
async function te(r, e) {
  const i = [];
  return await Promise.all(
    r.map(async (t) => {
      if (!oe(t)) {
        const o = T(t, !1);
        if (o.fieldToSort !== void 0) {
          const n = await b({
            queryObject: e,
            fieldToMatch: o.fieldToSort
          });
          n !== void 0 && i.push(
            o.orderBy === void 0 ? n : `${n} ${o.orderBy}`
          );
        }
      }
    })
  ), i;
}
async function de(r, e) {
  const i = { ...r };
  let t = e;
  if (!t) {
    const o = it(r) ? r.iLayer : r.dataSource?.layer;
    o && (t = await Ye(o));
  }
  if (t) {
    const o = C(i.series), n = h(i.series), u = i.series && i.series.length > 0 && i.series[0].x.trim() === "" || n === l.GaugeSeries && !Ke(r) || o === c.PieFromFields || o === c.BarAndLineFromFields || o === c.BoxPlotMonoField || o === c.BoxPlotMonoFieldAndSplitBy || o === c.BoxPlotMultiFields || o === c.BoxPlotMultiFieldsAndSplitBy, v = n === l.ScatterSeries || o === c.BarAndLineNoAggregation || o === c.BarAndLineSplitByNoAggregation || o === c.BoxPlotMonoField || o === c.BoxPlotMonoFieldAndSplitBy || o === c.BoxPlotMonoFieldAndCategory || o === c.BoxPlotMonoFieldAndCategoryAndSplitBy || o === c.PieNoAggregation;
    if (i.series = await Promise.all(
      r.series.map(async (a) => {
        const d = { ...a };
        if (u || (d.x = await b({ queryObject: t, fieldToMatch: a.x })), "y" in d && v) {
          const y = d.y;
          if (Array.isArray(y)) {
            const p = await Z({
              fieldsList: y,
              queryObject: t
            });
            p !== void 0 && "y" in d && (d.y = p);
          } else "y" in d && typeof y == "string" && (d.y = await b({ queryObject: t, fieldToMatch: y }));
        }
        if (a.query !== void 0) {
          let { where: y, groupByFieldsForStatistics: p, outStatistics: m } = a.query;
          if (p = await Z({ fieldsList: p, queryObject: t }), m !== void 0 && (m = await Promise.all(
            m.map(async (x) => {
              const O = { ...x };
              return O.onStatisticField = await b({
                queryObject: t,
                fieldToMatch: x.onStatisticField
              }), O;
            })
          )), y !== void 0 && o === c.BarAndLineSplitBy) {
            const x = Xe(a.query?.where), O = Je({
              where: a.query?.where,
              normalize: !1,
              escape: !1
            });
            y = `${await b({ queryObject: t, fieldToMatch: x })}=${O}`;
          }
          d.query !== void 0 && (y !== void 0 && (d.query.where = y), p !== void 0 && (d.query.groupByFieldsForStatistics = p), m !== void 0 && (d.query.outStatistics = m));
        }
        return d;
      })
    ), i.series[0]?.query !== void 0) {
      const a = i.series[0].query;
      let { orderByFields: d } = a;
      d !== void 0 && d.length > 0 && (d = await te(d, t), d.length > 0 && a.orderByFields !== void 0 && (i.series[0].query.orderByFields = d));
    }
    if (i.orderOptions?.orderByFields !== void 0) {
      let { orderByFields: a } = i.orderOptions;
      a !== void 0 && a.length > 0 && (a = await te(a, t), a.length > 0 && (i.orderOptions.orderByFields = a));
    }
    if (n === l.GaugeSeries && r.axes?.[0] !== void 0) {
      const { minimumFromField: a, maximumFromField: d } = r.axes[0];
      if (a !== void 0) {
        const y = typeof a == "string" ? a : a.onStatisticField, p = await b({ queryObject: t, fieldToMatch: y });
        let m = a;
        typeof r.axes[0].minimumFromField == "string" ? m = p : typeof a == "object" && (m = {
          ...a,
          onStatisticField: p
        }), r.axes[0].minimumFromField = m;
      }
      if (d !== void 0) {
        const y = typeof d == "string" ? d : d.onStatisticField, p = await b({ queryObject: t, fieldToMatch: y });
        let m = d;
        typeof r.axes[0].maximumFromField == "string" ? m = p : typeof d == "object" && (m = {
          ...d,
          onStatisticField: p
        }), r.axes[0].maximumFromField = m;
      }
    }
  }
  return i;
}
function le(r) {
  const e = s(r);
  if (!B(r.series) && h(r.series) === l.BoxPlotSeries) {
    const t = e.series[0];
    t && (t.showOutliers !== void 0 && (r.showOutliers === void 0 && (e.showOutliers = t.showOutliers), delete t.showOutliers), t.standardizeValues !== void 0 && (r.standardizeValues === void 0 && (e.standardizeValues = t.standardizeValues), delete t.standardizeValues), t.showMean !== void 0 && (r.showMean === void 0 && (e.showMean = t.showMean), delete t.showMean));
  }
  return e;
}
function ce(r) {
  const e = {
    orderType: f.Category,
    orderBy: S.Ascending
  }, i = r.query?.orderByFields?.[0];
  if (i !== void 0) {
    const { outStatisticFieldName: t, statisticType: o } = r.query?.outStatistics?.[0] ?? {}, n = T(i);
    t !== void 0 && n.fieldToSort === t && o !== void 0 && (o === F.Average || o === "mean" ? e.orderType = f.Mean : o === F.ContinuousPercentile && (e.orderType = f.Median)), e.orderBy = n.orderBy ?? S.Ascending;
  }
  return e;
}
function ue(r) {
  let e = !1;
  const i = Array.from(new Set(r.series.map((t) => t.type)));
  return i.length === 2 && i.includes(l.BoxPlotSeries) && i.includes(l.LineSeries) && (e = r.series.find((o) => o.type === l.LineSeries)?.query?.outStatistics?.[0] !== void 0), e;
}
function fe(r) {
  const e = s(r);
  if (!B(e.series) && h(r.series) === l.BoxPlotSeries) {
    if (e.orderOptions?.data === void 0) {
      const t = ce(r.series[0]);
      t.orderType !== void 0 && (e.orderOptions ??= {}, e.orderOptions.data = {
        orderType: t.orderType,
        orderBy: t.orderBy
      });
    }
    if (e.series = r.series.map((t) => {
      const o = t;
      return B(o.x?.trim()) && (o.x = Ze), delete o.query?.orderByFields, o;
    }), ue(e)) {
      e.showMean = !0;
      const t = e.series.find(
        (o) => o.type === l.BoxPlotSeries
      );
      e.series.forEach((o) => {
        o.type === l.LineSeries && (delete o.query?.groupByFieldsForStatistics, delete o.query?.outStatistics, delete o.query?.orderByFields, t && (o.y = t.y));
      });
    }
    e.series = r.series.map((t) => {
      const o = t;
      return delete o.query?.outStatistics, o;
    });
  }
  return e;
}
function ye(r) {
  const e = s(r);
  return e.legend !== void 0 && !Number.isFinite(e.legend.maxHeight) && (e.legend.maxHeight = Number.NaN), e;
}
function pe(r) {
  const e = s(r);
  return "dataSource" in e && e.dataSource.layer && (e.iLayer = e.dataSource.layer, delete e.dataSource), e;
}
function me(r) {
  const e = s(r), i = /* @__PURE__ */ new Set(), t = e.id ?? "";
  return i.add(t), e.series.forEach((o) => {
    let n = o.id;
    i.has(n) && (n = `${n}_${Date.now()}`, o.id = n), i.add(n);
  }), e;
}
async function Se(r) {
  const { configToUpdate: e, layer: i, chartContainer: t } = r;
  let o = s(e);
  if (o = ne(o), o = ae(o), o = await de(o, i), ie(o)) {
    const n = le(o);
    o = fe(n);
  }
  return o = ye(o), o = me(o), He(o) && (o = se({ configToUpdate: o, chartContainer: t, layer: i })), o;
}
function ve(r) {
  const e = s(r);
  return e?.orderOptions?.orderByFields !== void 0 && C(r.series) === c.PieFromFields && (e.orderOptions.orderByFields = r?.orderOptions?.orderByFields?.map(
    (i) => {
      let t = s(i);
      return i !== void 0 && i.includes("arcgis_charts_pie_category_from_fields_name") && (t = i.replace(
        "arcgis_charts_pie_category_from_fields_name",
        K
      )), t;
    }
  )), e;
}
function Be(r) {
  const e = s(r);
  if (!B(r.series) && e.axes?.[0] !== void 0 && h(r.series) === l.GaugeSeries && r.axes?.[0] !== void 0) {
    const t = r.axes[0];
    t.ticks !== void 0 && Object.hasOwn(t.ticks, "spacing") && delete t.ticks.spacing, e.axes[0] = t;
  }
  return e;
}
function he(r) {
  const e = s(r), { extent: i } = e.series[0]?.query ?? {};
  return i !== void 0 && (e.dataFilters = {
    ...e.dataFilters,
    geometry: i
  }, e.series.forEach((t) => {
    "query" in t && "extent" in t.query && delete t.query.extent;
  })), e;
}
function X(r) {
  const e = s(r);
  return B(r.series) || (ot(r) && r.rotated === void 0 && (e.rotated = r.series[0].rotated ?? Ue()), e.series.forEach((i) => {
    i.rotated !== void 0 && delete i.rotated;
  })), e;
}
function ge(r) {
  const e = s(r), i = r.dataSource;
  return "dataSource" in e && !B(i) && (i.type === "featureLayer" && e.dataSource !== void 0 && (e.dataSource.type = "layer"), "featureLayer" in i && (e.dataSource.layer = i.featureLayer, delete e.dataSource.featureLayer)), e;
}
function be(r) {
  const e = s(r);
  if ("dataSource" in r) {
    const i = r.dataSource;
    if (i.filter !== void 0 && i.filter.trim() !== "") {
      const t = et([i.filter, e.dataFilters?.where]);
      e.dataFilters = {
        ...e.dataFilters,
        where: t
      }, delete e.dataSource.filter;
    }
  }
  return e;
}
function Fe(r) {
  return r !== "originalValue";
}
function J(r) {
  let e;
  switch (r) {
    case "mean":
      e = f.Mean;
      break;
    case "median":
      e = f.Median;
      break;
    case "category":
      e = f.Category;
      break;
  }
  return e;
}
function xe(r) {
  const e = s(r);
  if (!B(r.series) && h(r.series) === l.PieSeries) {
    const t = e.series[0];
    if (t) {
      if (t.sortLabelsBy === "originalValue")
        e.sortLabelsBy = t.sortLabelsBy;
      else if (t.sortLabelsBy !== void 0 && e.orderOptions?.data === void 0) {
        const o = w(e);
        o !== void 0 && (e.orderOptions ??= {}, e.orderOptions.data = o);
      }
      t.sortLabelsBy && delete t.sortLabelsBy;
    }
  }
  return e;
}
function Oe(r) {
  const e = s(r);
  return B(r.series) || (st(r) && r.stackedType === void 0 && (e.stackedType = r.series[0].stackedType ?? tt()), e.series.forEach((i) => {
    "stackedType" in i && delete i.stackedType;
  })), e;
}
function Ce(r) {
  const e = s(r), i = r.sortOptions?.sortSeriesBy;
  return e.orderOptions === void 0 && typeof i == "string" && (e.orderOptions ??= {}, e.orderOptions.series = {
    orderBy: i === "DESC" ? S.Descending : S.Ascending
  }), e;
}
function Te(r) {
  const e = s(r);
  return e.colorMatch === void 0 && e.series[0]?.colorType !== void 0 && (e.colorMatch = e.series[0]?.colorType === nt.Match), e.series.forEach((i) => {
    i.colorType !== void 0 && delete i.colorType;
  }), e;
}
function we(r) {
  const e = s(r);
  if (e.sortDataBy !== void 0) {
    if (e.orderOptions?.data === void 0) {
      const i = r.sortDataBy, t = J(i?.sortType);
      t && t !== f.MultiAxes && (e.orderOptions ??= {}, e.orderOptions.data = {
        orderType: t,
        orderBy: i?.sortOrder ?? S.Ascending
      });
    }
    delete e.sortDataBy;
  }
  return e;
}
function Pe(r) {
  const e = s(r);
  return e.axes?.forEach((i) => {
    i !== void 0 && i.scrollbarVisible !== void 0 && i.scrollbar?.visible === void 0 && (i.scrollbar = {
      ...i.scrollbar,
      visible: i.scrollbarVisible
    }, delete i.scrollbarVisible);
  }), e;
}
function Le(r) {
  const e = s(r), i = e.series[0]?.query?.orderByFields;
  if (i !== void 0 && i.length > 0 && e.orderOptions?.orderByFields === void 0) {
    e.orderOptions ??= {};
    let t = !0;
    if (i.length === 1) {
      const { fieldToSort: o, orderBy: n } = T(i[0]);
      let u;
      o === r.series[0].x || o === K ? u = f.Category : "y" in r.series[0] && o === r.series[0].y && (u = f.YValue), u && u !== f.MultiAxes && (t = !1, e.orderOptions.data === void 0 && (e.orderOptions.data = {
        orderType: u,
        orderBy: n?.toUpperCase() === "DESC" ? S.Descending : S.Ascending
      }));
    }
    t && (e.orderOptions.orderByFields = i);
  }
  return e.series.forEach((t) => {
    delete t.query?.orderByFields;
  }), e;
}
function w(r) {
  let e, i = r.orderOptions?.orderByFields?.[0];
  if (r.series?.length > 0) {
    const t = h(r.series), o = C(r.series);
    if (t !== l.PieSeries && o !== c.BarAndLineFromFields && (i = i ?? r.series[0].x), i && !oe(i)) {
      const { fieldToSort: n, orderBy: u } = T(i);
      let v;
      n === r.series[0].x || n === K ? v = f.Category : "y" in r.series[0] && n === r.series[0].y && (v = f.YValue), v && v !== f.MultiAxes && (e = {
        orderType: v,
        orderBy: u?.toUpperCase() === "DESC" ? S.Descending : S.Ascending
      });
    }
  }
  return e;
}
function ke(r) {
  const e = s(r), i = r, t = r, o = r, n = r, u = r;
  if (e) {
    if (e.orderOptions?.series === void 0 && i.sortOptions?.sortSeriesBy !== void 0 && (e.orderOptions ??= {}, e.orderOptions.series = {
      preferLabel: Fe(
        t.sortLabelsBy ?? i.sortOptions.sortSeriesBy.sortType
      ),
      orderBy: i.sortOptions.sortSeriesBy.sortOrder ?? S.Ascending
    }), t.sortLabelsBy === "originalValue" || n.orderOptions?.data?.preferDataLabel === !1 || u.orderOptions?.data?.preferLabel === !1)
      e.orderOptions?.data && delete e.orderOptions.data;
    else if (e.orderOptions?.data === void 0)
      if (h(e.series) === l.BoxPlotSeries) {
        if (t.sortLabelsBy || o.sortOptions?.sortDataBy !== void 0) {
          const a = J(o.sortOptions?.sortDataBy?.sortType);
          a && a !== f.MultiAxes && (e.orderOptions ??= {}, e.orderOptions.data = {
            orderType: a,
            orderBy: o.sortOptions?.sortDataBy?.sortOrder ?? S.Ascending
          });
        }
      } else {
        const a = w(e);
        a !== void 0 && (e.orderOptions ??= {}, e.orderOptions.data = a);
      }
    "sortLabelsBy" in e && delete e.sortLabelsBy, "sortOptions" in e && delete e.sortOptions;
  }
  return e;
}
function Ae(r) {
  const e = s(r);
  if (e) {
    const i = C(e.series);
    if ((i === c.BarAndLineFromFields || i === c.PieFromFields) && e.orderOptions?.data === void 0 && e.orderOptions?.orderByFields !== void 0) {
      const t = w(e);
      t !== void 0 && (e.orderOptions ??= {}, e.orderOptions.data = t, delete e.orderOptions.orderByFields);
    }
  }
  return e;
}
function De(r) {
  const e = s(r);
  return e.horizontalAxisLabelsBehavior === P.NONE && (e.horizontalAxisLabelsBehavior = ee.Hide), e.verticalAxisLabelsBehavior === P.NONE && (e.verticalAxisLabelsBehavior = ee.Hide), e;
}
function Me(r) {
  const e = s(r), i = e.series[0];
  if (i && !i.temporalBinning && rt(e.series[0]) && ("timeIntervalSize" in i || "timeIntervalUnits" in i || "timeAggregationType" in i || "trimIncompleteTimeInterval" in i || "nullPolicy" in i)) {
    if (i.temporalBinning = {}, i.timeIntervalSize !== void 0 && (i.temporalBinning.size = i.timeIntervalSize, delete i.timeIntervalSize), i.timeIntervalUnits) {
      let t;
      switch (i.timeIntervalUnits) {
        case "esriTimeUnitsSeconds":
          t = g.Second;
          break;
        case "esriTimeUnitsMinutes":
          t = g.Minute;
          break;
        case "esriTimeUnitsHours":
          t = g.Hour;
          break;
        case "esriTimeUnitsDays":
          t = g.Day;
          break;
        case "esriTimeUnitsWeeks":
          t = g.Week;
          break;
        case "esriTimeUnitsMonths":
          t = g.Month;
          break;
        case "esriTimeUnitsYears":
          t = g.Year;
          break;
      }
      t !== void 0 && (i.temporalBinning.unit = t), delete i.timeIntervalUnits;
    }
    i.timeAggregationType && (i.temporalBinning.timeAggregationType = i.timeAggregationType, delete i.timeAggregationType), i.trimIncompleteTimeInterval !== void 0 && (i.temporalBinning.trimIncompleteTimeInterval = i.trimIncompleteTimeInterval, delete i.trimIncompleteTimeInterval), i.nullPolicy && (i.temporalBinning.nullPolicy = i.nullPolicy, delete i.nullPolicy);
  }
  return e;
}
function We(r) {
  const e = s(r);
  return e.series.forEach((i) => {
    i.query?.outStatistics?.forEach((t) => {
      t.statisticType === "percentile_cont" ? t.statisticType = F.ContinuousPercentile : t.statisticType === "percentile_disc" && (t.statisticType = F.DiscretePercentile);
    });
  }), e;
}
function qe(r) {
  const e = s(r);
  return e.subtitle === void 0 && e.subTitle && (e.subtitle = e.subTitle), delete e.subTitle, e;
}
function Ie(r) {
  const e = s(r), i = e.series[0];
  return i?.temporalBinning && delete i.temporalBinning?.type, e;
}
function Ne(r) {
  const e = s(r), i = e.series[0], t = r;
  return t.series[0]?.xTemporalBinning && (i.xTemporalBinning = {
    ...t.series[0]?.xTemporalBinning,
    type: l.CalendarDateParts
  }), t.series[0]?.yTemporalBinning && (i.yTemporalBinning = {
    ...t.series[0]?.yTemporalBinning,
    type: l.CalendarDateParts
  }), e;
}
function Ee(r) {
  let e = s(r);
  return e = ve(e), e;
}
function L(r) {
  let e = s(r);
  return e = Be(e), e;
}
function k(r) {
  let e = s(r);
  return e = he(e), e;
}
function A(r) {
  let e = s(r);
  return e = X(e), e;
}
function D(r) {
  let e = s(r);
  return e = ge(e), e;
}
function M(r) {
  let e = s(r);
  return e = be(e), e;
}
function W(r) {
  let e = s(r);
  return e = xe(e), e;
}
function q(r) {
  let e = s(r);
  return e = Ce(e), e;
}
function I(r) {
  let e = s(r);
  return e = Te(e), e;
}
function N(r) {
  return Pe(r);
}
function E(r) {
  let e = s(r);
  return ie(e) && (e = we(e)), e;
}
function V(r) {
  return Oe(r);
}
function G(r) {
  return ke(r);
}
function j(r) {
  return pe(r);
}
function _(r) {
  return Ae(r);
}
function z(r) {
  return De(r);
}
function H(r) {
  return Me(r);
}
function $(r) {
  return We(r);
}
function R(r) {
  let e = s(r);
  return e = X(e), qe(e);
}
function Q(r) {
  let e = s(r);
  return e = Ie(e), e;
}
function Y(r) {
  let e = s(r);
  return e = Ne(e), e;
}
function Ve(r) {
  const { versionsToConvert: e = [], configToUpdate: i } = r;
  let t = s(i);
  return e.length > 0 && t !== void 0 && (t = Le(t), e.includes(re) || e.includes($e) ? (t = Ee(t), t = L(t), t = k(t), t = A(t), t = D(t), t = M(t), t = W(t), t = q(t), t = I(t), t = N(t), t = E(t), t = V(t), t = G(t), t = j(t), t = _(t), t = z(t), t = H(t), t = $(t), t = R(t), t = Q(t), t = Y(t)) : e.forEach((o) => {
    if (t !== void 0)
      switch (o) {
        case "1.0.1":
          t = L(t);
          break;
        case "3.4.0":
          t = k(t);
          break;
        case "4.0.0":
          t = A(t);
          break;
        case "4.0.1":
          t = D(t);
          break;
        case "6.4.0":
          t = M(t);
          break;
        case "7.5.1":
          t = W(t);
          break;
        case "8.0.0":
          t = q(t);
          break;
        case "9.2.0":
          t = I(t);
          break;
        case "9.7.0":
          t = N(t);
          break;
        case "10.0.0":
          t = E(t);
          break;
        case "11.0.0":
          t = V(t);
          break;
        case "14.0.1":
          t = G(t);
          break;
        case "16.0.0":
          t = j(t);
          break;
        case "16.1.0":
          t = _(t);
          break;
        case "18.1.3":
          t = z(t);
          break;
        case "20.1.0":
          t = H(t);
          break;
        case "21.0.0":
          t = $(t);
          break;
        case "23.2.0":
          t = R(t);
          break;
        case "24.7.0":
          t = Q(t);
          break;
        case "25.0.0":
          t = Y(t);
          break;
      }
  }), t.version = Re), t;
}
async function pt(r, e, i) {
  let t = r;
  if (r) {
    const o = _e(e);
    t = await Se({ configToUpdate: r, layer: o, chartContainer: i });
    const n = r.version ?? re, { versionStatus: u, versions: v } = ze(n);
    (u === U.Older || u === U.Unrecognized) && (t = Ve({
      versionsToConvert: v,
      configToUpdate: t
    }));
  }
  return t;
}
const mt = {
  adjustAxes: ne,
  adjustSeries: ae,
  matchChartFieldsToLayerFields: de,
  resetLegendMaxHeight: ye,
  moveSeriesQueryExtent: he,
  moveSeriesRotatedPropToChart: X,
  renameDataSourceProperties: ge,
  copyDataSourceFilterToConfig: be,
  adjustPieFromFieldsDefaultNameAndValue: ve,
  removeSpacingPropertyFromGauge: Be,
  moveBoxPlotSeriesPropsToChart: le,
  movePieSeriesSortLabelsPropToChart: xe,
  getProBoxPlotSortDataOption: ce,
  isBoxPlotConfigWithMeanLinesFromPro: ue,
  preventDuplicatedIds: me,
  adjustBoxPlotConfig: fe,
  convertSortSeriesByToObject: Ce,
  moveBoxPlotSortDataByProp: we,
  handleColorMatchChanges: Te,
  moveScrollbarVisible: Pe,
  moveSeriesStackedTypePropToChart: Oe,
  convertBoxplotOldToNewDataSortType: J,
  getDataOrderFromOrderByFields: w,
  convertWebChartDataValueTypes: Fe,
  moveOrConvertSeriesOrderByFieldsToChartOrderOptions: Le,
  convertWebChartLabelBehaviorNoneToHide: De,
  handleOrderOptionsChanges: ke,
  applyDataOrderInstructionForFromFieldsCharts: Ae,
  convertTemporalBinningProps: Me,
  convertRESTStatisticTypeToWebChartStatisticType: We,
  renameChartSubtitle: qe,
  applyMandatoryConversions: Se,
  convertTo1x0x1: Ee,
  convertTo2x0x0: L,
  convertTo3x5x0: k,
  convertTo4x0x1: A,
  convertTo5x0x0: D,
  convertTo7x0x0: M,
  convertTo7x6x0: W,
  convertTo8x0x1: q,
  convertTo9x3x0: I,
  convertTo10x0x0: N,
  convertTo11x0x0: E,
  convertTo12x0x0: V,
  convertTo15x0x0: G,
  convertTo16x1x0: j,
  convertTo16x1x1: _,
  convertTo19x0x0: z,
  convertTo20x2x0: H,
  convertTo21x1x0: $,
  convertTo23x3x0: R,
  convertTo24x8x0: Q,
  convertTo25x0x0: Y,
  convertTemporalBinningProps2: Ie,
  transformPropsInHeatChart: Ne,
  applyConversions: Ve,
  convertDataSourceToILayer: pe,
  applyDefaultFirstDayOfWeek: se
};
export {
  mt as a,
  pt as c
};
