import { b as o } from "./tslib.es6-CJ7TUrOc.mjs";
import "./ripple-handlers-_gEIkKpx.mjs";
import { d as c } from "./utils-Dr5MegQq.mjs";
import { S as h, T as r, s as m } from "./mwc-slider.css-CBNgYCJf.mjs";
import { x as T, e as v } from "./query-assigned-elements-D930kELM.mjs";
import { n as b } from "./property-DJzm_oB9.mjs";
import { o as f } from "./style-map-D2TR7M-D.mjs";
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class u extends h {
  get value() {
    return this.valueEnd;
  }
  set value(t) {
    this.valueEnd = t;
  }
  renderTrack() {
    const t = f({
      "transform-origin": this.trackTransformOriginStyle,
      left: this.trackLeftStyle,
      right: this.trackRightStyle,
      "-webkit-transform": `scaleX(${(this.valueEnd - this.min) / (this.max - this.min)})`,
      transform: `scaleX(${(this.valueEnd - this.min) / (this.max - this.min)})`,
      "-webkit-transition": this.trackTransitionStyle,
      transition: this.trackTransitionStyle
    });
    return T`
      <div class="mdc-slider__track">
        <div class="mdc-slider__track--inactive"></div>
        <div class="mdc-slider__track--active">
          <div
              class="mdc-slider__track--active_fill"
              style=${t}>
          </div>
        </div>
      </div>`;
  }
  createAdapter() {
    return {
      addClass: (t) => {
        switch (t) {
          case "mdc-slider--disabled":
            this.disabled = !0;
            break;
        }
      },
      removeClass: (t) => {
        switch (t) {
          case "mdc-slider--disabled":
            this.disabled = !1;
            break;
        }
      },
      hasClass: (t) => {
        switch (t) {
          case "mdc-slider--disabled":
            return this.disabled;
          case "mdc-slider--discrete":
            return this.discrete;
          default:
            return !1;
        }
      },
      addThumbClass: (t, e) => {
        if (e !== r.START)
          switch (t) {
            case "mdc-slider__thumb--with-indicator":
              this.endThumbWithIndicator = !0;
              break;
          }
      },
      removeThumbClass: (t, e) => {
        if (e !== r.START)
          switch (t) {
            case "mdc-slider__thumb--with-indicator":
              this.endThumbWithIndicator = !1;
              break;
          }
      },
      registerEventHandler: () => {
      },
      deregisterEventHandler: () => {
      },
      registerBodyEventHandler: (t, e) => {
        document.body.addEventListener(t, e);
      },
      deregisterBodyEventHandler: (t, e) => {
        document.body.removeEventListener(t, e);
      },
      registerInputEventHandler: (t, e, i) => {
        t !== r.START && this.formElement.addEventListener(e, i);
      },
      deregisterInputEventHandler: (t, e, i) => {
        t !== r.START && this.formElement.removeEventListener(e, i);
      },
      registerThumbEventHandler: () => {
      },
      deregisterThumbEventHandler: () => {
      },
      registerWindowEventHandler: (t, e) => {
        window.addEventListener(t, e);
      },
      deregisterWindowEventHandler: (t, e) => {
        window.addEventListener(t, e);
      },
      emitChangeEvent: (t, e) => {
        if (e === r.START)
          return;
        const i = new CustomEvent("change", { bubbles: !0, composed: !0, detail: { value: t, thumb: e } });
        this.dispatchEvent(i);
      },
      emitDragEndEvent: (t, e) => {
        e !== r.START && this.endRippleHandlers.endPress();
      },
      emitDragStartEvent: (t, e) => {
        e !== r.START && this.endRippleHandlers.startPress();
      },
      emitInputEvent: (t, e) => {
        if (e === r.START)
          return;
        const i = new CustomEvent("input", { bubbles: !0, composed: !0, detail: { value: t, thumb: e } });
        this.dispatchEvent(i);
      },
      focusInput: (t) => {
        t !== r.START && this.formElement.focus();
      },
      getAttribute: () => "",
      getBoundingClientRect: () => this.mdcRoot.getBoundingClientRect(),
      getInputAttribute: (t, e) => {
        if (e === r.START)
          return null;
        switch (t) {
          case "min":
            return this.min.toString();
          case "max":
            return this.max.toString();
          case "value":
            return this.valueEnd.toString();
          case "step":
            return this.step.toString();
          default:
            return null;
        }
      },
      getInputValue: (t) => t === r.START ? "" : this.valueEnd.toString(),
      getThumbBoundingClientRect: (t) => t === r.START ? this.getBoundingClientRect() : this.endThumb.getBoundingClientRect(),
      getThumbKnobWidth: (t) => t === r.START ? 0 : this.endThumbKnob.getBoundingClientRect().width,
      getValueIndicatorContainerWidth: (t) => t === r.START ? 0 : this.endValueIndicatorContainer.getBoundingClientRect().width,
      getValueToAriaValueTextFn: () => this.valueToAriaTextTransform,
      isInputFocused: (t) => {
        if (t === r.START)
          return !1;
        const e = c();
        return e[e.length - 1] === this.formElement;
      },
      isRTL: () => getComputedStyle(this).direction === "rtl",
      setInputAttribute: (t, e, i) => {
        r.START;
      },
      removeInputAttribute: (t) => {
      },
      setThumbStyleProperty: (t, e, i) => {
        if (i !== r.START)
          switch (t) {
            case "transform":
            case "-webkit-transform":
              this.endThumbTransformStyle = e;
              break;
            case "transition":
            case "-webkit-transition":
              this.endThumbTransitionStyle = e;
              break;
            default:
              t.startsWith("--") && (this.endThumbCssProperties[t] = e);
          }
      },
      removeThumbStyleProperty: (t, e) => {
        if (e !== r.START)
          switch (t) {
            case "left":
            case "right":
              break;
            case "transition":
            case "-webkit-transition":
              this.endThumbTransitionStyle = "";
              break;
          }
      },
      setTrackActiveStyleProperty: (t, e) => {
        switch (t) {
          case "transform-origin":
            this.trackTransformOriginStyle = e;
            break;
          case "left":
            this.trackLeftStyle = e;
            break;
          case "right":
            this.trackRightStyle = e;
            break;
          case "transform":
          case "-webkit-transform":
            break;
          case "transition":
          case "-webkit-transition":
            this.trackTransitionStyle = e;
            break;
        }
      },
      removeTrackActiveStyleProperty: (t) => {
        switch (t) {
          case "transition":
          case "-webkit-transition":
            this.trackTransitionStyle = "";
            break;
        }
      },
      setInputValue: (t, e) => {
        e !== r.START && (this.valueEnd = Number(t));
      },
      setPointerCapture: (t) => {
        this.mdcRoot.setPointerCapture(t);
      },
      setValueIndicatorText: () => {
      },
      updateTickMarks: (t) => {
        this.tickMarks = t;
      }
    };
  }
}
o([
  b({ type: Number })
], u.prototype, "value", null);
var g = Object.getOwnPropertyDescriptor, S = (a, t, e, i) => {
  for (var s = i > 1 ? void 0 : i ? g(t, e) : t, d = a.length - 1, l; d >= 0; d--)
    (l = a[d]) && (s = l(s) || s);
  return s;
};
let n = class extends u {
};
n.styles = [m];
n = S([
  v("cv-slider")
], n);
const C = n;
export {
  n as CovalentSlider,
  C as default
};
