'use strict';

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

const index$1 = require('./index-140bcbcd.js');
const index$3 = require('./index-bddf9814.js');
const Item = require('./Item-00ce8c24.js');
const index$2 = require('./index-76391849.js');
require('./Credentials-8e4749ab.js');
require('./Token-8c5ba5d9.js');
const index = require('./index-d3079b93.js');
require('./index-188cc15d.js');
require('./_commonjsHelpers-537d719a.js');
require('./index-09251373.js');
require('./TextDecoder-753156f3.js');

const sv = {
  "Order complete": "Köp slutfört",
  "Order number": "Ordernummer",
  Amount: "Summa",
  Created: "Skapad",
  Phone: "Telefon",
  "Not available": "Ej angivet",
  "Thanks for your purchase!": "Tack för köpet!",
};

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

const styleCss = ":host{display:block}:host[hidden]{display:none}header{height:56px;width:100%}header>h1{margin:0;color:rgb(var(--smoothly-success-contrast));background:rgb(var(--smoothly-success-color));padding:0.8em}main{margin:1em}dl{margin-top:3em}dt{font-weight:bold}dd{margin-bottom:1em;margin-left:0}";

const IntergiroDisplayOrder = class {
  constructor(hostRef) {
    index$1.registerInstance(this, hostRef);
  }
  componentWillLoad() {
    if (typeof this.order == "string")
      this.order = JSON.parse(this.order);
    this.t = create(this.element);
  }
  render() {
    const t = this.t;
    this.order = this.order;
    return [
      index$1.h("header", null, index$1.h("h1", null, t("Order complete"))),
      index$1.h("main", null, index$1.h("dl", null, index$1.h("dt", null, t("Order number")), index$1.h("dd", null, this.order.number ? this.order.number : t("Not available")), index$1.h("dt", null, t("Amount")), index$1.h("dd", null, this.order.currency, " ", index$2.Item.amount(this.order.items)), index$1.h("dt", null, t("Created")), index$1.h("dd", null, index$1.h("smoothly-display-date-time", { datetime: this.order.created ? index$3.dist.DateTime.localize(index$3.dist.DateTime.parse(this.order.created)) : t("Not available") })), !this.order.customer || typeof this.order.customer == "string"
        ? ""
        : this.order.customer.phone
          ? [index$1.h("dt", null, t("Phone")), index$1.h("dd", null, Item.PhoneNumbers.get(this.order.customer.phone))]
          : this.order.customer.email
            ? [index$1.h("dt", null, t("Email")), index$1.h("dd", null, Item.EmailAddresses.get(this.order.customer.email))]
            : ""), index$1.h("h2", null, t("Thanks for your purchase!"))),
    ];
  }
  get element() { return index$1.getElement(this); }
};
IntergiroDisplayOrder.style = styleCss;

exports.ig_display_order = IntergiroDisplayOrder;
