/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import { c as Q } from "../../chunks/runtime.js";
import { keyed as Z } from "lit/directives/keyed.js";
import { LitElement as ee, createEvent as $, safeClassMap as P, safeStyleMap as L, nothing as E } from "@arcgis/lumina";
import { makeAccessorController as te } from "@arcgis/lumina/controllers/accessor";
import { slotChangeHasAssignedElement as R, classes as ae, getClosestElement as ne } from "@arcgis/toolkit/dom";
import { css as re, html as y } from "lit";
import { map as ie } from "lit/directives/map.js";
import { createRef as B, ref as O } from "lit/directives/ref.js";
import { u as se } from "../../chunks/useT9n.js";
import { g as le } from "../../chunks/locale.js";
import oe from "@arcgis/core/core/Accessor.js";
import { property as I, subclass as ce } from "@arcgis/core/core/accessorSupport/decorators.js";
import { watch as A } from "@arcgis/core/core/reactiveUtils.js";
import { generateGuid as K } from "@arcgis/toolkit/string";
const p = {
  increment: "ArrowUp",
  incrementHorizontal: "ArrowRight",
  decrement: "ArrowDown",
  decrementHorizontal: "ArrowLeft",
  pageIncrement: "PageUp",
  pageDecrement: "PageDown",
  jumpToStart: "Home",
  jumpToEnd: "End",
  confirmEdit: "Enter"
};
function N({ key: n, shiftKey: e }, t, a) {
  const i = de(n);
  if (i == null)
    return null;
  const r = ue(n) || he(n) && e ? ge(t) : 1;
  return {
    direction: a ? i * -1 : i,
    count: r
  };
}
function de(n) {
  return n === p.increment || n === p.incrementHorizontal || n === p.pageIncrement ? 1 : n === p.decrement || n === p.decrementHorizontal || n === p.pageDecrement ? -1 : null;
}
function U(n) {
  return n === p.jumpToEnd || n === p.jumpToStart;
}
function he(n) {
  return n === p.increment || n === p.decrement || n === p.decrementHorizontal || n === p.incrementHorizontal;
}
function ue(n) {
  return n === p.pageIncrement || n === p.pageDecrement;
}
function ge(n) {
  const e = Number.isFinite(n) ? Math.floor(n) : 1;
  return Math.max(1, e);
}
const me = re`:host{display:flex;width:100%;height:100%;font-family:Avenir Next,Helvetica Neue,helvetica,arial,sans-serif;font-size:var(--calcite-font-size--2);font-variant-numeric:tabular-nums;--arcgis-slider-dash-length: 5px;--arcgis-slider-handle-size: .875rem;--arcgis-slider-track-background-color: var(--calcite-color-border-2);--arcgis-slider-internal-show-range-labels: 0;--arcgis-slider-internal-show-value-labels: 0;--arcgis-slider-internal-value-labels-placement-start: 0;--arcgis-slider-internal-value-labels-placement-end: 0;--arcgis-slider-internal-range-labels-placement-center: 0;--arcgis-slider-internal-range-labels-placement-end: 0;--arcgis-slider-internal-handle-offset: calc(var(--arcgis-slider-handle-size) / 2);--arcgis-slider-internal-label-input-margin: calc(var(--arcgis-slider-internal-handle-offset) + 4px);--arcgis-slider-internal-label-input-height: var(--calcite-input-number-height, 1.5rem);--arcgis-slider-internal-track-size: 2px}:host([show-range-labels]){--arcgis-slider-internal-show-range-labels: 1}:host(:not([value-labels-display="hidden"])){--arcgis-slider-internal-show-value-labels: 1}:host([value-labels-placement="start"]){--arcgis-slider-internal-value-labels-placement-start: var(--arcgis-slider-internal-show-value-labels)}:host([value-labels-placement="end"]){--arcgis-slider-internal-value-labels-placement-end: var(--arcgis-slider-internal-show-value-labels)}:host([range-labels-placement="center"]){--arcgis-slider-internal-range-labels-placement-center: var(--arcgis-slider-internal-show-range-labels)}:host([range-labels-placement="end"]){--arcgis-slider-internal-range-labels-placement-end: var(--arcgis-slider-internal-show-range-labels)}:host([disabled]){cursor:default;opacity:var(--calcite-opacity-disabled);pointer-events:none}.content{direction:ltr;flex:1;touch-action:none;user-select:none;display:grid;word-wrap:normal;word-break:normal;padding-block:var(--arcgis-slider-internal-handle-offset)}.track-container{grid-area:track-container;position:relative;display:flex;justify-content:center;align-items:center}.track{touch-action:none;position:relative}.track-bounds{background-color:var(--calcite-color-border-2)}.track-fill{--arcgis-slider-track-background-color: var(--calcite-color-brand)}:host([layout="vertical"]){.track-effective-start{background:repeating-linear-gradient(to bottom,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}.track-effective-end{background:repeating-linear-gradient(to top,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}}:host([layout="horizontal"]){.track-effective-start{background:repeating-linear-gradient(to right,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}.track-effective-end{background:repeating-linear-gradient(to left,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}}.track-range{background-color:var(--calcite-color-brand);&.active{box-shadow:0 0 8px #00000029;outline:1px solid var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)))}}:host([disabled]) .track-range{background-color:var(--calcite-color-text-3)}:host([disabled]),:host([disabled][layout="horizontal"]),:host([disabled][layout="vertical"]){.track-range.interactive:after{cursor:default;pointer-events:none}}:host([layout="horizontal"]){.track-range.interactive:after{all:initial;cursor:ew-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-slider-internal-handle-offset));block-size:var(--arcgis-slider-handle-size);margin-top:1px}}:host([layout="vertical"]){.track-range.interactive:after{all:initial;cursor:ns-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-slider-internal-handle-offset));block-size:var(--arcgis-slider-handle-size);margin-left:1px;writing-mode:vertical-lr}}.segment{transform-origin:0 0;inset-block-start:0px;block-size:.125rem;position:absolute;top:0;left:0}.thumb{-webkit-user-select:none;user-select:none;background-color:#4c4c4c;position:absolute}.thumb:focus,.thumb.active{.handle{background-color:var(--calcite-color-brand);box-shadow:0 0 8px #00000029;outline:2px solid var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)));outline-offset:calc(2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}}.handle{cursor:pointer;box-sizing:border-box;z-index:1;touch-action:none;background-color:var(--calcite-color-foreground-1);box-shadow:0 0 0 2px var(--calcite-color-text-3) inset;border-radius:var(--arcgis-slider-handle-size);width:var(--arcgis-slider-handle-size);height:var(--arcgis-slider-handle-size);transition:all var(--calcite-animation-timing, .125s) ease-in-out;position:absolute;top:calc(var(--arcgis-slider-internal-handle-offset) * -1);left:calc(var(--arcgis-slider-internal-handle-offset) * -1)}.handle:hover{box-shadow:0 0 0 3px var(--calcite-color-brand) inset}.label{position:absolute;will-change:transform}.label[hidden]{display:block;opacity:0;pointer-events:none}.min{grid-area:range-start}.max{grid-area:range-end}:host([layout="horizontal"][mirrored][range-labels-placement="center"]),:host([layout="vertical"]:not([mirrored])){.min{grid-area:range-end}.max{grid-area:range-start}}.content-start{grid-area:content-start;display:flex}.content-end{grid-area:content-end;display:flex}:host([layout="vertical"]){.content{grid-template:". range-start range-start range-start ." "content-start content-start track-container content-end content-end" ". range-end range-end range-end .";grid-template-rows:auto 1fr auto;grid-template-columns:1fr auto auto auto 1fr;row-gap:var(--arcgis-slider-internal-handle-offset)}.track-container{flex-direction:column}.track{flex:1;width:var(--arcgis-slider-internal-track-size)}.segment{writing-mode:vertical-lr}.label{top:calc(var(--arcgis-slider-internal-label-input-height) * -.5)}&:host([value-labels-placement="start"]){.label{right:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="end"]){.label{left:var(--arcgis-slider-internal-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="center"]){.content{--arcgis-slider-internal-content-start-min-height: calc( ((1 - var(--arcgis-slider-internal-show-range-labels)) * var(--arcgis-slider-internal-handle-offset)) + (var(--arcgis-slider-internal-value-labels-placement-start) * var(--arcgis-slider-internal-label-input-height)) );--arcgis-slider-internal-content-end-min-height: calc( ((1 - var(--arcgis-slider-internal-show-range-labels)) * var(--arcgis-slider-internal-handle-offset)) + (var(--arcgis-slider-internal-value-labels-placement-end) * var(--arcgis-slider-internal-label-input-height)) );column-gap:calc(var(--arcgis-slider-internal-show-range-labels) * var(--arcgis-slider-internal-handle-offset) / 2);padding-inline:calc((1 - var(--arcgis-slider-internal-show-range-labels)) * var(--arcgis-slider-internal-handle-offset));grid-template:". content-start ." "range-start content-start range-end" "range-start track-container range-end" "range-start content-end range-end" ". content-end .";grid-template-columns:auto 1fr auto;grid-template-rows:minmax(var(--arcgis-slider-internal-content-start-min-height),auto) calc(var(--arcgis-slider-internal-show-range-labels) * calc(calc(var(--arcgis-slider-internal-label-input-height) / 2) - calc(var(--arcgis-slider-internal-track-size) / 2))) var(--arcgis-slider-internal-track-size) calc(var(--arcgis-slider-internal-show-range-labels) * calc(calc(var(--arcgis-slider-internal-label-input-height) / 2) - calc(var(--arcgis-slider-internal-track-size) / 2))) minmax(var(--arcgis-slider-internal-content-end-min-height),auto)}.track{flex:1;height:var(--arcgis-slider-internal-track-size)}&:host([value-labels-placement="start"]){.label{bottom:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="end"]){.label{top:var(--arcgis-slider-internal-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="end"]){.content{--arcgis-slider-internal-content-start-min-height: calc( var(--arcgis-slider-internal-handle-offset) + var(--arcgis-slider-internal-value-labels-placement-start) * var(--arcgis-slider-internal-label-input-height) );--arcgis-slider-internal-content-end-min-height: calc( var(--arcgis-slider-internal-value-labels-placement-end) * var(--arcgis-slider-internal-label-input-height) );padding-inline:var(--arcgis-slider-internal-handle-offset);grid-template:"content-start content-start content-start" "track-container track-container track-container" "content-end content-end content-end" "content-end content-end content-end" "content-end content-end content-end";grid-template-columns:auto;grid-template-rows:minmax(var(--arcgis-slider-internal-content-start-min-height),auto) var(--arcgis-slider-internal-track-size) var(--arcgis-slider-internal-handle-offset) calc(var(--arcgis-slider-internal-range-labels-placement-end) * var(--arcgis-slider-internal-label-input-height)) minmax(var(--arcgis-slider-internal-content-end-min-height),auto);column-gap:var(--arcgis-slider-internal-handle-offset)}.track{flex:1;height:var(--arcgis-slider-internal-track-size)}&:host([value-labels-placement="start"]){.label{bottom:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="end"]){.label{top:calc(var(--arcgis-slider-internal-label-input-margin) + var(--arcgis-slider-internal-range-labels-placement-end) * (var(--arcgis-slider-internal-label-input-height)))}}.min,.max{--arcgis-slider-internal-range-translation: calc(var(--arcgis-slider-internal-handle-offset) + .5rem + 1px);grid-area:unset;grid-row:-3}&:host(:not([mirrored])){.min{grid-column:1;transform:translate(calc(var(--arcgis-slider-internal-range-translation) * -1))}.max{grid-column:3;transform:translate(var(--arcgis-slider-internal-range-translation))}}&:host([mirrored]){.min{grid-column:3;transform:translate(var(--arcgis-slider-internal-range-translation))}.max{grid-column:1;transform:translate(calc(var(--arcgis-slider-internal-range-translation) * -1))}}}`;
var fe = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, W = (n) => {
  throw TypeError(n);
}, D = (n, e, t, a) => {
  for (var i = a > 1 ? void 0 : a ? pe(e, t) : e, r = n.length - 1, o; r >= 0; r--)
    (o = n[r]) && (i = (a ? o(e, t, i) : o(i)) || i);
  return a && i && fe(e, t, i), i;
}, G = (n, e, t) => e.has(n) || W("Cannot " + t), ve = (n, e, t) => (G(n, e, "read from private field"), e.get(n)), be = (n, e, t) => e.has(n) ? W("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), _e = (n, e, t, a) => (G(n, e, "write to private field"), e.set(n, t), t), F;
function xe() {
  return {
    min: 0,
    max: 100,
    values: []
  };
}
let w = class extends oe {
  //--------------------------------------------------------------------------
  //
  //  Lifecycle
  //
  //--------------------------------------------------------------------------
  constructor(n = {}) {
    super({ ...xe(), properties: n }), this._entries = /* @__PURE__ */ new Map(), this.precision = 4, this.ready = !1, be(this, F);
  }
  startup() {
    const { precision: n } = this;
    let { min: e, max: t, values: a } = this;
    t = x(t, n), e = x(e, n), a = a?.map((r) => T(x(r, n), e, t)).sort((r, o) => r - o), this._set("min", e), this._set("max", t), this._set("values", a);
    const i = new Map(a?.map((r) => [K(), r]));
    this._entries = i, A(
      () => this.min,
      (r) => {
        const o = this.values;
        r != null && o?.length && o.some((s) => s < r) && (this._entries.forEach((s, l) => {
          s < r && this._entries.set(l, r);
        }), this._updatesValues());
      },
      { sync: !0 }
    ), A(
      () => this.max,
      (r) => {
        const o = this.values;
        r != null && o?.length && o.some((s) => s > r) && (this._entries.forEach((s, l) => {
          s > r && this._entries.set(l, r);
        }), this._updatesValues());
      },
      { sync: !0 }
    ), A(
      () => this.precision,
      (r) => {
        const { min: o, max: s, values: l } = this;
        this._set("min", x(o, r)), this._set("max", x(s, r)), l?.length && (this._entries.forEach((c, d) => {
          this._entries.set(d, x(c, r));
        }), this._updatesValues());
      },
      { sync: !0 }
    ), this._set("ready", !0);
  }
  get entries() {
    return this._entries;
  }
  set max(n) {
    if (!this.ready) {
      this._set("max", n);
      return;
    }
    const e = this._get("max"), t = x(n, this.precision);
    e !== t && this._set("max", t);
  }
  set min(n) {
    if (!this.ready) {
      this._set("min", n);
      return;
    }
    const e = this._get("min"), t = x(n, this.precision);
    e !== t && this._set("min", t);
  }
  set values(n) {
    if (ve(this, F) === n)
      return;
    if (_e(this, F, n), !this.ready) {
      this._set("values", n);
      return;
    }
    const e = this._get("values");
    if (n = n?.map((a) => T(x(a, this.precision), this.min, this.max)).sort((a, i) => a - i), e && n && e.length === n.length && e.every((a, i) => a === n[i]))
      return;
    const t = new Map(n?.map((a) => [K(), a]));
    this._entries = t, this._set("values", n);
  }
  //--------------------------------------------------------------------------
  //
  //  Public Methods
  //
  //--------------------------------------------------------------------------
  getValue(n) {
    return this._entries.get(n);
  }
  /**
   * Updates a thumb [value](#values) based on the provided index. The provided value
   * must differ from the previous value.
   * The provided value must also be between the [min](#min) and [max](#max).
   *
   * @returns `true` if the value was changed, otherwise `false`.
   */
  setValue(n, e) {
    if (this.values == null)
      return !1;
    const { min: t, max: a } = this, i = this._entries.get(n), r = T(x(e, this.precision), t, a);
    return i === r ? !1 : (this._entries.set(n, r), this._updatesValues(), !0);
  }
  setValues(n) {
    if (this.values == null)
      return !1;
    let e = !1;
    const { min: t, max: a } = this;
    for (const [i, r] of n) {
      const o = this._entries.get(i), s = T(x(r, this.precision), t, a);
      o !== s && (e = !0, this._entries.set(i, s));
    }
    return e ? (this._updatesValues(), !0) : !1;
  }
  _updatesValues() {
    const n = Array.from(this._entries.values()).sort((e, t) => e - t);
    this._set("values", n);
  }
};
F = /* @__PURE__ */ new WeakMap();
D([
  I()
], w.prototype, "_entries", 2);
D([
  I({ readOnly: !0 })
], w.prototype, "entries", 1);
D([
  I()
], w.prototype, "max", 1);
D([
  I()
], w.prototype, "min", 1);
D([
  I({ cast: (n) => T(n, 0, 20) })
], w.prototype, "precision", 2);
D([
  I({ readOnly: !0 })
], w.prototype, "ready", 2);
D([
  I()
], w.prototype, "values", 1);
w = D([
  ce("esri.widgets.Slider.SliderData")
], w);
function T(n, e, t) {
  return Math.min(Math.max(n, e), t);
}
function x(n, e) {
  return Number.parseFloat(n.toFixed(e));
}
class ye {
  constructor(e) {
    this.steps = e, this.minIndex = 0, this.maxIndex = this.steps.length - 1;
  }
  indexToValue(e) {
    return this.steps[k(e, this.minIndex, this.maxIndex)];
  }
  valueToIndex(e) {
    const t = this.steps.indexOf(e);
    return t !== -1 ? t : this.steps.reduce(
      (a, i, r, o) => Math.abs(i - e) < Math.abs(o[a] - e) ? r : a,
      0
    );
  }
  getClosestStepDistances(e, t) {
    if (t <= 0)
      return [];
    const a = [];
    for (let i = this.minIndex; i <= this.maxIndex; i++) {
      const r = this.indexToValue(i), o = Math.abs(r - e);
      let s = !1;
      for (let l = 0; l < a.length; l++)
        if (o < a[l].dist) {
          a.splice(l, 0, { idx: i, value: r, dist: o }), s = !0;
          break;
        }
      !s && a.length < t && a.push({ idx: i, value: r, dist: o }), a.length > t && (a.length = t);
    }
    return a;
  }
}
class we {
  constructor(e, t, a) {
    this.min = e, this.max = t, this.stepSize = a, this.minIndex = 0, this.maxIndex = Math.round((this.max - this.min) / this.stepSize);
  }
  indexToValue(e) {
    return this.min + k(e, this.minIndex, this.maxIndex) * this.stepSize;
  }
  valueToIndex(e) {
    return e = k(e, this.min, this.max), Math.round((e - this.min) / this.stepSize);
  }
  getClosestStepDistances(e, t) {
    if (t <= 0)
      return [];
    const a = [], i = this.minIndex, r = this.maxIndex, s = (k(e, this.min, this.max) - this.min) / this.stepSize;
    let l = Math.floor(s), c = l + 1;
    for (; a.length < t && (l >= i || c <= r); ) {
      if (l < i) {
        const u = this.indexToValue(c);
        a.push({ idx: c, value: u, dist: Math.abs(u - e) }), c++;
        continue;
      }
      if (c > r) {
        const u = this.indexToValue(l);
        a.push({ idx: l, value: u, dist: Math.abs(u - e) }), l--;
        continue;
      }
      const d = this.indexToValue(l), h = this.indexToValue(c), g = Math.abs(d - e), f = Math.abs(h - e);
      g <= f ? (a.push({ idx: l, value: d, dist: g }), l--) : (a.push({ idx: c, value: h, dist: f }), c++);
    }
    return a;
  }
}
function ke(n) {
  if (n.steps == null)
    return null;
  const e = n.steps;
  return Array.isArray(e) ? e.length === 0 ? null : new ye(e) : e <= 0 ? null : new we(n.min, n.max, e);
}
function De(n, e, t) {
  if (n == null) {
    const s = /* @__PURE__ */ new Map();
    for (const [l, c] of e.entries())
      s.set(l, c + t);
    return s;
  }
  const a = e.size, i = Array.from(e.entries()).map(([s, l]) => {
    const c = l + t, d = n.getClosestStepDistances(c, a);
    return { uuid: s, stepDistances: d };
  }), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
  i.sort((s, l) => s.stepDistances[0].dist - l.stepDistances[0].dist);
  for (const s of i) {
    const l = s.stepDistances.find((c) => !r.has(c.idx));
    l ? (r.add(l.idx), o.set(s.uuid, l.value)) : o.set(s.uuid, e.get(s.uuid));
  }
  return o;
}
function X(n, e, t, a, i) {
  const r = e.get(t) ?? 0;
  if (!n)
    return r + a;
  const o = r + a, s = n.minIndex, l = n.maxIndex, c = /* @__PURE__ */ new Set();
  if (!i)
    for (const [u, v] of e.entries())
      u !== t && c.add(n.valueToIndex(v));
  const d = k(n.valueToIndex(o), s, l);
  if (!c.has(d))
    return n.indexToValue(d);
  let h = null, g = 1 / 0;
  const f = Math.min(Math.max(d - s, l - d), c.size + 1);
  for (let u = 1; u <= f; u++) {
    const v = d - u;
    if (v >= s && !c.has(v)) {
      const m = n.indexToValue(v), b = Math.abs(m - o);
      h = v, g = b;
    }
    const _ = d + u;
    if (_ <= l && !c.has(_)) {
      const m = n.indexToValue(_), b = Math.abs(m - o);
      (h == null || b < g) && (h = _, g = b);
    }
    if (h != null)
      return n.indexToValue(h);
  }
  return h == null ? r : n.indexToValue(h);
}
function Ie(n, e, t, a = 1) {
  const i = J(a);
  let r = e, o = !1;
  for (let s = 0; s < i; s++) {
    const l = Ve(n, r, t);
    if (o ||= l.changed, r = l.entries, !l.changed)
      break;
  }
  return { changed: o, entries: r };
}
function Ee(n, e, t, a, i = 1) {
  const r = J(i);
  if (r === 1)
    return H(n, e, t, a);
  const o = new Map(e);
  let s = o.get(t);
  for (let l = 0; l < r; l++) {
    const c = H(n, o, t, a);
    if (c === s)
      break;
    s = c, o.set(t, s);
  }
  return s;
}
function J(n) {
  const e = Number.isFinite(n) ? Math.floor(n) : 1;
  return Math.max(1, e);
}
function Ve(n, e, t) {
  const a = /* @__PURE__ */ new Map(), i = t > 0 ? Me : Y, r = Array.from(e).sort((l, c) => i(l[1], c[1]));
  let o = !1, s = !0;
  for (const [l, c] of r)
    if (a.set(l, c), s) {
      const d = H(n, a, l, t);
      c === d && (s = !1), o ||= s, a.set(l, d);
    }
  return { changed: o, entries: a };
}
function H(n, e, t, a) {
  const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } = n, c = e.get(t);
  if (a = a > 0 ? 1 : -1, !r) {
    let m = k(c + a * o, s, l);
    if (i)
      return m;
    const b = /* @__PURE__ */ new Set();
    for (const [C, M] of e)
      C !== t && b.add(M);
    for (; b.has(m) && m <= l && m >= s; )
      m = k(m + a * o, s, l);
    return b.has(m) || m > l || m < s ? c : m;
  }
  const d = r.valueToIndex(c);
  if (d === -1)
    return c;
  if (i) {
    const m = k(d + a, r.minIndex, r.maxIndex);
    return r.indexToValue(m);
  }
  const h = /* @__PURE__ */ new Set();
  for (const [m, b] of e)
    m !== t && h.add(r.valueToIndex(b));
  let g = d, f = !1;
  const u = r.minIndex, v = r.maxIndex;
  let _ = 0;
  for (; _ < Math.abs(v - u) && (g += a, !(g < u || g > v)); ) {
    if (!h.has(g)) {
      f = !0;
      break;
    }
    _++;
  }
  return f ? r.indexToValue(g) : c;
}
function Te(n, e, t, a) {
  const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } = n, c = e.get(t);
  if (a = a > 0 ? 1 : -1, !r) {
    const f = new Set(
      Array.from(e).filter(([v]) => v !== t).map(([, v]) => v)
    );
    let u = a > 0 ? l : s;
    if (i)
      return u;
    for (; f.has(u); )
      if (u -= a * o, a > 0 && u > l || a < 0 && u < s) {
        u = c;
        break;
      }
    return u;
  }
  if (i)
    return a > 0 ? r.indexToValue(r.maxIndex) : r.indexToValue(r.minIndex);
  const d = r.valueToIndex(c);
  if (d === -1)
    return c;
  const h = new Set(
    Array.from(e).filter(([f]) => f !== t).map(([, f]) => r.valueToIndex(f))
  );
  let g = a > 0 ? r.maxIndex : r.minIndex;
  for (; h.has(g); )
    if (g -= a, a > 0 && g > l || a < 0 && g < s) {
      g = d;
      break;
    }
  return r.indexToValue(g);
}
function Ce(n, e, t) {
  const { stepsProvider: a, min: i, max: r } = n, o = /* @__PURE__ */ new Map(), s = Array.from(e).sort((c, d) => Y(c[1], d[1]));
  if (a) {
    let c = 0;
    if (t > 0) {
      const d = s[s.length - 1], h = a.valueToIndex(d[1]);
      c = a.maxIndex - h;
    } else {
      const d = s[0], h = a.valueToIndex(d[1]);
      c = a.minIndex - h;
    }
    if (c === 0)
      for (const [d, h] of s)
        o.set(d, h);
    for (const [d, h] of s) {
      const g = a.indexToValue(a.valueToIndex(h) + c);
      o.set(d, g);
    }
    return o;
  }
  let l = 0;
  if (t > 0) {
    const c = s[s.length - 1];
    l = r - c[1];
  } else {
    const c = s[0];
    l = i - c[1];
  }
  for (const [c, d] of s)
    o.set(c, d + l);
  return o;
}
function Y(n, e) {
  return n - e;
}
function Me(n, e) {
  return e - n;
}
function k(n, e, t) {
  return Math.max(e, Math.min(t, n));
}
const $e = te(w);
class Pe extends ee {
  constructor() {
    super(...arguments), this._stepsProvider = null, this._popoverElement = B(), this._trackElement = B(), this.messages = se({}), this._onPointerMoveDragUpdate = (e) => {
      this._updateDrag(this._mapEventToRange(e));
    }, this._onPointerUpDragEnd = (e) => {
      S(e) && this._endDrag();
    }, this._onPointerCancelDragEnd = () => {
      this._endDrag();
    }, this._formatLabel = (e, t, a) => {
      const i = le(this.messages._lang, t), r = this.labelFormatter;
      if (!r)
        return i.format(a);
      const o = r(a, e, (s) => i.format(s));
      return o ?? i.format(a);
    }, this._numberFormatOptions = {}, this._createFormatter = (e, t) => this._formatLabel.bind(this, e, t), this._minFormatter = this._createFormatter("min", this._numberFormatOptions), this._maxFormatter = this._createFormatter("max", this._numberFormatOptions), this._valueFormatter = this._createFormatter("value", this._numberFormatOptions), this._resizeObserver = new ResizeObserver(() => {
      this._layoutLabelInputs();
    }), this._labelInputsUpdateComplete = null, this._dragInfo = null, this._hasPopoverContent = !1, this._hasContentStart = !1, this._hasContentEnd = !1, this._activePart = null, this._sliderData = $e(this), this.allowValuesOverlap = !1, this.autoDestroyDisabled = !1, this.disabled = !1, this.fillPlacement = "start", this.layout = "horizontal", this.max = this._sliderData.max, this.min = this._sliderData.min, this.mirrored = !1, this.popoverLabel = "", this.popoverPlacement = "start", this.precision = this._sliderData.precision, this.rangeLabelsEditingEnabled = !1, this.rangeLabelsPlacement = "center", this.segmentsDraggingDisabled = !1, this.showRangeLabels = !1, this.valueLabelsDisplay = "hidden", this.valueLabelsPlacement = "start", this.valueLabelsEditingEnabled = !1, this.keyboardLargeStep = 10, this.values = this._sliderData.values, this.arcgisActiveValueChange = $({ cancelable: !1 }), this.arcgisChange = $({ cancelable: !1 }), this.arcgisInput = $({ cancelable: !1 }), this.arcgisRangeChange = $({ cancelable: !1 });
  }
  static {
    this.properties = { _dragInfo: 16, _hasPopoverContent: 16, _hasContentStart: 16, _hasContentEnd: 16, _activePart: 16, _sliderData: 16, activeValue: 32, allowValuesOverlap: 5, autoDestroyDisabled: 5, disabled: 7, fullRangeMax: 11, fullRangeMin: 11, fillPlacement: 1, labelFormatter: 0, layout: 3, max: 11, min: 11, mirrored: 7, popoverLabel: 1, popoverPlacement: 3, precision: 11, rangeLabelsEditingEnabled: 5, rangeLabelsPlacement: 3, segmentsDraggingDisabled: 5, showRangeLabels: 7, steps: [9, { converter: {
      fromAttribute(e) {
        if (e.includes(","))
          return e.split(",").filter((a) => a.trim() !== "").map(parseFloat).filter((a) => Number.isFinite(a));
        const t = parseFloat(e);
        return Number.isFinite(t) ? t : void 0;
      }
    } }], valueLabelsDisplay: 3, valueLabelsPlacement: 3, valueLabelsEditingEnabled: 5, keyboardLargeStep: 9, values: [1, { converter: {
      fromAttribute(e) {
        return e.includes(",") ? e.split(",").filter((t) => t.trim() !== "").map(parseFloat).filter((t) => Number.isFinite(t)) : [parseFloat(e)].filter((t) => Number.isFinite(t));
      }
    } }], messageOverrides: 0 };
  }
  static {
    this.styles = me;
  }
  static {
    this.shadowRootOptions = { mode: "open", delegatesFocus: !0 };
  }
  get _fullMin() {
    return this.fullRangeMin ?? this.min;
  }
  get _fullMax() {
    return this.fullRangeMax ?? this.max;
  }
  get _fullRange() {
    return this._fullMax - this._fullMin;
  }
  get isHorizontal() {
    return this.layout === "horizontal";
  }
  get _trackWidthOrHeight() {
    const e = this._trackElement.value?.getBoundingClientRect();
    return e ? this.isHorizontal ? e.width : e.height : 0;
  }
  get _disabledOrInvalid() {
    return this.disabled || this.values.length === 0 || this._invalid;
  }
  get _invalid() {
    const e = this.fullRangeMin == null || this.fullRangeMax == null || this.fullRangeMin < this.fullRangeMax, t = this.fullRangeMin == null || this.fullRangeMin <= this.min, a = this.fullRangeMax == null || this.fullRangeMax >= this.max;
    return this.min >= this.max || !e || !t || !a;
  }
  get resolution() {
    const e = (this._sliderData.max - this._sliderData.min) / this._trackWidthOrHeight;
    return Math.max(e, 1 / Math.pow(10, this.precision));
  }
  get activeValue() {
    if (this._activePart)
      return this._activePart === "range" ? "all" : this._sliderData.getValue(this._activePart);
  }
  async destroy() {
    await this.manager.destroy();
  }
  load() {
    this._sliderData.startup();
  }
  willUpdate(e) {
    if ((e.has("steps") || e.has("min") || e.has("max")) && (this._stepsProvider = ke(this)), e.has("messages") || e.has("min") || e.has("max") || e.has("precision") || e.has("labelFormatter")) {
      const t = this.max != null && this.min != null && this.max - this.min > 10 ? 2 : this.precision;
      this._numberFormatOptions = { maximumFractionDigits: t }, this._minFormatter = this._createFormatter("min", this._numberFormatOptions), this._maxFormatter = this._createFormatter("max", this._numberFormatOptions), this._valueFormatter = this._createFormatter("value", this._numberFormatOptions);
    }
  }
  updated(e) {
    this._layoutLabelInputs();
    const t = this._popoverElement.value;
    t && (e.has("values") || e.has("min") || e.has("max")) && t.reposition();
  }
  loaded() {
    this._resizeObserver.observe(this.el);
  }
  disconnectedCallback() {
    super.disconnectedCallback(), this._removeDragListeners();
  }
  _makeResizeRef() {
    let e = null;
    return (t) => {
      t ? (e = t, this._resizeObserver.observe(t)) : e && (this._resizeObserver.unobserve(e), e = null);
    };
  }
  async _layoutLabelInputs() {
    if (this.layout !== "horizontal" || !this._trackElement.value || this.valueLabelsDisplay === "hidden")
      return;
    const e = this.renderRoot.querySelectorAll("arcgis-label-input"), t = this.componentOnReady().then(() => Promise.all(Array.from(e, (r) => r.updateComplete)));
    if (this._labelInputsUpdateComplete = t, await t, t !== this._labelInputsUpdateComplete)
      return;
    this._labelInputsUpdateComplete = null;
    const a = this._trackElement.value;
    if (!a)
      return;
    const i = a.getBoundingClientRect();
    for (const r of this._sliderData.entries.keys()) {
      const o = this._activePart === "range" || this._activePart === r;
      if (this.valueLabelsDisplay === "always" || o) {
        const l = Le(this, r), c = q(this, r);
        if (!l || !c)
          continue;
        const d = l.getBoundingClientRect(), h = c.getBoundingClientRect(), g = c.getLabelBoundingClientRect(), f = d.width / 2, u = Math.round(d.left + f), v = Math.round(g.width / 2);
        let _ = h.width / 2;
        const m = i.left - f, b = i.right + f, C = u - v, M = u + v;
        C < m ? _ += C - m : M > b && (_ += M - b), c.style.transform = `translateX(${-Math.round(_)}px)`;
      }
    }
  }
  _onTrackFocus() {
    this._setActivePart("range");
  }
  _onTrackBlur() {
    this._setActivePart(null);
  }
  _onTrackRangePointerDown(e) {
    this._disabledOrInvalid || !S(e) || (e.preventDefault(), e.currentTarget.focus(), this._startDrag("range", this._mapEventToRange(e)));
  }
  async _onPointerDown(e) {
    if (this._disabledOrInvalid || !S(e))
      return;
    const t = this.renderRoot.querySelector("arcgis-label-input[editing]");
    if (e.target === t)
      return;
    if (t) {
      t.blur(), this._focusEntry(V(t));
      return;
    }
    if (Se(e.target) || this.values?.length > 1)
      return;
    const a = this._mapEventToRange(e), [i, r] = this._sliderData.entries.entries().next().value, o = a * this._fullRange + this._fullMin - r, s = z(this._fullMin, this._fullMax, r) / 100;
    this._startDrag(i, s);
    const l = X(this._stepsProvider, this._sliderData.entries, i, o, this.allowValuesOverlap);
    this._setValue(i, l), this._focusEntry(i);
  }
  _onThumbPointerDown(e) {
    const t = V(e.currentTarget);
    if (!S(e) || this._disabledOrInvalid || !t)
      return;
    const a = q(this, t);
    e.target === a && a?.editing || (e.stopPropagation(), e.preventDefault(), this._focusEntry(t), this._startDrag(t, this._mapEventToRange(e)));
  }
  _endDrag() {
    if (this._disabledOrInvalid)
      return;
    this._removeDragListeners();
    let e = !1;
    if (this._dragInfo) {
      const { entries: t } = this._dragInfo;
      for (const [a, i] of t)
        if (this._sliderData.getValue(a) !== i) {
          e = !0;
          break;
        }
    }
    this._dragInfo = null, e && this.arcgisChange.emit();
  }
  _startDrag(e, t) {
    if (this._disabledOrInvalid)
      return;
    const { min: a, max: i, values: r } = this;
    let o = a, s = i;
    if (this._setActivePart(e), e === "range") {
      if (this.segmentsDraggingDisabled)
        return;
      o = a - r[0], s = i - r[r.length - 1];
    }
    this._dragInfo = {
      position: t,
      entries: new Map(this._sliderData.entries.entries()),
      minDiff: o,
      maxDiff: s
    }, this._addDragListeners();
  }
  _updateDrag(e) {
    if (!this._dragInfo || !this._activePart)
      return;
    const { _activePart: t, _dragInfo: { position: a, entries: i, minDiff: r, maxDiff: o } } = this;
    if (a === e)
      return;
    let s = (e - a) * this._fullRange;
    if (t === "range") {
      s = Math.min(o, Math.max(r, s));
      const l = De(this._stepsProvider, i, s);
      this._setValues(l);
    } else {
      const l = X(this._stepsProvider, i, t, s, this.allowValuesOverlap);
      this._setValue(t, l);
    }
  }
  _focusEntry(e) {
    e && Fe(this, e)?.focus();
  }
  _addDragListeners() {
    document.addEventListener("pointerup", this._onPointerUpDragEnd), document.addEventListener("pointermove", this._onPointerMoveDragUpdate), document.addEventListener("pointercancel", this._onPointerCancelDragEnd);
  }
  _removeDragListeners() {
    document.removeEventListener("pointerup", this._onPointerUpDragEnd), document.removeEventListener("pointermove", this._onPointerMoveDragUpdate), document.removeEventListener("pointercancel", this._onPointerCancelDragEnd);
  }
  _setValues(e) {
    this._sliderData.setValues(e) && (this._dragInfo || this.arcgisChange.emit(), this.arcgisInput.emit());
  }
  _setValue(e, t) {
    this._sliderData.setValue(e, t) && (this._dragInfo || this.arcgisChange.emit(), this.arcgisInput.emit());
  }
  _onThumbFocus(e) {
    const t = V(e.currentTarget);
    this._setActivePart(t);
  }
  _onThumbBlur() {
    this._setActivePart(null);
  }
  _onRangeInputChange(e) {
    const t = e.currentTarget, a = t.value, i = t.dataset.type;
    let r = !1;
    switch (e.stopPropagation(), i) {
      case "min": {
        a < this.max ? (this.min = a, r = !0) : t.value = this.min;
        break;
      }
      case "max": {
        a > this.min ? (this.max = a, r = !0) : t.value = this.max;
        break;
      }
    }
    r && this.arcgisRangeChange.emit();
  }
  _onValueInputChange(e) {
    const t = e.currentTarget, a = V(t), i = t.value;
    a && (e.stopPropagation(), this._setValue(a, i), t.value = this._sliderData.getValue(a));
  }
  _mapEventToRange(e) {
    const t = this._trackElement.value?.getBoundingClientRect();
    if (!t)
      return 0;
    const a = this.isHorizontal ? (e.clientX - t.left) / t.width : 1 - (e.clientY - t.top) / t.height;
    return this.mirrored ? 1 - a : a;
  }
  _getPositionStyleForElement(e) {
    const t = z(this._fullMin, this._fullMax, e);
    return {
      [this.isHorizontal ? this.mirrored ? "right" : "left" : this.mirrored ? "top" : "bottom"]: `${t}%`
    };
  }
  _popoverSlotChange(e) {
    this._hasPopoverContent = R(e);
  }
  _onContentStartSlotChange(e) {
    this._hasContentStart = R(e);
  }
  _onContentEndSlotChange(e) {
    this._hasContentEnd = R(e);
  }
  _onThumbKeyDown(e) {
    const t = V(e.currentTarget);
    if (!t)
      return;
    const a = e.currentTarget.querySelector("arcgis-label-input");
    if (!a || a.editing)
      return;
    if (e.key === p.confirmEdit) {
      a.edit();
      return;
    }
    const i = N(e, this.keyboardLargeStep, this.mirrored);
    if (i) {
      e.preventDefault();
      const r = Ee(this._getStepsConfiguration(), this._sliderData.entries, t, i.direction, i.count);
      this._setValue(t, r);
      return;
    }
    if (U(e.key)) {
      e.preventDefault();
      const r = Te(this._getStepsConfiguration(), this._sliderData.entries, t, this._getDirectionForHomeEndKey(e.key));
      this._setValue(t, r);
    }
  }
  _onTrackRangeKeyDown(e) {
    if (this._disabledOrInvalid)
      return;
    const t = N(e, this.keyboardLargeStep, this.mirrored);
    if (t) {
      e.preventDefault();
      const { entries: a } = Ie(this._getStepsConfiguration(), this._sliderData.entries, t.direction, t.count);
      this._setValues(a);
      return;
    }
    if (U(e.key)) {
      e.preventDefault();
      const a = Ce(this._getStepsConfiguration(), this._sliderData.entries, this._getDirectionForHomeEndKey(e.key));
      this._setValues(a);
    }
  }
  _getStepsConfiguration() {
    return {
      allowValuesOverlap: this.allowValuesOverlap,
      stepsProvider: this._stepsProvider,
      resolution: this.resolution,
      min: this.min,
      max: this.max
    };
  }
  _getDirectionForHomeEndKey(e) {
    return this.isHorizontal && this.mirrored || this.layout === "vertical" ? e === p.jumpToEnd ? -1 : 1 : e === p.jumpToStart ? -1 : 1;
  }
  _setActivePart(e) {
    this._activePart !== e && (this._activePart = e, this.arcgisActiveValueChange.emit());
  }
  render() {
    return y`<div class=${P({
      content: !0,
      disabled: this._disabledOrInvalid
    })} @pointerdown=${this._onPointerDown}>${this._renderContentStart()}${this._renderContentEnd()}${this._renderRangeLabel("min")}${this._renderTrackRange()}${this._renderRangeLabel("max")}${this._renderPopover()}</div>`;
  }
  _renderPopover() {
    const { _activePart: e, layout: t, popoverPlacement: a, valueLabelsPlacement: i, valueLabelsDisplay: r, popoverLabel: o } = this, s = e ? ze(e) ? e : "track-range" : "", l = this._hasPopoverContent && !!s, c = t === "horizontal" ? a === "start" ? "top" : "bottom" : a === "start" ? "left" : "right";
    let d = 14;
    return r !== "hidden" && a === i && (d += 24), y`<calcite-popover flip-disabled focus-trap-disabled .label=${o} .open=${l} .offsetDistance=${d} .placement=${c} .referenceElement=${s} scale=s trigger-disabled ${O(this._popoverElement)}><slot name=popover @slotchange=${this._popoverSlotChange}></slot></calcite-popover>`;
  }
  _renderContentStart() {
    return y`<div class="content-start" .hidden=${!this._hasContentStart}><slot name=content-start @slotchange=${this._onContentStartSlotChange}></slot></div>`;
  }
  _renderContentEnd() {
    return y`<div class="content-end" .hidden=${!this._hasContentEnd}><slot name=content-end @slotchange=${this._onContentEndSlotChange}></slot></div>`;
  }
  _renderTrackRange() {
    return y`<div class="track-container">${this._renderTrack()}${this._renderThumbs()}</div>`;
  }
  _renderTrack() {
    return y`<div class="track" ${O(this._trackElement)}>${this._renderTrackBackground()}${this._renderFillSegment()}</div>`;
  }
  _renderTrackBackground() {
    const { max: e, min: t, fillPlacement: a, values: i } = this, r = i.length > 1;
    let o = this._fullMin, s = this._fullMax;
    const l = [];
    return this._invalid ? y`<div class="segment track-bounds" style=${L({ left: "0%", right: "0%", top: "0%", bottom: "0%" })}></div>` : (o < t && (l.push(this._renderSegment(o, t, [
      this.mirrored ? "track-effective-end" : "track-effective-start",
      !r && a === "start" ? "track-fill" : null
    ])), o = t), s > e && (l.push(this._renderSegment(e, s, [
      this.mirrored ? "track-effective-start" : "track-effective-end",
      !r && a === "end" ? "track-fill" : null
    ])), s = e), l.push(this._renderSegment(o, s, ["track-bounds"])), l);
  }
  _renderFillSegment() {
    const { values: e, fillPlacement: t, min: a, max: i } = this;
    if (!e?.length || this._invalid)
      return;
    const r = [...e].sort((s, l) => s - l);
    if (r.length === 1)
      switch (t) {
        case "start":
          if (a < r[0])
            return this._renderSegment(a, r[0], ["track-range"]);
          break;
        case "end":
          if (i > r[0])
            return this._renderSegment(r[0], i, ["track-range"]);
          break;
      }
    const o = this.segmentsDraggingDisabled;
    return this._renderSegment(r[0], r[r.length - 1], ["track-range", o ? null : "interactive", this._activePart === "range" ? "active" : null], {
      id: "track-range",
      onFocus: o ? void 0 : this._onTrackFocus,
      onBlur: o ? void 0 : this._onTrackBlur,
      onPointerDown: o ? void 0 : this._onTrackRangePointerDown,
      onKeyDown: o ? void 0 : this._onTrackRangeKeyDown
    });
  }
  _renderSegment(e, t, a, i) {
    const { _fullMin: r, _fullMax: o, mirrored: s } = this, l = [
      z(r, o, j(e, r, o)),
      100 - z(r, o, j(t, r, o))
    ];
    s && l.reverse();
    const c = this.isHorizontal ? {
      left: `${l[0]}%`,
      right: `${l[1]}%`
    } : {
      top: `${l[1]}%`,
      bottom: `${l[0]}%`
    }, d = ae("segment", ...a);
    return y`<div id=${i?.id ?? E} class=${P(d)} style=${L(c)} .tabIndex=${i?.onPointerDown ? 0 : -1} @focus=${i?.onFocus} @blur=${i?.onBlur} @pointerdown=${i?.onPointerDown} @keydown=${i?.onKeyDown}></div>`;
  }
  _renderThumbs() {
    const { _sliderData: e } = this, t = Array.from(e.entries).filter(([, a]) => a >= this._fullMin && a <= this._fullMax);
    return ie(t, ([a, i]) => this._renderThumb(a, i));
  }
  _renderThumb(e, t) {
    const { valueLabelsDisplay: a } = this, i = this._disabledOrInvalid, r = this._activePart === e || this._activePart === "range", o = this._activePart === "range" || this._activePart === e, s = a === "always" || a === "auto" && o, l = this.isHorizontal, c = l ? "horizontal" : "vertical", d = `label-${e}`, h = l ? "center" : this.valueLabelsPlacement === "start" ? "end" : "start";
    return Z(e, y`<div id=${e ?? E} .ariaLabel=${this.messages.sliderValue} aria-labelledby=${(a ? d : void 0) ?? E} .ariaOrientation=${c} .ariaValueMin=${this._minFormatter(this.min)} .ariaValueMax=${this._maxFormatter(this.max)} .ariaValueNow=${t} .ariaValueText=${this._valueFormatter(t)} class=${P({
      thumb: !0,
      active: r
    })} data-entry=${e ?? E} @pointerdown=${this._onThumbPointerDown} @focus=${this._onThumbFocus} @blur=${this._onThumbBlur} @keydown=${this._onThumbKeyDown} role=slider style=${L({
      ...this._getPositionStyleForElement(t),
      "z-index": this._activePart === e ? 1 : 0
    })} .tabIndex=${i ? -1 : 0}><span class="handle"></span><arcgis-label-input .alignment=${h} class="label" .hidden=${!s} id=${d ?? E} .labelFormatter=${this._valueFormatter} @focus=${i ? void 0 : this._onThumbFocus} @blur=${i ? void 0 : this._onThumbBlur} @arcgisChange=${this._onValueInputChange} .readOnly=${!this.valueLabelsEditingEnabled} tabindex=-1 .value=${t} ${O(this._makeResizeRef())}></arcgis-label-input></div>`);
  }
  _renderRangeLabel(e) {
    let t = "center";
    return this.isHorizontal && (t = e === "min" ? "end" : "start", this.rangeLabelsPlacement === "end" && (t = t === "end" ? "start" : "end"), this.mirrored && (t = t === "end" ? "start" : "end")), y`<arcgis-label-input .alignment=${t} class=${P(e)} data-type=${e ?? E} .hidden=${!this.showRangeLabels} .labelFormatter=${this[`_${e}Formatter`]} @arcgisChange=${this._onRangeInputChange} .readOnly=${!this.rangeLabelsEditingEnabled} .value=${this[e]}></arcgis-label-input>`;
  }
}
function Se(n) {
  return "dataset" in n && n.tagName === "ARCGIS-LABEL-INPUT" && (n.dataset.type === "min" || n.dataset.type === "max");
}
function V(n) {
  const e = ne(n, "[data-entry]");
  return e && "dataset" in e ? e.dataset.entry : null;
}
function ze(n) {
  return typeof n != null && n !== "range";
}
function Fe(n, e) {
  return e ? n.renderRoot.querySelector(`div[data-entry="${e}"]`) : null;
}
function Le(n, e) {
  return e ? n.renderRoot.querySelector(`div[data-entry="${e}"] span.handle`) : null;
}
function q(n, e) {
  return e ? n.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`) : null;
}
function S(n) {
  return n.isPrimary && n.button === 0;
}
const Re = 5;
function z(n, e, t) {
  const a = e - n, i = (t - n) / a * 100;
  return Number.parseFloat(i.toFixed(Re));
}
function j(n, e, t) {
  return Math.max(e, Math.min(t, n));
}
Q("arcgis-slider", Pe);
export {
  Pe as ArcgisSlider
};
