/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { MDCLinearProgress } from '@material/linear-progress';
import { CustomElement, coerceBoolean, coerceNumber, attachShadowTemplate, getShadowElement, toggleAttribute } from '@tylertech/forge-core';
import { BaseComponent } from '../core/base/base-component';
import { LINEAR_PROGRESS_CONSTANTS } from './linear-progress-constants';
const template = '<template><div role=\"progressbar\" class=\"mdc-linear-progress\" part=\"root\" aria-valuemin=\"0\" aria-valuemax=\"1\" aria-valuenow=\"0\"><div class=\"mdc-linear-progress__buffer\" part=\"buffer\"><div class=\"mdc-linear-progress__buffer-bar\" part=\"buffer-bar\"></div><div class=\"mdc-linear-progress__buffer-dots\" part=\"buffer-dots\"></div></div><div class=\"mdc-linear-progress__bar mdc-linear-progress__primary-bar\" part=\"progress-bar\"><span class=\"mdc-linear-progress__bar-inner\" part=\"progress-bar-inner\"></span></div><div class=\"mdc-linear-progress__bar mdc-linear-progress__secondary-bar\" part=\"secondary-bar\"><span class=\"mdc-linear-progress__bar-inner\" part=\"secondary-bar-inner\"></span></div></div></template>';
const styles = '@-webkit-keyframes mdc-linear-progress-primary-indeterminate-translate{0%{-webkit-transform:translateX(0);transform:translateX(0)}20%{-webkit-animation-timing-function:cubic-bezier(0.5,0,0.701732,0.495819);animation-timing-function:cubic-bezier(0.5,0,0.701732,0.495819);-webkit-transform:translateX(0);transform:translateX(0)}59.15%{-webkit-animation-timing-function:cubic-bezier(0.302435,0.381352,0.55,0.956352);animation-timing-function:cubic-bezier(0.302435,0.381352,0.55,0.956352);-webkit-transform:translateX(83.67142%);transform:translateX(83.67142%);-webkit-transform:translateX(var(--mdc-linear-progress-primary-half,83.67142%));transform:translateX(var(--mdc-linear-progress-primary-half,83.67142%))}100%{-webkit-transform:translateX(200.611057%);transform:translateX(200.611057%);-webkit-transform:translateX(var(--mdc-linear-progress-primary-full,200.611057%));transform:translateX(var(--mdc-linear-progress-primary-full,200.611057%))}}@keyframes mdc-linear-progress-primary-indeterminate-translate{0%{-webkit-transform:translateX(0);transform:translateX(0)}20%{-webkit-animation-timing-function:cubic-bezier(0.5,0,0.701732,0.495819);animation-timing-function:cubic-bezier(0.5,0,0.701732,0.495819);-webkit-transform:translateX(0);transform:translateX(0)}59.15%{-webkit-animation-timing-function:cubic-bezier(0.302435,0.381352,0.55,0.956352);animation-timing-function:cubic-bezier(0.302435,0.381352,0.55,0.956352);-webkit-transform:translateX(83.67142%);transform:translateX(83.67142%);-webkit-transform:translateX(var(--mdc-linear-progress-primary-half,83.67142%));transform:translateX(var(--mdc-linear-progress-primary-half,83.67142%))}100%{-webkit-transform:translateX(200.611057%);transform:translateX(200.611057%);-webkit-transform:translateX(var(--mdc-linear-progress-primary-full,200.611057%));transform:translateX(var(--mdc-linear-progress-primary-full,200.611057%))}}@-webkit-keyframes mdc-linear-progress-primary-indeterminate-scale{0%{-webkit-transform:scaleX(.08);transform:scaleX(.08)}36.65%{-webkit-animation-timing-function:cubic-bezier(0.334731,0.12482,0.785844,1);animation-timing-function:cubic-bezier(0.334731,0.12482,0.785844,1);-webkit-transform:scaleX(.08);transform:scaleX(.08)}69.15%{-webkit-animation-timing-function:cubic-bezier(0.06,0.11,0.6,1);animation-timing-function:cubic-bezier(0.06,0.11,0.6,1);-webkit-transform:scaleX(.661479);transform:scaleX(.661479)}100%{-webkit-transform:scaleX(.08);transform:scaleX(.08)}}@keyframes mdc-linear-progress-primary-indeterminate-scale{0%{-webkit-transform:scaleX(.08);transform:scaleX(.08)}36.65%{-webkit-animation-timing-function:cubic-bezier(0.334731,0.12482,0.785844,1);animation-timing-function:cubic-bezier(0.334731,0.12482,0.785844,1);-webkit-transform:scaleX(.08);transform:scaleX(.08)}69.15%{-webkit-animation-timing-function:cubic-bezier(0.06,0.11,0.6,1);animation-timing-function:cubic-bezier(0.06,0.11,0.6,1);-webkit-transform:scaleX(.661479);transform:scaleX(.661479)}100%{-webkit-transform:scaleX(.08);transform:scaleX(.08)}}@-webkit-keyframes mdc-linear-progress-secondary-indeterminate-translate{0%{-webkit-animation-timing-function:cubic-bezier(0.15,0,0.515058,0.409685);animation-timing-function:cubic-bezier(0.15,0,0.515058,0.409685);-webkit-transform:translateX(0);transform:translateX(0)}25%{-webkit-animation-timing-function:cubic-bezier(0.31033,0.284058,0.8,0.733712);animation-timing-function:cubic-bezier(0.31033,0.284058,0.8,0.733712);-webkit-transform:translateX(37.651913%);transform:translateX(37.651913%);-webkit-transform:translateX(var(--mdc-linear-progress-secondary-quarter,37.651913%));transform:translateX(var(--mdc-linear-progress-secondary-quarter,37.651913%))}48.35%{-webkit-animation-timing-function:cubic-bezier(0.4,0.627035,0.6,0.902026);animation-timing-function:cubic-bezier(0.4,0.627035,0.6,0.902026);-webkit-transform:translateX(84.386165%);transform:translateX(84.386165%);-webkit-transform:translateX(var(--mdc-linear-progress-secondary-half,84.386165%));transform:translateX(var(--mdc-linear-progress-secondary-half,84.386165%))}100%{-webkit-transform:translateX(160.277782%);transform:translateX(160.277782%);-webkit-transform:translateX(var(--mdc-linear-progress-secondary-full,160.277782%));transform:translateX(var(--mdc-linear-progress-secondary-full,160.277782%))}}@keyframes mdc-linear-progress-secondary-indeterminate-translate{0%{-webkit-animation-timing-function:cubic-bezier(0.15,0,0.515058,0.409685);animation-timing-function:cubic-bezier(0.15,0,0.515058,0.409685);-webkit-transform:translateX(0);transform:translateX(0)}25%{-webkit-animation-timing-function:cubic-bezier(0.31033,0.284058,0.8,0.733712);animation-timing-function:cubic-bezier(0.31033,0.284058,0.8,0.733712);-webkit-transform:translateX(37.651913%);transform:translateX(37.651913%);-webkit-transform:translateX(var(--mdc-linear-progress-secondary-quarter,37.651913%));transform:translateX(var(--mdc-linear-progress-secondary-quarter,37.651913%))}48.35%{-webkit-animation-timing-function:cubic-bezier(0.4,0.627035,0.6,0.902026);animation-timing-function:cubic-bezier(0.4,0.627035,0.6,0.902026);-webkit-transform:translateX(84.386165%);transform:translateX(84.386165%);-webkit-transform:translateX(var(--mdc-linear-progress-secondary-half,84.386165%));transform:translateX(var(--mdc-linear-progress-secondary-half,84.386165%))}100%{-webkit-transform:translateX(160.277782%);transform:translateX(160.277782%);-webkit-transform:translateX(var(--mdc-linear-progress-secondary-full,160.277782%));transform:translateX(var(--mdc-linear-progress-secondary-full,160.277782%))}}@-webkit-keyframes mdc-linear-progress-secondary-indeterminate-scale{0%{-webkit-animation-timing-function:cubic-bezier(0.205028,0.057051,0.57661,0.453971);animation-timing-function:cubic-bezier(0.205028,0.057051,0.57661,0.453971);-webkit-transform:scaleX(.08);transform:scaleX(.08)}19.15%{-webkit-animation-timing-function:cubic-bezier(0.152313,0.196432,0.648374,1.004315);animation-timing-function:cubic-bezier(0.152313,0.196432,0.648374,1.004315);-webkit-transform:scaleX(.457104);transform:scaleX(.457104)}44.15%{-webkit-animation-timing-function:cubic-bezier(0.257759,-0.003163,0.211762,1.38179);animation-timing-function:cubic-bezier(0.257759,-0.003163,0.211762,1.38179);-webkit-transform:scaleX(.72796);transform:scaleX(.72796)}100%{-webkit-transform:scaleX(.08);transform:scaleX(.08)}}@keyframes mdc-linear-progress-secondary-indeterminate-scale{0%{-webkit-animation-timing-function:cubic-bezier(0.205028,0.057051,0.57661,0.453971);animation-timing-function:cubic-bezier(0.205028,0.057051,0.57661,0.453971);-webkit-transform:scaleX(.08);transform:scaleX(.08)}19.15%{-webkit-animation-timing-function:cubic-bezier(0.152313,0.196432,0.648374,1.004315);animation-timing-function:cubic-bezier(0.152313,0.196432,0.648374,1.004315);-webkit-transform:scaleX(.457104);transform:scaleX(.457104)}44.15%{-webkit-animation-timing-function:cubic-bezier(0.257759,-0.003163,0.211762,1.38179);animation-timing-function:cubic-bezier(0.257759,-0.003163,0.211762,1.38179);-webkit-transform:scaleX(.72796);transform:scaleX(.72796)}100%{-webkit-transform:scaleX(.08);transform:scaleX(.08)}}@-webkit-keyframes mdc-linear-progress-buffering{from{-webkit-transform:rotate(180deg) translateX(-10px);transform:rotate(180deg) translateX(-10px)}}@keyframes mdc-linear-progress-buffering{from{-webkit-transform:rotate(180deg) translateX(-10px);transform:rotate(180deg) translateX(-10px)}}@-webkit-keyframes mdc-linear-progress-primary-indeterminate-translate-reverse{0%{-webkit-transform:translateX(0);transform:translateX(0)}20%{-webkit-animation-timing-function:cubic-bezier(0.5,0,0.701732,0.495819);animation-timing-function:cubic-bezier(0.5,0,0.701732,0.495819);-webkit-transform:translateX(0);transform:translateX(0)}59.15%{-webkit-animation-timing-function:cubic-bezier(0.302435,0.381352,0.55,0.956352);animation-timing-function:cubic-bezier(0.302435,0.381352,0.55,0.956352);-webkit-transform:translateX(-83.67142%);transform:translateX(-83.67142%);-webkit-transform:translateX(var(--mdc-linear-progress-primary-half-neg,-83.67142%));transform:translateX(var(--mdc-linear-progress-primary-half-neg,-83.67142%))}100%{-webkit-transform:translateX(-200.611057%);transform:translateX(-200.611057%);-webkit-transform:translateX(var(--mdc-linear-progress-primary-full-neg,-200.611057%));transform:translateX(var(--mdc-linear-progress-primary-full-neg,-200.611057%))}}@keyframes mdc-linear-progress-primary-indeterminate-translate-reverse{0%{-webkit-transform:translateX(0);transform:translateX(0)}20%{-webkit-animation-timing-function:cubic-bezier(0.5,0,0.701732,0.495819);animation-timing-function:cubic-bezier(0.5,0,0.701732,0.495819);-webkit-transform:translateX(0);transform:translateX(0)}59.15%{-webkit-animation-timing-function:cubic-bezier(0.302435,0.381352,0.55,0.956352);animation-timing-function:cubic-bezier(0.302435,0.381352,0.55,0.956352);-webkit-transform:translateX(-83.67142%);transform:translateX(-83.67142%);-webkit-transform:translateX(var(--mdc-linear-progress-primary-half-neg,-83.67142%));transform:translateX(var(--mdc-linear-progress-primary-half-neg,-83.67142%))}100%{-webkit-transform:translateX(-200.611057%);transform:translateX(-200.611057%);-webkit-transform:translateX(var(--mdc-linear-progress-primary-full-neg,-200.611057%));transform:translateX(var(--mdc-linear-progress-primary-full-neg,-200.611057%))}}@-webkit-keyframes mdc-linear-progress-secondary-indeterminate-translate-reverse{0%{-webkit-animation-timing-function:cubic-bezier(0.15,0,0.515058,0.409685);animation-timing-function:cubic-bezier(0.15,0,0.515058,0.409685);-webkit-transform:translateX(0);transform:translateX(0)}25%{-webkit-animation-timing-function:cubic-bezier(0.31033,0.284058,0.8,0.733712);animation-timing-function:cubic-bezier(0.31033,0.284058,0.8,0.733712);-webkit-transform:translateX(-37.651913%);transform:translateX(-37.651913%);-webkit-transform:translateX(var(--mdc-linear-progress-secondary-quarter-neg,-37.651913%));transform:translateX(var(--mdc-linear-progress-secondary-quarter-neg,-37.651913%))}48.35%{-webkit-animation-timing-function:cubic-bezier(0.4,0.627035,0.6,0.902026);animation-timing-function:cubic-bezier(0.4,0.627035,0.6,0.902026);-webkit-transform:translateX(-84.386165%);transform:translateX(-84.386165%);-webkit-transform:translateX(var(--mdc-linear-progress-secondary-half-neg,-84.386165%));transform:translateX(var(--mdc-linear-progress-secondary-half-neg,-84.386165%))}100%{-webkit-transform:translateX(-160.277782%);transform:translateX(-160.277782%);-webkit-transform:translateX(var(--mdc-linear-progress-secondary-full-neg,-160.277782%));transform:translateX(var(--mdc-linear-progress-secondary-full-neg,-160.277782%))}}@keyframes mdc-linear-progress-secondary-indeterminate-translate-reverse{0%{-webkit-animation-timing-function:cubic-bezier(0.15,0,0.515058,0.409685);animation-timing-function:cubic-bezier(0.15,0,0.515058,0.409685);-webkit-transform:translateX(0);transform:translateX(0)}25%{-webkit-animation-timing-function:cubic-bezier(0.31033,0.284058,0.8,0.733712);animation-timing-function:cubic-bezier(0.31033,0.284058,0.8,0.733712);-webkit-transform:translateX(-37.651913%);transform:translateX(-37.651913%);-webkit-transform:translateX(var(--mdc-linear-progress-secondary-quarter-neg,-37.651913%));transform:translateX(var(--mdc-linear-progress-secondary-quarter-neg,-37.651913%))}48.35%{-webkit-animation-timing-function:cubic-bezier(0.4,0.627035,0.6,0.902026);animation-timing-function:cubic-bezier(0.4,0.627035,0.6,0.902026);-webkit-transform:translateX(-84.386165%);transform:translateX(-84.386165%);-webkit-transform:translateX(var(--mdc-linear-progress-secondary-half-neg,-84.386165%));transform:translateX(var(--mdc-linear-progress-secondary-half-neg,-84.386165%))}100%{-webkit-transform:translateX(-160.277782%);transform:translateX(-160.277782%);-webkit-transform:translateX(var(--mdc-linear-progress-secondary-full-neg,-160.277782%));transform:translateX(var(--mdc-linear-progress-secondary-full-neg,-160.277782%))}}@-webkit-keyframes mdc-linear-progress-buffering-reverse{from{-webkit-transform:translateX(-10px);transform:translateX(-10px)}}@keyframes mdc-linear-progress-buffering-reverse{from{-webkit-transform:translateX(-10px);transform:translateX(-10px)}}.mdc-linear-progress{position:relative;width:100%;-webkit-transform:translateZ(0);transform:translateZ(0);outline:1px solid transparent;overflow:hidden;-webkit-transition:opacity 250ms 0s cubic-bezier(.4, 0, .6, 1);transition:opacity 250ms 0s cubic-bezier(.4, 0, .6, 1)}@media screen and (forced-colors:active){.mdc-linear-progress{outline-color:CanvasText}}.mdc-linear-progress__bar{position:absolute;width:100%;height:100%;-webkit-animation:none;animation:none;-webkit-transform-origin:top left;transform-origin:top left;-webkit-transition:-webkit-transform 250ms 0s cubic-bezier(.4, 0, .6, 1);transition:-webkit-transform 250ms 0s cubic-bezier(.4, 0, .6, 1);transition:transform 250ms 0s cubic-bezier(.4, 0, .6, 1);transition:transform 250ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 250ms 0s cubic-bezier(.4, 0, .6, 1)}.mdc-linear-progress__bar-inner{display:inline-block;position:absolute;width:100%;-webkit-animation:none;animation:none;border-top-style:solid}.mdc-linear-progress__buffer{display:-webkit-box;display:flex;position:absolute;width:100%;height:100%}.mdc-linear-progress__buffer-dots{background-repeat:repeat-x;-webkit-box-flex:1;flex:auto;-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-animation:mdc-linear-progress-buffering 250ms infinite linear;animation:mdc-linear-progress-buffering 250ms infinite linear}.mdc-linear-progress__buffer-bar{-webkit-box-flex:0;flex:0 1 100%;-webkit-transition:-webkit-flex-basis 250ms 0s cubic-bezier(.4, 0, .6, 1);transition:-webkit-flex-basis 250ms 0s cubic-bezier(.4, 0, .6, 1);transition:flex-basis 250ms 0s cubic-bezier(.4, 0, .6, 1);transition:flex-basis 250ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-flex-basis 250ms 0s cubic-bezier(.4, 0, .6, 1)}.mdc-linear-progress__primary-bar{-webkit-transform:scaleX(0);transform:scaleX(0)}.mdc-linear-progress__secondary-bar{display:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__bar{-webkit-transition:none;transition:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{left:-145.166611%}.mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{left:-54.888891%;display:block}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{-webkit-animation:mdc-linear-progress-primary-indeterminate-translate 2s infinite linear;animation:mdc-linear-progress-primary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar>.mdc-linear-progress__bar-inner{-webkit-animation:mdc-linear-progress-primary-indeterminate-scale 2s infinite linear;animation:mdc-linear-progress-primary-indeterminate-scale 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{-webkit-animation:mdc-linear-progress-secondary-indeterminate-translate 2s infinite linear;animation:mdc-linear-progress-secondary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar>.mdc-linear-progress__bar-inner{-webkit-animation:mdc-linear-progress-secondary-indeterminate-scale 2s infinite linear;animation:mdc-linear-progress-secondary-indeterminate-scale 2s infinite linear}.mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__bar,[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__bar{right:0;-webkit-transform-origin:center right;transform-origin:center right}.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar,[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{-webkit-animation-name:mdc-linear-progress-primary-indeterminate-translate-reverse;animation-name:mdc-linear-progress-primary-indeterminate-translate-reverse}.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar,[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{-webkit-animation-name:mdc-linear-progress-secondary-indeterminate-translate-reverse;animation-name:mdc-linear-progress-secondary-indeterminate-translate-reverse}.mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__buffer-dots,[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__buffer-dots{-webkit-animation:mdc-linear-progress-buffering-reverse 250ms infinite linear;animation:mdc-linear-progress-buffering-reverse 250ms infinite linear;-webkit-transform:rotate(0);transform:rotate(0)}.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar,[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{right:-145.166611%;left:auto}.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar,[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{right:-54.888891%;left:auto}.mdc-linear-progress--closed{opacity:0}.mdc-linear-progress--closed-animation-off .mdc-linear-progress__buffer-dots{-webkit-animation:none;animation:none}.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar,.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar .mdc-linear-progress__bar-inner{-webkit-animation:none;animation:none}.mdc-linear-progress__bar-inner{border-color:#6200ee;border-color:var(--mdc-theme-primary,#6200ee)}.mdc-linear-progress__buffer-dots{background-image:url(\"data:image/svg+xml,%3Csvg version=\'1.1\' xmlns=\'http://www.w3.org/2000/svg\' xmlns:xlink=\'http://www.w3.org/1999/xlink\' x=\'0px\' y=\'0px\' enable-background=\'new 0 0 5 2\' xml:space=\'preserve\' viewBox=\'0 0 5 2\' preserveAspectRatio=\'none slice\'%3E%3Ccircle cx=\'1\' cy=\'1\' r=\'1\' fill=\'%23e6e6e6\'/%3E%3C/svg%3E\")}.mdc-linear-progress__buffer-bar{background-color:#e6e6e6}.mdc-linear-progress{height:4px}.mdc-linear-progress__bar-inner{border-top-width:4px}.mdc-linear-progress__buffer-dots{background-size:10px 4px}:host{display:block}:host([hidden]){display:none}.mdc-linear-progress__buffer-dots{background-image:url(\"data:image/svg+xml,%3Csvg version=\'1.1\' xmlns=\'http://www.w3.org/2000/svg\' xmlns:xlink=\'http://www.w3.org/1999/xlink\' x=\'0px\' y=\'0px\' enable-background=\'new 0 0 5 2\' xml:space=\'preserve\' viewBox=\'0 0 5 2\' preserveAspectRatio=\'none slice\'%3E%3Ccircle cx=\'1\' cy=\'1\' r=\'1\' fill=\'%23ced5f7\'/%3E%3C/svg%3E\")}.mdc-linear-progress__buffer-bar{background-color:#ced5f7}.mdc-linear-progress{border-radius:inherit;border-radius:var(--forge-linear-progress-border-radius,inherit)}.mdc-linear-progress__bar-inner{border-color:#3d5afe;border-color:var(--forge-theme-tertiary,#3d5afe)}.mdc-linear-progress__buffer-bar{background-color:#ced5f7;background-color:var(--forge-linear-progress-theme-buffer,#ced5f7)}.mdc-linear-progress__buffer-dots{-webkit-filter:none;filter:none;-webkit-filter:var(--forge-linear-progress-theme-buffer-dots,none);filter:var(--forge-linear-progress-theme-buffer-dots, none)}';
/**
 * The web component class behind the `<forge-linear-progress>` custom element.
 *
 * @tag forge-linear-progress
 */
