'use strict';

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

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

const sv = {
  Qty: "Antal",
  Name: "Namn",
  Price: "Pris",
  VAT: "Moms",
  Total: "Totalt",
  Status: "Status",
};

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

const styleCss = ".sc-payfunc-order-items-h{display:inline-block}[hidden].sc-payfunc-order-items-h{display:none}.sc-payfunc-order-items-h>table.sc-payfunc-order-items{table-layout:fixed;width:100%}.sc-payfunc-order-items-h>table.sc-payfunc-order-items>tr.sc-payfunc-order-items>th.sc-payfunc-order-items{text-align:left;padding-top:0.4em;padding-bottom:0.5em}.sc-payfunc-order-items-h>table.sc-payfunc-order-items>tr.sc-payfunc-order-items>th.wide.sc-payfunc-order-items{width:20%}.sc-payfunc-order-items-h>table.sc-payfunc-order-items>tr.sc-payfunc-order-items>th.status.sc-payfunc-order-items{width:19%;max-width:20em}";

const PayfuncOrderItems = class {
  constructor(hostRef) {
    index$1.registerInstance(this, hostRef);
    this.quantityStatus = false;
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  handleQuantityStatus(event) {
    this.quantityStatus = true;
  }
  render() {
    const t = this.t;
    return [
      index$1.h("table", null, index$1.h("tr", null, index$1.h("th", null, this.quantityStatus ? t("Qty") : ""), index$1.h("th", { class: "wide" }, this.quantityStatus ? t("Name") : ""), index$1.h("th", null, this.quantityStatus ? t("Price") : ""), index$1.h("th", null, this.quantityStatus ? t("VAT") : ""), index$1.h("th", null, t("Total")), index$1.h("th", { class: "status" }, t("Status"))), typeof this.order.items === "number"
        ? []
        : index$2.Item.asArray(this.order.items).map((item, index) => (index$1.h("payfunc-order-items-quantity", { order: this.order.id, currency: this.order.currency, item: item }))), index$1.h("payfunc-order-items-total", { currency: this.order.currency, items: this.order.items })),
    ];
  }
  get element() { return index$1.getElement(this); }
};
PayfuncOrderItems.style = styleCss;

exports.payfunc_order_items = PayfuncOrderItems;
