@saasquatch/mint-components 1.5.0-113 → 1.5.0-114
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.
- package/dist/cjs/{GenericTableView-f947b749.js → GenericTableView-a69fddb5.js} +4 -2
- package/dist/cjs/{ShadowViewAddon-79dd6c07.js → ShadowViewAddon-b0dc2cbf.js} +14 -19
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-big-stat_30.cjs.entry.js +20 -8
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -2
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +9 -12
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +42 -50
- package/dist/collection/components/sqm-big-stat/UseBigStat.stories.js +1 -1
- package/dist/collection/components/sqm-big-stat/useBigStat.js +1 -1
- package/dist/collection/components/sqm-leaderboard/UseLeaderboard.stories.js +2 -2
- package/dist/collection/components/sqm-leaderboard/sqm-leaderboard-view.js +0 -5
- package/dist/collection/components/sqm-referral-table/ReferralTable.stories.js +1 -1
- package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.js +0 -1
- package/dist/collection/components/sqm-rewards-table/RewardsTableCell.stories.js +10 -10
- package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-reward-cell.js +8 -24
- package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-reward-column.js +1 -26
- package/dist/collection/components/sqm-rewards-table/sqm-rewards-table.js +1 -1
- package/dist/collection/components/sqm-scroll/Scroll.stories.js +14 -23
- package/dist/collection/components/sqm-scroll/sqm-scroll.js +101 -147
- package/dist/collection/components/sqm-share-button/ShareButton.stories.js +8 -8
- package/dist/collection/components/sqm-share-button/sqm-share-button-view.js +13 -13
- package/dist/collection/components/sqm-share-button/sqm-share-button.js +21 -21
- package/dist/collection/components/sqm-task-card/sqm-task-card.js +3 -1
- package/dist/collection/tables/GenericTableView.js +4 -2
- package/dist/esm/{GenericTableView-6b7b537b.js → GenericTableView-042ed0ca.js} +4 -2
- package/dist/esm/{ShadowViewAddon-9c382e30.js → ShadowViewAddon-1c28d584.js} +14 -19
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-big-stat_30.entry.js +20 -8
- package/dist/esm/sqm-referral-table_11.entry.js +1 -2
- package/dist/esm/sqm-rewards-table_9.entry.js +9 -12
- package/dist/esm/sqm-stencilbook.entry.js +42 -50
- package/dist/esm-es5/GenericTableView-042ed0ca.js +1 -0
- package/dist/esm-es5/ShadowViewAddon-1c28d584.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-big-stat_30.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-46c31936.entry.js +1 -0
- package/dist/mint-components/p-55f3d841.system.js +1 -1
- package/dist/mint-components/{p-e16186c0.system.entry.js → p-660e371f.system.entry.js} +1 -1
- package/dist/mint-components/{p-1cd23e56.system.entry.js → p-6918a207.system.entry.js} +1 -1
- package/dist/mint-components/{p-bb497e73.entry.js → p-920a2900.entry.js} +2 -2
- package/dist/mint-components/p-9a2b9ff8.system.entry.js +1 -0
- package/dist/mint-components/p-a11e1cb1.system.js +1 -0
- package/dist/mint-components/p-b74de10f.js +1 -0
- package/dist/mint-components/p-b7f5d9e7.entry.js +9 -0
- package/dist/mint-components/p-bf49f17f.system.js +1 -0
- package/dist/mint-components/{p-eb61462d.entry.js → p-d79e1aa4.entry.js} +8 -8
- package/dist/mint-components/{p-2c5d7a20.js → p-f017e3da.js} +3 -3
- package/dist/mint-components/{p-e2731437.system.entry.js → p-fa68591b.system.entry.js} +1 -1
- package/dist/types/components/sqm-rewards-table/cells/sqm-rewards-table-reward-cell.d.ts +0 -1
- package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-reward-column.d.ts +0 -4
- package/dist/types/components/sqm-rewards-table/sqm-rewards-table.d.ts +1 -1
- package/dist/types/components/sqm-scroll/Scroll.stories.d.ts +1 -0
- package/dist/types/components/sqm-scroll/sqm-scroll.d.ts +56 -8
- package/dist/types/components/sqm-share-button/sqm-share-button-view.d.ts +6 -6
- package/dist/types/components/sqm-share-button/sqm-share-button.d.ts +9 -9
- package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +2 -0
- package/dist/types/components.d.ts +116 -42
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/shoelace/assets/icons/123.svg +3 -0
- package/shoelace/assets/icons/activity.svg +3 -0
- package/shoelace/assets/icons/apple.svg +4 -0
- package/shoelace/assets/icons/bandaid-fill.svg +3 -0
- package/shoelace/assets/icons/bandaid.svg +4 -0
- package/shoelace/assets/icons/bank.svg +3 -0
- package/shoelace/assets/icons/bank2.svg +3 -0
- package/shoelace/assets/icons/behance.svg +3 -0
- package/shoelace/assets/icons/bell-slash-fill.svg +3 -0
- package/shoelace/assets/icons/bell-slash.svg +3 -0
- package/shoelace/assets/icons/bluetooth.svg +3 -0
- package/shoelace/assets/icons/body-text.svg +3 -0
- package/shoelace/assets/icons/boombox-fill.svg +4 -0
- package/shoelace/assets/icons/boombox.svg +6 -0
- package/shoelace/assets/icons/boxes.svg +3 -0
- package/shoelace/assets/icons/cash-coin.svg +6 -0
- package/shoelace/assets/icons/check-lg.svg +3 -0
- package/shoelace/assets/icons/cloud-haze2.svg +3 -0
- package/shoelace/assets/icons/coin.svg +5 -0
- package/shoelace/assets/icons/currency-bitcoin.svg +3 -0
- package/shoelace/assets/icons/currency-dollar.svg +3 -0
- package/shoelace/assets/icons/currency-euro.svg +3 -0
- package/shoelace/assets/icons/currency-exchange.svg +3 -0
- package/shoelace/assets/icons/currency-pound.svg +3 -0
- package/shoelace/assets/icons/currency-yen.svg +3 -0
- package/shoelace/assets/icons/dash-lg.svg +3 -0
- package/shoelace/assets/icons/device-hdd-fill.svg +4 -0
- package/shoelace/assets/icons/device-hdd.svg +5 -0
- package/shoelace/assets/icons/device-ssd-fill.svg +4 -0
- package/shoelace/assets/icons/device-ssd.svg +4 -0
- package/shoelace/assets/icons/displayport-fill.svg +3 -0
- package/shoelace/assets/icons/displayport.svg +4 -0
- package/shoelace/assets/icons/dpad-fill.svg +3 -0
- package/shoelace/assets/icons/dpad.svg +4 -0
- package/shoelace/assets/icons/dribbble.svg +3 -0
- package/shoelace/assets/icons/ear-fill.svg +3 -0
- package/shoelace/assets/icons/ear.svg +3 -0
- package/shoelace/assets/icons/easel2-fill.svg +4 -0
- package/shoelace/assets/icons/easel2.svg +3 -0
- package/shoelace/assets/icons/easel3-fill.svg +3 -0
- package/shoelace/assets/icons/easel3.svg +3 -0
- package/shoelace/assets/icons/envelope-check-fill.svg +4 -0
- package/shoelace/assets/icons/envelope-check.svg +4 -0
- package/shoelace/assets/icons/envelope-dash-fill.svg +4 -0
- package/shoelace/assets/icons/envelope-dash.svg +4 -0
- package/shoelace/assets/icons/envelope-exclamation-fill.svg +4 -0
- package/shoelace/assets/icons/envelope-exclamation.svg +4 -0
- package/shoelace/assets/icons/envelope-plus-fill.svg +4 -0
- package/shoelace/assets/icons/envelope-plus.svg +4 -0
- package/shoelace/assets/icons/envelope-slash-fill.svg +4 -0
- package/shoelace/assets/icons/envelope-slash.svg +4 -0
- package/shoelace/assets/icons/envelope-x-fill.svg +4 -0
- package/shoelace/assets/icons/envelope-x.svg +4 -0
- package/shoelace/assets/icons/ethernet.svg +4 -0
- package/shoelace/assets/icons/exclamation-lg.svg +3 -0
- package/shoelace/assets/icons/explicit-fill.svg +3 -0
- package/shoelace/assets/icons/explicit.svg +4 -0
- package/shoelace/assets/icons/fan.svg +4 -0
- package/shoelace/assets/icons/file-earmark-pdf-fill.svg +4 -0
- package/shoelace/assets/icons/file-earmark-pdf.svg +4 -0
- package/shoelace/assets/icons/file-pdf-fill.svg +4 -0
- package/shoelace/assets/icons/file-pdf.svg +4 -0
- package/shoelace/assets/icons/fingerprint.svg +7 -0
- package/shoelace/assets/icons/gender-ambiguous.svg +3 -0
- package/shoelace/assets/icons/gender-female.svg +3 -0
- package/shoelace/assets/icons/gender-male.svg +3 -0
- package/shoelace/assets/icons/gender-trans.svg +3 -0
- package/shoelace/assets/icons/git.svg +3 -0
- package/shoelace/assets/icons/gpu-card.svg +5 -0
- package/shoelace/assets/icons/graph-down-arrow.svg +3 -0
- package/shoelace/assets/icons/graph-up-arrow.svg +3 -0
- package/shoelace/assets/icons/hdmi-fill.svg +3 -0
- package/shoelace/assets/icons/hdmi.svg +4 -0
- package/shoelace/assets/icons/headset-vr.svg +4 -0
- package/shoelace/assets/icons/hypnotize.svg +4 -0
- package/shoelace/assets/icons/infinity.svg +3 -0
- package/shoelace/assets/icons/info-lg.svg +3 -0
- package/shoelace/assets/icons/line.svg +3 -0
- package/shoelace/assets/icons/list-columns-reverse.svg +3 -0
- package/shoelace/assets/icons/list-columns.svg +3 -0
- package/shoelace/assets/icons/magic.svg +3 -0
- package/shoelace/assets/icons/mastodon.svg +3 -0
- package/shoelace/assets/icons/medium.svg +3 -0
- package/shoelace/assets/icons/memory.svg +3 -0
- package/shoelace/assets/icons/messenger.svg +3 -0
- package/shoelace/assets/icons/meta.svg +3 -0
- package/shoelace/assets/icons/microsoft.svg +3 -0
- package/shoelace/assets/icons/modem-fill.svg +3 -0
- package/shoelace/assets/icons/modem.svg +4 -0
- package/shoelace/assets/icons/mortarboard-fill.svg +4 -0
- package/shoelace/assets/icons/mortarboard.svg +4 -0
- package/shoelace/assets/icons/motherboard-fill.svg +4 -0
- package/shoelace/assets/icons/motherboard.svg +4 -0
- package/shoelace/assets/icons/nintendo-switch.svg +4 -0
- package/shoelace/assets/icons/optical-audio-fill.svg +4 -0
- package/shoelace/assets/icons/optical-audio.svg +5 -0
- package/shoelace/assets/icons/paypal.svg +3 -0
- package/shoelace/assets/icons/pc-display-horizontal.svg +3 -0
- package/shoelace/assets/icons/pc-display.svg +3 -0
- package/shoelace/assets/icons/pc-horizontal.svg +3 -0
- package/shoelace/assets/icons/pc.svg +3 -0
- package/shoelace/assets/icons/pci-card.svg +4 -0
- package/shoelace/assets/icons/person-rolodex.svg +4 -0
- package/shoelace/assets/icons/person-video.svg +4 -0
- package/shoelace/assets/icons/person-video2.svg +4 -0
- package/shoelace/assets/icons/person-video3.svg +4 -0
- package/shoelace/assets/icons/person-workspace.svg +4 -0
- package/shoelace/assets/icons/piggy-bank-fill.svg +3 -0
- package/shoelace/assets/icons/piggy-bank.svg +4 -0
- package/shoelace/assets/icons/pin-map-fill.svg +4 -0
- package/shoelace/assets/icons/pin-map.svg +4 -0
- package/shoelace/assets/icons/pinterest.svg +3 -0
- package/shoelace/assets/icons/playstation.svg +3 -0
- package/shoelace/assets/icons/plus-lg.svg +3 -0
- package/shoelace/assets/icons/plus-slash-minus.svg +3 -0
- package/shoelace/assets/icons/projector-fill.svg +3 -0
- package/shoelace/assets/icons/projector.svg +4 -0
- package/shoelace/assets/icons/qr-code-scan.svg +7 -0
- package/shoelace/assets/icons/qr-code.svg +7 -0
- package/shoelace/assets/icons/question-lg.svg +3 -0
- package/shoelace/assets/icons/quora.svg +3 -0
- package/shoelace/assets/icons/quote.svg +3 -0
- package/shoelace/assets/icons/radioactive.svg +4 -0
- package/shoelace/assets/icons/recycle.svg +3 -0
- package/shoelace/assets/icons/reddit.svg +4 -0
- package/shoelace/assets/icons/robot.svg +4 -0
- package/shoelace/assets/icons/router-fill.svg +6 -0
- package/shoelace/assets/icons/router.svg +6 -0
- package/shoelace/assets/icons/safe-fill.svg +4 -0
- package/shoelace/assets/icons/safe.svg +4 -0
- package/shoelace/assets/icons/safe2-fill.svg +4 -0
- package/shoelace/assets/icons/safe2.svg +4 -0
- package/shoelace/assets/icons/sd-card-fill.svg +3 -0
- package/shoelace/assets/icons/sd-card.svg +4 -0
- package/shoelace/assets/icons/send-check-fill.svg +4 -0
- package/shoelace/assets/icons/send-check.svg +4 -0
- package/shoelace/assets/icons/send-dash-fill.svg +4 -0
- package/shoelace/assets/icons/send-dash.svg +4 -0
- package/shoelace/assets/icons/send-exclamation-fill.svg +4 -0
- package/shoelace/assets/icons/send-exclamation.svg +4 -0
- package/shoelace/assets/icons/send-fill.svg +3 -0
- package/shoelace/assets/icons/send-plus-fill.svg +4 -0
- package/shoelace/assets/icons/send-plus.svg +4 -0
- package/shoelace/assets/icons/send-slash-fill.svg +4 -0
- package/shoelace/assets/icons/send-slash.svg +4 -0
- package/shoelace/assets/icons/send-x-fill.svg +4 -0
- package/shoelace/assets/icons/send-x.svg +4 -0
- package/shoelace/assets/icons/send.svg +3 -0
- package/shoelace/assets/icons/signal.svg +3 -0
- package/shoelace/assets/icons/skype.svg +3 -0
- package/shoelace/assets/icons/slash-lg.svg +3 -0
- package/shoelace/assets/icons/snapchat.svg +3 -0
- package/shoelace/assets/icons/spotify.svg +3 -0
- package/shoelace/assets/icons/stack-overflow.svg +4 -0
- package/shoelace/assets/icons/steam.svg +4 -0
- package/shoelace/assets/icons/strava.svg +3 -0
- package/shoelace/assets/icons/terminal-dash.svg +4 -0
- package/shoelace/assets/icons/terminal-plus.svg +4 -0
- package/shoelace/assets/icons/terminal-split.svg +4 -0
- package/shoelace/assets/icons/terminal-x.svg +4 -0
- package/shoelace/assets/icons/thunderbolt-fill.svg +3 -0
- package/shoelace/assets/icons/thunderbolt.svg +4 -0
- package/shoelace/assets/icons/ticket-detailed-fill.svg +3 -0
- package/shoelace/assets/icons/ticket-detailed.svg +4 -0
- package/shoelace/assets/icons/ticket-fill.svg +3 -0
- package/shoelace/assets/icons/ticket-perforated-fill.svg +3 -0
- package/shoelace/assets/icons/ticket-perforated.svg +4 -0
- package/shoelace/assets/icons/ticket.svg +3 -0
- package/shoelace/assets/icons/tiktok.svg +3 -0
- package/shoelace/assets/icons/translate.svg +4 -0
- package/shoelace/assets/icons/usb-c-fill.svg +3 -0
- package/shoelace/assets/icons/usb-c.svg +4 -0
- package/shoelace/assets/icons/usb-drive-fill.svg +3 -0
- package/shoelace/assets/icons/usb-drive.svg +3 -0
- package/shoelace/assets/icons/usb-fill.svg +3 -0
- package/shoelace/assets/icons/usb-micro-fill.svg +3 -0
- package/shoelace/assets/icons/usb-micro.svg +4 -0
- package/shoelace/assets/icons/usb-mini-fill.svg +3 -0
- package/shoelace/assets/icons/usb-mini.svg +4 -0
- package/shoelace/assets/icons/usb-plug-fill.svg +3 -0
- package/shoelace/assets/icons/usb-plug.svg +3 -0
- package/shoelace/assets/icons/usb-symbol.svg +3 -0
- package/shoelace/assets/icons/usb.svg +4 -0
- package/shoelace/assets/icons/vimeo.svg +3 -0
- package/shoelace/assets/icons/webcam-fill.svg +4 -0
- package/shoelace/assets/icons/webcam.svg +4 -0
- package/shoelace/assets/icons/window-dash.svg +5 -0
- package/shoelace/assets/icons/window-desktop.svg +4 -0
- package/shoelace/assets/icons/window-fullscreen.svg +4 -0
- package/shoelace/assets/icons/window-plus.svg +5 -0
- package/shoelace/assets/icons/window-split.svg +4 -0
- package/shoelace/assets/icons/window-stack.svg +4 -0
- package/shoelace/assets/icons/window-x.svg +5 -0
- package/shoelace/assets/icons/windows.svg +3 -0
- package/shoelace/assets/icons/wordpress.svg +5 -0
- package/shoelace/assets/icons/x-lg.svg +4 -0
- package/shoelace/assets/icons/xbox.svg +3 -0
- package/shoelace/assets/icons/yin-yang.svg +4 -0
- package/shoelace/themes/themes/dark.styles.d.ts +2 -0
- package/shoelace/themes/themes/dark.styles.js +531 -0
- package/shoelace/themes/themes/light.css +439 -0
- package/shoelace/themes/themes/light.styles.d.ts +2 -0
- package/shoelace/themes/themes/light.styles.js +531 -0
- package/dist/esm-es5/GenericTableView-6b7b537b.js +0 -1
- package/dist/esm-es5/ShadowViewAddon-9c382e30.js +0 -1
- package/dist/mint-components/p-1b71a09e.system.entry.js +0 -1
- package/dist/mint-components/p-3f88f8eb.system.js +0 -1
- package/dist/mint-components/p-45581e0b.entry.js +0 -9
- package/dist/mint-components/p-48161ba8.js +0 -1
- package/dist/mint-components/p-546ee840.entry.js +0 -1
- package/dist/mint-components/p-ac303785.system.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as e,r as t,c as a}from"./p-64c3217a.js";import{u as r,e as s,m as l,i}from"./p-27455c4c.js";import{i as n}from"./p-55b6147d.js";import"./p-982ad256.js";import{d as o,i as d,M as c,A as u,a as m,j as p}from"./p-b83ee009.js";import"./p-81f34787.js";import{c as h}from"./p-c1086930.js";import"./p-26f627aa.js";import{c as v}from"./p-373fa002.js";import{G as E}from"./p-
|
|
1
|
+
import{h as e,r as t,c as a}from"./p-64c3217a.js";import{u as r,e as s,m as l,i}from"./p-27455c4c.js";import{i as n}from"./p-55b6147d.js";import"./p-982ad256.js";import{d as o,i as d,M as c,A as u,a as m,j as p}from"./p-b83ee009.js";import"./p-81f34787.js";import{c as h}from"./p-c1086930.js";import"./p-26f627aa.js";import{c as v}from"./p-373fa002.js";import{G as E}from"./p-b74de10f.js";import{u as y,a as f}from"./p-62db6962.js";import{u as g}from"./p-a95844a2.js";import{l as w}from"./p-7794c289.js";import{g as b}from"./p-7e955ed7.js";import{l as R}from"./p-4e05c65a.js";const x=["POINT","TICKET","GIFT"],A=["Points","Tickets","Gifts"],D=["AVAILABLE","PENDING","CANCELLED","EXPIRED","REDEEMED"],N=["US_TAX","SCHEDULED","UNHANDLED_ERROR"],T=o.gql`
|
|
2
2
|
query getRewards(
|
|
3
3
|
$limit: Int!
|
|
4
4
|
$offset: Int!
|
|
@@ -90,4 +90,4 @@ import{h as e,r as t,c as a}from"./p-64c3217a.js";import{u as r,e as s,m as l,i}
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
`;async function L(t,a){const r=t.tagName.toLowerCase();let s;await customElements.whenDefined(r);try{s=a()}catch(t){return console.error("label promise failed",t),e("span",null)}try{return await s}catch(t){console.error("Error rendering label",t);const a=b(t);return e("details",null,e("summary",null,"Error"),a)}}const C=class{constructor(e){t(this,e),this.perPage=4,this.showLabels=!0,this.prevLabel="Prev",this.moreLabel="Next",this.hiddenColumns="0",this.smBreakpoint=599,this.mdBreakpoint=899,l(this)}disconnectedCallback(){}render(){const t=e(_,null),a=e(I,null),{states:l,data:n,callbacks:o,elements:v}=p()?function(e,t,a){const[l,n]=r(((e,t)=>({...e,...t})),{columns:[],rows:[],loading:!1,page:0}),o=y(),{data:d}=i((()=>((e=4)=>({data:[...Array(e)].map((()=>(()=>{let e,t,a,r,s=!1,l=0;const i=w.DateTime.now(),n=Math.floor(3*Math.random()),o=D[Math.floor(5*Math.random())],d=x[n],c=A[n],u=Math.floor(100*Math.random())+2;if("AVAILABLE"===o)l=Math.floor(Math.random()*u),r=Math.floor(10*Math.random())<3?i.plus({days:7}).toMillis():null;else if("EXPIRED"===o)s=!0,l=Math.floor(Math.random()*u),r=i.minus({days:1}).toMillis();else if("PENDING"===o){const a=N[Math.floor(3*Math.random())];e=[a],"SCHEDULED"===a&&(t=i.plus({days:6}).toMillis())}else"REDEEMED"===o?s=!0:(s=!0,a=i.minus({days:2}).toMillis());const m=Math.floor(3*Math.random());return{id:"61f7878e096c9265de88b46f",type:"CREDIT",value:u,unit:d,name:null,dateGiven:i.minus({days:3}).toMillis(),dateExpires:r,dateCancelled:a,dateRedeemed:"REDEEMED"===o?i.plus({days:2}).toMillis():null,dateScheduledFor:t,fuelTankCode:null,fuelTankType:null,currency:null,prettyValue:`${u} ${c}`,prettyValueNumber:`${u}`,prettyAvailableNumber:s?"0":""+(u-l),prettyRedeemedNumber:s&&!l?"0":`${l}`,programId:1===m?"program-id":null,program:{name:"My Program"},statuses:[o],pendingReasons:e,globalRewardKey:null,programRewardKey:null,rewardSource:1===m?"AUTOMATED":"MANUAL",prettyRedeemedCredit:`${l} ${c}`,prettyAssignedCredit:`${u} ${c}`,prettyAvailableValue:s?`0 ${c}`:`${u-l} ${c}`,exchangedRewardRedemptionTransaction:2===m?{id:"61f7878e096c9265de88b414",creditRedeemed:50,prettyRedeemedCredit:"50 Tokens",unit:"TOKEN",dateRedeemed:1643612046258}:null,referral:null,rewardRedemptionTransactions:{data:[]}}})()))}))(e.perPage)),[e.perPage]),c=g();return s((()=>{n({loading:!0}),d&&async function(t){let a=d;a=d.slice(0,e.perPage);const r=t.filter((e=>"loading"!==e.slot&&"empty"!==e.slot)),s=null==r?void 0:r.map((async e=>L(e,(()=>e.renderLabel())))),l=null==a?void 0:a.map((async e=>{const t=null==r?void 0:r.map((async t=>L(t,(()=>t.renderCell([e],void 0)))));return await Promise.all(t)})),i=l&&(await Promise.all(l)).filter((e=>e));n({rows:i});const o=s&&await Promise.all(s);n({columns:o,loading:!1,page:0})}(c)}),[d,c,o]),h({states:{hasPrev:!1,hasNext:!1,loading:!1,show:"rows"},callbacks:{prevPage:()=>console.log("Prev"),nextPage:()=>console.log("Next")},data:{textOverrides:{showLabels:e.showLabels,prevLabel:e.prevLabel,moreLabel:e.moreLabel},referralData:[]},elements:{columns:l.columns,rows:l.rows,emptyElement:t,loadingElement:a}},e.demoData||{},{arrayMerge:(e,t)=>t})}(this,t,a):function(e,t,a){var l,i;const n=d(),o=c(),p=u(),h=null!==(l=e.programId)&&void 0!==l?l:o,v={userId_eq:null==n?void 0:n.id,accountId_eq:null==n?void 0:n.accountId,...h?"classic"===h?{programId_exists:!1}:{programId_eq:h}:{}},[E,f]=r(((e,t)=>({...e,...t})),{columns:[],rows:[],loading:!1,page:0}),{envelope:w,states:b,callbacks:R}=m(T,(e=>{var t;return null===(t=null==e?void 0:e.viewer)||void 0===t?void 0:t.rewards}),{limit:e.perPage,offset:0},{rewardFilter:v,locale:p},!(null==n?void 0:n.jwt)),x=y(),A=g(),D=null==w?void 0:w.data;s((()=>{f({loading:!0}),w&&async function(e){const t=e.filter((e=>"loading"!==e.slot&&"empty"!==e.slot)),a=null==t?void 0:t.map((async e=>L(e,(()=>e.renderLabel())))),r=null==D?void 0:D.map((async e=>{const a=null==t?void 0:t.map((async t=>L(t,(()=>t.renderCell([e],p)))));return await Promise.all(a)})),s=r&&(await Promise.all(r)).filter((e=>e));f({rows:s});const l=a&&await Promise.all(a);f({columns:l,loading:!1,page:b.currentPage})}(A)}),[w,A,x]);const N=!(null===(i=null==E?void 0:E.rows)||void 0===i?void 0:i.length)&&!(null==D?void 0:D.length);return{states:{hasNext:b.currentPage<b.pageCount-1,hasPrev:b.currentPage>0,show:b.loading||E.loading?"loading":N?"empty":"rows",namespace:"sqm-rewards-table"},data:{textOverrides:{showLabels:e.showLabels,prevLabel:e.prevLabel,moreLabel:e.moreLabel},hiddenColumns:e.hiddenColumns,smBreakpoint:e.smBreakpoint,mdBreakpoint:e.mdBreakpoint},elements:{columns:E.columns,rows:E.rows,emptyElement:t,loadingElement:a},callbacks:{nextPage:()=>{R.setCurrentPage(b.currentPage+1)},prevPage:()=>{R.setCurrentPage(b.currentPage-1)}}}}(this,t,a);return f([this.perPage]),e(E,{states:l,data:n,callbacks:o,elements:v})}};function _(){return e("slot",{name:"empty"},e("sqm-empty",{"empty-state-image":"https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_reward2.png","empty-state-header":"View your rewards","empty-state-text":"See all the rewards you have earned from referring friends and completing tasks"}))}function I(){return e("slot",{name:"loading"},e(M,null),e(M,null),e(M,null),e(M,null))}function M(){return e("sqm-table-row",null,e("sqm-table-cell",{colspan:5},e("sl-skeleton",null)))}const S=class{constructor(e){t(this,e),this.ignored=!0,this.locale="en",l(this)}disconnectedCallback(){}render(){var e,t;return this.date?null===(t=null===(e=w.DateTime.fromMillis(this.date))||void 0===e?void 0:e.setLocale(R(this.locale)))||void 0===t?void 0:t.toLocaleString(w.DateTime.DATE_MED):"-"}},P=class{constructor(e){t(this,e),this.columnTitle="Date received",this.dateShown="dateGiven",l(this)}disconnectedCallback(){}async renderCell(t,a){return e("sqm-rewards-table-date-cell",{date:(null==t?void 0:t[0])[this.dateShown],locale:a})}async renderLabel(){return this.columnTitle}render(){return f([this.dateShown,this.columnTitle]),e(a,{style:{display:"none"}})}},k=class{constructor(e){t(this,e)}render(){n.locale=this.locale;const t=v({DetailsContainer:{width:"100%",display:"flex","align-items":"center","justify-content":"space-between","margin-right":"var(--sl-spacing-small)","flex-wrap":"wrap"},Details:{"padding-bottom":"var(--sl-spacing-small)","max-width":"500px","padding-right":"var(--sl-spacing-x-small)","&::part(header)":{padding:"var(--sl-spacing-x-small)",cursor:"default"},"&::part(content)":{padding:"var(--sl-spacing-x-small) var(--sl-spacing-medium)"},"&::part(base)":{opacity:"1"},"&::part(summary-icon)":{display:"flex"}},BadgeContainer:{"& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}},BoldText:{"font-weight":"var(--sl-font-weight-semibold)"},StatusBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line"}},Fueltank:{"& .code":{display:"flex",cursor:"pointer",userSelect:"none",color:"var(--sl-color-neutral-500)","&:hover":{color:"var(--sl-color-sky-500)"}},"& .text":{maxWidth:"90%",overflow:"hidden",textOverflow:"ellipsis",color:"inherit",fontSize:"var(--sl-font-size-small)",fontWeight:"var(--sl-font-weight-bold)"},"& .icon":{position:"relative",top:"1px",marginLeft:"var(--sl-spacing-x-small)",color:"inherit"}}}),a=t.toString();return e("div",{style:{display:"contents"}},e("style",{type:"text/css"},a),e((({reward:a})=>{var r;const s="CENTS"===a.unit?a.prettyValue.replace(/USD/gi,"$"):null!==(r=a.prettyValue)&&void 0!==r?r:"-",l="1"===a.prettyValueNumber||a.dateRedeemed&&"0"===a.prettyAvailableNumber;if("FUELTANK"===a.type)return e("div",{class:t.classes.Fueltank},a.prettyValue,e("div",{class:"code",onClick:()=>navigator.clipboard.writeText(a.fuelTankCode)},e("sl-tooltip",{trigger:"click",placement:"top",distance:5,skidding:11,content:this.copyText,"onSl-show":e=>setTimeout((()=>e.path[0].hide()),1e3)},e("span",{class:"text"},a.fuelTankCode),e("span",{class:"icon"},e("sl-icon",{name:"files"})))));if("CREDIT"===a.type&&!l){const t=Math.round((parseFloat(a.prettyValueNumber)-parseFloat(a.prettyRedeemedNumber))/parseFloat(a.prettyValueNumber)*100),r=a.statuses.includes("EXPIRED")||a.statuses.includes("CANCELLED")?e("div",null,n.formatMessage({id:"redeemedText",defaultMessage:this.redeemedText},{redeemedAmount:a.prettyRedeemedCredit})):e("div",null,n.formatMessage({id:"availableText",defaultMessage:this.availableText},{availableAmount:a.prettyAvailableValue})),l=v({Progress:{height:"3px",width:"100%",margin:"var(--sl-spacing-xx-small) 0",background:"var(--sl-color-neutral-200)","&:after":{content:'""',display:"block",background:"var(--sl-color-primary-300)",borderRadius:"100px",width:`${t}%`,height:"100%"}},Container:{display:"inline-block",verticalAlign:"top",width:"130px",whiteSpace:"break",overflow:"hidden",textOverflow:"ellipsis"},Text:{fontSize:"var(--sl-font-size-medium)",color:"var(--sl-color-gray-800)"},Subtext:{fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)"}}),i=l.toString();return e("div",null,e("style",{type:"text/css"},i),e("div",{class:l.classes.Container},e("span",null,s+" "),e("br",null)," ",e("div",{class:l.classes.Progress}),e("span",{class:l.classes.Subtext},r)))}return e("div",null,s)}),{reward:this.reward}))}},$=class{constructor(e){t(this,e),this.columnTitle="Reward",this.redeemedText="{redeemedAmount} redeemed",this.availableText="{availableAmount} remaining",this.fueltankText="Your code:",this.copyText="Copied!",l(this)}disconnectedCallback(){}async renderCell(t,a){return e("sqm-rewards-table-reward-cell",{reward:null==t?void 0:t[0],redeemedText:this.redeemedText,availableText:this.availableText,fueltankText:this.fueltankText,locale:a})}async renderLabel(){return this.columnTitle}render(){return f([this.columnTitle]),e(a,{style:{display:"none"}})}},U=class{constructor(e){t(this,e),this.locale="en"}render(){n.locale=this.locale;const t=({reward:t})=>{var a;return e("span",null,n.formatMessage({id:"rewardSourceText",defaultMessage:this.rewardSourceText},{rewardSource:t.rewardSource,programName:null===(a=null==t?void 0:t.program)||void 0===a?void 0:a.name}))},a=({reward:t})=>{var a;const r=e("div",null,e("span",{style:{fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)"}},this.rewardExchangeText),e("br",null),null===(a=t.exchangedRewardRedemptionTransaction)||void 0===a?void 0:a.prettyRedeemedCredit," → ",t.prettyValue);return t.exchangedRewardRedemptionTransaction.prettyRedeemedCredit.length+t.prettyValue.length<21?r:e("div",{style:{display:"inline-block",verticalAlign:"top"}},r)},r=e=>e?e.firstName||e.lastName?e.firstName?e.lastName?`${e.firstName} ${e.lastName}`:`${e.firstName}`:`${e.lastName}`:this.anonymousUserText:this.deletedUserText;return e((()=>"FRIEND_SIGNUP"===this.reward.rewardSource||"REFERRED"===this.reward.rewardSource?e("div",null,e("div",{style:{fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)"}},n.formatMessage({id:"referralText",defaultMessage:this.referralText},{rewardSource:this.reward.rewardSource})),e("div",null,r("FRIEND_SIGNUP"==this.reward.rewardSource?this.reward.referral.referredUser:this.reward.referral.referrerUser))):e(this.reward.exchangedRewardRedemptionTransaction?a:t,{reward:this.reward})),null)}},q=class{constructor(e){t(this,e),this.columnTitle="Source",this.anonymousUser="Anonymous User",this.deletedUser="Deleted User",this.rewardExchangeText="Reward Exchange",this.referralText="{rewardSource, select, FRIEND_SIGNUP {Referral to} REFERRED {Referred by} other {}}",this.rewardSourceText="{rewardSource, select, MANUAL {Manual} AUTOMATED {{programName}} other {}}",l(this)}disconnectedCallback(){}async renderCell(t,a){return e("sqm-rewards-table-source-cell",{reward:null==t?void 0:t[0],anonymousUserText:this.anonymousUser,deletedUserText:this.deletedUser,rewardExchangeText:this.rewardExchangeText,referralText:this.referralText,rewardSourceText:this.rewardSourceText,locale:a})}async renderLabel(){return this.columnTitle}render(){return f([this.deletedUser,this.anonymousUser,this.columnTitle]),e(a,{style:{display:"none"}})}},F=class{constructor(e){t(this,e),this.expiryText="Expires",this.locale="en",this.pendingUsTax="W-9 required",this.pendingScheduled="Until",this.pendingUnhandled="Fulfillment error"}rewardStatus(e){if(e.dateCancelled)return"CANCELLED";if(e.statuses&&e.statuses.includes("EXPIRED"))return"EXPIRED";if(e.statuses&&e.statuses.includes("PENDING"))return"PENDING";if("CREDIT"===e.type)return e.statuses.includes("REDEEMED")?"REDEEMED":"AVAILABLE";if("PCT_DISCOUNT"===e.type&&e.statuses.includes("AVAILABLE"))return"AVAILABLE";if("INTEGRATION"===e.type||"FUELTANK"===e.type){if(e.statuses&&e.statuses.includes("PENDING"))return"PENDING";if(e.statuses&&e.statuses.includes("CANCELLED"))return"CANCELLED";if(e.statuses.includes("AVAILABLE"))return"AVAILABLE"}return""}render(){var t;n.locale=this.locale;const a=v({Badge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",paddingLeft:"10px",whiteSpace:"pre-line"}},RedeemBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",background:"var(--sl-color-blue-600)"}},Date:{fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)",margin:"0"}}),r=a.toString(),s=this.rewardStatus(this.reward),l=n.formatMessage({id:"statusMessage",defaultMessage:this.statusText},{status:s}),i="AVAILABLE"===s?"success":"REDEEMED"===s?"primary":"PENDING"===s?"warning":"danger",o=this.reward.dateCancelled||this.reward.dateExpires||this.reward.dateRedeemed||"",d=o&&`${"AVAILABLE"===s&&this.reward.dateExpires?this.expiryText+" ":""}${null===(t=w.DateTime.fromMillis(o))||void 0===t?void 0:t.setLocale(R(R(this.locale))).toLocaleString(w.DateTime.DATE_MED)}`,c="PENDING"===s?function(e){var t;const a={US_TAX:e.pendingUsTax,SCHEDULED:e.reward.dateScheduledFor&&e.pendingScheduled+" "+(null===(t=w.DateTime.fromMillis(e.reward.dateScheduledFor))||void 0===t?void 0:t.setLocale(R(R(e.locale||"en"))).toLocaleString(w.DateTime.DATE_MED)),UNHANDLED_ERROR:e.pendingUnhandled};return[e.reward.pendingReasons].map((e=>{var t;return null!==(t=a[e])&&void 0!==t?t:e})).join(", ")}(this):null;return e("div",{style:{display:"contents"}},e("style",{type:"text/css"},r),e("sl-badge",{type:i,pill:!0,class:"REDEEMED"===s?a.classes.RedeemBadge:a.classes.Badge},l),e("p",{class:a.classes.Date},c||d))}},B=class{constructor(e){t(this,e),this.columnTitle="Status",this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }",this.expiryText="Expires on ",l(this)}disconnectedCallback(){}async renderCell(t,a){return e("sqm-rewards-table-status-cell",{statusText:this.statusText,reward:null==t?void 0:t[0],expiryText:this.expiryText,locale:a})}async renderLabel(){return this.columnTitle}render(){return f([this.columnTitle]),e(a,{style:{display:"none"}})}};export{C as sqm_rewards_table,S as sqm_rewards_table_date_cell,P as sqm_rewards_table_date_column,k as sqm_rewards_table_reward_cell,$ as sqm_rewards_table_reward_column,U as sqm_rewards_table_source_cell,q as sqm_rewards_table_source_column,F as sqm_rewards_table_status_cell,B as sqm_rewards_table_status_column}
|
|
93
|
+
`;async function L(t,a){const r=t.tagName.toLowerCase();let s;await customElements.whenDefined(r);try{s=a()}catch(t){return console.error("label promise failed",t),e("span",null)}try{return await s}catch(t){console.error("Error rendering label",t);const a=b(t);return e("details",null,e("summary",null,"Error"),a)}}const C=class{constructor(e){t(this,e),this.perPage=4,this.showLabels=!0,this.prevLabel="Prev",this.moreLabel="Next",this.hiddenColumns="0",this.smBreakpoint=599,this.mdBreakpoint=899,l(this)}disconnectedCallback(){}render(){const t=e(I,null),a=e(_,null),{states:l,data:n,callbacks:o,elements:v}=p()?function(e,t,a){const[l,n]=r(((e,t)=>({...e,...t})),{columns:[],rows:[],loading:!1,page:0}),o=y(),{data:d}=i((()=>((e=4)=>({data:[...Array(e)].map((()=>(()=>{let e,t,a,r,s=!1,l=0;const i=w.DateTime.now(),n=Math.floor(3*Math.random()),o=D[Math.floor(5*Math.random())],d=x[n],c=A[n],u=Math.floor(100*Math.random())+2;if("AVAILABLE"===o)l=Math.floor(Math.random()*u),r=Math.floor(10*Math.random())<3?i.plus({days:7}).toMillis():null;else if("EXPIRED"===o)s=!0,l=Math.floor(Math.random()*u),r=i.minus({days:1}).toMillis();else if("PENDING"===o){const a=N[Math.floor(3*Math.random())];e=[a],"SCHEDULED"===a&&(t=i.plus({days:6}).toMillis())}else"REDEEMED"===o?s=!0:(s=!0,a=i.minus({days:2}).toMillis());const m=Math.floor(3*Math.random());return{id:"61f7878e096c9265de88b46f",type:"CREDIT",value:u,unit:d,name:null,dateGiven:i.minus({days:3}).toMillis(),dateExpires:r,dateCancelled:a,dateRedeemed:"REDEEMED"===o?i.plus({days:2}).toMillis():null,dateScheduledFor:t,fuelTankCode:null,fuelTankType:null,currency:null,prettyValue:`${u} ${c}`,prettyValueNumber:`${u}`,prettyAvailableNumber:s?"0":""+(u-l),prettyRedeemedNumber:s&&!l?"0":`${l}`,programId:1===m?"program-id":null,program:{name:"My Program"},statuses:[o],pendingReasons:e,globalRewardKey:null,programRewardKey:null,rewardSource:1===m?"AUTOMATED":"MANUAL",prettyRedeemedCredit:`${l} ${c}`,prettyAssignedCredit:`${u} ${c}`,prettyAvailableValue:s?`0 ${c}`:`${u-l} ${c}`,exchangedRewardRedemptionTransaction:2===m?{id:"61f7878e096c9265de88b414",creditRedeemed:50,prettyRedeemedCredit:"50 Tokens",unit:"TOKEN",dateRedeemed:1643612046258}:null,referral:null,rewardRedemptionTransactions:{data:[]}}})()))}))(e.perPage)),[e.perPage]),c=g();return s((()=>{n({loading:!0}),d&&async function(t){let a=d;a=d.slice(0,e.perPage);const r=t.filter((e=>"loading"!==e.slot&&"empty"!==e.slot)),s=null==r?void 0:r.map((async e=>L(e,(()=>e.renderLabel())))),l=null==a?void 0:a.map((async e=>{const t=null==r?void 0:r.map((async t=>L(t,(()=>t.renderCell([e],void 0)))));return await Promise.all(t)})),i=l&&(await Promise.all(l)).filter((e=>e));n({rows:i});const o=s&&await Promise.all(s);n({columns:o,loading:!1,page:0})}(c)}),[d,c,o]),h({states:{hasPrev:!1,hasNext:!1,loading:!1,show:"rows"},callbacks:{prevPage:()=>console.log("Prev"),nextPage:()=>console.log("Next")},data:{textOverrides:{showLabels:e.showLabels,prevLabel:e.prevLabel,moreLabel:e.moreLabel},referralData:[]},elements:{columns:l.columns,rows:l.rows,emptyElement:t,loadingElement:a}},e.demoData||{},{arrayMerge:(e,t)=>t})}(this,t,a):function(e,t,a){var l,i;const n=d(),o=c(),p=u(),h=null!==(l=e.programId)&&void 0!==l?l:o,v={userId_eq:null==n?void 0:n.id,accountId_eq:null==n?void 0:n.accountId,...h?"classic"===h?{programId_exists:!1}:{programId_eq:h}:{}},[E,f]=r(((e,t)=>({...e,...t})),{columns:[],rows:[],loading:!1,page:0}),{envelope:w,states:b,callbacks:R}=m(T,(e=>{var t;return null===(t=null==e?void 0:e.viewer)||void 0===t?void 0:t.rewards}),{limit:e.perPage,offset:0},{rewardFilter:v,locale:p},!(null==n?void 0:n.jwt)),x=y(),A=g(),D=null==w?void 0:w.data;s((()=>{f({loading:!0}),w&&async function(e){const t=e.filter((e=>"loading"!==e.slot&&"empty"!==e.slot)),a=null==t?void 0:t.map((async e=>L(e,(()=>e.renderLabel())))),r=null==D?void 0:D.map((async e=>{const a=null==t?void 0:t.map((async t=>L(t,(()=>t.renderCell([e],p)))));return await Promise.all(a)})),s=r&&(await Promise.all(r)).filter((e=>e));f({rows:s});const l=a&&await Promise.all(a);f({columns:l,loading:!1,page:b.currentPage})}(A)}),[w,A,x]);const N=!(null===(i=null==E?void 0:E.rows)||void 0===i?void 0:i.length)&&!(null==D?void 0:D.length);return{states:{hasNext:b.currentPage<b.pageCount-1,hasPrev:b.currentPage>0,show:b.loading||E.loading?"loading":N?"empty":"rows",namespace:"sqm-rewards-table"},data:{textOverrides:{showLabels:e.showLabels,prevLabel:e.prevLabel,moreLabel:e.moreLabel},hiddenColumns:e.hiddenColumns,smBreakpoint:e.smBreakpoint,mdBreakpoint:e.mdBreakpoint},elements:{columns:E.columns,rows:E.rows,emptyElement:t,loadingElement:a},callbacks:{nextPage:()=>{R.setCurrentPage(b.currentPage+1)},prevPage:()=>{R.setCurrentPage(b.currentPage-1)}}}}(this,t,a);return f([this.perPage]),e(E,{states:l,data:n,callbacks:o,elements:v})}};function I(){return e("slot",{name:"empty"},e("sqm-empty",{"empty-state-image":"https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_reward2.png","empty-state-header":"View your rewards","empty-state-text":"See all the rewards you have earned from referring friends and completing tasks"}))}function _(){return e("slot",{name:"loading"},e(M,null),e(M,null),e(M,null),e(M,null))}function M(){return e("sqm-table-row",null,e("sqm-table-cell",{colspan:5},e("sl-skeleton",null)))}const S=class{constructor(e){t(this,e),this.ignored=!0,this.locale="en",l(this)}disconnectedCallback(){}render(){var e,t;return this.date?null===(t=null===(e=w.DateTime.fromMillis(this.date))||void 0===e?void 0:e.setLocale(R(this.locale)))||void 0===t?void 0:t.toLocaleString(w.DateTime.DATE_MED):"-"}},P=class{constructor(e){t(this,e),this.columnTitle="Date received",this.dateShown="dateGiven",l(this)}disconnectedCallback(){}async renderCell(t,a){return e("sqm-rewards-table-date-cell",{date:(null==t?void 0:t[0])[this.dateShown],locale:a})}async renderLabel(){return this.columnTitle}render(){return f([this.dateShown,this.columnTitle]),e(a,{style:{display:"none"}})}},$=class{constructor(e){t(this,e)}render(){n.locale=this.locale;const t=v({DetailsContainer:{width:"100%",display:"flex","align-items":"center","justify-content":"space-between","margin-right":"var(--sl-spacing-small)","flex-wrap":"wrap"},Details:{"padding-bottom":"var(--sl-spacing-small)","max-width":"500px","padding-right":"var(--sl-spacing-x-small)","&::part(header)":{padding:"var(--sl-spacing-x-small)",cursor:"default"},"&::part(content)":{padding:"var(--sl-spacing-x-small) var(--sl-spacing-medium)"},"&::part(base)":{opacity:"1"},"&::part(summary-icon)":{display:"flex"}},BadgeContainer:{"& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}},BoldText:{"font-weight":"var(--sl-font-weight-semibold)"},StatusBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line"}},Fueltank:{"& .code":{display:"flex",cursor:"pointer",userSelect:"none",color:"var(--sl-color-neutral-500)","&:hover":{color:"var(--sl-color-sky-500)"}},"& .text":{maxWidth:"90%",overflow:"hidden",textOverflow:"ellipsis",color:"inherit",fontSize:"var(--sl-font-size-small)",fontWeight:"var(--sl-font-weight-bold)"},"& .icon":{position:"relative",top:"1px",marginLeft:"var(--sl-spacing-x-small)",color:"inherit"}}}),a=t.toString();return e("div",{style:{display:"contents"}},e("style",{type:"text/css"},a),e((({reward:a})=>{var r;const s="CENTS"===a.unit?a.prettyValue.replace(/USD/gi,"$"):null!==(r=a.prettyValue)&&void 0!==r?r:"-",l="1"===a.prettyValueNumber||a.dateRedeemed&&"0"===a.prettyAvailableNumber;if("FUELTANK"===a.type)return e("div",{class:t.classes.Fueltank},a.prettyValue,a.fuelTankCode&&e("div",{class:"code",onClick:()=>navigator.clipboard.writeText(a.fuelTankCode)},e("sl-tooltip",{trigger:"click",placement:"top",distance:5,skidding:11,content:this.copyText,"onSl-show":e=>setTimeout((()=>e.path[0].hide()),1e3)},e("span",{class:"text"},a.fuelTankCode),e("span",{class:"icon"},e("sl-icon",{name:"files"})))));if("CREDIT"===a.type&&!l){const t=parseFloat(a.prettyValueNumber)-parseFloat(a.prettyRedeemedNumber),r=Math.round(t/parseFloat(a.prettyValueNumber)*100),l=a.statuses.includes("EXPIRED")||a.statuses.includes("CANCELLED")?e("div",null,n.formatMessage({id:"redeemedText",defaultMessage:this.redeemedText},{redeemedAmount:a.prettyRedeemedCredit})):e("div",null,n.formatMessage({id:"availableText",defaultMessage:this.availableText},{availableAmount:a.statuses.includes("PENDING")?a.prettyAssignedCredit:a.prettyAvailableValue})),i=v({Progress:{height:"3px",width:"100%",margin:"var(--sl-spacing-xx-small) 0",background:"var(--sl-color-neutral-200)","&:after":{content:'""',display:"block",background:"var(--sl-color-primary-300)",borderRadius:"100px",width:`${r}%`,height:"100%"}},Container:{display:"inline-block",verticalAlign:"top",width:"130px",whiteSpace:"break",overflow:"hidden",textOverflow:"ellipsis"},Text:{fontSize:"var(--sl-font-size-medium)",color:"var(--sl-color-gray-800)"},Subtext:{fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)"}}),o=i.toString();return e("div",null,e("style",{type:"text/css"},o),e("div",{class:i.classes.Container},e("span",null,s+" "),e("br",null)," ",e("div",{class:i.classes.Progress}),e("span",{class:i.classes.Subtext},l)))}return e("div",null,s)}),{reward:this.reward}))}},k=class{constructor(e){t(this,e),this.columnTitle="Reward",this.redeemedText="{redeemedAmount} redeemed",this.availableText="{availableAmount} remaining",this.copyText="Copied!",l(this)}disconnectedCallback(){}async renderCell(t,a){return e("sqm-rewards-table-reward-cell",{reward:null==t?void 0:t[0],redeemedText:this.redeemedText,availableText:this.availableText,copyText:this.copyText,locale:a})}async renderLabel(){return this.columnTitle}render(){return f([this.columnTitle]),e(a,{style:{display:"none"}})}},U=class{constructor(e){t(this,e),this.locale="en"}render(){n.locale=this.locale;const t=({reward:t})=>{var a;return e("span",null,n.formatMessage({id:"rewardSourceText",defaultMessage:this.rewardSourceText},{rewardSource:t.rewardSource,programName:null===(a=null==t?void 0:t.program)||void 0===a?void 0:a.name}))},a=({reward:t})=>{var a;const r=e("div",null,e("span",{style:{fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)"}},this.rewardExchangeText),e("br",null),null===(a=t.exchangedRewardRedemptionTransaction)||void 0===a?void 0:a.prettyRedeemedCredit," → ",t.prettyValue);return t.exchangedRewardRedemptionTransaction.prettyRedeemedCredit.length+t.prettyValue.length<21?r:e("div",{style:{display:"inline-block",verticalAlign:"top"}},r)},r=e=>e?e.firstName||e.lastName?e.firstName?e.lastName?`${e.firstName} ${e.lastName}`:`${e.firstName}`:`${e.lastName}`:this.anonymousUserText:this.deletedUserText;return e((()=>"FRIEND_SIGNUP"===this.reward.rewardSource||"REFERRED"===this.reward.rewardSource?e("div",null,e("div",{style:{fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)"}},n.formatMessage({id:"referralText",defaultMessage:this.referralText},{rewardSource:this.reward.rewardSource})),e("div",null,r("FRIEND_SIGNUP"==this.reward.rewardSource?this.reward.referral.referredUser:this.reward.referral.referrerUser))):e(this.reward.exchangedRewardRedemptionTransaction?a:t,{reward:this.reward})),null)}},q=class{constructor(e){t(this,e),this.columnTitle="Source",this.anonymousUser="Anonymous User",this.deletedUser="Deleted User",this.rewardExchangeText="Reward Exchange",this.referralText="{rewardSource, select, FRIEND_SIGNUP {Referral to} REFERRED {Referred by} other {}}",this.rewardSourceText="{rewardSource, select, MANUAL {Manual} AUTOMATED {{programName}} other {}}",l(this)}disconnectedCallback(){}async renderCell(t,a){return e("sqm-rewards-table-source-cell",{reward:null==t?void 0:t[0],anonymousUserText:this.anonymousUser,deletedUserText:this.deletedUser,rewardExchangeText:this.rewardExchangeText,referralText:this.referralText,rewardSourceText:this.rewardSourceText,locale:a})}async renderLabel(){return this.columnTitle}render(){return f([this.deletedUser,this.anonymousUser,this.columnTitle]),e(a,{style:{display:"none"}})}},F=class{constructor(e){t(this,e),this.expiryText="Expires",this.locale="en",this.pendingUsTax="W-9 required",this.pendingScheduled="Until",this.pendingUnhandled="Fulfillment error"}rewardStatus(e){if(e.dateCancelled)return"CANCELLED";if(e.statuses&&e.statuses.includes("EXPIRED"))return"EXPIRED";if(e.statuses&&e.statuses.includes("PENDING"))return"PENDING";if("CREDIT"===e.type)return e.statuses.includes("REDEEMED")?"REDEEMED":"AVAILABLE";if("PCT_DISCOUNT"===e.type&&e.statuses.includes("AVAILABLE"))return"AVAILABLE";if("INTEGRATION"===e.type||"FUELTANK"===e.type){if(e.statuses&&e.statuses.includes("PENDING"))return"PENDING";if(e.statuses&&e.statuses.includes("CANCELLED"))return"CANCELLED";if(e.statuses.includes("AVAILABLE"))return"AVAILABLE"}return""}render(){var t;n.locale=this.locale;const a=v({Badge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",paddingLeft:"10px",whiteSpace:"pre-line"}},RedeemBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",background:"var(--sl-color-blue-600)"}},Date:{fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)",margin:"0"}}),r=a.toString(),s=this.rewardStatus(this.reward),l=n.formatMessage({id:"statusMessage",defaultMessage:this.statusText},{status:s}),i="AVAILABLE"===s?"success":"REDEEMED"===s?"primary":"PENDING"===s?"warning":"danger",o=this.reward.dateCancelled||this.reward.dateExpires||this.reward.dateRedeemed||"",d=o&&`${"AVAILABLE"===s&&this.reward.dateExpires?this.expiryText+" ":""}${null===(t=w.DateTime.fromMillis(o))||void 0===t?void 0:t.setLocale(R(R(this.locale))).toLocaleString(w.DateTime.DATE_MED)}`,c="PENDING"===s?function(e){var t;const a={US_TAX:e.pendingUsTax,SCHEDULED:e.reward.dateScheduledFor&&e.pendingScheduled+" "+(null===(t=w.DateTime.fromMillis(e.reward.dateScheduledFor))||void 0===t?void 0:t.setLocale(R(R(e.locale||"en"))).toLocaleString(w.DateTime.DATE_MED)),UNHANDLED_ERROR:e.pendingUnhandled};return[e.reward.pendingReasons].map((e=>{var t;return null!==(t=a[e])&&void 0!==t?t:e})).join(", ")}(this):null;return e("div",{style:{display:"contents"}},e("style",{type:"text/css"},r),e("sl-badge",{type:i,pill:!0,class:"REDEEMED"===s?a.classes.RedeemBadge:a.classes.Badge},l),e("p",{class:a.classes.Date},c||d))}},B=class{constructor(e){t(this,e),this.columnTitle="Status",this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }",this.expiryText="Expires on ",l(this)}disconnectedCallback(){}async renderCell(t,a){return e("sqm-rewards-table-status-cell",{statusText:this.statusText,reward:null==t?void 0:t[0],expiryText:this.expiryText,locale:a})}async renderLabel(){return this.columnTitle}render(){return f([this.columnTitle]),e(a,{style:{display:"none"}})}};export{C as sqm_rewards_table,S as sqm_rewards_table_date_cell,P as sqm_rewards_table_date_column,$ as sqm_rewards_table_reward_cell,k as sqm_rewards_table_reward_column,U as sqm_rewards_table_source_cell,q as sqm_rewards_table_source_column,F as sqm_rewards_table_status_cell,B as sqm_rewards_table_status_column}
|