import { Component, h, Prop } from '@stencil/core';
import { sprintf, __ } from '@wordpress/i18n';
import { openWormhole } from 'stencil-wormhole';
export class ScOrderConfirmationDetails {
  renderOrderStatus() {
    var _a, _b;
    if (((_a = this === null || this === void 0 ? void 0 : this.order) === null || _a === void 0 ? void 0 : _a.status) === 'processing') {
      return h("sc-tag", { type: "warning" }, __('On Hold', 'surecart'));
    }
    return h("sc-order-status-badge", { status: (_b = this.order) === null || _b === void 0 ? void 0 : _b.status });
  }
  render() {
    var _a, _b;
    if (!!this.loading) {
      return (h("sc-dashboard-module", null,
        h("sc-skeleton", { slot: "heading", style: { width: '120px', display: 'inline-block' } }),
        h("sc-skeleton", { slot: "end", style: { width: '60px', display: 'inline-block' } }),
        h("sc-card", null,
          h("sc-line-item", null,
            h("sc-skeleton", { style: { 'width': '50px', 'height': '50px', '--border-radius': '0' }, slot: "image" }),
            h("sc-skeleton", { slot: "title", style: { width: '120px', display: 'inline-block' } }),
            h("sc-skeleton", { slot: "description", style: { width: '60px', display: 'inline-block' } }),
            h("sc-skeleton", { style: { width: '120px', display: 'inline-block' }, slot: "price" }),
            h("sc-skeleton", { style: { width: '60px', display: 'inline-block' }, slot: "price-description" })),
          h("sc-divider", null),
          h("sc-line-item", null,
            h("sc-skeleton", { slot: "title", style: { width: '120px', display: 'inline-block' } }),
            h("sc-skeleton", { style: { width: '120px', display: 'inline-block' }, slot: "price" })),
          h("sc-divider", null),
          h("sc-line-item", null,
            h("sc-skeleton", { slot: "title", style: { width: '120px', display: 'inline-block' } }),
            h("sc-skeleton", { style: { width: '120px', display: 'inline-block' }, slot: "price" })))));
    }
    if (!((_a = this.order) === null || _a === void 0 ? void 0 : _a.number))
      return;
    return (h("sc-dashboard-module", { class: "order" },
      h("span", { slot: "heading" }, sprintf(__('Order #%s', 'surecart'), (_b = this.order) === null || _b === void 0 ? void 0 : _b.number)),
      h("span", { slot: "end" }, this.renderOrderStatus()),
      h("sc-card", null,
        h("sc-order-confirmation-line-items", null),
        h("sc-divider", null),
        h("sc-order-confirmation-totals", null))));
  }
  static get is() { return "sc-order-confirmation-details"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["sc-order-confirmation-details.css"]
  }; }
  static get styleUrls() { return {
    "$": ["sc-order-confirmation-details.css"]
  }; }
  static get properties() { return {
    "order": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "Order",
        "resolved": "Order",
        "references": {
          "Order": {
            "location": "import",
            "path": "../../../../types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "loading": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "loading",
      "reflect": false
    }
  }; }
}
openWormhole(ScOrderConfirmationDetails, ['order', 'loading'], false);
