var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
  if (kind === "a" && !f)
    throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
    throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _KlevuBanner_instances, _KlevuBanner_click;
import { Host, h } from "@stencil/core";
/**
 * Component that displays a typical klevu banner
 */
export class KlevuBanner {
  constructor() {
    _KlevuBanner_instances.add(this);
    this.imageUrl = undefined;
    this.linkUrl = undefined;
    this.altText = undefined;
    this.target = "_blank";
  }
  render() {
    return (h(Host, null, h("slot", null, h("a", { href: this.linkUrl, target: this.target, onClick: __classPrivateFieldGet(this, _KlevuBanner_instances, "m", _KlevuBanner_click) }, h("img", { part: "banner-image", src: this.imageUrl, alt: this.altText })))));
  }
  static get is() { return "klevu-banner"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() {
    return {
      "$": ["klevu-banner.css"]
    };
  }
  static get styleUrls() {
    return {
      "$": ["klevu-banner.css"]
    };
  }
  static get properties() {
    return {
      "imageUrl": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": true,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "The image url to display"
        },
        "attribute": "image-url",
        "reflect": false
      },
      "linkUrl": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": true,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "The link url to navigate to"
        },
        "attribute": "link-url",
        "reflect": false
      },
      "altText": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": true,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "The alt text to display for iamge"
        },
        "attribute": "alt-text",
        "reflect": false
      },
      "target": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "\"_blank\" | \"_self\"",
          "resolved": "\"_blank\" | \"_self\"",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "The target to open the link in"
        },
        "attribute": "target",
        "reflect": false,
        "defaultValue": "\"_blank\""
      }
    };
  }
  static get events() {
    return [{
        "method": "klevuBannerClick",
        "name": "klevuBannerClick",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": "Event emitted when the banner is clicked. Sends the link url as the event detail\n\nIf defaultPrevented is called on the event, the link will not be followed"
        },
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        }
      }];
  }
}
_KlevuBanner_instances = new WeakSet(), _KlevuBanner_click = function _KlevuBanner_click(event) {
  const sent = this.klevuBannerClick.emit(this.linkUrl);
  if (sent.defaultPrevented) {
    event.preventDefault();
    return false;
  }
};
//# sourceMappingURL=klevu-banner.js.map
