'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-b499856a.js');
const error = require('./error-89de8210.js');

const BadgeVariant = {
  ATTENTION: 'attention',
  SPECIAL: 'special',
  NEUTRAL: 'neutral',
  INFORMATION: 'information',
  SUCCESS: 'success',
  WARNING: 'warning',
  ERROR: 'error',
  // Deprectated variants below
  SPECIAL_OFFER: 'special-offer',
  NOT_AVAILABLE: 'not-available',
};
Object.values(BadgeVariant);

const teliaBadgeCss = ".telia-badge{font-family:\"TeliaSans\", Helvetica, Arial, \"Lucida Grande\", sans-serif;font-weight:500;font-size:calc(1.4rem * var(--voca-rem-multiplier));align-items:center;border-radius:calc(0.2rem * var(--voca-rem-multiplier));display:inline-flex;gap:calc(0.4rem * var(--voca-rem-multiplier));line-height:1;padding:calc(0.4rem * var(--voca-rem-multiplier)) calc(0.8rem * var(--voca-rem-multiplier))}.telia-badge--attention{background-color:#5e0092;color:#ffffff}.telia-badge--special{background-color:#edc8ff;color:#30004b}.telia-badge--neutral{background-color:rgba(0, 0, 0, 0.2);color:#303032}.telia-badge--information{background-color:#a6dbff;color:#003d66}.telia-badge--success{background-color:#a6e3c4;color:#00572a}.telia-badge--warning{background-color:#ffdca6;color:#663e00}.telia-badge--error{background-color:#f6aec6;color:#5b0925}.telia-badge--special-offer{background-color:#edc8ff;color:#29003e}.telia-badge--not-available{background-color:#dcdce1;color:#303032}";

const TeliaBadge = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    /** Test id set for web component host */
    this.dataTestid = null;
    /** Describe status of badge for better accessibility support */
    this.allyLabel = null;
    /** Tracking id is used to identify and count Component usage */
    this.dataTrackingId = 'telia-badge';
    /**
     * Maps the BadgeVariantType to the corresponding icon SVG.
     * @param variant - The variant to map to an icon SVG.
     * @returns The corresponding icon SVG for the variant.
     */
    this.mapIcon = (variant) => {
      switch (variant) {
        case BadgeVariant.SUCCESS:
          return error.checkCircle.svg;
        case BadgeVariant.WARNING:
          return error.alert.svg;
        case BadgeVariant.ERROR:
          return error.error.svg;
        default:
          return null;
      }
    };
  }
  /**
   * Validates that the variant prop is not a deprecated variant, and logs a warning message if it is.
   * TODO: Remove after deprecation.
   */
  validateDeprecatedVariants() {
    const deprecatedVariants = [
      BadgeVariant.SPECIAL_OFFER,
      BadgeVariant.NOT_AVAILABLE,
    ];
    const message = `Deprecation warning - [Telia-badge]: ${this.variant} variant. This variant will be deprecated soon.`;
    if (deprecatedVariants.includes(this.variant)) {
      console.warn(message);
    }
  }
  componentWillLoad() {
    this.validateDeprecatedVariants();
  }
  render() {
    const iconSvg = this.mapIcon(this.variant);
    return (index.h("span", { class: {
        'telia-badge': true,
        [`telia-badge--${this.variant}`]: !!this.variant,
      }, "data-testid": this.dataTestid }, (iconSvg || this.icon) && (index.h("telia-icon", { "ally-title": this.allyLabel, name: this.icon, size: "sm", svg: iconSvg })), index.h("slot", null), index.h("telia-vst", { dataTrackingId: this.dataTrackingId })));
  }
};
TeliaBadge.style = teliaBadgeCss;

const teliaCardFrameLinkCss = ".telia-card-frame-link__link{background-clip:padding-box;box-sizing:border-box;cursor:pointer;height:100%;white-space:normal}.telia-card-frame-link__content{border-radius:calc(0.8rem * var(--voca-rem-multiplier));display:flex;flex-direction:column;height:100%}.telia-card-frame-link__content:hover{color:#222222}@media screen and (min-width: 37.5em){.telia-card-frame-link__content:hover{box-shadow:0 calc(0.1rem * var(--voca-rem-multiplier)) calc(0.4rem * var(--voca-rem-multiplier)) rgba(0, 0, 0, 0.1)}}.telia-card-frame-link__frame{height:100%;width:100%}";

const TeliaCardFrameLink = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    /** Tracking id is used to identify and count Component usage */
    this.dataTrackingId = 'telia-card-frame-link';
    this.componentClass = 'telia-card-frame-link';
  }
  render() {
    return (index.h(index.Host, { class: this.componentClass, "data-testid": this.dataTestid }, index.h("telia-link", { silent: true, variant: 'text', href: this.href, "link-title": this.linkTitle, class: this.componentClass + '__link' }, index.h("div", { class: `${this.componentClass}__content` }, index.h("telia-card-frame", { class: `${this.componentClass}__frame`, disablePadding: this.disablePadding }, index.h("slot", null)))), index.h("telia-vst", { dataTrackingId: this.dataTrackingId })));
  }
};
TeliaCardFrameLink.style = teliaCardFrameLinkCss;

exports.telia_badge = TeliaBadge;
exports.telia_card_frame_link = TeliaCardFrameLink;
