var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
    function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
    var _, done = false;
    for (var i = decorators.length - 1; i >= 0; i--) {
        var context = {};
        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
        context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
        var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
        if (kind === "accessor") {
            if (result === void 0) continue;
            if (result === null || typeof result !== "object") throw new TypeError("Object expected");
            if (_ = accept(result.get)) descriptor.get = _;
            if (_ = accept(result.set)) descriptor.set = _;
            if (_ = accept(result.init)) initializers.unshift(_);
        }
        else if (_ = accept(result)) {
            if (kind === "field") initializers.unshift(_);
            else descriptor[key] = _;
        }
    }
    if (target) Object.defineProperty(target, contextIn.name, descriptor);
    done = true;
};
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
    var useValue = arguments.length > 2;
    for (var i = 0; i < initializers.length; i++) {
        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
    }
    return useValue ? value : void 0;
};
import { DeesElement, customElement, html, css, cssManager, property, } from '@design.estate/dees-element';
let SzCertificatesCard = (() => {
    let _classDecorators = [customElement('sz-certificates-card')];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = DeesElement;
    let _validCount_decorators;
    let _validCount_initializers = [];
    let _validCount_extraInitializers = [];
    let _expiringCount_decorators;
    let _expiringCount_initializers = [];
    let _expiringCount_extraInitializers = [];
    let _expiredCount_decorators;
    let _expiredCount_initializers = [];
    let _expiredCount_extraInitializers = [];
    var SzCertificatesCard = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _validCount_decorators = [property({ type: Number })];
            _expiringCount_decorators = [property({ type: Number })];
            _expiredCount_decorators = [property({ type: Number })];
            __esDecorate(this, null, _validCount_decorators, { kind: "accessor", name: "validCount", static: false, private: false, access: { has: obj => "validCount" in obj, get: obj => obj.validCount, set: (obj, value) => { obj.validCount = value; } }, metadata: _metadata }, _validCount_initializers, _validCount_extraInitializers);
            __esDecorate(this, null, _expiringCount_decorators, { kind: "accessor", name: "expiringCount", static: false, private: false, access: { has: obj => "expiringCount" in obj, get: obj => obj.expiringCount, set: (obj, value) => { obj.expiringCount = value; } }, metadata: _metadata }, _expiringCount_initializers, _expiringCount_extraInitializers);
            __esDecorate(this, null, _expiredCount_decorators, { kind: "accessor", name: "expiredCount", static: false, private: false, access: { has: obj => "expiredCount" in obj, get: obj => obj.expiredCount, set: (obj, value) => { obj.expiredCount = value; } }, metadata: _metadata }, _expiredCount_initializers, _expiredCount_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            SzCertificatesCard = _classThis = _classDescriptor.value;
            if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
        }
        static demo = () => html `
    <div style="padding: 24px; display: flex; gap: 16px; flex-wrap: wrap;">
      <sz-certificates-card validCount="2"></sz-certificates-card>
      <sz-certificates-card validCount="5" expiringCount="2"></sz-certificates-card>
      <sz-certificates-card validCount="0" expiredCount="1"></sz-certificates-card>
    </div>
  `;
        #validCount_accessor_storage = __runInitializers(this, _validCount_initializers, 0);
        get validCount() { return this.#validCount_accessor_storage; }
        set validCount(value) { this.#validCount_accessor_storage = value; }
        #expiringCount_accessor_storage = (__runInitializers(this, _validCount_extraInitializers), __runInitializers(this, _expiringCount_initializers, 0));
        get expiringCount() { return this.#expiringCount_accessor_storage; }
        set expiringCount(value) { this.#expiringCount_accessor_storage = value; }
        #expiredCount_accessor_storage = (__runInitializers(this, _expiringCount_extraInitializers), __runInitializers(this, _expiredCount_initializers, 0));
        get expiredCount() { return this.#expiredCount_accessor_storage; }
        set expiredCount(value) { this.#expiredCount_accessor_storage = value; }
        static styles = [
            cssManager.defaultStyles,
            css `
      :host {
        display: block;
        min-width: 200px;
        height: 100%;
      }

      .card {
        background: ${cssManager.bdTheme('#ffffff', '#09090b')};
        border: 1px solid ${cssManager.bdTheme('#e4e4e7', '#27272a')};
        border-radius: 8px;
        padding: 20px;
        height: 100%;
        box-sizing: border-box;
      }

      .header {
        margin-bottom: 16px;
      }

      .title {
        font-size: 16px;
        font-weight: 600;
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
      }

      .subtitle {
        font-size: 13px;
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
        margin-top: 2px;
      }

      .status {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .status-icon {
        width: 20px;
        height: 20px;
      }

      .status-icon.valid {
        color: ${cssManager.bdTheme('#22c55e', '#22c55e')};
      }

      .status-icon.warning {
        color: ${cssManager.bdTheme('#facc15', '#facc15')};
      }

      .status-icon.error {
        color: ${cssManager.bdTheme('#ef4444', '#ef4444')};
      }

      .status-text {
        font-size: 14px;
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
      }

      .status-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
    `,
        ];
        render() {
            return html `
      <div class="card">
        <div class="header">
          <div class="title">Certificates</div>
          <div class="subtitle">SSL/TLS certificate status</div>
        </div>

        <div class="status-list">
          ${this.validCount > 0 ? html `
            <div class="status">
              <svg class="status-icon valid" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                <polyline points="20 6 9 17 4 12"></polyline>
              </svg>
              <span class="status-text">${this.validCount} valid</span>
            </div>
          ` : ''}

          ${this.expiringCount > 0 ? html `
            <div class="status">
              <svg class="status-icon warning" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path>
                <line x1="12" y1="9" x2="12" y2="13"></line>
                <line x1="12" y1="17" x2="12.01" y2="17"></line>
              </svg>
              <span class="status-text">${this.expiringCount} expiring soon</span>
            </div>
          ` : ''}

          ${this.expiredCount > 0 ? html `
            <div class="status">
              <svg class="status-icon error" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                <circle cx="12" cy="12" r="10"></circle>
                <line x1="15" y1="9" x2="9" y2="15"></line>
                <line x1="9" y1="9" x2="15" y2="15"></line>
              </svg>
              <span class="status-text">${this.expiredCount} expired</span>
            </div>
          ` : ''}

          ${this.validCount === 0 && this.expiringCount === 0 && this.expiredCount === 0 ? html `
            <div class="status">
              <span class="status-text">No certificates</span>
            </div>
          ` : ''}
        </div>
      </div>
    `;
        }
        constructor() {
            super(...arguments);
            __runInitializers(this, _expiredCount_extraInitializers);
        }
        static {
            __runInitializers(_classThis, _classExtraInitializers);
        }
    };
    return SzCertificatesCard = _classThis;
})();
export { SzCertificatesCard };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3otY2VydGlmaWNhdGVzLWNhcmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c193ZWIvZWxlbWVudHMvc3otY2VydGlmaWNhdGVzLWNhcmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLE9BQU8sRUFDTCxXQUFXLEVBQ1gsYUFBYSxFQUNiLElBQUksRUF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