let LinearProgressComponent = class LinearProgressComponent extends BaseComponent {
    constructor() {
        super();
        this._determinate = false;
        this._progress = 0;
        this._buffer = 1;
        this._visible = true;
        attachShadowTemplate(this, template, styles);
        this._progressbarElement = getShadowElement(this, LINEAR_PROGRESS_CONSTANTS.selectors.ROOT);
    }
    static get observedAttributes() {
        return [
            LINEAR_PROGRESS_CONSTANTS.attributes.DETERMINATE,
            LINEAR_PROGRESS_CONSTANTS.attributes.PROGRESS,
            LINEAR_PROGRESS_CONSTANTS.attributes.BUFFER,
            LINEAR_PROGRESS_CONSTANTS.attributes.VISIBLE,
            LINEAR_PROGRESS_CONSTANTS.attributes.PROGRESSBAR_ARIA_LABEL
        ];
    }
    connectedCallback() {
        this._initialize();
    }
    disconnectedCallback() {
        if (this._mdcLinearProgress) {
            this._mdcLinearProgress.destroy();
        }
    }
    attributeChangedCallback(name, oldValue, newValue) {
        switch (name) {
            case LINEAR_PROGRESS_CONSTANTS.attributes.DETERMINATE:
                this.determinate = coerceBoolean(newValue);
                break;
            case LINEAR_PROGRESS_CONSTANTS.attributes.PROGRESS:
                this.progress = coerceNumber(newValue);
                break;
            case LINEAR_PROGRESS_CONSTANTS.attributes.BUFFER:
                this.buffer = coerceNumber(newValue);
                break;
            case LINEAR_PROGRESS_CONSTANTS.attributes.VISIBLE:
                this.visible = coerceBoolean(newValue);
                break;
            case LINEAR_PROGRESS_CONSTANTS.attributes.PROGRESSBAR_ARIA_LABEL:
                toggleAttribute(this._progressbarElement, !!newValue, 'aria-label', newValue);
                break;
        }
    }
    set determinate(value) {
        if (this._determinate !== value) {
            this._determinate = value;
            if (this._mdcLinearProgress) {
                this._mdcLinearProgress.determinate = value;
            }
            this.setAttribute(LINEAR_PROGRESS_CONSTANTS.attributes.DETERMINATE, value.toString());
        }
    }
    get determinate() {
        return this._determinate;
    }
    set progress(value) {
        if (this._progress !== value) {
            this._progress = value;
            if (this._mdcLinearProgress) {
                this._mdcLinearProgress.progress = value;
            }
            this.setAttribute(LINEAR_PROGRESS_CONSTANTS.attributes.PROGRESS, value.toString());
        }
    }
    get progress() {
        return this._progress;
    }
    set buffer(value) {
        if (this._buffer !== value) {
            this._buffer = value;
            if (this._mdcLinearProgress) {
                this._mdcLinearProgress.buffer = value;
            }
            this.setAttribute(LINEAR_PROGRESS_CONSTANTS.attributes.BUFFER, value.toString());
        }
    }
    get buffer() {
        return this._buffer;
    }
    get visible() {
        return this._visible;
    }
    set visible(value) {
        if (this._visible !== value) {
            this._visible = value;
            this._applyVisibility(value);
        }
    }
    open() {
        this._visible = true;
        if (this._mdcLinearProgress) {
            this._mdcLinearProgress.open();
        }
    }
    close() {
        this._visible = false;
        if (this._mdcLinearProgress) {
            this._mdcLinearProgress.close();
        }
    }
    _initialize() {
        var _a;
        const root = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(LINEAR_PROGRESS_CONSTANTS.selectors.ROOT);
        this._mdcLinearProgress = new MDCLinearProgress(root);
        this._mdcLinearProgress.initialize();
        this._mdcLinearProgress.determinate = this._determinate;
        this._mdcLinearProgress.progress = this._progress;
        this._mdcLinearProgress.buffer = this._buffer;
        // We are visible by default so we only apply initial visibility if otherwise
        if (!this._visible) {
            this._applyVisibility(this._visible);
        }
    }
    _applyVisibility(value) {
        if (value) {
            this.open();
        }
        else {
            this.close();
        }
    }
};
LinearProgressComponent = __decorate([
    CustomElement({
        name: LINEAR_PROGRESS_CONSTANTS.elementName
    })
], LinearProgressComponent);
export { LinearProgressComponent };
