import { withHooks } from "@saasquatch/stencil-hooks";
import { Component, h, Host, Method, Prop } from "@stencil/core";
import { useRequestRerender } from "../../../tables/re-render";
/**
 * @uiName Reward Table Status Column
 * @validParents ["sqm-rewards-table"]
 * @exampleGroup Rewards
 * @example Reward Table Status Column - <sqm-rewards-table-status-column column-title="Status" status-text="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_CANCELLED {Payout Cancelled} PAYOUT_FAILED {Payout Failed} EXPIRED {Expired} REDEEMED {Redeemed} DENIED {Denied} other {Not available} }" expiry-text="Expires on " pending-us-tax="W-9 required" pending-scheduled="Until" pending-unhandled="Fulfillment error" pending-review-text="Awaiting review" denied-text="Detected self-referral" pending-tax-review="Awaiting tax form review." pending-new-tax-form="Invalid tax form. Submit a new form to receive your rewards." pending-tax-submission="Submit your tax documents to receive your rewards." pending-partner-creation="Complete your tax and cash payout setup to receive your rewards." payout-failed="Payout failed due to a fulfillment issue and is currently being retried." payout-cancelled="If you think this is a mistake, contact our Support team." payout-approved="Reward was scheduled for payment based on your settings, barring any account holds." ></sqm-rewards-table-status-column>
 */
