@saasquatch/mint-components 2.2.0-1 → 2.2.0-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +27 -9
  2. package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +30 -9
  3. package/dist/cjs/sqm-stencilbook.cjs.entry.js +470 -303
  4. package/dist/collection/components/sqm-referral-table/ReferralTable.stories.js +1 -0
  5. package/dist/collection/components/sqm-referral-table/ReferralTableRewardsCell.stories.js +1 -0
  6. package/dist/collection/components/sqm-referral-table/TaxAndCashReferralTableRewardsCell.stories.js +209 -157
  7. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.js +30 -10
  8. package/dist/collection/components/sqm-rewards-table/RewardsTableCell.stories.js +1 -0
  9. package/dist/collection/components/sqm-rewards-table/TaxAndCashRewardsTableCell.stories.js +223 -148
  10. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.js +30 -10
  11. package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +1 -0
  12. package/dist/esm/sqm-referral-table_11.entry.js +27 -9
  13. package/dist/esm/sqm-rewards-table_9.entry.js +30 -9
  14. package/dist/esm/sqm-stencilbook.entry.js +470 -303
  15. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  16. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
  17. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  18. package/dist/mint-components/mint-components.esm.js +1 -1
  19. package/dist/mint-components/p-162da001.system.entry.js +1 -0
  20. package/dist/mint-components/p-1c413a06.system.js +1 -1
  21. package/dist/mint-components/p-1f76371b.entry.js +9 -0
  22. package/dist/mint-components/p-bdf858c3.entry.js +1 -0
  23. package/dist/mint-components/{p-9e43f1eb.entry.js → p-be5ecf62.entry.js} +3 -2
  24. package/dist/mint-components/p-d3ac8246.system.entry.js +1 -0
  25. package/dist/mint-components/{p-0b2a428f.system.entry.js → p-e83d08d7.system.entry.js} +1 -1
  26. package/dist/types/components/sqm-referral-table/TaxAndCashReferralTableRewardsCell.stories.d.ts +16 -0
  27. package/dist/types/components/sqm-rewards-table/TaxAndCashRewardsTableCell.stories.d.ts +18 -7
  28. package/dist/types/saasquatch.d.ts +1 -0
  29. package/docs/docs.docx +0 -0
  30. package/docs/raisins.json +1 -1
  31. package/package.json +1 -1
  32. package/dist/mint-components/p-55627a5c.entry.js +0 -1
  33. package/dist/mint-components/p-7a744cb2.entry.js +0 -9
  34. package/dist/mint-components/p-d01949f7.system.entry.js +0 -1
  35. package/dist/mint-components/p-e9e05970.system.entry.js +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@saasquatch/mint-components",
3
3
  "title": "Mint Components",
4
- "version": "2.2.0-1",
4
+ "version": "2.2.0-2",
5
5
  "description": "A minimal design library with components for referral and loyalty experiences. Built with Shoelace components by Saasquatch.",
6
6
  "icon": "https://res.cloudinary.com/saasquatch/image/upload/v1652219900/squatch-assets/For_Mint.svg",
7
7
  "raisins": "docs/raisins.json",
