// #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 { Boundable } from '../../../Behaviors/Boundable';
import { InlineStyleController } from '../../../Controllers/InlineStyleController';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { epgNowLineElementTemplate } from './EpgNowLineElementTemplate';
import { epgNowLineElementJoyStyle } from './Themes/EpgNowLineElement.Joy';
// #endregion
/**
 * EPG Now Line - A visual indicator marking the current time on an Electronic Program Guide.
 *
 * Renders a vertical line that is automatically positioned based on the current time
 * relative to the parent `mosaik-epg` start boundary.
 *
 * @name EpgNowLineElement
 * @element mosaik-epg-now-line
 * @category Selectors
 *
 * @csspart line - The line part.
 *
 * @cssprop {String} --epg-now-line-border-color - The now line border color CSS custom property.
 * @cssprop {String} --epg-now-line-border-radius - The now line border radius CSS custom property.
 * @cssprop {String} --epg-now-line-border-style - The now line border style CSS custom property.
 * @cssprop {String} --epg-now-line-border-width - The now line border width CSS custom property.
 * @cssprop {String} --epg-now-line-font-family - The now line font family CSS custom property.
 * @cssprop {String} --epg-now-line-font-letter-spacing - The now line font letter spacing CSS custom property.
 * @cssprop {String} --epg-now-line-font-line-height - The now line font line height CSS custom property.
 * @cssprop {String} --epg-now-line-font-size - The now line font size CSS custom property.
 * @cssprop {String} --epg-now-line-font-text-decoration - The now line font text decoration CSS custom property.
 * @cssprop {String} --epg-now-line-font-text-transform - The now line font text transform CSS custom property.
 * @cssprop {String} --epg-now-line-font-weight - The now line font weight CSS custom property.
 * @cssprop {String} --epg-now-line-gap - The now line gap CSS custom property.
 * @cssprop {String} --epg-now-line-padding-bottom - The now line padding bottom CSS custom property.
 * @cssprop {String} --epg-now-line-padding-left - The now line padding left CSS custom property.
 * @cssprop {String} --epg-now-line-padding-right - The now line padding right CSS custom property.
 * @cssprop {String} --epg-now-line-padding-top - The now line padding top CSS custom property.
 * @cssprop {String} --epg-now-line-shadow - The now line shadow CSS custom property.
 * @cssprop {String} --epg-now-line-shadow-blur - The now line shadow blur CSS custom property.
 * @cssprop {String} --epg-now-line-shadow-color - The now line shadow color CSS custom property.
 * @cssprop {String} --epg-now-line-shadow-offset-x - The now line shadow offset x CSS custom property.
 * @cssprop {String} --epg-now-line-shadow-offset-y - The now line shadow offset y CSS custom property.
 * @cssprop {String} --epg-now-line-shadow-spread - The now line shadow spread CSS custom property.
 * @cssprop {String} --epg-now-line-transition-duration - The now line transition duration CSS custom property.
 * @cssprop {String} --epg-now-line-transition-mode - The now line transition mode CSS custom property.
 * @cssprop {String} --epg-now-line-transition-property - The now line transition property CSS custom property.
 * @cssprop {String} --epg-now-line-translate - The now line translate CSS custom property.
 *
 * @example
 * ```html
 * <!-- Used inside mosaik-epg; start/end are Date @Attributes from Boundable -->
 * <mosaik-epg-now-line></mosaik-epg-now-line>
 * ```
 *
 * @public
 */
let EpgNowLineElement = class EpgNowLineElement extends Boundable(CustomElement) {
    // #region Fields
    _boardElement;
    _inlineStyleController;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._boardElement = null;
        this._inlineStyleController = new InlineStyleController(this);
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     * The `is` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-epg-now-line';
    }
    // #endregion
    // #region Methods
    /**
     * Calculates the position of the now line.
     *
     * @private
     */
    calculatePosition() {
        const board = this._boardElement;
        const rect = {
            left: 0
        };
        if (board) {
            const now = Date.now();
            const startMs = board.start.getTime();
            rect.left = ((now - startMs) / 60000) * board.zoom;
        }
        this._inlineStyleController.set('epg-now-line-left', `${rect.left}px`);
    }
};
EpgNowLineElement = __decorate([
    Component({
        selector: 'mosaik-epg-now-line',
        template: epgNowLineElementTemplate,
        styles: epgNowLineElementJoyStyle,
        imports: []
    }),
    __metadata("design:paramtypes", [])
], EpgNowLineElement);
export { EpgNowLineElement };
//# sourceMappingURL=EpgNowLineElement.js.map