// #region Imports
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { CssLength } from '@breadstone/mosaik-themes';
import { Disableable } from '../../../Behaviors/Disableable';
import { Labelable } from '../../../Behaviors/Labelable';
import { Orientable } from '../../../Behaviors/Orientable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Variantable } from '../../../Behaviors/Variantable';
import { TextElement } from '../../../Components/Primitives/Text/TextElement';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Watch } from '../../../Decorators/WatchDecorator';
import { RangeBaseElement } from '../Abstracts/RangeBaseElement';
import { progressBarElementTemplate } from './ProgressBarElementTemplate';
import { progressBarElementCosmopolitanStyle } from './Themes/ProgressBarElement.Cosmopolitan';
import { progressBarElementJoyStyle } from './Themes/ProgressBarElement.Joy';
import { progressBarElementMemphisStyle } from './Themes/ProgressBarElement.Memphis';
// #endregion
/**
 * ProgressBar - A horizontal or vertical indicator showing task completion or loading progress.
 *
 * @description
 * The ProgressBar component displays progress as a filled bar with configurable value ranges,
 * orientations, and visual styles. Supports determinate progress tracking with specific values
 * and indeterminate loading states for unknown durations. Features smooth animations, optional
 * segmented display for multi-step processes, and comprehensive theming. Essential for showing
 * task progress, file uploads, loading states, and completion percentages in user interfaces.
 *
 * @name ProgressBar
 * @element mosaik-progress-bar
 * @category Ranges
 *
 * @slot hint - Secondary text content area for additional progress information or details
 * @slot label - Text label content area for progress description or status
 *
 * @csspart container - Outer container wrapping the entire progress bar structure
 * @csspart fill - Filled portion of the progress bar indicating current completion level
 * @csspart hint - Hint text styling container for additional information
 * @csspart label - Text label styling container for progress information
 * @csspart track - Track wrapper providing layout for the progress rail
 * @csspart track-fill - Inner track element displaying the background rail and overflow clipping
 *
 * @cssprop {String} --progress-bar-font-family - The bar font family CSS custom property.
 * @cssprop {String} --progress-bar-font-letter-spacing - The bar font letter spacing CSS custom property.
 * @cssprop {String} --progress-bar-font-line-height - The bar font line height CSS custom property.
 * @cssprop {String} --progress-bar-font-size - The bar font size CSS custom property.
 * @cssprop {String} --progress-bar-font-text-decoration - The bar font text decoration CSS custom property.
 * @cssprop {String} --progress-bar-font-text-transform - The bar font text transform CSS custom property.
 * @cssprop {String} --progress-bar-font-weight - The bar font weight CSS custom property.
 * @cssprop {String} --progress-bar-gap - The bar gap CSS custom property.
 * @cssprop {String} --progress-bar-padding-bottom - The bar padding bottom CSS custom property.
 * @cssprop {String} --progress-bar-padding-left - The bar padding left CSS custom property.
 * @cssprop {String} --progress-bar-padding-right - The bar padding right CSS custom property.
 * @cssprop {String} --progress-bar-padding-top - The bar padding top CSS custom property.
 * @cssprop {String} --progress-bar-segment-gap - The bar segment gap CSS custom property.
 * @cssprop {String} --progress-bar-shadow - The bar shadow CSS custom property.
 * @cssprop {String} --progress-bar-shadow-blur - The bar shadow blur CSS custom property.
 * @cssprop {String} --progress-bar-shadow-color - The bar shadow color CSS custom property.
 * @cssprop {String} --progress-bar-shadow-offset-x - The bar shadow offset x CSS custom property.
 * @cssprop {String} --progress-bar-shadow-offset-y - The bar shadow offset y CSS custom property.
 * @cssprop {String} --progress-bar-shadow-spread - The bar shadow spread CSS custom property.
 * @cssprop {String} --progress-bar-transition-duration - The bar transition duration CSS custom property.
 * @cssprop {String} --progress-bar-transition-mode - The bar transition mode CSS custom property.
 * @cssprop {String} --progress-bar-transition-property - The bar transition property CSS custom property.
 * @cssprop {String} --progress-bar-translate - The bar translate CSS custom property.
 *
 * @fires rangeValueChanged {RangeValueChangedEvent} - Fired when the progress value changes
 *
 * @dependency mosaik-text - The Text element.
 *
 * @example
 * Basic determinate progress bar:
 * ```html
 * <mosaik-progress-bar value="65" max="100"></mosaik-progress-bar>
 * ```
 *
 * @example
 * Progress bar with label showing upload status:
 * ```html
 * <mosaik-progress-bar value="45" max="100">
 *   <span slot="label">Uploading document.pdf</span>
 * </mosaik-progress-bar>
 * ```
 *
 * @example
 * Indeterminate loading bar for unknown duration:
 * ```html
 * <mosaik-progress-bar is-indeterminate>
 *   <span slot="label">Loading...</span>
 * </mosaik-progress-bar>
 * ```
 *
 * @example
 * Vertical progress bar for volume control:
 * ```html
 * <mosaik-progress-bar
 *   value="80"
 *   max="100"
 *   orientation="vertical"
 *   thickness="8px"
 *   variant="primary">
 * </mosaik-progress-bar>
 * ```
 *
 * @example
 * Segmented progress for multi-step wizard:
 * ```html
 * <mosaik-progress-bar
 *   value="3"
 *   max="5"
 *   segments="5"
 *   variant="success">
 *   <span slot="label">Step 3 of 5</span>
 * </mosaik-progress-bar>
 * ```
 *
 * @example
 * File upload progress with percentage display:
 * ```html
 * <div class="upload-container">
 *   <span>Uploading document.pdf</span>
 *   <mosaik-progress-bar
 *     id="uploadProgress"
 *     value="0"
 *     max="100"
 *     thickness="4px">
 *   </mosaik-progress-bar>
 *   <span id="progressText">0%</span>
 * </div>
 * ```
 *
 * @example
 * Download progress with custom styling:
 * ```html
 * <mosaik-progress-bar
 *   value="72"
 *   max="100"
 *   thickness="6px"
 *   variant="info">
 *   <span slot="label">Downloading update...</span>
 *   <span slot="hint">72% complete (3.6 MB / 5 MB)</span>
 * </mosaik-progress-bar>
 * ```
 *
 * @public
 */