@@ -1 +0,0 @@
1
- import{r as e,h as t,g as a,c as s}from"./p-083180bf.js";import{i as r}from"./p-438f6702.js";import{n as l,j as i,u as n,f as o}from"./p-a7fc1e02.js";import{i as d}from"./p-d20188db.js";import{c}from"./p-c1086930.js";import{l as u}from"./p-9ec99ced.js";import{c as E}from"./p-cef45012.js";import"./p-49b20dae.js";import{T as p}from"./p-50d959bd.js";import{G as h}from"./p-b1eb2a6a.js";import{a as v,u as N}from"./p-092db51a.js";import{u as m}from"./p-7e36a1ff.js";import{l as P}from"./p-2786819c.js";import{g as I}from"./p-11c127f5.js";import{u as D,t as _}from"./p-32d078a3.js";const A=[["AVAILABLE"],["PENDING"],["CANCELLED"],["EXPIRED"],["REDEEMED"]],f=["Rajesh","Pierre","Ji-Ho","Chinua","Charleston","Sally","Gael","Jill","Jane","Khadija"],g=["Smith","Parker","Kent","Chew","Stark","Banner","Jones","Odinson","Pym","Rogers"],R=class{constructor(t){e(this,t),this.perPage=4,this.hideLabels=!1,this.prevLabel="Prev",this.moreLabel="Next",this.showReferrer=!1,this.hiddenColumns="0",this.smBreakpoint=599,this.mdBreakpoint=799,l(this)}disconnectedCallback(){}render(){const e=t(y,null),a=t(b,null),{states:s,data:r,callbacks:l,elements:u}=d()?function(e,t,a){const[s,r]=i(((e,t)=>({...e,...t})),{columns:[],rows:[],loading:!1,page:0}),l=N(),d=n((()=>{var t;return(null===(t=e.demoData)||void 0===t?void 0:t.mockData)||((e=4)=>({totalCount:6,count:e,referredByReferral:{dateConverted:null,dateReferralStarted:1643912659850,referrerUser:{firstName:"John",lastName:"Snow",rewards:[]}},data:[...Array(e)].map((()=>({id:"5cae6b0fcc540e209db45b53",referredUser:{id:"5cae6b0ce4b0d81c67b78e82",accountId:"SPX1MZBIPTFL3E1H",firstName:f[Math.floor(Math.random()*f.length)],lastName:g[Math.floor(Math.random()*g.length)],email:"example.uexwltgh@mailosaur.io",programGoals:[]},shareLinkUsed:null,referralCodeUsed:"JIMBONEUTRON2",moderationStatus:"PENDING",dateConverted:Math.floor(10*Math.random())>=5?P.DateTime.now().minus({days:6}).toMillis():null,dateFraudChecksCompleted:null,dateModerated:1558730033306,dateModified:1554934543447,dateReferralEnded:null,dateReferralPaid:null,dateReferralStarted:P.DateTime.now().minus({days:8}).toMillis(),dateUserModified:null,programId:"sam-partner-test-2",program:{id:"sam-partner-test-2",name:"Partner Program 2.0"},rewards:Math.floor(10*Math.random())>=5?[{id:"5cae6b16cc540e209db45cfa",type:"CREDIT",value:1,unit:"POINT",name:"Partner Reward",dateGiven:1554934550726,dateExpires:null,dateCancelled:null,dateRedeemed:1637004373582,dateScheduledFor:null,fuelTankCode:null,fuelTankType:null,currency:null,prettyValue:"1 Point",statuses:A[Math.floor(Math.random()*A.length)],globalRewardKey:null,programRewardKey:"partnerReward",meta:{...I()},rewardRedemptionTransactions:{data:[{exchangedRewards:{data:[{prettyValue:"CAD10.00 Visa* Prepaid Card CAD",type:"INTEGRATION",fuelTankCode:null,globalRewardKey:"gc1"}]}}]}}]:[],childNodes:{data:[{data:{id:"5cae6b16cc540e209db45cb3",statuses:A[Math.floor(Math.random()*A.length)],type:"PCT_DISCOUNT",value:50},depth:1},{data:{id:"5cae6b16cc540e209db45cfa",statuses:A[Math.floor(Math.random()*A.length)],type:"CREDIT",value:1},depth:1}]}})))}))(e.perPage)}),[e.perPage]),u=m();return o((()=>{r({loading:!0}),(null==d?void 0:d.data)&&async function(t){var a;let s;const l=null==d?void 0:d.referredByReferral,i=e.showReferrer&&!!(null===(a=null==d?void 0:d.referredByReferral)||void 0===a?void 0:a.dateReferralStarted);s=d.data.slice(0,i?e.perPage-1:e.perPage);const n=t.filter((e=>{var t,a;return"loading"!==e.slot&&"empty"!==e.slot&&"loading"!==(null===(t=null==e?void 0:e.firstElementChild)||void 0===t?void 0:t.getAttribute("slot"))&&"empty"!==(null===(a=null==e?void 0:e.firstElementChild)||void 0===a?void 0:a.getAttribute("slot"))})),o=null==n?void 0:n.map((async(e,t)=>{var a;const s=null===(a=null==e?void 0:e.firstElementChild)||void 0===a?void 0:a.getAttribute("slot");if("RAISINS-PLOP-TARGET"===e.tagName&&"loading"!==s&&"empty"!==s){e.setAttribute("slot","column-"+t),e.style.position="absolute";const a=e.firstElementChild.childNodes[1];return a.innerHTML="+",a.style.lineHeight="20px",_(e,(()=>e.renderLabel(t)))}return _(e,(()=>e.renderLabel()))}));let c;if(i){const e=null==n?void 0:n.map((async e=>_(e,(function(){return e.renderCell(l,e)}))));c=await Promise.all(e)}const u=null==s?void 0:s.map((async e=>{const t=null==n?void 0:n.map((async t=>_(t,(()=>t.renderCell(e,void 0)))));return await Promise.all(t)})),E=u&&[c,...await Promise.all(u)].filter((e=>e));r({rows:E});const p=o&&await Promise.all(o);r({columns:p,loading:!1,page:0})}(u)}),[null==d?void 0:d.data,u,l]),c({states:{hasPrev:!1,hasNext:!1,loading:!1,show:"rows"},callbacks:{prevPage:()=>console.log("Prev"),nextPage:()=>console.log("Next")},data:{textOverrides:{showLabels:!e.hideLabels,prevLabel:e.prevLabel,moreLabel:e.moreLabel},hiddenColumns:e.hiddenColumns,referralData:[],mdBreakpoint:799,smBreakpoint:599},elements:{columns:s.columns,rows:s.rows,emptyElement:t,loadingElement:a}},e.demoData||{},{arrayMerge:(e,t)=>t})}(this,e,a):D(this,e,a);return v([this.showReferrer,this.perPage]),t(h,{states:s,data:r,callbacks:l,elements:u})}};function y(){return t("slot",{name:"empty"},t("sqm-empty",{"empty-state-image":"https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/empty_referral2.png","empty-state-header":"View your referral details","empty-state-text":"Refer a friend to view the status of your referrals and rewards earned"}))}function b(){return t("slot",{name:"loading"},t(C,null),t(C,null),t(C,null),t(C,null))}function C(){return t("sqm-table-row",null,t("sqm-table-cell",{colspan:5},t("sqm-skeleton",null)))}const T=class{constructor(t){e(this,t),this.ignored=!0,l(this)}disconnectedCallback(){}render(){return t("div",{innerHTML:this.innerTemplate})}},x=class{constructor(t){e(this,t),l(this)}disconnectedCallback(){}async renderCell(e){return t("sqm-referral-table-cell",{"inner-template":a(this).innerHTML})}async renderLabel(){return Promise.resolve(this.columnTitle)}render(){return v([this.columnTitle]),t(s,{style:{display:"none"}},t("slot",null))}},w=class{constructor(t){e(this,t),this.ignored=!0,this.locale="en",l(this)}disconnectedCallback(){}render(){var e;return this.date?null===(e=P.DateTime.fromMillis(this.date))||void 0===e?void 0:e.setLocale(u(this.locale)).toLocaleString(P.DateTime.DATE_MED):"-"}},O=class{constructor(t){e(this,t),this.columnTitle="Date converted",this.dateShown="dateConverted",l(this)}disconnectedCallback(){}async renderCell(e,a){return t("sqm-referral-table-date-cell",{date:e[this.dateShown],locale:null==a?void 0:a.locale})}async renderLabel(){return this.columnTitle}async renderReferrerCell(e){return t("sqm-referral-table-date-cell",{date:e[this.dateShown]})}render(){return v([this.dateShown,this.columnTitle]),t(s,{style:{display:"none"}})}},S=class{constructor(t){e(this,t),this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }",this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} 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.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} 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} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }",this.pendingForText="{status} for {date}",this.locale="en"}render(){var e;r.locale=this.locale;const a=E({"@keyframes slideRight":{from:{opacity:0},to:{opacity:1}},DetailsContainer:{width:"100%",display:"flex","align-items":"center","justify-content":"space-between","margin-right":"var(--sl-spacing-small)","flex-wrap":"wrap"},Details:{"max-width":"500px","&::part(header)":{padding:"var(--sl-spacing-x-small)",cursor:this.hideDetails?"default":"pointer"},"&::part(content)":{padding:"var(--sl-spacing-x-small) var(--sl-spacing-medium)"},"&::part(base)":{border:"var(--sqm-border-thickness) solid var(--sqm-border-color)",opacity:"1"},"&::part(summary-icon)":{display:this.hideDetails?"none":"flex"},"&::part(summary-icon[open])":{transform:"rotate(-90deg)"}},BadgeContainer:{"& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}},BoldText:{"font-weight":"var(--sl-font-weight-semibold)"},RedeemBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-informative-color-icon)",color:"var(--sl-color-white)"}},DangerBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-danger-color-icon)",color:"var(--sl-color-white)"}},WarningBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-warning-color-icon)",color:"var(--sl-color-white)"}},SuccessBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-success-color-icon)",color:"var(--sl-color-white)"}}}),s=a.toString(),l=e=>{switch(e){case"primary":return a.classes.RedeemBadge;case"danger":return a.classes.DangerBadge;case"success":return a.classes.SuccessBadge;case"warning":case"info":default:return a.classes.WarningBadge}},i=e=>P.DateTime.fromMillis(e).setLocale(u(this.locale)).toRelative().replace("in","").trim();return null===(e=this.rewards)||void 0===e?void 0:e.map((e=>{var n,o,d,c;const E=((e,t)=>{var a,s,r,l,i,n,o,d,c,u,E,p;if("APPROVED"!==(null===(s=null===(a=e.referral)||void 0===a?void 0:a.fraudData)||void 0===s?void 0:s.moderationStatus)){if("PENDING"===(null===(l=null===(r=e.referral)||void 0===r?void 0:r.fraudData)||void 0===l?void 0:l.moderationStatus))return"PENDING_REVIEW";if("DENIED"===(null===(n=null===(i=e.referral)||void 0===i?void 0:i.fraudData)||void 0===n?void 0:n.moderationStatus))return"DENIED"}const h=null===(o=e.partnerFundsTransfer)||void 0===o?void 0:o.status;if(e.partnerFundsTransfer){if("REVERSED"===h)return"PAYOUT_CANCELLED";if("OVERDUE"===h)return"PAYOUT_FAILED";if(e.partnerFundsTransfer.dateScheduled&&e.partnerFundsTransfer.dateScheduled>Date.now())return"PROCESSING";if("TRANSFERRED"===h||"NOT_YET_DUE"===h||e.partnerFundsTransfer.dateScheduled&&e.partnerFundsTransfer.dateScheduled<Date.now()&&"OVERDUE"!==h&&"REVERSED"!==h)return"PAYOUT_APPROVED"}if(null===(d=null==e?void 0:e.pendingReasons)||void 0===d?void 0:d.includes("US_TAX")){if(!(null==t?void 0:t.taxHandlingEnabled))return"PENDING";if(!(null==t?void 0:t.connected))return"PENDING_PARTNER_CREATION";if(null===(c=null==t?void 0:t.publisher)||void 0===c?void 0:c.requiredTaxDocumentType){if(!(null===(u=null==t?void 0:t.publisher)||void 0===u?void 0:u.currentTaxDocument))return"PENDING_TAX_SUBMISSION";const e=t.publisher.currentTaxDocument.status;if("INACTIVE"===e||"INVALID_W9_ELECTRONIC_DOCUMENT"===e||"INVALID_W9_ELECTRONIC_DOCUMENT_CHECK_INTERNAL"===e)return"PENDING_NEW_TAX_FORM";if("NOT_VERIFIED"===e)return"PENDING_TAX_REVIEW"}if(!(null===(E=null==t?void 0:t.publisher)||void 0===E?void 0:E.withdrawalSettings))return"PENDING_PARTNER_CREATION"}return(null===(p=null==e?void 0:e.pendingReasons)||void 0===p?void 0:p.includes("MISSING_PAYOUT_CONFIGURATION"))?"PENDING_PARTNER_CREATION":1===e.statuses.length?e.statuses[0]:["REDEEMED","CANCELLED","EXPIRED","PENDING","AVAILABLE","PENDING_REVIEW","DENIED","PAYOUT_APPROVED","PAYOUT_CANCELLED","PAYOUT_FAILED","PENDING_TAX_REVIEW","PENDING_NEW_TAX_FORM","PENDING_TAX_SUBMISSION","PENDING_PARTNER_CREATION","PROCESSING"].find((t=>e.statuses.includes(t)&&t))})(e,this.taxConnection),h=(e=>{switch(e){case"REDEEMED":case"PAYOUT_APPROVED":return"primary";case"DENIED":case"EXPIRED":case"CANCELLED":case"PAYOUT_FAILED":case"PAYOUT_CANCELLED":return"danger";case"PENDING":case"PENDING_REVIEW":case"PENDING_TAX_REVIEW":case"PENDING_NEW_TAX_FORM":case"PENDING_TAX_SUBMISSION":case"PENDING_PARTNER_CREATION":case"PROCESSING":return"warning";case"AVAILABLE":return"success"}})(E),v=r.formatMessage({id:"statusShortMessage",defaultMessage:this.statusText},{status:E}),N=r.formatMessage({id:"statusLongMessage",defaultMessage:this.statusLongText},{status:E,scheduledPayoutDate:(null===(n=e.partnerFundsTransfer)||void 0===n?void 0:n.dateScheduled)?null===(o=P.DateTime.fromMillis(e.partnerFundsTransfer.dateScheduled))||void 0===o?void 0:o.setLocale(u(this.locale)).toLocaleString(P.DateTime.DATE_MED):null});return t("sl-details",{class:a.classes.Details,disabled:this.hideDetails},t("style",{type:"text/css"},s),t("div",{slot:"summary",class:a.classes.DetailsContainer},t(p,{type:"p"},t("span",{part:"sqm-cell-value",class:a.classes.BoldText},e.prettyValue)),t("div",{class:a.classes.BadgeContainer},t("sl-badge",{class:l(h),type:h,pill:!0},"PENDING"===E&&e.dateScheduledFor?r.formatMessage({id:"pendingForText",defaultMessage:this.pendingForText},{status:v,date:i(e.dateScheduledFor)}):v),e.dateExpires&&"AVAILABLE"===E&&t("sl-badge",{class:l(h),type:"info",pill:!0},this.expiringText,` ${i(e.dateExpires)}`))),t("div",null,"PENDING_REVIEW"===E&&(null===(d=e.referral)||void 0===d?void 0:d.dateModerated)&&t("div",null,t(p,{type:"p"},N," ",t("span",{class:a.classes.BoldText,part:"sqm-cell-value"},P.DateTime.fromMillis(e.referral.dateModerated).setLocale(u(this.locale)).toLocaleString(P.DateTime.DATE_MED)))),"PAYOUT_APPROVED"===E&&t("div",null,t(p,{type:"p"},N)),"PROCESSING"===E&&t("div",null,t(p,{type:"p"},N)),"PAYOUT_FAILED"===E&&t("div",null,t(p,{type:"p"},N)),"PAYOUT_CANCELLED"===E&&t("div",null,t(p,{type:"p"},N)),"PENDING_TAX_REVIEW"===E&&t("div",null,t(p,{type:"p"},N)),"PENDING_NEW_TAX_FORM"===E&&t("div",null,t(p,{type:"p"},N)),"PENDING_TAX_SUBMISSION"===E&&t("div",null,t(p,{type:"p"},N)),"PENDING_PARTNER_CREATION"===E&&t("div",null,t(p,{type:"p"},N)),"DENIED"===E&&(null===(c=e.referral)||void 0===c?void 0:c.dateModerated)&&t("div",null,t(p,{type:"p"},N," ",t("span",{class:a.classes.BoldText,part:"sqm-cell-value"},P.DateTime.fromMillis(e.referral.dateModerated).setLocale(u(this.locale)).toLocaleString(P.DateTime.DATE_MED)),".",this.deniedHelpText?` ${this.deniedHelpText}`:"")),e.dateGiven&&t("div",null,t(p,{type:"p"},this.rewardReceivedText," ",t("span",{class:a.classes.BoldText,part:"sqm-cell-value"},P.DateTime.fromMillis(e.dateGiven).setLocale(u(this.locale)).toLocaleString(P.DateTime.DATE_MED)))),"EXPIRED"===E&&e.dateExpires&&t("div",null,t(p,{type:"p"},N," ",t("span",{class:a.classes.BoldText,part:"sqm-cell-value"},P.DateTime.fromMillis(e.dateExpires).setLocale(u(this.locale)).toLocaleString(P.DateTime.DATE_MED)))),"CANCELLED"===E&&e.dateCancelled&&t("div",null,t(p,{type:"p"},N," ",t("span",{class:a.classes.BoldText,part:"sqm-cell-value"},P.DateTime.fromMillis(e.dateCancelled).setLocale(u(this.locale)).toLocaleString(P.DateTime.DATE_MED)))),"PENDING"===E&&e.dateScheduledFor&&t("div",null,t(p,{type:"p"},N," ",t("span",{class:a.classes.BoldText,part:"sqm-cell-value"},P.DateTime.fromMillis(e.dateScheduledFor).setLocale(u(this.locale)).toLocaleString(P.DateTime.DATE_MED))))," ","AVAILABLE"===E&&e.dateExpires&&t("div",null,t(p,{type:"p"},N," ",t("span",{class:a.classes.BoldText,part:"sqm-cell-value"},P.DateTime.fromMillis(e.dateExpires).setLocale(u(this.locale)).toLocaleString(P.DateTime.DATE_MED)))),e.fuelTankCode&&t("div",null,this.fuelTankText," ",t("span",{class:a.classes.BoldText,part:"sqm-cell-value"},e.fuelTankCode))))}))}},L=class{constructor(t){e(this,t),this.columnTitle="Rewards",this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }",this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} 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.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} 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} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }",this.fuelTankText="Your code is",this.rewardReceivedText="Reward received on",this.expiringText="Expiring in",this.pendingForText="{status} for {date}",this.deniedHelpText="Contact support if you think this is a mistake.",this.hideDetails=!1,l(this)}disconnectedCallback(){}async renderCell(e,a){return t("sqm-referral-table-rewards-cell",{rewards:e.rewards,taxConnection:null==a?void 0:a.taxConnection,statusText:this.statusText,statusLongText:this.statusLongText,fuelTankText:this.fuelTankText,rewardReceivedText:this.rewardReceivedText,expiringText:this.expiringText,pendingForText:this.pendingForText,hideDetails:this.hideDetails,deniedHelpText:this.deniedHelpText,locale:null==a?void 0:a.locale,exportparts:"sqm-cell-value"})}async renderLabel(){return this.columnTitle}async renderReferrerCell(e){return t("sqm-referral-table-rewards-cell",{rewards:e.rewards,exportparts:"sqm-cell-value"})}render(){return v([this.columnTitle,this.statusText,this.statusLongText,this.fuelTankText,this.rewardReceivedText,this.expiringText,this.pendingForText,this.hideDetails]),t(s,{style:{display:"none"}})}},G={SubText:{fontSize:"var(--sl-font-size-small)",color:"var(--sqm-text-subdued)",margin:"0"},RedeemBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-informative-color-icon)",color:"var(--sl-color-white)"}},DangerBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-danger-color-icon)",color:"var(--sl-color-white)"}},WarningBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-warning-color-icon)",color:"var(--sl-color-white)"}},SuccessBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-success-color-icon)",color:"var(--sl-color-white)"}}},M=(E(G).toString(),class{constructor(t){e(this,t)}render(){const e=E(G),a=e.toString(),s=e=>"PENDING"===e?"warning":"DENIED"===e?"danger":this.converted?"success":"warning";return t("div",null,t("style",{type:"text/css"},a),t("sl-badge",{pill:!0,type:s(this.fraudStatus),class:(t=>{switch(t){case"primary":return e.classes.RedeemBadge;case"danger":return e.classes.DangerBadge;case"success":return e.classes.SuccessBadge;case"warning":case"info":default:return e.classes.WarningBadge}})(s(this.fraudStatus))},this.statusText),this.statusSubText?t("p",{class:e.classes.SubText},this.statusSubText):null)}}),q=class{constructor(t){e(this,t),this.columnTitle="Status",this.convertedStatusText="Converted",this.inProgressStatusText="In Progress",this.pendingReviewStatusText="Pending",this.deniedStatusText="Denied",this.pendingReviewStatusSubText="Awaiting review",this.deniedStatusSubText="Detected self-referral",l(this)}disconnectedCallback(){}async renderCell(e){var a;let s,r;const l=null===(a=null==e?void 0:e.fraudData)||void 0===a?void 0:a.moderationStatus;return"DENIED"===l?(s=this.deniedStatusText,r=this.deniedStatusSubText):"PENDING"===l?(s=this.pendingReviewStatusText,r=this.pendingReviewStatusSubText):s=e.dateConverted?this.convertedStatusText:this.inProgressStatusText,t("sqm-referral-table-status-cell",{"status-text":s,"status-sub-text":r,"fraud-status":l,converted:!!e.dateConverted})}async renderLabel(){return this.columnTitle}async renderReferrerCell(e){return t("sqm-referral-table-status-cell",{"status-text":e.dateConverted?this.convertedStatusText:this.inProgressStatusText,converted:!!e.dateConverted})}render(){return v([this.columnTitle,this.convertedStatusText,this.inProgressStatusText]),t(s,{style:{display:"none"}})}},U=class{constructor(t){e(this,t)}render(){return this.name}},V=class{constructor(t){e(this,t),this.columnTitle="Customer",this.anonymousUser="Your Friend",this.deletedUser="Deleted User",l(this)}disconnectedCallback(){}async renderCell(e){var a,s,r,l,i,n,o,d;let c;return c=(null==e?void 0:e.referredUser)||(null==e?void 0:e.referrerUser)?(null===(a=null==e?void 0:e.referredUser)||void 0===a?void 0:a.firstName)||(null===(s=null==e?void 0:e.referredUser)||void 0===s?void 0:s.lastName)||(null===(r=null==e?void 0:e.referrerUser)||void 0===r?void 0:r.firstName)||(null===(l=null==e?void 0:e.referrerUser)||void 0===l?void 0:l.lastName)?(null==e?void 0:e.referrerUser)?`${null===(i=null==e?void 0:e.referrerUser)||void 0===i?void 0:i.firstName} ${null===(n=null==e?void 0:e.referrerUser)||void 0===n?void 0:n.lastName}`:`${null===(o=null==e?void 0:e.referredUser)||void 0===o?void 0:o.firstName} ${null===(d=null==e?void 0:e.referredUser)||void 0===d?void 0:d.lastName}`:this.anonymousUser:this.deletedUser,t("sqm-referral-table-user-cell",{name:c})}async renderLabel(){return this.columnTitle}async renderReferrerCell(e){var a,s,r,l;let i;return i=e?(null===(a=null==e?void 0:e.referrerUser)||void 0===a?void 0:a.firstName)||(null===(s=e.referrerUser)||void 0===s?void 0:s.lastName)?`${null===(r=null==e?void 0:e.referrerUser)||void 0===r?void 0:r.firstName} ${null===(l=null==e?void 0:e.referrerUser)||void 0===l?void 0:l.lastName}`:this.anonymousUser:this.deletedUser,t("sqm-referral-table-user-cell",{name:i})}render(){return v([this.deletedUser,this.anonymousUser,this.columnTitle]),t(s,{style:{display:"none"}})}};export{R as sqm_referral_table,T as sqm_referral_table_cell,x as sqm_referral_table_column,w as sqm_referral_table_date_cell,O as sqm_referral_table_date_column,S as sqm_referral_table_rewards_cell,L as sqm_referral_table_rewards_column,M as sqm_referral_table_status_cell,q as sqm_referral_table_status_column,U as sqm_referral_table_user_cell,V as sqm_referral_table_user_column}