import { r as registerInstance, h } from './index-f1d2a96f.js';
import { _ as __ } from './default-i18n-91ef32a0.js';
import './index-0a61debd.js';
import './_commonjsHelpers-9943807e.js';

const scOrderStatusBadgeCss = ":host{display:inline-block}";

const ScOrderStatusBadge = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    /** The tag's size. */
    this.size = 'medium';
    /** Draws a pill-style tag with rounded edges. */
    this.pill = false;
    /** Makes the tag clearable. */
    this.clearable = false;
  }
  getType() {
    switch (this.status) {
      case 'draft':
        return 'info';
      case 'requires_approval':
      case 'finalized':
        return 'warning';
      case 'paid':
        return 'success';
      case 'payment_intent_canceled':
      case 'payment_failed':
        return 'danger';
    }
  }
  getText() {
    switch (this.status) {
      case 'draft':
        return __('Draft', 'surecart');
      case 'finalized':
        return __('Pending Payment', 'surecart');
      case 'paid':
        return __('Paid', 'surecart');
      case 'payment_intent_canceled':
        return __('Cancelled', 'surecart');
      case 'payment_failed':
        return __('Failed', 'surecart');
      case 'requires_approval':
        return __('Requires Approval', 'surecart');
      default:
        return this.status;
    }
  }
  render() {
    return h("sc-tag", { type: this.getType() }, this.getText());
  }
};
ScOrderStatusBadge.style = scOrderStatusBadgeCss;

export { ScOrderStatusBadge as sc_order_status_badge };
