'use strict';

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

const index$1 = require('./index-0b1e2673.js');
require('./_commonjsHelpers-937cd5b3.js');
const index$2 = require('./index-2eb96242.js');
const index = require('./index-36cf3884.js');

const sv = {
  Scheme: "System",
  Number: "Nummer",
  Expires: "Giltigt t.o.m.",
  Type: "Typ",
  card: "kort",
  Method: "Metod",
  Contact: "Kontakt",
  Message: "Meddelande",
  "Open link": "Öppna länk",
  defer: "skickad",
  link: "länk",
};

function create(language) {
  return index.dist.create({
    sv,
  }, language);
}

const styleCss = "*.sc-payfunc-order-payment-h{display:flex}[hidden].sc-payfunc-order-payment-h{display:none}.sc-payfunc-order-payment-h>span.sc-payfunc-order-payment{flex-grow:1;padding-left:0.6em;padding-right:0.6em}ul.sc-payfunc-order-payment{width:100%;list-style-type:none;margin-top:0;margin-bottom:0;padding-inline-start:0}summary.sc-payfunc-order-payment{outline:none;text-align:left}dl.sc-payfunc-order-payment{margin:8px;width:100%;display:flex;flex-direction:column;flex-wrap:wrap;max-height:3em;justify-content:flex-start}dt.sc-payfunc-order-payment{font-weight:bold;text-align:left}dd.sc-payfunc-order-payment{text-align:left;margin:0}dd.icon.sc-payfunc-order-payment{width:max-content;padding-top:0.5em}";

const PayfuncOrderPayment = class {
  constructor(hostRef) {
    index$1.registerInstance(this, hostRef);
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  render() {
    const t = this.t;
    return (index$1.h("ul", null, index$1.h("li", null, this.order.payment.type == "card" ? (index$1.h("summary", null, index$1.h("dl", null, this.order.payment.type ? [index$1.h("dt", null, t("Type")), index$1.h("dd", null, t(this.order.payment.type))] : "", this.order.payment.scheme ? [index$1.h("dt", null, t("Scheme")), index$1.h("dd", null, this.order.payment.scheme)] : "", index$2.Payment.Card.is(this.order.payment)
      ? [
        index$1.h("dt", null, t("Number")),
        index$1.h("dd", null, this.order.payment.iin.substring(0, 4) +
          " " +
          this.order.payment.iin.substring(4) +
          "** **** " +
          this.order.payment.last4),
      ]
      : "", this.order.payment.expires
      ? [
        index$1.h("dt", null, t("Expires")),
        index$1.h("dd", null, this.order.payment.expires[0], "/", this.order.payment.expires[1]),
      ]
      : ""))) : this.order.payment.type == "defer" ? (index$1.h("summary", null, index$1.h("dl", null, this.order.payment.type ? [index$1.h("dt", null, t("Type")), index$1.h("dd", null, t(this.order.payment.type))] : "", this.order.payment.method ? [index$1.h("dt", null, t("Method")), index$1.h("dd", null, t(this.order.payment.method))] : "", this.order.payment.contact ? [index$1.h("dt", null, t("Contact")), index$1.h("dd", null, this.order.payment.contact)] : "", this.order.payment.message ? [index$1.h("dt", null, t("Message")), index$1.h("dd", null, this.order.payment.message)] : "", index$2.Payment.Defer.is(this.order.payment) && this.order.payment.link != undefined
      ? [
        index$1.h("dt", null),
        index$1.h("dd", { class: "icon" }, index$1.h("a", { target: "_blank", href: this.order.payment.link }, index$1.h("smoothly-icon", { toolTip: t("Open link"), name: "open" }))),
      ]
      : ""))) : ("No payment information available."))));
  }
  get element() { return index$1.getElement(this); }
};
PayfuncOrderPayment.style = styleCss;

exports.payfunc_order_payment = PayfuncOrderPayment;