let ProgressBarElement = class ProgressBarElement extends Themeable(Variantable(Orientable(Disableable(Labelable(RangeBaseElement))))) {
    // #region Fields
    _isIndeterminate;
    _thickness;
    _segments;
    // #endregion
    // #region Ctor
    /**
     * Constructs a new instance of the `ProgressBarElement` class.
     *
     * @public
     */
    constructor() {
        super();
        this._isIndeterminate = false;
        this._thickness = 4;
        this._segments = 0;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     *
     * @public
     * @static
     * @readonly
    */
    static get is() {
        return 'mosaik-progress-bar';
    }
    /**
     * Determines if `ProgressBar` shows actual values `false` or generic, continuous progress feedback `true`.
     *
     * @public
     * @attr
     */
    get isIndeterminate() {
        return this._isIndeterminate;
    }
    set isIndeterminate(value) {
        if (this._isIndeterminate !== value) {
            this._isIndeterminate = value;
            this.requestUpdate('isIndeterminate');
        }
    }
    /**
     * Gets or sets the thickness property.
     *
     * @public
     * @attr
     */
    get thickness() {
        return this._thickness;
    }
    set thickness(value) {
        if (this._thickness !== value) {
            this._thickness = value;
            this.requestUpdate('thickness');
        }
    }
    /**
     * Gets or sets the `segments` property.
     *
     * @public
     * @attr
     */
    get segments() {
        return this._segments;
    }
    set segments(value) {
        if (this._segments !== value) {
            this._segments = value;
            this.requestUpdate('segments');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @protected
     */
    onSegmentsPropertyChanged(_prev, next) {
        if (next) {
            this.setAttribute('has-segments', '');
        }
        else {
            this.removeAttribute('has-segments');
        }
    }
};
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], ProgressBarElement.prototype, "isIndeterminate", null);
__decorate([
    Attribute({
        type: String,
        converter: (value) => CssLength.tryParse(value)
    }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], ProgressBarElement.prototype, "thickness", null);
__decorate([
    Attribute({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], ProgressBarElement.prototype, "segments", null);
__decorate([
    Watch('segments'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Number, Number]),
    __metadata("design:returntype", void 0)
], ProgressBarElement.prototype, "onSegmentsPropertyChanged", null);
ProgressBarElement = __decorate([
    Component({
        selector: 'mosaik-progress-bar',
        template: progressBarElementTemplate,
        themes: {
            joy: progressBarElementJoyStyle,
            memphis: progressBarElementMemphisStyle,
            cosmopolitan: progressBarElementCosmopolitanStyle
        },
        imports: [
            TextElement
        ]
    }),
    __metadata("design:paramtypes", [])
], ProgressBarElement);
export { ProgressBarElement };
//# sourceMappingURL=ProgressBarElement.js.map