export class RewardTableStatusColumn {
  constructor() {
    /**
     * @uiName Column title
     */
    this.columnTitle = "Status";
    /**
     * @uiName Reward status text
     * @uiWidget textArea
     */
    this.statusText = "{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_CANCELLED {Payout Cancelled} PAYOUT_FAILED {Payout Failed} EXPIRED {Expired} REDEEMED {Redeemed} DENIED {Denied} other {Not available} }";
    /**
     * Text shown before the date of an expiring reward.
     *
     * @uiName Expiry date prefix
     */
    this.expiryText = "Expires on ";
    /**
     * Displayed when a reward is pending due to W-9 compliance.
     *
     * @uiName W-9 pending text
     */
    this.pendingUsTax = "W-9 required";
    /**
     * Text shown before the available date of a pending reward.
     *
     * @uiName Pending date prefix
     */
    this.pendingScheduled = "Until";
    /**
     * Displayed when fulfillment error occured when creating a reward.
     *
     * @uiName Unhandled error text
     */
    this.pendingUnhandled = "Fulfillment error";
    /**
     *  Displayed when flagged for fraud.
     *
     * @uiName Pending review text
     */
    this.pendingReviewText = "Awaiting review";
    /**
     *  Displayed when denied for fraud.
     *
     * @uiName Denied text
     */
    this.deniedText = "Detected self-referral";
    /**
     * Displayed when pending due to tax document review.
     *
     * @uiName Pending tax review text
     */
    this.pendingTaxReview = "Awaiting tax form review.";
    /**
     * Displayed when pending due to requiring a new tax document
     *
     * @uiName Pending new tax form text
     */
    this.pendingNewTaxForm = "Invalid tax form. Submit a new form to receive your rewards.";
    /**
     * Displayed when pending due to lack of tax document submission.
     *
     * @uiName Pending tax submission text
     */
    this.pendingTaxSubmission = "Submit your tax documents to receive your rewards.";
    /**
     * Displayed when pending due to need to connect to an Impact partner
     *
     * @uiName Pending partner creation text
     */
    this.pendingPartnerCreation = "Complete your tax and cash payout setup to receive your rewards.";
    /**
     * Displayed when reward payout has failed (based on Impact cash payout configuration).
     *
     * @uiName Payout failed text
     */
    this.payoutFailed = "Payout failed due to a fulfillment issue and is currently being retried.";
    /**
     * Displayed when a reward payout is processing.
     *
     * @uiName Payout processing text
     */
    this.payoutProcessing = "Processing until {date}. Payout is then scheduled based on your settings.";
    /**
     * Displayed when reward payout was reversed (based on Impact cash payout configuration).
     *
     * @uiName Payout cancelled text
     */
    this.payoutCancelled = "If you think this is a mistake, contact our Support team.";
    /**
     * Displayed when reward payout is approved (based on Impact cash payout configuration).
     *
     * @uiName Payout approved text
     */
    this.payoutApproved = "Reward was scheduled for payment based on your settings, barring any account holds.";
    withHooks(this);
  }
  disconnectedCallback() { }
  async renderCell(data, options) {
    return (h("sqm-rewards-table-status-cell", { statusText: this.statusText, reward: data, taxConnection: options === null || options === void 0 ? void 0 : options.taxConnection, expiryText: this.expiryText, pendingScheduled: this.pendingScheduled, pendingUsTax: this.pendingUsTax, pendingUnhandled: this.pendingUnhandled, pendingReviewText: this.pendingReviewText, payoutFailed: this.payoutFailed, payoutApproved: this.payoutApproved, payoutProcessing: this.payoutProcessing, payoutCancelled: this.payoutCancelled, deniedText: this.deniedText, locale: options === null || options === void 0 ? void 0 : options.locale }));
  }
  async renderLabel() {
    return this.columnTitle;
  }
  render() {
    useRequestRerender([
      this.columnTitle,
      this.statusText,
      this.expiryText,
      this.pendingReviewText,
      this.pendingScheduled,
      this.pendingUsTax,
      this.pendingUnhandled,
    ]);
    return h(Host, { style: { display: "none" } });
  }
  static get is() { return "sqm-rewards-table-status-column"; }
  static get encapsulation() { return "shadow"; }
  static get properties() { return {
    "columnTitle": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Column title",
            "name": "uiName"
          }],
        "text": ""
      },
      "attribute": "column-title",
      "reflect": false,
      "defaultValue": "\"Status\""
    },
    "statusText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Reward status text",
            "name": "uiName"
          }, {
            "text": "textArea",
            "name": "uiWidget"
          }],
        "text": ""
      },
      "attribute": "status-text",
      "reflect": false,
      "defaultValue": "\"{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_CANCELLED {Payout Cancelled} PAYOUT_FAILED {Payout Failed} EXPIRED {Expired} REDEEMED {Redeemed} DENIED {Denied} other {Not available} }\""
    },
    "expiryText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Expiry date prefix",
            "name": "uiName"
          }],
        "text": "Text shown before the date of an expiring reward."
      },
      "attribute": "expiry-text",
      "reflect": false,
      "defaultValue": "\"Expires on \""
    },
    "pendingUsTax": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "W-9 pending text",
            "name": "uiName"
          }],
        "text": "Displayed when a reward is pending due to W-9 compliance."
      },
      "attribute": "pending-us-tax",
      "reflect": false,
      "defaultValue": "\"W-9 required\""
    },
    "pendingScheduled": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Pending date prefix",
            "name": "uiName"
          }],
        "text": "Text shown before the available date of a pending reward."
      },
      "attribute": "pending-scheduled",
      "reflect": false,
      "defaultValue": "\"Until\""
    },
    "pendingUnhandled": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Unhandled error text",
            "name": "uiName"
          }],
        "text": "Displayed when fulfillment error occured when creating a reward."
      },
      "attribute": "pending-unhandled",
      "reflect": false,
      "defaultValue": "\"Fulfillment error\""
    },
    "pendingReviewText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Pending review text",
            "name": "uiName"
          }],
        "text": "Displayed when flagged for fraud."
      },
      "attribute": "pending-review-text",
      "reflect": false,
      "defaultValue": "\"Awaiting review\""
    },
    "deniedText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Denied text",
            "name": "uiName"
          }],
        "text": "Displayed when denied for fraud."
      },
      "attribute": "denied-text",
      "reflect": false,
      "defaultValue": "\"Detected self-referral\""
    },
    "pendingTaxReview": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Pending tax review text",
            "name": "uiName"
          }],
        "text": "Displayed when pending due to tax document review."
      },
      "attribute": "pending-tax-review",
      "reflect": false,
      "defaultValue": "\"Awaiting tax form review.\""
    },
    "pendingNewTaxForm": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Pending new tax form text",
            "name": "uiName"
          }],
        "text": "Displayed when pending due to requiring a new tax document"
      },
      "attribute": "pending-new-tax-form",
      "reflect": false,
      "defaultValue": "\"Invalid tax form. Submit a new form to receive your rewards.\""
    },
    "pendingTaxSubmission": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Pending tax submission text",
            "name": "uiName"
          }],
        "text": "Displayed when pending due to lack of tax document submission."
      },
      "attribute": "pending-tax-submission",
      "reflect": false,
      "defaultValue": "\"Submit your tax documents to receive your rewards.\""
    },
    "pendingPartnerCreation": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Pending partner creation text",
            "name": "uiName"
          }],
        "text": "Displayed when pending due to need to connect to an Impact partner"
      },
      "attribute": "pending-partner-creation",
      "reflect": false,
      "defaultValue": "\"Complete your tax and cash payout setup to receive your rewards.\""
    },
    "payoutFailed": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Payout failed text",
            "name": "uiName"
          }],
        "text": "Displayed when reward payout has failed (based on Impact cash payout configuration)."
      },
      "attribute": "payout-failed",
      "reflect": false,
      "defaultValue": "\"Payout failed due to a fulfillment issue and is currently being retried.\""
    },
    "payoutProcessing": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Payout processing text",
            "name": "uiName"
          }],
        "text": "Displayed when a reward payout is processing."
      },
      "attribute": "payout-processing",
      "reflect": false,
      "defaultValue": "\"Processing until {date}. Payout is then scheduled based on your settings.\""
    },
    "payoutCancelled": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Payout cancelled text",
            "name": "uiName"
          }],
        "text": "Displayed when reward payout was reversed (based on Impact cash payout configuration)."
      },
      "attribute": "payout-cancelled",
      "reflect": false,
      "defaultValue": "\"If you think this is a mistake, contact our Support team.\""
    },
    "payoutApproved": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Payout approved text",
            "name": "uiName"
          }],
        "text": "Displayed when reward payout is approved (based on Impact cash payout configuration)."
      },
      "attribute": "payout-approved",
      "reflect": false,
      "defaultValue": "\"Reward was scheduled for payment based on your settings, barring any account holds.\""
    }
  }; }
  static get methods() { return {
    "renderCell": {
      "complexType": {
        "signature": "(data: Reward, options?: { locale: string; taxConnection: ImpactConnection; }) => Promise<any>",
        "parameters": [{
            "tags": [],
            "text": ""
          }, {
            "tags": [],
            "text": ""
          }],
        "references": {
          "Promise": {
            "location": "global"
          },
          "Reward": {
            "location": "import",
            "path": "../../../saasquatch"
          },
          "ImpactConnection": {
            "location": "import",
            "path": "../../../saasquatch"
          }
        },
        "return": "Promise<any>"
      },
      "docs": {
        "text": "",
        "tags": []
      }
    },
    "renderLabel": {
      "complexType": {
        "signature": "() => Promise<string>",
        "parameters": [],
        "references": {
          "Promise": {
            "location": "global"
          }
        },
        "return": "Promise<string>"
      },
      "docs": {
        "text": "",
        "tags": []
      }
    }
  }; }
}
