import { r as registerInstance, h, g as getElement } from './index-aeac5cad.js';
import './_commonjsHelpers-91fffb88.js';
import { P as Payment } from './index-ec2a4942.js';
import { d as dist } from './index-fdd60c34.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 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) {
    registerInstance(this, hostRef);
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  render() {
    const t = this.t;
    return (h("ul", null, h("li", null, this.order.payment.type == "card" ? (h("summary", null, h("dl", null, this.order.payment.type ? [h("dt", null, t("Type")), h("dd", null, t(this.order.payment.type))] : "", this.order.payment.scheme ? [h("dt", null, t("Scheme")), h("dd", null, this.order.payment.scheme)] : "", Payment.Card.is(this.order.payment)
      ? [
        h("dt", null, t("Number")),
        h("dd", null, this.order.payment.iin.substring(0, 4) +
          " " +
          this.order.payment.iin.substring(4) +
          "** **** " +
          this.order.payment.last4),
      ]
      : "", this.order.payment.expires
      ? [
        h("dt", null, t("Expires")),
        h("dd", null, this.order.payment.expires[0], "/", this.order.payment.expires[1]),
      ]
      : ""))) : this.order.payment.type == "defer" ? (h("summary", null, h("dl", null, this.order.payment.type ? [h("dt", null, t("Type")), h("dd", null, t(this.order.payment.type))] : "", this.order.payment.method ? [h("dt", null, t("Method")), h("dd", null, t(this.order.payment.method))] : "", this.order.payment.contact ? [h("dt", null, t("Contact")), h("dd", null, this.order.payment.contact)] : "", this.order.payment.message ? [h("dt", null, t("Message")), h("dd", null, this.order.payment.message)] : "", Payment.Defer.is(this.order.payment) && this.order.payment.link != undefined
      ? [
        h("dt", null),
        h("dd", { class: "icon" }, h("a", { target: "_blank", href: this.order.payment.link }, h("smoothly-icon", { toolTip: t("Open link"), name: "open" }))),
      ]
      : ""))) : ("No payment information available."))));
  }
  get element() { return getElement(this); }
};
PayfuncOrderPayment.style = styleCss;

export { PayfuncOrderPayment as payfunc_order_payment };
