/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import { c as W } from "../../chunks/runtime.js";
import { keyed as J } from "lit/directives/keyed.js";
import { LitElement as Y, createEvent as P, safeClassMap as C, safeStyleMap as F, nothing as E } from "@arcgis/lumina";
import { makeAccessorController as Q } from "@arcgis/lumina/controllers/accessor";
import { slotChangeHasAssignedElement as L, classes as Z, getClosestElement as ee } from "@arcgis/toolkit/dom";
import { css as te, html as y } from "lit";
import { map as ne } from "lit/directives/map.js";
import { createRef as H, ref as R } from "lit/directives/ref.js";
import { u as ae } from "../../chunks/useT9n.js";
import { g as re } from "../../chunks/locale.js";
import ie from "@arcgis/core/core/Accessor.js";
import { property as I, subclass as se } from "@arcgis/core/core/accessorSupport/decorators.js";
import { watch as O } from "@arcgis/core/core/reactiveUtils.js";
import { generateGuid as B } 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 K({ key: a, shiftKey: e }, t, n) {
  const i = le(a);
  if (i == null)
    return null;
  const r = ce(a) || oe(a) && e ? de(t) : 1;
  return {
    direction: n ? i * -1 : i,
    count: r
  };
}
function le(a) {
  return a === p.increment || a === p.incrementHorizontal || a === p.pageIncrement ? 1 : a === p.decrement || a === p.decrementHorizontal || a === p.pageDecrement ? -1 : null;
}
function N(a) {
  return a === p.jumpToEnd || a === p.jumpToStart;
}
function oe(a) {
  return a === p.increment || a === p.decrement || a === p.decrementHorizontal || a === p.incrementHorizontal;
}
function ce(a) {
  return a === p.pageIncrement || a === p.pageDecrement;
}
function de(a) {
  const e = Number.isFinite(a) ? Math.floor(a) : 1;
  return Math.max(1, e);
}
const ue = te`: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 he = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, D = (a, e, t, n) => {
  for (var i = n > 1 ? void 0 : n ? ge(e, t) : e, r = a.length - 1, o; r >= 0; r--)
    (o = a[r]) && (i = (n ? o(e, t, i) : o(i)) || i);
  return n && i && he(e, t, i), i;
};
function me() {
  return {
    min: 0,
    max: 100,
    values: []
  };
}
let w = class extends ie {
  //--------------------------------------------------------------------------
  //
  //  Lifecycle
  //
  //--------------------------------------------------------------------------
  constructor(a = {}) {
    super({ ...me(), properties: a }), this._entries = /* @__PURE__ */ new Map(), this.precision = 4, this.ready = !1;
  }
  startup() {
    const { precision: a } = this;
    let { min: e, max: t, values: n } = this;
    t = x(t, a), e = x(e, a), n = n?.map((r) => T(x(r, a), e, t)), this._set("min", e), this._set("max", t), this._set("values", n);
    const i = new Map(n?.map((r) => [B(), r]));
    this._entries = i, O(
      () => 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 }
    ), O(
      () => 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 }
    ), O(
      () => 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(a) {
    if (!this.ready) {
      this._set("max", a);
      return;
    }
    const e = this._get("max"), t = x(a, this.precision);
    e !== t && this._set("max", t);
  }
  set min(a) {
    if (!this.ready) {
      this._set("min", a);
      return;
    }
    const e = this._get("min"), t = x(a, this.precision);
    e !== t && this._set("min", t);
  }
  set values(a) {
    if (!this.ready) {
      this._set("values", a);
      return;
    }
    const e = this._get("values");
    if (a = a?.map((n) => T(x(n, this.precision), this.min, this.max)).sort((n, i) => n - i), e && a && e.length === a.length && e.every((n, i) => n === a[i]))
      return;
    const t = new Map(a?.map((n) => [B(), n]));
    this._entries = t, this._set("values", a);
  }
  //--------------------------------------------------------------------------
  //
  //  Public Methods
  //
  //--------------------------------------------------------------------------
  getValue(a) {
    return this._entries.get(a);
  }
  /**
   * 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(a, e) {
    if (this.values == null)
      return !1;
    const { min: t, max: n } = this, i = this._entries.get(a), r = T(x(e, this.precision), t, n);
    return i === r ? !1 : (this._entries.set(a, r), this._updatesValues(), !0);
  }
  setValues(a) {
    if (this.values == null)
      return !1;
    let e = !1;
    const { min: t, max: n } = this;
    for (const [i, r] of a) {
      const o = this._entries.get(i), s = T(x(r, this.precision), t, n);
      o !== s && (e = !0, this._entries.set(i, s));
    }
    return e ? (this._updatesValues(), !0) : !1;
  }
  _updatesValues() {
    const a = Array.from(this._entries.values()).sort((e, t) => e - t);
    this._set("values", a);
  }
};
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: (a) => T(a, 0, 20) })
], w.prototype, "precision", 2);
D([
  I({ readOnly: !0 })
], w.prototype, "ready", 2);
D([
  I()
], w.prototype, "values", 1);
w = D([
  se("esri.widgets.Slider.SliderData")
], w);
function T(a, e, t) {
  return Math.min(Math.max(a, e), t);
}
function x(a, e) {
  return Number.parseFloat(a.toFixed(e));
}
class fe {
  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(
      (n, i, r, o) => Math.abs(i - e) < Math.abs(o[n] - e) ? r : n
    );
  }
  getClosestStepDistances(e, t) {
    if (t <= 0)
      return [];
    const n = [];
    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 < n.length; l++)
        if (o < n[l].dist) {
          n.splice(l, 0, { idx: i, value: r, dist: o }), s = !0;
          break;
        }
      !s && n.length < t && n.push({ idx: i, value: r, dist: o }), n.length > t && (n.length = t);
    }
    return n;
  }
}
class pe {
  constructor(e, t, n) {
    this.min = e, this.max = t, this.stepSize = n, 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 n = [], 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 (; n.length < t && (l >= i || c <= r); ) {
      if (l < i) {
        const h = this.indexToValue(c);
        n.push({ idx: c, value: h, dist: Math.abs(h - e) }), c++;
        continue;
      }
      if (c > r) {
        const h = this.indexToValue(l);
        n.push({ idx: l, value: h, dist: Math.abs(h - e) }), l--;
        continue;
      }
      const d = this.indexToValue(l), u = this.indexToValue(c), g = Math.abs(d - e), f = Math.abs(u - e);
      g <= f ? (n.push({ idx: l, value: d, dist: g }), l--) : (n.push({ idx: c, value: u, dist: f }), c++);
    }
    return n;
  }
}
function ve(a) {
  if (a.steps == null)
    return null;
  const e = a.steps;
  return Array.isArray(e) ? e.length === 0 ? null : new fe(e) : e <= 0 ? null : new pe(a.min, a.max, e);
}
function be(a, e, t) {
  if (a == null) {
    const s = /* @__PURE__ */ new Map();
    for (const [l, c] of e.entries())
      s.set(l, c + t);
    return s;
  }
  const n = e.size, i = Array.from(e.entries()).map(([s, l]) => {
    const c = l + t, d = a.getClosestStepDistances(c, n);
    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 U(a, e, t, n, i) {
  const r = e.get(t) ?? 0;
  if (!a)
    return r + n;
  const o = r + n, s = a.minIndex, l = a.maxIndex, c = /* @__PURE__ */ new Set();
  if (!i)
    for (const [h, v] of e.entries())
      h !== t && c.add(a.valueToIndex(v));
  const d = k(a.valueToIndex(o), s, l);
  if (!c.has(d))
    return a.indexToValue(d);
  let u = null, g = 1 / 0;
  const f = Math.min(Math.max(d - s, l - d), c.size + 1);
  for (let h = 1; h <= f; h++) {
    const v = d - h;
    if (v >= s && !c.has(v)) {
      const m = a.indexToValue(v), b = Math.abs(m - o);
      u = v, g = b;
    }
    const _ = d + h;
    if (_ <= l && !c.has(_)) {
      const m = a.indexToValue(_), b = Math.abs(m - o);
      (u == null || b < g) && (u = _, g = b);
    }
    if (u != null)
      return a.indexToValue(u);
  }
  return u == null ? r : a.indexToValue(u);
}
function _e(a, e, t, n = 1) {
  const i = q(n);
  let r = e, o = !1;
  for (let s = 0; s < i; s++) {
    const l = ye(a, r, t);
    if (o ||= l.changed, r = l.entries, !l.changed)
      break;
  }
  return { changed: o, entries: r };
}
function xe(a, e, t, n, i = 1) {
  const r = q(i);
  if (r === 1)
    return A(a, e, t, n);
  const o = new Map(e);
  let s = o.get(t);
  for (let l = 0; l < r; l++) {
    const c = A(a, o, t, n);
    if (c === s)
      break;
    s = c, o.set(t, s);
  }
  return s;
}
function q(a) {
  const e = Number.isFinite(a) ? Math.floor(a) : 1;
  return Math.max(1, e);
}
function ye(a, e, t) {
  const n = /* @__PURE__ */ new Map(), i = t > 0 ? De : G, r = Array.from(e).sort((l, c) => i(l[1], c[1]));
  let o = !1, s = !0;
  for (const [l, c] of r)
    if (n.set(l, c), s) {
      const d = A(a, n, l, t);
      c === d && (s = !1), o ||= s, n.set(l, d);
    }
  return { changed: o, entries: n };
}
function A(a, e, t, n) {
  const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } = a, c = e.get(t);
  if (n = n > 0 ? 1 : -1, !r) {
    let m = k(c + n * o, s, l);
    if (i)
      return m;
    const b = /* @__PURE__ */ new Set();
    for (const [$, M] of e)
      $ !== t && b.add(M);
    for (; b.has(m) && m <= l && m >= s; )
      m = k(m + n * 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 + n, r.minIndex, r.maxIndex);
    return r.indexToValue(m);
  }
  const u = /* @__PURE__ */ new Set();
  for (const [m, b] of e)
    m !== t && u.add(r.valueToIndex(b));
  let g = d, f = !1;
  const h = r.minIndex, v = r.maxIndex;
  let _ = 0;
  for (; _ < Math.abs(v - h) && (g += n, !(g < h || g > v)); ) {
    if (!u.has(g)) {
      f = !0;
      break;
    }
    _++;
  }
  return f ? r.indexToValue(g) : c;
}
function we(a, e, t, n) {
  const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } = a, c = e.get(t);
  if (n = n > 0 ? 1 : -1, !r) {
    const f = new Set(
      Array.from(e).filter(([v]) => v !== t).map(([, v]) => v)
    );
    let h = n > 0 ? l : s;
    if (i)
      return h;
    for (; f.has(h); )
      if (h -= n * o, n > 0 && h > l || n < 0 && h < s) {
        h = c;
        break;
      }
    return h;
  }
  if (i)
    return n > 0 ? r.indexToValue(r.maxIndex) : r.indexToValue(r.minIndex);
  const d = r.valueToIndex(c);
  if (d === -1)
    return c;
  const u = new Set(
    Array.from(e).filter(([f]) => f !== t).map(([, f]) => r.valueToIndex(f))
  );
  let g = n > 0 ? r.maxIndex : r.minIndex;
  for (; u.has(g); )
    if (g -= n, n > 0 && g > l || n < 0 && g < s) {
      g = d;
      break;
    }
  return r.indexToValue(g);
}
function ke(a, e, t) {
  const { stepsProvider: n, min: i, max: r } = a, o = /* @__PURE__ */ new Map(), s = Array.from(e).sort((c, d) => G(c[1], d[1]));
  if (n) {
    let c = 0;
    if (t > 0) {
      const d = s[s.length - 1], u = n.valueToIndex(d[1]);
      c = n.maxIndex - u;
    } else {
      const d = s[0], u = n.valueToIndex(d[1]);
      c = n.minIndex - u;
    }
    if (c === 0)
      for (const [d, u] of s)
        o.set(d, u);
    for (const [d, u] of s) {
      const g = n.indexToValue(n.valueToIndex(u) + 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 G(a, e) {
  return a - e;
}
function De(a, e) {
  return e - a;
}
function k(a, e, t) {
  return Math.max(e, Math.min(t, a));
}
const Ie = Q(w);
class Ee extends Y {
  constructor() {
    super(...arguments), this._stepsProvider = null, this._popoverElement = H(), this._trackElement = H(), this.messages = ae({}), this._onPointerMoveDragUpdate = (e) => {
      this._updateDrag(this._mapEventToRange(e));
    }, this._onPointerUpDragEnd = (e) => {
      S(e) && this._endDrag();
    }, this._onPointerCancelDragEnd = () => {
      this._endDrag();
    }, this._formatLabel = (e, t, n) => {
      const i = re(this.messages._lang, t), r = this.labelFormatter;
      if (!r)
        return i.format(n);
      const o = r(n, e, (s) => i.format(s));
      return o ?? i.format(n);
    }, 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 = Ie(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 = P({ cancelable: !1 }), this.arcgisChange = P({ cancelable: !1 }), this.arcgisInput = P({ cancelable: !1 }), this.arcgisRangeChange = P({ 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((n) => n.trim() !== "").map(parseFloat).filter((n) => Number.isFinite(n));
        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 = ue;
  }
  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, n = this.fullRangeMax == null || this.fullRangeMax >= this.max;
    return this.min >= this.max || !e || !t || !n;
  }
  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 = ve(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 n = this._trackElement.value;
    if (!n)
      return;
    const i = n.getBoundingClientRect();
    for (const r of this._sliderData.entries.keys()) {
      const o = this._activePart === "range" || this._activePart === r;
      if (this.valueLabelsDisplay === "always" || o) {
        const l = Me(this, r), c = j(this, r);
        if (!l || !c)
          continue;
        const d = l.getBoundingClientRect(), u = c.getBoundingClientRect(), g = c.getLabelBoundingClientRect(), f = d.width / 2, h = Math.round(d.left + f), v = Math.round(g.width / 2);
        let _ = u.width / 2;
        const m = i.left - f, b = i.right + f, $ = h - v, M = h + v;
        $ < m ? _ += $ - 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 (Ve(e.target) || this.values?.length > 1)
      return;
    const n = this._mapEventToRange(e), [i, r] = this._sliderData.entries.entries().next().value, o = n * this._fullRange + this._fullMin - r, s = z(this._fullMin, this._fullMax, r) / 100;
    this._startDrag(i, s);
    const l = U(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 n = j(this, t);
    e.target === n && n?.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 [n, i] of t)
        if (this._sliderData.getValue(n) !== i) {
          e = !0;
          break;
        }
    }
    this._dragInfo = null, e && this.arcgisChange.emit();
  }
  _startDrag(e, t) {
    if (this._disabledOrInvalid)
      return;
    const { min: n, max: i, values: r } = this;
    let o = n, s = i;
    if (this._setActivePart(e), e === "range") {
      if (this.segmentsDraggingDisabled)
        return;
      o = n - 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: n, entries: i, minDiff: r, maxDiff: o } } = this;
    if (n === e)
      return;
    let s = (e - n) * this._fullRange;
    if (t === "range") {
      s = Math.min(o, Math.max(r, s));
      const l = be(this._stepsProvider, i, s);
      this._setValues(l);
    } else {
      const l = U(this._stepsProvider, i, t, s, this.allowValuesOverlap);
      this._setValue(t, l);
    }
  }
  _focusEntry(e) {
    e && $e(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, n = t.value, i = t.dataset.type;
    let r = !1;
    switch (e.stopPropagation(), i) {
      case "min": {
        n < this.max ? (this.min = n, r = !0) : t.value = this.min;
        break;
      }
      case "max": {
        n > this.min ? (this.max = n, r = !0) : t.value = this.max;
        break;
      }
    }
    r && this.arcgisRangeChange.emit();
  }
  _onValueInputChange(e) {
    const t = e.currentTarget, n = V(t), i = t.value;
    n && (e.stopPropagation(), this._setValue(n, i), t.value = this._sliderData.getValue(n));
  }
  _mapEventToRange(e) {
    const t = this._trackElement.value?.getBoundingClientRect();
    if (!t)
      return 0;
    const n = this.isHorizontal ? (e.clientX - t.left) / t.width : 1 - (e.clientY - t.top) / t.height;
    return this.mirrored ? 1 - n : n;
  }
  _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 = L(e);
  }
  _onContentStartSlotChange(e) {
    this._hasContentStart = L(e);
  }
  _onContentEndSlotChange(e) {
    this._hasContentEnd = L(e);
  }
  _onThumbKeyDown(e) {
    const t = V(e.currentTarget);
    if (!t)
      return;
    const n = e.currentTarget.querySelector("arcgis-label-input");
    if (!n || n.editing)
      return;
    if (e.key === p.confirmEdit) {
      n.edit();
      return;
    }
    const i = K(e, this.keyboardLargeStep, this.mirrored);
    if (i) {
      e.preventDefault();
      const r = xe(this._getStepsConfiguration(), this._sliderData.entries, t, i.direction, i.count);
      this._setValue(t, r);
      return;
    }
    if (N(e.key)) {
      e.preventDefault();
      const r = we(this._getStepsConfiguration(), this._sliderData.entries, t, this._getDirectionForHomeEndKey(e.key));
      this._setValue(t, r);
    }
  }
  _onTrackRangeKeyDown(e) {
    if (this._disabledOrInvalid)
      return;
    const t = K(e, this.keyboardLargeStep, this.mirrored);
    if (t) {
      e.preventDefault();
      const { entries: n } = _e(this._getStepsConfiguration(), this._sliderData.entries, t.direction, t.count);
      this._setValues(n);
      return;
    }
    if (N(e.key)) {
      e.preventDefault();
      const n = ke(this._getStepsConfiguration(), this._sliderData.entries, this._getDirectionForHomeEndKey(e.key));
      this._setValues(n);
    }
  }
  _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=${C({
      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: n, valueLabelsPlacement: i, valueLabelsDisplay: r, popoverLabel: o } = this, s = e ? Te(e) ? e : "track-range" : "", l = this._hasPopoverContent && !!s, c = t === "horizontal" ? n === "start" ? "top" : "bottom" : n === "start" ? "left" : "right";
    let d = 14;
    return r !== "hidden" && n === i && (d += 24), y`<calcite-popover flip-disabled focus-trap-disabled .label=${o} .open=${l} .offsetDistance=${d} .placement=${c} pointer-disabled .referenceElement=${s} scale=s trigger-disabled ${R(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" ${R(this._trackElement)}>${this._renderTrackBackground()}${this._renderFillSegment()}</div>`;
  }
  _renderTrackBackground() {
    const { max: e, min: t, fillPlacement: n, 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=${F({ 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 && n === "start" ? "track-fill" : null
    ])), o = t), s > e && (l.push(this._renderSegment(e, s, [
      this.mirrored ? "track-effective-start" : "track-effective-end",
      !r && n === "end" ? "track-fill" : null
    ])), s = e), l.push(this._renderSegment(o, s, ["track-bounds"])), l);
  }
  _renderFillSegment() {
    const { values: e, fillPlacement: t, min: n, 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 (n < r[0])
            return this._renderSegment(n, 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, n, i) {
    const { _fullMin: r, _fullMax: o, mirrored: s } = this, l = [
      z(r, o, X(e, r, o)),
      100 - z(r, o, X(t, r, o))
    ];
    s && l.reverse();
    const c = this.isHorizontal ? {
      left: `${l[0]}%`,
      right: `${l[1]}%`
    } : {
      top: `${l[1]}%`,
      bottom: `${l[0]}%`
    }, d = Z("segment", ...n);
    return y`<div id=${i?.id ?? E} class=${C(d)} style=${F(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(([, n]) => n >= this._fullMin && n <= this._fullMax);
    return ne(t, ([n, i]) => this._renderThumb(n, i));
  }
  _renderThumb(e, t) {
    const { valueLabelsDisplay: n } = this, i = this._disabledOrInvalid, r = this._activePart === e || this._activePart === "range", o = this._activePart === "range" || this._activePart === e, s = n === "always" || n === "auto" && o, l = this.isHorizontal, c = l ? "horizontal" : "vertical", d = `label-${e}`, u = l ? "center" : this.valueLabelsPlacement === "start" ? "end" : "start";
    return J(e, y`<div id=${e ?? E} .ariaLabel=${this.messages.sliderValue} aria-labelledby=${(n ? d : void 0) ?? E} .ariaOrientation=${c} .ariaValueMin=${this._minFormatter(this.min)} .ariaValueMax=${this._maxFormatter(this.max)} .ariaValueNow=${t} .ariaValueText=${this._valueFormatter(t)} class=${C({
      thumb: !0,
      active: r
    })} data-entry=${e ?? E} @pointerdown=${this._onThumbPointerDown} @focus=${this._onThumbFocus} @blur=${this._onThumbBlur} @keydown=${this._onThumbKeyDown} role=slider style=${F({
      ...this._getPositionStyleForElement(t),
      "z-index": this._activePart === e ? 1 : 0
    })} .tabIndex=${i ? -1 : 0}><span class="handle"></span><arcgis-label-input .alignment=${u} 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} ${R(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=${C(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 Ve(a) {
  return "dataset" in a && a.tagName === "ARCGIS-LABEL-INPUT" && (a.dataset.type === "min" || a.dataset.type === "max");
}
function V(a) {
  const e = ee(a, "[data-entry]");
  return e && "dataset" in e ? e.dataset.entry : null;
}
function Te(a) {
  return typeof a != null && a !== "range";
}
function $e(a, e) {
  return e ? a.renderRoot.querySelector(`div[data-entry="${e}"]`) : null;
}
function Me(a, e) {
  return e ? a.renderRoot.querySelector(`div[data-entry="${e}"] span.handle`) : null;
}
function j(a, e) {
  return e ? a.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`) : null;
}
function S(a) {
  return a.isPrimary && a.button === 0;
}
const Pe = 5;
function z(a, e, t) {
  const n = e - a, i = (t - a) / n * 100;
  return Number.parseFloat(i.toFixed(Pe));
}
function X(a, e, t) {
  return Math.max(e, Math.min(t, a));
}
W("arcgis-slider", Ee);
export {
  Ee as ArcgisSlider
};
